slice-machine-ui 1.13.0 → 1.13.1-dev-next-release.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/lib/builders/CustomTypeBuilder/SliceZone/SlicesTemplatesModal.tsx +1 -1
  2. package/lib/builders/CustomTypeBuilder/SliceZone/UpdateSliceZoneModal.tsx +1 -1
  3. package/lib/builders/CustomTypeBuilder/SliceZone/index.tsx +9 -6
  4. package/out/404.html +1 -1
  5. package/out/[lib]/[sliceName]/[variation]/screenshot.html +1 -1
  6. package/out/[lib]/[sliceName]/[variation]/simulator.html +1 -1
  7. package/out/[lib]/[sliceName]/[variation].html +1 -1
  8. package/out/_next/static/YLgeEAv5bwBJ6tgg2asgk/_buildManifest.js +1 -0
  9. package/out/_next/static/chunks/{18539003-b0b0df3d19f7d641.js → 18539003-a714ba731c9448b9.js} +22 -22
  10. package/out/_next/static/chunks/{377-53e916959dab47c4.js → 377-870ca4414847069f.js} +1 -1
  11. package/out/_next/static/chunks/{482-ad5ef8eecedd8b52.js → 482-a4c1c3721ca38516.js} +1 -1
  12. package/out/_next/static/chunks/780-643ae720f13fb3dc.js +1 -0
  13. package/out/_next/static/chunks/799-5ea3393033a9f617.js +1 -0
  14. package/out/_next/static/chunks/970-6dd3097206130d9c.js +1 -0
  15. package/out/_next/static/chunks/pages/[lib]/[sliceName]/[variation]/{simulator-2c6033d99c3672e0.js → simulator-4dcf33735c45c344.js} +1 -1
  16. package/out/_next/static/chunks/pages/[lib]/[sliceName]/{[variation]-bd1822e54ac8836c.js → [variation]-9fff494255e34c39.js} +1 -1
  17. package/out/_next/static/chunks/pages/{_app-72e68f8cbd128095.js → _app-c888f424516c0a36.js} +93 -93
  18. package/out/_next/static/chunks/pages/{changelog-dda7774c702c6b47.js → changelog-c08cc37b54d73a60.js} +1 -1
  19. package/out/_next/static/chunks/pages/{changes-7a3c37a25631d524.js → changes-6a039e823313b41c.js} +1 -1
  20. package/out/_next/static/chunks/pages/custom-types/{[customTypeId]-000131f34adb09ab.js → [customTypeId]-f8e48a51edbb5e1c.js} +1 -1
  21. package/out/_next/static/chunks/pages/page-types/{[pageTypeId]-ef69705204e4ca4e.js → [pageTypeId]-ddc8d057c3e251d1.js} +1 -1
  22. package/out/_next/static/chunks/pages/{slices-0333a80308f2058b.js → slices-24d2714462334469.js} +1 -1
  23. package/out/_next/static/css/{05ee3752aba1232a.css → 2d1eda18406a9ff4.css} +1 -1
  24. package/out/_next/static/css/6b6c11ed1fffd3e0.css +1 -0
  25. package/out/_next/static/css/{8488e84efc1f7f54.css → d6e6d21ff661397d.css} +1 -1
  26. package/out/_next/static/css/{74653a9f89a68929.css → fe2a2a1cbf3b4092.css} +1 -1
  27. package/out/blank-slate-slice-zone.png +0 -0
  28. package/out/changelog.html +1 -1
  29. package/out/changes.html +1 -1
  30. package/out/custom-types/[customTypeId].html +1 -1
  31. package/out/custom-types.html +1 -1
  32. package/out/index.html +1 -1
  33. package/out/page-types/[pageTypeId].html +1 -1
  34. package/out/slices.html +1 -1
  35. package/package.json +8 -8
  36. package/public/blank-slate-slice-zone.png +0 -0
  37. package/src/components/BlankSlate/BlankSlate.css.ts +2 -2
  38. package/src/features/customTypes/customTypesBuilder/SliceZoneBlankSlate.tsx +30 -49
  39. package/src/icons/LightningIcon3D.tsx +49 -0
  40. package/test/pages/custom-types.test.tsx +1 -2
  41. package/out/_next/static/7e5b6avcazgNMfyzSf2Je/_buildManifest.js +0 -1
  42. package/out/_next/static/chunks/677-d8555c165c261511.js +0 -1
  43. package/out/_next/static/chunks/777-a3c83f63c2609096.js +0 -1
  44. package/out/_next/static/chunks/799-2ecedfb7a28f9844.js +0 -1
  45. package/out/_next/static/css/be974b8a064b90bc.css +0 -1
  46. /package/out/_next/static/{7e5b6avcazgNMfyzSf2Je → YLgeEAv5bwBJ6tgg2asgk}/_ssgManifest.js +0 -0
@@ -1,16 +1,16 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[851],{71463:function(t,n,r){r.d(n,{kS:function(){return ecV}});var i,o,a,u,s,c=r(2784),l=r(21658),f=r(74217),d=r(86579),p=r(1611),h=r(17329),m=r(98863),g=r(77252),y=r(661),v=r(28316),b=r(52393),x=r(87322),_=r(87598),S=Object.defineProperty,T=(t,n,r)=>n in t?S(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r,w=(t,n,r)=>(T(t,"symbol"!=typeof n?n+"":n,r),r),O="u">typeof globalThis?globalThis:"u">typeof window?window:"u">typeof r.g?r.g:"u">typeof self?self:{};function k(t){if(t.__esModule)return t;var n=t.default;if("function"==typeof n){var r=function t(){if(this instanceof t){var r=[null];return r.push.apply(r,arguments),new(Function.bind.apply(n,r))}return n.apply(this,arguments)};r.prototype=n.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var I,M={},C={get exports(){return M},set exports(e){M=e}},R={};(I=C).exports=function(){if(zR)return R;zR=1;var t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function a(n,a,u){var s,c={},l=null,f=null;for(s in void 0!==u&&(l=""+u),void 0!==a.key&&(l=""+a.key),void 0!==a.ref&&(f=a.ref),a)r.call(a,s)&&!o.hasOwnProperty(s)&&(c[s]=a[s]);if(n&&n.defaultProps)for(s in a=n.defaultProps)void 0===c[s]&&(c[s]=a[s]);return{$$typeof:t,type:n,key:l,ref:f,props:c,_owner:i.current}}return R.Fragment=n,R.jsx=a,R.jsxs=a,R}();var E=function(t){return function(){return{meet:function(n,r){return function(i){return t.meet(n(i),r(i))}},join:function(n,r){return function(i){return t.join(n(i),r(i))}},zero:function(){return t.zero},one:function(){return t.one},implies:function(n,r){return function(i){return t.implies(n(i),r(i))}},not:function(n){return function(r){return t.not(n(r))}}}}},A=function(t){return function(){return{concat:function(n,r){return function(i){return t.concat(n(i),r(i))}}}}},j=function(t){var n=A(t);return function(){return{concat:n().concat,empty:function(){return t.empty}}}},N=function(t){return{add:function(n,r){return function(i){return t.add(n(i),r(i))}},zero:function(){return t.zero},mul:function(n,r){return function(i){return t.mul(n(i),r(i))}},one:function(){return t.one}}},P=function(t){var n=N(t);return{add:n.add,mul:n.mul,one:n.one,zero:n.zero,sub:function(n,r){return function(i){return t.sub(n(i),r(i))}}}},L=function(t){return function(n){return n(t)}};function F(t){return t}function D(t){return function(){return t}}var W=D(!0),U=D(!1),z=D(null),B=D(void 0);function q(t,n,r,i,o,a,u,s,c){switch(arguments.length){case 1:return t;case 2:return function(){return n(t.apply(this,arguments))};case 3:return function(){return r(n(t.apply(this,arguments)))};case 4:return function(){return i(r(n(t.apply(this,arguments))))};case 5:return function(){return o(i(r(n(t.apply(this,arguments)))))};case 6:return function(){return a(o(i(r(n(t.apply(this,arguments))))))};case 7:return function(){return u(a(o(i(r(n(t.apply(this,arguments)))))))};case 8:return function(){return s(u(a(o(i(r(n(t.apply(this,arguments))))))))};case 9:return function(){return c(s(u(a(o(i(r(n(t.apply(this,arguments)))))))))}}}function V(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t}function $(t){return t+1}function K(t){return t-1}function H(t){throw Error("Called `absurd` function which should be uncallable")}function Z(t,n,r,i,o,a,u,s,c){switch(arguments.length){case 1:return t;case 2:return n(t);case 3:return r(n(t));case 4:return i(r(n(t)));case 5:return o(i(r(n(t))));case 6:return a(o(i(r(n(t)))));case 7:return u(a(o(i(r(n(t))))));case 8:return s(u(a(o(i(r(n(t)))))));case 9:return c(s(u(a(o(i(r(n(t))))))));default:for(var l=arguments[0],f=1;f<arguments.length;f++)l=arguments[f](l);return l}}var G=function(t,n){return n},J=function(){return{concat:function(t,n){return q(t,n)},empty:F}};let Y=Object.freeze(Object.defineProperty({__proto__:null,SK:G,absurd:H,apply:L,constFalse:U,constNull:z,constTrue:W,constUndefined:B,constVoid:B,constant:D,decrement:K,flip:function(t){return function(n,r){return t(r,n)}},flow:q,getBooleanAlgebra:E,getEndomorphismMonoid:J,getMonoid:j,getRing:P,getSemigroup:A,getSemiring:N,hole:H,identity:F,increment:$,not:function(t){return function(n){return!t(n)}},pipe:Z,tuple:V,tupled:function(t){return function(n){return t.apply(void 0,n)}},unsafeCoerce:F,untupled:function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t(n)}}},Symbol.toStringTag,{value:"Module"}));var Q=function(t){return{equals:function(n,r){return n===r||t(n,r)}}},X=function(t){return Q(function(n,r){for(var i in t)if(!t[i].equals(n[i],r[i]))return!1;return!0})},ee=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Q(function(n,r){return t.every(function(t,i){return t.equals(n[i],r[i])})})},et=function(t){return function(n){return Q(function(r,i){return n.equals(t(r),t(i))})}},en={equals:function(t,n){return t===n}},er={equals:function(){return!0}},ei=function(){return{concat:function(t,n){return Q(function(r,i){return t.equals(r,i)&&n.equals(r,i)})}}},eo=function(){return{concat:ei().concat,empty:er}},ea={URI:"Eq",contramap:function(t,n){return Z(t,et(n))}},eu=en.equals;let es=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:ea,URI:"Eq",contramap:et,eq:ea,eqBoolean:en,eqDate:{equals:function(t,n){return t.valueOf()===n.valueOf()}},eqNumber:en,eqStrict:en,eqString:en,fromEquals:Q,getMonoid:eo,getSemigroup:ei,getStructEq:X,getTupleEq:ee,strictEqual:eu,struct:X,tuple:ee},Symbol.toStringTag,{value:"Module"}));function ec(t,n){return function(r){return function(i){return t.map(i,function(t){return n.map(t,r)})}}}function el(t){return function(n){return function(r){return t.map(r,function(t){return t(n)})}}}function ef(t){return function(n){return function(r){return t.map(r,function(t){var r;return(r={})[n]=t,r})}}}function ed(t,n){var r=ec(t,n);return{map:function(t,n){return Z(t,r(n))}}}let ep=Object.freeze(Object.defineProperty({__proto__:null,bindTo:ef,flap:el,getFunctorComposition:ed,map:ec},Symbol.toStringTag,{value:"Module"}));var eh=globalThis&&globalThis.__spreadArray||function(t,n,r){if(r||2===arguments.length)for(var i,o=0,a=n.length;o<a;o++)!i&&o in n||(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return t.concat(i||Array.prototype.slice.call(n))},em=function(t){return"None"===t._tag},eg=function(t){return"Some"===t._tag},ey={_tag:"None"},ev=function(t){return{_tag:"Some",value:t}},eb=function(t){return"Left"===t._tag},ex=function(t){return"Right"===t._tag},e_=function(t){return{_tag:"Left",left:t}},eS=function(t){return{_tag:"Right",right:t}},eT=function(t){return[t]},ew=function(t){return t.length>0},eO=function(t){return t[0]},ek=function(t){return t.slice(1)},eI=[],eM={},eC=Object.prototype.hasOwnProperty,eR=function(t){return eh([t[0]],t.slice(1),!0)},eE=function(t,n){return{left:t,right:n}},eA=function(t,n){return Z(t,eP(n))},ej=function(t,n,r){return Z(t,eL(n,r))},eN=function(t){return function(n){return eE(eU(n),t(ez(n)))}},eP=function(t){return function(n){return eE(t(eU(n)),ez(n))}},eL=function(t,n){return function(r){return eE(t(eU(r)),n(ez(r)))}},eF="Separated",eD={URI:eF,map:function(t,n){return Z(t,eN(n))}},eW=el(eD),eU=function(t){return t.left},ez=function(t){return t.right};let eB=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:{URI:eF,mapLeft:eA,bimap:ej},Functor:eD,URI:eF,bimap:eL,flap:eW,left:eU,map:eN,mapLeft:eP,right:ez,separated:eE},Symbol.toStringTag,{value:"Module"}));function eq(t,n){return function(r){return function(i){return t.ap(t.map(i,function(t){return function(r){return n.ap(t,r)}}),r)}}}function eV(t){return function(n){return function(r){return t.ap(t.map(r,function(t){return function(){return t}}),n)}}}function e$(t){return function(n){return function(r){return t.ap(t.map(r,function(){return function(t){return t}}),n)}}}function eK(t){return function(n,r){return function(i){return t.ap(t.map(i,function(t){return function(r){var i;return Object.assign({},t,((i={})[n]=r,i))}}),r)}}}function eH(t){return function(n){return{concat:function(r,i){return t.ap(t.map(r,function(t){return function(r){return n.concat(t,r)}}),i)}}}}function eZ(t,n,r){return function(i){for(var o=Array(r.length+1),a=0;a<r.length;a++)o[a]=r[a];return o[r.length]=i,0===n?t.apply(null,o):eZ(t,n-1,o)}}var eG={1:function(t){return[t]},2:function(t){return function(n){return[t,n]}},3:function(t){return function(n){return function(r){return[t,n,r]}}},4:function(t){return function(n){return function(r){return function(i){return[t,n,r,i]}}}},5:function(t){return function(n){return function(r){return function(i){return function(o){return[t,n,r,i,o]}}}}}};function eJ(t){return eC.call(eG,t)||(eG[t]=eZ(V,t-1,[])),eG[t]}function eY(t){var n=t.length;switch(n){case 1:return function(n){var r;return(r={})[t[0]]=n,r};case 2:return function(n){return function(r){var i;return(i={})[t[0]]=n,i[t[1]]=r,i}};case 3:return function(n){return function(r){return function(i){var o;return(o={})[t[0]]=n,o[t[1]]=r,o[t[2]]=i,o}}};case 4:return function(n){return function(r){return function(i){return function(o){var a;return(a={})[t[0]]=n,a[t[1]]=r,a[t[2]]=i,a[t[3]]=o,a}}}};case 5:return function(n){return function(r){return function(i){return function(o){return function(a){var u;return(u={})[t[0]]=n,u[t[1]]=r,u[t[2]]=i,u[t[3]]=o,u[t[4]]=a,u}}}}};default:return eZ(function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];for(var o={},a=0;a<n;a++)o[t[a]]=r[a];return o},n-1,[])}}let eQ=Object.freeze(Object.defineProperty({__proto__:null,ap:eq,apFirst:eV,apS:eK,apSecond:e$,getApplySemigroup:eH,sequenceS:function(t){return function(n){for(var r=Object.keys(n),i=r.length,o=eY(r),a=t.map(n[r[0]],o),u=1;u<i;u++)a=t.ap(a,n[r[u]]);return a}},sequenceT:function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i=n.length,o=eJ(i),a=t.map(n[0],o),u=1;u<i;u++)a=t.ap(a,n[u]);return a}}},Symbol.toStringTag,{value:"Module"}));function eX(t){return function(n){return function(r){return t.chain(r,function(r){return t.map(n(r),function(){return r})})}}}function e0(t){return function(n,r){return function(i){return t.chain(i,function(i){return t.map(r(i),function(t){var r;return Object.assign({},i,((r={})[n]=t,r))})})}}}let e1=Object.freeze(Object.defineProperty({__proto__:null,bind:e0,chainFirst:eX},Symbol.toStringTag,{value:"Module"}));var e2=function(t){return function(n,r){return n===r||0===t(n,r)}},e3=function(t){return{equals:e2(t),compare:function(n,r){return n===r?0:t(n,r)}}},e4=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e3(function(n,r){for(var i=0;i<t.length-1;i++){var o=t[i].compare(n[i],r[i]);if(0!==o)return o}return t[i].compare(n[i],r[i])})},e5=function(t){return e3(function(n,r){return t.compare(r,n)})},e6=function(t){return function(n){return e3(function(r,i){return n.compare(t(r),t(i))})}},e9=function(){return{concat:function(t,n){return e3(function(r,i){var o=t.compare(r,i);return 0!==o?o:n.compare(r,i)})}}},e8=function(){return{concat:e9().concat,empty:e3(function(){return 0})}},e7={URI:"Ord",contramap:function(t,n){return Z(t,e6(n))}},te={equals:W,compare:D(0)},tt=function(t){return function(n){return function(r){return r===n||0===t.compare(r,n)}}},tn=function(t){return function(n,r){return -1===t.compare(n,r)}},tr=function(t){return function(n,r){return 1===t.compare(n,r)}},ti=function(t){return function(n,r){return 1!==t.compare(n,r)}},to=function(t){return function(n,r){return -1!==t.compare(n,r)}},ta=function(t){return function(n,r){return n===r||1>t.compare(n,r)?n:r}},tu=function(t){return function(n,r){return n===r||t.compare(n,r)>-1?n:r}},ts=function(t){var n=ta(t),r=tu(t);return function(t,i){return function(o){return r(n(o,i),t)}}},tc=function(t){var n=tn(t),r=tr(t);return function(t,i){return function(o){return!(n(o,t)||r(o,i))}}},tl={equals:en.equals,compare:function(t,n){return t<n?-1:t>n?1:0}},tf=Z(tl,e6(function(t){return t.valueOf()}));let td=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:e7,URI:"Ord",between:tc,clamp:ts,contramap:e6,equals:tt,equalsDefault:e2,fromCompare:e3,geq:to,getDualOrd:e5,getMonoid:e8,getSemigroup:e9,getTupleOrd:e4,gt:tr,leq:ti,lt:tn,max:tu,min:ta,ord:e7,ordBoolean:tl,ordDate:tf,ordNumber:tl,ordString:tl,reverse:e5,trivial:te,tuple:e4},Symbol.toStringTag,{value:"Module"}));var tp=function(t){return{concat:function(n,r){return t.concat(r,n)}}},th=function(t){return function(n){return{concat:function(r,i){return t(r)?n.concat(r,i):i}}}},tm=function(t){return function(n){return{concat:function(r,i){return t(i)?n.concat(r,i):r}}}},tg=function(t){return function(n){return{concat:function(r,i){return n.concat(t(r),t(i))}}}},ty=function(t){return function(n){return function(r){return r.reduce(function(n,r){return t.concat(n,r)},n)}}};let tv=Object.freeze(Object.defineProperty({__proto__:null,concatAll:ty,endo:tg,filterFirst:th,filterSecond:tm,reverse:tp},Symbol.toStringTag,{value:"Module"}));var tb=function(t){return{concat:ta(t)}},tx=function(t){return{concat:tu(t)}},t_=function(t){return{concat:function(){return t}}},tS=function(t){return{concat:function(n,r){var i={};for(var o in t)eC.call(t,o)&&(i[o]=t[o].concat(n[o],r[o]));return i}}},tT=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return{concat:function(n,r){return t.map(function(t,i){return t.concat(n[i],r[i])})}}},tw=function(t){return function(n){return{concat:function(r,i){return n.concat(r,n.concat(t,i))}}}},tO=function(){return{concat:F}},tk=function(){return{concat:function(t,n){return n}}},tI=t_(void 0),tM=function(){return{concat:function(t,n){return Object.assign({},t,n)}}},tC={concat:function(t,n){return t&&n}},tR={concat:function(t,n){return t||n}},tE={concat:function(t,n){return t+n}},tA={concat:function(t,n){return t+n}},tj={concat:function(t,n){return t*n}};let tN=Object.freeze(Object.defineProperty({__proto__:null,concatAll:ty,constant:t_,first:tO,fold:function(t){var n=ty(t);return function(t,r){return void 0===r?n(t):n(t)(r)}},getDualSemigroup:tp,getFirstSemigroup:tO,getFunctionSemigroup:A,getIntercalateSemigroup:tw,getJoinSemigroup:tx,getLastSemigroup:tk,getMeetSemigroup:tb,getObjectSemigroup:tM,getStructSemigroup:tS,getTupleSemigroup:tT,intercalate:tw,last:tk,max:tx,min:tb,reverse:tp,semigroupAll:tC,semigroupAny:tR,semigroupProduct:tj,semigroupString:tE,semigroupSum:tA,semigroupVoid:tI,struct:tS,tuple:tT},Symbol.toStringTag,{value:"Module"}));var tP=globalThis&&globalThis.__spreadArray||function(t,n,r){if(r||2===arguments.length)for(var i,o=0,a=n.length;o<a;o++)!i&&o in n||(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return t.concat(i||Array.prototype.slice.call(n))},tL=function(t,n){return t<0||t>=n.length},tF=function(t){return function(n){return tP([t],n,!0)}},tD=function(t){return function(n){return tP(tP([],n,!0),[t],!1)}},tW=function(t,n,r){if(ew(r)){var i=eR(r);return i.splice(t,0,n),i}return[n]},tU=function(t,n,r){if(r[t]===n)return r;var i=eR(r);return i[t]=n,i},tz=function(t){return function(n){if(1===n.length)return n;for(var r=[nQ(n)],i=nX(n),o=function(n){r.every(function(r){return!t.equals(r,n)})&&r.push(n)},a=0;a<i.length;a++)o(i[a]);return r}},tB=function(t){if(ew(t)){var n=e8();return t3(t.reduce(n.concat,n.empty))}return F},tq=function(t){var n=tz(t);return function(t){return function(r){return n(Z(r,tX(t)))}}},tV=function(t){return function(n){var r=n.length,i=Math.round(t)%r;if(tL(Math.abs(i),n)||0===i)return n;if(!(i<0))return tV(i-r)(n);var o=nn(-i)(n),a=o[0];return Z(o[1],tX(a))}},t$=function(t){return ew(t)?ev(t):ey},tK=function(t){return function(n){for(var r=Math.max(0,Math.floor(n)),i=[t(0)],o=1;o<r;o++)i.push(t(o));return i}},tH=function(t){return tK(function(){return t})},tZ=function(t,n){return t<=n?tK(function(n){return t+n})(n-t+1):[t]},tG=function(t){return[nQ(t),nX(t)]},tJ=function(t){return[n1(t),n0(t)]},tY=function(t){return t$(t.slice())};function tQ(t){return function(n){return n.concat(t)}}function tX(t,n){return n?t.concat(n):function(n){return n.concat(t)}}var t0=function(t){return 1===t.length?t:tP([n0(t)],t.slice(0,-1).reverse(),!0)};function t1(t){return function(n){var r=n.length;if(0===r)return eI;for(var i=[],o=n[0],a=[o],u=1;u<r;u++){var s=n[u];t.equals(s,o)?a.push(s):(i.push(a),a=[o=s])}return i.push(a),i}}var t2=function(t){return function(n){for(var r={},i=0;i<n.length;i++){var o=n[i],a=t(o);eC.call(r,a)?r[a].push(o):r[a]=[o]}return r}},t3=function(t){return function(n){return 1===n.length?n:n.slice().sort(t.compare)}},t4=function(t,n){return t5(t,function(){return n})},t5=function(t,n){return function(r){return tL(t,r)?ey:ev(tU(t,n(r[t]),r))}},t6=function(t,n,r){for(var i=[r(t[0],n[0])],o=Math.min(t.length,n.length),a=1;a<o;a++)i[a]=r(t[a],n[a]);return i},t9=function(t){for(var n=[t[0][0]],r=[t[0][1]],i=1;i<t.length;i++)n[i]=t[i][0],r[i]=t[i][1];return[n,r]},t8=function(t){return function(n){for(var r=[t,n[0]],i=1;i<n.length;i++)r.push(t,n[i]);return r}},t7=function(t){return function(n){var r=nX(n);return ew(r)?Z(r,t8(t),tF(nQ(n))):n}},ne=function(t){return function(n){for(var r=eR(t(0,nQ(n))),i=1;i<n.length;i++)r.push.apply(r,t(i,n[i]));return r}},nt=function(t){return function(n){for(var r=t(n),i=r[0],o=r[1],a=[i],u=o;ew(u);){var s=t(u),c=s[0],l=s[1];a.push(c),u=l}return a}},nn=function(t){return function(n){var r=Math.max(1,t);return r>=n.length?[n,eI]:[Z(n.slice(1,r),tF(nQ(n))),n.slice(r)]}},nr=function(t){return nt(nn(t))},ni=function(t,n){return Z(t,nO(n))},no=function(t,n){return Z(t,nk(n))},na=function(t,n){return Z(t,nx(n))},nu=function(t,n){return Z(t,n_(n))},ns=function(t,n){return Z(t,nS(n))},nc=function(t,n,r){return Z(t,nI(n,r))},nl=function(t){var n=nM(t);return function(t,r){return Z(t,n(r))}},nf=function(t,n,r){return Z(t,nC(n,r))},nd=function(t){var n=nj(t);return function(t,r){return Z(t,n(r))}},np=function(t,n){return Z(t,nb(n))},nh=function(t,n,r){return Z(t,nR(n,r))},nm=function(t){var n=nE(t);return function(t,r){return Z(t,n(r))}},ng=function(t,n,r){return Z(t,nA(n,r))},ny=function(t){var n=nP(t);return function(t,r){return Z(t,n(r))}},nv=function(t){return function(n){return Z(n,tQ(t()))}},nb=nv,nx=function(t){return n_(function(n){return Z(t,nO(n))})},n_=function(t){return ne(function(n,r){return t(r)})},nS=function(t){return function(n){for(var r=nX(n),i=[t(n)];ew(r);)i.push(t(r)),r=nX(r);return i}},nT=nS(F),nw=n_(F),nO=function(t){return nk(function(n,r){return t(r)})},nk=function(t){return function(n){for(var r=[t(0,nQ(n))],i=1;i<n.length;i++)r.push(t(i,n[i]));return r}},nI=function(t,n){return nR(t,function(t,r,i){return n(r,i)})},nM=function(t){return function(n){return function(r){return r.slice(1).reduce(function(r,i){return t.concat(r,n(i))},n(r[0]))}}},nC=function(t,n){return nA(t,function(t,r,i){return n(r,i)})},nR=function(t,n){return function(r){return r.reduce(function(t,r,i){return n(i,t,r)},t)}},nE=function(t){return function(n){return function(r){return r.slice(1).reduce(function(r,i,o){return t.concat(r,n(o+1,i))},n(0,r[0]))}}},nA=function(t,n){return function(r){return r.reduceRight(function(t,r,i){return n(i,r,t)},t)}},nj=function(t){var n=nP(t);return function(t){return n(function(n,r){return t(r)})}},nN=function(t){return nP(t)(G)},nP=function(t){return function(n){return function(r){for(var i=t.map(n(0,nQ(r)),eT),o=1;o<r.length;o++)i=t.ap(t.map(i,function(t){return function(n){return Z(t,tD(n))}}),n(o,r[o]));return i}}},nL="ReadonlyNonEmptyArray",nF=function(t){return{show:function(n){return"[".concat(n.map(t.show).join(", "),"]")}}},nD=function(){return{concat:tX}},nW=function(t){return Q(function(n,r){return n.length===r.length&&n.every(function(n,i){return t.equals(n,r[i])})})},nU=function(t){var n=tq(t);return{concat:function(t,r){return n(r)(t)}}},nz={URI:nL,map:ni},nB=el(nz),nq={URI:nL,map:ni,ap:na},nV=eV(nq),n$=e$(nq),nK={URI:nL,map:ni,ap:na,chain:nu},nH=eX(nK),nZ=eT(eM),nG=ef(nz),nJ=e0(nK),nY=eK(nq),nQ=eO,nX=ek,n0=function(t){return t[t.length-1]},n1=function(t){return t.slice(0,-1)},n2=function(t){var n=tb(t);return function(t){return t.reduce(n.concat)}},n3=function(t){var n=tx(t);return function(t){return t.reduce(n.concat)}},n4=function(t){return function(n){return n.reduce(t.concat)}},n5=function(t){return function(n){return t(nQ(n),nX(n))}},n6=function(t){return function(n){return t(n1(n),n0(n))}},n9=function(t){return function(n){return tP([t(nQ(n))],nX(n),!0)}},n8=function(t){return n9(function(){return t})},n7=function(t){return function(n){return Z(n1(n),tD(t(n0(n))))}},re=function(t){return n7(function(){return t})},rt=function(t){var n=n4(t);return function(t){return q(t7(t),n)}},rn=function(t){return function(n){return t$(n.filter(function(n,r){return t(r,n)}))}};function rr(t,n){return void 0===n?tF(t):Z(n,tF(t))}var ri=function(t,n){return Z(t,tX([n]))},ro=function(t,n){return function(r){return t<0||t>r.length?ey:ev(tW(t,n,r))}};let ra=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:nL,map:ni,alt:np},Applicative:{URI:nL,map:ni,ap:na,of:eT},Apply:nq,Chain:nK,Comonad:{URI:nL,map:ni,extend:ns,extract:eO},Do:nZ,Foldable:{URI:nL,reduce:nc,foldMap:nl,reduceRight:nf},FoldableWithIndex:{URI:nL,reduce:nc,foldMap:nl,reduceRight:nf,reduceWithIndex:nh,foldMapWithIndex:nm,reduceRightWithIndex:ng},Functor:nz,FunctorWithIndex:{URI:nL,map:ni,mapWithIndex:no},Monad:{URI:nL,map:ni,ap:na,of:eT,chain:nu},Pointed:{URI:nL,of:eT},Traversable:{URI:nL,map:ni,reduce:nc,foldMap:nl,reduceRight:nf,traverse:nd,sequence:nN},TraversableWithIndex:{URI:nL,map:ni,mapWithIndex:no,reduce:nc,foldMap:nl,reduceRight:nf,traverse:nd,sequence:nN,reduceWithIndex:nh,foldMapWithIndex:nm,reduceRightWithIndex:ng,traverseWithIndex:ny},URI:nL,alt:nb,altW:nv,ap:nx,apFirst:nV,apS:nY,apSecond:n$,append:tD,appendW:tD,bind:nJ,bindTo:nG,chain:n_,chainFirst:nH,chainWithIndex:ne,chop:nt,chunksOf:nr,concat:tX,concatAll:n4,concatW:tQ,cons:rr,duplicate:nT,empty:eI,extend:nS,extract:eO,filter:function(t){return rn(function(n,r){return t(r)})},filterWithIndex:rn,flap:nB,flatten:nw,fold:n4,foldMap:nM,foldMapWithIndex:nE,fromArray:tY,fromReadonlyArray:t$,getEq:nW,getSemigroup:nD,getShow:nF,getUnionSemigroup:nU,group:t1,groupBy:t2,groupSort:function(t){var n=t3(t),r=t1(t);return function(t){return ew(t)?r(n(t)):eI}},head:nQ,init:n1,insertAt:ro,intercalate:rt,intersperse:t7,isNonEmpty:ew,isOutOfBound:tL,last:n0,makeBy:tK,map:nO,mapWithIndex:nk,matchLeft:n5,matchRight:n6,max:n3,min:n2,modifyAt:t5,modifyHead:n9,modifyLast:n7,of:eT,prepend:tF,prependAll:t8,prependToAll:t8,prependW:tF,range:tZ,readonlyNonEmptyArray:{URI:nL,of:eT,map:ni,mapWithIndex:no,ap:na,chain:nu,extend:ns,extract:eO,reduce:nc,foldMap:nl,reduceRight:nf,traverse:nd,sequence:nN,reduceWithIndex:nh,foldMapWithIndex:nm,reduceRightWithIndex:ng,traverseWithIndex:ny,alt:np},reduce:nI,reduceRight:nC,reduceRightWithIndex:nA,reduceWithIndex:nR,replicate:tH,reverse:t0,rotate:tV,sequence:nN,snoc:ri,sort:t3,sortBy:tB,splitAt:nn,tail:nX,traverse:nj,traverseWithIndex:nP,unappend:tJ,uncons:tG,union:tq,uniq:tz,unprepend:tG,unsafeInsertAt:tW,unsafeUpdateAt:tU,unsnoc:tJ,unzip:t9,updateAt:t4,updateHead:n8,updateLast:re,zip:function t(n,r){return void 0===r?function(r){return t(r,n)}:t6(n,r,function(t,n){return[t,n]})},zipWith:t6},Symbol.toStringTag,{value:"Module"}));var ru={equals:function(t,n){return t===n}},rs={concat:function(t,n){return t+n}},rc={concat:rs.concat,empty:""},rl={equals:ru.equals,compare:function(t,n){return t<n?-1:t>n?1:0}},rf=function(t){return"string"==typeof t},rd=function(t){return t.toUpperCase()},rp=function(t){return t.toLowerCase()},rh=function(t,n){return function(r){return r.replace(t,n)}},rm=function(t){return t.trim()},rg=function(t){return t.trimLeft()},ry=function(t){return t.trimRight()},rv=function(t,n){return function(r){return r.slice(t,n)}},rb=function(t){return 0===t.length},rx=function(t){return t.length},r_=function(t){return function(n){var r=n.split(t);return ew(r)?r:[n]}},rS=function(t,n){return function(r){return r.includes(t,n)}},rT=function(t,n){return function(r){return r.startsWith(t,n)}},rw=function(t,n){return function(r){return r.endsWith(t,n)}};let rO=Object.freeze(Object.defineProperty({__proto__:null,Eq:ru,Monoid:rc,Ord:rl,Semigroup:rs,Show:{show:function(t){return JSON.stringify(t)}},empty:"",endsWith:rw,includes:rS,isEmpty:rb,isString:rf,replace:rh,size:rx,slice:rv,split:r_,startsWith:rT,toLowerCase:rp,toUpperCase:rd,trim:rm,trimLeft:rg,trimRight:ry},Symbol.toStringTag,{value:"Module"}));function rk(t,n){return function(r){var i=t.traverse(r);return function(t,o){return r.map(i(t,o),n.separate)}}}function rI(t,n){return function(r){var i=t.traverse(r);return function(t,o){return r.map(i(t,o),n.compact)}}}function rM(t){return function(n){var r=t.wither(n);return function(t){return function(i){return r(i,function(r){return n.map(t(r),function(t){return t?ev(r):ey})})}}}}let rC=Object.freeze(Object.defineProperty({__proto__:null,filterE:rM,wiltDefault:rk,witherDefault:rI},Symbol.toStringTag,{value:"Module"}));var rR=function(t){return Object.assign({},t)},rE=function(t){return Object.assign({},t)},rA=function(t){return Object.keys(t).length},rj=function(t){for(var n in t)if(eC.call(t,n))return!1;return!0},rN=function(t){return function(n){return Object.keys(n).sort(t.compare)}},rP=rN(rl);function rL(t){if("function"==typeof t)return rL(rl)(t);var n=rN(t);return function(t){return function(r){for(var i=[],o=0,a=n(r);o<a.length;o++){var u=a[o];i.push(t(u,r[u]))}return i}}}var rF=rL(rl)(function(t,n){return[t,n]}),rD=function(t,n){return function(r){if(eC.call(r,t)&&r[t]===n)return r;var i=Object.assign({},r);return i[t]=n,i}},rW=function(t,n){return eC.call(n,t)};function rU(t){return function(n){if(!eC.call(n,t))return n;var r=Object.assign({},n);return delete r[t],r}}var rz=function(t,n){return function(r){if(!rW(t,r))return ey;if(r[t]===n)return ev(r);var i=Object.assign({},r);return i[t]=n,ev(i)}},rB=function(t,n){return function(r){if(!rW(t,r))return ey;var i=n(r[t]);if(i===r[t])return ev(r);var o=Object.assign({},r);return o[t]=i,ev(o)}};function rq(t){return function(n,r){if(void 0===r){var i=rq(t);return function(t){return i(t,n)}}for(var o in n)if(!eC.call(r,o)||!t.equals(n[o],r[o]))return!1;return!0}}function rV(t,n){return void 0===n?function(n){return rV(t,n)}:eC.call(n,t)?ev(n[t]):ey}var r$={};function rK(t){return function(n){var r={};for(var i in n)eC.call(n,i)&&(r[i]=t(i,n[i]));return r}}function rH(t){return rK(function(n,r){return t(r)})}function rZ(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(2===t.length)return rZ(rl).apply(void 0,t);var r=rN(t[0]);return function(t,n){return function(i){for(var o=t,a=r(i),u=a.length,s=0;s<u;s++){var c=a[s];o=n(c,o,i[c])}return o}}}function rG(t){if("compare"in t){var n=rN(t);return function(t){return function(r){return function(i){for(var o=t.empty,a=n(i),u=a.length,s=0;s<u;s++){var c=a[s];o=t.concat(o,r(c,i[c]))}return o}}}}return rG(rl)(t)}function rJ(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(2===t.length)return rJ(rl).apply(void 0,t);var r=rN(t[0]);return function(t,n){return function(i){for(var o=t,a=r(i),u=a.length,s=u-1;s>=0;s--){var c=a[s];o=n(c,i[c],o)}return o}}}var rY=function(t,n){var r;return(r={})[t]=n,r};function rQ(t){var n=ik(rl)(t);return function(t){return function(r){return n(r,t)}}}function rX(t){var n=iw(rl)(t);return function(t){return function(r){return n(r,t)}}}function r0(t){return iO(rl)(t)}var r1=function(t){var n=rX(t);return function(r){return function(i){return t.map(Z(i,n(r)),iN)}}},r2=function(t){var n=rX(t);return function(r){return function(i){return t.map(Z(i,n(r)),iP)}}};function r3(t){return function(n){var r={},i={};for(var o in n)if(eC.call(n,o)){var a=t(o,n[o]);switch(a._tag){case"Left":r[o]=a.left;break;case"Right":i[o]=a.right}}return eE(r,i)}}function r4(t){return function(n){var r={},i={};for(var o in n)if(eC.call(n,o)){var a=n[o];t(o,a)?i[o]=a:r[o]=a}return eE(r,i)}}function r5(t){return function(n){var r={};for(var i in n)if(eC.call(n,i)){var o=t(i,n[i]);eg(o)&&(r[i]=o.value)}return r}}function r6(t){return function(n){var r={},i=!1;for(var o in n)if(eC.call(n,o)){var a=n[o];t(o,a)?r[o]=a:i=!0}return i?r:n}}function r9(t,n){var r=r8(t,n);return function(t){return r(t,F)}}function r8(t,n){return function(r,i){return n.reduce(r,{},function(n,r){var o=i(r),a=o[0],u=o[1];return n[a]=eC.call(n,a)?t.concat(n[a],u):u,n})}}var r7=function(t){for(var n={},r=0;r<t.length;r++){var i=t[r];n[i[0]]=i[1]}return n};function ie(t){return function(n){for(var r in n)if(!t(n[r]))return!1;return!0}}function it(t){return function(n){for(var r in n)if(t(n[r]))return!0;return!1}}function ir(t){return function(n,r){if(void 0===r){var i=ir(t);return function(t){return i(n,t)}}for(var o in r)if(t.equals(r[o],n))return!0;return!1}}var ii=function(t){return function(n){return function(r){if(rj(r))return n;if(rj(n))return r;var i={};for(var o in r)rW(o,n)?i[o]=t.concat(r[o],n[o]):i[o]=r[o];for(var o in n)rW(o,i)||(i[o]=n[o]);return i}}},io=function(t){return function(n){return function(r){if(rj(r)||rj(n))return r$;var i={};for(var o in r)rW(o,n)&&(i[o]=t.concat(r[o],n[o]));return i}}},ia=function(t){return function(n){if(rj(n))return t;if(rj(t))return n;var r={};for(var i in n)rW(i,t)||(r[i]=n[i]);for(var i in t)rW(i,n)||(r[i]=t[i]);return r}},iu=function(t,n){return Z(t,rH(n))},is=function(t,n){return Z(t,rK(n))},ic=function(t){var n=iE(t);return function(t,r,i){return Z(t,n(r,i))}},il=function(t){return function(n){var r=iA(t)(n);return function(t,n){return Z(t,r(n))}}},id=function(t){var n=ij(t);return function(t,r,i){return Z(t,n(r,i))}},ip=function(t,n){return Z(t,iI(n))},ih=function(t,n){return Z(t,iM(n))},im=function(t,n){return Z(t,iC(n))},ig=function(t,n){return Z(t,iR(n))},iy=function(t){var n=rZ(t);return function(t,r,i){return Z(t,n(r,i))}},iv=function(t){var n=rG(t);return function(t){var r=n(t);return function(t,n){return Z(t,r(n))}}},ib=function(t){var n=rJ(t);return function(t,r,i){return Z(t,n(r,i))}},ix=function(t,n){return Z(t,r3(n))},i_=function(t,n){return Z(t,r4(n))},iS=function(t,n){return Z(t,r5(n))},iT=function(t,n){return Z(t,r6(n))},iw=function(t){var n=ik(t);return function(t){var r=n(t);return function(t,n){return r(t,q(G,n))}}},iO=function(t){var n=iw(t);return function(t){var r=n(t);return function(t){return r(t,F)}}},ik=function(t){return function(n){var r=rN(t);return function(t,i){var o=r(t);if(0===o.length)return n.of(r$);for(var a=n.of({}),u=function(r){a=n.ap(n.map(a,function(t){return function(n){var i;return Object.assign({},t,((i={})[r]=n,i))}}),i(r,t[r]))},s=0;s<o.length;s++)u(o[s]);return a}}},iI=function(t){return r6(function(n,r){return t(r)})},iM=function(t){return r5(function(n,r){return t(r)})},iC=function(t){return r4(function(n,r){return t(r)})},iR=function(t){return r3(function(n,r){return t(r)})};function iE(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(1===t.length){var r=rZ(t[0]);return function(t,n){return r(t,function(t,r,i){return n(r,i)})}}return iE(rl).apply(void 0,t)}function iA(t){if("compare"in t){var n=rG(t);return function(t){var r=n(t);return function(t){return r(function(n,r){return t(r)})}}}return iA(rl)(t)}function ij(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(1===t.length){var r=rJ(t[0]);return function(t,n){return r(t,function(t,r,i){return n(r,i)})}}return ij(rl).apply(void 0,t)}var iN=function(t){var n={};for(var r in t)if(eC.call(t,r)){var i=t[r];eg(i)&&(n[r]=i.value)}return n},iP=function(t){var n={},r={};for(var i in t)if(eC.call(t,i)){var o=t[i];eb(o)?n[i]=o.left:r[i]=o.right}return eE(n,r)},iL="ReadonlyRecord";function iF(t){return"compare"in t?function(n){return{show:function(r){var i=rL(t)(function(t,r){return"".concat(JSON.stringify(t),": ").concat(n.show(r))})(r).join(", ");return""===i?"{}":"{ ".concat(i," }")}}}:iF(rl)(t)}function iD(t){var n=rq(t);return Q(function(t,r){return n(t)(r)&&n(r)(t)})}function iW(t){return{concat:function(n,r){if(rj(n))return r;if(rj(r))return n;var i=Object.assign({},n);for(var o in r)eC.call(r,o)&&(i[o]=eC.call(n,o)?t.concat(n[o],r[o]):r[o]);return i},empty:r$}}var iU={URI:iL,map:iu},iz=el(iU),iB=function(t){return{URI:iL,reduce:ic(t),foldMap:il(t),reduceRight:id(t)}},iq=function(t){return{URI:iL,reduce:ic(t),foldMap:il(t),reduceRight:id(t),reduceWithIndex:iy(t),foldMapWithIndex:iv(t),reduceRightWithIndex:ib(t)}},iV={URI:iL,compact:iN,separate:iP},i$=function(t){return{URI:iL,map:iu,reduce:ic(t),foldMap:il(t),reduceRight:id(t),traverse:iw(t),sequence:iO(t)}},iK=function(t){return{URI:iL,map:iu,mapWithIndex:is,reduce:ic(t),foldMap:il(t),reduceRight:id(t),reduceWithIndex:iy(t),foldMapWithIndex:iv(t),reduceRightWithIndex:ib(t),traverse:iw(t),sequence:iO(t),traverseWithIndex:ik(t)}},iH=function(t){var n=i$(t);return{URI:iL,map:iu,reduce:ic(t),foldMap:il(t),reduceRight:id(t),traverse:n.traverse,sequence:n.sequence,compact:iN,separate:iP,filter:ip,filterMap:ih,partition:im,partitionMap:ig,wither:rI(n,iV),wilt:rk(n,iV)}},iZ=function(t){var n=ii(t);return{concat:function(t,r){return n(r)(t)}}},iG=function(t){return{concat:iZ(t).concat,empty:r$}},iJ=function(t){var n=io(t);return{concat:function(t,r){return n(r)(t)}}},iY=function(){return{concat:function(t,n){return ia(n)(t)}}},iQ={URI:iL,reduce:ic(rl),foldMap:il(rl),reduceRight:id(rl)},iX={URI:iL,reduce:ic(rl),foldMap:il(rl),reduceRight:id(rl),reduceWithIndex:iy(rl),foldMapWithIndex:iv(rl),reduceRightWithIndex:ib(rl)},i0={URI:iL,map:iu,reduce:ic(rl),foldMap:il(rl),reduceRight:id(rl),traverse:iw(rl),sequence:r0},i1={URI:iL,map:iu,mapWithIndex:is,reduce:ic(rl),foldMap:il(rl),reduceRight:id(rl),reduceWithIndex:iy(rl),foldMapWithIndex:iv(rl),reduceRightWithIndex:ib(rl),traverse:iw(rl),sequence:r0,traverseWithIndex:ik(rl)},i2=rI(i0,iV),i3=rk(i0,iV),i4={URI:iL,map:iu,reduce:ic(rl),foldMap:il(rl),reduceRight:id(rl),traverse:iw(rl),sequence:r0,compact:iN,separate:iP,filter:ip,filterMap:ih,partition:im,partitionMap:ig,wither:i2,wilt:i3};function i5(t,n){return eC.call(void 0===n?this:n,t)}var i6={URI:iL,map:iu,reduce:ic(rl),foldMap:il(rl),reduceRight:id(rl),traverse:iw(rl),sequence:r0,compact:iN,separate:iP,filter:ip,filterMap:ih,partition:im,partitionMap:ig,mapWithIndex:is,reduceWithIndex:iy(rl),foldMapWithIndex:iv(rl),reduceRightWithIndex:ib(rl),filterMapWithIndex:iS,filterWithIndex:iT,partitionMapWithIndex:ix,partitionWithIndex:i_,traverseWithIndex:ik(rl),wither:i2,wilt:i3};let i9=Object.freeze(Object.defineProperty({__proto__:null,Compactable:iV,Filterable:{URI:iL,map:iu,compact:iN,separate:iP,filter:ip,filterMap:ih,partition:im,partitionMap:ig},FilterableWithIndex:{URI:iL,map:iu,mapWithIndex:is,compact:iN,separate:iP,filter:ip,filterMap:ih,partition:im,partitionMap:ig,filterMapWithIndex:iS,filterWithIndex:iT,partitionMapWithIndex:ix,partitionWithIndex:i_},Foldable:iQ,FoldableWithIndex:iX,Functor:iU,FunctorWithIndex:{URI:iL,map:iu,mapWithIndex:is},Traversable:i0,TraversableWithIndex:i1,URI:iL,Witherable:i4,_filter:ip,_filterMap:ih,_filterMapWithIndex:iS,_filterWithIndex:iT,_foldMap:il,_foldMapWithIndex:iv,_map:iu,_mapWithIndex:is,_partition:im,_partitionMap:ig,_partitionMapWithIndex:ix,_partitionWithIndex:i_,_reduce:ic,_reduceRight:id,_reduceRightWithIndex:ib,_reduceWithIndex:iy,_sequence:iO,_traverse:iw,collect:rL,compact:iN,deleteAt:rU,difference:ia,elem:ir,empty:r$,every:ie,filter:iI,filterMap:iM,filterMapWithIndex:r5,filterWithIndex:r6,flap:iz,foldMap:iA,foldMapWithIndex:rG,fromEntries:r7,fromFoldable:r9,fromFoldableMap:r8,fromRecord:rR,getDifferenceMagma:iY,getEq:iD,getFoldable:iB,getFoldableWithIndex:iq,getIntersectionSemigroup:iJ,getMonoid:iW,getShow:iF,getTraversable:i$,getTraversableWithIndex:iK,getUnionMonoid:iG,getUnionSemigroup:iZ,getWitherable:iH,has:rW,hasOwnProperty:i5,insertAt:rD,intersection:io,isEmpty:rj,isSubrecord:rq,keys:rP,lookup:rV,map:rH,mapWithIndex:rK,modifyAt:rB,partition:iC,partitionMap:iR,partitionMapWithIndex:r3,partitionWithIndex:r4,pop:function(t){var n=rU(t);return function(r){var i=rV(t,r);return em(i)?ey:ev([i.value,n(r)])}},readonlyRecord:i6,reduce:iE,reduceRight:ij,reduceRightWithIndex:rJ,reduceWithIndex:rZ,separate:iP,sequence:r0,singleton:rY,size:rA,some:it,toEntries:rF,toReadonlyArray:rF,toRecord:rE,toUnfoldable:function(t){return function(n){var r=rF(n),i=r.length;return t.unfold(0,function(t){return t<i?ev([r[t],t+1]):ey})}},traverse:rX,traverseWithIndex:rQ,union:ii,updateAt:rz,upsertAt:rD,wilt:r2,wither:r1},Symbol.toStringTag,{value:"Module"})),i8=(0,c.createContext)(void 0);function i7(){let t=(0,c.useContext)(i8);if(!t)throw Error("Missing EditorConfigContext.Provider");return t}class oe extends Error{}function ot(t){throw new oe(`Missing EditorConfig.${t}`)}var on,or,oi,oo,oa,ou,oc,ol,of,od,op,oh,om,og,oy,ov,ob,ox,o_,oS,oT,ow,oO,ok,oI,oM,oC,oR,oE,oA,oj={},oN={};on={get exports(){return oN},set exports(e){oN=e}},function(t){var n="object"==typeof O?O:"object"==typeof self?self:"object"==typeof this?this:{};function r(t,r){return t!==n&&("function"==typeof Object.create?Object.defineProperty(t,"__esModule",{value:!0}):t.__esModule=!0),function(n,i){return t[n]=r?r(n,i):i}}t(r(n,r(on.exports)))}(function(t){var n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])};or=function(t,r){if("function"!=typeof r&&null!==r)throw TypeError("Class extends value "+String(r)+" is not a constructor or null");function i(){this.constructor=t}n(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)},oi=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t},oo=function(t,n){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&0>n.indexOf(i)&&(r[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,i=Object.getOwnPropertySymbols(t);o<i.length;o++)0>n.indexOf(i[o])&&Object.prototype.propertyIsEnumerable.call(t,i[o])&&(r[i[o]]=t[i[o]]);return r},oa=function(t,n,r,i){var o,a=arguments.length,u=a<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)u=Reflect.decorate(t,n,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(u=(a<3?o(u):a>3?o(n,r,u):o(n,r))||u);return a>3&&u&&Object.defineProperty(n,r,u),u},ou=function(t,n){return function(r,i){n(r,i,t)}},oc=function(t,n,r,i,o,a){function u(t){if(void 0!==t&&"function"!=typeof t)throw TypeError("Function expected");return t}for(var s,c=i.kind,l="getter"===c?"get":"setter"===c?"set":"value",f=!n&&t?i.static?t:t.prototype:null,d=n||(f?Object.getOwnPropertyDescriptor(f,i.name):{}),p=!1,h=r.length-1;h>=0;h--){var m={};for(var g in i)m[g]="access"===g?{}:i[g];for(var g in i.access)m.access[g]=i.access[g];m.addInitializer=function(t){if(p)throw TypeError("Cannot add initializers after decoration has completed");a.push(u(t||null))};var y=(0,r[h])("accessor"===c?{get:d.get,set:d.set}:d[l],m);if("accessor"===c){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw TypeError("Object expected");(s=u(y.get))&&(d.get=s),(s=u(y.set))&&(d.set=s),(s=u(y.init))&&o.push(s)}else(s=u(y))&&("field"===c?o.push(s):d[l]=s)}f&&Object.defineProperty(f,i.name,d),p=!0},ol=function(t,n,r){for(var i=arguments.length>2,o=0;o<n.length;o++)r=i?n[o].call(t,r):n[o].call(t);return i?r:void 0},of=function(t){return"symbol"==typeof t?t:"".concat(t)},od=function(t,n,r){return"symbol"==typeof n&&(n=n.description?"[".concat(n.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",n):n})},op=function(t,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,n)},oh=function(t,n,r,i){return new(r||(r=Promise))(function(o,a){function u(t){try{c(i.next(t))}catch(n){a(n)}}function s(t){try{c(i.throw(t))}catch(n){a(n)}}function c(t){var n;t.done?o(t.value):((n=t.value)instanceof r?n:new r(function(t){t(n)})).then(u,s)}c((i=i.apply(t,n||[])).next())})},om=function(t,n){var r,i,o,a,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(u=0)),u;)try{if(r=1,i&&(o=2&s[0]?i.return:s[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;switch(i=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,i=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){u=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){u.label=s[1];break}if(6===s[0]&&u.label<o[1]){u.label=o[1],o=s;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(s);break}o[2]&&u.ops.pop(),u.trys.pop();continue}s=n.call(t,u)}catch(c){s=[6,c],i=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},og=function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||oA(n,t,r)},oA=Object.create?function(t,n,r,i){void 0===i&&(i=r);var o=Object.getOwnPropertyDescriptor(n,r);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[r]}}),Object.defineProperty(t,i,o)}:function(t,n,r,i){void 0===i&&(i=r),t[i]=n[r]},oy=function(t){var n="function"==typeof Symbol&&Symbol.iterator,r=n&&t[n],i=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")},ov=function(t,n){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,o,a=r.call(t),u=[];try{for(;(void 0===n||n-- >0)&&!(i=a.next()).done;)u.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}return u},ob=function(){for(var t=[],n=0;n<arguments.length;n++)t=t.concat(ov(arguments[n]));return t},ox=function(){for(var t=0,n=0,r=arguments.length;n<r;n++)t+=arguments[n].length;for(var i=Array(t),o=0,n=0;n<r;n++)for(var a=arguments[n],u=0,s=a.length;u<s;u++,o++)i[o]=a[u];return i},o_=function(t,n,r){if(r||2===arguments.length)for(var i,o=0,a=n.length;o<a;o++)!i&&o in n||(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return t.concat(i||Array.prototype.slice.call(n))},oS=function(t){return this instanceof oS?(this.v=t,this):new oS(t)},oT=function(t,n,r){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var i,o=r.apply(t,n||[]),a=[];return i={},u("next"),u("throw"),u("return"),i[Symbol.asyncIterator]=function(){return this},i;function u(t){o[t]&&(i[t]=function(n){return new Promise(function(r,i){a.push([t,n,r,i])>1||s(t,n)})})}function s(t,n){try{var r;r=o[t](n),r.value instanceof oS?Promise.resolve(r.value.v).then(c,l):f(a[0][2],r)}catch(i){f(a[0][3],i)}}function c(t){s("next",t)}function l(t){s("throw",t)}function f(t,n){t(n),a.shift(),a.length&&s(a[0][0],a[0][1])}},ow=function(t){var n,r;return n={},i("next"),i("throw",function(t){throw t}),i("return"),n[Symbol.iterator]=function(){return this},n;function i(i,o){n[i]=t[i]?function(n){return(r=!r)?{value:oS(t[i](n)),done:!1}:o?o(n):n}:o}},oO=function(t){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var n,r=t[Symbol.asyncIterator];return r?r.call(t):(t="function"==typeof oy?oy(t):t[Symbol.iterator](),n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n);function i(r){n[r]=t[r]&&function(n){return new Promise(function(i,o){(function(t,n,r,i){Promise.resolve(i).then(function(n){t({value:n,done:r})},n)})(i,o,(n=t[r](n)).done,n.value)})}}},ok=function(t,n){return Object.defineProperty?Object.defineProperty(t,"raw",{value:n}):t.raw=n,t};var r=Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n};oI=function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var i in t)"default"!==i&&Object.prototype.hasOwnProperty.call(t,i)&&oA(n,t,i);return r(n,t),n},oM=function(t){return t&&t.__esModule?t:{default:t}},oC=function(t,n,r,i){if("a"===r&&!i)throw TypeError("Private accessor was defined without a getter");if("function"==typeof n?t!==n||!i:!n.has(t))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(t):i?i.value:n.get(t)},oR=function(t,n,r,i,o){if("m"===i)throw TypeError("Private method is not writable");if("a"===i&&!o)throw TypeError("Private accessor was defined without a setter");if("function"==typeof n?t!==n||!o:!n.has(t))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?o.call(t,r):o?o.value=r:n.set(t,r),r},oE=function(t,n){if(null===n||"object"!=typeof n&&"function"!=typeof n)throw TypeError("Cannot use 'in' operator on non-object");return"function"==typeof t?n===t:t.has(n)},t("__extends",or),t("__assign",oi),t("__rest",oo),t("__decorate",oa),t("__param",ou),t("__esDecorate",oc),t("__runInitializers",ol),t("__propKey",of),t("__setFunctionName",od),t("__metadata",op),t("__awaiter",oh),t("__generator",om),t("__exportStar",og),t("__createBinding",oA),t("__values",oy),t("__read",ov),t("__spread",ob),t("__spreadArrays",ox),t("__spreadArray",o_),t("__await",oS),t("__asyncGenerator",oT),t("__asyncDelegator",ow),t("__asyncValues",oO),t("__makeTemplateObject",ok),t("__importStar",oI),t("__importDefault",oM),t("__classPrivateFieldGet",oC),t("__classPrivateFieldSet",oR),t("__classPrivateFieldIn",oE)});var oP={};function oL(t){return function(n){return function(r){return r.reduce(function(n,r){return t.alt(n,function(){return r})},n)}}}let oF=Object.freeze(Object.defineProperty({__proto__:null,altAll:oL},Symbol.toStringTag,{value:"Module"})),oD=Object.freeze(Object.defineProperty({__proto__:null,altAll:function(t){return oL(t)(t.zero())}},Symbol.toStringTag,{value:"Module"}));function oW(t){var n=eH(t);return function(r){return{concat:n(r).concat,empty:t.of(r.empty)}}}function oU(t,n){var r=ed(t,n).map,i=eq(t,n);return{map:r,of:function(r){return t.of(n.of(r))},ap:function(t,n){return Z(t,i(n))}}}let oz=Object.freeze(Object.defineProperty({__proto__:null,getApplicativeComposition:oU,getApplicativeMonoid:oW},Symbol.toStringTag,{value:"Module"}));function oB(t){return function(n){return function(r){return t.fromEither(em(r)?e_(n()):eS(r.value))}}}function oq(t){return function(n,r){return function(i){return t.fromEither(n(i)?eS(i):e_(r(i)))}}}function oV(t){var n=oB(t);return function(t){var r=n(t);return function(t){return q(t,r)}}}function o$(t,n){var r=oV(t);return function(t){var i=r(t);return function(t){return function(r){return n.chain(r,i(t))}}}}function oK(t){return function(n){return q(n,t.fromEither)}}function oH(t,n){var r=oK(t);return function(t){return function(i){return n.chain(i,r(t))}}}function oZ(t,n){return q(oK(t),eX(n))}function oG(t,n){return function(r,i){return function(o){return n.chain(o,function(n){return t.fromEither(r(n)?eS(n):e_(i(n)))})}}}let oJ=Object.freeze(Object.defineProperty({__proto__:null,chainEitherK:oH,chainFirstEitherK:oZ,chainOptionK:o$,filterOrElse:oG,fromEitherK:oK,fromOption:oB,fromOptionK:oV,fromPredicate:oq},Symbol.toStringTag,{value:"Module"}));var oY=globalThis&&globalThis.__spreadArray||function(t,n,r){if(r||2===arguments.length)for(var i,o=0,a=n.length;o<a;o++)!i&&o in n||(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return t.concat(i||Array.prototype.slice.call(n))},oQ=function(t){return t.length>0},oX=function(t,n){return t<0||t>=n.length},o0=function(t){return function(n){return oY([t],n,!0)}},o1=function(t){return function(n){return oY(oY([],n,!0),[t],!1)}},o2=function(t,n,r){if(oQ(r)){var i=o8(r);return i.splice(t,0,n),i}return[n]},o3=function(t,n,r){var i=o8(r);return i[t]=n,i},o4=function(t){return function(n){if(1===n.length)return ah(n);for(var r=[ui(n)],i=uo(n),o=function(n){r.every(function(r){return!t.equals(r,n)})&&r.push(n)},a=0;a<i.length;a++)o(i[a]);return r}},o5=function(t){if(oQ(t)){var n=e8();return al(t.reduce(n.concat,n.empty))}return ah},o6=function(t){var n=o4(t);return function(t){return function(r){return n(Z(r,aa(t)))}}},o9=function(t){return function(n){var r=n.length,i=Math.round(t)%r;if(oX(Math.abs(i),n)||0===i)return ah(n);if(!(i<0))return o9(i-r)(n);var o=aS(-i)(n),a=o[0];return Z(o[1],aa(a))}},o8=eR,o7=function(t){return oQ(t)?ev(t):ey},ae=function(t){return function(n){for(var r=Math.max(0,Math.floor(n)),i=[t(0)],o=1;o<r;o++)i.push(t(o));return i}},at=function(t){return ae(function(){return t})},an=function(t,n){return t<=n?ae(function(n){return t+n})(n-t+1):[t]},ar=function(t){return[ui(t),uo(t)]},ai=function(t){return[uu(t),ua(t)]};function ao(t){return function(n){return n.concat(t)}}function aa(t,n){return n?t.concat(n):function(n){return n.concat(t)}}var au=function(t){return oY([ua(t)],t.slice(0,-1).reverse(),!0)};function as(t){return function(n){var r=n.length;if(0===r)return[];for(var i=[],o=n[0],a=[o],u=1;u<r;u++){var s=n[u];t.equals(s,o)?a.push(s):(i.push(a),a=[o=s])}return i.push(a),i}}var ac=function(t){return function(n){for(var r={},i=0;i<n.length;i++){var o=n[i],a=t(o);eC.call(r,a)?r[a].push(o):r[a]=[o]}return r}},al=function(t){return function(n){return n.slice().sort(t.compare)}},af=function(t,n){return function(r){return t<0||t>r.length?ey:ev(o2(t,n,r))}},ad=function(t,n){return ap(t,function(){return n})},ap=function(t,n){return function(r){return oX(t,r)?ey:ev(o3(t,n(r[t]),r))}},ah=o8,am=function(t){return[t]},ag=function(t,n,r){for(var i=[r(t[0],n[0])],o=Math.min(t.length,n.length),a=1;a<o;a++)i[a]=r(t[a],n[a]);return i},ay=function(t){for(var n=[t[0][0]],r=[t[0][1]],i=1;i<t.length;i++)n[i]=t[i][0],r[i]=t[i][1];return[n,r]},av=function(t){return function(n){for(var r=[t,n[0]],i=1;i<n.length;i++)r.push(t,n[i]);return r}},ab=function(t){return function(n){var r=uo(n);return oQ(r)?Z(r,av(t),o0(ui(n))):ah(n)}},ax=function(t){return function(n){for(var r=o8(t(0,ui(n))),i=1;i<n.length;i++)r.push.apply(r,t(i,n[i]));return r}},a_=function(t){return function(n){for(var r=t(n),i=r[0],o=r[1],a=[i],u=o;oQ(u);){var s=t(u),c=s[0],l=s[1];a.push(c),u=l}return a}},aS=function(t){return function(n){var r=Math.max(1,t);return r>=n.length?[ah(n),[]]:[Z(n.slice(1,r),o0(ui(n))),n.slice(r)]}},aT=function(t){return a_(aS(t))},aw=function(t,n){return Z(t,a$(n))},aO=function(t,n){return Z(t,aK(n))},ak=function(t,n){return Z(t,aU(n))},aI=function(t,n){return Z(t,az(n))},aM=function(t,n){return Z(t,aB(n))},aC=function(t,n,r){return Z(t,aH(n,r))},aR=function(t){var n=nM(t);return function(t,r){return Z(t,n(r))}},aE=function(t,n,r){return Z(t,aG(n,r))},aA=function(t){var n=aY(t);return function(t,r){return Z(t,n(r))}},aj=function(t,n){return Z(t,aW(n))},aN=function(t,n,r){return Z(t,aZ(n,r))},aP=function(t){var n=nE(t);return function(t,r){return Z(t,n(r))}},aL=function(t,n,r){return Z(t,aJ(n,r))},aF=function(t){var n=aX(t);return function(t,r){return Z(t,n(r))}},aD=function(t){return function(n){return Z(n,ao(t()))}},aW=aD,aU=function(t){return az(function(n){return Z(t,a$(n))})},az=function(t){return ax(function(n,r){return t(r)})},aB=function(t){return function(n){for(var r=uo(n),i=[t(n)];oQ(r);)i.push(t(r)),r=uo(r);return i}},aq=aB(F),aV=az(F),a$=function(t){return aK(function(n,r){return t(r)})},aK=function(t){return function(n){for(var r=[t(0,ui(n))],i=1;i<n.length;i++)r.push(t(i,n[i]));return r}},aH=nI,aZ=nR,aG=nC,aJ=nA,aY=function(t){var n=aX(t);return function(t){return n(function(n,r){return t(r)})}},aQ=function(t){return aX(t)(function(t,n){return n})},aX=function(t){return function(n){return function(r){for(var i=t.map(n(0,ui(r)),am),o=1;o<r.length;o++)i=t.ap(t.map(i,function(t){return function(n){return Z(t,o1(n))}}),n(o,r[o]));return i}}},a0="NonEmptyArray",a1=function(){return{concat:aa}},a2=function(t){var n=o6(t);return{concat:function(t,r){return n(r)(t)}}},a3={URI:a0,map:aw},a4=el(a3),a5={URI:a0,map:aw,ap:ak},a6=eV(a5),a9=e$(a5),a8={URI:a0,map:aw,ap:ak,chain:aI},a7=eX(a8),ue=am(eM),ut=ef(a3),un=e0(a8),ur=eK(a5),ui=nQ,uo=function(t){return t.slice(1)},ua=n0,uu=function(t){return t.slice(0,-1)},us=function(t){return function(n){return n.reduce(t.concat)}},uc=function(t){return function(n){return t(ui(n),uo(n))}},ul=function(t){return function(n){return t(uu(n),ua(n))}},uf=function(t){return function(n){return oY([t(ui(n))],uo(n),!0)}},ud=function(t){return uf(function(){return t})},up=function(t){return function(n){return Z(uu(n),o1(t(ua(n))))}},uh=function(t){return up(function(){return t})},um=function(t){return function(n){return o7(n.filter(function(n,r){return t(r,n)}))}};function ug(t,n){return void 0===n?o0(t):Z(n,o0(t))}var uy=function(t,n){return Z(t,o1(n))};let uv=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:a0,map:aw,alt:aj},Applicative:{URI:a0,map:aw,ap:ak,of:am},Apply:a5,Chain:a8,Comonad:{URI:a0,map:aw,extend:aM,extract:nQ},Do:ue,Foldable:{URI:a0,reduce:aC,foldMap:aR,reduceRight:aE},FoldableWithIndex:{URI:a0,reduce:aC,foldMap:aR,reduceRight:aE,reduceWithIndex:aN,foldMapWithIndex:aP,reduceRightWithIndex:aL},Functor:a3,FunctorWithIndex:{URI:a0,map:aw,mapWithIndex:aO},Monad:{URI:a0,map:aw,ap:ak,of:am,chain:aI},Pointed:{URI:a0,of:am},Traversable:{URI:a0,map:aw,reduce:aC,foldMap:aR,reduceRight:aE,traverse:aA,sequence:aQ},TraversableWithIndex:{URI:a0,map:aw,mapWithIndex:aO,reduce:aC,foldMap:aR,reduceRight:aE,traverse:aA,sequence:aQ,reduceWithIndex:aN,foldMapWithIndex:aP,reduceRightWithIndex:aL,traverseWithIndex:aF},URI:a0,alt:aW,altW:aD,ap:aU,apFirst:a6,apS:ur,apSecond:a9,append:o1,appendW:o1,bind:un,bindTo:ut,chain:az,chainFirst:a7,chainWithIndex:ax,chop:a_,chunksOf:aT,concat:aa,concatAll:us,concatW:ao,cons:ug,copy:ah,duplicate:aq,extend:aB,extract:nQ,filter:function(t){return um(function(n,r){return t(r)})},filterWithIndex:um,flap:a4,flatten:aV,fold:n4,foldMap:nM,foldMapWithIndex:nE,fromArray:o7,fromReadonlyNonEmptyArray:o8,getEq:nW,getSemigroup:a1,getShow:nF,getUnionSemigroup:a2,group:as,groupBy:ac,groupSort:function(t){var n=al(t),r=as(t);return function(t){return oQ(t)?r(n(t)):[]}},head:ui,init:uu,insertAt:af,intercalate:rt,intersperse:ab,isNonEmpty:oQ,isOutOfBound:oX,last:ua,makeBy:ae,map:a$,mapWithIndex:aK,matchLeft:uc,matchRight:ul,max:n3,min:n2,modifyAt:ap,modifyHead:uf,modifyLast:up,nonEmptyArray:{URI:a0,of:am,map:aw,mapWithIndex:aO,ap:ak,chain:aI,extend:aM,extract:nQ,reduce:aC,foldMap:aR,reduceRight:aE,traverse:aA,sequence:aQ,reduceWithIndex:aN,foldMapWithIndex:aP,reduceRightWithIndex:aL,traverseWithIndex:aF,alt:aj},of:am,prepend:o0,prependAll:av,prependToAll:av,prependW:o0,range:an,reduce:aH,reduceRight:aG,reduceRightWithIndex:aJ,reduceWithIndex:aZ,replicate:at,reverse:au,rotate:o9,sequence:aQ,snoc:uy,sort:al,sortBy:o5,splitAt:aS,tail:uo,traverse:aY,traverseWithIndex:aX,unappend:ai,uncons:ar,union:o6,uniq:o4,unprepend:ar,unsafeInsertAt:o2,unsafeUpdateAt:o3,unsnoc:ai,unzip:ay,updateAt:ad,updateHead:ud,updateLast:uh,zip:function t(n,r){return void 0===r?function(r){return t(r,n)}:ag(n,r,function(t,n){return[t,n]})},zipWith:ag},Symbol.toStringTag,{value:"Module"}));var ub=function(t){return"number"==typeof t},ux={equals:function(t,n){return t===n}},u_={equals:ux.equals,compare:function(t,n){return t<n?-1:t>n?1:0}},uS={equals:ux.equals,compare:u_.compare,top:1/0,bottom:-1/0},uT={concat:function(t,n){return t-n}},uw={concat:function(t,n){return t+n}},uO={concat:function(t,n){return t*n}},uk={concat:uw.concat,empty:0},uI={concat:uO.concat,empty:1},uM={add:uw.concat,zero:0,mul:uO.concat,one:1,sub:uT.concat,degree:function(t){return 1},div:function(t,n){return t/n},mod:function(t,n){return t%n}};let uC=Object.freeze(Object.defineProperty({__proto__:null,Bounded:uS,Eq:ux,Field:uM,MagmaSub:uT,MonoidProduct:uI,MonoidSum:uk,Ord:u_,SemigroupProduct:uO,SemigroupSum:uw,Show:{show:function(t){return JSON.stringify(t)}},isNumber:ub},Symbol.toStringTag,{value:"Module"}));function uR(t,n){return function(r){return r?n.of(void 0):t.zero()}}let uE=Object.freeze(Object.defineProperty({__proto__:null,guard:uR},Symbol.toStringTag,{value:"Module"}));var uA=globalThis&&globalThis.__spreadArray||function(t,n,r){if(r||2===arguments.length)for(var i,o=0,a=n.length;o<a;o++)!i&&o in n||(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return t.concat(i||Array.prototype.slice.call(n))},uj=function(t){return 0===t.length},uN=function(t,n){return t<=0?cH:tK(n)(t)},uP=function(t,n){return uN(t,function(){return n})},uL=function(t){return em(t)?cH:[t.value]},uF=function(t){return eb(t)?cH:[t.right]},uD=function(t,n){return function(r){return ew(r)?n(r):t()}},uW=function(t,n){return function(r){return ew(r)?n(nQ(r),nX(r)):t()}},uU=function(t,n){return function(r){return ew(r)?n(n1(r),n0(r)):t()}},uz=function(t){return function(n){if(uj(n))return cH;for(var r=[],i=0;i<n.length;i++)r.push.apply(r,t(i,n[i]));return r}},uB=function(t,n){return function(r){var i=r.length,o=Array(i+1);o[0]=t;for(var a=0;a<i;a++)o[a+1]=n(o[a],r[a]);return o}},uq=function(t,n){return function(r){var i=r.length,o=Array(i+1);o[i]=t;for(var a=i-1;a>=0;a--)o[a]=n(r[a],o[a+1]);return o}},uV=function(t){return t.length};function u$(t,n){return void 0===n?function(n){return u$(t,n)}:tL(t,n)?ey:ev(n[t])}var uK=function(t){return ew(t)?ev(nQ(t)):ey},uH=function(t){return ew(t)?ev(n0(t)):ey},uZ=function(t){return ew(t)?ev(nX(t)):ey},uG=function(t){return ew(t)?ev(n1(t)):ey},uJ=function(t){return function(n){return tL(t,n)?n:0===t?cH:n.slice(0,t)}},uY=function(t){return function(n){return tL(t,n)?n:0===t?cH:n.slice(-t)}},uQ=function(t,n){for(var r=t.length,i=0;i<r&&n(t[i]);i++);return i},uX=function(t){return function(n){return t<=0||uj(n)?n:t>=n.length?cH:n.slice(t,n.length)}},u0=function(t){return function(n){return t<=0||uj(n)?n:t>=n.length?cH:n.slice(0,n.length-t)}},u1=function(t){return function(n){for(var r=0;r<n.length;r++)if(t(n[r]))return ev(r);return ey}};function u2(t){return function(n){for(var r=0;r<n.length;r++)if(t(n[r]))return ev(n[r]);return ey}}var u3=function(t){return function(n){for(var r=0;r<n.length;r++){var i=t(n[r]);if(eg(i))return i}return ey}};function u4(t){return function(n){for(var r=n.length-1;r>=0;r--)if(t(n[r]))return ev(n[r]);return ey}}var u5=function(t){return function(n){for(var r=n.length-1;r>=0;r--){var i=t(n[r]);if(eg(i))return i}return ey}},u6=function(t){return function(n){for(var r=n.length-1;r>=0;r--)if(t(n[r]))return ev(r);return ey}},u9=function(t,n){return function(r){return t<0||t>r.length?ey:ev(tW(t,n,r))}},u8=function(t,n){return se(t,function(){return n})},u7=function(t){return function(n){return tL(t,n)?ey:ev(cV(t,n))}},se=function(t,n){return function(r){return tL(t,r)?ey:ev(cq(t,n(r[t]),r))}},st=function(t){return t.length<=1?t:t.slice().reverse()},sn=function(t){for(var n=[],r=0;r<t.length;r++){var i=t[r];"Right"===i._tag&&n.push(i.right)}return n},sr=function(t){for(var n=[],r=0;r<t.length;r++){var i=t[r];"Left"===i._tag&&n.push(i.left)}return n},si=function(t){return function(n){return n.length<=1?n:n.slice().sort(t.compare)}},so=function(t,n,r){for(var i=[],o=Math.min(t.length,n.length),a=0;a<o;a++)i[a]=r(t[a],n[a]);return i},sa=function(t){for(var n=[],r=[],i=0;i<t.length;i++)n[i]=t[i][0],r[i]=t[i][1];return[n,r]},su=function(t){var n=t8(t);return function(t){return ew(t)?n(t):t}},ss=function(t){var n=t7(t);return function(t){return ew(t)?n(t):t}},sc=function(t){var n=tV(t);return function(t){return ew(t)?n(t):t}};function sl(t){return function(n,r){if(void 0===r){var i,o=sl(t);return function(t){return o(n,t)}}for(var a=0;a<r.length;a++)if(i=r[a],t.equals(i,n))return!0;return!1}}var sf=function(t){var n=tz(t);return function(t){return ew(t)?n(t):t}},sd=function(t){var n=tB(t);return function(t){return ew(t)?n(t):t}},sp=function(t){var n=nt(t);return function(t){return ew(t)?n(t):cH}},sh=function(t){return function(n){return t>=1&&ew(n)?nn(t)(n):uj(n)?[n,cH]:[cH,n]}},sm=function(t){var n=nr(t);return function(t){return ew(t)?n(t):cH}},sg=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return uL(t.apply(void 0,n))}},sy=function(t){return function(n){return uj(n)?t:uj(t)?n:n.concat(t)}};function sv(t){var n=tq(t);return function(r,i){if(void 0===i){var o=sv(t);return function(t){return o(t,r)}}return ew(r)&&ew(i)?n(i)(r):ew(r)?r:i}}function sb(t){var n=sl(t);return function(r,i){if(void 0===i){var o=sb(t);return function(t){return o(t,r)}}return r.filter(function(t){return n(t,i)})}}function sx(t){var n=sl(t);return function(r,i){if(void 0===i){var o=sx(t);return function(t){return o(t,r)}}return r.filter(function(t){return!n(t,i)})}}var s_=function(t,n){return Z(t,sY(n))},sS=function(t,n){return Z(t,sQ(n))},sT=function(t,n){return Z(t,sZ(n))},sw=function(t,n){return Z(t,sG(n))},sO=function(t,n){return Z(t,s0(n))},sk=function(t,n){return Z(t,s2(n))},sI=function(t,n){return Z(t,s4(n))},sM=function(t,n){return Z(t,s6(n))},sC=function(t,n){return Z(t,s5(n))},sR=function(t,n){return Z(t,s9(n))},sE=function(t,n){return Z(t,sH(n))},sA=function(t,n,r){return Z(t,cn(n,r))},sj=function(t){var n=cr(t);return function(t,r){return Z(t,n(r))}},sN=function(t,n,r){return Z(t,co(n,r))},sP=function(t,n,r){return Z(t,ci(n,r))},sL=function(t){var n=ct(t);return function(t,r){return Z(t,n(r))}},sF=function(t,n,r){return Z(t,ca(n,r))},sD=function(t,n){return Z(t,s1(n))},sW=function(t,n){return Z(t,s8(n))},sU=function(t,n){return Z(t,s7(n))},sz=function(t){var n=cu(t);return function(t,r){return Z(t,n(r))}},sB=function(t){var n=cc(t);return function(t,r){return Z(t,n(r))}},sq=function(t,n){return Z(t,cP(n))},sV=function(t,n){return Z(t,cL(n))},s$=function(){return cH},sK=function(t){return function(n){return n.concat(t())}},sH=sK,sZ=function(t){return sG(function(n){return Z(t,sY(n))})},sG=function(t){return function(n){return Z(n,uz(function(n,r){return t(r)}))}},sJ=sG(F),sY=function(t){return function(n){return n.map(function(n){return t(n)})}},sQ=function(t){return function(n){return n.map(function(n,r){return t(r,n)})}},sX=function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=t[i];"Left"===o._tag?n.push(o.left):r.push(o.right)}return eE(n,r)},s0=function(t){return function(n){return n.filter(t)}},s1=function(t){return function(n){for(var r=[],i=0;i<n.length;i++){var o=t(i,n[i]);eg(o)&&r.push(o.value)}return r}},s2=function(t){return s1(function(n,r){return t(r)})},s3=s2(F),s4=function(t){return s5(function(n,r){return t(r)})},s5=function(t){return function(n){for(var r=[],i=[],o=0;o<n.length;o++){var a=n[o];t(o,a)?i.push(a):r.push(a)}return eE(r,i)}},s6=function(t){return s9(function(n,r){return t(r)})},s9=function(t){return function(n){for(var r=[],i=[],o=0;o<n.length;o++){var a=t(o,n[o]);"Left"===a._tag?r.push(a.left):i.push(a.right)}return eE(r,i)}},s8=function(t){return function(n){return n.filter(function(n,r){return t(r,n)})}},s7=function(t){return function(n){return n.map(function(r,i){return t(n.slice(i))})}},ce=s7(F),ct=function(t){return function(n){return function(r){return r.reduce(function(r,i,o){return t.concat(r,n(o,i))},t.empty)}}},cn=function(t,n){return ci(t,function(t,r,i){return n(r,i)})},cr=function(t){var n=ct(t);return function(t){return n(function(n,r){return t(r)})}},ci=function(t,n){return function(r){for(var i=r.length,o=t,a=0;a<i;a++)o=n(a,o,r[a]);return o}},co=function(t,n){return ca(t,function(t,r,i){return n(r,i)})},ca=function(t,n){return function(r){return r.reduceRight(function(t,r,i){return n(i,r,t)},t)}},cu=function(t){var n=cc(t);return function(t){return n(function(n,r){return t(r)})}},cs=function(t){return function(n){return sA(n,t.of(s$()),function(n,r){return t.ap(t.map(n,function(t){return function(n){return Z(t,tD(n))}}),r)})}},cc=function(t){return function(n){return ci(t.of(s$()),function(r,i,o){return t.ap(t.map(i,function(t){return function(n){return Z(t,tD(n))}}),n(r,o))})}},cl=function(t){var n=cF(t);return function(t){return function(r){return n(r,t)}}},cf=function(t){var n=cD(t);return function(t){return function(r){return n(r,t)}}},cd=function(t,n){for(var r=[],i=t;;){var o=n(i);if(eg(o)){var a=o.value,u=a[0],s=a[1];r.push(u),i=s}else break}return r},cp="ReadonlyArray",ch=function(t){return{show:function(n){return"[".concat(n.map(t.show).join(", "),"]")}}},cm=function(){return{concat:function(t,n){return uj(t)?n:uj(n)?t:t.concat(n)}}},cg=function(){return{concat:cm().concat,empty:cH}},cy=function(t){return Q(function(n,r){return n.length===r.length&&n.every(function(n,i){return t.equals(n,r[i])})})},cv=function(t){return e3(function(n,r){for(var i=n.length,o=r.length,a=Math.min(i,o),u=0;u<a;u++){var s=t.compare(n[u],r[u]);if(0!==s)return s}return u_.compare(i,o)})},cb=function(t){var n=sv(t);return{concat:function(t,r){return n(r)(t)}}},cx=function(t){return{concat:cb(t).concat,empty:cH}},c_=function(t){var n=sb(t);return{concat:function(t,r){return n(r)(t)}}},cS=function(t){var n=sx(t);return{concat:function(t,r){return n(r)(t)}}},cT={URI:cp,map:s_},cw=el(cT),cO={URI:cp,of:eT},ck={URI:cp,map:s_,ap:sT},cI=eV(ck),cM=e$(ck),cC={URI:cp,map:s_,ap:sT,chain:sw},cR=eX(cC),cE={URI:cp,zero:s$},cA=uR(cE,cO),cj={URI:cp,compact:s3,separate:sX},cN={URI:cp,map:s_,reduce:sA,foldMap:sj,reduceRight:sN,traverse:sz,sequence:cs},cP=function(t){return function(n){for(var r=uA([],t(n),!0),i=[];r.length>0;){var o=r.shift();eb(o)?r.unshift.apply(r,t(o.left)):i.push(o.right)}return i}},cL=function(t){return function(n){var r=t(n),i=[],o=[];function a(n){eb(n)?t(n.left).forEach(function(t){return i.push(t)}):o.push(n.right)}for(var u=0;u<r.length;u++)a(r[u]);for(;i.length>0;)a(i.shift());return o}},cF=rI(cN,cj),cD=rk(cN,cj),cW={URI:cp,map:s_,compact:s3,separate:sX,filter:sO,filterMap:sk,partition:sI,partitionMap:sM,reduce:sA,foldMap:sj,reduceRight:sN,traverse:sz,sequence:cs,wither:cF,wilt:cD},cU=rM(cW),cz={URI:cp,fromEither:uF},cB=oK(cz),cq=function(t,n,r){return ew(r)?tU(t,n,r):r},cV=function(t,n){var r=n.slice();return r.splice(t,1),r},c$=function(t){return t.slice()},cK=function(t){return uj(t)?cH:t.slice()},cH=eI;function cZ(t){return function(n){return n.every(t)}}var cG=function(t){return function(n){return n.some(t)}},cJ=function(t){var n=rt(t);return function(r){return uD(function(){return t.empty},n(r))}},cY=eT(eM),cQ=ef(cT),cX=e0(cC),c0=eK(ck);let c1=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:cp,map:s_,alt:sE},Alternative:{URI:cp,map:s_,ap:sT,of:eT,alt:sE,zero:s$},Applicative:{URI:cp,map:s_,ap:sT,of:eT},Apply:ck,Chain:cC,ChainRecBreadthFirst:{URI:cp,map:s_,ap:sT,chain:sw,chainRec:sV},ChainRecDepthFirst:{URI:cp,map:s_,ap:sT,chain:sw,chainRec:sq},Compactable:cj,Do:cY,Extend:{URI:cp,map:s_,extend:sU},Filterable:{URI:cp,map:s_,compact:s3,separate:sX,filter:sO,filterMap:sk,partition:sI,partitionMap:sM},FilterableWithIndex:{URI:cp,map:s_,mapWithIndex:sS,compact:s3,separate:sX,filter:sO,filterMap:sk,partition:sI,partitionMap:sM,partitionMapWithIndex:sR,partitionWithIndex:sC,filterMapWithIndex:sD,filterWithIndex:sW},Foldable:{URI:cp,reduce:sA,foldMap:sj,reduceRight:sN},FoldableWithIndex:{URI:cp,reduce:sA,foldMap:sj,reduceRight:sN,reduceWithIndex:sP,foldMapWithIndex:sL,reduceRightWithIndex:sF},FromEither:cz,Functor:cT,FunctorWithIndex:{URI:cp,map:s_,mapWithIndex:sS},Monad:{URI:cp,map:s_,ap:sT,of:eT,chain:sw},Pointed:cO,Traversable:cN,TraversableWithIndex:{URI:cp,map:s_,mapWithIndex:sS,reduce:sA,foldMap:sj,reduceRight:sN,reduceWithIndex:sP,foldMapWithIndex:sL,reduceRightWithIndex:sF,traverse:sz,sequence:cs,traverseWithIndex:sB},URI:cp,Unfoldable:{URI:cp,unfold:cd},Witherable:cW,Zero:cE,_chainRecBreadthFirst:sV,_chainRecDepthFirst:sq,alt:sH,altW:sK,ap:sZ,apFirst:cI,apS:c0,apSecond:cM,append:tD,appendW:tD,bind:cX,bindTo:cQ,chain:sG,chainFirst:cR,chainRecBreadthFirst:cL,chainRecDepthFirst:cP,chainWithIndex:uz,chop:sp,chunksOf:sm,compact:s3,comprehension:function(t,n,r){void 0===r&&(r=function(){return!0});var i=function(t,o){return ew(o)?Z(nQ(o),sG(function(n){return i(Z(t,tD(n)),nX(o))})):r.apply(void 0,t)?[n.apply(void 0,t)]:cH};return i(cH,t)},concat:sy,concatW:sy,cons:rr,deleteAt:u7,difference:sx,dropLeft:uX,dropLeftWhile:function(t){return function(n){var r=uQ(n,t);return 0===r?n:r===n.length?cH:n.slice(r)}},dropRight:u0,duplicate:ce,elem:sl,empty:cH,every:cZ,exists:cG,extend:s7,filter:s0,filterE:cU,filterMap:s2,filterMapWithIndex:s1,filterWithIndex:s8,findFirst:u2,findFirstMap:u3,findIndex:u1,findLast:u4,findLastIndex:u6,findLastMap:u5,flap:cw,flatten:sJ,foldLeft:uW,foldMap:cr,foldMapWithIndex:ct,foldRight:uU,fromArray:cK,fromEither:uF,fromEitherK:cB,fromOption:uL,fromOptionK:sg,fromPredicate:function(t){return function(n){return t(n)?[n]:cH}},getDifferenceMagma:cS,getEq:cy,getIntersectionSemigroup:c_,getMonoid:cg,getOrd:cv,getSemigroup:cm,getShow:ch,getUnionMonoid:cx,getUnionSemigroup:cb,guard:cA,head:uK,init:uG,insertAt:u9,intercalate:cJ,intersection:sb,intersperse:ss,isEmpty:uj,isNonEmpty:ew,isOutOfBound:tL,last:uH,lefts:sr,lookup:u$,makeBy:uN,map:sY,mapWithIndex:sQ,match:uD,matchLeft:uW,matchLeftW:uW,matchRight:uU,matchRightW:uU,matchW:uD,modifyAt:se,of:eT,partition:s4,partitionMap:s6,partitionMapWithIndex:s9,partitionWithIndex:s5,prepend:tF,prependAll:su,prependToAll:su,prependW:tF,range:tZ,readonlyArray:{URI:cp,compact:s3,separate:sX,map:s_,ap:sT,of:eT,chain:sw,filter:sO,filterMap:sk,partition:sI,partitionMap:sM,mapWithIndex:sS,partitionMapWithIndex:sR,partitionWithIndex:sC,filterMapWithIndex:sD,filterWithIndex:sW,alt:sE,zero:s$,unfold:cd,reduce:sA,foldMap:sj,reduceRight:sN,traverse:sz,sequence:cs,reduceWithIndex:sP,foldMapWithIndex:sL,reduceRightWithIndex:sF,traverseWithIndex:sB,extend:sU,wither:cF,wilt:cD},reduce:cn,reduceRight:co,reduceRightWithIndex:ca,reduceWithIndex:ci,replicate:uP,reverse:st,rights:sn,rotate:sc,scanLeft:uB,scanRight:uq,separate:sX,sequence:cs,size:uV,snoc:ri,some:cG,sort:si,sortBy:sd,spanLeft:function(t){return function(n){var r,i=sh(uQ(n,t))(n);return{init:i[0],rest:i[1]}}},splitAt:sh,tail:uZ,takeLeft:uJ,takeLeftWhile:function(t){return function(n){for(var r=[],i=0;i<n.length;i++){var o=n[i];if(!t(o))break;r.push(o)}var a=r.length;return a===n.length?n:0===a?cH:r}},takeRight:uY,toArray:c$,traverse:cu,traverseWithIndex:cc,unfold:cd,union:sv,uniq:sf,unsafeDeleteAt:cV,unsafeInsertAt:tW,unsafeUpdateAt:cq,unzip:sa,updateAt:u8,wilt:cf,wither:cl,zero:s$,zip:function t(n,r){return void 0===r?function(r){return t(r,n)}:so(n,r,function(t,n){return[t,n]})},zipWith:so},Symbol.toStringTag,{value:"Module"}));var c2=function(t){return 0===t.length},c3=function(t,n){return t<=0?[]:ae(n)(t)},c4=function(t,n){return c3(t,function(){return n})},c5=function(t){return em(t)?[]:[t.value]},c6=function(t){return eb(t)?[]:[t.right]},c9=function(t,n){return function(r){return oQ(r)?n(r):t()}},c8=function(t,n){return function(r){return oQ(r)?n(ui(r),uo(r)):t()}},c7=function(t,n){return function(r){return oQ(r)?n(uu(r),ua(r)):t()}},le=function(t){return function(n){for(var r=[],i=0;i<n.length;i++)r.push.apply(r,t(i,n[i]));return r}},lt=function(t,n){return function(r){var i=r.length,o=Array(i+1);o[0]=t;for(var a=0;a<i;a++)o[a+1]=n(o[a],r[a]);return o}},ln=function(t,n){return function(r){var i=r.length,o=Array(i+1);o[i]=t;for(var a=i-1;a>=0;a--)o[a]=n(r[a],o[a+1]);return o}},lr=function(t){return t.length},li=function(t){return oQ(t)?ev(uo(t)):ey},lo=function(t){return oQ(t)?ev(uu(t)):ey},la=function(t){return function(n){return oX(t,n)?lp(n):n.slice(0,t)}},lu=function(t){return function(n){return oX(t,n)?lp(n):0===t?[]:n.slice(-t)}},ls=function(t,n){for(var r=t.length,i=0;i<r&&n(t[i]);i++);return i},lc=function(t){return function(n){return t<=0||c2(n)?lp(n):t>=n.length?[]:n.slice(t,n.length)}},ll=function(t){return function(n){return t<=0||c2(n)?lp(n):t>=n.length?[]:n.slice(0,n.length-t)}};function lf(t){return u2(t)}function ld(t){return u4(t)}var lp=function(t){return t.slice()},lh=function(t,n){return function(r){return t<0||t>r.length?ey:ev(fX(t,n,r))}},lm=function(t,n){return ly(t,function(){return n})},lg=function(t){return function(n){return oX(t,n)?ey:ev(f1(t,n))}},ly=function(t,n){return function(r){return oX(t,r)?ey:ev(f0(t,n(r[t]),r))}},lv=function(t){return c2(t)?[]:t.slice().reverse()},lb=function(t){for(var n=[],r=0;r<t.length;r++){var i=t[r];"Right"===i._tag&&n.push(i.right)}return n},lx=function(t){for(var n=[],r=0;r<t.length;r++){var i=t[r];"Left"===i._tag&&n.push(i.left)}return n},l_=function(t){return function(n){return n.length<=1?lp(n):n.slice().sort(t.compare)}},lS=function(t,n,r){for(var i=[],o=Math.min(t.length,n.length),a=0;a<o;a++)i[a]=r(t[a],n[a]);return i},lT=function(t){for(var n=[],r=[],i=0;i<t.length;i++)n[i]=t[i][0],r[i]=t[i][1];return[n,r]},lw=function(t){var n=av(t);return function(t){return oQ(t)?n(t):[]}},lO=function(t){var n=ab(t);return function(t){return oQ(t)?n(t):lp(t)}},lk=function(t){var n=o9(t);return function(t){return oQ(t)?n(t):lp(t)}},lI=function(t){var n=o4(t);return function(t){return oQ(t)?n(t):lp(t)}},lM=function(t){var n=o5(t);return function(t){return oQ(t)?n(t):lp(t)}},lC=function(t){var n=a_(t);return function(t){return oQ(t)?n(t):[]}},lR=function(t){return function(n){return t>=1&&oQ(n)?aS(t)(n):c2(n)?[lp(n),[]]:[[],lp(n)]}},lE=function(t){var n=aT(t);return function(t){return oQ(t)?n(t):[]}},lA=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return c5(t.apply(void 0,n))}},lj=function(t){return function(n){return c2(n)?lp(t):c2(t)?lp(n):n.concat(t)}};function lN(t){var n=o6(t);return function(r,i){if(void 0===i){var o=lN(t);return function(t){return o(t,r)}}return oQ(r)&&oQ(i)?n(i)(r):oQ(r)?lp(r):lp(i)}}function lP(t){var n=sl(t);return function(r,i){if(void 0===i){var o=lP(t);return function(t){return o(t,r)}}return r.filter(function(t){return n(t,i)})}}function lL(t){var n=sl(t);return function(r,i){if(void 0===i){var o=lL(t);return function(t){return o(t,r)}}return r.filter(function(t){return!n(t,i)})}}var lF=function(t,n){return Z(t,l6(n))},lD=function(t,n){return Z(t,fe(n))},lW=function(t,n){return Z(t,l9(n))},lU=function(t,n){return Z(t,l8(n))},lz=function(t,n){return Z(t,fo(n))},lB=function(t,n){return Z(t,fn(n))},lq=function(t,n){return Z(t,fa(n))},lV=function(t,n){return Z(t,fs(n))},l$=function(t,n){return Z(t,fu(n))},lK=function(t,n){return Z(t,fc(n))},lH=function(t,n){return Z(t,ff(n))},lZ=function(t,n,r){return Z(t,fy(n,r))},lG=function(t){var n=fm(t);return function(t,r){return Z(t,n(r))}},lJ=function(t,n,r){return Z(t,fb(n,r))},lY=function(t,n,r){return Z(t,fv(n,r))},lQ=function(t){var n=fg(t);return function(t,r){return Z(t,n(r))}},lX=function(t,n,r){return Z(t,fx(n,r))},l0=function(t,n){return Z(t,ft(n))},l1=function(t,n){return Z(t,fd(n))},l2=function(t,n){return Z(t,fp(n))},l3=function(t){var n=f_(t);return function(t,r){return Z(t,n(r))}},l4=function(t){var n=fT(t);return function(t,r){return Z(t,n(r))}},l5=function(){return[]},l6=function(t){return function(n){return n.map(function(n){return t(n)})}},l9=function(t){return l8(function(n){return Z(t,l6(n))})},l8=function(t){return function(n){return Z(n,le(function(n,r){return t(r)}))}},l7=l8(F),fe=function(t){return function(n){return n.map(function(n,r){return t(r,n)})}},ft=function(t){return function(n){for(var r=[],i=0;i<n.length;i++){var o=t(i,n[i]);eg(o)&&r.push(o.value)}return r}},fn=function(t){return ft(function(n,r){return t(r)})},fr=fn(F),fi=function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=t[i];"Left"===o._tag?n.push(o.left):r.push(o.right)}return eE(n,r)},fo=function(t){return function(n){return n.filter(t)}},fa=function(t){return fu(function(n,r){return t(r)})},fu=function(t){return function(n){for(var r=[],i=[],o=0;o<n.length;o++){var a=n[o];t(o,a)?i.push(a):r.push(a)}return eE(r,i)}},fs=function(t){return fc(function(n,r){return t(r)})},fc=function(t){return function(n){for(var r=[],i=[],o=0;o<n.length;o++){var a=t(o,n[o]);"Left"===a._tag?r.push(a.left):i.push(a.right)}return eE(r,i)}},fl=function(t){return function(n){return n.concat(t())}},ff=fl,fd=function(t){return function(n){return n.filter(function(n,r){return t(r,n)})}},fp=function(t){return function(n){return n.map(function(r,i){return t(n.slice(i))})}},fh=fp(F),fm=cr,fg=ct,fy=cn,fv=ci,fb=co,fx=ca,f_=function(t){var n=fT(t);return function(t){return n(function(n,r){return t(r)})}},fS=function(t){return function(n){return lZ(n,t.of(l5()),function(n,r){return t.ap(t.map(n,function(t){return function(n){return Z(t,o1(n))}}),r)})}},fT=function(t){return function(n){return fv(t.of(l5()),function(r,i,o){return t.ap(t.map(i,function(t){return function(n){return Z(t,o1(n))}}),n(r,o))})}},fw=function(t){var n=fH(t);return function(t){return function(r){return n(r,t)}}},fO=function(t){var n=fZ(t);return function(t){return function(r){return n(r,t)}}},fk=function(t,n){for(var r=[],i=t;;){var o=n(i);if(eg(o)){var a=o.value,u=a[0],s=a[1];r.push(u),i=s}else break}return r},fI="Array",fM=function(){return{concat:function(t,n){return t.concat(n)}}},fC=function(){return{concat:fM().concat,empty:[]}},fR=function(t){var n=lN(t);return{concat:function(t,r){return n(r)(t)}}},fE=function(t){return{concat:fR(t).concat,empty:[]}},fA=function(t){var n=lP(t);return{concat:function(t,r){return n(r)(t)}}},fj=function(t){var n=lL(t);return{concat:function(t,r){return n(r)(t)}}},fN={URI:fI,map:lF},fP=el(fN),fL={URI:fI,of:am},fF={URI:fI,map:lF,ap:lW},fD=eV(fF),fW=e$(fF),fU={URI:fI,map:lF,ap:lW,chain:lU},fz=eX(fU),fB={URI:fI,zero:l5},fq=uR(fB,fL),fV={URI:fI,compact:fr,separate:fi},f$={URI:fI,reduce:lZ,foldMap:lG,reduceRight:lJ},fK={URI:fI,map:lF,reduce:lZ,foldMap:lG,reduceRight:lJ,traverse:l3,sequence:fS},fH=rI(fK,fV),fZ=rk(fK,fV),fG={URI:fI,map:lF,compact:fr,separate:fi,filter:lz,filterMap:lB,partition:lq,partitionMap:lV,reduce:lZ,foldMap:lG,reduceRight:lJ,traverse:l3,sequence:fS,wither:fH,wilt:fZ},fJ=rM(fG),fY={URI:fI,fromEither:c6},fQ=oK(fY),fX=o2,f0=function(t,n,r){return oQ(r)?o3(t,n,r):[]},f1=function(t,n){var r=n.slice();return r.splice(t,1),r},f2=function(t){return function(n){return n.some(t)}},f3=am(eM),f4=ef(fN),f5=e0(fU),f6=eK(fF);let f9=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:fI,map:lF,alt:lH},Alternative:{URI:fI,map:lF,ap:lW,of:am,alt:lH,zero:l5},Applicative:{URI:fI,map:lF,ap:lW,of:am},Apply:fF,Chain:fU,ChainRecBreadthFirst:{URI:fI,map:lF,ap:lW,chain:lU,chainRec:sV},ChainRecDepthFirst:{URI:fI,map:lF,ap:lW,chain:lU,chainRec:sq},Compactable:fV,Do:f3,Extend:{URI:fI,map:lF,extend:l2},Filterable:{URI:fI,map:lF,compact:fr,separate:fi,filter:lz,filterMap:lB,partition:lq,partitionMap:lV},FilterableWithIndex:{URI:fI,map:lF,mapWithIndex:lD,compact:fr,separate:fi,filter:lz,filterMap:lB,partition:lq,partitionMap:lV,partitionMapWithIndex:lK,partitionWithIndex:l$,filterMapWithIndex:l0,filterWithIndex:l1},Foldable:f$,FoldableWithIndex:{URI:fI,reduce:lZ,foldMap:lG,reduceRight:lJ,reduceWithIndex:lY,foldMapWithIndex:lQ,reduceRightWithIndex:lX},FromEither:fY,Functor:fN,FunctorWithIndex:{URI:fI,map:lF,mapWithIndex:lD},Monad:{URI:fI,map:lF,ap:lW,of:am,chain:lU},Pointed:fL,Traversable:fK,TraversableWithIndex:{URI:fI,map:lF,mapWithIndex:lD,reduce:lZ,foldMap:lG,reduceRight:lJ,reduceWithIndex:lY,foldMapWithIndex:lQ,reduceRightWithIndex:lX,traverse:l3,sequence:fS,traverseWithIndex:l4},URI:fI,Unfoldable:{URI:fI,unfold:fk},Witherable:fG,Zero:fB,alt:ff,altW:fl,ap:l9,apFirst:fD,apS:f6,apSecond:fW,append:o1,appendW:o1,array:{URI:fI,compact:fr,separate:fi,map:lF,ap:lW,of:am,chain:lU,filter:lz,filterMap:lB,partition:lq,partitionMap:lV,mapWithIndex:lD,partitionMapWithIndex:lK,partitionWithIndex:l$,filterMapWithIndex:l0,filterWithIndex:l1,alt:lH,zero:l5,unfold:fk,reduce:lZ,foldMap:lG,reduceRight:lJ,traverse:l3,sequence:fS,reduceWithIndex:lY,foldMapWithIndex:lQ,reduceRightWithIndex:lX,traverseWithIndex:l4,extend:l2,wither:fH,wilt:fZ},bind:f5,bindTo:f4,chain:l8,chainFirst:fz,chainRecBreadthFirst:cL,chainRecDepthFirst:cP,chainWithIndex:le,chop:lC,chunksOf:lE,compact:fr,comprehension:function(t,n,r){void 0===r&&(r=function(){return!0});var i=function(t,o){return oQ(o)?Z(ui(o),l8(function(n){return i(Z(t,o1(n)),uo(o))})):r.apply(void 0,t)?[n.apply(void 0,t)]:[]};return i([],t)},concat:lj,concatW:lj,cons:ug,copy:lp,deleteAt:lg,difference:lL,dropLeft:lc,dropLeftWhile:function(t){return function(n){return n.slice(ls(n,t))}},dropRight:ll,duplicate:fh,elem:sl,empty:[],every:cZ,exists:f2,extend:fp,filter:fo,filterE:fJ,filterMap:fn,filterMapWithIndex:ft,filterWithIndex:fd,findFirst:lf,findFirstMap:u3,findIndex:u1,findLast:ld,findLastIndex:u6,findLastMap:u5,flap:fP,flatten:l7,foldLeft:c8,foldMap:fm,foldMapWithIndex:fg,foldRight:c7,fromEither:c6,fromEitherK:fQ,fromOption:c5,fromOptionK:lA,fromPredicate:function(t){return function(n){return t(n)?[n]:[]}},getDifferenceMagma:fj,getEq:cy,getIntersectionSemigroup:fA,getMonoid:fC,getOrd:cv,getSemigroup:fM,getShow:ch,getUnionMonoid:fE,getUnionSemigroup:fR,guard:fq,head:uK,init:lo,insertAt:lh,intercalate:cJ,intersection:lP,intersperse:lO,isEmpty:c2,isNonEmpty:oQ,isOutOfBound:oX,last:uH,lefts:lx,lookup:u$,makeBy:c3,map:l6,mapWithIndex:fe,match:c9,matchLeft:c8,matchLeftW:c8,matchRight:c7,matchRightW:c7,matchW:c9,modifyAt:ly,of:am,partition:fa,partitionMap:fs,partitionMapWithIndex:fc,partitionWithIndex:fu,prepend:o0,prependAll:lw,prependToAll:lw,prependW:o0,range:an,reduce:fy,reduceRight:fb,reduceRightWithIndex:fx,reduceWithIndex:fv,replicate:c4,reverse:lv,rights:lb,rotate:lk,scanLeft:lt,scanRight:ln,separate:fi,sequence:fS,size:lr,snoc:uy,some:f2,sort:l_,sortBy:lM,spanLeft:function(t){return function(n){var r,i=lR(ls(n,t))(n);return{init:i[0],rest:i[1]}}},splitAt:lR,tail:li,takeLeft:la,takeLeftWhile:function(t){return function(n){for(var r=[],i=0;i<n.length;i++){var o=n[i];if(!t(o))break;r.push(o)}return r}},takeRight:lu,traverse:f_,traverseWithIndex:fT,unfold:fk,union:lN,uniq:lI,unsafeDeleteAt:f1,unsafeInsertAt:fX,unsafeUpdateAt:f0,unzip:lT,updateAt:lm,wilt:fO,wither:fw,zero:l5,zip:function t(n,r){return void 0===r?function(r){return t(r,n)}:lS(n,r,function(t,n){return[t,n]})},zipWith:lS},Symbol.toStringTag,{value:"Module"})),f8=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var f7=function(t){return"boolean"==typeof t},de=function(t,n){return function(r){return r?n():t()}},dt={equals:function(t,n){return t===n}},dn={concat:function(t,n){return t&&n}},dr={concat:function(t,n){return t||n}},di={concat:dn.concat,empty:!0},da={concat:dr.concat,empty:!1},du={equals:dt.equals,compare:function(t,n){return t<n?-1:t>n?1:0}};let ds=Object.freeze(Object.defineProperty({__proto__:null,BooleanAlgebra:{meet:function(t,n){return t&&n},join:function(t,n){return t||n},zero:!1,one:!0,implies:function(t,n){return!t||n},not:function(t){return!t}},Eq:dt,MonoidAll:di,MonoidAny:da,Ord:du,SemigroupAll:dn,SemigroupAny:dr,Show:{show:function(t){return JSON.stringify(t)}},fold:de,foldW:de,isBoolean:f7,match:de,matchW:de},Symbol.toStringTag,{value:"Module"}));var dc=function(t){return{meet:function(n,r){return t.join(n,r)},join:function(n,r){return t.meet(n,r)},zero:t.one,one:t.zero,implies:function(n,r){return t.join(t.not(n),r)},not:t.not}};let dl=Object.freeze(Object.defineProperty({__proto__:null,booleanAlgebraBoolean:{meet:function(t,n){return t&&n},join:function(t,n){return t||n},zero:!1,one:!0,implies:function(t,n){return!t||n},not:function(t){return!t}},booleanAlgebraVoid:{meet:function(){},join:function(){},zero:void 0,one:void 0,implies:function(){},not:function(){}},getDualBooleanAlgebra:dc,getFunctionBooleanAlgebra:E,reverse:dc},Symbol.toStringTag,{value:"Module"}));var df=function(t){return ts(t)(t.bottom,t.top)},dd=function(t){var n=e5(t);return{equals:n.equals,compare:n.compare,top:t.bottom,bottom:t.top}},dp={equals:tl.equals,compare:tl.compare,top:1/0,bottom:-1/0};let dh=Object.freeze(Object.defineProperty({__proto__:null,boundedNumber:dp,clamp:df,reverse:dd},Symbol.toStringTag,{value:"Module"}));function dm(t){return{meet:ta(t),join:tu(t)}}let dg=Object.freeze(Object.defineProperty({__proto__:null,getMinMaxDistributiveLattice:dm},Symbol.toStringTag,{value:"Module"})),dy=Object.freeze(Object.defineProperty({__proto__:null,getMinMaxBoundedDistributiveLattice:function(t){var n=dm(t);return function(t,r){return{join:n.join,meet:n.meet,zero:t,one:r}}}},Symbol.toStringTag,{value:"Module"})),dv=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),db=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),dx=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),d_=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var dS=function(t,n){for(var r=n(t);"Left"===r._tag;)r=n(r.left);return r.right};let dT=Object.freeze(Object.defineProperty({__proto__:null,tailRec:dS},Symbol.toStringTag,{value:"Module"}));function dw(t,n){return function(r,i){return n.compose(t.right(i),t.left(r))}}function dO(t,n){var r=dw(t,n);return function(i,o){return n.compose(t.promap(n.id(),function(t){return"Left"===t._tag?t.left:t.right},F),r(i,o))}}let dk=Object.freeze(Object.defineProperty({__proto__:null,fanIn:dO,fanin:function(t){return dO(t,t)},split:dw,splitChoice:function(t){return dw(t,t)}},Symbol.toStringTag,{value:"Module"})),dI=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var dM=function(t,n){return Z(t,dC(n))},dC=function(t){return function(n){return q(t,n)}},dR="Predicate",dE=function(){return{concat:function(t,n){return Z(t,dL(n))}}},dA=function(){return{concat:dE().concat,empty:U}},dj=function(){return{concat:function(t,n){return Z(t,dF(n))}}},dN=function(){return{concat:dj().concat,empty:W}},dP=function(t){return function(n){return!t(n)}},dL=function(t){return function(n){return function(r){return n(r)||t(r)}}},dF=function(t){return function(n){return function(r){return n(r)&&t(r)}}};let dD=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:{URI:dR,contramap:dM},URI:dR,and:dF,contramap:dC,getMonoidAll:dN,getMonoidAny:dA,getSemigroupAll:dj,getSemigroupAny:dE,not:dP,or:dL},Symbol.toStringTag,{value:"Module"}));function dW(t){return function(n){return t(n)?ev(n):ey}}var dU=function(t){return"Right"===t._tag?ey:ev(t.left)},dz=function(t){return"Left"===t._tag?ey:ev(t.right)},dB=function(t,n){return Z(t,d6(n))},dq=function(t,n){return Z(t,d7(n))},dV=function(t,n){return Z(t,pn(n))},d$=function(t,n,r){return Z(t,pi(n,r))},dK=function(t){var n=po(t);return function(t,r){return Z(t,n(r))}},dH=function(t,n,r){return Z(t,pa(n,r))},dZ=function(t){var n=pS(t);return function(t,r){return Z(t,n(r))}},dG=function(t,n){return Z(t,ps(n))},dJ=function(t,n){return Z(t,py(n))},dY=function(t,n){return Z(t,pv(n))},dQ=function(t,n){return Z(t,pd(n))},dX=function(t,n){return Z(t,pb(n))},d0=function(t,n){return Z(t,px(n))},d1="Option",d2=function(t){return{show:function(n){return pA(n)?"none":"some(".concat(t.show(n.value),")")}}},d3=function(t){return{equals:function(n,r){return n===r||(pA(n)?pA(r):!pA(r)&&t.equals(n.value,r.value))}}},d4=function(t){return{equals:d3(t).equals,compare:function(n,r){return n===r?0:pE(n)?pE(r)?t.compare(n.value,r.value):1:-1}}},d5=function(t){return{concat:function(n,r){return pA(n)?r:pA(r)?n:ev(t.concat(n.value,r.value))},empty:ey}},d6=function(t){return function(n){return pA(n)?ey:ev(t(n.value))}},d9={URI:d1,map:dB},d8={URI:d1,of:ev},d7=function(t){return function(n){return pA(n)||pA(t)?ey:ev(n.value(t.value))}},pe={URI:d1,map:dB,ap:dq},pt={URI:d1,map:dB,ap:dq,of:ev},pn=function(t){return function(n){return pA(n)?ey:t(n.value)}},pr={URI:d1,map:dB,ap:dq,chain:dV},pi=function(t,n){return function(r){return pA(r)?t:n(t,r.value)}},po=function(t){return function(n){return function(r){return pA(r)?t.empty:n(r.value)}}},pa=function(t,n){return function(r){return pA(r)?t:n(r.value,t)}},pu=function(t){return function(n){return pA(n)?t():n}},ps=pu,pc=function(){return ey},pl={URI:d1,zero:pc},pf=uR(pl,d8),pd=function(t){return function(n){return pA(n)?ey:ev(t(n))}},pp=pn(F),ph=eE(ey,ey),pm=function(t){return pA(t)?ph:eE(dU(t.value),dz(t.value))},pg={URI:d1,compact:pp,separate:pm},py=function(t){return function(n){return pA(n)?ey:t(n.value)?n:ey}},pv=function(t){return function(n){return pA(n)?ey:t(n.value)}},pb=function(t){return function(n){return eE(dJ(n,dP(t)),dJ(n,t))}},px=function(t){return q(d6(t),pm)},p_={URI:d1,map:dB,compact:pp,separate:pm,filter:dJ,filterMap:dY,partition:dX,partitionMap:d0},pS=function(t){return function(n){return function(r){return pA(r)?t.of(ey):t.map(n(r.value),ev)}}},pT=function(t){return function(n){return pA(n)?t.of(ey):t.map(n.value,ev)}},pw={URI:d1,map:dB,reduce:d$,foldMap:dK,reduceRight:dH,traverse:dZ,sequence:pT},pO=rI(pw,pg),pk=rk(pw,pg),pI=function(t){var n=pO(t);return function(t){return function(r){return n(r,t)}}},pM=function(t){var n=pk(t);return function(t){return function(r){return n(r,t)}}},pC=function(){return ey},pR={URI:d1,fromEither:dz},pE=eg,pA=function(t){return"None"===t._tag},pj=function(t,n){return function(r){return pA(r)?t():n(r.value)}},pN=function(t){return function(n){return pA(n)?t():n.value}},pP=el(d9),pL=eV(pe),pF=e$(pe),pD=eX(pr),pW=pd(F),pU=oK(pR),pz=oH(pR,pr),pB=oZ(pR,pr),pq=function(t){return null==t?ey:ev(t)},pV=function(t){try{return ev(t())}catch{return ey}},p$=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return pV(function(){return t.apply(void 0,n)})}},pK=function(t){return q(t,pq)},pH=function(t){return function(n){return pA(n)?ey:pq(t(n.value))}},pZ=pj(z,F),pG=pj(B,F),pJ=function(t){return function(n){return!pA(n)&&t(n.value)}},pY=ev(eM),pQ=ef(d9),pX=e0(pr),p0=eK(pe),p1=ev(eI),p2=function(t){return function(n){var r=t(0,eO(n));if(pA(r))return ey;for(var i=[r.value],o=1;o<n.length;o++){var a=t(o,n[o]);if(pA(a))return ey;i.push(a.value)}return ev(i)}},p3=function(t){var n=p2(t);return function(t){return ew(t)?n(t):p1}},p4=function(t){return p3(function(n,r){return t(r)})},p5=p4(F),p6={URI:d1,map:dB,of:ev,ap:dq,chain:dV,reduce:d$,foldMap:dK,reduceRight:dH,traverse:dZ,sequence:pT,zero:pc,alt:dG,extend:dQ,compact:pp,separate:pm,filter:dJ,filterMap:dY,partition:dX,partitionMap:d0,wither:pO,wilt:pk,throwError:pC},p9=eH(pe),p8=oW(pt),p7=function(){return d5(tO())},he=function(){return d5(tk())};let ht=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:d1,map:dB,alt:dG},Alternative:{URI:d1,map:dB,ap:dq,of:ev,alt:dG,zero:pc},ApT:p1,Applicative:pt,Apply:pe,Chain:pr,Compactable:pg,Do:pY,Extend:{URI:d1,map:dB,extend:dQ},Filterable:p_,Foldable:{URI:d1,reduce:d$,foldMap:dK,reduceRight:dH},FromEither:pR,Functor:d9,Monad:{URI:d1,map:dB,ap:dq,of:ev,chain:dV},MonadThrow:{URI:d1,map:dB,ap:dq,of:ev,chain:dV,throwError:pC},Pointed:d8,Traversable:pw,URI:d1,Witherable:{URI:d1,map:dB,reduce:d$,foldMap:dK,reduceRight:dH,traverse:dZ,sequence:pT,compact:pp,separate:pm,filter:dJ,filterMap:dY,partition:dX,partitionMap:d0,wither:pO,wilt:pk},Zero:pl,alt:ps,altW:pu,ap:d7,apFirst:pL,apS:p0,apSecond:pF,bind:pX,bindTo:pQ,chain:pn,chainEitherK:pz,chainFirst:pD,chainFirstEitherK:pB,chainNullableK:pH,compact:pp,duplicate:pW,elem:function t(n){return function(r,i){if(void 0===i){var o=t(n);return function(t){return o(r,t)}}return!pA(i)&&n.equals(r,i.value)}},exists:pJ,extend:pd,filter:py,filterMap:pv,flap:pP,flatten:pp,fold:pj,foldMap:po,foldW:pj,fromEither:dz,fromEitherK:pU,fromNullable:pq,fromNullableK:pK,fromPredicate:dW,getApplyMonoid:p8,getApplySemigroup:p9,getEq:d3,getFirstMonoid:p7,getLastMonoid:he,getLeft:dU,getMonoid:d5,getOrElse:pN,getOrElseW:pN,getOrd:d4,getRefinement:function(t){return function(n){return pE(t(n))}},getRight:dz,getShow:d2,guard:pf,isNone:pA,isSome:pE,map:d6,mapNullable:pH,match:pj,matchW:pj,none:ey,of:ev,option:p6,partition:pb,partitionMap:px,reduce:pi,reduceRight:pa,separate:pm,sequence:pT,sequenceArray:p5,some:ev,throwError:pC,toNullable:pZ,toUndefined:pG,traverse:pS,traverseArray:p4,traverseArrayWithIndex:p3,traverseReadonlyArrayWithIndex:p3,traverseReadonlyNonEmptyArrayWithIndex:p2,tryCatch:pV,tryCatchK:p$,wilt:pM,wither:pI,zero:pc},Symbol.toStringTag,{value:"Module"}));function hn(t,n){return function(r){return t.map(r,n.compact)}}function hr(t,n,r){var i=hn(t,n),o=ec(t,r);return function(t){return eE(i(Z(t,o(dU))),i(Z(t,o(dz))))}}let hi=Object.freeze(Object.defineProperty({__proto__:null,compact:hn,getCompactableComposition:function(t,n){return{map:ed(t,n).map,compact:hn(t,n),separate:hr(t,n,n)}},separate:hr},Symbol.toStringTag,{value:"Module"}));var ho=function(t){return function(){return console.log(t)}},ha=function(t){return function(){return console.warn(t)}},hu=function(t){return function(){return console.error(t)}},hs=function(t){return function(){return console.info(t)}};let hc=Object.freeze(Object.defineProperty({__proto__:null,error:hu,info:hs,log:ho,warn:ha},Symbol.toStringTag,{value:"Module"}));function hl(t){return{URI:hx,_E:void 0,map:hp,ap:function(n,r){return F(t.concat(n,r))}}}function hf(t){var n=hl(t);return{URI:hx,_E:void 0,map:n.map,ap:n.ap,of:function(){return F(t.empty)}}}var hd=function(t,n){return Z(t,hg())},hp=function(t,n){return Z(t,hy())},hh=function(t,n,r){return Z(t,hv(n))},hm=function(t,n){return Z(t,hb(n))},hg=function(){return F},hy=function(){return F},hv=function(t){return function(n){return F(t(n))}},hb=function(t){return function(n){return F(t(n))}},hx="Const",h_={URI:hx,map:hp},hS=el(h_);let hT=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:{URI:hx,bimap:hh,mapLeft:hm},Contravariant:{URI:hx,contramap:hd},Functor:h_,URI:hx,bimap:hv,const_:{URI:hx,map:hp,contramap:hd,bimap:hh,mapLeft:hm},contramap:hg,flap:hS,getApplicative:hf,getApply:hl,getBooleanAlgebra:F,getBounded:F,getEq:F,getHeytingAlgebra:F,getMonoid:F,getOrd:F,getRing:F,getSemigroup:F,getSemiring:F,getShow:function(t){return{show:function(n){return"make(".concat(t.show(n),")")}}},make:F,map:hy,mapLeft:hb},Symbol.toStringTag,{value:"Module"})),hw=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var hO=Z(u_,e6(function(t){return t.valueOf()})),hk=function(){return new Date},hI=function(){return new Date().getTime()};let hM=Object.freeze(Object.defineProperty({__proto__:null,Eq:{equals:function(t,n){return t.valueOf()===n.valueOf()}},Ord:hO,create:hk,eqDate:{equals:function(t,n){return t.getDate()===n.getDate()}},eqMonth:{equals:function(t,n){return t.getMonth()===n.getMonth()}},eqYear:{equals:function(t,n){return t.getFullYear()===n.getFullYear()}},now:hI},Symbol.toStringTag,{value:"Module"}));var hC=function(t,n){return Z(t,hJ(n))},hR=function(t,n){return Z(t,h0(n))},hE=function(t,n){return Z(t,h4(n))},hA=function(t,n,r){return Z(t,h6(n,r))},hj=function(t){return function(n,r){var i=h9(t);return Z(n,i(r))}},hN=function(t,n,r){return Z(t,h8(n,r))},hP=function(t){var n=h7(t);return function(t,r){return Z(t,n(r))}},hL=function(t,n,r){return Z(t,mn(n,r))},hF=function(t,n){return Z(t,mr(n))},hD=function(t,n){return Z(t,mo(n))},hW=function(t,n){return Z(t,ma(n))},hU=function(t,n){return dS(n(t),function(t){return ml(t)?eS(e_(t.left)):ml(t.right)?e_(n(t.right.left)):eS(eS(t.right.right))})},hz="Either",hB=function(t,n){return{show:function(r){return ml(r)?"left(".concat(t.show(r.left),")"):"right(".concat(n.show(r.right),")")}}},hq=function(t,n){return{equals:function(r,i){return r===i||(ml(r)?ml(i)&&t.equals(r.left,i.left):mf(i)&&n.equals(r.right,i.right))}}},hV=function(t){return{concat:function(n,r){return ml(r)?n:ml(n)?r:eS(t.concat(n.right,r.right))}}},h$=function(t){var n=e_(t.empty);return{URI:hz,_E:void 0,compact:function(t){return ml(t)?t:"None"===t.right._tag?n:eS(t.right.value)},separate:function(t){return ml(t)?eE(t,t):ml(t.right)?eE(eS(t.right.left),n):eE(n,eS(t.right.right))}}},hK=function(t){var n,r=e_(t.empty),i=h$(t),o=i.compact;return{URI:hz,_E:void 0,map:hC,compact:o,separate:i.separate,filter:function(t,n){return ml(t)||n(t.right)?t:r},filterMap:function(t,n){if(ml(t))return t;var i=n(t.right);return"None"===i._tag?r:eS(i.value)},partition:function(t,n){return ml(t)?eE(t,t):n(t.right)?eE(r,eS(t.right)):eE(eS(t.right),r)},partitionMap:function(t,n){if(ml(t))return eE(t,t);var i=n(t.right);return ml(i)?eE(eS(i.left),r):eE(r,eS(i.right))}}},hH=function(t){var n=hK(t),r=h$(t);return{URI:hz,_E:void 0,map:hC,compact:n.compact,separate:n.separate,filter:n.filter,filterMap:n.filterMap,partition:n.partition,partitionMap:n.partitionMap,traverse:hP,sequence:me,reduce:hA,foldMap:hj,reduceRight:hN,wither:rI(mt,r),wilt:rk(mt,r)}},hZ=function(t){return{URI:hz,_E:void 0,map:hC,ap:function(n,r){return ml(n)?ml(r)?e_(t.concat(n.left,r.left)):n:ml(r)?r:eS(n.right(r.right))},of:hQ}},hG=function(t){return{URI:hz,_E:void 0,map:hC,alt:function(n,r){if(mf(n))return n;var i=r();return ml(i)?e_(t.concat(n.left,i.left)):i}}},hJ=function(t){return function(n){return ml(n)?n:eS(t(n.right))}},hY={URI:hz,map:hC},hQ=eS,hX=function(t){return function(n){return ml(n)?n:ml(t)?t:eS(n.right(t.right))}},h0=hX,h1={URI:hz,map:hC,ap:hR},h2={URI:hz,map:hC,ap:hR,of:hQ},h3=function(t){return function(n){return ml(n)?n:t(n.right)}},h4=h3,h5={URI:hz,map:hC,ap:hR,chain:hE},h6=function(t,n){return function(r){return ml(r)?t:n(t,r.right)}},h9=function(t){return function(n){return function(r){return ml(r)?t.empty:n(r.right)}}},h8=function(t,n){return function(r){return ml(r)?t:n(r.right,t)}},h7=function(t){return function(n){return function(r){return ml(r)?t.of(e_(r.left)):t.map(n(r.right),eS)}}},me=function(t){return function(n){return ml(n)?t.of(e_(n.left)):t.map(n.right,eS)}},mt={URI:hz,map:hC,reduce:hA,foldMap:hj,reduceRight:hN,traverse:hP,sequence:me},mn=function(t,n){return function(r){return ml(r)?e_(t(r.left)):eS(n(r.right))}},mr=function(t){return function(n){return ml(n)?e_(t(n.left)):n}},mi=function(t){return function(n){return ml(n)?t():n}},mo=mi,ma=function(t){return function(n){return ml(n)?n:eS(t(n))}},mu={URI:hz,fromEither:F},ms=oq(mu),mc=oB(mu),ml=eb,mf=ex,md=function(t,n){return function(r){return ml(r)?t(r.left):n(r.right)}},mp=function(t){return function(n){return ml(n)?t(n.left):n.right}},mh=el(hY),mm=eV(h1),mg=e$(h1),my=eX(h5),mv=h3(F),mb=ma(F),mx=oV(mu),m_=o$(mu,h5),mS=oG(mu,h5),mT=function(t){return ml(t)?eS(t.left):e_(t.right)},mw=function(t){return function(n){return ml(n)?t(n.left):n}},mO=function(t){return function(n){return null==n?e_(t):eS(n)}},mk=function(t,n){try{return eS(t())}catch(r){return e_(n(r))}},mI=function(t,n){return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return mk(function(){return t.apply(void 0,r)},n)}},mM=function(t){var n=mO(t);return function(t){return q(t,n)}},mC=function(t){var n=mM(t);return function(t){return h4(n(t))}},mR=md(F,F),mE=function(t){return function(n){return!ml(n)&&t(n.right)}},mA=hQ(eM),mj=ef(hY),mN=e0(h5),mP=eK(h1),mL=hQ(eI),mF=function(t){return function(n){var r=t(0,eO(n));if(ml(r))return r;for(var i=[r.right],o=1;o<n.length;o++){var a=t(o,n[o]);if(ml(a))return a;i.push(a.right)}return eS(i)}},mD=function(t){var n=mF(t);return function(t){return ew(t)?n(t):mL}},mW=function(t){return mD(function(n,r){return t(r)})},mU=mW(F),mz=function(t,n){return mk(function(){var n=JSON.stringify(t);if("string"!=typeof n)throw Error("Converting unsupported structure to JSON");return n},n)},mB=eH(h1),mq=oW(h2),mV=function(t,n){return eH(hZ(t))(n)},m$=function(t,n){return oW(hZ(t))(n)};let mK=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:hz,map:hC,alt:hD},ApT:mL,Applicative:h2,Apply:h1,Bifunctor:{URI:hz,bimap:hL,mapLeft:hF},Chain:h5,ChainRec:{URI:hz,map:hC,ap:hR,chain:hE,chainRec:hU},Do:mA,Extend:{URI:hz,map:hC,extend:hW},Foldable:{URI:hz,reduce:hA,foldMap:hj,reduceRight:hN},FromEither:mu,Functor:hY,Monad:{URI:hz,map:hC,ap:hR,of:hQ,chain:hE},MonadThrow:{URI:hz,map:hC,ap:hR,of:hQ,chain:hE,throwError:e_},Pointed:{URI:hz,of:hQ},Traversable:mt,URI:hz,alt:mo,altW:mi,ap:h0,apFirst:mm,apFirstW:mm,apS:mP,apSW:mP,apSecond:mg,apSecondW:mg,apW:hX,bimap:mn,bind:mN,bindTo:mj,bindW:mN,chain:h4,chainFirst:my,chainFirstW:my,chainNullableK:mC,chainOptionK:m_,chainW:h3,duplicate:mb,either:{URI:hz,map:hC,of:hQ,ap:hR,chain:hE,reduce:hA,foldMap:hj,reduceRight:hN,traverse:hP,sequence:me,bimap:hL,mapLeft:hF,alt:hD,extend:hW,chainRec:hU,throwError:e_},elem:function t(n){return function(r,i){if(void 0===i){var o=t(n);return function(t){return o(r,t)}}return!ml(i)&&n.equals(r,i.right)}},exists:mE,extend:ma,filterOrElse:mS,filterOrElseW:mS,flap:mh,flatten:mv,flattenW:mv,fold:md,foldMap:h9,foldW:md,fromNullable:mO,fromNullableK:mM,fromOption:mc,fromOptionK:mx,fromPredicate:ms,getAltValidation:hG,getApplicativeValidation:hZ,getApplyMonoid:mq,getApplySemigroup:mB,getCompactable:h$,getEq:hq,getFilterable:hK,getOrElse:mp,getOrElseW:mp,getSemigroup:hV,getShow:hB,getValidation:function(t){var n=hZ(t).ap,r=hG(t).alt;return{URI:hz,_E:void 0,map:hC,of:hQ,chain:hE,bimap:hL,mapLeft:hF,reduce:hA,foldMap:hj,reduceRight:hN,extend:hW,traverse:hP,sequence:me,chainRec:hU,throwError:e_,ap:n,alt:r}},getValidationMonoid:m$,getValidationSemigroup:mV,getWitherable:hH,isLeft:ml,isRight:mf,left:e_,map:hJ,mapLeft:mr,match:md,matchW:md,of:hQ,orElse:mw,orElseW:mw,parseJSON:function(t,n){return mk(function(){return JSON.parse(t)},n)},reduce:h6,reduceRight:h8,right:eS,sequence:me,sequenceArray:mU,stringifyJSON:mz,swap:mT,throwError:e_,toError:function(t){return t instanceof Error?t:Error(String(t))},toUnion:mR,traverse:h7,traverseArray:mW,traverseArrayWithIndex:mD,traverseReadonlyArrayWithIndex:mD,traverseReadonlyNonEmptyArrayWithIndex:mF,tryCatch:mk,tryCatchK:mI},Symbol.toStringTag,{value:"Module"}));function mH(t){return q(eS,t.of)}function mZ(t){return q(e_,t.of)}function mG(t){return function(n){return t.map(n,eS)}}function mJ(t){return function(n){return t.map(n,e_)}}function mY(t){return function(n){return q(mO(n),t.of)}}function mQ(t){var n=mY(t);return function(t){var r=n(t);return function(t){return q(t,r)}}}function mX(t){var n=m2(t),r=mQ(t);return function(t){var i=r(t);return function(t){return n(i(t))}}}function m0(t){return ec(t,hY)}function m1(t){return eq(t,h1)}function m2(t){return function(n){return function(r){return t.chain(r,function(r){return ml(r)?t.of(r):n(r.right)})}}}function m3(t){return function(n){return function(r){return t.chain(r,function(r){return ml(r)?n():t.of(r)})}}}function m4(t){return function(n,r){return function(i){return t.map(i,mn(n,r))}}}function m5(t){return function(n){return function(r){return t.map(r,mr(n))}}}function m6(t,n){return function(r){return function(i){return t.chain(i,md(function(i){return t.map(r(),mr(function(t){return n.concat(i,t)}))},mH(t)))}}}function m9(t){return function(n,r){return function(i){return t.map(i,md(n,r))}}}function m8(t){return function(n,r){return function(i){return t.chain(i,md(n,r))}}}function m7(t){return function(n){return function(r){return t.chain(r,md(n,t.of))}}}function ge(t){return function(n){return function(r){return t.chain(r,function(r){return ml(r)?n(r.left):t.of(r)})}}}function gt(t){var n=ge(t);return function(r){return n(function(n){return t.map(r(n),function(t){return ml(t)?t:e_(n)})})}}function gn(t){return function(n){return function(r){return t.chain(r,md(function(r){return t.map(n(r),e_)},function(n){return t.of(eS(n))}))}}}function gr(t){return function(n){return t.map(n,mT)}}function gi(t){return function(n){return t.map(n,mR)}}let go=Object.freeze(Object.defineProperty({__proto__:null,alt:m3,altValidation:m6,ap:m1,bimap:m4,chain:m2,chainNullableK:mX,fromNullable:mY,fromNullableK:mQ,getEitherM:function(t){var n=m1(t),r=m0(t),i=m2(t),o=m3(t),a=m4(t),u=m5(t),s=m8(t),c=m7(t),l=ge(t);return{map:function(t,n){return Z(t,r(n))},ap:function(t,r){return Z(t,n(r))},of:mH(t),chain:function(t,n){return Z(t,i(n))},alt:function(t,n){return Z(t,o(n))},bimap:function(t,n,r){return Z(t,a(n,r))},mapLeft:function(t,n){return Z(t,u(n))},fold:function(t,n,r){return Z(t,s(n,r))},getOrElse:function(t,n){return Z(t,c(n))},orElse:function(t,n){return Z(t,l(n))},swap:gr(t),rightM:mG(t),leftM:mJ(t),left:mZ(t)}},getOrElse:m7,left:mZ,leftF:mJ,map:m0,mapLeft:m5,match:m9,matchE:m8,orElse:ge,orElseFirst:gt,orLeft:gn,right:mH,rightF:mG,swap:gr,toUnion:gi},Symbol.toStringTag,{value:"Module"}));var ga=function(){return{concat:function(t,n){return q(t,n)}}},gu=function(){return{concat:ga().concat,empty:F}};let gs=Object.freeze(Object.defineProperty({__proto__:null,URI:"Endomorphism",getMonoid:gu,getSemigroup:ga},Symbol.toStringTag,{value:"Module"})),gc=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function gl(t,n){var r=n.zero,i=function(o,a){return t.equals(a,r)?o:i(a,n.mod(o,a))};return i}let gf=Object.freeze(Object.defineProperty({__proto__:null,fieldNumber:{add:function(t,n){return t+n},zero:0,mul:function(t,n){return t*n},one:1,sub:function(t,n){return t-n},degree:function(t){return 1},div:function(t,n){return t/n},mod:function(t,n){return t%n}},gcd:gl,lcm:function(t,n){var r=n.zero,i=gl(t,n);return function(o,a){return t.equals(o,r)||t.equals(a,r)?r:n.div(n.mul(o,a),i(o,a))}}},Symbol.toStringTag,{value:"Module"}));function gd(t,n){return function(r){return function(i){return t.map(i,function(t){return n.filter(t,r)})}}}function gp(t,n){return function(r){return function(i){return t.map(i,function(t){return n.filterMap(t,r)})}}}function gh(t,n){var r=gd(t,n);return function(t){var n=r(dP(t)),i=r(t);return function(t){return eE(n(t),i(t))}}}function gm(t,n){var r=gp(t,n);return function(t){return function(n){return eE(Z(n,r(function(n){return dU(t(n))})),Z(n,r(function(n){return dz(t(n))})))}}}let gg=Object.freeze(Object.defineProperty({__proto__:null,filter:gd,filterMap:gp,getFilterableComposition:function(t,n){var r=ed(t,n).map,i=hn(t,n),o=hr(t,n,n),a=gd(t,n),u=gp(t,n),s=gh(t,n),c=gm(t,n);return{map:r,compact:i,separate:o,filter:function(t,n){return Z(t,a(n))},filterMap:function(t,n){return Z(t,u(n))},partition:function(t,n){return Z(t,s(n))},partitionMap:function(t,n){return Z(t,c(n))}}},partition:gh,partitionMap:gm},Symbol.toStringTag,{value:"Module"})),gy=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function gv(t,n){return function(r,i){return function(o){return t.reduce(o,r,function(t,r){return n.reduce(r,t,i)})}}}function gb(t,n){return function(r){var i=t.foldMap(r),o=n.foldMap(r);return function(t){return function(n){return i(n,function(n){return o(n,t)})}}}}function gx(t,n){return function(r,i){return function(o){return t.reduceRight(o,r,function(t,r){return n.reduceRight(t,r,i)})}}}function g_(t){return function(n){return t.reduce(n,[],function(t,n){return t.push(n),t})}}function gS(t,n){var r=gv(t,n),i=gb(t,n),o=gx(t,n);return{reduce:function(t,n,i){return Z(t,r(n,i))},foldMap:function(t){var n=i(t);return function(t,r){return Z(t,n(r))}},reduceRight:function(t,n,r){return Z(t,o(n,r))}}}let gT=Object.freeze(Object.defineProperty({__proto__:null,foldM:function(t,n){return function(r,i,o){return n.reduce(r,t.of(i),function(n,r){return t.chain(n,function(t){return o(t,r)})})}},foldMap:gb,getFoldableComposition:gS,intercalate:function(t,n){return function(r,i){var o=function(n,i){var o=n.init,a=n.acc;return o?{init:!1,acc:i}:{init:!1,acc:t.concat(t.concat(a,r),i)}};return n.reduce(i,{init:!0,acc:t.empty},o).acc}},reduce:gv,reduceM:function(t,n){return function(r,i){return function(o){return n.reduce(o,t.of(r),function(n,r){return t.chain(n,function(t){return i(t,r)})})}}},reduceRight:gx,toArray:g_,toReadonlyArray:g_,traverse_:function(t,n){var r=t.of(void 0);return function(i,o){return n.reduce(i,r,function(n,r){var i,a;return a=o(r),t.ap(t.map(n,D),a)})}}},Symbol.toStringTag,{value:"Module"}));function gw(t,n){return function(r,i){return function(o){return t.reduceWithIndex(o,r,function(t,r,o){return n.reduceWithIndex(o,r,function(n,r,o){return i([t,n],r,o)})})}}}function gO(t,n){return function(r){var i=t.foldMapWithIndex(r),o=n.foldMapWithIndex(r);return function(t){return function(n){return i(n,function(n,r){return o(r,function(r,i){return t([n,r],i)})})}}}}function gk(t,n){return function(r,i){return function(o){return t.reduceRightWithIndex(o,r,function(t,r,o){return n.reduceRightWithIndex(r,o,function(n,r,o){return i([t,n],r,o)})})}}}let gI=Object.freeze(Object.defineProperty({__proto__:null,foldMapWithIndex:gO,getFoldableWithIndexComposition:function(t,n){var r=gS(t,n),i=gw(t,n),o=gO(t,n),a=gk(t,n);return{reduce:r.reduce,foldMap:r.foldMap,reduceRight:r.reduceRight,reduceWithIndex:function(t,n,r){return Z(t,i(n,r))},foldMapWithIndex:function(t){var n=o(t);return function(t,r){return Z(t,n(r))}},reduceRightWithIndex:function(t,n,r){return Z(t,a(n,r))}}},reduceRightWithIndex:gk,reduceWithIndex:gw},Symbol.toStringTag,{value:"Module"}));function gM(t){return function(n){return q(n,t.fromIO)}}function gC(t,n){return function(r){var i=q(r,t.fromIO);return function(t){return n.chain(t,i)}}}function gR(t,n){var r=eX(n);return function(n){return r(q(n,t.fromIO))}}let gE=Object.freeze(Object.defineProperty({__proto__:null,chainFirstIOK:gR,chainIOK:gC,fromIOK:gM},Symbol.toStringTag,{value:"Module"}));var gA=function(){return F},gj=function(t){return function(n){return function(r){return n(t(r))}}},gN=function(t){return function(n){return t(n)(n)}},gP=function(t,n){return Z(t,gU(n))},gL=function(t,n){return Z(t,gB(n))},gF=function(t,n){return Z(t,gV(n))},gD=function(t,n){return Z(t,gK(n))},gW=function(t,n,r){return Z(t,gH(n,r))},gU=function(t){return function(n){return function(r){return t(n(r))}}},gz=function(t){return function(n){return function(r){return n(r)(t(r))}}},gB=gz,gq=function(t){return function(n){return function(r){return t(n(r))(r)}}},gV=gq,g$=gq(F),gK=function(t){return function(n){return q(t,n)}},gH=function(t,n){return function(r){return function(i){return n(r(t(i)))}}},gZ=function(){return F},gG=function(t){return function(n){var r=n[0],i=n[1];return[t(r),i]}},gJ=function(t){return function(n){var r;return[n[0],t(n[1])]}},gY=function(t){return md(function(n){return e_(t(n))},eS)},gQ=function(t){return md(e_,function(n){return eS(t(n))})},gX="Reader",g0={URI:gX,map:gP},g1=el(g0),g2={URI:gX,of:D},g3={URI:gX,map:gP,ap:gL},g4=eV(g3),g5=e$(g3),g6={URI:gX,map:gP,ap:gL,of:D},g9={URI:gX,map:gP,ap:gL,chain:gF},g8={URI:gX,map:gP,of:D,ap:gL,chain:gF},g7=eX(g9),ye=ef(g0),yt=e0(g9),yn=D(eM),yr=eK(g3),yi=D(eI),yo=function(t){return function(n){return function(r){for(var i=[t(0,eO(n))(r)],o=1;o<n.length;o++)i.push(t(o,n[o])(r));return i}}},ya=function(t){var n=yo(t);return function(t){return ew(t)?n(t):yi}},yu=function(t){return ya(function(n,r){return t(r)})},ys=yu(F),yc=eH(g3),yl=oW(g6);let yf=Object.freeze(Object.defineProperty({__proto__:null,ApT:yi,Applicative:g6,Apply:g3,Category:{URI:gX,compose:gD,id:gZ},Chain:g9,Choice:{URI:gX,map:gP,promap:gW,left:gY,right:gQ},Do:yn,Functor:g0,Monad:g8,Pointed:g2,Profunctor:{URI:gX,map:gP,promap:gW},Strong:{URI:gX,map:gP,promap:gW,first:gG,second:gJ},URI:gX,ap:gB,apFirst:g4,apFirstW:g4,apS:yr,apSW:yr,apSecond:g5,apSecondW:g5,apW:gz,ask:gA,asks:F,asksReader:gN,asksReaderW:gN,bind:yt,bindTo:ye,bindW:yt,chain:gV,chainFirst:g7,chainFirstW:g7,chainW:gq,compose:gK,first:gG,flap:g1,flatten:g$,flattenW:g$,getMonoid:yl,getSemigroup:yc,id:gZ,left:gY,local:gj,map:gU,of:D,promap:gH,reader:{URI:gX,map:gP,of:D,ap:gL,chain:gF,promap:gW,compose:gD,id:gZ,first:gG,second:gJ,left:gY,right:gQ},right:gQ,second:gJ,sequenceArray:ys,traverseArray:yu,traverseArrayWithIndex:ya,traverseReadonlyArrayWithIndex:ya,traverseReadonlyNonEmptyArrayWithIndex:yo},Symbol.toStringTag,{value:"Module"}));function yd(t){return function(){return t.fromReader(gA())}}function yp(t){return t.fromReader}function yh(t){return function(n){return q(n,t.fromReader)}}function ym(t,n){var r=yh(t);return function(t){return function(i){return n.chain(i,r(t))}}}function yg(t,n){return q(yh(t),eX(n))}let yy=Object.freeze(Object.defineProperty({__proto__:null,ask:yd,asks:yp,chainFirstReaderK:yg,chainReaderK:ym,fromReaderK:yh},Symbol.toStringTag,{value:"Module"}));var yv=function(){return function(t){return[t,t]}},yb=function(t){return function(){return[void 0,t]}},yx=function(t){return function(n){return[void 0,t(n)]}},y_=function(t){return function(n){return[t(n),n]}},yS=function(t,n){return Z(t,yO(n))},yT=function(t,n){return Z(t,yk(n))},yw=function(t,n){return Z(t,yM(n))},yO=function(t){return function(n){return function(r){var i=n(r),o=i[0],a=i[1];return[t(o),a]}}},yk=function(t){return function(n){return function(r){var i=n(r),o=i[0],a=t(i[1]),u=a[0],s=a[1];return[o(u),s]}}},yI=function(t){return function(n){return[t,n]}},yM=function(t){return function(n){return function(r){var i=n(r),o=i[0],a=i[1];return t(o)(a)}}},yC=yM(F),yR="State",yE={URI:yR,map:yS},yA=el(yE),yj={URI:yR,map:yS,ap:yT},yN=eV(yj),yP=e$(yj),yL={URI:yR,map:yS,ap:yT,chain:yw},yF={URI:yR,map:yS,ap:yT,of:yI,chain:yw},yD=eX(yL),yW=function(t){return function(n){return n(t)[0]}},yU=function(t){return function(n){return n(t)[1]}},yz=ef(yE),yB=e0(yL),yq=eK(yj),yV=function(t){return function(n){return function(r){for(var i=t(0,eO(n))(r),o=i[0],a=i[1],u=[o],s=a,c=1;c<n.length;c++){var l=t(c,n[c])(s),f=l[0],d=l[1];u.push(f),s=d}return[u,s]}}},y$=function(t){var n=yV(t);return function(t){return ew(t)?n(t):yI(eI)}},yK=function(t){return y$(function(n,r){return t(r)})},yH=yK(F),yZ=function(t,n){return t(n)[0]},yG=function(t,n){return t(n)[1]};let yJ=Object.freeze(Object.defineProperty({__proto__:null,Applicative:{URI:yR,map:yS,ap:yT,of:yI},Apply:yj,Chain:yL,FromState:{URI:yR,fromState:F},Functor:yE,Monad:yF,Pointed:{URI:yR,of:yI},URI:yR,ap:yk,apFirst:yN,apS:yq,apSecond:yP,bind:yB,bindTo:yz,chain:yM,chainFirst:yD,evalState:yZ,evaluate:yW,execState:yG,execute:yU,flap:yA,flatten:yC,get:yv,gets:y_,map:yO,modify:yx,of:yI,put:yb,sequenceArray:yH,state:yF,traverseArray:yK,traverseArrayWithIndex:y$,traverseReadonlyArrayWithIndex:y$,traverseReadonlyNonEmptyArrayWithIndex:yV},Symbol.toStringTag,{value:"Module"}));function yY(t){return function(){return t.fromState(yv())}}function yQ(t){return function(n){return t.fromState(yb(n))}}function yX(t){return q(yx,t.fromState)}function y0(t){return q(y_,t.fromState)}function y1(t){return function(n){return q(n,t.fromState)}}function y2(t,n){var r=y1(t);return function(t){return function(i){return n.chain(i,r(t))}}}let y3=Object.freeze(Object.defineProperty({__proto__:null,chainStateK:y2,fromStateK:y1,get:yY,gets:y0,modify:yX,put:yQ},Symbol.toStringTag,{value:"Module"}));function y4(t){return function(n){return q(n,t.fromTask)}}function y5(t,n){return function(r){var i=q(r,t.fromTask);return function(t){return n.chain(t,i)}}}function y6(t,n){var r=eX(n);return function(n){return r(q(n,t.fromTask))}}let y9=Object.freeze(Object.defineProperty({__proto__:null,chainFirstTaskK:y6,chainTaskK:y5,fromTaskK:y4},Symbol.toStringTag,{value:"Module"}));function y8(t){return function(n){return q(n,t.fromThese)}}let y7=Object.freeze(Object.defineProperty({__proto__:null,fromTheseK:y8},Symbol.toStringTag,{value:"Module"}));function ve(t,n){return function(r){return function(i){return t.mapWithIndex(i,function(t,i){return n.mapWithIndex(i,function(n,i){return r([t,n],i)})})}}}let vt=Object.freeze(Object.defineProperty({__proto__:null,getFunctorWithIndexComposition:function(t,n){var r=ed(t,n).map,i=ve(t,n);return{map:r,mapWithIndex:function(t,n){return Z(t,i(n))}}},mapWithIndex:ve},Symbol.toStringTag,{value:"Module"})),vn=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),vr=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),vi=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var vo=function(t,n){return Z(t,vh(n))},va=function(t,n){return Z(t,vm(n))},vu=function(t,n){return Z(t,vg(n))},vs=function(t,n,r){return Z(t,vx(n,r))},vc=function(t){return function(t,n){return Z(t,v_()(n))}},vl=function(t,n,r){return Z(t,vS(n,r))},vf=function(t,n){return Z(t,vk())},vd=function(t,n){return Z(t,vy(n))},vp=function(t){var n=vT(t);return function(t,r){return Z(t,n(r))}},vh=function(t){return function(n){return t(n)}},vm=function(t){return function(n){return n(t)}},vg=function(t){return function(n){return t(n)}},vy=function(t){return function(n){return t(n)}},vv=vy(F),vb=vg(F),vx=function(t,n){return function(r){return n(t,r)}},v_=function(){return function(t){return function(n){return t(n)}}},vS=function(t,n){return function(r){return n(r,t)}},vT=function(t){return function(n){return function(r){return t.map(n(r),F)}}},vw=function(t){return function(n){return t.map(n,F)}},vO=function(){return F},vk=vO,vI="Identity",vM={URI:vI,map:vo},vC=el(vM),vR={URI:vI,map:vo,ap:va},vE=eV(vR),vA=e$(vR),vj={URI:vI,map:vo,ap:va,chain:vu},vN=eX(vj),vP=F(eM),vL=ef(vM),vF=e0(vj),vD=eK(vR);let vW=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:vI,map:vo,alt:vf},Applicative:{URI:vI,map:vo,ap:va,of:F},Apply:vR,Chain:vj,ChainRec:{URI:vI,map:vo,ap:va,chain:vu,chainRec:dS},Comonad:{URI:vI,map:vo,extend:vd,extract:F},Do:vP,Foldable:{URI:vI,reduce:vs,foldMap:vc,reduceRight:vl},Functor:vM,Monad:{URI:vI,map:vo,ap:va,of:F,chain:vu},Pointed:{URI:vI,of:F},Traversable:{URI:vI,map:vo,reduce:vs,foldMap:vc,reduceRight:vl,traverse:vp,sequence:vw},URI:vI,alt:vk,altW:vO,ap:vm,apFirst:vE,apS:vD,apSecond:vA,bind:vF,bindTo:vL,chain:vg,chainFirst:vN,duplicate:vv,extend:vy,extract:F,flap:vC,flatten:vb,foldMap:v_,getEq:F,getShow:F,identity:{URI:vI,map:vo,ap:va,of:F,chain:vu,reduce:vs,foldMap:vc,reduceRight:vl,traverse:vp,sequence:vw,alt:vf,extract:F,extend:vd,chainRec:dS},map:vh,of:F,reduce:vx,reduceRight:vS,sequence:vw,traverse:vT},Symbol.toStringTag,{value:"Module"})),vU=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var vz=function(t,n){return function(){return n(t())}},vB=function(t,n){return function(){return t()(n())}},vq=function(t,n){return function(){return n(t())()}},vV=function(t,n){return function(){for(var r=n(t)();"Left"===r._tag;)r=n(r.left)();return r.right}},v$=function(t){return function(n){return vz(n,t)}},vK=function(t){return function(n){return vB(n,t)}},vH=function(t){return function(n){return vq(n,t)}},vZ=vH(F),vG={URI:"IO",map:vz},vJ=el(vG),vY={URI:"IO",of:D},vQ={URI:"IO",map:vz,ap:vB},vX=eV(vQ),v0=e$(vQ),v1={URI:"IO",map:vz,ap:vB,of:D},v2={URI:"IO",map:vz,ap:vB,chain:vq},v3={URI:"IO",map:vz,ap:vB,of:D,chain:vq},v4=eX(v2),v5=D(eM),v6=ef(vG),v9=e0(v2),v8=eK(vQ),v7=D(eI),be=function(t){return function(n){return function(){for(var r=[t(0,eO(n))()],i=1;i<n.length;i++)r.push(t(i,n[i])());return r}}},bt=function(t){var n=be(t);return function(t){return ew(t)?n(t):v7}},bn=function(t){return bt(function(n,r){return t(r)})},br=bn(F),bi=eH(vQ),bo=oW(v1);let ba=Object.freeze(Object.defineProperty({__proto__:null,ApT:v7,Applicative:v1,Apply:vQ,Chain:v2,ChainRec:{URI:"IO",map:vz,ap:vB,chain:vq,chainRec:vV},Do:v5,FromIO:{URI:"IO",fromIO:F},Functor:vG,Monad:v3,MonadIO:{URI:"IO",map:vz,ap:vB,of:D,chain:vq,fromIO:F},Pointed:vY,URI:"IO",ap:vK,apFirst:vX,apS:v8,apSecond:v0,bind:v9,bindTo:v6,chain:vH,chainFirst:v4,flap:vJ,flatten:vZ,fromIO:F,getMonoid:bo,getSemigroup:bi,io:{URI:"IO",map:vz,of:D,ap:vB,chain:vq,fromIO:F,chainRec:vV},map:v$,of:D,sequenceArray:br,traverseArray:bn,traverseArrayWithIndex:bt,traverseReadonlyArrayWithIndex:bt,traverseReadonlyNonEmptyArrayWithIndex:be},Symbol.toStringTag,{value:"Module"}));var bu=mZ(vY),bs=mH(vY),bc=mG(vG),bl=mJ(vG),bf=m9(vG),bd=m8(v3),bp=m7(v3),bh=function(t,n){return function(){return mk(t,n)}},bm=function(t,n){return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return bh(function(){return t.apply(void 0,r)},n)}},bg=gi(vG),by=ge(v3),bv=gt(v3),bb=function(t){return bv(bG(t))},bx=gn(v3),b_=gr(vG),bS=function(t,n){return Z(t,bC(n))},bT=function(t,n){return Z(t,bA(n))},bw=function(t,n){return Z(t,bj(function(t){return Z(n,bC(t))}))},bO=function(t,n){return Z(t,bj(n))},bk=function(t,n,r){return Z(t,bR(n,r))},bI=function(t,n){return Z(t,bE(n))},bM=function(t,n){return Z(t,bP(n))},bC=m0(vG),bR=m4(vG),bE=m5(vG),bA=m1(vQ),bj=m2(v3),bN=bj(F),bP=m3(v3),bL="IOEither";function bF(t){var n=eq(vQ,hZ(t));return{URI:bL,_E:void 0,map:bS,ap:function(t,r){return Z(t,n(r))},of:bs}}function bD(t){var n=m6(v3,t);return{URI:bL,_E:void 0,map:bS,alt:function(t,r){return Z(t,n(r))}}}var bW=function(t){var n=h$(t);return{URI:bL,_E:void 0,compact:hn(vG,n),separate:hr(vG,n,hY)}},bU={URI:bL,map:bS},bz=el(bU),bB={URI:bL,map:bS,ap:bT},bq=eV(bB),bV=e$(bB),b$={URI:bL,map:bS,ap:bT,of:bs},bK={URI:bL,map:bS,ap:bT,chain:bO},bH=eX(bK),bZ={URI:bL,fromIO:bc},bG=gM(bZ),bJ=gC(bZ,bK),bY=gR(bZ,bK),bQ={URI:bL,fromEither:D},bX=oB(bQ),b0=oV(bQ),b1=o$(bQ,bK),b2=oH(bQ,bK),b3=oZ(bQ,bK),b4=oq(bQ),b5=oG(bQ,bK),b6=oK(bQ),b9=function(t,n,r){return b8(t,n,r)},b8=function(t,n,r){return Z(t,bj(function(t){return Z(n(t),vH(function(n){return Z(r(t,n),bj(function(){return D(n)}))}))}))},b7=bs(eM),xe=ef(bU),xt=e0(bK),xn=eK(bB),xr=bs(eI),xi=function(t){return q(be(t),v$(mF(G)))},xo=function(t){var n=xi(t);return function(t){return ew(t)?n(t):xr}},xa=function(t){return function(n){return function(){var r=t(0,eO(n))();if(eb(r))return r;for(var i=[r.right],o=1;o<n.length;o++){var a=t(o,n[o])();if(eb(a))return a;i.push(a.right)}return eS(i)}}},xu=function(t){var n=xa(t);return function(t){return ew(t)?n(t):xr}},xs=function(t){return xo(function(n,r){return t(r)})},xc=xs(F),xl=function(t){return xu(function(n,r){return t(r)})},xf=xl(F),xd=eH(bB),xp=oW(b$),xh=function(t){return eH(vQ)(hV(t))};let xm=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:bL,map:bS,alt:bM},ApT:xr,Applicative:b$,ApplicativePar:b$,ApplicativeSeq:{URI:bL,map:bS,ap:bw,of:bs},ApplyPar:bB,Bifunctor:{URI:bL,bimap:bk,mapLeft:bI},Chain:bK,Do:b7,FromEither:bQ,FromIO:bZ,Functor:bU,Monad:{URI:bL,map:bS,ap:bT,of:bs,chain:bO},MonadIO:{URI:bL,map:bS,ap:bT,of:bs,chain:bO,fromIO:bc},MonadThrow:{URI:bL,map:bS,ap:bT,of:bs,chain:bO,throwError:bu},Pointed:{URI:bL,of:bs},URI:bL,alt:bP,altW:bP,ap:bA,apFirst:bq,apFirstW:bq,apS:xn,apSW:xn,apSecond:bV,apSecondW:bV,apW:bA,bimap:bR,bind:xt,bindTo:xe,bindW:xt,bracket:b9,bracketW:b8,chain:bj,chainEitherK:b2,chainEitherKW:b2,chainFirst:bH,chainFirstEitherK:b3,chainFirstEitherKW:b3,chainFirstIOK:bY,chainFirstW:bH,chainIOK:bJ,chainOptionK:b1,chainW:bj,filterOrElse:b5,filterOrElseW:b5,flap:bz,flatten:bN,flattenW:bN,fold:bd,foldW:bd,fromEither:D,fromEitherK:b6,fromIO:bc,fromIOK:bG,fromOption:bX,fromOptionK:b0,fromPredicate:b4,getAltIOValidation:bD,getApplicativeIOValidation:bF,getApplyMonoid:xp,getApplySemigroup:xd,getCompactable:bW,getFilterable:function(t){var n=hK(t),r=bW(t),i=gd(vG,n),o=gp(vG,n),a=gh(vG,n),u=gm(vG,n);return{URI:bL,_E:void 0,map:bS,compact:r.compact,separate:r.separate,filter:function(t,n){return Z(t,i(n))},filterMap:function(t,n){return Z(t,o(n))},partition:function(t,n){return Z(t,a(n))},partitionMap:function(t,n){return Z(t,u(n))}}},getIOValidation:function(t){var n=bF(t),r=bD(t);return{URI:bL,_E:void 0,map:bS,ap:n.ap,of:bs,chain:bO,bimap:bk,mapLeft:bI,alt:r.alt,fromIO:bc,throwError:bu}},getOrElse:bp,getOrElseW:bp,getSemigroup:xh,ioEither:{URI:bL,bimap:bk,mapLeft:bI,map:bS,of:bs,ap:bT,chain:bO,alt:bM,fromIO:bc,throwError:bu},left:bu,leftIO:bl,map:bC,mapLeft:bE,match:bf,matchE:bd,matchEW:bd,matchW:bf,of:bs,orElse:by,orElseFirst:bv,orElseFirstIOK:bb,orElseFirstW:bv,orElseW:by,orLeft:bx,right:bs,rightIO:bc,sequenceArray:xc,sequenceSeqArray:xf,swap:b_,throwError:bu,toUnion:bg,traverseArray:xs,traverseArrayWithIndex:xo,traverseReadonlyArrayWithIndex:xo,traverseReadonlyArrayWithIndexSeq:xu,traverseReadonlyNonEmptyArrayWithIndex:xi,traverseReadonlyNonEmptyArrayWithIndexSeq:xa,traverseSeqArray:xl,traverseSeqArrayWithIndex:xu,tryCatch:bh,tryCatchK:bm},Symbol.toStringTag,{value:"Module"}));function xg(t){return q(ev,t.of)}function xy(t){return D(t.of(ey))}function xv(t){return function(n){return t.map(n,ev)}}function xb(t){return q(pq,t.of)}function xx(t){var n=xb(t);return function(t){return q(t,n)}}function x_(t){var n=xE(t),r=xx(t);return function(t){return n(r(t))}}function xS(t){return function(n){return q(n,t.of)}}function xT(t){var n=xE(t),r=xS(t);return function(t){return n(r(t))}}function xw(t){return function(n){return function(r){return t.of(dW(n)(r))}}}function xO(t){return q(dz,t.of)}function xk(t){return function(n,r){return function(i){return t.map(i,pj(n,r))}}}function xI(t){return function(n,r){return function(i){return t.chain(i,pj(n,r))}}}function xM(t){return function(n){return function(r){return t.chain(r,pj(n,t.of))}}}function xC(t){return ec(t,d9)}function xR(t){return eq(t,pe)}function xE(t){var n=xy(t);return function(r){return function(i){return t.chain(i,pj(function(){return n()},r))}}}function xA(t){var n=xg(t);return function(r){return function(i){return t.chain(i,pj(r,n))}}}let xj=Object.freeze(Object.defineProperty({__proto__:null,alt:xA,ap:xR,chain:xE,chainNullableK:x_,chainOptionK:xT,fromEither:xO,fromF:xv,fromNullable:xb,fromNullableK:xx,fromOptionK:xS,fromPredicate:xw,getOptionM:function(t){var n=xR(t),r=xC(t),i=xE(t),o=xA(t),a=xI(t),u=xM(t),s=xy(t);return{map:function(t,n){return Z(t,r(n))},ap:function(t,r){return Z(t,n(r))},of:xg(t),chain:function(t,n){return Z(t,i(n))},alt:function(t,n){return Z(t,o(n))},fold:function(t,n,r){return Z(t,a(n,r))},getOrElse:function(t,n){return Z(t,u(n))},fromM:xv(t),none:function(){return s()}}},getOrElse:xM,map:xC,match:xk,matchE:xI,some:xg,zero:xy},Symbol.toStringTag,{value:"Module"}));var xN=xg(vY),xP=xw(vY),xL=xO(vY),xF=xv(vG),xD=v$(dz),xW=xk(vG),xU=xI(v2),xz=xM(v3),xB=v$(pG),xq=v$(pZ),xV=xb(vY),x$=xx(vY),xK=x_(v3),xH=xS(vY),xZ=xT(v3),xG=xC(vG),xJ=xR(vQ),xY=xE(v3),xQ=xY(F),xX=xA(v3),x0=xy(vY),x1=x0(),x2=hn(vG,pg),x3=hr(vG,pg,d9),x4=gd(vG,p_),x5=gp(vG,p_),x6=gh(vG,p_),x9=gm(vG,p_),x8=function(t,n){return Z(t,xG(n))},x7=function(t,n){return Z(t,xJ(n))},_e=function(t,n){return Z(t,xY(n))},_t=function(t,n){return Z(t,xX(n))},_n=function(t,n){return Z(t,x4(n))},_r=function(t,n){return Z(t,x5(n))},_i=function(t,n){return Z(t,x6(n))},_o=function(t,n){return Z(t,x9(n))},_a="IOOption",_u={URI:_a,map:x8},_s=el(_u),_c={URI:_a,of:xN},_l={URI:_a,map:x8,ap:x7},_f=eV(_l),_d=e$(_l),_p={URI:_a,map:x8,ap:x7,chain:_e},_h=eX(_p),_m={URI:_a,zero:x0},_g=uR(_m,_c),_y={URI:_a,fromIO:xF},_v=gM(_y),_b=gC(_y,_p),_x=gR(_y,_p),__={URI:_a,fromEither:xL},_S=oK(__),_T=oH(__,_p),_w=oZ(__,_p),_O=xN(eM),_k=ef(_u),_I=e0(_p),_M=eK(_l),_C=xN(eI),_R=function(t){return q(be(t),v$(p2(G)))},_E=function(t){var n=_R(t);return function(t){return ew(t)?n(t):_C}};let _A=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:_a,map:x8,alt:_t},Alternative:{URI:_a,map:x8,ap:x7,of:xN,alt:_t,zero:x0},ApT:_C,Applicative:{URI:_a,map:x8,ap:x7,of:xN},Apply:_l,Chain:_p,Compactable:{URI:_a,compact:x2,separate:x3},Do:_O,Filterable:{URI:_a,map:x8,compact:x2,separate:x3,filter:_n,filterMap:_r,partition:_i,partitionMap:_o},FromEither:__,FromIO:_y,Functor:_u,Monad:{URI:_a,map:x8,ap:x7,of:xN,chain:_e},MonadIO:{URI:_a,map:x8,ap:x7,of:xN,chain:_e,fromIO:xF},Pointed:_c,Zero:_m,alt:xX,altW:xX,ap:xJ,apFirst:_f,apS:_M,apSecond:_d,bind:_I,bindTo:_k,chain:xY,chainEitherK:_T,chainFirst:_h,chainFirstEitherK:_w,chainFirstIOK:_x,chainIOK:_b,chainNullableK:xK,chainOptionK:xZ,compact:x2,filter:x4,filterMap:x5,flap:_s,flatten:xQ,fold:xU,fromEither:xL,fromEitherK:_S,fromIO:xF,fromIOEither:xD,fromIOK:_v,fromNullable:xV,fromNullableK:x$,fromOption:D,fromOptionK:xH,fromPredicate:xP,getOrElse:xz,getOrElseW:xz,guard:_g,map:xG,match:xW,matchE:xU,matchEW:xU,matchW:xW,none:x1,of:xN,partition:x6,partitionMap:x9,separate:x3,some:xN,toNullable:xq,toUndefined:xB,traverseReadonlyArrayWithIndex:_E,traverseReadonlyNonEmptyArrayWithIndex:_R,zero:x0},Symbol.toStringTag,{value:"Module"}));var _j=function(){function t(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 t.prototype.write=function(t){var n=this;return function(){n.value=t}},t.prototype.modify=function(t){var n=this;return function(){n.value=t(n.value)}},t}();let _N=Object.freeze(Object.defineProperty({__proto__:null,IORef:_j,newIORef:function(t){return function(){return new _j(t)}}},Symbol.toStringTag,{value:"Module"})),_P=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var _L=function(t){return mk(function(){return JSON.parse(t)},F)},_F=function(t){return mk(function(){var n=JSON.stringify(t);if("string"!=typeof n)throw Error("Converting unsupported structure to JSON");return n},F)};let _D=Object.freeze(Object.defineProperty({__proto__:null,parse:_L,stringify:_F},Symbol.toStringTag,{value:"Module"})),_W=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var _U=function(t){return new Map(t)};function _z(t,n){return{show:function(r){var i=[];return r.forEach(function(r,o){i.push("[".concat(t.show(o),", ").concat(n.show(r),"]"))}),"new Map([".concat(i.sort().join(", "),"])")}}}var _B=function(t){return t.size},_q=function(t){return 0===t.size};function _V(t){var n=_1(t);return function(r,i){if(void 0===i){var o=_V(t);return function(t){return o(r,t)}}return eg(n(r,i))}}function _$(t){return function(n,r){if(void 0===r){var i=_$(t);return function(t){return i(n,t)}}for(var o,a=r.values();!(o=a.next()).done;){var u=o.value;if(t.equals(n,u))return!0}return!1}}var _K=function(t){return function(n){return Array.from(n.keys()).sort(t.compare)}},_H=function(t){return function(n){return Array.from(n.values()).sort(t.compare)}};function _Z(t){var n=_K(t);return function(t){return function(r){for(var i=[],o=n(r),a=0;a<o.length;a++){var u=o[a];i.push(t(u,r.get(u)))}return i}}}var _G=function(t){return _Z(t)(function(t,n){return[t,n]})},_J=function(t){var n=_0(t);return function(t,r){var i=n(t);return function(n){var o=i(n);if(em(o)){var a=new Map(n);return a.set(t,r),a}if(o.value[1]!==r){var a=new Map(n);return a.set(o.value[0],r),a}return n}}},_Y=function(t){var n=_0(t);return function(t){return function(r){var i=n(t,r);if(eg(i)){var o=new Map(r);return o.delete(i.value[0]),o}return r}}},_Q=function(t){var n=_X(t);return function(t,r){return n(t,function(){return r})}},_X=function(t){var n=_0(t);return function(t,r){return function(i){var o=n(t,i);if(em(o))return ey;var a=o.value,u=a[0],s=a[1],c=r(s);if(c===s)return ev(i);var l=new Map(i);return l.set(u,c),ev(l)}}};function _0(t){return function(n,r){if(void 0===r){var i=_0(t);return function(t){return i(n,t)}}for(var o,a=r.entries();!(o=a.next()).done;){var u=o.value,s=u[0],c=u[1];if(t.equals(s,n))return ev([s,c])}return ey}}function _1(t){var n=_0(t);return function(r,i){if(void 0===i){var o=_1(t);return function(t){return o(r,t)}}return Z(n(r,i),d6(function(t){return t[0],t[1]}))}}function _2(t,n){var r=_0(t);return function(i,o){if(void 0===o){var a=_2(t,n);return function(t){return a(t,i)}}for(var u,s=i.entries();!(u=s.next()).done;){var c=u.value,l=c[0],f=c[1],d=r(l,o);if(em(d)||!t.equals(l,d.value[0])||!n.equals(f,d.value[1]))return!1}return!0}}var _3=new Map;function _4(t,n){var r=_2(t,n);return Q(function(t,n){return r(t,n)&&r(n,t)})}var _5=function(t,n){return new Map([[t,n]])},_6=function(t,n){for(var r,i=new Map,o=t.entries();!(r=o.next()).done;){var a=r.value,u=a[0],s=a[1];i.set(u,n(u,s))}return i},_9=function(t){return function(n){for(var r,i=new Map,o=new Map,a=n.entries();!(r=a.next()).done;){var u=r.value,s=u[0],c=t(s,u[1]);eb(c)?i.set(s,c.left):o.set(s,c.right)}return eE(i,o)}};function _8(t){return function(n){for(var r,i=new Map,o=new Map,a=n.entries();!(r=a.next()).done;){var u=r.value,s=u[0],c=u[1];t(s,c)?o.set(s,c):i.set(s,c)}return eE(i,o)}}var _7=function(t){return function(n){for(var r,i=new Map,o=n.entries();!(r=o.next()).done;){var a=r.value,u=a[0],s=t(u,a[1]);eg(s)&&i.set(u,s.value)}return i}};function Se(t){return function(n){for(var r,i=new Map,o=n.entries();!(r=o.next()).done;){var a=r.value,u=a[0],s=a[1];t(u,s)&&i.set(u,s)}return i}}var St=function(t,n){return _6(t,function(t,r){return n(r)})},Sn=function(t,n){return Sa(t,function(t,r){return n(r)})},Sr=function(t,n){return Su(t,function(t,r){return n(r)})},Si=function(t,n){return Ss(t,function(t,r){return n(r)})},So=function(t,n){return Sc(t,function(t,r){return n(r)})},Sa=function(t,n){return Z(t,Se(n))},Su=function(t,n){return Z(t,_7(n))},Ss=function(t,n){return Z(t,_8(n))},Sc=function(t,n){return Z(t,_9(n))},Sl=function(t){for(var n,r=new Map,i=t.entries();!(n=i.next()).done;){var o=n.value,a=o[0],u=o[1];eg(u)&&r.set(a,u.value)}return r},Sf=function(t){return function(n){return Sn(n,t)}},Sd=function(t){return function(n){return Sr(n,t)}},Sp=function(t){return function(n){return St(n,t)}},Sh=function(t){return function(n){return _6(n,t)}},Sm=function(t){return function(n){return Si(n,t)}},Sg=function(t){return function(n){return So(n,t)}},Sy=function(t){for(var n,r=new Map,i=new Map,o=t.entries();!(n=o.next()).done;){var a=n.value,u=a[0],s=a[1];eb(s)?r.set(u,s.left):i.set(u,s.right)}return eE(r,i)},Sv="ReadonlyMap",Sb=function(t,n){var r=SF(t,n);return{concat:function(t,n){return r(n)(t)}}},Sx=function(t,n){return{concat:Sb(t,n).concat,empty:_3}},S_=function(t,n){var r=SD(t,n);return{concat:function(t,n){return r(n)(t)}}},SS=function(t){return function(){var n=SW(t);return{concat:function(t,r){return n(r)(t)}}}},ST={URI:Sv,map:St},Sw=el(ST),SO=function(){return{URI:Sv,_E:void 0,map:St,mapWithIndex:_6}},Sk={URI:Sv,compact:Sl,separate:Sy},SI=function(t){var n=SE(t);return function(t,r){return n(t,function(t,n,i){return r(n,i)})}},SM=function(t){var n=SA(t);return function(t){var r=n(t);return function(t){return r(function(n,r){return t(r)})}}},SC=function(t){var n=Sj(t);return function(t,r){return n(t,function(t,n,i){return r(n,i)})}},SR=function(t){var n=SI(t),r=SM(t),i=SC(t);return{URI:Sv,_E:void 0,reduce:function(t,r,i){return Z(t,n(r,i))},foldMap:function(t){var n=r(t);return function(t,r){return Z(t,n(r))}},reduceRight:function(t,n,r){return Z(t,i(n,r))}}},SE=function(t){var n=_K(t);return function(t,r){return function(i){for(var o=t,a=0,u=n(i);a<u.length;a++){var s=u[a];o=r(s,o,i.get(s))}return o}}},SA=function(t){var n=_K(t);return function(t){return function(r){return function(i){for(var o=t.empty,a=0,u=n(i);a<u.length;a++){var s=u[a];o=t.concat(o,r(s,i.get(s)))}return o}}}},Sj=function(t){var n=_K(t);return function(t,r){return function(i){for(var o=t,a=n(i),u=a.length,s=u-1;s>=0;s--){var c=a[s];o=r(c,i.get(c),o)}return o}}},SN=function(t){var n=SR(t),r=SE(t),i=SA(t),o=Sj(t);return{URI:Sv,_E:void 0,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,reduceWithIndex:function(t,n,i){return Z(t,r(n,i))},foldMapWithIndex:function(t){var n=i(t);return function(t,r){return Z(t,n(r))}},reduceRightWithIndex:function(t,n,r){return Z(t,o(n,r))}}},SP=function(t){var n=SL(t),r=SR(t);return{URI:Sv,_E:void 0,map:St,reduce:r.reduce,foldMap:r.foldMap,reduceRight:r.reduceRight,traverse:n.traverse,sequence:n.sequence}},SL=function(t){var n=SN(t),r=_K(t),i=function(t){return function(n,i){for(var o=t.of(new Map),a=r(n),u=a.length,s=0;s<u;s++)!function(r){var u=a[r],s=n.get(u);o=t.ap(t.map(o,function(t){return function(n){return t.set(u,n)}}),i(u,s))}(s);return o}},o=function(t){var n=i(t);return function(t,r){return n(t,function(t,n){return r(n)})}},a=function(t){var n=i(t);return function(t){return n(t,G)}};return{URI:Sv,_E:void 0,map:St,mapWithIndex:_6,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,reduceWithIndex:n.reduceWithIndex,foldMapWithIndex:n.foldMapWithIndex,reduceRightWithIndex:n.reduceRightWithIndex,traverse:o,sequence:a,traverseWithIndex:i}},SF=function(t,n){var r=_1(t);return function(t){return function(i){if(_q(i))return t;if(_q(t))return i;for(var o,a=new Map,u=i.entries();!(o=u.next()).done;){var s=o.value,c=s[0],l=s[1],f=r(c)(t);eg(f)?a.set(c,n.concat(l,f.value)):a.set(c,l)}for(var d=t.entries();!(o=d.next()).done;){var p=o.value,c=p[0],l=p[1],f=r(c)(a);em(f)&&a.set(c,l)}return a}}},SD=function(t,n){var r=_1(t);return function(t){return function(i){if(_q(i)||_q(t))return _3;for(var o,a=new Map,u=i.entries();!(o=u.next()).done;){var s=o.value,c=s[0],l=s[1],f=r(c)(t);eg(f)&&a.set(c,n.concat(l,f.value))}return a}}},SW=function(t){var n=_V(t);return function(t){return function(r){if(_q(r))return t;if(_q(t))return r;for(var i,o=new Map,a=r.entries();!(i=a.next()).done;){var u=i.value,s=u[0],c=u[1];n(s)(t)||o.set(s,c)}for(var l=t.entries();!(i=l.next()).done;){var f=i.value,s=f[0],c=f[1];n(s)(r)||o.set(s,c)}return o}}};let SU=Object.freeze(Object.defineProperty({__proto__:null,Compactable:Sk,Filterable:{URI:Sv,map:St,compact:Sl,separate:Sy,filter:Sn,filterMap:Sr,partition:Si,partitionMap:So},Functor:ST,URI:Sv,collect:_Z,compact:Sl,deleteAt:_Y,difference:SW,elem:_$,empty:_3,filter:Sf,filterMap:Sd,filterMapWithIndex:_7,filterWithIndex:Se,flap:Sw,foldMap:SM,foldMapWithIndex:SA,fromFoldable:function(t,n,r){return function(i){var o=_0(t);return r.reduce(i,new Map,function(t,r){var i=r[0],a=r[1],u=o(i,t);return eg(u)?t.set(u.value[0],n.concat(u.value[1],a)):t.set(i,a),t})}},fromMap:_U,getDifferenceMagma:SS,getEq:_4,getFilterableWithIndex:function(){return{URI:Sv,_E:void 0,map:St,mapWithIndex:_6,compact:Sl,separate:Sy,filter:Sn,filterMap:Sr,partition:Si,partitionMap:So,partitionMapWithIndex:Sc,partitionWithIndex:Ss,filterMapWithIndex:Su,filterWithIndex:Sa}},getFoldable:SR,getFoldableWithIndex:SN,getFunctorWithIndex:SO,getIntersectionSemigroup:S_,getMonoid:function(t,n){var r=_0(t);return{concat:function(t,i){if(_q(t))return i;if(_q(i))return t;for(var o,a=new Map(t),u=i.entries();!(o=u.next()).done;){var s=o.value,c=s[0],l=s[1],f=r(c,t);eg(f)?a.set(f.value[0],n.concat(f.value[1],l)):a.set(c,l)}return a},empty:_3}},getShow:_z,getTraversable:SP,getTraversableWithIndex:SL,getUnionMonoid:Sx,getUnionSemigroup:Sb,getWitherable:function(t){var n=SL(t);return{URI:Sv,_E:void 0,map:St,compact:Sl,separate:Sy,filter:Sn,filterMap:Sr,partition:Si,partitionMap:So,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,traverse:n.traverse,sequence:n.sequence,mapWithIndex:_6,reduceWithIndex:n.reduceWithIndex,foldMapWithIndex:n.foldMapWithIndex,reduceRightWithIndex:n.reduceRightWithIndex,traverseWithIndex:n.traverseWithIndex,wilt:rk(n,Sk),wither:rI(n,Sk)}},insertAt:_J,intersection:SD,isEmpty:_q,isSubmap:_2,keys:_K,lookup:_1,lookupWithKey:_0,map:Sp,mapWithIndex:Sh,member:_V,modifyAt:_X,partition:Sm,partitionMap:Sg,partitionMapWithIndex:_9,partitionWithIndex:_8,pop:function(t){var n=_1(t),r=_Y(t);return function(t){var i=r(t);return function(r){return Z(n(t,r),d6(function(t){return[t,i(r)]}))}}},readonlyMap:{URI:Sv,map:St,compact:Sl,separate:Sy,filter:Sn,filterMap:Sr,partition:Si,partitionMap:So},reduce:SI,reduceRight:SC,reduceRightWithIndex:Sj,reduceWithIndex:SE,separate:Sy,singleton:_5,size:_B,toMap:function(t){return new Map(t)},toReadonlyArray:_G,toUnfoldable:function(t,n){var r=_G(t);return function(t){var i=r(t),o=i.length;return n.unfold(0,function(t){return t<o?ev([i[t],t+1]):ey})}},union:SF,updateAt:_Q,upsertAt:_J,values:_H},Symbol.toStringTag,{value:"Module"}));var Sz=globalThis&&globalThis.__assign||function(){return(Sz=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t}).apply(this,arguments)},SB=function(t){return function(n){return Array.from(n.keys()).sort(t.compare)}},Sq=function(t){return function(n){return Array.from(n.values()).sort(t.compare)}};function SV(t){var n=SB(t);return function(t){return function(r){for(var i=[],o=n(r),a=0;a<o.length;a++){var u=o[a];i.push(t(u,r.get(u)))}return i}}}function S$(t){return SV(t)(function(t,n){return[t,n]})}var SK=function(t){var n=SJ(t);return function(t,r){var i=n(t);return function(n){var o=i(n);if(em(o)){var a=new Map(n);return a.set(t,r),a}if(o.value[1]!==r){var a=new Map(n);return a.set(o.value[0],r),a}return n}}},SH=function(t){var n=SJ(t);return function(t){return function(r){var i=n(t,r);if(eg(i)){var o=new Map(r);return o.delete(i.value[0]),o}return r}}},SZ=function(t){var n=SG(t);return function(t,r){return n(t,function(){return r})}},SG=function(t){var n=SJ(t);return function(t,r){return function(i){var o=n(t,i);if(em(o))return ey;var a=new Map(i);return a.set(o.value[0],r(o.value[1])),ev(a)}}};function SJ(t){return function(n,r){if(void 0===r){var i=SJ(t);return function(t){return i(n,t)}}for(var o,a=r.entries();!(o=a.next()).done;){var u=o.value,s=u[0],c=u[1];if(t.equals(s,n))return ev([s,c])}return ey}}var SY=function(t,n){return new Map([[t,n]])},SQ=function(t,n){for(var r,i=new Map,o=t.entries();!(r=o.next()).done;){var a=r.value,u=a[0],s=a[1];i.set(u,n(u,s))}return i},SX=function(t){return function(n){for(var r,i=new Map,o=new Map,a=n.entries();!(r=a.next()).done;){var u=r.value,s=u[0],c=t(s,u[1]);eb(c)?i.set(s,c.left):o.set(s,c.right)}return eE(i,o)}};function S0(t){return function(n){for(var r,i=new Map,o=new Map,a=n.entries();!(r=a.next()).done;){var u=r.value,s=u[0],c=u[1];t(s,c)?o.set(s,c):i.set(s,c)}return eE(i,o)}}var S1=function(t){return function(n){for(var r,i=new Map,o=n.entries();!(r=o.next()).done;){var a=r.value,u=a[0],s=t(u,a[1]);eg(s)&&i.set(u,s.value)}return i}};function S2(t){return function(n){for(var r,i=new Map,o=n.entries();!(r=o.next()).done;){var a=r.value,u=a[0],s=a[1];t(u,s)&&i.set(u,s)}return i}}var S3=function(t,n){return SQ(t,function(t,r){return n(r)})},S4=function(t,n){return S8(t,function(t,r){return n(r)})},S5=function(t,n){return S7(t,function(t,r){return n(r)})},S6=function(t,n){return Te(t,function(t,r){return n(r)})},S9=function(t,n){return Tt(t,function(t,r){return n(r)})},S8=function(t,n){return Z(t,S2(n))},S7=function(t,n){return Z(t,S1(n))},Te=function(t,n){return Z(t,S0(n))},Tt=function(t,n){return Z(t,SX(n))},Tn=function(t){for(var n,r=new Map,i=t.entries();!(n=i.next()).done;){var o=n.value,a=o[0],u=o[1];eg(u)&&r.set(a,u.value)}return r},Tr=function(t){return function(n){return S4(n,t)}},Ti=function(t){return function(n){return S5(n,t)}},To=function(t){return function(n){return S3(n,t)}},Ta=function(t){return function(n){return SQ(n,t)}},Tu=function(t){return function(n){return S6(n,t)}},Ts=function(t){return function(n){return S9(n,t)}},Tc=function(t){for(var n,r=new Map,i=new Map,o=t.entries();!(n=o.next()).done;){var a=n.value,u=a[0],s=a[1];eb(s)?r.set(u,s.left):i.set(u,s.right)}return eE(r,i)},Tl=function(t,n){var r=TS(t,n);return{concat:function(t,n){return r(n)(t)}}},Tf=function(t,n){return{concat:Tl(t,n).concat,empty:new Map}},Td=function(t,n){var r=TT(t,n);return{concat:function(t,n){return r(n)(t)}}},Tp=function(t){return function(){var n=Tw(t);return{concat:function(t,r){return n(r)(t)}}}},Th=function(t){return Sz(Sz({},SR(t)),{URI:"Map"})},Tm=function(t){return Sz(Sz({},SN(t)),{URI:"Map"})},Tg=function(t){var n=Tm(t),r=SB(t),i=function(t){return function(n,i){for(var o=t.of(new Map),a=r(n),u=a.length,s=0;s<u;s++)!function(r){var u=a[r],s=n.get(u);o=t.ap(t.map(o,function(t){return function(n){return t.set(u,n)}}),i(u,s))}(s);return o}},o=function(t){var n=i(t);return function(t,r){return n(t,function(t,n){return r(n)})}},a=function(t){var n=i(t);return function(t){return n(t,function(t,n){return n})}};return{URI:"Map",_E:void 0,map:S3,mapWithIndex:SQ,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,reduceWithIndex:n.reduceWithIndex,foldMapWithIndex:n.foldMapWithIndex,reduceRightWithIndex:n.reduceRightWithIndex,traverse:o,sequence:a,traverseWithIndex:i}},Ty={URI:"Map",map:S3},Tv=el(Ty),Tb={URI:"Map",compact:Tn,separate:Tc},Tx={URI:"Map",map:S3,compact:Tn,separate:Tc,filter:S4,filterMap:S5,partition:S6,partitionMap:S9},T_=function(t){return new Map(t)},TS=function(t,n){var r=SF(t,n);return function(t){return function(n){return _q(n)?T_(t):_q(t)?T_(n):r(t)(n)}}},TT=function(t,n){var r=SD(t,n);return function(t){return function(n){return _q(n)||_q(t)?new Map:r(t)(n)}}},Tw=function(t){var n=SW(t);return function(t){return function(r){return _q(r)?T_(t):_q(t)?T_(r):n(t)(r)}}},TO=new Map;let Tk=Object.freeze(Object.defineProperty({__proto__:null,Compactable:Tb,Filterable:Tx,Functor:Ty,URI:"Map",collect:SV,compact:Tn,deleteAt:SH,difference:Tw,elem:_$,empty:TO,filter:Tr,filterMap:Ti,filterMapWithIndex:S1,filterWithIndex:S2,flap:Tv,foldMap:SM,foldMapWithIndex:SA,fromFoldable:function(t,n,r){return function(i){var o=SJ(t);return r.reduce(i,new Map,function(t,r){var i=r[0],a=r[1],u=o(i,t);return eg(u)?t.set(u.value[0],n.concat(u.value[1],a)):t.set(i,a),t})}},getDifferenceMagma:Tp,getEq:_4,getFilterableWithIndex:function(){return{URI:"Map",_E:void 0,map:S3,mapWithIndex:SQ,compact:Tn,separate:Tc,filter:S4,filterMap:S5,partition:S6,partitionMap:S9,partitionMapWithIndex:Tt,partitionWithIndex:Te,filterMapWithIndex:S7,filterWithIndex:S8}},getFoldable:Th,getFoldableWithIndex:Tm,getIntersectionSemigroup:Td,getMonoid:function(t,n){var r=SJ(t);return{concat:function(t,i){if(_q(t))return i;if(_q(i))return t;for(var o,a=new Map(t),u=i.entries();!(o=u.next()).done;){var s=o.value,c=s[0],l=s[1],f=r(c,t);eg(f)?a.set(f.value[0],n.concat(f.value[1],l)):a.set(c,l)}return a},empty:new Map}},getShow:_z,getTraversableWithIndex:Tg,getUnionMonoid:Tf,getUnionSemigroup:Tl,getWitherable:function(t){var n=Tg(t);return{URI:"Map",_E:void 0,map:S3,compact:Tn,separate:Tc,filter:S4,filterMap:S5,partition:S6,partitionMap:S9,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,traverse:n.traverse,sequence:n.sequence,mapWithIndex:SQ,reduceWithIndex:n.reduceWithIndex,foldMapWithIndex:n.foldMapWithIndex,reduceRightWithIndex:n.reduceRightWithIndex,traverseWithIndex:n.traverseWithIndex,wilt:rk(n,Tb),wither:rI(n,Tb)}},insertAt:SK,intersection:TT,isEmpty:_q,isSubmap:_2,keys:SB,lookup:_1,lookupWithKey:SJ,map:To,mapWithIndex:Ta,map_:Tx,member:_V,modifyAt:SG,partition:Tu,partitionMap:Ts,partitionMapWithIndex:SX,partitionWithIndex:S0,pop:function(t){var n=_1(t),r=SH(t);return function(t){var i=r(t);return function(r){return Z(n(t,r),d6(function(t){return[t,i(r)]}))}}},reduce:SI,reduceRight:SC,reduceRightWithIndex:Sj,reduceWithIndex:SE,separate:Tc,singleton:SY,size:_B,toArray:S$,toUnfoldable:function(t,n){var r=S$(t);return function(t){var i=r(t),o=i.length;return n.unfold(0,function(t){return t<o?ev([i[t],t+1]):ey})}},union:TS,updateAt:SZ,upsertAt:SK,values:Sq},Symbol.toStringTag,{value:"Module"})),TI=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),TM=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),TC=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),TR=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),TE=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var TA=function(t){return{concat:tb(t).concat,empty:t.top}},Tj=function(t){return{concat:tx(t).concat,empty:t.bottom}},TN=function(t){return{concat:tp(t).concat,empty:t.empty}},TP=function(t){var n={};for(var r in t)eC.call(t,r)&&(n[r]=t[r].empty);return{concat:tS(t).concat,empty:n}},TL=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return{concat:tT.apply(tN,t).concat,empty:t.map(function(t){return t.empty})}},TF=function(t){return ty(t)(t.empty)},TD={concat:tI.concat,empty:void 0},TW={concat:tC.concat,empty:!0},TU={concat:tR.concat,empty:!1},Tz=function(){return TN(gu())},TB={concat:tE.concat,empty:""},Tq={concat:tA.concat,empty:0},TV={concat:tj.concat,empty:1};let T$=Object.freeze(Object.defineProperty({__proto__:null,concatAll:TF,fold:TF,getDualMonoid:TN,getEndomorphismMonoid:Tz,getFunctionMonoid:j,getJoinMonoid:Tj,getMeetMonoid:TA,getStructMonoid:TP,getTupleMonoid:TL,max:Tj,min:TA,monoidAll:TW,monoidAny:TU,monoidProduct:TV,monoidString:TB,monoidSum:Tq,monoidVoid:TD,reverse:TN,struct:TP,tuple:TL},Symbol.toStringTag,{value:"Module"})),TK=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var TH=function(t,n,r){return function(i){return -1===i?t():0===i?n():r()}},TZ=function(t){return -1===t?1:1===t?-1:0},TG={equals:function(t,n){return t===n}},TJ={concat:function(t,n){return 0!==t?t:n}},TY={concat:TJ.concat,empty:0},TQ=function(t){return t<=-1?-1:t>=1?1:0};let TX=Object.freeze(Object.defineProperty({__proto__:null,Eq:TG,Monoid:TY,Semigroup:TJ,eqOrdering:TG,invert:TZ,match:TH,matchW:TH,monoidOrdering:TY,reverse:TZ,semigroupOrdering:TJ,sign:TQ},Symbol.toStringTag,{value:"Module"})),T0=Object.freeze(Object.defineProperty({__proto__:null,pipe:Z,pipeable:function(t){var n,r,i,o,a,u,s,c,l,f,d,p,h,m,g,y={};if("function"==typeof t.map){var v=function(n){return function(r){return t.map(r,n)}};y.map=v}if("function"==typeof t.contramap){var b=function(n){return function(r){return t.contramap(r,n)}};y.contramap=b}if("function"==typeof t.mapWithIndex){var x=function(n){return function(r){return t.mapWithIndex(r,n)}};y.mapWithIndex=x}if("function"==typeof t.ap){var _=function(n){return function(r){return t.ap(r,n)}},S=function(n){return function(r){return t.ap(t.map(r,function(t){return function(){return t}}),n)}};y.ap=_,y.apFirst=S,y.apSecond=function(n){return function(r){return t.ap(t.map(r,function(){return function(t){return t}}),n)}}}if("function"==typeof t.chain){var T=function(n){return function(r){return t.chain(r,n)}},w=function(n){return function(r){return t.chain(r,function(r){return t.map(n(r),function(){return r})})}},O=function(n){return t.chain(n,F)};y.chain=T,y.chainFirst=w,y.flatten=O}if("function"==typeof t.bimap){var k=function(n,r){return function(i){return t.bimap(i,n,r)}},I=function(n){return function(r){return t.mapLeft(r,n)}};y.bimap=k,y.mapLeft=I}if("function"==typeof t.extend){var M=function(n){return function(r){return t.extend(r,n)}},C=function(n){return t.extend(n,F)};y.extend=M,y.duplicate=C}if("function"==typeof t.reduce){var R=function(n,r){return function(i){return t.reduce(i,n,r)}},E=function(n){var r=t.foldMap(n);return function(t){return function(n){return r(n,t)}}},A=function(n,r){return function(i){return t.reduceRight(i,n,r)}};y.reduce=R,y.foldMap=E,y.reduceRight=A}if("function"==typeof t.reduceWithIndex){var j=function(n,r){return function(i){return t.reduceWithIndex(i,n,r)}},N=function(n){var r=t.foldMapWithIndex(n);return function(t){return function(n){return r(n,t)}}},P=function(n,r){return function(i){return t.reduceRightWithIndex(i,n,r)}};y.reduceWithIndex=j,y.foldMapWithIndex=N,y.reduceRightWithIndex=P}if("function"==typeof t.alt){var L=function(n){return function(r){return t.alt(r,n)}};y.alt=L}if("function"==typeof t.compact&&(y.compact=t.compact,y.separate=t.separate),"function"==typeof t.filter){var D=function(n){return function(r){return t.filter(r,n)}},W=function(n){return function(r){return t.filterMap(r,n)}},U=function(n){return function(r){return t.partition(r,n)}},z=function(n){return function(r){return t.partitionMap(r,n)}};y.filter=D,y.filterMap=W,y.partition=U,y.partitionMap=z}if("function"==typeof t.filterWithIndex){var B=function(n){return function(r){return t.filterWithIndex(r,n)}},q=function(n){return function(r){return t.filterMapWithIndex(r,n)}},V=function(n){return function(r){return t.partitionWithIndex(r,n)}},$=function(n){return function(r){return t.partitionMapWithIndex(r,n)}};y.filterWithIndex=B,y.filterMapWithIndex=q,y.partitionWithIndex=V,y.partitionMapWithIndex=$}if("function"==typeof t.promap){var K=function(n,r){return function(i){return t.promap(i,n,r)}};y.promap=K}if("function"==typeof t.compose){var H=function(n){return function(r){return t.compose(r,n)}};y.compose=H}if("function"==typeof t.throwError){var Z=function(n){return function(r){return"None"===r._tag?t.throwError(n()):t.of(r.value)}},G=function(n){return"Left"===n._tag?t.throwError(n.left):t.of(n.right)},J=function(n,r){return function(i){return n(i)?t.of(i):t.throwError(r(i))}},Y=function(n,r){return function(i){return t.chain(i,function(i){return n(i)?t.of(i):t.throwError(r(i))})}};y.fromOption=Z,y.fromEither=G,y.fromPredicate=J,y.filterOrElse=Y}return y}},Symbol.toStringTag,{value:"Module"})),T1=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),T2=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var T3=function(){return Math.random()};function T4(t,n){return Z(T3,v$(function(r){return Math.floor((n-t+1)*r+t)}))}var T5=Z(T3,v$(function(t){return t<.5})),T6=function(t){return Z(T4(0,t.length-1),v$(function(n){return t[n]}))};let T9=Object.freeze(Object.defineProperty({__proto__:null,random:T3,randomBool:T5,randomElem:T6,randomInt:T4,randomRange:function(t,n){return Z(T3,v$(function(r){return(n-t)*r+t}))}},Symbol.toStringTag,{value:"Module"}));var T8=mZ(g2),T7=mH(g2),we=mG(g0),wt=mJ(g0),wn=m9(g0),wr=m8(g8),wi=m7(g8),wo=gi(g0),wa=ge(g8),wu=gt(g8),ws=gn(g8),wc=gr(g0),wl=function(t,n){return Z(t,wg(n))},wf=function(t,n,r){return Z(t,wy(n,r))},wd=function(t,n){return Z(t,wv(n))},wp=function(t,n){return Z(t,wb(n))},wh=function(t,n){return Z(t,wx(n))},wm=function(t,n){return Z(t,wS(n))},wg=m0(g0),wy=m4(g0),wv=m5(g0),wb=m1(g3),wx=m2(g8),w_=wx(F),wS=m3(g8),wT="ReaderEither",ww=function(t){var n=h$(t);return{URI:wT,_E:void 0,compact:hn(g0,n),separate:hr(g0,n,hY)}};function wO(t){var n=eq(g3,hZ(t));return{URI:wT,_E:void 0,map:wl,ap:function(t,r){return Z(t,n(r))},of:T7}}function wk(t){var n=m6(g8,t);return{URI:wT,_E:void 0,map:wl,alt:function(t,r){return Z(t,n(r))}}}var wI={URI:wT,map:wl},wM=el(wI),wC={URI:wT,map:wl,ap:wp},wR=eV(wC),wE=e$(wC),wA={URI:wT,map:wl,ap:wp,of:T7},wj={URI:wT,map:wl,ap:wp,chain:wh},wN=eX(wj),wP={URI:wT,fromReader:we},wL=yd(wP),wF=yp(wP),wD=yh(wP),wW=ym(wP,wj),wU=yg(wP,wj),wz={URI:wT,fromEither:D},wB=oB(wz),wq=oV(wz),wV=o$(wz,wj),w$=oH(wz,wj),wK=oZ(wz,wj),wH=oq(wz),wZ=oG(wz,wj),wG=oK(wz),wJ=T7(eM),wY=ef(wI),wQ=e0(wj),wX=eK(wC),w0=T7(eI),w1=function(t){return q(yo(t),gU(mF(G)))},w2=function(t){var n=w1(t);return function(t){return ew(t)?n(t):w0}},w3=function(t){return w2(function(n,r){return t(r)})},w4=w3(F),w5=eH(wC),w6=oW(wA),w9=function(t){return eH(g3)(hV(t))};let w8=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:wT,map:wl,alt:wm},ApT:w0,Applicative:wA,Apply:wC,Bifunctor:{URI:wT,bimap:wf,mapLeft:wd},Chain:wj,Do:wJ,FromEither:wz,FromReader:wP,Functor:wI,Monad:{URI:wT,map:wl,ap:wp,of:T7,chain:wh},MonadThrow:{URI:wT,map:wl,ap:wp,of:T7,chain:wh,throwError:T8},Pointed:{URI:wT,of:T7},URI:wT,alt:wS,altW:wS,ap:wb,apFirst:wR,apFirstW:wR,apS:wX,apSW:wX,apSecond:wE,apSecondW:wE,apW:wb,ask:wL,asks:wF,asksReaderEither:gN,asksReaderEitherW:gN,bimap:wy,bind:wQ,bindTo:wY,bindW:wQ,chain:wx,chainEitherK:w$,chainEitherKW:w$,chainFirst:wN,chainFirstEitherK:wK,chainFirstEitherKW:wK,chainFirstReaderK:wU,chainFirstReaderKW:wU,chainFirstW:wN,chainOptionK:wV,chainReaderK:wW,chainReaderKW:wW,chainW:wx,filterOrElse:wZ,filterOrElseW:wZ,flap:wM,flatten:w_,flattenW:w_,fold:wr,foldW:wr,fromEither:D,fromEitherK:wG,fromOption:wB,fromOptionK:wq,fromPredicate:wH,fromReader:we,fromReaderK:wD,getAltReaderValidation:wk,getApplicativeReaderValidation:wO,getApplyMonoid:w6,getApplySemigroup:w5,getCompactable:ww,getFilterable:function(t){var n=hK(t),r=ww(t),i=gd(g0,n),o=gp(g0,n),a=gh(g0,n),u=gm(g0,n);return{URI:wT,_E:void 0,map:wl,compact:r.compact,separate:r.separate,filter:function(t,n){return Z(t,i(n))},filterMap:function(t,n){return Z(t,o(n))},partition:function(t,n){return Z(t,a(n))},partitionMap:function(t,n){return Z(t,u(n))}}},getOrElse:wi,getOrElseW:wi,getReaderValidation:function(t){var n=wO(t),r=wk(t);return{URI:wT,_E:void 0,map:wl,ap:n.ap,of:T7,chain:wh,bimap:wf,mapLeft:wd,alt:r.alt,throwError:T8}},getSemigroup:w9,left:T8,leftReader:wt,local:gj,map:wg,mapLeft:wv,match:wn,matchE:wr,matchEW:wr,matchW:wn,of:T7,orElse:wa,orElseFirst:wu,orElseFirstW:wu,orElseW:wa,orLeft:ws,readerEither:{URI:wT,bimap:wf,mapLeft:wd,map:wl,of:T7,ap:wp,chain:wh,alt:wm,throwError:T8},right:T7,rightReader:we,sequenceArray:w4,swap:wc,throwError:T8,toUnion:wo,traverseArray:w3,traverseArrayWithIndex:w2,traverseReadonlyArrayWithIndex:w2,traverseReadonlyNonEmptyArrayWithIndex:w1},Symbol.toStringTag,{value:"Module"}));function w7(t){return function(n){return function(){return t.of(n)}}}function Oe(t){return function(n){return function(r){return function(i){return t.map(r(i),n)}}}}function Ot(t){return function(n){return function(r){return function(i){return t.ap(r(i),n(i))}}}}function On(t){return function(n){return function(r){return function(i){return t.chain(r(i),function(t){return n(t)(i)})}}}}function Or(t){return function(n){return q(n,t.of)}}let Oi=Object.freeze(Object.defineProperty({__proto__:null,ap:Ot,chain:On,fromNaturalTransformation:function(t){return function(n){return q(n,t)}},fromReader:Or,getReaderM:function(t){var n=Ot(t),r=Oe(t),i=On(t);return{map:function(t,n){return Z(t,r(n))},ap:function(t,r){return Z(t,n(r))},of:w7(t),chain:function(t,n){return Z(t,i(n))},ask:function(){return t.of},asks:function(n){return q(n,t.of)},local:function(t,n){return function(r){return t(n(r))}},fromReader:Or(t),fromM:function(t){return function(){return t}}}},map:Oe,of:w7},Symbol.toStringTag,{value:"Module"}));var Oo=function(t){return function(){return Promise.resolve().then(t)}},Oa=function(t,n){return Z(t,Ol(n))},Ou=function(t,n){return Z(t,Of(n))},Os=function(t,n){return Z(t,Op(function(t){return Z(n,Ol(t))}))},Oc=function(t,n){return Z(t,Op(n))},Ol=function(t){return function(n){return function(){return Promise.resolve().then(n).then(t)}}},Of=function(t){return function(n){return function(){return Promise.all([Promise.resolve().then(n),Promise.resolve().then(t)]).then(function(t){var n;return(0,t[0])(t[1])})}}},Od=function(t){return function(){return Promise.resolve(t)}},Op=function(t){return function(n){return function(){return Promise.resolve().then(n).then(function(n){return t(n)()})}}},Oh=Op(F),Om="Task",Og={URI:Om,map:Oa},Oy=el(Og),Ov={URI:Om,of:Od},Ob={URI:Om,map:Oa,ap:Ou},Ox=eV(Ob),O_=e$(Ob),OS={URI:Om,map:Oa,ap:Ou,of:Od},OT={URI:Om,map:Oa,ap:Os},Ow={URI:Om,map:Oa,ap:Os,of:Od},OO={URI:Om,map:Oa,ap:Ou,chain:Oc},Ok={URI:Om,map:Oa,of:Od,ap:Ou,chain:Oc},OI=eX(OO),OM={URI:Om,fromIO:Oo},OC=gM(OM),OR=gC(OM,OO),OE=gR(OM,OO),OA=function(){return new Promise(function(t){})},Oj=Od(eM),ON=ef(Og),OP=e0(OO),OL=eK(Ob),OF=Od(eI),OD=function(t){return function(n){return function(){return Promise.all(n.map(function(n,r){return Promise.resolve().then(function(){return t(r,n)()})}))}}},OW=function(t){var n=OD(t);return function(t){return ew(t)?n(t):OF}},OU=function(t){return function(n){return function(){return ek(n).reduce(function(n,r,i){return n.then(function(n){return Promise.resolve().then(t(i+1,r)).then(function(t){return n.push(t),n})})},Promise.resolve().then(t(0,eO(n))).then(eT))}}},Oz=function(t){var n=OU(t);return function(t){return ew(t)?n(t):OF}},OB=function(t){return OW(function(n,r){return t(r)})},Oq=OB(F),OV=function(t){return Oz(function(n,r){return t(r)})},O$=OV(F),OK=eH(OT),OH=oW(Ow);let OZ=Object.freeze(Object.defineProperty({__proto__:null,ApT:OF,ApplicativePar:OS,ApplicativeSeq:Ow,ApplyPar:Ob,ApplySeq:OT,Chain:OO,Do:Oj,FromIO:OM,FromTask:{URI:Om,fromIO:Oo,fromTask:F},Functor:Og,Monad:Ok,MonadIO:{URI:Om,map:Oa,of:Od,ap:Ou,chain:Oc,fromIO:Oo},MonadTask:{URI:Om,map:Oa,of:Od,ap:Ou,chain:Oc,fromIO:Oo,fromTask:F},Pointed:Ov,URI:Om,ap:Of,apFirst:Ox,apS:OL,apSecond:O_,bind:OP,bindTo:ON,chain:Op,chainFirst:OI,chainFirstIOK:OE,chainIOK:OR,delay:function(t){return function(n){return function(){return new Promise(function(r){setTimeout(function(){Promise.resolve().then(n).then(r)},t)})}}},flap:Oy,flatten:Oh,fromIO:Oo,fromIOK:OC,fromTask:F,getMonoid:OH,getRaceMonoid:function(){return{concat:function(t,n){return function(){return Promise.race([Promise.resolve().then(t),Promise.resolve().then(n)])}},empty:OA}},getSemigroup:OK,map:Ol,never:OA,of:Od,sequenceArray:Oq,sequenceSeqArray:O$,task:{URI:Om,map:Oa,of:Od,ap:Ou,chain:Oc,fromIO:Oo,fromTask:F},taskSeq:{URI:Om,map:Oa,of:Od,ap:Os,chain:Oc,fromIO:Oo,fromTask:F},traverseArray:OB,traverseArrayWithIndex:OW,traverseReadonlyArrayWithIndex:OW,traverseReadonlyArrayWithIndexSeq:Oz,traverseReadonlyNonEmptyArrayWithIndex:OD,traverseReadonlyNonEmptyArrayWithIndexSeq:OU,traverseSeqArray:OV,traverseSeqArrayWithIndex:Oz},Symbol.toStringTag,{value:"Module"}));var OG=Or(Ov),OJ=q(Oo,D),OY=function(t,n){return Z(t,O1(n))},OQ=function(t,n){return Z(t,O2(n))},OX=function(t,n){return Z(t,O4(function(t){return Z(n,O1(t))}))},O0=function(t,n){return Z(t,O4(n))},O1=Oe(Og),O2=Ot(Ob),O3=w7(Ov),O4=On(Ok),O5=O4(F),O6="ReaderTask",O9={URI:O6,map:OY},O8=el(O9),O7={URI:O6,of:O3},ke={URI:O6,map:OY,ap:OQ},kt=eV(ke),kn=e$(ke),kr={URI:O6,map:OY,ap:OX},ki={URI:O6,map:OY,ap:OX,of:O3},ko={URI:O6,map:OY,ap:OQ,chain:O0},ka={URI:O6,map:OY,of:O3,ap:OQ,chain:O0},ku=eX(ko),ks={URI:O6,fromIO:OJ},kc=gM(ks),kl=gC(ks,ko),kf=gR(ks,ko),kd={URI:O6,fromReader:OG},kp=yd(kd),kh=yp(kd),km=yh(kd),kg=ym(kd,ko),ky=yg(kd,ko),kv={URI:O6,fromIO:OJ,fromTask:D},kb=y4(kv),kx=y5(kv,ko),k_=y6(kv,ko),kS=O3(eM),kT=ef(O9),kw=e0(ko),kO=eK(ke),kk=O3(eI),kI=function(t){return q(yo(t),gU(OD(G)))},kM=function(t){var n=kI(t);return function(t){return ew(t)?n(t):kk}},kC=function(t){return q(yo(t),gU(OU(G)))},kR=function(t){var n=kC(t);return function(t){return ew(t)?n(t):kk}},kE=function(t){return kM(function(n,r){return t(r)})},kA=kE(F),kj=function(t){return kR(function(n,r){return t(r)})},kN=kj(F),kP=eH(kr),kL=oW(ki);function kF(t,n){return t(n)()}let kD=Object.freeze(Object.defineProperty({__proto__:null,ApT:kk,ApplicativePar:{URI:O6,map:OY,ap:OQ,of:O3},ApplicativeSeq:ki,ApplyPar:ke,ApplySeq:kr,Chain:ko,Do:kS,FromIO:ks,FromReader:kd,FromTask:kv,Functor:O9,Monad:ka,MonadIO:{URI:O6,map:OY,of:O3,ap:OQ,chain:O0,fromIO:OJ},MonadTask:{URI:O6,map:OY,of:O3,ap:OQ,chain:O0,fromIO:OJ,fromTask:D},Pointed:O7,URI:O6,ap:O2,apFirst:kt,apS:kO,apSW:kO,apSecond:kn,apW:O2,ask:kp,asks:kh,asksReaderTask:gN,asksReaderTaskW:gN,bind:kw,bindTo:kT,bindW:kw,chain:O4,chainFirst:ku,chainFirstIOK:kf,chainFirstReaderK:ky,chainFirstReaderKW:ky,chainFirstTaskK:k_,chainFirstW:ku,chainIOK:kl,chainReaderK:kg,chainReaderKW:kg,chainTaskK:kx,chainW:O4,flap:O8,flatten:O5,flattenW:O5,fromIO:OJ,fromIOK:kc,fromReader:OG,fromReaderK:km,fromTask:D,fromTaskK:kb,getMonoid:kL,getSemigroup:kP,local:gj,map:O1,of:O3,readerTask:{URI:O6,map:OY,of:O3,ap:OQ,chain:O0,fromIO:OJ,fromTask:D},readerTaskSeq:{URI:O6,map:OY,of:O3,ap:OX,chain:O0,fromIO:OJ,fromTask:D},run:kF,sequenceArray:kA,sequenceSeqArray:kN,traverseArray:kE,traverseArrayWithIndex:kM,traverseReadonlyArrayWithIndex:kM,traverseReadonlyArrayWithIndexSeq:kR,traverseReadonlyNonEmptyArrayWithIndex:kI,traverseReadonlyNonEmptyArrayWithIndexSeq:kC,traverseSeqArray:kj,traverseSeqArrayWithIndex:kR},Symbol.toStringTag,{value:"Module"}));var kW=globalThis&&globalThis.__awaiter||function(t,n,r,i){return new(r||(r=Promise))(function(o,a){function u(t){try{c(i.next(t))}catch(n){a(n)}}function s(t){try{c(i.throw(t))}catch(n){a(n)}}function c(t){var n;t.done?o(t.value):((n=t.value)instanceof r?n:new r(function(t){t(n)})).then(u,s)}c((i=i.apply(t,n||[])).next())})},kU=globalThis&&globalThis.__generator||function(t,n){var r,i,o,a,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(r)throw TypeError("Generator is already executing.");for(;u;)try{if(r=1,i&&(o=2&a[0]?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,i=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){u=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){u.label=a[1];break}if(6===a[0]&&u.label<o[1]){u.label=o[1],o=a;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(a);break}o[2]&&u.ops.pop(),u.trys.pop();continue}a=n.call(t,u)}catch(s){a=[6,s],i=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},kz=mZ(Ov),kB=mH(Ov),kq=mG(Og),kV=mJ(Og),k$=q(Oo,kq),kK=q(Oo,kV),kH=function(t){return Ol(mc(t))},kZ=m9(Og),kG=m8(Ok),kJ=m7(Ok),kY=function(t,n){return function(){return kW(void 0,void 0,void 0,function(){var r;return kU(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,t().then(eS)];case 1:return[2,r.sent()];case 2:return[2,e_(n(r.sent()))];case 3:return[2]}})})}},kQ=function(t,n){return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return kY(function(){return t.apply(void 0,r)},n)}},kX=gi(Og),k0=mY(Ov),k1=mQ(Ov),k2=mX(Ok),k3=ge(Ok),k4=gt(Ok),k5=function(t){return k4(Iz(t))},k6=function(t){return k4(I$(t))},k9=gn(Ok),k8=gr(Og),k7=function(t){var n=kH(t);return function(t){return q(t,n)}},Ie=function(t){return function(n){return function(r){return Z(r,Ih(k7(t)(n)))}}},It=function(t){return q(t,Oo)},In=function(t){return Im(It(t))},Ir=function(t,n){return Z(t,Il(n))},Ii=function(t,n){return Z(t,Ip(n))},Io=function(t,n){return Z(t,Ih(function(t){return Z(n,Il(t))}))},Ia=function(t,n){return Z(t,Ih(n))},Iu=function(t,n,r){return Z(t,If(n,r))},Is=function(t,n){return Z(t,Id(n))},Ic=function(t,n){return Z(t,Iy(n))},Il=m0(Og),If=m4(Og),Id=m5(Og),Ip=m1(Ob),Ih=m2(Ok),Im=Ih,Ig=Im(F),Iy=m3(Ok),Iv="TaskEither";function Ib(t,n){var r=eq(t,hZ(n));return{URI:Iv,_E:void 0,map:Ir,ap:function(t,n){return Z(t,r(n))},of:kB}}function Ix(t){var n=m6(Ok,t);return{URI:Iv,_E:void 0,map:Ir,alt:function(t,r){return Z(t,n(r))}}}var I_=function(t){var n=h$(t);return{URI:Iv,_E:void 0,compact:hn(Og,n),separate:hr(Og,n,hY)}},IS={URI:Iv,map:Ir},IT=el(IS),Iw={URI:Iv,map:Ir,ap:Ii},IO=eV(Iw),Ik=e$(Iw),II={URI:Iv,map:Ir,ap:Io},IM={URI:Iv,map:Ir,ap:Io,of:kB},IC={URI:Iv,map:Ir,ap:Ii,chain:Ia},IR=eX(IC),IE={URI:Iv,fromEither:Od},IA=oB(IE),Ij=oV(IE),IN=o$(IE,IC),IP=oH(IE,IC),IL=oZ(IE,IC),IF=oq(IE),ID=oG(IE,IC),IW=oK(IE),IU={URI:Iv,fromIO:k$},Iz=gM(IU),IB=gC(IU,IC),Iq=gR(IU,IC),IV={URI:Iv,fromIO:k$,fromTask:kq},I$=y4(IV),IK=y5(IV,IC),IH=y6(IV,IC),IZ=function(t,n,r){return IG(t,n,r)},IG=function(t,n,r){return Z(t,Im(function(t){return Z(n(t),Op(function(n){return Z(r(t,n),Im(function(){return Od(n)}))}))}))},IJ=kB(eM),IY=ef(IS),IQ=e0(IC),IX=eK(Iw),I0=kB(eI),I1=function(t){return q(OD(t),Ol(mF(G)))},I2=function(t){var n=I1(t);return function(t){return ew(t)?n(t):I0}},I3=function(t){return function(n){return function(){return ek(n).reduce(function(n,r,i){return n.then(function(o){return eb(o)?n:t(i+1,r)().then(function(t){return eb(t)?t:(o.right.push(t.right),o)})})},t(0,eO(n))().then(hJ(eT)))}}},I4=function(t){var n=I3(t);return function(t){return ew(t)?n(t):I0}},I5=function(t){return I2(function(n,r){return t(r)})},I6=I5(F),I9=function(t){return I4(function(n,r){return t(r)})},I8=I9(F),I7=eH(II),Me=oW(IM),Mt=function(t){return eH(OT)(hV(t))};let Mn=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:Iv,map:Ir,alt:Ic},ApT:I0,ApplicativePar:{URI:Iv,map:Ir,ap:Ii,of:kB},ApplicativeSeq:IM,ApplyPar:Iw,ApplySeq:II,Bifunctor:{URI:Iv,bimap:Iu,mapLeft:Is},Chain:IC,Do:IJ,FromEither:IE,FromIO:IU,FromTask:IV,Functor:IS,Monad:{URI:Iv,map:Ir,ap:Ii,chain:Ia,of:kB},MonadIO:{URI:Iv,map:Ir,ap:Ii,chain:Ia,of:kB,fromIO:k$},MonadTask:{URI:Iv,map:Ir,ap:Ii,chain:Ia,of:kB,fromIO:k$,fromTask:kq},MonadThrow:{URI:Iv,map:Ir,ap:Ii,chain:Ia,of:kB,throwError:kz},Pointed:{URI:Iv,of:kB},URI:Iv,alt:Iy,altW:Iy,ap:Ip,apFirst:IO,apFirstW:IO,apS:IX,apSW:IX,apSecond:Ik,apSecondW:Ik,apW:Ip,bimap:If,bind:IQ,bindTo:IY,bindW:IQ,bracket:IZ,bracketW:IG,chain:Ih,chainEitherK:IP,chainEitherKW:IP,chainFirst:IR,chainFirstEitherK:IL,chainFirstEitherKW:IL,chainFirstIOK:Iq,chainFirstTaskK:IH,chainFirstW:IR,chainIOEitherK:In,chainIOEitherKW:In,chainIOK:IB,chainNullableK:k2,chainOptionK:IN,chainTaskK:IK,chainTaskOptionK:Ie,chainTaskOptionKW:Ie,chainW:Im,filterOrElse:ID,filterOrElseW:ID,flap:IT,flatten:Ig,flattenW:Ig,fold:kG,foldW:kG,fromEither:Od,fromEitherK:IW,fromIO:k$,fromIOEither:Oo,fromIOEitherK:It,fromIOK:Iz,fromNullable:k0,fromNullableK:k1,fromOption:IA,fromOptionK:Ij,fromPredicate:IF,fromTask:kq,fromTaskK:I$,fromTaskOption:kH,fromTaskOptionK:k7,getAltTaskValidation:Ix,getApplicativeTaskValidation:Ib,getApplyMonoid:Me,getApplySemigroup:I7,getCompactable:I_,getFilterable:function(t){var n=hK(t),r=I_(t),i=gd(Og,n),o=gp(Og,n),a=gh(Og,n),u=gm(Og,n);return{URI:Iv,_E:void 0,map:Ir,compact:r.compact,separate:r.separate,filter:function(t,n){return Z(t,i(n))},filterMap:function(t,n){return Z(t,o(n))},partition:function(t,n){return Z(t,a(n))},partitionMap:function(t,n){return Z(t,u(n))}}},getOrElse:kJ,getOrElseW:kJ,getSemigroup:Mt,getTaskValidation:function(t){var n=Ib(OS,t),r=Ix(t);return{URI:Iv,_E:void 0,map:Ir,ap:n.ap,of:kB,chain:Ia,bimap:Iu,mapLeft:Is,alt:r.alt,fromIO:k$,fromTask:kq,throwError:kz}},left:kz,leftIO:kK,leftTask:kV,map:Il,mapLeft:Id,match:kZ,matchE:kG,matchEW:kG,matchW:kZ,of:kB,orElse:k3,orElseFirst:k4,orElseFirstIOK:k5,orElseFirstTaskK:k6,orElseFirstW:k4,orElseW:k3,orLeft:k9,right:kB,rightIO:k$,rightTask:kq,sequenceArray:I6,sequenceSeqArray:I8,swap:k8,taskEither:{URI:Iv,bimap:Iu,mapLeft:Is,map:Ir,of:kB,ap:Ii,chain:Ia,alt:Ic,fromIO:k$,fromTask:kq,throwError:kz},taskEitherSeq:{URI:Iv,bimap:Iu,mapLeft:Is,map:Ir,of:kB,ap:Io,chain:Ia,alt:Ic,fromIO:k$,fromTask:kq,throwError:kz},taskify:function(t){return function(){var n=Array.prototype.slice.call(arguments);return function(){return new Promise(function(r){var i=function(t,n){return null!=t?r(e_(t)):r(eS(n))};t.apply(null,n.concat(i))})}}},throwError:kz,toUnion:kX,traverseArray:I5,traverseArrayWithIndex:I2,traverseReadonlyArrayWithIndex:I2,traverseReadonlyArrayWithIndexSeq:I4,traverseReadonlyNonEmptyArrayWithIndex:I1,traverseReadonlyNonEmptyArrayWithIndexSeq:I3,traverseSeqArray:I9,traverseSeqArrayWithIndex:I4,tryCatch:kY,tryCatchK:kQ},Symbol.toStringTag,{value:"Module"}));var Mr=mZ(O7),Mi=mH(O7),Mo=q(kq,D),Ma=q(kV,D),Mu=function(t){return q(t,kB)},Ms=function(t){return q(t,kz)},Mc=mG(O9),Ml=mJ(O9),Mf=q(k$,D),Md=q(kK,D),Mp=q(Oo,D),Mh=function(t){return q(t,Od)},Mm=m9(O9),Mg=m8(ko),My=m7(ka),Mv=gi(O9),Mb=mY(O7),Mx=mQ(O7),M_=mX(ka),MS=ge(ka),MT=gt(ka),Mw=gn(ka),MO=gr(O9),Mk=function(t){return q(t,Mp)},MI=function(t){return MK(Mk(t))},MM=function(t){return q(t,D)},MC=function(t){return MK(MM(t))},MR=function(t){return M7(MM(t))},ME=function(t){return q(t,Mh)},MA=function(t){return MK(ME(t))},Mj=function(t){return M7(ME(t))},MN=function(t,n){return Z(t,Mz(n))},MP=function(t,n){return Z(t,MV(n))},ML=function(t,n){return Z(t,M$(function(t){return Z(n,Mz(t))}))},MF=function(t,n){return Z(t,M$(n))},MD=function(t,n){return Z(t,MZ(n))},MW=function(t,n,r){return Z(t,MB(n,r))},MU=function(t,n){return Z(t,Mq(n))},Mz=m0(O9),MB=m4(O9),Mq=m5(O9),MV=m1(ke),M$=m2(ka),MK=M$,MH=MK(F),MZ=m3(ka),MG="ReaderTaskEither",MJ=function(t){var n=h$(t);return{URI:MG,_E:void 0,compact:hn(O9,n),separate:hr(O9,n,hY)}};function MY(t,n){var r=eq(g3,Ib(t,n));return{URI:MG,_E:void 0,map:MN,ap:function(t,n){return Z(t,r(n))},of:Mi}}function MQ(t){var n=m6(ka,t);return{URI:MG,_E:void 0,map:MN,alt:function(t,r){return Z(t,n(r))}}}var MX={URI:MG,map:MN},M0=el(MX),M1={URI:MG,of:Mi},M2={URI:MG,map:MN,ap:MP},M3=eV(M2),M4=e$(M2),M5={URI:MG,map:MN,ap:ML},M6={URI:MG,map:MN,ap:ML,of:Mi},M9={URI:MG,map:MN,ap:MP,chain:MF},M8=eX(M9),M7=M8,Ce={URI:MG,fromReader:Mu},Ct=yd(Ce),Cn=yp(Ce),Cr=yh(Ce),Ci=ym(Ce,M9),Co=yg(Ce,M9),Ca=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return Mc(t.apply(void 0,n))}},Cu=function(t){return MK(Ca(t))},Cs=function(t){return M7(Ca(t))},Cc={URI:MG,fromEither:O3},Cl=oB(Cc),Cf=oV(Cc),Cd=o$(Cc,M9),Cp=oH(Cc,M9),Ch=oZ(Cc,M9),Cm=oq(Cc),Cg=oG(Cc,M9),Cy=oK(Cc),Cv={URI:MG,fromIO:Mf},Cb=gM(Cv),Cx=gC(Cv,M9),C_=gR(Cv,M9),CS={URI:MG,fromIO:Mf,fromTask:Mo},CT=y4(CS),Cw=y5(CS,M9),CO=y6(CS,M9);function Ck(t,n,r){return CI(t,n,r)}function CI(t,n,r){return function(i){return IG(t(i),function(t){return n(t)(i)},function(t,n){return r(t,n)(i)})}}var CM=Mi(eM),CC=ef(MX),CR=e0(M9),CE=eK(M2),CA=Mi(eI),Cj=function(t){return q(yo(t),gU(I1(G)))},CN=function(t){var n=Cj(t);return function(t){return ew(t)?n(t):CA}},CP=function(t){return q(yo(t),gU(I3(G)))},CL=function(t){var n=CP(t);return function(t){return ew(t)?n(t):CA}},CF=function(t){return CN(function(n,r){return t(r)})},CD=CF(F),CW=function(t){return CL(function(n,r){return t(r)})},CU=CW(F),Cz=eH(M5),CB=oW(M6),Cq=function(t){return eH(kr)(hV(t))};function CV(t,n){return t(n)()}let C$=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:MG,map:MN,alt:MD},ApT:CA,ApplicativePar:{URI:MG,map:MN,ap:MP,of:Mi},ApplicativeSeq:M6,ApplyPar:M2,ApplySeq:M5,Bifunctor:{URI:MG,bimap:MW,mapLeft:MU},Chain:M9,Do:CM,FromEither:Cc,FromIO:Cv,FromReader:Ce,FromTask:CS,Functor:MX,Monad:{URI:MG,map:MN,ap:MP,chain:MF,of:Mi},MonadIO:{URI:MG,map:MN,ap:MP,chain:MF,of:Mi,fromIO:Mf},MonadTask:{URI:MG,map:MN,ap:MP,chain:MF,of:Mi,fromIO:Mf,fromTask:Mo},MonadThrow:{URI:MG,map:MN,ap:MP,chain:MF,of:Mi,throwError:Mr},Pointed:M1,URI:MG,alt:MZ,altW:MZ,ap:MV,apFirst:M3,apFirstW:M3,apS:CE,apSW:CE,apSecond:M4,apSecondW:M4,apW:MV,ask:Ct,asks:Cn,asksReaderTaskEither:gN,asksReaderTaskEitherW:gN,bimap:MB,bind:CR,bindTo:CC,bindW:CR,bracket:Ck,bracketW:CI,chain:M$,chainEitherK:Cp,chainEitherKW:Cp,chainFirst:M8,chainFirstEitherK:Ch,chainFirstEitherKW:Ch,chainFirstIOK:C_,chainFirstReaderEitherK:Mj,chainFirstReaderEitherKW:Mj,chainFirstReaderK:Co,chainFirstReaderKW:Co,chainFirstReaderTaskK:Cs,chainFirstReaderTaskKW:Cs,chainFirstTaskEitherK:MR,chainFirstTaskEitherKW:MR,chainFirstTaskK:CO,chainFirstW:M7,chainIOEitherK:MI,chainIOEitherKW:MI,chainIOK:Cx,chainNullableK:M_,chainOptionK:Cd,chainReaderEitherK:MA,chainReaderEitherKW:MA,chainReaderK:Ci,chainReaderKW:Ci,chainReaderTaskK:Cu,chainReaderTaskKW:Cu,chainTaskEitherK:MC,chainTaskEitherKW:MC,chainTaskK:Cw,chainW:MK,filterOrElse:Cg,filterOrElseW:Cg,flap:M0,flatten:MH,flattenW:MH,fold:Mg,foldW:Mg,fromEither:O3,fromEitherK:Cy,fromIO:Mf,fromIOEither:Mp,fromIOEitherK:Mk,fromIOK:Cb,fromNullable:Mb,fromNullableK:Mx,fromOption:Cl,fromOptionK:Cf,fromPredicate:Cm,fromReader:Mu,fromReaderEither:Mh,fromReaderEitherK:ME,fromReaderK:Cr,fromReaderTaskK:Ca,fromTask:Mo,fromTaskEither:D,fromTaskEitherK:MM,fromTaskK:CT,getAltReaderTaskValidation:MQ,getApplicativeReaderTaskValidation:MY,getApplyMonoid:CB,getApplySemigroup:Cz,getCompactable:MJ,getFilterable:function(t){var n=hK(t),r=MJ(t),i=gd(O9,n),o=gp(O9,n),a=gh(O9,n),u=gm(O9,n);return{URI:MG,_E:void 0,map:MN,compact:r.compact,separate:r.separate,filter:function(t,n){return Z(t,i(n))},filterMap:function(t,n){return Z(t,o(n))},partition:function(t,n){return Z(t,a(n))},partitionMap:function(t,n){return Z(t,u(n))}}},getOrElse:My,getOrElseW:My,getReaderTaskValidation:function(t){var n=MY(OS,t),r=MQ(t);return{URI:MG,_E:void 0,map:MN,of:Mi,chain:MF,bimap:MW,mapLeft:MU,ap:n.ap,alt:r.alt,fromIO:Mf,fromTask:Mo,throwError:Mr}},getSemigroup:Cq,left:Mr,leftIO:Md,leftReader:Ms,leftReaderTask:Ml,leftTask:Ma,local:gj,map:Mz,mapLeft:Mq,match:Mm,matchE:Mg,matchEW:Mg,matchW:Mm,of:Mi,orElse:MS,orElseFirst:MT,orElseFirstW:MT,orElseW:MS,orLeft:Mw,readerTaskEither:{URI:MG,map:MN,of:Mi,ap:MP,chain:MF,alt:MD,bimap:MW,mapLeft:MU,fromIO:Mf,fromTask:Mo,throwError:Mr},readerTaskEitherSeq:{URI:MG,map:MN,of:Mi,ap:ML,chain:MF,alt:MD,bimap:MW,mapLeft:MU,fromIO:Mf,fromTask:Mo,throwError:Mr},right:Mi,rightIO:Mf,rightReader:Mu,rightReaderTask:Mc,rightTask:Mo,run:CV,sequenceArray:CD,sequenceSeqArray:CU,swap:MO,throwError:Mr,toUnion:Mv,traverseArray:CF,traverseArrayWithIndex:CN,traverseReadonlyArrayWithIndex:CN,traverseReadonlyArrayWithIndexSeq:CL,traverseReadonlyNonEmptyArrayWithIndex:Cj,traverseReadonlyNonEmptyArrayWithIndexSeq:CP,traverseSeqArray:CW,traverseSeqArrayWithIndex:CL},Symbol.toStringTag,{value:"Module"}));var CK=function(t){return new Set(t)},CH=function(t){return new Set([t])},CZ=function(t){return function(n){for(var r=n.length,i=new Set,o=Rr(t),a=0;a<r;a++){var u=n[a];o(u,i)||i.add(u)}return i}};function CG(t){return function(n){for(var r,i=n.values(),o=new Set;!(r=i.next()).done;){var a=r.value;t(a)&&o.add(a)}return o}}function CJ(t){var n=Rr(t);return function(r,i){if(void 0===i){var o=CJ(t);return function(t){return o(r,t)}}if(C8(r))return i;if(C8(i))return r;var a=new Set(r);return i.forEach(function(t){n(t,a)||a.add(t)}),a}}function CY(t){var n=Rr(t);return function(r,i){if(void 0===i){var o=CY(t);return function(t){return o(t,r)}}if(C8(r)||C8(i))return C9;var a=new Set;return r.forEach(function(t){n(t,i)&&a.add(t)}),a}}function CQ(t){var n=Rr(t);return function(r,i){if(void 0===i){var o=CQ(t);return function(t){return o(t,r)}}return CG(function(t){return!n(t,i)})(r)}}function CX(t){var n=Ri(t);return function(t,r){return function(i){return n(i).reduce(r,t)}}}function C0(t,n){var r=Ri(t);return function(t){return function(i){return r(i).reduce(function(r,i){return n.concat(r,t(i))},n.empty)}}}var C1=function(t){var n=Ri(t);return function(t,r){return function(i){return n(i).reduceRight(function(t,n){return r(n,t)},t)}}};function C2(t){var n=Rr(t);return function(t){return function(r){if(n(t)(r))return r;var i=new Set(r);return i.add(t),i}}}var C3=function(t){return function(n){return function(r){return CG(function(r){return!t.equals(n,r)})(r)}}},C4=function(t){var n=Rr(t),r=C3(t),i=C2(t);return function(t){return function(o){return(n(t,o)?r:i)(t)(o)}}},C5=function(t){return C6(t)(F)};function C6(t){var n=Rr(t);return function(t){return function(r){var i=new Set;return r.forEach(function(r){var o=t(r);"Some"!==o._tag||n(o.value,i)||i.add(o.value)}),i}}}var C9=new Set,C8=function(t){return 0===t.size},C7=function(t){return t.size},Re=function(t){return function(n){for(var r,i=n.values(),o=!1;!o&&!(r=i.next()).done;)o=t(r.value);return o}};function Rt(t){return dP(Re(dP(t)))}function Rn(t){var n=Rr(t);return function(r,i){if(void 0===i){var o=Rn(t);return function(t){return o(t,r)}}return Rt(function(t){return n(t,i)})(r)}}function Rr(t){return function(n,r){if(void 0===r){var i=Rr(t);return function(t){return i(n,t)}}for(var o,a=r.values(),u=!1;!u&&!(o=a.next()).done;)u=t.equals(n,o.value);return u}}var Ri=function(t){return function(n){var r=[];return n.forEach(function(t){return r.push(t)}),r.sort(t.compare)}};function Ro(t){return{show:function(n){var r=[];return n.forEach(function(n){r.push(t.show(n))}),"new Set([".concat(r.sort().join(", "),"])")}}}function Ra(t){var n=Rn(t);return Q(function(t,r){return n(t,r)&&n(r,t)})}var Ru=function(t){return{concat:CJ(t)}},Rs=function(t){return{concat:Ru(t).concat,empty:C9}},Rc=function(t){return{concat:CY(t)}},Rl=function(t){return{concat:CQ(t)}};let Rf=Object.freeze(Object.defineProperty({__proto__:null,URI:"ReadonlySet",chain:function(t){var n=Rr(t);return function(t){return function(r){var i=new Set;return r.forEach(function(r){t(r).forEach(function(t){n(t,i)||i.add(t)})}),i}}},compact:C5,difference:CQ,elem:Rr,empty:C9,every:Rt,filter:CG,filterMap:C6,foldMap:C0,fromArray:CZ,fromReadonlyArray:CZ,fromSet:CK,getDifferenceMagma:Rl,getEq:Ra,getIntersectionSemigroup:Rc,getShow:Ro,getUnionMonoid:Rs,getUnionSemigroup:Ru,insert:C2,intersection:CY,isEmpty:C8,isSubset:Rn,map:function(t){var n=Rr(t);return function(t){return function(r){var i=new Set;return r.forEach(function(r){var o=t(r);n(o,i)||i.add(o)}),i}}},partition:function(t){return function(n){for(var r,i=n.values(),o=new Set,a=new Set;!(r=i.next()).done;){var u=r.value;t(u)?o.add(u):a.add(u)}return eE(a,o)}},partitionMap:function(t,n){return function(r){return function(i){for(var o,a=i.values(),u=new Set,s=new Set,c=Rr(t),l=Rr(n);!(o=a.next()).done;){var f=r(o.value);switch(f._tag){case"Left":c(f.left,u)||u.add(f.left);break;case"Right":l(f.right,s)||s.add(f.right)}}return eE(u,s)}}},reduce:CX,reduceRight:C1,remove:C3,separate:function(t,n){return function(r){var i=Rr(t),o=Rr(n),a=new Set,u=new Set;return r.forEach(function(t){switch(t._tag){case"Left":i(t.left,a)||a.add(t.left);break;case"Right":o(t.right,u)||u.add(t.right)}}),eE(a,u)}},singleton:CH,size:C7,some:Re,toReadonlyArray:Ri,toSet:function(t){return new Set(t)},toggle:C4,union:CJ},Symbol.toStringTag,{value:"Module"}));function Rd(t){return t[0]}function Rp(t){return t[1]}var Rh=function(t){var n;return[Rp(t),t[0]]};function Rm(t){return{URI:RD,_E:void 0,map:Rb,ap:function(n,r){var i,o;return[(0,n[0])(r[0]),t.concat(Rp(n),Rp(r))]}}}var Rg=function(t){return function(n){return[n,t.empty]}};function Ry(t){var n=Rm(t);return{URI:RD,_E:void 0,map:n.map,ap:n.ap,chain:function(n,r){var i,o=r(n[0]),a=o[0],u=o[1];return[a,t.concat(Rp(n),u)]}}}var Rv=function(t,n){return Z(t,RR(n))},Rb=function(t,n){return Z(t,RM(n))},Rx=function(t,n,r){return Z(t,RI(n,r))},R_=function(t,n){return Z(t,RC(n))},RS=function(t,n){return Z(t,RE(n))},RT=function(t,n,r){return Z(t,Rj(n,r))},Rw=function(t){var n=RN();return function(t,r){return Z(t,n(r))}},RO=function(t,n,r){return Z(t,RP(n,r))},Rk=function(t){var n=RL(t);return function(t,r){return Z(t,n(r))}},RI=function(t,n){return function(r){var i;return[n(r[0]),t(Rp(r))]}},RM=function(t){return function(n){var r;return[t(n[0]),Rp(n)]}},RC=function(t){return function(n){var r;return[n[0],t(Rp(n))]}},RR=function(t){return function(n){var r;return[n[0],Rp(t)]}},RE=function(t){return function(n){return[t(n),Rp(n)]}},RA=RE(F),Rj=function(t,n){return function(r){var i;return n(t,r[0])}},RN=function(){return function(t){return function(n){var r;return t(n[0])}}},RP=function(t,n){return function(r){var i;return n(r[0],t)}},RL=function(t){return function(n){return function(r){var i;return t.map(n(r[0]),function(t){return[t,Rp(r)]})}}},RF=function(t){return function(n){var r;return t.map(n[0],function(t){return[t,Rp(n)]})}},RD="ReadonlyTuple",RW={URI:RD,map:Rb},RU=el(RW);let Rz=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:{URI:RD,bimap:Rx,mapLeft:R_},Comonad:{URI:RD,map:Rb,extend:RS,extract:Rd},Foldable:{URI:RD,reduce:RT,foldMap:Rw,reduceRight:RO},Functor:RW,Semigroupoid:{URI:RD,compose:Rv},Traversable:{URI:RD,map:Rb,reduce:RT,foldMap:Rw,reduceRight:RO,traverse:Rk,sequence:RF},URI:RD,bimap:RI,compose:RR,duplicate:RA,extend:RE,extract:Rd,flap:RU,foldMap:RN,fst:Rd,getApplicative:function(t){var n=Rm(t);return{URI:RD,_E:void 0,map:n.map,ap:n.ap,of:Rg(t)}},getApply:Rm,getChain:Ry,getChainRec:function(t){var n=function(n,r){for(var i,o,a=r(n),u=t.empty,s=(i=a)[0];"Left"===s._tag;)u=t.concat(u,Rp(a)),s=(a=r(s.left))[0];return[s.right,t.concat(u,Rp(a))]},r=Ry(t);return{URI:RD,_E:void 0,map:r.map,ap:r.ap,chain:r.chain,chainRec:n}},getMonad:function(t){var n=Ry(t);return{URI:RD,_E:void 0,map:n.map,ap:n.ap,chain:n.chain,of:Rg(t)}},map:RM,mapFst:RM,mapLeft:RC,mapSnd:RC,readonlyTuple:{URI:RD,compose:Rv,map:Rb,bimap:Rx,mapLeft:R_,extract:Rd,extend:RS,reduce:RT,foldMap:Rw,reduceRight:RO,traverse:Rk,sequence:RF},reduce:Rj,reduceRight:RP,sequence:RF,snd:Rp,swap:Rh,traverse:RL},Symbol.toStringTag,{value:"Module"}));var RB=globalThis&&globalThis.__assign||function(){return(RB=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t}).apply(this,arguments)},Rq=function(t){return function(n){return Object.keys(n).sort(t.compare)}},RV=Rq(rl);function R$(t){if("function"==typeof t)return R$(rl)(t);var n=Rq(t);return function(t){return function(r){for(var i=[],o=0,a=n(r);o<a.length;o++){var u=a[o];i.push(t(u,r[u]))}return i}}}var RK=R$(rl)(function(t,n){return[t,n]});function RH(t){return function(n){if(!eC.call(n,t))return n;var r=Object.assign({},n);return delete r[t],r}}var RZ=function(t,n){return RG(t,function(){return n})},RG=function(t,n){return function(r){if(!rW(t,r))return ey;var i=Object.assign({},r);return i[t]=n(r[t]),ev(i)}};function RJ(t){return rQ(t)}function RY(t){return rX(t)}function RQ(t){return r0(t)}var RX=function(t){var n,r=rX(t);return function(n){return function(i){return t.map(Z(i,r(n)),Ee)}}},R0=function(t){var n,r=rX(t);return function(n){return function(i){return t.map(Z(i,r(n)),Et)}}};function R1(t){return r4(t)}function R2(t){return r6(t)}function R3(t,n){return r9(t,n)}var R4=function(t){var n,r;return(n=tk(),r9(n,f$))(t)};function R5(t,n){return r8(t,n)}var R6=function(t){var n=ii(t);return function(t){return function(r){return rj(r)?RB({},t):rj(t)?RB({},r):n(t)(r)}}},R9=function(t){return function(n){return function(r){return rj(r)||rj(n)?{}:io(t)(n)(r)}}},R8=function(t){return function(n){return rj(n)?RB({},t):rj(t)?RB({},n):ia(t)(n)}},R7=function(t){return function(n){var r=Rq(t);return function(t,i){var o=r(t);if(0===o.length)return n.of({});for(var a=n.of({}),u=function(r){a=n.ap(n.map(a,function(t){return function(n){return t[r]=n,t}}),i(r,t[r]))},s=0;s<o.length;s++)u(o[s]);return a}}},Ee=iN,Et=iP,En="Record",Er={URI:En,map:iu},Ei=el(Er),Eo=function(t){return{URI:En,reduce:ic(t),foldMap:il(t),reduceRight:id(t)}},Ea=function(t){return{URI:En,reduce:ic(t),foldMap:il(t),reduceRight:id(t),reduceWithIndex:iy(t),foldMapWithIndex:iv(t),reduceRightWithIndex:ib(t)}},Eu={URI:En,compact:Ee,separate:Et},Es=function(t){return{URI:En,map:iu,reduce:ic(t),foldMap:il(t),reduceRight:id(t),traverse:iw(t),sequence:iO(t)}},Ec=function(t){return{URI:En,map:iu,mapWithIndex:is,reduce:ic(t),foldMap:il(t),reduceRight:id(t),reduceWithIndex:iy(t),foldMapWithIndex:iv(t),reduceRightWithIndex:ib(t),traverse:iw(t),sequence:iO(t),traverseWithIndex:R7(t)}},El=function(t){var n=Es(t);return{URI:En,map:iu,reduce:ic(t),foldMap:il(t),reduceRight:id(t),traverse:n.traverse,sequence:n.sequence,compact:Ee,separate:Et,filter:ip,filterMap:ih,partition:im,partitionMap:ig,wither:rI(n,Eu),wilt:rk(n,Eu)}},Ef=function(t){var n=R6(t);return{concat:function(t,r){return n(r)(t)}}},Ed=function(t){return{concat:Ef(t).concat,empty:{}}},Ep=function(t){var n=R9(t);return{concat:function(t,r){return n(r)(t)}}},Eh=function(){return{concat:function(t,n){return R8(n)(t)}}},Em={URI:En,reduce:ic(rl),foldMap:il(rl),reduceRight:id(rl)},Eg={URI:En,reduce:ic(rl),foldMap:il(rl),reduceRight:id(rl),reduceWithIndex:iy(rl),foldMapWithIndex:iv(rl),reduceRightWithIndex:ib(rl)},Ey={URI:En,map:iu,reduce:ic(rl),foldMap:il(rl),reduceRight:id(rl),traverse:iw(rl),sequence:RQ},Ev={URI:En,map:iu,mapWithIndex:is,reduce:ic(rl),foldMap:il(rl),reduceRight:id(rl),reduceWithIndex:iy(rl),foldMapWithIndex:iv(rl),reduceRightWithIndex:ib(rl),traverse:iw(rl),sequence:RQ,traverseWithIndex:R7(rl)},Eb=rI(Ey,Eu),Ex=rk(Ey,Eu),E_={URI:En,map:iu,reduce:ic(rl),foldMap:il(rl),reduceRight:id(rl),traverse:iw(rl),sequence:RQ,compact:Ee,separate:Et,filter:ip,filterMap:ih,partition:im,partitionMap:ig,wither:Eb,wilt:Ex},ES={URI:En,map:iu,reduce:ic(rl),foldMap:il(rl),reduceRight:id(rl),traverse:iw(rl),sequence:RQ,compact:Ee,separate:Et,filter:ip,filterMap:ih,partition:im,partitionMap:ig,mapWithIndex:is,reduceWithIndex:iy(rl),foldMapWithIndex:iv(rl),reduceRightWithIndex:ib(rl),filterMapWithIndex:iS,filterWithIndex:iT,partitionMapWithIndex:ix,partitionWithIndex:i_,traverseWithIndex:R7(rl),wither:Eb,wilt:Ex};let ET=Object.freeze(Object.defineProperty({__proto__:null,Compactable:Eu,Filterable:{URI:En,map:iu,compact:Ee,separate:Et,filter:ip,filterMap:ih,partition:im,partitionMap:ig},FilterableWithIndex:{URI:En,map:iu,mapWithIndex:is,compact:Ee,separate:Et,filter:ip,filterMap:ih,partition:im,partitionMap:ig,filterMapWithIndex:iS,filterWithIndex:iT,partitionMapWithIndex:ix,partitionWithIndex:i_},Foldable:Em,FoldableWithIndex:Eg,Functor:Er,FunctorWithIndex:{URI:En,map:iu,mapWithIndex:is},Traversable:Ey,TraversableWithIndex:Ev,URI:En,Witherable:E_,collect:R$,compact:Ee,deleteAt:RH,difference:R8,elem:ir,empty:{},every:ie,filter:iI,filterMap:iM,filterMapWithIndex:r5,filterWithIndex:R2,flap:Ei,foldMap:function(t){return"compare"in t?iA(t):iA(rl)(t)},foldMapWithIndex:function(t){return"compare"in t?rG(t):rG(rl)(t)},fromEntries:R4,fromFoldable:R3,fromFoldableMap:R5,getDifferenceMagma:Eh,getEq:iD,getFoldable:Eo,getFoldableWithIndex:Ea,getIntersectionSemigroup:Ep,getMonoid:iW,getShow:function(t){return"compare"in t?iF(t):iF(rl)(t)},getTraversable:Es,getTraversableWithIndex:Ec,getUnionMonoid:Ed,getUnionSemigroup:Ef,getWitherable:El,has:rW,hasOwnProperty:i5,insertAt:rD,intersection:R9,isEmpty:rj,isSubrecord:rq,keys:RV,lookup:rV,map:rH,mapWithIndex:rK,modifyAt:RG,partition:iC,partitionMap:iR,partitionMapWithIndex:r3,partitionWithIndex:R1,pop:function(t){var n=RH(t);return function(r){var i=rV(t,r);return em(i)?ey:ev([i.value,n(r)])}},record:ES,reduce:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1===t.length?iE(t[0]):iE(rl).apply(void 0,t)},reduceRight:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1===t.length?ij(t[0]):ij(rl).apply(void 0,t)},reduceRightWithIndex:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1===t.length?rJ(t[0]):rJ(rl).apply(void 0,t)},reduceWithIndex:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1===t.length?rZ(t[0]):rZ(rl).apply(void 0,t)},separate:Et,sequence:RQ,singleton:rY,size:rA,some:it,toArray:RK,toEntries:RK,toUnfoldable:function(t){return function(n){var r=RK(n),i=r.length;return t.unfold(0,function(t){return t<i?ev([r[t],t+1]):ey})}},traverse:RY,traverseWithIndex:RJ,union:R6,updateAt:RZ,upsertAt:rD,wilt:R0,wither:RX},Symbol.toStringTag,{value:"Module"}));var Ew=function(t){return function(n){return eg(t(n))}},EO=function(t){return function(n){return ex(t(n))}},Ek=function(){return function(t){return!0}},EI=function(t){return function(n){return!t(n)}},EM=function(t){return function(n){return function(r){return n(r)||t(r)}}},EC=function(t){return function(n){return function(r){return n(r)&&t(r)}}},ER=function(){return function(t){return!1}},EE=function(t){return function(n){return function(r){return n(r)&&t(r)}}};let EA=Object.freeze(Object.defineProperty({__proto__:null,and:EC,compose:EE,fromEitherK:EO,fromOptionK:Ew,id:Ek,not:EI,or:EM,zero:ER},Symbol.toStringTag,{value:"Module"}));var Ej=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return{add:function(n,r){return t.map(function(t,i){return t.add(n[i],r[i])})},zero:t.map(function(t){return t.zero}),mul:function(n,r){return t.map(function(t,i){return t.mul(n[i],r[i])})},one:t.map(function(t){return t.one}),sub:function(n,r){return t.map(function(t,i){return t.sub(n[i],r[i])})}}},EN=function(t){return function(n){return t.sub(t.zero,n)}};let EP=Object.freeze(Object.defineProperty({__proto__:null,getFunctionRing:P,getTupleRing:Ej,negate:EN,tuple:Ej},Symbol.toStringTag,{value:"Module"})),EL=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),EF=Object.freeze(Object.defineProperty({__proto__:null,getFunctionSemiring:N},Symbol.toStringTag,{value:"Module"}));function ED(t){return function(n){for(var r,i=n.values(),o=new Set;!(r=i.next()).done;){var a=r.value;t(a)&&o.add(a)}return o}}function EW(t){var n=E2(t);return function(r,i){if(void 0===i){var o=EW(t);return function(t){return o(r,t)}}if(E0(r))return i;if(E0(i))return r;var a=new Set(r);return i.forEach(function(t){n(t,a)||a.add(t)}),a}}function EU(t){var n=E2(t);return function(r,i){if(void 0===i){var o=EU(t);return function(t){return o(t,r)}}if(E0(r)||E0(i))return new Set;var a=new Set;return r.forEach(function(t){n(t,i)&&a.add(t)}),a}}function Ez(t){var n=E2(t);return function(r,i){if(void 0===i){var o=Ez(t);return function(t){return o(t,r)}}return ED(function(t){return!n(t,i)})(r)}}var EB=function(t){return{concat:EW(t)}},Eq=function(t){return{concat:EB(t).concat,empty:new Set}},EV=function(t){return{concat:EU(t)}},E$=function(t){return{concat:Ez(t)}},EK=function(t){return new Set([t])};function EH(t){var n=E2(t);return function(t){return function(r){if(n(t)(r))return r;var i=new Set(r);return i.add(t),i}}}var EZ=function(t){return function(n){return function(r){return ED(function(r){return!t.equals(n,r)})(r)}}},EG=function(t){var n=E2(t),r=EZ(t),i=EH(t);return function(t){return function(o){return(n(t,o)?r:i)(t)(o)}}},EJ=function(t){return function(n){for(var r=n.length,i=new Set,o=E2(t),a=0;a<r;a++){var u=n[a];o(u,i)||i.add(u)}return i}},EY=function(t){return EQ(t)(F)};function EQ(t){var n=E2(t);return function(t){return function(r){var i=new Set;return r.forEach(function(r){var o=t(r);"Some"!==o._tag||n(o.value,i)||i.add(o.value)}),i}}}var EX=new Set,E0=function(t){return 0===t.size},E1=function(t){return t.size},E2=Rr,E3=function(t){return function(n){var r=[];return n.forEach(function(t){return r.push(t)}),r.sort(t.compare)}};let E4=Object.freeze(Object.defineProperty({__proto__:null,chain:function(t){var n=E2(t);return function(t){return function(r){var i=new Set;return r.forEach(function(r){t(r).forEach(function(t){n(t,i)||i.add(t)})}),i}}},compact:EY,difference:Ez,elem:E2,empty:EX,every:Rt,filter:ED,filterMap:EQ,foldMap:C0,fromArray:EJ,getDifferenceMagma:E$,getEq:Ra,getIntersectionSemigroup:EV,getShow:Ro,getUnionMonoid:Eq,getUnionSemigroup:EB,insert:EH,intersection:EU,isEmpty:E0,isSubset:Rn,map:function(t){var n=E2(t);return function(t){return function(r){var i=new Set;return r.forEach(function(r){var o=t(r);n(o,i)||i.add(o)}),i}}},partition:function(t){return function(n){for(var r,i=n.values(),o=new Set,a=new Set;!(r=i.next()).done;){var u=r.value;t(u)?o.add(u):a.add(u)}return eE(a,o)}},partitionMap:function(t,n){return function(r){return function(i){for(var o,a=i.values(),u=new Set,s=new Set,c=E2(t),l=E2(n);!(o=a.next()).done;){var f=r(o.value);switch(f._tag){case"Left":c(f.left,u)||u.add(f.left);break;case"Right":l(f.right,s)||s.add(f.right)}}return eE(u,s)}}},reduce:CX,reduceRight:C1,remove:EZ,separate:function(t,n){return function(r){var i=E2(t),o=E2(n),a=new Set,u=new Set;return r.forEach(function(t){switch(t._tag){case"Left":i(t.left,a)||a.add(t.left);break;case"Right":o(t.right,u)||u.add(t.right)}}),eE(a,u)}},singleton:EK,size:E1,some:Re,subset:Rn,toArray:E3,toggle:EG,union:EW},Symbol.toStringTag,{value:"Module"}));var E5=function(t){return{show:function(n){var r="{";for(var i in t)eC.call(t,i)&&(r+=" ".concat(i,": ").concat(t[i].show(n[i]),","));return r.length>1&&(r=r.slice(0,-1)+" "),r+="}"}}},E6=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return{show:function(n){return"[".concat(n.map(function(n,r){return t[r].show(n)}).join(", "),"]")}}};let E9=Object.freeze(Object.defineProperty({__proto__:null,getStructShow:E5,getTupleShow:E6,showBoolean:{show:function(t){return JSON.stringify(t)}},showNumber:{show:function(t){return JSON.stringify(t)}},showString:{show:function(t){return JSON.stringify(t)}},struct:E5,tuple:E6},Symbol.toStringTag,{value:"Module"}));function E8(t){return function(n){return function(r){return t.of([n,r])}}}function E7(t){return function(n){return function(r){return function(i){return t.map(r(i),function(t){var r=t[0],i=t[1];return[n(r),i]})}}}}function Ae(t){return function(n){return function(r){return function(i){return t.chain(r(i),function(r){var i=r[0],o=r[1];return t.map(n(o),function(t){var n=t[0],r=t[1];return[i(n),r]})})}}}}function At(t){return function(n){return function(r){return function(i){return t.chain(r(i),function(t){var r=t[0],i=t[1];return n(r)(i)})}}}}function An(t){return function(n){return function(r){return t.of(n(r))}}}function Ar(t){return function(n){return function(r){return t.map(n,function(t){return[t,r]})}}}function Ai(t){return function(n){return function(r){return t.map(r(n),function(t){return t[0]})}}}function Ao(t){return function(n){return function(r){return t.map(r(n),Rp)}}}let Aa=Object.freeze(Object.defineProperty({__proto__:null,ap:Ae,chain:At,evaluate:Ai,execute:Ao,fromF:Ar,fromState:An,getStateM:function(t){var n=Ae(t),r=E7(t),i=At(t),o=Ai(t),a=Ao(t);return{map:function(t,n){return Z(t,r(n))},ap:function(t,r){return Z(t,n(r))},of:E8(t),chain:function(t,n){return Z(t,i(n))},get:function(){return function(n){return t.of([n,n])}},put:function(n){return function(){return t.of([void 0,n])}},modify:function(n){return function(r){return t.of([void 0,n(r)])}},gets:function(n){return function(r){return t.of([n(r),r])}},fromState:An(t),fromM:Ar(t),evalState:function(t,n){return Z(t,o(n))},execState:function(t,n){return Z(t,a(n))}}},map:E7,of:E8},Symbol.toStringTag,{value:"Module"}));var Au=function(t){return function(){return Mr(t)}},As=E8(M1);function Ac(t){return Ab(Mo(t))}function Al(t){return Ab(Mu(t))}function Af(t){return Ab(Mf(t))}var Ad=function(t){return q(t,Mi)},Ap=function(t){return function(n){return Mr(t(n)[0])}},Ah=md(function(t){return Au(t)},As),Am=An(M1),Ag=function(t){return Ab(D(t))},Ay=function(t){return Ab(Mp(t))},Av=function(t){return Ab(Mh(t))},Ab=Ar(MX),Ax=function(t){return function(n){return q(n,gj(t))}},A_=function(t){return function(n){return function(r){return t(r)(n)(r)}}},AS=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return Ay(t.apply(void 0,n))}},AT=function(t){return function(n){return Z(n,AW(AS(t)))}},Aw=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return Ag(t.apply(void 0,n))}},AO=function(t){return function(n){return Z(n,AW(Aw(t)))}},Ak=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return Ab(t.apply(void 0,n))}},AI=function(t){return function(n){return Z(n,AW(Ak(t)))}},AM=function(t,n){return Z(t,AN(n))},AC=function(t,n){return Z(t,AF(n))},AR=function(t,n){return Z(t,AD(n))},AE=function(t,n){return function(r){return Z(t(r),MZ(function(){return n()(r)}))}},AA=function(t,n,r){return function(i){return Z(t(i),MB(n,function(t){var n=t[0],i=t[1];return[r(n),i]}))}},Aj=function(t,n){return function(r){return Z(t(r),Mq(n))}},AN=E7(MX),AP=function(t,n){return function(r){return AA(r,t,n)}},AL=function(t){return function(n){return Aj(n,t)}},AF=Ae(M9),AD=At(M9),AW=AD,AU=AW(F),Az=function(t){return function(n){return function(r){return Z(n(r),MZ(function(){return t()(r)}))}}},AB="StateReaderTaskEither",Aq={URI:AB,map:AM},AV=el(Aq),A$={URI:AB,map:AM,ap:AC},AK=eV(A$),AH=e$(A$),AZ={URI:AB,map:AM,ap:AC,chain:AR},AG={URI:AB,fromState:Am},AJ=yY(AG),AY=yQ(AG),AQ=yX(AG),AX=y0(AG),A0=y1(AG),A1=y2(AG,AZ),A2=eX(AZ),A3={URI:AB,fromReader:Al},A4=yd(A3),A5=yp(A3),A6=yh(A3),A9=ym(A3,AZ),A8=yg(A3,AZ),A7={URI:AB,fromEither:Ah},je=oB(A7),jt=oV(A7),jn=o$(A7,AZ),jr=oH(A7,AZ),ji=oZ(A7,AZ),jo=oq(A7),ja=oG(A7,AZ),ju=oK(A7),js={URI:AB,fromIO:Af},jc=gM(js),jl=gC(js,AZ),jf=gR(js,AZ),jd={URI:AB,fromIO:Af,fromTask:Ac},jp=y4(jd),jh=y5(jd,AZ),jm=y6(jd,AZ),jg=Ai(MX),jy=Ao(MX),jv=ef(Aq),jb=e0(AZ),jx=eK(A$),j_=function(t){return function(n){return function(r){return function(i){return function(){return ek(n).reduce(function(n,r,o){return n.then(function(a){return eb(a)?n:t(o+1,r)(a.right[1])(i)().then(function(t){if(eb(t))return t;var n=t.right,r=n[0],i=n[1];return a.right[0].push(r),a.right[1]=i,a})})},t(0,eO(n))(r)(i)().then(hJ(function(t){var n;return[[t[0]],t[1]]})))}}}}},jS=function(t){var n=j_(t);return function(t){return ew(t)?n(t):As(eI)}},jT=function(t){return jS(function(n,r){return t(r)})},jw=jT(F),jO=function(t,n){return Z(t(n),Mz(function(t){return t[0]}))},jk=function(t,n){return Z(t(n),Mz(function(t){return t[0],t[1]}))};let jI=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:AB,map:AM,alt:AE},Applicative:{URI:AB,map:AM,ap:AC,of:As},Apply:A$,Bifunctor:{URI:AB,bimap:AA,mapLeft:Aj},Chain:AZ,FromEither:A7,FromIO:js,FromReader:A3,FromState:AG,FromTask:jd,Functor:Aq,Monad:{URI:AB,map:AM,ap:AC,of:As,chain:AR},MonadIO:{URI:AB,map:AM,ap:AC,of:As,chain:AR,fromIO:Af},MonadTask:{URI:AB,map:AM,ap:AC,of:As,chain:AR,fromIO:Af,fromTask:Ac},MonadThrow:{URI:AB,map:AM,ap:AC,of:As,chain:AR,throwError:Au},Pointed:{URI:AB,of:As},URI:AB,alt:Az,altW:Az,ap:AF,apFirst:AK,apFirstW:AK,apS:jx,apSW:jx,apSecond:AH,apSecondW:AH,apW:AF,ask:A4,asks:A5,asksStateReaderTaskEither:A_,asksStateReaderTaskEitherW:A_,bimap:AP,bind:jb,bindTo:jv,bindW:jb,chain:AD,chainEitherK:jr,chainEitherKW:jr,chainFirst:A2,chainFirstEitherK:ji,chainFirstEitherKW:ji,chainFirstIOK:jf,chainFirstReaderK:A8,chainFirstReaderKW:A8,chainFirstTaskK:jm,chainFirstW:A2,chainIOEitherK:AT,chainIOEitherKW:AT,chainIOK:jl,chainOptionK:jn,chainReaderK:A9,chainReaderKW:A9,chainReaderTaskEitherK:AI,chainReaderTaskEitherKW:AI,chainStateK:A1,chainTaskEitherK:AO,chainTaskEitherKW:AO,chainTaskK:jh,chainW:AW,evalState:jO,evaluate:jg,execState:jk,execute:jy,filterOrElse:ja,filterOrElseW:ja,flap:AV,flatten:AU,flattenW:AU,fromEither:Ah,fromEitherK:ju,fromIO:Af,fromIOEither:Ay,fromIOEitherK:AS,fromIOK:jc,fromOption:je,fromOptionK:jt,fromPredicate:jo,fromReader:Al,fromReaderEither:Av,fromReaderK:A6,fromReaderTaskEither:Ab,fromReaderTaskEitherK:Ak,fromState:Am,fromStateK:A0,fromTask:Ac,fromTaskEither:Ag,fromTaskEitherK:Aw,fromTaskK:jp,get:AJ,gets:AX,left:Au,leftIO:function(t){return Ab(Md(t))},leftReader:function(t){return Ab(Ms(t))},leftState:Ap,leftTask:function(t){return Ab(Ma(t))},local:Ax,map:AN,mapLeft:AL,modify:AQ,of:As,put:AY,right:As,rightIO:Af,rightReader:Al,rightState:Ad,rightTask:Ac,run:function(t,n,r){return t(n)(r)()},sequenceArray:jw,stateReaderTaskEither:{URI:AB,map:AM,of:As,ap:AC,chain:AR,bimap:AA,mapLeft:Aj,alt:AE,fromIO:Af,fromTask:Ac,throwError:Au},stateReaderTaskEitherSeq:{URI:AB,map:AM,of:As,ap:AC,chain:AR,bimap:AA,mapLeft:Aj,alt:AE,fromIO:Af,fromTask:Ac,throwError:Au},throwError:Au,traverseArray:jT,traverseArrayWithIndex:jS,traverseReadonlyArrayWithIndex:jS,traverseReadonlyNonEmptyArrayWithIndex:j_},Symbol.toStringTag,{value:"Module"}));var jM=function(t,n){return Z(t,jj(n))},jC=function(t,n){return Z(t,jR(n))},jR=function(t){return function(n){return{peek:function(r){return t({peek:n.peek,pos:r})},pos:n.pos}}},jE=function(t){return t.peek(t.pos)},jA=jR(F),jj=function(t){return function(n){return{peek:function(r){return t(n.peek(r))},pos:n.pos}}},jN="Store",jP={URI:jN,map:jM},jL=el(jP),jF={URI:jN,map:jM,extend:jC,extract:jE};let jD=Object.freeze(Object.defineProperty({__proto__:null,Comonad:jF,Functor:jP,URI:jN,duplicate:jA,experiment:function(t){return function(n){return function(r){return t.map(n(r.pos),function(t){return r.peek(t)})}}},extend:jR,extract:jE,flap:jL,map:jj,peeks:function(t){return function(n){return n.peek(t(n.pos))}},seek:function(t){return function(n){return{peek:n.peek,pos:t}}},seeks:function(t){return function(n){return{peek:n.peek,pos:t(n.pos)}}},store:jF},Symbol.toStringTag,{value:"Module"}));function jW(t,n){return function(r,i){return n.compose(t.second(i),t.first(r))}}function jU(t,n){var r=jW(t,n);return function(i,o){return n.compose(r(i,o),t.promap(n.id(),F,function(t){return[t,t]}))}}let jz=Object.freeze(Object.defineProperty({__proto__:null,fanOut:jU,fanout:function(t){return jU(t,t)},split:jW,splitStrong:function(t){return jW(t,t)}},Symbol.toStringTag,{value:"Module"}));var jB=function(){return{concat:function(t,n){return Object.assign({},t,n)}}},jq=function(t){return function(n){var r={};for(var i in n)eC.call(n,i)&&(r[i]=t[i](n[i]));return r}};let jV=Object.freeze(Object.defineProperty({__proto__:null,evolve:jq,getAssignSemigroup:jB},Symbol.toStringTag,{value:"Module"}));var j$=globalThis&&globalThis.__awaiter||function(t,n,r,i){return new(r||(r=Promise))(function(o,a){function u(t){try{c(i.next(t))}catch(n){a(n)}}function s(t){try{c(i.throw(t))}catch(n){a(n)}}function c(t){var n;t.done?o(t.value):((n=t.value)instanceof r?n:new r(function(t){t(n)})).then(u,s)}c((i=i.apply(t,n||[])).next())})},jK=globalThis&&globalThis.__generator||function(t,n){var r,i,o,a,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(r)throw TypeError("Generator is already executing.");for(;u;)try{if(r=1,i&&(o=2&a[0]?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,i=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){u=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){u.label=a[1];break}if(6===a[0]&&u.label<o[1]){u.label=o[1],o=a;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(a);break}o[2]&&u.ops.pop(),u.trys.pop();continue}a=n.call(t,u)}catch(s){a=[6,s],i=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},jH=xg(Ov),jZ=xw(Ov),jG=xO(Ov),jJ=function(t){return jY(Oo(t))},jY=xv(Og),jQ=Ol(dz),jX=xk(Og),j0=xI(OO),j1=xM(Ok),j2=xb(Ov),j3=function(t){return function(){return j$(void 0,void 0,void 0,function(){return jK(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,t().then(ev)];case 1:return[2,n.sent()];case 2:return n.sent(),[2,ey];case 3:return[2]}})})}},j4=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return j3(function(){return t.apply(void 0,n)})}},j5=xx(Ov),j6=x_(Ok),j9=xS(Ov),j8=xT(Ok),j7=xC(Og),Ne=xR(Ob),Nt=xE(Ok),Nn=Nt(F),Nr=xA(Ok),Ni=xy(Ov),No=Ni(),Na=hn(Og,pg),Nu=hr(Og,pg,d9),Ns=gd(Og,p_),Nc=gp(Og,p_),Nl=gh(Og,p_),Nf=gm(Og,p_),Nd=function(t,n){return Z(t,j7(n))},Np=function(t,n){return Z(t,Ne(n))},Nh=function(t,n){return Z(t,Nt(n))},Nm=function(t,n){return Z(t,Nr(n))},Ng=function(t,n){return Z(t,Ns(n))},Ny=function(t,n){return Z(t,Nc(n))},Nv=function(t,n){return Z(t,Nl(n))},Nb=function(t,n){return Z(t,Nf(n))},Nx="TaskOption",N_={URI:Nx,map:Nd},NS=el(N_),NT={URI:Nx,of:jH},Nw={URI:Nx,map:Nd,ap:Np},NO=eV(Nw),Nk=e$(Nw),NI=function(t,n){return Z(t,Nt(function(t){return Z(n,j7(t))}))},NM={URI:Nx,map:Nd,ap:Np,chain:Nh},NC=eX(NM),NR={URI:Nx,zero:Ni},NE=uR(NR,NT),NA={URI:Nx,fromIO:jJ},Nj=gM(NA),NN=gC(NA,NM),NP=gR(NA,NM),NL={URI:Nx,fromEither:jG},NF=oK(NL),ND=oH(NL,NM),NW=oZ(NL,NM),NU={URI:Nx,fromIO:jJ,fromTask:jY},Nz=y4(NU),NB=y5(NU,NM),Nq=y6(NU,NM),NV=jH(eM),N$=ef(N_),NK=e0(NM),NH=eK(Nw),NZ=jH(eI),NG=function(t){return q(OD(t),Ol(p2(G)))},NJ=function(t){var n=NG(t);return function(t){return ew(t)?n(t):NZ}},NY=function(t){return function(n){return function(){return ek(n).reduce(function(n,r,i){return n.then(function(o){return em(o)?n:t(i+1,r)().then(function(t){return em(t)?t:(o.value.push(t.value),o)})})},t(0,eO(n))().then(d6(eT)))}}},NQ=function(t){var n=NY(t);return function(t){return ew(t)?n(t):NZ}},NX=function(t){return NJ(function(n,r){return t(r)})},N0=NX(F),N1=function(t){return NQ(function(n,r){return t(r)})},N2=N1(F);let N3=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:Nx,map:Nd,alt:Nm},Alternative:{URI:Nx,map:Nd,ap:Np,of:jH,alt:Nm,zero:Ni},ApT:NZ,ApplicativePar:{URI:Nx,map:Nd,ap:Np,of:jH},ApplicativeSeq:{URI:Nx,map:Nd,ap:NI,of:jH},ApplyPar:Nw,ApplySeq:{URI:Nx,map:Nd,ap:NI},Chain:NM,Compactable:{URI:Nx,compact:Na,separate:Nu},Do:NV,Filterable:{URI:Nx,map:Nd,compact:Na,separate:Nu,filter:Ng,filterMap:Ny,partition:Nv,partitionMap:Nb},FromEither:NL,FromIO:NA,FromTask:NU,Functor:N_,Monad:{URI:Nx,map:Nd,ap:Np,of:jH,chain:Nh},MonadIO:{URI:Nx,map:Nd,ap:Np,of:jH,chain:Nh,fromIO:jJ},MonadTask:{URI:Nx,map:Nd,ap:Np,of:jH,chain:Nh,fromIO:jJ,fromTask:jY},Pointed:NT,Zero:NR,alt:Nr,altW:Nr,ap:Ne,apFirst:NO,apS:NH,apSecond:Nk,bind:NK,bindTo:N$,chain:Nt,chainEitherK:ND,chainFirst:NC,chainFirstEitherK:NW,chainFirstIOK:NP,chainFirstTaskK:Nq,chainIOK:NN,chainNullableK:j6,chainOptionK:j8,chainTaskK:NB,compact:Na,filter:Ns,filterMap:Nc,flap:NS,flatten:Nn,fold:j0,foldW:j0,fromEither:jG,fromEitherK:NF,fromIO:jJ,fromIOK:Nj,fromNullable:j2,fromNullableK:j5,fromOption:Od,fromOptionK:j9,fromPredicate:jZ,fromTask:jY,fromTaskEither:jQ,fromTaskK:Nz,getOrElse:j1,getOrElseW:j1,guard:NE,map:j7,match:jX,matchE:j0,matchEW:j0,matchW:jX,none:No,of:jH,partition:Nl,partitionMap:Nf,separate:Nu,sequenceArray:N0,sequenceSeqArray:N2,some:jH,traverseArray:NX,traverseArrayWithIndex:NJ,traverseReadonlyArrayWithIndex:NJ,traverseReadonlyArrayWithIndexSeq:NQ,traverseReadonlyNonEmptyArrayWithIndex:NG,traverseReadonlyNonEmptyArrayWithIndexSeq:NY,traverseSeqArray:N1,traverseSeqArrayWithIndex:NQ,tryCatch:j3,tryCatchK:j4,zero:Ni},Symbol.toStringTag,{value:"Module"}));var N4=function(t){return"Left"===t._tag},N5=function(t){return"Right"===t._tag};function N6(t){return"Both"===t._tag}function N9(t){return{_tag:"Left",left:t}}function N8(t){return{_tag:"Right",right:t}}function N7(t,n){return{_tag:"Both",left:t,right:n}}var Pe=function(t,n,r){return function(i){switch(i._tag){case"Left":return t(i.left);case"Right":return n(i.right);case"Both":return r(i.left,i.right)}}},Pt=Pe(N8,N9,function(t,n){return N7(n,t)});function Pn(t,n){return{concat:function(r,i){return N4(r)?N4(i)?N9(t.concat(r.left,i.left)):N5(i)?N7(r.left,i.right):N7(t.concat(r.left,i.left),i.right):N5(r)?N4(i)?N7(i.left,r.right):N5(i)?N8(n.concat(r.right,i.right)):N7(i.left,n.concat(r.right,i.right)):N4(i)?N7(t.concat(r.left,i.left),r.right):N5(i)?N7(r.left,n.concat(r.right,i.right)):N7(t.concat(r.left,i.left),n.concat(r.right,i.right))}}}var Pr=function(t){return{URI:P_,_E:void 0,map:Pa,ap:function(n,r){return N4(n)?N4(r)?N9(t.concat(n.left,r.left)):N5(r)?N9(n.left):N9(t.concat(n.left,r.left)):N5(n)?N4(r)?N9(r.left):N5(r)?N8(n.right(r.right)):N7(r.left,n.right(r.right)):N4(r)?N9(t.concat(n.left,r.left)):N5(r)?N7(n.left,n.right(r.right)):N7(t.concat(n.left,r.left),n.right(r.right))}}};function Pi(t){var n=Pr(t),r=function(n,r){if(N4(n))return n;if(N5(n))return r(n.right);var i=r(n.right);return N4(i)?N9(t.concat(n.left,i.left)):N5(i)?N7(n.left,i.right):N7(t.concat(n.left,i.left),i.right)};return{URI:P_,_E:void 0,map:Pa,ap:n.ap,chain:r}}var Po=function(t,n){return em(t)?em(n)?ey:ev(N8(n.value)):em(n)?ev(N9(t.value)):ev(N7(t.value,n.value))},Pa=function(t,n){return Z(t,Pm(n))},Pu=function(t,n,r){return Z(t,Pp(n,r))},Ps=function(t,n){return Z(t,Ph(n))},Pc=function(t,n,r){return Z(t,Pg(n,r))},Pl=function(t){var n=Py(t);return function(t,r){return Z(t,n(r))}},Pf=function(t,n,r){return Z(t,Pv(n,r))},Pd=function(t){var n=Pb(t);return function(t,r){return Z(t,n(r))}},Pp=function(t,n){return function(r){return N4(r)?N9(t(r.left)):N5(r)?N8(n(r.right)):N7(t(r.left),n(r.right))}},Ph=function(t){return function(n){return N4(n)?N9(t(n.left)):N6(n)?N7(t(n.left),n.right):n}},Pm=function(t){return function(n){return N4(n)?n:N5(n)?N8(t(n.right)):N7(n.left,t(n.right))}},Pg=function(t,n){return function(r){return N4(r)?t:n(t,r.right)}},Py=function(t){return function(n){return function(r){return N4(r)?t.empty:n(r.right)}}},Pv=function(t,n){return function(r){return N4(r)?t:n(r.right,t)}},Pb=function(t){return function(n){return function(r){return N4(r)?t.of(r):N5(r)?t.map(n(r.right),N8):t.map(n(r.right),function(t){return N7(r.left,t)})}}},Px=function(t){return function(n){return N4(n)?t.of(n):N5(n)?t.map(n.right,N8):t.map(n.right,function(t){return N7(n.left,t)})}},P_="These",PS={URI:P_,map:Pa},PT=el(PS),Pw={URI:P_,fromEither:F},PO=oB(Pw),Pk=oV(Pw),PI=function(t){return function(n){return function(r){return!N4(r)&&t.equals(n,r.right)}}},PM=function(t){return function(n){return!N4(n)&&t(n.right)}},PC=function(t,n){return function(r){return N4(r)?[r.left,n()]:N5(r)?[t(),r.right]:[r.left,r.right]}},PR=function(t,n){return PC(function(){return t},function(){return n})},PE=N8(eI),PA=function(t){return function(n){return function(r){var i=ey,o=n(0,eO(r));if(N4(o))return o;N6(o)&&(i=ev(o.left));for(var a=[o.right],u=1;u<r.length;u++){var s=n(u,r[u]);if(N4(s))return s;N6(s)&&(i=em(i)?ev(s.left):ev(t.concat(i.value,s.left))),a.push(s.right)}return em(i)?N8(a):N7(i.value,a)}}},Pj=function(t){return function(n){var r=PA(t)(n);return function(t){return ew(t)?r(t):PE}}};let PN=Object.freeze(Object.defineProperty({__proto__:null,ApT:PE,Bifunctor:{URI:P_,bimap:Pu,mapLeft:Ps},Foldable:{URI:P_,reduce:Pc,foldMap:Pl,reduceRight:Pf},FromEither:Pw,FromThese:{URI:P_,fromThese:F},Functor:PS,Pointed:{URI:P_,of:N8},Traversable:{URI:P_,map:Pa,reduce:Pc,foldMap:Pl,reduceRight:Pf,traverse:Pd,sequence:Px},URI:P_,bimap:Pp,both:N7,elem:PI,exists:PM,flap:PT,fold:Pe,foldMap:Py,foldW:Pe,fromOption:PO,fromOptionK:Pk,fromOptions:Po,getApplicative:function(t){var n=Pr(t);return{URI:P_,_E:void 0,map:Pa,ap:n.ap,of:N8}},getApply:Pr,getChain:Pi,getEq:function(t,n){return Q(function(r,i){return N4(r)?N4(i)&&t.equals(r.left,i.left):N5(r)?N5(i)&&n.equals(r.right,i.right):N6(i)&&t.equals(r.left,i.left)&&n.equals(r.right,i.right)})},getLeft:function(t){return N4(t)?ev(t.left):N5(t)?ey:ev(t.left)},getLeftOnly:function(t){return N4(t)?ev(t.left):ey},getMonad:function(t){var n=Pi(t);return{URI:P_,_E:void 0,map:Pa,of:N8,ap:n.ap,chain:n.chain,throwError:N9}},getRight:function(t){return N4(t)?ey:(N5(t),ev(t.right))},getRightOnly:function(t){return N5(t)?ev(t.right):ey},getSemigroup:Pn,getShow:function(t,n){return{show:Pe(function(n){return"left(".concat(t.show(n),")")},function(t){return"right(".concat(n.show(t),")")},function(r,i){return"both(".concat(t.show(r),", ").concat(n.show(i),")")})}},isBoth:N6,isLeft:N4,isRight:N5,left:N9,leftOrBoth:function(t){return function(n){return em(n)?N9(t):N7(t,n.value)}},map:Pm,mapLeft:Ph,match:Pe,matchW:Pe,of:N8,reduce:Pg,reduceRight:Pv,right:N8,rightOrBoth:function(t){return function(n){return em(n)?N8(t):N7(n.value,t)}},sequence:Px,swap:Pt,these:{URI:P_,map:Pa,bimap:Pu,mapLeft:Ps,reduce:Pc,foldMap:Pl,reduceRight:Pf,traverse:Pd,sequence:Px},toTuple:PR,toTuple2:PC,traverse:Pb,traverseReadonlyArrayWithIndex:Pj,traverseReadonlyNonEmptyArrayWithIndex:PA},Symbol.toStringTag,{value:"Module"}));function PP(t){return q(N8,t.of)}function PL(t){return q(N9,t.of)}function PF(t){return q(N7,t.of)}function PD(t){return function(n){return t.map(n,N8)}}function PW(t){return function(n){return t.map(n,N9)}}function PU(t){return ec(t,PS)}function Pz(t,n){return eq(t,Pr(n))}function PB(t,n){var r=PL(t);return function(i){return function(o){return t.chain(o,Pe(r,i,function(r,o){return t.map(i(o),Pe(function(t){return N9(n.concat(r,t))},function(t){return N7(r,t)},function(t,i){return N7(n.concat(r,t),i)}))}))}}}function Pq(t){return function(n,r){return function(i){return t.map(i,Pp(n,r))}}}function PV(t){return function(n){return function(r){return t.map(r,Ph(n))}}}function P$(t){return function(n,r,i){return function(o){return t.map(o,Pe(n,r,i))}}}function PK(t){return function(n,r,i){return function(o){return t.chain(o,Pe(n,r,i))}}}function PH(t){return function(n){return t.map(n,Pt)}}function PZ(t){return function(n,r){return function(i){return t.map(i,PC(n,r))}}}let PG=Object.freeze(Object.defineProperty({__proto__:null,ap:Pz,bimap:Pq,both:PF,chain:PB,getTheseM:function(t){var n=PU(t),r=Pq(t),i=PV(t),o=PK(t),a=PZ(t),u=PP(t),s=function(t,r){return Z(t,n(r))};return{map:s,bimap:function(t,n,i){return Z(t,r(n,i))},mapLeft:function(t,n){return Z(t,i(n))},fold:function(t,n,r,i){return Z(t,o(n,r,i))},swap:PH(t),rightM:PD(t),leftM:PW(t),left:PL(t),right:PP(t),both:PF(t),toTuple:function(t,n,r){return Z(t,a(function(){return n},function(){return r}))},getMonad:function(n){var r=Pz(t,n),i=PB(t,n);return{_E:void 0,map:s,of:u,ap:function(t,n){return Z(t,r(n))},chain:function(t,n){return Z(t,i(n))}}}}},left:PL,leftF:PW,map:PU,mapLeft:PV,match:P$,matchE:PK,right:PP,rightF:PD,swap:PH,toTuple2:PZ},Symbol.toStringTag,{value:"Module"}));var PJ=PL(Ov),PY=PP(Ov),PQ=PF(Ov),PX=PD(Og),P0=PW(Og),P1=q(Oo,PX),P2=q(Oo,P0),P3=P$(Og),P4=PK(Ok),P5=PH(Og),P6=function(t,n){return Z(t,P7(n))},P9=function(t,n,r){return Z(t,Le(n,r))},P8=function(t,n){return Z(t,Lt(n))},P7=PU(Og),Le=Pq(Og),Lt=PV(Og),Ln="TaskThese",Lr=function(t,n){var r=Pz(t,n);return{URI:Ln,_E:void 0,map:P6,ap:function(t,n){return Z(t,r(n))}}};function Li(t,n){var r=Lr(t,n).ap;return{URI:Ln,_E:void 0,map:P6,ap:r,of:PY}}function Lo(t){var n=Lr(OS,t),r=PB(Ok,t);return{URI:Ln,_E:void 0,map:P6,ap:n.ap,chain:function(t,n){return Z(t,r(n))}}}var La={URI:Ln,map:P6},Lu=el(La),Ls={URI:Ln,fromEither:Od},Lc=oB(Ls),Ll=oV(Ls),Lf=oq(Ls),Ld={URI:Ln,fromThese:Od},Lp=y8(Ld),Lh={URI:Ln,fromIO:P1},Lm=gM(Lh),Lg={URI:Ln,fromIO:P1,fromTask:PX},Ly=y4(Lg),Lv=PZ(Og),Lb=PY(eI),Lx=function(t){var n=PA(t);return function(t){return q(OD(t),Ol(n(G)))}},L_=function(t){return function(n){var r=Lx(t)(n);return function(t){return ew(t)?r(t):Lb}}},LS=function(t){return function(n){return function(r){return function(){return ek(r).reduce(function(r,i,o){return r.then(function(a){return N4(a)?r:n(o+1,i)().then(function(n){if(N4(n))return n;if(N6(n)){var r=a.right;return r.push(n.right),N6(a)?N7(t.concat(a.left,n.left),r):N7(n.left,r)}return a.right.push(n.right),a})})},n(0,eO(r))().then(Pm(eT)))}}}},LT=function(t){return function(n){var r=LS(t)(n);return function(t){return ew(t)?r(t):Lb}}},Lw=function(t,n){return Lv(function(){return t},function(){return n})},LO=function(t,n){return eH(OT)(Pn(t,n))};let Lk=Object.freeze(Object.defineProperty({__proto__:null,ApT:Lb,Bifunctor:{URI:Ln,bimap:P9,mapLeft:P8},FromEither:Ls,FromIO:Lh,FromTask:Lg,FromThese:Ld,Functor:La,Pointed:{URI:Ln,of:PY},URI:Ln,bifunctorTaskThese:{URI:Ln,bimap:P9,mapLeft:P8},bimap:Le,both:PQ,flap:Lu,fold:P4,foldW:P4,fromEither:Od,fromIO:P1,fromIOEither:Oo,fromIOK:Lm,fromOption:Lc,fromOptionK:Ll,fromPredicate:Lf,fromTask:PX,fromTaskK:Ly,fromThese:Od,fromTheseK:Lp,functorTaskThese:{URI:Ln,map:P6},getApplicative:Li,getApply:Lr,getChain:Lo,getMonad:function(t){var n=Li(OS,t),r=Lo(t);return{URI:Ln,_E:void 0,map:P6,ap:n.ap,of:PY,chain:r.chain,fromIO:P1,fromTask:PX}},getSemigroup:LO,left:PJ,leftIO:P2,leftTask:P0,map:P7,mapLeft:Lt,match:P3,matchE:P4,matchEW:P4,matchW:P3,of:PY,right:PY,rightIO:P1,rightTask:PX,swap:P5,taskThese:{URI:Ln,map:P6,bimap:P9,mapLeft:P8},toTuple:Lw,toTuple2:Lv,traverseReadonlyArrayWithIndex:L_,traverseReadonlyArrayWithIndexSeq:LT,traverseReadonlyNonEmptyArrayWithIndex:Lx,traverseReadonlyNonEmptyArrayWithIndexSeq:LS},Symbol.toStringTag,{value:"Module"}));var LI=function(t,n){return Z(t,LM(n))},LM=function(t){return function(n){return function(r){return t(n(r))}}},LC="Traced",LR={URI:LC,map:LI},LE=el(LR);let LA=Object.freeze(Object.defineProperty({__proto__:null,Functor:LR,URI:LC,censor:function(t){return function(n){return function(r){return n(t(r))}}},flap:LE,getComonad:function(t){return{URI:LC,_E:void 0,map:LI,extend:function(n,r){return function(i){return r(function(r){return n(t.concat(i,r))})}},extract:function(n){return n(t.empty)}}},listen:function(t){return function(n){return[t(n),n]}},listens:function(t){return function(n){return function(r){return[n(r),t(r)]}}},map:LM,traced:LR,tracks:function(t,n){return function(r){return r(n(r(t.empty)))}}},Symbol.toStringTag,{value:"Module"}));function Lj(t,n){return function(r){var i=t.traverse(r),o=n.traverse(r);return function(t){return function(n){return i(n,function(n){return o(n,t)})}}}}function LN(t,n){return function(r){var i=t.sequence(r),o=n.sequence(r);return function(n){return i(t.map(n,o))}}}let LP=Object.freeze(Object.defineProperty({__proto__:null,getTraversableComposition:function(t,n){var r=ed(t,n).map,i=gS(t,n),o=Lj(t,n),a=LN(t,n);return{map:r,reduce:i.reduce,foldMap:i.foldMap,reduceRight:i.reduceRight,traverse:function(t){var n=o(t);return function(t,r){return Z(t,n(r))}},sequence:function(t){var n=a(t);return function(t){return Z(t,n)}}}},sequence:LN,traverse:Lj},Symbol.toStringTag,{value:"Module"})),LL=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function LF(t,n){return void 0===n&&(n=[]),{value:t,forest:n}}var LD=function(t,n){for(var r,i="",o=n.length,a=0;a<o;a++){r=n[a];var u=a===o-1;i+=t+(u?"└":"├")+"─ "+r.value,i+=LD(t+(o>1&&!u?"│ ":" "),r.forest)}return i};function LW(t){return LD(`
2
- `,t)}function LU(t,n){var r,i=n(t);return{value:i[0],forest:Lz(i[1],n)}}function Lz(t,n){return t.map(function(t){return LU(t,n)})}function LB(t){var n=Lq(t);return function(r,i){return t.chain(i(r),function(r){var o=r[0],a=r[1];return t.map(n(a,i),function(t){return{value:o,forest:t}})})}}function Lq(t){var n=f_(t);return function(r,i){return Z(r,n(function(n){return LB(t)(n,i)}))}}var LV=function(t,n){return Z(t,L3(n))},L$=function(t,n){return Z(t,LX(function(t){return Z(n,L3(t))}))},LK=function(t,n){return Z(t,LX(n))},LH=function(t,n,r){return Z(t,L4(n,r))},LZ=function(t){var n=L5(t);return function(t,r){return Z(t,n(r))}},LG=function(t,n,r){return Z(t,L6(n,r))},LJ=function(t,n){return Z(t,L0(n))},LY=function(t){var n=L8(t);return function(t,r){return Z(t,n(r))}},LQ=function(t){return function(n){return L$(n,t)}},LX=function(t){return function(n){var r=t(n.value),i=r.value,o=r.forest,a=fC().concat;return{value:i,forest:a(o,n.forest.map(LX(t)))}}},L0=function(t){return function(n){return{value:t(n),forest:n.forest.map(L0(t))}}},L1=L0(F),L2=LX(F),L3=function(t){return function(n){return{value:t(n.value),forest:n.forest.map(L3(t))}}},L4=function(t,n){return function(r){for(var i=n(t,r.value),o=r.forest.length,a=0;a<o;a++)i=Z(r.forest[a],L4(i,n));return i}},L5=function(t){return function(n){return L4(t.empty,function(r,i){return t.concat(r,n(i))})}},L6=function(t,n){return function(r){for(var i=t,o=r.forest.length,a=o-1;a>=0;a--)i=Z(r.forest[a],L6(i,n));return n(r.value,i)}},L9=function(t){return t.value},L8=function(t){var n=f_(t),r=function(i){return function(o){return t.ap(t.map(i(o.value),function(t){return function(n){return{value:t,forest:n}}}),Z(o.forest,n(r(i))))}};return r},L7=function(t){return L8(t)(F)},Fe=function(t){return LF(t)},Ft="Tree",Fn={URI:Ft,map:LV},Fr=el(Fn),Fi={URI:Ft,map:LV,ap:L$},Fo=eV(Fi),Fa=e$(Fi),Fu={URI:Ft,map:LV,ap:L$,chain:LK},Fs=eX(Fu),Fc=Fe(eM),Fl=ef(Fn),Ff=e0(Fu),Fd=eK(Fi),Fp=function(t){return function(n){return t(n.value)||n.forest.some(Fp(t))}};let Fh=Object.freeze(Object.defineProperty({__proto__:null,Applicative:{URI:Ft,map:LV,ap:L$,of:Fe},Apply:Fi,Chain:Fu,Comonad:{URI:Ft,map:LV,extend:LJ,extract:L9},Do:Fc,Foldable:{URI:Ft,reduce:LH,foldMap:LZ,reduceRight:LG},Functor:Fn,Monad:{URI:Ft,map:LV,ap:L$,of:Fe,chain:LK},Pointed:{URI:Ft,of:Fe},Traversable:{URI:Ft,map:LV,reduce:LH,foldMap:LZ,reduceRight:LG,traverse:LY,sequence:L7},URI:Ft,ap:LQ,apFirst:Fo,apS:Fd,apSecond:Fa,bind:Ff,bindTo:Fl,chain:LX,chainFirst:Fs,drawForest:LW,drawTree:function(t){return t.value+LW(t.forest)},duplicate:L1,elem:function(t){var n=function(r,i){return t.equals(r,i.value)||i.forest.some(function(t){return n(r,t)})};return n},exists:Fp,extend:L0,extract:L9,flap:Fr,flatten:L2,fold:function(t){var n=function(r){return t(r.value,r.forest.map(n))};return n},foldMap:L5,getEq:function(t){var n,r=Q(function(r,i){return t.equals(r.value,i.value)&&n.equals(r.forest,i.forest)});return n=cy(r),r},getShow:function(t){var n=function(r){return c2(r.forest)?"make(".concat(t.show(r.value),")"):"make(".concat(t.show(r.value),", [").concat(r.forest.map(n).join(", "),"])")};return{show:n}},make:LF,map:L3,of:Fe,reduce:L4,reduceRight:L6,sequence:L7,traverse:L8,tree:{URI:Ft,map:LV,of:Fe,ap:L$,chain:LK,reduce:LH,foldMap:LZ,reduceRight:LG,traverse:LY,sequence:L7,extract:L9,extend:LJ},unfoldForest:Lz,unfoldForestM:Lq,unfoldTree:LU,unfoldTreeM:LB},Symbol.toStringTag,{value:"Module"}));var Fm=function(t){var n;return[Rp(t),(n=t,n[0])]};function Fg(t){return{URI:FW,_E:void 0,map:Fx,ap:function(n,r){var i,o;return[(i=n,i[0])((o=r,o[0])),t.concat(Rp(n),Rp(r))]}}}var Fy=function(t){return function(n){return[n,t.empty]}};function Fv(t){var n=Fg(t);return{URI:FW,_E:void 0,map:n.map,ap:n.ap,chain:function(n,r){var i,o=r((i=n,i[0])),a=o[0],u=o[1];return[a,t.concat(Rp(n),u)]}}}var Fb=function(t,n){return Z(t,FE(n))},Fx=function(t,n){return Z(t,FC(n))},F_=function(t,n,r){return Z(t,FM(n,r))},FS=function(t,n){return Z(t,FR(n))},FT=function(t,n){return Z(t,FA(n))},Fw=function(t,n,r){return Z(t,FP(n,r))},FO=function(t){var n=FN();return function(t,r){return Z(t,n(r))}},Fk=function(t,n,r){return Z(t,FL(n,r))};function FI(t){var n=FF(t);return function(t,r){return Z(t,n(r))}}var FM=function(t,n){return function(r){var i;return[n((i=r,i[0])),t(Rp(r))]}},FC=function(t){return function(n){var r;return[t((r=n,r[0])),Rp(n)]}},FR=function(t){return function(n){var r;return[(r=n,r[0]),t(Rp(n))]}},FE=function(t){return function(n){var r;return[(r=n,r[0]),Rp(t)]}},FA=function(t){return function(n){return[t(n),Rp(n)]}},Fj=FA(F),FN=RN,FP=Rj,FL=RP,FF=function(t){return function(n){return function(r){var i;return t.map(n((i=r,i[0])),function(t){return[t,Rp(r)]})}}},FD=function(t){return function(n){var r;return t.map((r=n,r[0]),function(t){return[t,Rp(n)]})}},FW="Tuple",FU={URI:FW,map:Fx},Fz=el(FU);let FB=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:{URI:FW,bimap:F_,mapLeft:FS},Comonad:{URI:FW,map:Fx,extend:FT,extract:Rd},Foldable:{URI:FW,reduce:Fw,foldMap:FO,reduceRight:Fk},Functor:FU,Semigroupoid:{URI:FW,compose:Fb},Traversable:{URI:FW,map:Fx,reduce:Fw,foldMap:FO,reduceRight:Fk,traverse:FI,sequence:FD},URI:FW,bimap:FM,compose:FE,duplicate:Fj,extend:FA,extract:Rd,flap:Fz,foldMap:FN,fst:Rd,getApplicative:function(t){var n=Fg(t);return{URI:FW,_E:void 0,map:n.map,ap:n.ap,of:Fy(t)}},getApply:Fg,getChain:Fv,getChainRec:function(t){var n=function(n,r){for(var i,o,a=r(n),u=t.empty,s=(i=a,i[0]);"Left"===s._tag;){u=t.concat(u,Rp(a)),s=(o=a=r(s.left))[0]}return[s.right,t.concat(u,Rp(a))]},r=Fv(t);return{URI:FW,_E:void 0,map:r.map,ap:r.ap,chain:r.chain,chainRec:n}},getMonad:function(t){var n=Fv(t);return{URI:FW,_E:void 0,map:n.map,ap:n.ap,chain:n.chain,of:Fy(t)}},map:FC,mapFst:FC,mapLeft:FR,mapSnd:FR,reduce:FP,reduceRight:FL,sequence:FD,snd:Rp,swap:Fm,traverse:FF,tuple:{URI:FW,compose:Fb,map:Fx,bimap:F_,mapLeft:FS,extract:Rd,extend:FT,reduce:Fw,foldMap:FO,reduceRight:Fk,traverse:FI,sequence:FD}},Symbol.toStringTag,{value:"Module"})),Fq=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),FV=Object.freeze(Object.defineProperty({__proto__:null,getValidationM:function(t,n){var r=oU(n,hZ(t));return{map:r.map,ap:r.ap,of:r.of,chain:function(t,r){return n.chain(t,function(t){return eb(t)?n.of(e_(t.left)):r(t.right)})},alt:function(r,i){return n.chain(r,function(r){return ex(r)?n.of(r):n.map(i(),function(n){return eb(n)?e_(t.concat(r.left,n.left)):n})})}}}},Symbol.toStringTag,{value:"Module"}));var F$=t_(void 0),FK={concat:F$.concat,empty:void 0};let FH=Object.freeze(Object.defineProperty({__proto__:null,Monoid:FK,Semigroup:F$},Symbol.toStringTag,{value:"Module"}));var FZ=function(t){return function(){return[void 0,t]}},FG=function(t){return function(){var n=t(),r=n[0],i=n[1];return[[r,i],i]}},FJ=function(t){return function(){var n,r=t(),i=r[0],o=i[0];return[o,(0,i[1])(r[1])]}},FY=function(t){return function(n){return function(){var r=n(),i=r[0],o=r[1];return[[i,t(o)],o]}}},FQ=function(t){return function(n){return function(){var r,i=n();return[i[0],t(i[1])]}}},FX=function(t,n){return Z(t,F0(n))},F0=function(t){return function(n){return function(){var r=n(),i=r[0],o=r[1];return[t(i),o]}}},F1="Writer",F2=function(t){return{URI:F1,_E:void 0,of:function(n){return function(){return[n,t.empty]}}}},F3=function(t){return{URI:F1,_E:void 0,map:FX,ap:function(n,r){return function(){var i=n(),o=i[0],a=i[1],u=r(),s=u[0],c=u[1];return[o(s),t.concat(a,c)]}}}},F4=function(t){var n=F3(t),r=F2(t);return{URI:F1,_E:void 0,map:FX,ap:n.ap,of:r.of}};function F5(t){var n=F3(t);return{URI:F1,_E:void 0,map:FX,ap:n.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,t.concat(a,c)]}}}}var F6={URI:F1,map:FX},F9=el(F6),F8=function(t){return t()[0]},F7=function(t){return t()[1]},De=function(t){return t()[0]},Dt=function(t){return t()[1]};let Dn=Object.freeze(Object.defineProperty({__proto__:null,Functor:F6,URI:F1,censor:FQ,evalWriter:De,evaluate:F8,execWriter:Dt,execute:F7,flap:F9,getApplicative:F4,getApply:F3,getChain:F5,getMonad:function(t){var n=F4(t),r=F5(t);return{URI:F1,_E:void 0,map:FX,ap:n.ap,of:n.of,chain:r.chain}},getPointed:F2,listen:FG,listens:FY,map:F0,pass:FJ,tell:FZ,writer:F6},Symbol.toStringTag,{value:"Module"})),Dr=Object.freeze(Object.defineProperty({__proto__:null,getWriterM:function(t){var n=function(n,r){return function(){return t.map(n(),function(t){var n=t[0],i=t[1];return[r(n),i]})}};return{map:n,evalWriter:function(n){return t.map(n(),function(t){return t[0]})},execWriter:function(n){return t.map(n(),function(t){return t[0],t[1]})},tell:function(n){return function(){return t.of([void 0,n])}},listen:function(n){return function(){return t.map(n(),function(t){var n=t[0],r=t[1];return[[n,r],r]})}},pass:function(n){return function(){return t.map(n(),function(t){var n,r=t[0],i=r[0];return[i,(0,r[1])(t[1])]})}},listens:function(n,r){return function(){return t.map(n(),function(t){var n=t[0],i=t[1];return[[n,r(i)],i]})}},censor:function(n,r){return function(){return t.map(n(),function(t){var n;return[t[0],r(t[1])]})}},getMonad:function(r){return{_E:void 0,map:n,of:function(n){return function(){return t.of([n,r.empty])}},ap:function(n,i){return function(){return t.chain(n(),function(n){var o=n[0],a=n[1];return t.map(i(),function(t){var n=t[0],i=t[1];return[o(n),r.concat(a,i)]})})}},chain:function(n,i){return function(){return t.chain(n(),function(n){var o=n[0],a=n[1];return t.map(i(o)(),function(t){var n=t[0],i=t[1];return[n,r.concat(a,i)]})})}}}}}}},Symbol.toStringTag,{value:"Module"})),Di=Object.freeze(Object.defineProperty({__proto__:null,alt:oF,alternative:oD,applicative:oz,apply:eQ,array:f9,bifunctor:f8,boolean:ds,booleanAlgebra:dl,bounded:dh,boundedDistributiveLattice:dy,boundedJoinSemilattice:dv,boundedLattice:db,boundedMeetSemilattice:dx,category:d_,chain:e1,chainRec:dT,choice:dk,comonad:dI,compactable:hi,console:hc,const:hT,contravariant:hw,date:hM,distributiveLattice:dg,either:mK,eitherT:go,endomorphism:gs,eq:es,extend:gc,field:gf,filterable:gg,filterableWithIndex:gy,foldable:gT,foldableWithIndex:gI,fromEither:oJ,fromIO:gE,fromReader:yy,fromState:y3,fromTask:y9,fromThese:y7,function:Y,functor:ep,functorWithIndex:vt,group:vn,heytingAlgebra:vr,hkt:vi,identity:vW,invariant:vU,io:ba,ioEither:xm,ioOption:_A,ioRef:_N,joinSemilattice:_P,json:_D,lattice:_W,magma:tv,map:Tk,meetSemilattice:TI,monad:TM,monadIO:TC,monadTask:TR,monadThrow:TE,monoid:T$,naturalTransformation:TK,nonEmptyArray:uv,number:uC,option:ht,optionT:xj,ord:td,ordering:TX,pipeable:T0,pointed:T1,predicate:dD,profunctor:T2,random:T9,reader:yf,readerEither:w8,readerT:Oi,readerTask:kD,readerTaskEither:C$,readonlyArray:c1,readonlyMap:SU,readonlyNonEmptyArray:ra,readonlyRecord:i9,readonlySet:Rf,readonlyTuple:Rz,record:ET,refinement:EA,ring:EP,semigroup:tN,semigroupoid:EL,semiring:EF,separated:eB,set:E4,show:E9,state:yJ,stateReaderTaskEither:jI,stateT:Aa,store:jD,string:rO,strong:jz,struct:jV,task:OZ,taskEither:Mn,taskOption:N3,taskThese:Lk,these:PN,theseT:PG,traced:LA,traversable:LP,traversableWithIndex:LL,tree:Fh,tuple:FB,unfoldable:Fq,validationT:FV,void:FH,witherable:rC,writer:Dn,writerT:Dr,zero:uE},Symbol.toStringTag,{value:"Module"})),Do=k(Di);var Da={},Du={},Ds={},Dc={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getEndomorphismMonoid=t.not=t.SK=t.hole=t.pipe=t.untupled=t.tupled=t.absurd=t.decrement=t.increment=t.tuple=t.flow=t.flip=t.constVoid=t.constUndefined=t.constNull=t.constFalse=t.constTrue=t.constant=t.unsafeCoerce=t.identity=t.apply=t.getRing=t.getSemiring=t.getMonoid=t.getSemigroup=t.getBooleanAlgebra=void 0;var n=function(t){return function(){return{meet:function(n,r){return function(i){return t.meet(n(i),r(i))}},join:function(n,r){return function(i){return t.join(n(i),r(i))}},zero:function(){return t.zero},one:function(){return t.one},implies:function(n,r){return function(i){return t.implies(n(i),r(i))}},not:function(n){return function(r){return t.not(n(r))}}}}};t.getBooleanAlgebra=n;var r=function(t){return function(){return{concat:function(n,r){return function(i){return t.concat(n(i),r(i))}}}}};t.getSemigroup=r;var i=function(n){var r=(0,t.getSemigroup)(n);return function(){return{concat:r().concat,empty:function(){return n.empty}}}};t.getMonoid=i;var o=function(t){return{add:function(n,r){return function(i){return t.add(n(i),r(i))}},zero:function(){return t.zero},mul:function(n,r){return function(i){return t.mul(n(i),r(i))}},one:function(){return t.one}}};t.getSemiring=o;var a=function(n){var r=(0,t.getSemiring)(n);return{add:r.add,mul:r.mul,one:r.one,zero:r.zero,sub:function(t,r){return function(i){return n.sub(t(i),r(i))}}}};t.getRing=a;var u=function(t){return function(n){return n(t)}};function s(t){return t}function c(t){return function(){return t}}function l(t,n,r,i,o,a,u,s,c){switch(arguments.length){case 1:return t;case 2:return function(){return n(t.apply(this,arguments))};case 3:return function(){return r(n(t.apply(this,arguments)))};case 4:return function(){return i(r(n(t.apply(this,arguments))))};case 5:return function(){return o(i(r(n(t.apply(this,arguments)))))};case 6:return function(){return a(o(i(r(n(t.apply(this,arguments))))))};case 7:return function(){return u(a(o(i(r(n(t.apply(this,arguments)))))))};case 8:return function(){return s(u(a(o(i(r(n(t.apply(this,arguments))))))))};case 9:return function(){return c(s(u(a(o(i(r(n(t.apply(this,arguments)))))))))}}}function f(t){return t+1}function d(t){return t-1}function p(t){throw Error("Called `absurd` function which should be uncallable")}t.apply=u,t.identity=s,t.unsafeCoerce=s,t.constant=c,t.constTrue=c(!0),t.constFalse=c(!1),t.constNull=c(null),t.constUndefined=c(void 0),t.constVoid=t.constUndefined,t.flip=function(t){return function(n,r){return t(r,n)}},t.flow=l,t.tuple=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t},t.increment=f,t.decrement=d,t.absurd=p,t.tupled=function(t){return function(n){return t.apply(void 0,n)}},t.untupled=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t(n)}},t.pipe=function(t,n,r,i,o,a,u,s,c){switch(arguments.length){case 1:return t;case 2:return n(t);case 3:return r(n(t));case 4:return i(r(n(t)));case 5:return o(i(r(n(t))));case 6:return a(o(i(r(n(t)))));case 7:return u(a(o(i(r(n(t))))));case 8:return s(u(a(o(i(r(n(t)))))));case 9:return c(s(u(a(o(i(r(n(t))))))));default:for(var l=arguments[0],f=1;f<arguments.length;f++)l=arguments[f](l);return l}},t.hole=p;var h=function(t,n){return n};t.SK=h,t.not=function(t){return function(n){return!t(n)}};var m=function(){return{concat:function(t,n){return l(t,n)},empty:s}};t.getEndomorphismMonoid=m}(Dc);var Dl={},Df=O&&O.__spreadArray||function(t,n,r){if(r||2===arguments.length)for(var i,o=0,a=n.length;o<a;o++)!i&&o in n||(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return t.concat(i||Array.prototype.slice.call(n))};Object.defineProperty(Dl,"__esModule",{value:!0}),Dl.fromReadonlyNonEmptyArray=Dl.has=Dl.emptyRecord=Dl.emptyReadonlyArray=Dl.tail=Dl.head=Dl.isNonEmpty=Dl.singleton=Dl.right=Dl.left=Dl.isRight=Dl.isLeft=Dl.some=Dl.none=Dl.isSome=Dl.isNone=void 0;var Dd=function(t){return"None"===t._tag};Dl.isNone=Dd;var Dp=function(t){return"Some"===t._tag};Dl.isSome=Dp,Dl.none={_tag:"None"};var Dh=function(t){return{_tag:"Some",value:t}};Dl.some=Dh;var Dm=function(t){return"Left"===t._tag};Dl.isLeft=Dm;var Dg=function(t){return"Right"===t._tag};Dl.isRight=Dg;var Dy=function(t){return{_tag:"Left",left:t}};Dl.left=Dy;var Dv=function(t){return{_tag:"Right",right:t}};Dl.right=Dv;var Db=function(t){return[t]};Dl.singleton=Db;var Dx=function(t){return t.length>0};Dl.isNonEmpty=Dx;var D_=function(t){return t[0]};Dl.head=D_;var DS=function(t){return t.slice(1)};Dl.tail=DS,Dl.emptyReadonlyArray=[],Dl.emptyRecord={},Dl.has=Object.prototype.hasOwnProperty;var DT=function(t){return Df([t[0]],t.slice(1),!0)};Dl.fromReadonlyNonEmptyArray=DT;var Dw=O&&O.__createBinding||(Object.create?function(t,n,r,i){void 0===i&&(i=r);var o=Object.getOwnPropertyDescriptor(n,r);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[r]}}),Object.defineProperty(t,i,o)}:function(t,n,r,i){void 0===i&&(i=r),t[i]=n[r]}),DO=O&&O.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),Dk=O&&O.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&Dw(n,t,r);return DO(n,t),n};Object.defineProperty(Ds,"__esModule",{value:!0}),Ds.sequenceS=Ds.sequenceT=Ds.getApplySemigroup=Ds.apS=Ds.apSecond=Ds.apFirst=Ds.ap=void 0;var DI=Dk(Dl);function DM(t,n,r){return function(i){for(var o=Array(r.length+1),a=0;a<r.length;a++)o[a]=r[a];return o[r.length]=i,0===n?t.apply(null,o):DM(t,n-1,o)}}Ds.ap=function(t,n){return function(r){return function(i){return t.ap(t.map(i,function(t){return function(r){return n.ap(t,r)}}),r)}}},Ds.apFirst=function(t){return function(n){return function(r){return t.ap(t.map(r,function(t){return function(){return t}}),n)}}},Ds.apSecond=function(t){return function(n){return function(r){return t.ap(t.map(r,function(){return function(t){return t}}),n)}}},Ds.apS=function(t){return function(n,r){return function(i){return t.ap(t.map(i,function(t){return function(r){var i;return Object.assign({},t,((i={})[n]=r,i))}}),r)}}},Ds.getApplySemigroup=function(t){return function(n){return{concat:function(r,i){return t.ap(t.map(r,function(t){return function(r){return n.concat(t,r)}}),i)}}}};var DC={1:function(t){return[t]},2:function(t){return function(n){return[t,n]}},3:function(t){return function(n){return function(r){return[t,n,r]}}},4:function(t){return function(n){return function(r){return function(i){return[t,n,r,i]}}}},5:function(t){return function(n){return function(r){return function(i){return function(o){return[t,n,r,i,o]}}}}}};function DR(t){return DI.has.call(DC,t)||(DC[t]=DM(Dc.tuple,t-1,[])),DC[t]}function DE(t){var n=t.length;switch(n){case 1:return function(n){var r;return(r={})[t[0]]=n,r};case 2:return function(n){return function(r){var i;return(i={})[t[0]]=n,i[t[1]]=r,i}};case 3:return function(n){return function(r){return function(i){var o;return(o={})[t[0]]=n,o[t[1]]=r,o[t[2]]=i,o}}};case 4:return function(n){return function(r){return function(i){return function(o){var a;return(a={})[t[0]]=n,a[t[1]]=r,a[t[2]]=i,a[t[3]]=o,a}}}};case 5:return function(n){return function(r){return function(i){return function(o){return function(a){var u;return(u={})[t[0]]=n,u[t[1]]=r,u[t[2]]=i,u[t[3]]=o,u[t[4]]=a,u}}}}};default:return DM(function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];for(var o={},a=0;a<n;a++)o[t[a]]=r[a];return o},n-1,[])}}Ds.sequenceT=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i=n.length,o=DR(i),a=t.map(n[0],o),u=1;u<i;u++)a=t.ap(a,n[u]);return a}},Ds.sequenceS=function(t){return function(n){for(var r=Object.keys(n),i=r.length,o=DE(r),a=t.map(n[r[0]],o),u=1;u<i;u++)a=t.ap(a,n[r[u]]);return a}};var DA={};function Dj(t,n){return function(r){return function(i){return t.map(i,function(t){return n.map(t,r)})}}}Object.defineProperty(DA,"__esModule",{value:!0}),DA.getFunctorComposition=DA.bindTo=DA.flap=DA.map=void 0,DA.map=Dj,DA.flap=function(t){return function(n){return function(r){return t.map(r,function(t){return t(n)})}}},DA.bindTo=function(t){return function(n){return function(r){return t.map(r,function(t){var r;return(r={})[n]=t,r})}}},DA.getFunctorComposition=function(t,n){var r=Dj(t,n);return{map:function(t,n){return(0,Dc.pipe)(t,r(n))}}},Object.defineProperty(Du,"__esModule",{value:!0}),Du.getApplicativeComposition=Du.getApplicativeMonoid=void 0,Du.getApplicativeMonoid=function(t){var n=(0,Ds.getApplySemigroup)(t);return function(r){return{concat:n(r).concat,empty:t.of(r.empty)}}},Du.getApplicativeComposition=function(t,n){var r=(0,DA.getFunctorComposition)(t,n).map,i=(0,Ds.ap)(t,n);return{map:r,of:function(r){return t.of(n.of(r))},ap:function(t,n){return(0,Dc.pipe)(t,i(n))}}};var DN={};Object.defineProperty(DN,"__esModule",{value:!0}),DN.bind=DN.chainFirst=void 0,DN.chainFirst=function(t){return function(n){return function(r){return t.chain(r,function(r){return t.map(n(r),function(){return r})})}}},DN.bind=function(t){return function(n,r){return function(i){return t.chain(i,function(i){return t.map(r(i),function(t){var r;return Object.assign({},i,((r={})[n]=t,r))})})}}};var DP={};Object.defineProperty(DP,"__esModule",{value:!0}),DP.tailRec=void 0;var DL=function(t,n){for(var r=n(t);"Left"===r._tag;)r=n(r.left);return r.right};DP.tailRec=DL;var DF={},DD=O&&O.__createBinding||(Object.create?function(t,n,r,i){void 0===i&&(i=r);var o=Object.getOwnPropertyDescriptor(n,r);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[r]}}),Object.defineProperty(t,i,o)}:function(t,n,r,i){void 0===i&&(i=r),t[i]=n[r]}),DW=O&&O.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),DU=O&&O.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&DD(n,t,r);return DW(n,t),n};Object.defineProperty(DF,"__esModule",{value:!0}),DF.filterOrElse=DF.chainFirstEitherK=DF.chainEitherK=DF.fromEitherK=DF.chainOptionK=DF.fromOptionK=DF.fromPredicate=DF.fromOption=void 0;var Dz=DU(Dl);function DB(t){return function(n){return function(r){return t.fromEither(Dz.isNone(r)?Dz.left(n()):Dz.right(r.value))}}}function Dq(t){var n=DB(t);return function(t){var r=n(t);return function(t){return(0,Dc.flow)(t,r)}}}function DV(t){return function(n){return(0,Dc.flow)(n,t.fromEither)}}DF.fromOption=DB,DF.fromPredicate=function(t){return function(n,r){return function(i){return t.fromEither(n(i)?Dz.right(i):Dz.left(r(i)))}}},DF.fromOptionK=Dq,DF.chainOptionK=function(t,n){var r=Dq(t);return function(t){var i=r(t);return function(t){return function(r){return n.chain(r,i(t))}}}},DF.fromEitherK=DV,DF.chainEitherK=function(t,n){var r=DV(t);return function(t){return function(i){return n.chain(i,r(t))}}},DF.chainFirstEitherK=function(t,n){return(0,Dc.flow)(DV(t),(0,DN.chainFirst)(n))},DF.filterOrElse=function(t,n){return function(r,i){return function(o){return n.chain(o,function(n){return t.fromEither(r(n)?Dz.right(n):Dz.left(i(n)))})}}};var D$,DK,DH,DZ,DG,DJ,DY,DQ,DX,D0,D1={};Object.defineProperty(D$=D1,"__esModule",{value:!0}),D$.right=D$.left=D$.flap=D$.Functor=D$.Bifunctor=D$.URI=D$.bimap=D$.mapLeft=D$.map=D$.separated=void 0,DK=function(t,n){return{left:t,right:n}},D$.separated=DK,DH=function(t,n){return(0,Dc.pipe)(t,(0,D$.map)(n))},DZ=function(t,n){return(0,Dc.pipe)(t,(0,D$.mapLeft)(n))},DG=function(t,n,r){return(0,Dc.pipe)(t,(0,D$.bimap)(n,r))},DJ=function(t){return function(n){return(0,D$.separated)((0,D$.left)(n),t((0,D$.right)(n)))}},D$.map=DJ,DY=function(t){return function(n){return(0,D$.separated)(t((0,D$.left)(n)),(0,D$.right)(n))}},D$.mapLeft=DY,DQ=function(t,n){return function(r){return(0,D$.separated)(t((0,D$.left)(r)),n((0,D$.right)(r)))}},D$.bimap=DQ,D$.URI="Separated",D$.Bifunctor={URI:D$.URI,mapLeft:DZ,bimap:DG},D$.Functor={URI:D$.URI,map:DH},D$.flap=(0,DA.flap)(D$.Functor),DX=function(t){return t.left},D$.left=DX,D0=function(t){return t.right},D$.right=D0;var D2={},D3=O&&O.__createBinding||(Object.create?function(t,n,r,i){void 0===i&&(i=r);var o=Object.getOwnPropertyDescriptor(n,r);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[r]}}),Object.defineProperty(t,i,o)}:function(t,n,r,i){void 0===i&&(i=r),t[i]=n[r]}),D4=O&&O.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),D5=O&&O.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&D3(n,t,r);return D4(n,t),n};Object.defineProperty(D2,"__esModule",{value:!0}),D2.filterE=D2.witherDefault=D2.wiltDefault=void 0;var D6=D5(Dl);D2.wiltDefault=function(t,n){return function(r){var i=t.traverse(r);return function(t,o){return r.map(i(t,o),n.separate)}}},D2.witherDefault=function(t,n){return function(r){var i=t.traverse(r);return function(t,o){return r.map(i(t,o),n.compact)}}},D2.filterE=function(t){return function(n){var r=t.wither(n);return function(t){return function(i){return r(i,function(r){return n.map(t(r),function(t){return t?D6.some(r):D6.none})})}}}},WJ=Da,WY=O&&O.__createBinding||(Object.create?function(t,n,r,i){void 0===i&&(i=r);var o=Object.getOwnPropertyDescriptor(n,r);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[r]}}),Object.defineProperty(t,i,o)}:function(t,n,r,i){void 0===i&&(i=r),t[i]=n[r]}),WQ=O&&O.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),WX=O&&O.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&WY(n,t,r);return WQ(n,t),n},Object.defineProperty(WJ,"__esModule",{value:!0}),WJ.fold=WJ.match=WJ.foldW=WJ.matchW=WJ.isRight=WJ.isLeft=WJ.fromOption=WJ.fromPredicate=WJ.FromEither=WJ.MonadThrow=WJ.throwError=WJ.ChainRec=WJ.Extend=WJ.extend=WJ.Alt=WJ.alt=WJ.altW=WJ.Bifunctor=WJ.mapLeft=WJ.bimap=WJ.Traversable=WJ.sequence=WJ.traverse=WJ.Foldable=WJ.reduceRight=WJ.foldMap=WJ.reduce=WJ.Monad=WJ.Chain=WJ.chain=WJ.chainW=WJ.Applicative=WJ.Apply=WJ.ap=WJ.apW=WJ.Pointed=WJ.of=WJ.Functor=WJ.map=WJ.getAltValidation=WJ.getApplicativeValidation=WJ.getWitherable=WJ.getFilterable=WJ.getCompactable=WJ.getSemigroup=WJ.getEq=WJ.getShow=WJ.URI=WJ.right=WJ.left=void 0,WJ.getValidation=WJ.getValidationMonoid=WJ.getValidationSemigroup=WJ.getApplyMonoid=WJ.getApplySemigroup=WJ.either=WJ.stringifyJSON=WJ.parseJSON=WJ.sequenceArray=WJ.traverseArray=WJ.traverseArrayWithIndex=WJ.traverseReadonlyArrayWithIndex=WJ.traverseReadonlyNonEmptyArrayWithIndex=WJ.ApT=WJ.apSW=WJ.apS=WJ.bindW=WJ.bind=WJ.bindTo=WJ.Do=WJ.exists=WJ.elem=WJ.toError=WJ.toUnion=WJ.chainNullableK=WJ.fromNullableK=WJ.tryCatchK=WJ.tryCatch=WJ.fromNullable=WJ.orElse=WJ.orElseW=WJ.swap=WJ.filterOrElseW=WJ.filterOrElse=WJ.chainOptionK=WJ.fromOptionK=WJ.duplicate=WJ.flatten=WJ.flattenW=WJ.chainFirstW=WJ.chainFirst=WJ.apSecondW=WJ.apSecond=WJ.apFirstW=WJ.apFirst=WJ.flap=WJ.getOrElse=WJ.getOrElseW=void 0,W0=WX(Dl),WJ.left=W0.left,WJ.right=W0.right,W1=function(t,n){return(0,Dc.pipe)(t,(0,WJ.map)(n))},W2=function(t,n){return(0,Dc.pipe)(t,(0,WJ.ap)(n))},W3=function(t,n){return(0,Dc.pipe)(t,(0,WJ.chain)(n))},W4=function(t,n,r){return(0,Dc.pipe)(t,(0,WJ.reduce)(n,r))},W5=function(t){return function(n,r){var i=(0,WJ.foldMap)(t);return(0,Dc.pipe)(n,i(r))}},W6=function(t,n,r){return(0,Dc.pipe)(t,(0,WJ.reduceRight)(n,r))},W9=function(t){var n=(0,WJ.traverse)(t);return function(t,r){return(0,Dc.pipe)(t,n(r))}},W8=function(t,n,r){return(0,Dc.pipe)(t,(0,WJ.bimap)(n,r))},W7=function(t,n){return(0,Dc.pipe)(t,(0,WJ.mapLeft)(n))},Ue=function(t,n){return(0,Dc.pipe)(t,(0,WJ.alt)(n))},Ut=function(t,n){return(0,Dc.pipe)(t,(0,WJ.extend)(n))},Un=function(t,n){return(0,DP.tailRec)(n(t),function(t){return(0,WJ.isLeft)(t)?(0,WJ.right)((0,WJ.left)(t.left)):(0,WJ.isLeft)(t.right)?(0,WJ.left)(n(t.right.left)):(0,WJ.right)((0,WJ.right)(t.right.right))})},WJ.URI="Either",Ur=function(t,n){return{show:function(r){return(0,WJ.isLeft)(r)?"left(".concat(t.show(r.left),")"):"right(".concat(n.show(r.right),")")}}},WJ.getShow=Ur,Ui=function(t,n){return{equals:function(r,i){return r===i||((0,WJ.isLeft)(r)?(0,WJ.isLeft)(i)&&t.equals(r.left,i.left):(0,WJ.isRight)(i)&&n.equals(r.right,i.right))}}},WJ.getEq=Ui,Uo=function(t){return{concat:function(n,r){return(0,WJ.isLeft)(r)?n:(0,WJ.isLeft)(n)?r:(0,WJ.right)(t.concat(n.right,r.right))}}},WJ.getSemigroup=Uo,Ua=function(t){var n=(0,WJ.left)(t.empty);return{URI:WJ.URI,_E:void 0,compact:function(t){return(0,WJ.isLeft)(t)?t:"None"===t.right._tag?n:(0,WJ.right)(t.right.value)},separate:function(t){return(0,WJ.isLeft)(t)?(0,D1.separated)(t,t):(0,WJ.isLeft)(t.right)?(0,D1.separated)((0,WJ.right)(t.right.left),n):(0,D1.separated)(n,(0,WJ.right)(t.right.right))}}},WJ.getCompactable=Ua,Uu=function(t){var n=(0,WJ.left)(t.empty),r=(0,WJ.getCompactable)(t),i=r.compact,o=r.separate,a=function(t,r){return(0,WJ.isLeft)(t)||r(t.right)?t:n},u=function(t,r){return(0,WJ.isLeft)(t)?(0,D1.separated)(t,t):r(t.right)?(0,D1.separated)(n,(0,WJ.right)(t.right)):(0,D1.separated)((0,WJ.right)(t.right),n)};return{URI:WJ.URI,_E:void 0,map:W1,compact:i,separate:o,filter:a,filterMap:function(t,r){if((0,WJ.isLeft)(t))return t;var i=r(t.right);return"None"===i._tag?n:(0,WJ.right)(i.value)},partition:u,partitionMap:function(t,r){if((0,WJ.isLeft)(t))return(0,D1.separated)(t,t);var i=r(t.right);return(0,WJ.isLeft)(i)?(0,D1.separated)((0,WJ.right)(i.left),n):(0,D1.separated)(n,(0,WJ.right)(i.right))}}},WJ.getFilterable=Uu,Us=function(t){var n=(0,WJ.getFilterable)(t),r=(0,WJ.getCompactable)(t);return{URI:WJ.URI,_E:void 0,map:W1,compact:n.compact,separate:n.separate,filter:n.filter,filterMap:n.filterMap,partition:n.partition,partitionMap:n.partitionMap,traverse:W9,sequence:WJ.sequence,reduce:W4,foldMap:W5,reduceRight:W6,wither:(0,D2.witherDefault)(WJ.Traversable,r),wilt:(0,D2.wiltDefault)(WJ.Traversable,r)}},WJ.getWitherable=Us,Uc=function(t){return{URI:WJ.URI,_E:void 0,map:W1,ap:function(n,r){return(0,WJ.isLeft)(n)?(0,WJ.isLeft)(r)?(0,WJ.left)(t.concat(n.left,r.left)):n:(0,WJ.isLeft)(r)?r:(0,WJ.right)(n.right(r.right))},of:WJ.of}},WJ.getApplicativeValidation=Uc,Ul=function(t){return{URI:WJ.URI,_E:void 0,map:W1,alt:function(n,r){if((0,WJ.isRight)(n))return n;var i=r();return(0,WJ.isLeft)(i)?(0,WJ.left)(t.concat(n.left,i.left)):i}}},WJ.getAltValidation=Ul,Uf=function(t){return function(n){return(0,WJ.isLeft)(n)?n:(0,WJ.right)(t(n.right))}},WJ.map=Uf,WJ.Functor={URI:WJ.URI,map:W1},WJ.of=WJ.right,WJ.Pointed={URI:WJ.URI,of:WJ.of},Ud=function(t){return function(n){return(0,WJ.isLeft)(n)?n:(0,WJ.isLeft)(t)?t:(0,WJ.right)(n.right(t.right))}},WJ.apW=Ud,WJ.ap=WJ.apW,WJ.Apply={URI:WJ.URI,map:W1,ap:W2},WJ.Applicative={URI:WJ.URI,map:W1,ap:W2,of:WJ.of},Up=function(t){return function(n){return(0,WJ.isLeft)(n)?n:t(n.right)}},WJ.chainW=Up,WJ.chain=WJ.chainW,WJ.Chain={URI:WJ.URI,map:W1,ap:W2,chain:W3},WJ.Monad={URI:WJ.URI,map:W1,ap:W2,of:WJ.of,chain:W3},Uh=function(t,n){return function(r){return(0,WJ.isLeft)(r)?t:n(t,r.right)}},WJ.reduce=Uh,Um=function(t){return function(n){return function(r){return(0,WJ.isLeft)(r)?t.empty:n(r.right)}}},WJ.foldMap=Um,Ug=function(t,n){return function(r){return(0,WJ.isLeft)(r)?t:n(r.right,t)}},WJ.reduceRight=Ug,WJ.Foldable={URI:WJ.URI,reduce:W4,foldMap:W5,reduceRight:W6},Uy=function(t){return function(n){return function(r){return(0,WJ.isLeft)(r)?t.of((0,WJ.left)(r.left)):t.map(n(r.right),WJ.right)}}},WJ.traverse=Uy,Uv=function(t){return function(n){return(0,WJ.isLeft)(n)?t.of((0,WJ.left)(n.left)):t.map(n.right,WJ.right)}},WJ.sequence=Uv,WJ.Traversable={URI:WJ.URI,map:W1,reduce:W4,foldMap:W5,reduceRight:W6,traverse:W9,sequence:WJ.sequence},Ub=function(t,n){return function(r){return(0,WJ.isLeft)(r)?(0,WJ.left)(t(r.left)):(0,WJ.right)(n(r.right))}},WJ.bimap=Ub,Ux=function(t){return function(n){return(0,WJ.isLeft)(n)?(0,WJ.left)(t(n.left)):n}},WJ.mapLeft=Ux,WJ.Bifunctor={URI:WJ.URI,bimap:W8,mapLeft:W7},U_=function(t){return function(n){return(0,WJ.isLeft)(n)?t():n}},WJ.altW=U_,WJ.alt=WJ.altW,WJ.Alt={URI:WJ.URI,map:W1,alt:Ue},US=function(t){return function(n){return(0,WJ.isLeft)(n)?n:(0,WJ.right)(t(n))}},WJ.extend=US,WJ.Extend={URI:WJ.URI,map:W1,extend:Ut},WJ.ChainRec={URI:WJ.URI,map:W1,ap:W2,chain:W3,chainRec:Un},WJ.throwError=WJ.left,WJ.MonadThrow={URI:WJ.URI,map:W1,ap:W2,of:WJ.of,chain:W3,throwError:WJ.throwError},WJ.FromEither={URI:WJ.URI,fromEither:Dc.identity},WJ.fromPredicate=(0,DF.fromPredicate)(WJ.FromEither),WJ.fromOption=(0,DF.fromOption)(WJ.FromEither),WJ.isLeft=W0.isLeft,WJ.isRight=W0.isRight,UT=function(t,n){return function(r){return(0,WJ.isLeft)(r)?t(r.left):n(r.right)}},WJ.matchW=UT,WJ.foldW=WJ.matchW,WJ.match=WJ.matchW,WJ.fold=WJ.match,Uw=function(t){return function(n){return(0,WJ.isLeft)(n)?t(n.left):n.right}},WJ.getOrElseW=Uw,WJ.getOrElse=WJ.getOrElseW,WJ.flap=(0,DA.flap)(WJ.Functor),WJ.apFirst=(0,Ds.apFirst)(WJ.Apply),WJ.apFirstW=WJ.apFirst,WJ.apSecond=(0,Ds.apSecond)(WJ.Apply),WJ.apSecondW=WJ.apSecond,WJ.chainFirst=(0,DN.chainFirst)(WJ.Chain),WJ.chainFirstW=WJ.chainFirst,WJ.flattenW=(0,WJ.chainW)(Dc.identity),WJ.flatten=WJ.flattenW,WJ.duplicate=(0,WJ.extend)(Dc.identity),WJ.fromOptionK=(0,DF.fromOptionK)(WJ.FromEither),WJ.chainOptionK=(0,DF.chainOptionK)(WJ.FromEither,WJ.Chain),WJ.filterOrElse=(0,DF.filterOrElse)(WJ.FromEither,WJ.Chain),WJ.filterOrElseW=WJ.filterOrElse,UO=function(t){return(0,WJ.isLeft)(t)?(0,WJ.right)(t.left):(0,WJ.left)(t.right)},WJ.swap=UO,Uk=function(t){return function(n){return(0,WJ.isLeft)(n)?t(n.left):n}},WJ.orElseW=Uk,WJ.orElse=WJ.orElseW,UI=function(t){return function(n){return null==n?(0,WJ.left)(t):(0,WJ.right)(n)}},WJ.fromNullable=UI,UM=function(t,n){try{return(0,WJ.right)(t())}catch(r){return(0,WJ.left)(n(r))}},WJ.tryCatch=UM,UC=function(t,n){return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return(0,WJ.tryCatch)(function(){return t.apply(void 0,r)},n)}},WJ.tryCatchK=UC,UR=function(t){var n=(0,WJ.fromNullable)(t);return function(t){return(0,Dc.flow)(t,n)}},WJ.fromNullableK=UR,UE=function(t){var n=(0,WJ.fromNullableK)(t);return function(t){return(0,WJ.chain)(n(t))}},WJ.chainNullableK=UE,WJ.toUnion=(0,WJ.foldW)(Dc.identity,Dc.identity),WJ.toError=function(t){return t instanceof Error?t:Error(String(t))},WJ.elem=function t(n){return function(r,i){if(void 0===i){var o=t(n);return function(t){return o(r,t)}}return!(0,WJ.isLeft)(i)&&n.equals(r,i.right)}},UA=function(t){return function(n){return!(0,WJ.isLeft)(n)&&t(n.right)}},WJ.exists=UA,WJ.Do=(0,WJ.of)(W0.emptyRecord),WJ.bindTo=(0,DA.bindTo)(WJ.Functor),WJ.bind=(0,DN.bind)(WJ.Chain),WJ.bindW=WJ.bind,WJ.apS=(0,Ds.apS)(WJ.Apply),WJ.apSW=WJ.apS,WJ.ApT=(0,WJ.of)(W0.emptyReadonlyArray),Uj=function(t){return function(n){var r=t(0,W0.head(n));if((0,WJ.isLeft)(r))return r;for(var i=[r.right],o=1;o<n.length;o++){var a=t(o,n[o]);if((0,WJ.isLeft)(a))return a;i.push(a.right)}return(0,WJ.right)(i)}},WJ.traverseReadonlyNonEmptyArrayWithIndex=Uj,UN=function(t){var n=(0,WJ.traverseReadonlyNonEmptyArrayWithIndex)(t);return function(t){return W0.isNonEmpty(t)?n(t):WJ.ApT}},WJ.traverseReadonlyArrayWithIndex=UN,WJ.traverseArrayWithIndex=WJ.traverseReadonlyArrayWithIndex,UP=function(t){return(0,WJ.traverseReadonlyArrayWithIndex)(function(n,r){return t(r)})},WJ.traverseArray=UP,WJ.sequenceArray=(0,WJ.traverseArray)(Dc.identity),WJ.parseJSON=function(t,n){return(0,WJ.tryCatch)(function(){return JSON.parse(t)},n)},UL=function(t,n){return(0,WJ.tryCatch)(function(){var n=JSON.stringify(t);if("string"!=typeof n)throw Error("Converting unsupported structure to JSON");return n},n)},WJ.stringifyJSON=UL,WJ.either={URI:WJ.URI,map:W1,of:WJ.of,ap:W2,chain:W3,reduce:W4,foldMap:W5,reduceRight:W6,traverse:W9,sequence:WJ.sequence,bimap:W8,mapLeft:W7,alt:Ue,extend:Ut,chainRec:Un,throwError:WJ.throwError},WJ.getApplySemigroup=(0,Ds.getApplySemigroup)(WJ.Apply),WJ.getApplyMonoid=(0,Du.getApplicativeMonoid)(WJ.Applicative),UF=function(t,n){return(0,Ds.getApplySemigroup)((0,WJ.getApplicativeValidation)(t))(n)},WJ.getValidationSemigroup=UF,UD=function(t,n){return(0,Du.getApplicativeMonoid)((0,WJ.getApplicativeValidation)(t))(n)},WJ.getValidationMonoid=UD,WJ.getValidation=function(t){var n=(0,WJ.getApplicativeValidation)(t).ap,r=(0,WJ.getAltValidation)(t).alt;return{URI:WJ.URI,_E:void 0,map:W1,of:WJ.of,chain:W3,bimap:W8,mapLeft:W7,reduce:W4,foldMap:W5,reduceRight:W6,extend:Ut,traverse:W9,sequence:WJ.sequence,chainRec:Un,throwError:WJ.throwError,ap:n,alt:r}};var D9=globalThis&&globalThis.__extends||(UW=function(t,n){return(UW=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])})(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}UW(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}),D8=globalThis&&globalThis.__assign||function(){return(D8=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t}).apply(this,arguments)},D7=globalThis&&globalThis.__spreadArray||function(t,n,r){if(r||2===arguments.length)for(var i,o=0,a=n.length;o<a;o++)!i&&o in n||(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return t.concat(i||Array.prototype.slice.call(n))},We=function(t,n,r){return e_([{value:t,context:n,message:r}])},Wt=function(){function t(t,n,r,i){this.name=t,this.is=n,this.validate=r,this.encode=i,this.decode=this.decode.bind(this)}return t.prototype.pipe=function(n,r){var i=this;return void 0===r&&(r="pipe(".concat(this.name,", ").concat(n.name,")")),new t(r,n.is,function(t,r){var o=i.validate(t,r);return ml(o)?o:n.validate(o.right,r)},this.encode===Wn&&n.encode===Wn?Wn:function(t){return i.encode(n.encode(t))})},t.prototype.asDecoder=function(){return this},t.prototype.asEncoder=function(){return this},t.prototype.decode=function(t){return this.validate(t,[{key:"",type:this,actual:t}])},t}(),Wn=function(t){return t};function Wr(t){return t.displayName||t.name||"<function".concat(t.length,">")}function Wi(t,n,r,i){for(var o=t.length,a=Array(o+1),u=0;u<o;u++)a[u]=t[u];return a[o]={key:n,type:r,actual:i},a}function Wo(t,n){for(var r=n.length,i=0;i<r;i++)t.push(n[i])}var Wa=Object.prototype.hasOwnProperty;function Wu(t){return Object.keys(t).map(function(n){return"".concat(n,": ").concat(t[n].name)}).join(", ")}function Ws(t){for(var n=0;n<t.length;n++)if(t[n].encode!==Wn)return!1;return!0}function Wc(t){return"{ ".concat(Wu(t)," }")}function Wl(t){return"Partial<".concat(t,">")}function Wf(t){if(Wb(t)){var n,r,i=t.value;if(WN.is(i))return(n={})[i]=null,n}else{if(r=t,"KeyofType"===r._tag)return t.keys;if(W_(t)){var o=t.types.map(function(t){return Wf(t)});return o.some(WM.is)?void 0:Object.assign.apply(Object,D7([{}],o,!1))}}}function Wd(t){return"("+t.map(function(t){return t.name}).join(" | ")+")"}function Wp(t,n){for(var r=!0,i=!0,o=!WV.is(t),a=0;a<n.length;a++){var u=n[a];u!==t&&(r=!1),WV.is(u)&&(i=!1)}if(r)return t;if(i)return n[n.length-1];for(var s={},c=0;c<n.length;c++){var u=n[c];for(var l in u)(!Wa.call(s,l)||o||u[l]!==t[l])&&(s[l]=u[l])}return s}function Wh(t,n){for(var r=Object.getOwnPropertyNames(t),i=!1,o={},a=0;a<r.length;a++){var u=r[a];Wa.call(n,u)?o[u]=t[u]:i=!0}return i?o:t}function Wm(t){return t.length>0}var Wg={};function Wy(t,n){for(var r=[],i=0;i<t.length;i++){var o=t[i];-1!==n.indexOf(o)&&r.push(o)}return r}function Wv(t){return"AnyType"===t._tag}function Wb(t){return"LiteralType"===t._tag}function Wx(t){return"InterfaceType"===t._tag}function W_(t){return"UnionType"===t._tag}var WS=[];function WT(t){if(-1!==WS.indexOf(t))return Wg;if(Wx(t)||"StrictType"===(n=t)._tag){var n,r,i,o,a,u=Wg;for(var s in t.props){var c=t.props[s];Wb(c)&&(u===Wg&&(u={}),u[s]=[c.value])}return u}if("ExactType"===t._tag||"RefinementType"===t._tag)return WT(t.type);if("IntersectionType"===t._tag)return t.types.reduce(function(t,n){return function(t,n){if(t===Wg)return n;if(n===Wg)return t;var r=Object.assign({},t);for(var i in n)if(Wa.call(t,i)){var o=Wy(t[i],n[i]);if(Wm(o))r[i]=o;else{r=Wg;break}}else r[i]=n[i];return r}(t,WT(n))},Wg);if(W_(t))return t.types.slice(1).reduce(function(t,n){return function(t,n){if(t===Wg||n===Wg)return Wg;var r=Wg;for(var i in t)Wa.call(n,i)&&0===Wy(t[i],n[i]).length&&(r===Wg&&(r={}),r[i]=t[i].concat(n[i]));return r}(t,WT(n))},WT(t.types[0]));if("RecursiveType"===t._tag){WS.push(t);var l=WT(t.type);return WS.pop(),l}return Wg}function Ww(t){var n=WT(t[0]),r=Object.keys(n),i=t.length;e:for(var o=0;o<r.length;o++){var a=function(r){for(var o=n[r].slice(),a=[n[r]],u=1;u<i;u++){var s=WT(t[u])[r];if(void 0===s||s.some(function(t){return -1!==o.indexOf(t)}))return"continue-keys";o.push.apply(o,s),a.push(s)}return{value:[r,a]}}(r[o]);if("object"==typeof a)return a.value;if("continue-keys"===a)continue e}}var WO=function(t){function n(){var n=t.call(this,"null",function(t){return null===t},function(t,r){return n.is(t)?eS(t):We(t,r)},Wn)||this;return n._tag="NullType",n}return D9(n,t),n}(Wt),Wk=new WO,WI=function(t){function n(){var n=t.call(this,"undefined",function(t){return void 0===t},function(t,r){return n.is(t)?eS(t):We(t,r)},Wn)||this;return n._tag="UndefinedType",n}return D9(n,t),n}(Wt),WM=new WI,WC=function(t){function n(){var n=t.call(this,"void",WM.is,WM.validate,Wn)||this;return n._tag="VoidType",n}return D9(n,t),n}(Wt),WR=new WC,WE=function(t){function n(){var n=t.call(this,"unknown",function(t){return!0},eS,Wn)||this;return n._tag="UnknownType",n}return D9(n,t),n}(Wt),WA=new WE,Wj=function(t){function n(){var n=t.call(this,"string",function(t){return"string"==typeof t},function(t,r){return n.is(t)?eS(t):We(t,r)},Wn)||this;return n._tag="StringType",n}return D9(n,t),n}(Wt),WN=new Wj,WP=function(t){function n(){var n=t.call(this,"number",function(t){return"number"==typeof t},function(t,r){return n.is(t)?eS(t):We(t,r)},Wn)||this;return n._tag="NumberType",n}return D9(n,t),n}(Wt),WL=new WP,WF=function(t){function n(){var n=t.call(this,"bigint",function(t){return"bigint"==typeof t},function(t,r){return n.is(t)?eS(t):We(t,r)},Wn)||this;return n._tag="BigIntType",n}return D9(n,t),n}(Wt),WD=new WF,WW=function(t){function n(){var n=t.call(this,"boolean",function(t){return"boolean"==typeof t},function(t,r){return n.is(t)?eS(t):We(t,r)},Wn)||this;return n._tag="BooleanType",n}return D9(n,t),n}(Wt),WU=new WW,Wz=function(t){function n(){var n=t.call(this,"UnknownArray",Array.isArray,function(t,r){return n.is(t)?eS(t):We(t,r)},Wn)||this;return n._tag="AnyArrayType",n}return D9(n,t),n}(Wt),WB=new Wz,Wq=function(t){function n(){var n=t.call(this,"UnknownRecord",function(t){var n=Object.prototype.toString.call(t);return"[object Object]"===n||"[object Window]"===n},function(t,r){return n.is(t)?eS(t):We(t,r)},Wn)||this;return n._tag="AnyDictionaryType",n}return D9(n,t),n}(Wt),WV=new Wq,W$=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.value=a,u._tag="LiteralType",u}return D9(n,t),n}(Wt);function WK(t,n){void 0===n&&(n=JSON.stringify(t));var r=function(n){return n===t};return new W$(n,r,function(n,i){return r(n)?eS(t):We(n,i)},Wn,t)}var WH=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.keys=a,u._tag="KeyofType",u}return D9(n,t),n}(Wt),WZ=function(t){function n(n,r,i,o,a,u){var s=t.call(this,n,r,i,o)||this;return s.type=a,s.predicate=u,s._tag="RefinementType",s}return D9(n,t),n}(Wt);function WG(t,n,r){return zl(t,n,r)}var WJ,WY,WQ,WX,W0,W1,W2,W3,W4,W5,W6,W9,W8,W7,Ue,Ut,Un,Ur,Ui,Uo,Ua,Uu,Us,Uc,Ul,Uf,Ud,Up,Uh,Um,Ug,Uy,Uv,Ub,Ux,U_,US,UT,Uw,UO,Uk,UI,UM,UC,UR,UE,UA,Uj,UN,UP,UL,UF,UD,UW,UU,Uz,UB=zl(WL,Uz=function(t){return Number.isInteger(t)},"Int"),Uq=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.runDefinition=a,u._tag="RecursiveType",u}return D9(n,t),n}(Wt);function UV(t,n){var r,i=function(){return r||((r=n(o)).name=t),r},o=new Uq(t,function(t){return i().is(t)},function(t,n){return i().validate(t,n)},function(t){return i().encode(t)},i);return o}Object.defineProperty(Uq.prototype,"type",{get:function(){return this.runDefinition()},enumerable:!0,configurable:!0});var U$=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.type=a,u._tag="ArrayType",u}return D9(n,t),n}(Wt);function UK(t,n){return void 0===n&&(n="Array<".concat(t.name,">")),new U$(n,function(n){return WB.is(n)&&n.every(t.is)},function(n,r){var i=WB.validate(n,r);if(ml(i))return i;for(var o=i.right,a=o.length,u=o,s=[],c=0;c<a;c++){var l=o[c],f=t.validate(l,Wi(r,String(c),t,l));if(ml(f))Wo(s,f.left);else{var d=f.right;d!==l&&(u===o&&(u=o.slice()),u[c]=d)}}return s.length>0?e_(s):eS(u)},t.encode===Wn?Wn:function(n){return n.map(t.encode)},t)}var UH=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.props=a,u._tag="InterfaceType",u}return D9(n,t),n}(Wt);function UZ(t,n){void 0===n&&(n=Wc(t));var r=Object.keys(t),i=r.map(function(n){return t[n]}),o=r.length;return new UH(n,function(t){if(WV.is(t)){for(var n=0;n<o;n++){var a=r[n],u=t[a];if(void 0===u&&!Wa.call(t,a)||!i[n].is(u))return!1}return!0}return!1},function(t,n){var a=WV.validate(t,n);if(ml(a))return a;for(var u=a.right,s=u,c=[],l=0;l<o;l++){var f=r[l],d=s[f],p=i[l],h=p.validate(d,Wi(n,f,p,d));if(ml(h))Wo(c,h.left);else{var m=h.right;m===d&&(void 0!==m||Wa.call(s,f))||(s===u&&(s=D8({},u)),s[f]=m)}}return c.length>0?e_(c):eS(s)},Ws(i)?Wn:function(t){for(var n=D8({},t),a=0;a<o;a++){var u=r[a],s=i[a].encode;s!==Wn&&(n[u]=s(t[u]))}return n},t)}var UG=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.props=a,u._tag="PartialType",u}return D9(n,t),n}(Wt),UJ=function(t){function n(n,r,i,o,a,u){var s=t.call(this,n,r,i,o)||this;return s.domain=a,s.codomain=u,s._tag="DictionaryType",s}return D9(n,t),n}(Wt);function UY(t,n,r){var i,o,a,u,s,c,l,f,d=Wf(t);return d?(i=Object.keys(d),void 0===(u=r)&&(u="{ [K in ".concat(t.name,"]: ").concat(n.name," }")),s=i.length,new UJ(u,function(t){return WV.is(t)&&i.every(function(r){return n.is(t[r])})},function(t,r){var o=WV.validate(t,r);if(ml(o))return o;for(var a=o.right,u={},c=[],l=!1,f=0;f<s;f++){var d=i[f],p=a[d],h=n.validate(p,Wi(r,d,n,p));if(ml(h))Wo(c,h.left);else{var m=h.right;l=l||m!==p,u[d]=m}}return c.length>0?e_(c):eS(l||Object.keys(a).length!==s?u:a)},n.encode===Wn?Wn:function(t){for(var r={},o=0;o<s;o++){var a=i[o];r[a]=n.encode(t[a])}return r},t,n)):(c=t,void 0===(f=r)&&(f="{ [K in ".concat(c.name,"]: ").concat(n.name," }")),new UJ(f,function(t){return WV.is(t)?Object.keys(t).every(function(r){return c.is(r)&&n.is(t[r])}):Wv(n)&&Array.isArray(t)},function(t,r){if(WV.is(t)){for(var i={},o=[],a=Object.keys(t),u=a.length,s=!1,l=0;l<u;l++){var f=a[l],d=t[f],p=c.validate(f,Wi(r,f,c,f));if(ml(p))Wo(o,p.left);else{var h=p.right;s=s||h!==f,f=h;var m=n.validate(d,Wi(r,f,n,d));if(ml(m))Wo(o,m.left);else{var g=m.right;s=s||g!==d,i[f]=g}}}return o.length>0?e_(o):eS(s?i:t)}return Wv(n)&&Array.isArray(t)?eS(t):We(t,r)},c.encode===Wn&&n.encode===Wn?Wn:function(t){for(var r={},i=Object.keys(t),o=i.length,a=0;a<o;a++){var u=i[a];r[String(c.encode(u))]=n.encode(t[u])}return r},c,n))}var UQ=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.types=a,u._tag="UnionType",u}return D9(n,t),n}(Wt);function UX(t,n){void 0===n&&(n=Wd(t));var r=Ww(t);if(void 0===r||!(t.length>0))return new UQ(n,function(n){return t.some(function(t){return t.is(n)})},function(n,r){for(var i=[],o=0;o<t.length;o++){var a=t[o],u=a.validate(n,Wi(r,String(o),a,n));if(!ml(u))return eS(u.right);Wo(i,u.left)}return e_(i)},Ws(t)?Wn:function(r){for(var i=0;i<t.length;i++){var o=t[i];if(o.is(r))return o.encode(r)}throw Error("no codec found to encode value in union type ".concat(n))},t);var i=r[0],o=r[1],a=o.length,u=function(t){for(var n=0;n<a;n++)if(-1!==o[n].indexOf(t))return n};return new ze(n,function(n){if(WV.is(n)){var r=u(n[i]);return void 0!==r&&t[r].is(n)}return!1},function(n,r){var o=WV.validate(n,r);if(ml(o))return o;var a=o.right,s=u(a[i]);if(void 0===s)return We(n,r);var c=t[s];return c.validate(a,Wi(r,String(s),c,a))},Ws(t)?Wn:function(r){var o=u(r[i]);if(void 0===o)throw Error("no codec found to encode value in union codec ".concat(n));return t[o].encode(r)},t,i)}var U0=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.types=a,u._tag="IntersectionType",u}return D9(n,t),n}(Wt),U1=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.types=a,u._tag="TupleType",u}return D9(n,t),n}(Wt),U2=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.type=a,u._tag="ReadonlyType",u}return D9(n,t),n}(Wt),U3=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.type=a,u._tag="ReadonlyArrayType",u}return D9(n,t),n}(Wt);function U4(t,n){void 0===n&&(n="ReadonlyArray<".concat(t.name,">"));var r=UK(t);return new U3(n,r.is,r.validate,r.encode,t)}var U5=function(t,n){return U9(UZ(t),n)},U6=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.type=a,u._tag="ExactType",u}return D9(n,t),n}(Wt);function U9(t,n){void 0===n&&(n=Wx(i=t)?"{| ".concat(Wu(i.props)," |}"):(r=i,"PartialType"===r._tag)?Wl("{| ".concat(Wu(i.props)," |}")):"Exact<".concat(i.name,">"));var r,i,o=function t(n){switch(n._tag){case"RefinementType":case"ReadonlyType":return t(n.type);case"InterfaceType":case"StrictType":case"PartialType":return n.props;case"IntersectionType":return n.types.reduce(function(n,r){return Object.assign(n,t(r))},{})}}(t);return new U6(n,t.is,function(n,r){var i=WV.validate(n,r);if(ml(i))return i;var a=t.validate(n,r);return ml(a)?a:eS(Wh(a.right,o))},function(n){return t.encode(Wh(n,o))},t)}var U8=function(t){function n(){var n=t.call(this,"Function",function(t){return"function"==typeof t},function(t,r){return n.is(t)?eS(t):We(t,r)},Wn)||this;return n._tag="FunctionType",n}return D9(n,t),n}(Wt),U7=new U8,ze=function(t){function n(n,r,i,o,a,u){var s=t.call(this,n,r,i,o,a)||this;return s.tag=u,s}return D9(n,t),n}(UQ),zt=function(t,n,r){void 0===r&&(r=Wd(n));var i=UX(n,r);return i instanceof ze?i:(console.warn("[io-ts] Cannot build a tagged union for ".concat(r,", returning a de-optimized union")),new ze(r,i.is,i.validate,i.encode,n,t))},zn=function(t,n){return{value:t,context:n}},zr=function(t){return[{key:"",type:t}]},zi=function(t){function n(){var n=t.call(this,"never",function(t){return!1},function(t,n){return We(t,n)},function(){throw Error("cannot encode never")})||this;return n._tag="NeverType",n}return D9(n,t),n}(Wt),zo=new zi,za=function(t){function n(){var n=t.call(this,"any",function(t){return!0},eS,Wn)||this;return n._tag="AnyType",n}return D9(n,t),n}(Wt),zu=new za,zs=function(t){function n(){var n=t.call(this,"object",function(t){return null!==t&&"object"==typeof t},function(t,r){return n.is(t)?eS(t):We(t,r)},Wn)||this;return n._tag="ObjectType",n}return D9(n,t),n}(Wt),zc=new zs;function zl(t,n,r){return void 0===r&&(r="(".concat(t.name," | ").concat(Wr(n),")")),new WZ(r,function(r){return t.is(r)&&n(r)},function(r,i){var o=t.validate(r,i);if(ml(o))return o;var a=o.right;return n(a)?eS(a):We(a,i)},t.encode,t,n)}var zf=zl(WL,Number.isInteger,"Integer"),zd=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.props=a,u._tag="StrictType",u}return D9(n,t),n}(Wt);function zp(t){return t}let zh=Object.freeze(Object.defineProperty({__proto__:null,AnyArrayType:Wz,AnyDictionaryType:Wq,AnyType:za,Array:WB,ArrayType:U$,BigIntType:WF,BooleanType:WW,Dictionary:WV,DictionaryType:UJ,ExactType:U6,Function:U7,FunctionType:U8,Int:UB,Integer:zf,InterfaceType:UH,IntersectionType:U0,KeyofType:WH,LiteralType:W$,NeverType:zi,NullType:WO,NumberType:WP,ObjectType:zs,PartialType:UG,ReadonlyArrayType:U3,ReadonlyType:U2,RecursiveType:Uq,RefinementType:WZ,StrictType:zd,StringType:Wj,TaggedUnionType:ze,TupleType:U1,Type:Wt,UndefinedType:WI,UnionType:UQ,UnknownArray:WB,UnknownRecord:WV,UnknownType:WE,VoidType:WC,alias:function(t){return function(){return t}},any:zu,appendContext:Wi,array:UK,bigint:WD,boolean:WU,brand:WG,clean:zp,dictionary:UY,emptyTags:Wg,exact:U9,failure:We,failures:e_,getContextEntry:function(t,n){return{key:t,type:n}},getDefaultContext:zr,getDomainKeys:Wf,getFunctionName:Wr,getIndex:Ww,getTags:WT,getValidationError:zn,identity:Wn,interface:UZ,intersection:function(t,n){void 0===n&&(n="(".concat(t.map(function(t){return t.name}).join(" & "),")"));var r=t.length;return new U0(n,function(n){return t.every(function(t){return t.is(n)})},0===t.length?eS:function(n,i){for(var o=[],a=[],u=0;u<r;u++){var s=t[u],c=s.validate(n,Wi(i,String(u),s,n));ml(c)?Wo(a,c.left):o.push(c.right)}return a.length>0?e_(a):eS(Wp(n,o))},0===t.length?Wn:function(n){return Wp(n,t.map(function(t){return t.encode(n)}))},t)},keyof:function(t,n){void 0===n&&(n=Object.keys(t).map(function(t){return JSON.stringify(t)}).join(" | "));var r=function(n){return WN.is(n)&&Wa.call(t,n)};return new WH(n,r,function(t,n){return r(t)?eS(t):We(t,n)},Wn,t)},literal:WK,mergeAll:Wp,never:zo,null:Wk,nullType:Wk,number:WL,object:zc,partial:function(t,n){void 0===n&&(n=Wl(Wc(t)));var r=Object.keys(t),i=r.map(function(n){return t[n]}),o=r.length;return new UG(n,function(n){if(WV.is(n)){for(var i=0;i<o;i++){var a=r[i],u=n[a];if(void 0!==u&&!t[a].is(u))return!1}return!0}return!1},function(n,i){var a=WV.validate(n,i);if(ml(a))return a;for(var u=a.right,s=u,c=[],l=0;l<o;l++){var f=r[l],d=s[f],p=t[f],h=p.validate(d,Wi(i,f,p,d));if(ml(h))void 0!==d&&Wo(c,h.left);else{var m=h.right;m!==d&&(s===u&&(s=D8({},u)),s[f]=m)}}return c.length>0?e_(c):eS(s)},Ws(i)?Wn:function(t){for(var n=D8({},t),a=0;a<o;a++){var u=r[a],s=t[u];void 0!==s&&(n[u]=i[a].encode(s))}return n},t)},readonly:function(t,n){return void 0===n&&(n="Readonly<".concat(t.name,">")),new U2(n,t.is,t.validate,t.encode,t)},readonlyArray:U4,record:UY,recursion:UV,refinement:zl,strict:U5,string:WN,success:eS,taggedUnion:zt,tuple:function(t,n){void 0===n&&(n="[".concat(t.map(function(t){return t.name}).join(", "),"]"));var r=t.length;return new U1(n,function(n){return WB.is(n)&&n.length===r&&t.every(function(t,r){return t.is(n[r])})},function(n,i){var o=WB.validate(n,i);if(ml(o))return o;for(var a=o.right,u=a.length>r?a.slice(0,r):a,s=[],c=0;c<r;c++){var l=a[c],f=t[c],d=f.validate(l,Wi(i,String(c),f,l));if(ml(d))Wo(s,d.left);else{var p=d.right;p!==l&&(u===a&&(u=a.slice()),u[c]=p)}}return s.length>0?e_(s):eS(u)},Ws(t)?Wn:function(n){return t.map(function(t,r){return t.encode(n[r])})},t)},type:UZ,undefined:WM,union:UX,unknown:WA,void:WR,voidType:WR},Symbol.toStringTag,{value:"Module"})),zm=k(zh);var zg={},zy={},zv={};let zb=k(Y);function zx(t,n,r){return void 0===r&&(r=t.name),new Wt(r,t.is,t.validate,function(r){return n(t.encode(r))})}let z_=Object.freeze(Object.defineProperty({__proto__:null,mapOutput:zx},Symbol.toStringTag,{value:"Module"})),zS=k(z_);Object.defineProperty(zv,"__esModule",{value:!0}),zv.addType=zv.isEmpty=zv.objectToMap=zv.grouped=zv.formatDate=zv.formatDateTime=zv.filterDouble=zv.refineType=zv.nullable=void 0;let zT=oN,zw=(0,zT.__importStar)(zm);zv.nullable=function(t){return zw.union([t,zw.null,zw.undefined])},zv.refineType=function(t,n,r){return new zw.Type(n,t.is,(n,i)=>(0,zb.pipe)(t.validate(n,i),Do.either.chain(t=>r(t)?zw.success(t):zw.failure(n,i))),t.encode)},zv.filterDouble=function(t){if(""===t)return null;let n=Number(t);return Number.isNaN(n)?null:n},zv.formatDateTime=function(t){return t.toISOString().replace(/\.\d{3}Z$/,"+0000")},zv.formatDate=function(t){return t.toISOString().replace(/T.*/,"")},zv.grouped=function(t,n){return t.reduce((t,r,i)=>(i%n==0?t.push([r]):t[Math.floor(i/n)].push(r),t),[])},zv.objectToMap=function(t){return new Map(Object.entries(t))},zv.isEmpty=function(t){for(let n in t)return!1;return!0},zv.addType=function(t,n){return(0,zS.mapOutput)(t,t=>({...t,__TYPE__:n}))},Object.defineProperty(zy,"__esModule",{value:!0}),zy.WidgetKey=void 0;let zO=oN,zk=(0,zO.__importStar)(zm),zI=RegExp("^[^<>]+$");zy.WidgetKey=(0,zv.refineType)(zk.string,"WidgetKey",t=>0===t.length||zI.test(t)),Object.defineProperty(zM=zg,"__esModule",{value:!0}),(0,oN.__exportStar)(zy,zM);var zM,zC,zR,zE,zA={},zj={},zN={};function zP(){if(zE)return zN;zE=1,Object.defineProperty(zN,"__esModule",{value:!0}),zN.hasContentType=zN.hasFieldContentType=void 0;let t=KT();function n(t){return"object"==typeof t&&null!==t&&"__TYPE__"in t}return zN.hasFieldContentType=function(r){return n(r)&&r.__TYPE__===t.FieldContentType&&(null==r?void 0:r.type)!==void 0&&"string"==typeof r.type&&(0,Da.isRight)(t.FieldType.decode(r.type))},zN.hasContentType=n,zN}function zL(){return qx||(qx=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.EmptyContent=t.EmptyLegacy=t.isEmptyContent=t.EmptyContentType=void 0;let n=oN,r=(0,n.__importStar)(zm),i=zP();t.EmptyContentType="EmptyContent";let o=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.EmptyContentType;t.isEmptyContent=o;let a=r.union([r.null,r.type({value:r.null})]),u=n=>new r.Type("EmptyLegacy",t.isEmptyContent,r=>(0,Dc.pipe)(a.decode(r),Do.either.map(()=>({type:n,__TYPE__:t.EmptyContentType}))),()=>null);t.EmptyLegacy=u,t.EmptyContent=r.strict({type:r.string,__TYPE__:r.literal(t.EmptyContentType)})}(zj)),zj}var zF={},zD={},zW={},zU={},zz={},zB={};let zq=k(mK);Object.defineProperty(zB,"__esModule",{value:!0});let zV=oN,z$=(0,zV.__importStar)(zm);zB.default=new z$.Type("dateFromString",t=>t instanceof Date,(t,n)=>(0,zb.pipe)(z$.string.validate(t,n),(0,zq.chain)(r=>{let i=new Date(r);return isNaN(i.getTime())?z$.failure(t,n):z$.success(i)})),t=>t.toISOString());var zK={};Object.defineProperty(zK,"__esModule",{value:!0});let zH=oN,zZ=(0,zH.__importStar)(zm);zK.default=new zZ.Type("dateFromStringOrNumber",t=>t instanceof Date,(t,n)=>(0,zb.pipe)(zZ.union([zZ.number,zZ.string]).validate(t,n),(0,zq.chain)(r=>{let i=new Date(r);return isNaN(i.getTime())?zZ.failure(t,n):zZ.success(i)})),t=>t);var zG={};Object.defineProperty(zG,"__esModule",{value:!0});let zJ=oN,zY=(0,zJ.__importStar)(zm);zG.default=new zY.Type("dateFromTsMs",t=>t instanceof Date,(t,n)=>(0,zb.pipe)(zY.number.validate(t,n),(0,zq.chain)(r=>{let i=new Date(r);return isNaN(i.getTime())?zY.failure(t,n):zY.success(i)})),t=>t.getTime());var zQ={};Object.defineProperty(zQ,"__esModule",{value:!0});let zX=oN,z0=(0,zX.__importStar)(zm);zQ.default=new z0.Type("IntFromNumber",z0.Int.is,(t,n)=>(0,zb.pipe)(z0.number.validate(t,n),(0,zq.chain)(t=>z0.Int.is(t)?z0.success(t):z0.success(Math.round(t)))),z0.Int.encode);var z1={};Object.defineProperty(z1,"__esModule",{value:!0});let z2=oN,z3=(0,z2.__importStar)(zm),z4=/^([0-9]+)px$/;z1.default=new z3.Type("IntFromPixels",z3.Int.is,(t,n)=>(0,zb.pipe)(z3.string.validate(t,n),(0,zq.chain)(r=>{try{let i=r.match(z4);if(!i)return z3.failure(t,n);let o=parseInt(i[1]);return z3.success(o)}catch{return z3.failure(t,n)}})),String);var z5={};Object.defineProperty(z5,"__esModule",{value:!0});let z6=oN,z9=(0,z6.__importStar)(zm);z5.default=(0,zv.refineType)(z9.string,"nonEmptyString",t=>t.trim().length>0);var z8={},z7={};Object.defineProperty(z7,"__esModule",{value:!0});let Be=oN,Bt=(0,Be.__importStar)(zm);z7.default=(0,zv.nullable)(Bt.string),Object.defineProperty(z8,"__esModule",{value:!0});let Bn=oN,Br=(0,Bn.__importDefault)(z7);z8.default=new zm.Type("nonEmptyStringOrNull",t=>"string"==typeof t||null===t,(t,n)=>(0,zb.pipe)(Br.default.validate(t,n),(0,zq.chain)(t=>"string"==typeof t&&t.length>0?(0,zm.success)(t):(0,zm.success)(null))),t=>t);var Bi={};Object.defineProperty(Bi,"__esModule",{value:!0});let Bo=oN,Ba=(0,Bo.__importStar)(zm);Bi.default=(0,zv.nullable)(Ba.number);var Bu={};Object.defineProperty(Bu,"__esModule",{value:!0});let Bs=oN,Bc=(0,Bs.__importStar)(zm);Bu.default=new Bc.Type("StringFromInt",Bc.string.is,(t,n)=>(0,zb.pipe)(Bc.boolean.validate(t,n),(0,zq.chain)(t=>Bc.success(t.toString()))),t=>t);var Bl={};Object.defineProperty(Bl,"__esModule",{value:!0});let Bf=oN,Bd=(0,Bf.__importStar)(zm);Bl.default=new Bd.Type("StringFromInt",Bd.string.is,(t,n)=>(0,zb.pipe)(Bd.number.validate(t,n),(0,zq.chain)(t=>Bd.success(t.toString()))),t=>t),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.StringOrNull=t.StringFromNumber=t.StringFromBoolean=t.NumberOrNull=t.NonEmptyStringOrNull=t.NonEmptyString=t.IntFromPixels=t.IntFromNumber=t.Function=t.DateFromTsMs=t.DateFromStringOrNumber=t.DateFromString=void 0;let n=oN;Object.defineProperty(t,"DateFromString",{enumerable:!0,get:function(){return(0,n.__importDefault)(zB).default}}),Object.defineProperty(t,"DateFromStringOrNumber",{enumerable:!0,get:function(){return(0,n.__importDefault)(zK).default}}),Object.defineProperty(t,"DateFromTsMs",{enumerable:!0,get:function(){return(0,n.__importDefault)(zG).default}}),t.Function=(0,n.__importStar)(zv),Object.defineProperty(t,"IntFromNumber",{enumerable:!0,get:function(){return(0,n.__importDefault)(zQ).default}}),Object.defineProperty(t,"IntFromPixels",{enumerable:!0,get:function(){return(0,n.__importDefault)(z1).default}}),Object.defineProperty(t,"NonEmptyString",{enumerable:!0,get:function(){return(0,n.__importDefault)(z5).default}}),Object.defineProperty(t,"NonEmptyStringOrNull",{enumerable:!0,get:function(){return(0,n.__importDefault)(z8).default}}),Object.defineProperty(t,"NumberOrNull",{enumerable:!0,get:function(){return(0,n.__importDefault)(Bi).default}}),Object.defineProperty(t,"StringFromBoolean",{enumerable:!0,get:function(){return(0,n.__importDefault)(Bu).default}}),Object.defineProperty(t,"StringFromNumber",{enumerable:!0,get:function(){return(0,n.__importDefault)(Bl).default}}),Object.defineProperty(t,"StringOrNull",{enumerable:!0,get:function(){return(0,n.__importDefault)(z7).default}})}(zz);var Bp={},Bh={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanField=t.BooleanConfig=t.BooleanFieldType=void 0;let n=(0,oN.__importStar)(zm);t.BooleanFieldType="Boolean",t.BooleanConfig=n.exact(n.partial({label:zz.StringOrNull,default_value:n.boolean,placeholder_true:n.string,placeholder_false:n.string})),t.BooleanField=n.exact(n.intersection([n.type({type:n.literal(t.BooleanFieldType)}),n.partial({config:t.BooleanConfig})]))}(Bh);var Bm={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Color=t.ColorConfig=t.ColorFieldType=void 0;let n=(0,oN.__importStar)(zm);t.ColorFieldType="Color",t.ColorConfig=n.exact(n.partial({label:zz.StringOrNull,placeholder:n.string})),t.Color=n.exact(n.intersection([n.type({type:n.literal(t.ColorFieldType)}),n.partial({fieldset:zz.StringOrNull,config:t.ColorConfig})]))}(Bm);var Bg={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Date=t.DateConfig=t.DateFieldType=void 0;let n=(0,oN.__importStar)(zm);t.DateFieldType="Date",t.DateConfig=n.exact(n.partial({label:zz.StringOrNull,placeholder:n.string,default:n.string})),t.Date=n.exact(n.intersection([n.type({type:n.literal(t.DateFieldType)}),n.partial({fieldset:zz.StringOrNull,config:t.DateConfig})]))}(Bg);var By={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Embed=t.EmbedConfig=t.EmbedFieldType=void 0;let n=(0,oN.__importStar)(zm);t.EmbedFieldType="Embed",t.EmbedConfig=n.exact(n.partial({label:zz.StringOrNull,placeholder:n.string,useAsTitle:n.boolean})),t.Embed=n.exact(n.intersection([n.type({type:n.literal(t.EmbedFieldType)}),n.partial({fieldset:zz.StringOrNull,config:t.EmbedConfig})]))}(By);var Bv={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.GeoPoint=t.GeoPointConfig=t.GeoPointFieldType=void 0;let n=(0,oN.__importStar)(zm);t.GeoPointFieldType="GeoPoint",t.GeoPointConfig=n.exact(n.partial({label:zz.StringOrNull})),t.GeoPoint=n.exact(n.intersection([n.type({type:n.literal(t.GeoPointFieldType)}),n.partial({fieldset:zz.StringOrNull,config:t.GeoPointConfig})]))}(Bv);var Bb={},Bx={},B_={},BS={},BT={};Object.defineProperty(BT,"__esModule",{value:!0}),BT.pipe=BT.pipeable=void 0,BT.pipeable=function(t){var n,r,i,o,a,u,s,c,l,f,d,p,h,m,g,y={};if("function"==typeof t.map){var v=function(n){return function(r){return t.map(r,n)}};y.map=v}if("function"==typeof t.contramap){var b=function(n){return function(r){return t.contramap(r,n)}};y.contramap=b}if("function"==typeof t.mapWithIndex){var x=function(n){return function(r){return t.mapWithIndex(r,n)}};y.mapWithIndex=x}if("function"==typeof t.ap){var _=function(n){return function(r){return t.ap(r,n)}},S=function(n){return function(r){return t.ap(t.map(r,function(t){return function(){return t}}),n)}};y.ap=_,y.apFirst=S,y.apSecond=function(n){return function(r){return t.ap(t.map(r,function(){return function(t){return t}}),n)}}}if("function"==typeof t.chain){var T=function(n){return function(r){return t.chain(r,n)}},w=function(n){return function(r){return t.chain(r,function(r){return t.map(n(r),function(){return r})})}},O=function(n){return t.chain(n,Dc.identity)};y.chain=T,y.chainFirst=w,y.flatten=O}if("function"==typeof t.bimap){var k=function(n,r){return function(i){return t.bimap(i,n,r)}},I=function(n){return function(r){return t.mapLeft(r,n)}};y.bimap=k,y.mapLeft=I}if("function"==typeof t.extend){var M=function(n){return function(r){return t.extend(r,n)}},C=function(n){return t.extend(n,Dc.identity)};y.extend=M,y.duplicate=C}if("function"==typeof t.reduce){var R=function(n,r){return function(i){return t.reduce(i,n,r)}},E=function(n){var r=t.foldMap(n);return function(t){return function(n){return r(n,t)}}},A=function(n,r){return function(i){return t.reduceRight(i,n,r)}};y.reduce=R,y.foldMap=E,y.reduceRight=A}if("function"==typeof t.reduceWithIndex){var j=function(n,r){return function(i){return t.reduceWithIndex(i,n,r)}},N=function(n){var r=t.foldMapWithIndex(n);return function(t){return function(n){return r(n,t)}}},P=function(n,r){return function(i){return t.reduceRightWithIndex(i,n,r)}};y.reduceWithIndex=j,y.foldMapWithIndex=N,y.reduceRightWithIndex=P}if("function"==typeof t.alt){var L=function(n){return function(r){return t.alt(r,n)}};y.alt=L}if("function"==typeof t.compact&&(y.compact=t.compact,y.separate=t.separate),"function"==typeof t.filter){var F=function(n){return function(r){return t.filter(r,n)}},D=function(n){return function(r){return t.filterMap(r,n)}},W=function(n){return function(r){return t.partition(r,n)}},U=function(n){return function(r){return t.partitionMap(r,n)}};y.filter=F,y.filterMap=D,y.partition=W,y.partitionMap=U}if("function"==typeof t.filterWithIndex){var z=function(n){return function(r){return t.filterWithIndex(r,n)}},B=function(n){return function(r){return t.filterMapWithIndex(r,n)}},q=function(n){return function(r){return t.partitionWithIndex(r,n)}},V=function(n){return function(r){return t.partitionMapWithIndex(r,n)}};y.filterWithIndex=z,y.filterMapWithIndex=B,y.partitionWithIndex=q,y.partitionMapWithIndex=V}if("function"==typeof t.promap){var $=function(n,r){return function(i){return t.promap(i,n,r)}};y.promap=$}if("function"==typeof t.compose){var K=function(n){return function(r){return t.compose(r,n)}};y.compose=K}if("function"==typeof t.throwError){var H=function(n){return function(r){return"None"===r._tag?t.throwError(n()):t.of(r.value)}},Z=function(n){return"Left"===n._tag?t.throwError(n.left):t.of(n.right)},G=function(n,r){return function(i){return n(i)?t.of(i):t.throwError(r(i))}},J=function(n,r){return function(i){return t.chain(i,function(i){return n(i)?t.of(i):t.throwError(r(i))})}};y.fromOption=H,y.fromEither=Z,y.fromPredicate=G,y.filterOrElse=J}return y},BT.pipe=Dc.pipe;var Bw=O&&O.__createBinding||(Object.create?function(t,n,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return n[r]}})}:function(t,n,r,i){void 0===i&&(i=r),t[i]=n[r]}),BO=O&&O.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),Bk=O&&O.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&Bw(n,t,r);return BO(n,t),n};Object.defineProperty(BS,"__esModule",{value:!0}),BS.NumberFromString=void 0;var BI=Bk(zm);BS.NumberFromString=new BI.Type("NumberFromString",BI.number.is,function(t,n){return BT.pipe(BI.string.validate(t,n),Da.chain(function(r){var i=+r;return isNaN(i)||""===r.trim()?BI.failure(t,n):BI.success(i)}))},String);var BM=O&&O.__createBinding||(Object.create?function(t,n,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return n[r]}})}:function(t,n,r,i){void 0===i&&(i=r),t[i]=n[r]}),BC=O&&O.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),BR=O&&O.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&BM(n,t,r);return BC(n,t),n};Object.defineProperty(B_,"__esModule",{value:!0}),B_.IntFromString=void 0;var BE=BR(zm);B_.IntFromString=new BE.Type("IntFromString",BE.Int.is,function(t,n){return BT.pipe(BS.NumberFromString.validate(t,n),Da.chain(function(r){return BE.Int.is(r)?BE.success(r):BE.failure(t,n)}))},BS.NumberFromString.encode),Object.defineProperty(Bx,"__esModule",{value:!0});let BA=oN,Bj=(0,BA.__importStar)(zm),BN=new Bj.Type("SideConstraints",t=>!t||"number"==typeof t,(t,n)=>Da.either.chain(Bj.union([Bj.literal("auto"),Bj.literal(""),Bj.Int,B_.IntFromString,zz.IntFromNumber,zz.IntFromPixels,Bj.null]).validate(t,n),t=>"auto"===t||""===t?Bj.success(null):Bj.success(t)),t=>t),BP=Bj.partial({width:BN,height:BN});Bx.default=BP,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Image=t.ImageConfig=t.Thumbnail=t.ImageFieldType=void 0;let n=oN,r=(0,n.__importStar)(zm),i=(0,n.__importDefault)(Bx);t.ImageFieldType="Image",t.Thumbnail=r.exact(r.intersection([r.type({name:r.string}),i.default])),t.ImageConfig=r.exact(r.partial({label:zz.StringOrNull,placeholder:r.string,constraint:i.default,thumbnails:r.readonlyArray(t.Thumbnail)})),t.Image=r.exact(r.intersection([r.type({type:r.literal(t.ImageFieldType)}),r.partial({fieldset:zz.StringOrNull,config:t.ImageConfig})]))}(Bb);var BL={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.IntegrationField=t.IntegrationFieldConfig=t.IntegrationFieldType=void 0;let n=(0,oN.__importStar)(zm);t.IntegrationFieldType="IntegrationFields",t.IntegrationFieldConfig=n.exact(n.partial({label:zz.StringOrNull,placeholder:n.string,catalog:n.string})),t.IntegrationField=n.exact(n.intersection([n.type({type:n.literal(t.IntegrationFieldType)}),n.partial({fieldset:zz.StringOrNull,config:t.IntegrationFieldConfig})]))}(BL);var BF={},BD={},BW={},BU={};Object.defineProperty(BU,"__esModule",{value:!0}),BU.clone=void 0,BU.clone=function(t){var n=Object.create(Object.getPrototypeOf(t));return Object.assign(n,t),n};var Bz=O&&O.__createBinding||(Object.create?function(t,n,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return n[r]}})}:function(t,n,r,i){void 0===i&&(i=r),t[i]=n[r]}),BB=O&&O.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),Bq=O&&O.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&Bz(n,t,r);return BB(n,t),n};Object.defineProperty(BW,"__esModule",{value:!0}),BW.withValidate=void 0;var BV=Bq(zm);BW.withValidate=function(t,n,r){void 0===r&&(r=t.name);var i=BU.clone(t);return i.validate=n,i.decode=function(t){return n(t,BV.getDefaultContext(i))},i.name=r,i};var B$=O&&O.__createBinding||(Object.create?function(t,n,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return n[r]}})}:function(t,n,r,i){void 0===i&&(i=r),t[i]=n[r]}),BK=O&&O.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),BH=O&&O.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&B$(n,t,r);return BK(n,t),n};Object.defineProperty(BD,"__esModule",{value:!0}),BD.withFallback=void 0;var BZ=BH(zm);BD.withFallback=function(t,n,r){return void 0===r&&(r="withFallback("+t.name+")"),BW.withValidate(t,function(r,i){return Da.orElse(function(){return BZ.success(n)})(t.validate(r,i))},r)},function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Link=t.LinkConfig=t.LinkFieldType=void 0;let n=oN,r=(0,n.__importStar)(zm),i=t=>{if(t instanceof Array&&t.reduce((t,n)=>t&&"string"==typeof n,!0))return r.success(t)},o=t=>{if("string"==typeof t)return r.success([t])},a=new r.Type("MasksArrayString",t=>t instanceof Array,(t,n)=>Da.either.chain(r.union([r.array(r.string),r.string]).validate(t,n),a=>i(a)||o(a)||r.failure(t,n)),t=>t);t.LinkFieldType="Link",t.LinkConfig=r.exact(r.partial({label:zz.StringOrNull,useAsTitle:r.boolean,placeholder:r.string,select:(0,BD.withFallback)(r.union([r.literal("media"),r.literal("document"),r.literal("web"),r.null]),null),customtypes:r.readonlyArray(r.string),masks:a,tags:a,allowTargetBlank:r.boolean})),t.Link=r.exact(r.intersection([r.type({type:r.literal(t.LinkFieldType)}),r.partial({fieldset:zz.StringOrNull,config:t.LinkConfig})]))}(BF);var BG={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Number=t.NumberConfig=t.NumberFieldType=void 0;let n=(0,oN.__importStar)(zm);t.NumberFieldType="Number",t.NumberConfig=n.exact(n.partial({label:zz.StringOrNull,placeholder:n.string,min:n.union([n.number,BS.NumberFromString]),max:n.union([n.number,BS.NumberFromString]),step:n.union([n.number,BS.NumberFromString])})),t.Number=n.exact(n.intersection([n.type({type:n.literal(t.NumberFieldType)}),n.partial({fieldset:zz.StringOrNull,config:t.NumberConfig})]))}(BG);var BJ={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Range=t.RangeConfig=t.RangeFieldType=void 0;let n=(0,oN.__importStar)(zm);t.RangeFieldType="Range",t.RangeConfig=n.exact(n.partial({label:zz.StringOrNull,placeholder:n.string,min:n.union([n.number,BS.NumberFromString]),max:n.union([n.number,BS.NumberFromString]),step:n.union([n.number,BS.NumberFromString])})),t.Range=n.exact(n.intersection([n.type({type:n.literal(t.RangeFieldType)}),n.partial({fieldset:zz.StringOrNull,config:t.RangeConfig})]))}(BJ);var BY={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RichText=t.RichTextConfig=t.RichTextNodeTypeCodec=t.RichTextNodeType=t.DEFAULT_OPTION=t.RichTextFieldType=void 0;let n=oN,r=(0,n.__importStar)(zm),i=(0,n.__importDefault)(Bx);t.RichTextFieldType="StructuredText",t.DEFAULT_OPTION="paragraph",t.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"},t.RichTextNodeTypeCodec=r.keyof({[t.RichTextNodeType.heading1]:null,[t.RichTextNodeType.heading2]:null,[t.RichTextNodeType.heading3]:null,[t.RichTextNodeType.heading4]:null,[t.RichTextNodeType.heading5]:null,[t.RichTextNodeType.heading6]:null,[t.RichTextNodeType.paragraph]:null,[t.RichTextNodeType.strong]:null,[t.RichTextNodeType.em]:null,[t.RichTextNodeType.preformatted]:null,[t.RichTextNodeType.hyperlink]:null,[t.RichTextNodeType.image]:null,[t.RichTextNodeType.embed]:null,[t.RichTextNodeType.list]:null,[t.RichTextNodeType.orderedList]:null,[t.RichTextNodeType.rtl]:null});let o=new r.Type("RichTextOptions",t=>"string"==typeof t,n=>(0,Dc.pipe)(r.union([r.string,r.null]).decode(n),Do.either.map(n=>{if(!n)return t.DEFAULT_OPTION;let r=n.split(",").map(t=>t.trim()).filter(n=>(0,Da.getOrElseW)(()=>{})(t.RichTextNodeTypeCodec.decode(n)));return r.length?r.join(","):t.DEFAULT_OPTION})),t=>t),a=t=>{if(!t)return r.success([])},u=t=>{if(t instanceof Object){if(!Object.entries(t).length)return r.success([]);if(t[""])return r.success(t[""].map(t=>t.name));let n=Object.entries(t).reduce((t,[,n])=>t.concat(n.map(t=>t.name)),[]).filter(Boolean);return r.success(n)}},s=t=>{if(t instanceof Array&&t.reduce((t,n)=>t&&"string"==typeof n,!0))return r.success(t)},c=t=>{if("string"==typeof t)return r.success([t])},l=new r.Type("RichTextLabels",t=>t instanceof Array,(t,n)=>{let i=r.record(r.string,r.readonlyArray(r.record(r.literal("name"),r.string))),o=r.readonlyArray(r.string);return(0,Dc.pipe)(r.union([i,o,r.string,r.null]).decode(t),Do.either.chain(i=>a(i)||s(i)||u(i)||c(i)||r.failure(t,n)))},t=>t);t.RichTextConfig=r.exact(r.partial({label:zz.StringOrNull,placeholder:r.string,useAsTitle:r.boolean,single:o,multi:o,imageConstraint:i.default,labels:l,allowTargetBlank:r.boolean})),t.RichText=r.exact(r.intersection([r.type({type:r.literal(t.RichTextFieldType)}),r.partial({fieldset:zz.StringOrNull,config:t.RichTextConfig})]))}(BY);var BQ={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Select=t.SelectConfig=t.SelectFieldType=void 0;let n=(0,oN.__importStar)(zm);t.SelectFieldType="Select",t.SelectConfig=n.exact(n.partial({label:zz.StringOrNull,placeholder:n.string,default_value:n.string,options:n.readonlyArray(n.union([n.string,zz.StringFromNumber,zz.StringFromBoolean]))})),t.Select=n.exact(n.intersection([n.type({type:n.literal(t.SelectFieldType)}),n.partial({fieldset:zz.StringOrNull,config:t.SelectConfig})]))}(BQ);var BX={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Separator=t.SeparatorConfig=t.SeparatorFieldType=void 0;let n=(0,oN.__importStar)(zm);t.SeparatorFieldType="Separator",t.SeparatorConfig=n.exact(n.partial({label:zz.StringOrNull})),t.Separator=n.exact(n.intersection([n.type({type:n.literal(t.SeparatorFieldType)}),n.partial({config:t.SeparatorConfig})]))}(BX);var B0={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Text=t.TextConfig=t.TextFieldType=void 0;let n=(0,oN.__importStar)(zm);t.TextFieldType="Text",t.TextConfig=n.exact(n.partial({label:zz.StringOrNull,useAsTitle:n.boolean,placeholder:n.string})),t.Text=n.exact(n.intersection([n.type({type:n.literal(t.TextFieldType)}),n.partial({fieldset:zz.StringOrNull,config:t.TextConfig})]))}(B0);var B1={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Timestamp=t.TimestampConfig=t.TimestampFieldType=void 0;let n=(0,oN.__importStar)(zm);t.TimestampFieldType="Timestamp",t.TimestampConfig=n.exact(n.partial({label:zz.StringOrNull,placeholder:n.string,default:n.string})),t.Timestamp=n.exact(n.intersection([n.type({type:n.literal(t.TimestampFieldType)}),n.partial({fieldset:zz.StringOrNull,config:t.TimestampConfig})]))}(B1),Object.defineProperty(Bp,"__esModule",{value:!0}),Bp.NestableWidget=void 0;let B2=oN,B3=(0,B2.__importStar)(zm);Bp.NestableWidget=B3.union([Bm.Color,Bh.BooleanField,By.Embed,Bv.GeoPoint,Bg.Date,BG.Number,BJ.Range,BY.RichText,BQ.Select,BX.Separator,B0.Text,B1.Timestamp,BF.Link,Bb.Image,BL.IntegrationField]),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Group=t.GroupConfig=t.GroupFieldType=void 0;let n=(0,oN.__importStar)(zm);t.GroupFieldType="Group",t.GroupConfig=n.exact(n.partial({label:zz.StringOrNull,repeat:n.boolean,fields:n.record(zg.WidgetKey,Bp.NestableWidget)})),t.Group=n.exact(n.intersection([n.type({type:n.literal(t.GroupFieldType)}),n.partial({fieldset:zz.StringOrNull,icon:n.string,description:n.string,config:t.GroupConfig})]))}(zU);var B4={};!function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=oN;(0,n.__exportStar)(Bh,t),(0,n.__exportStar)(Bm,t),(0,n.__exportStar)(Bg,t),(0,n.__exportStar)(By,t),(0,n.__exportStar)(Bv,t),(0,n.__exportStar)(Bb,t),(0,n.__exportStar)(BL,t),(0,n.__exportStar)(BF,t),(0,n.__exportStar)(Bp,t),(0,n.__exportStar)(BG,t),(0,n.__exportStar)(BJ,t),(0,n.__exportStar)(BY,t),(0,n.__exportStar)(BQ,t),(0,n.__exportStar)(BX,t),(0,n.__exportStar)(B0,t),(0,n.__exportStar)(B1,t)}(B4);var B5,B6,B9={};B5=B9,B6=O&&O.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},Object.defineProperty(B5,"__esModule",{value:!0}),B5.ImageConstraint=void 0,Object.defineProperty(B5,"ImageConstraint",{enumerable:!0,get:function(){return B6(Bx).default}});var B8={},B7={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CompositeSlice=t.CompositeSliceConfig=t.CompositeSliceType=void 0;let n=(0,oN.__importStar)(zm);t.CompositeSliceType="Slice",t.CompositeSliceConfig=n.exact(n.partial({label:zz.StringOrNull})),t.CompositeSlice=n.exact(n.intersection([n.type({type:n.literal(t.CompositeSliceType)}),n.partial({fieldset:zz.StringOrNull,description:n.string,icon:n.string,display:n.string,"non-repeat":n.record(zg.WidgetKey,Bp.NestableWidget),repeat:n.record(zg.WidgetKey,Bp.NestableWidget),config:t.CompositeSliceConfig})]))}(B7);var qe={};Object.defineProperty(qe,"__esModule",{value:!0}),qe.LegacySlice=void 0;let qt=oN,qn=(0,qt.__importStar)(zm);qe.LegacySlice=qn.union([Bp.NestableWidget,zU.Group]);var qr={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SharedSlice=t.SharedSliceType=t.Variation=void 0;let n=(0,oN.__importStar)(zm);t.Variation=n.exact(n.intersection([n.type({id:n.string,name:n.string,description:n.string,imageUrl:(0,BD.withFallback)(n.string,"https://images.prismic.io/slice-machine/621a5ec4-0387-4bc5-9860-2dd46cbc07cd_default_ss.png?auto=compress,format"),docURL:n.string,version:n.string}),n.partial({display:n.string,primary:n.record(zg.WidgetKey,Bp.NestableWidget),items:n.record(zg.WidgetKey,Bp.NestableWidget)})])),t.SharedSliceType="SharedSlice",t.SharedSlice=n.exact(n.intersection([n.type({id:n.string,type:n.literal(t.SharedSliceType),name:n.string,variations:n.readonlyArray(t.Variation)}),n.partial({description:n.string})]))}(qr);var qi={};Object.defineProperty(qi,"__esModule",{value:!0}),qi.SharedSliceRef=void 0;let qo=oN,qa=(0,qo.__importStar)(zm);qi.SharedSliceRef=qa.exact(qa.type({type:qa.literal(qr.SharedSliceType)}));var qu={};Object.defineProperty(qu,"__esModule",{value:!0});var qs={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Slices=t.DynamicSlices=t.StaticSlices=t.slicesReader=t.DynamicSlicesConfig=t.StaticSlicesConfig=t.slicesConfigReader=t.SlicesLabels=t.SlicesFieldType=t.LegacySlicesFieldType=void 0;let n=(0,oN.__importStar)(zm);function r(r){return n.exact(n.partial({label:zz.StringOrNull,labels:t.SlicesLabels,choices:n.record(zg.WidgetKey,n.union([qe.LegacySlice,B7.CompositeSlice,r]))}))}t.LegacySlicesFieldType="Choice",t.SlicesFieldType="Slices",t.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]),t.slicesConfigReader=r,t.StaticSlicesConfig=r(qr.SharedSlice),t.DynamicSlicesConfig=r(qi.SharedSliceRef);let i={toStatic(t,n){let r=Object.entries(t.choices||{}).reduce((t,[r,i])=>{if("SharedSlice"!==i.type)return{...t,[r]:i};{let o=n.get(r);return o?{...t,[r]:o}:t}},{});return{...t,choices:r}}};function o(r){return n.exact(n.intersection([n.type({type:n.keyof({[t.SlicesFieldType]:null,[t.LegacySlicesFieldType]:null})}),n.partial({fieldset:zz.StringOrNull,config:r})]))}t.slicesReader=o,t.StaticSlices=o(t.StaticSlicesConfig),t.DynamicSlices=o(t.DynamicSlicesConfig),t.Slices={toStatic:(t,n)=>t.config?{...t,config:i.toStatic(t.config,n)}:t}}(qs);var qc={};Object.defineProperty(qc,"__esModule",{value:!0}),qc.SlicesTypes=void 0;let ql=oN,qf=(0,ql.__importStar)(zm);qc.SlicesTypes=qf.keyof({[B7.CompositeSliceType]:null,[qr.SharedSliceType]:null}),function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=oN;(0,n.__exportStar)(B7,t),(0,n.__exportStar)(qe,t),(0,n.__exportStar)(qr,t),(0,n.__exportStar)(qi,t),(0,n.__exportStar)(qu,t),(0,n.__exportStar)(qs,t),(0,n.__exportStar)(qc,t)}(B8);var qd={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.UID=t.UIDConfig=t.UIDFieldType=void 0;let n=(0,oN.__importStar)(zm);t.UIDFieldType="UID",t.UIDConfig=n.exact(n.partial({label:zz.StringOrNull,useAsTitle:n.boolean,placeholder:n.string})),t.UID=n.exact(n.intersection([n.type({type:n.literal(t.UIDFieldType)}),n.partial({fieldset:zz.StringOrNull,config:t.UIDConfig})]))}(qd);var qp={};Object.defineProperty(qp,"__esModule",{value:!0}),qp.Widgets=qp.FieldType=qp.DynamicWidget=qp.StaticWidget=qp.widgetReader=void 0;let qh=oN,qm=(0,qh.__importStar)(zm);function qg(t){return qm.union([qd.UID,Bp.NestableWidget,zU.Group,t])}qp.widgetReader=qg,qp.StaticWidget=qg(qs.StaticSlices),qp.DynamicWidget=qg(qs.DynamicSlices),qp.FieldType=qm.keyof({[B4.ColorFieldType]:null,[B4.BooleanFieldType]:null,[B4.NumberFieldType]:null,[B4.EmbedFieldType]:null,[B4.GeoPointFieldType]:null,[B4.DateFieldType]:null,[B4.RangeFieldType]:null,[B4.RichTextFieldType]:null,[B4.SelectFieldType]:null,[B4.SeparatorFieldType]:null,[B4.TextFieldType]:null,[B4.TimestampFieldType]:null,[B4.LinkFieldType]:null,[B4.ImageFieldType]:null,[B4.IntegrationFieldType]:null,[qd.UIDFieldType]:null,[zU.GroupFieldType]:null,[qs.SlicesFieldType]:null,[qs.LegacySlicesFieldType]:null}),qp.Widgets={toStatic(t,n){switch(t.type){case"Choice":case"Slices":return qs.Slices.toStatic(t,n);default:return t}}},function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=oN;(0,n.__exportStar)(zU,t),(0,n.__exportStar)(B4,t),(0,n.__exportStar)(B9,t),(0,n.__exportStar)(B8,t),(0,n.__exportStar)(qd,t),(0,n.__exportStar)(qp,t)}(zW),Object.defineProperty(zD,"__esModule",{value:!0}),zD.defaultCtx=zD.getFieldCtx=zD.LegacyContentCtx=zD.FieldOrSliceType=void 0;let qy=oN,qv=(0,qy.__importStar)(zm);zD.FieldOrSliceType=qv.union([zW.FieldType,zW.SlicesTypes]);class qb{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;let i=Array.of(this.fieldPath,[this.fieldKey]).flat().join(".");this.prefixedKey=i,this.keyOfType=`${i}_TYPE`,this.fieldType=this.allTypes.get(this.prefixedKey)}}zD.LegacyContentCtx=qb,zD.getFieldCtx=function(t,n,r){return new qb(t,[...n.fieldPath,n.fieldKey,...r||[]],n.allTypes)},zD.defaultCtx=function(t,n=new Map){return new qb(t,[],n)};var qx,q_,qS={},qT={};function qw(){return q_||(q_=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanContent=t.BooleanLegacy=t.isBooleanContent=t.BooleanContentType=void 0;let n=oN,r=(0,n.__importStar)(zm),i=zP();t.BooleanContentType="BooleanContent";let o=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.BooleanContentType;t.isBooleanContent=o;let a=n=>new r.Type("BooleanLegacy",t.isBooleanContent,n=>(0,Dc.pipe)(r.boolean.decode(n),Do.either.map(n=>t.BooleanContent.encode({value:n,__TYPE__:t.BooleanContentType}))),t=>({content:t.value,types:{[n.keyOfType]:"Boolean"}}));t.BooleanLegacy=a,t.BooleanContent=r.strict({__TYPE__:r.literal(t.BooleanContentType),value:r.boolean})}(qT)),qT}var qO,qk={};function qI(){return qO||(qO=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.EmbedContent=t.EmbedLegacy=t.EmbedContentLegacy=t.isEmbedContent=t.EmbedContentType=void 0;let n=oN,r=(0,n.__importStar)(zm),i=zP();t.EmbedContentType="EmbedContent";let o=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.EmbedContentType;t.isEmbedContent=o,t.EmbedContentLegacy=r.exact(r.intersection([r.type({embed_url:r.string,type:r.string}),r.partial({version:r.union([r.string,r.number,r.null]),title:zz.StringOrNull,author_name:zz.StringOrNull,author_url:zz.StringOrNull,provider_name:zz.StringOrNull,provider_url:zz.StringOrNull,cache_age:r.union([r.string,r.number,r.null]),thumbnail_url:zz.StringOrNull,thumbnail_width:zz.NumberOrNull,thumbnail_height:zz.NumberOrNull,html:zz.StringOrNull})]));let a=n=>new r.Type("EmbedLegacy",t.isEmbedContent,n=>(0,Dc.pipe)(t.EmbedContentLegacy.decode(n),Do.either.map(r=>({...r,all:n,__TYPE__:t.EmbedContentType}))),t=>({content:t.all,types:{[n.keyOfType]:"Embed"}}));t.EmbedLegacy=a,t.EmbedContent=r.intersection([t.EmbedContentLegacy,r.strict({__TYPE__:r.literal(t.EmbedContentType),all:r.unknown})])}(qk)),qk}var qM={},qC={},qR={};Object.defineProperty(qR,"__esModule",{value:!0});let qE=oN,qA=(0,qE.__importStar)(zm);qR.default=new qA.Type("TrimmedString",qA.string.is,(t,n)=>(0,zb.pipe)(qA.string.validate(t,n),(0,zq.chain)(t=>qA.success(function(t){let n=0;for(;n<t.length&&t[n]<=" ";)n++;let r=t.length;for(;n<r&&t[r-1]<=" ";)r--;return t.substring(n,r)}(t)))),t=>t);var qj={};function qN(){return qP||(qP=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ColorContent=t.ColorLegacy=t.isColorContent=void 0;let n=oN,r=(0,n.__importStar)(zm),i=(0,n.__importDefault)(qR),o=zP(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===qj.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Color"===t.type;t.isColorContent=a;let u=n=>new r.Type("ColorLegacy",t.isColorContent,n=>(0,Dc.pipe)(i.default.decode(n),Do.either.map(n=>t.ColorContent.encode({value:n,type:zW.ColorFieldType,__TYPE__:qj.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:zW.ColorFieldType}}));t.ColorLegacy=u,t.ColorContent=r.strict({type:r.literal(zW.ColorFieldType),value:i.default,__TYPE__:r.literal(qj.FieldContentType)})}(qC)),qC}Object.defineProperty(qj,"__esModule",{value:!0}),qj.FieldContentType=void 0,qj.FieldContentType="FieldContent";var qP,qL,qF={};function qD(){return qL||(qL=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DateContent=t.DateLegacy=t.isDateContent=void 0;let n=oN,r=(0,n.__importStar)(zm),i=(0,n.__importDefault)(qR),o=zP(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===qj.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Date"===t.type;t.isDateContent=a;let u=n=>new r.Type("DateLegacy",t.isDateContent,n=>(0,Dc.pipe)(i.default.decode(n),Do.either.map(n=>t.DateContent.encode({value:n,type:zW.DateFieldType,__TYPE__:qj.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:zW.DateFieldType}}));t.DateLegacy=u,t.DateContent=r.strict({type:r.literal(zW.DateFieldType),value:i.default,__TYPE__:r.literal(qj.FieldContentType)})}(qF)),qF}var qW,qU={};function qz(){return qW||(qW=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.NumberContent=t.NumberLegacy=t.isNumberContent=void 0;let n=oN,r=(0,n.__importStar)(zm),i=(0,n.__importDefault)(qR),o=zP(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===qj.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Number"===t.type;t.isNumberContent=a;let u=n=>new r.Type("NumberLegacy",t.isNumberContent,n=>(0,Dc.pipe)(i.default.decode(n),Do.either.map(n=>t.NumberContent.encode({value:n,type:zW.NumberFieldType,__TYPE__:qj.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:zW.NumberFieldType}}));t.NumberLegacy=u,t.NumberContent=r.strict({type:r.literal(zW.NumberFieldType),value:i.default,__TYPE__:r.literal(qj.FieldContentType)})}(qU)),qU}var qB,qq={};function qV(){return qB||(qB=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RangeContent=t.RangeLegacy=t.isRangeContent=void 0;let n=oN,r=(0,n.__importStar)(zm),i=(0,n.__importDefault)(qR),o=zP(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===qj.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Range"===t.type;t.isRangeContent=a;let u=n=>new r.Type("RangeLegacy",t.isRangeContent,n=>(0,Dc.pipe)(i.default.decode(n),Do.either.map(n=>t.RangeContent.encode({value:n,type:zW.RangeFieldType,__TYPE__:qj.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:zW.RangeFieldType}}));t.RangeLegacy=u,t.RangeContent=r.strict({type:r.literal(zW.RangeFieldType),value:i.default,__TYPE__:r.literal(qj.FieldContentType)})}(qq)),qq}var q$,qK={};function qH(){return q$||(q$=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SelectContent=t.SelectLegacy=t.isSelectContent=void 0;let n=oN,r=(0,n.__importStar)(zm),i=(0,n.__importDefault)(qR),o=zP(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===qj.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Select"===t.type;t.isSelectContent=a;let u=n=>new r.Type("SelectLegacy",t.isSelectContent,n=>(0,Dc.pipe)(i.default.decode(n),Do.either.map(n=>t.SelectContent.encode({value:n,type:zW.SelectFieldType,__TYPE__:qj.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:zW.SelectFieldType}}));t.SelectLegacy=u,t.SelectContent=r.strict({type:r.literal(zW.SelectFieldType),value:i.default,__TYPE__:r.literal(qj.FieldContentType)})}(qK)),qK}var qZ,qG={};function qJ(){return qZ||(qZ=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TextContent=t.TextLegacy=t.isTextContent=void 0;let n=oN,r=(0,n.__importStar)(zm),i=(0,n.__importDefault)(qR),o=zP(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===qj.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Text"===t.type;t.isTextContent=a;let u=n=>new r.Type("TextLegacy",t.isTextContent,n=>(0,Dc.pipe)(i.default.decode(n),Do.either.map(n=>t.TextContent.encode({value:n,type:zW.TextFieldType,__TYPE__:qj.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:zW.TextFieldType}}));t.TextLegacy=u,t.TextContent=r.strict({type:r.literal(zW.TextFieldType),value:i.default,__TYPE__:r.literal(qj.FieldContentType)})}(qG)),qG}var qY,qQ={};function qX(){return qY||(qY=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TimestampContent=t.TimestampLegacy=t.isTimestampContent=void 0;let n=oN,r=(0,n.__importStar)(zm),i=(0,n.__importDefault)(qR),o=zP(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===qj.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Timestamp"===t.type;t.isTimestampContent=a;let u=n=>new r.Type("TimestampLegacy",t.isTimestampContent,n=>(0,Dc.pipe)(i.default.decode(n),Do.either.map(n=>t.TimestampContent.encode({value:n,type:zW.TimestampFieldType,__TYPE__:qj.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:zW.TimestampFieldType}}));t.TimestampLegacy=u,t.TimestampContent=r.strict({type:r.literal(zW.TimestampFieldType),value:i.default,__TYPE__:r.literal(qj.FieldContentType)})}(qQ)),qQ}function q0(){return q1||(q1=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.FieldContent=t.FieldType=void 0;let n=oN,r=(0,n.__importStar)(zm),i=qN(),o=qD(),a=qz(),u=qV(),s=qH(),c=qJ(),l=qX();t.FieldType=r.keyof({Text:null,Date:null,Timestamp:null,Color:null,Number:null,Range:null,Select:null}),t.FieldContent=r.union([o.DateContent,i.ColorContent,a.NumberContent,u.RangeContent,s.SelectContent,c.TextContent,l.TimestampContent]),(0,n.__exportStar)(qN(),t),(0,n.__exportStar)(qj,t),(0,n.__exportStar)(qD(),t),(0,n.__exportStar)(qz(),t),(0,n.__exportStar)(qV(),t),(0,n.__exportStar)(qH(),t),(0,n.__exportStar)(qJ(),t),(0,n.__exportStar)(qX(),t)}(qM)),qM}var q1,q2,q3={};function q4(){return q2||(q2=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.GeoPointContent=t.GeoPointLegacy=t.isGeoPointContent=t.GeoPointContentType=void 0;let n=oN,r=(0,n.__importStar)(zm),i=zP();t.GeoPointContentType="GeoPointContent";let o=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.GeoPointContentType;t.isGeoPointContent=o;let a=r.strict({position:r.strict({lat:r.number,lng:r.number})}),u=n=>new r.Type("GeoPointLegacy",t.isGeoPointContent,n=>(0,zb.pipe)(a.decode(n),Do.either.map(n=>t.GeoPointContent.encode({...n,__TYPE__:t.GeoPointContentType}))),t=>({content:{position:t.position},types:{[n.keyOfType]:"GeoPoint"}}));t.GeoPointLegacy=u,t.GeoPointContent=r.intersection([a,r.strict({__TYPE__:r.literal(t.GeoPointContentType)})])}(q3)),q3}var q5={},q6={};function q9(){return q8||(q8=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ImageContent=t.ImageLegacy=t.ImageContentView=t.isImageContent=t.ImageContentType=void 0;let n=oN,r=(0,n.__importStar)(zm),i=zP();t.ImageContentType="ImageContent";let o=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.ImageContentType;t.isImageContent=o;let a=r.exact(r.type({id:r.string,url:r.string,width:r.number,height:r.number}));t.ImageContentView=r.exact(r.intersection([r.type({origin:a,width:r.number,height:r.number,edit:r.type({zoom:r.number,crop:r.type({x:r.number,y:r.number}),background:r.string})}),r.partial({url:r.string,credits:zz.NonEmptyStringOrNull,alt:zz.NonEmptyStringOrNull,provider:zz.StringOrNull})]));let u=r.intersection([t.ImageContentView,r.partial({thumbnails:r.record(r.string,t.ImageContentView)})]),s=n=>new r.Type("ImageLegacy",t.isImageContent,n=>(0,Dc.pipe)(u.decode(n),Do.either.map(n=>t.ImageContent.encode({...n,__TYPE__:t.ImageContentType}))),t=>({content:(0,q6.withOptionals)({edit:t.edit,height:t.height,origin:t.origin,width:t.width},[["alt",t.alt],["credits",t.credits],["provider",t.provider],["thumbnails",t.thumbnails],["url",t.url]]),types:{[n.keyOfType]:"Image"}}));t.ImageLegacy=s,t.ImageContent=r.intersection([u,r.strict({__TYPE__:r.literal(t.ImageContentType)})])}(q5)),q5}Object.defineProperty(q6,"__esModule",{value:!0}),q6.withOptionals=q6.isNotEmpty=q6.zipObjects=void 0,q6.zipObjects=function(t,n){return[...new Set(Object.keys(t||{}).concat(Object.keys(n||{})))].reduce((r,i)=>{let o=null==t?void 0:t[i],a=null==n?void 0:n[i];return{...r,[i]:{left:o,right:a}}},{})},q6.isNotEmpty=function(t){return Boolean(Object.keys(t).length)},q6.withOptionals=function(t,n){return{...t,...n.reduce((t,[n,r])=>r?{...t,[n]:r}:t,{})}};var q8,q7,Ve={};function Vt(){return q7||(q7=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.IntegrationFieldContent=t.IntegrationFieldLegacy=t.isIntegrationFieldContent=t.IntegrationFieldContentType=void 0;let n=oN,r=(0,n.__importStar)(zm),i=zP();t.IntegrationFieldContentType="IntegrationFieldsContent";let o=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.IntegrationFieldContentType;t.isIntegrationFieldContent=o;let a=n=>new r.Type("IntegrationFieldLegacy",t.isIntegrationFieldContent,n=>(0,Dc.pipe)(r.string.decode(n),Do.either.map(n=>t.IntegrationFieldContent.encode({value:n,__TYPE__:t.IntegrationFieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:"IntegrationFields"}}));t.IntegrationFieldLegacy=a,t.IntegrationFieldContent=r.strict({__TYPE__:r.literal(t.IntegrationFieldContentType),value:r.string})}(Ve)),Ve}var Vn,Vr,Vi,Vo={},Va=zl(WN,Vr=function(t){return t.length>0},"NonEmptyString");function Vu(t,n){void 0===n&&(n="NonEmptyArray<"+t.name+">");var r=UK(t);return new Wt(n,function(t){return r.is(t)&&oQ(t)},function(t,n){return Z(r.validate(t,n),h4(function(r){var i=o7(r);return pA(i)?We(t,n):eS(i.value)}))},function(t){return r.encode(t)})}function Vs(t,n,r){void 0===r&&(r="Set<"+t.name+">");var i=UK(t),o=E3(n),a=EJ(n);return new Wt(r,function(n){return n instanceof Set&&Rt(t.is)(n)},function(t,n){return Z(i.validate(t,n),h4(function(r){var i=a(r);return i.size!==r.length?We(t,n):eS(i)}))},function(t){return i.encode(o(t))})}function Vc(t,n){return new Wt(t,n,function(t,r){return n(t)?eS(t):We(t,r)},Wn)}var Vl=Vc("Date",function(t){return t instanceof Date}),Vf=globalThis&&globalThis.__spreadArray||function(t,n,r){if(r||2===arguments.length)for(var i,o=0,a=n.length;o<a;o++)!i&&o in n||(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return t.concat(i||Array.prototype.slice.call(n))},Vd=function(t,n){return{get:t,reverseGet:n}},Vp=function(t){return Vy(t.get,q(t.reverseGet,D))},Vh=function(t){return VM(q(t.get,ev),t.reverseGet)},Vm=function(t){return Vj(q(t.get,ev),q(t.reverseGet,D))},Vg=function(t){return VW(function(n){return function(r){return function(i){return n.map(r(t.get(i)),function(n){return t.reverseGet(n)})}}})},Vy=function(t,n){return{get:t,set:n}},Vv=function(t){return Vj(q(t.get,ev),t.set)},Vb=function(t){return VW(function(n){return function(r){return function(i){return n.map(r(t.get(i)),function(n){return t.set(n)(i)})}}})},Vx=function(t){return function(n){return Vy(function(r){return t.get(n.get(r))},function(r){return function(i){return n.set(t.set(r)(n.get(i)))(i)}})}},V_=function(t){return function(n){return VM(q(n.getOption,pn(t.getOption)),q(t.reverseGet,n.reverseGet))}},VS=function(t){return function(n){return VF(VC(t))(Vv(n))}},VT=function(){return Vy(F,D)},Vw=function(t){return function(n){return Vy(function(r){return n.get(r)[t]},function(r){return function(i){var o,a=n.get(i);return r===a[t]?i:n.set(Object.assign({},a,((o={})[t]=r,o)))(i)}})}},VO=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return function(n){return Vy(function(r){for(var i=n.get(r),o={},a=0;a<t.length;a++){var u=t[a];o[u]=i[u]}return o},function(r){return function(i){for(var o=n.get(i),a=0;a<t.length;a++){var u=t[a];if(r[u]!==o[u])return n.set(Object.assign({},o,r))(i)}return i}})}},Vk=function(t){return function(n){return Vy(function(r){return n.get(r)[t]},function(r){return function(i){var o=n.get(i);if(r===o[t])return i;var a=o.slice();return a[t]=r,n.set(a)(i)}})}},VI=function(t){return function(n){var r;return Z(n,Vx(({at:r=function(t){return Vy(function(n){return rV(t,n)},pj(function(){return rU(t)},function(n){return rD(t,n)}))}}).at(t)))}},VM=function(t,n){return{getOption:t,reverseGet:n}},VC=function(t){return Vj(t.getOption,function(n){return VE(n)(t)})},VR=function(t){return VW(function(n){return function(r){return function(i){return Z(t.getOption(i),pj(function(){return n.of(i)},function(o){return n.map(r(o),function(n){return VE(n)(t)(i)})}))}}})},VE=function(t){var n;return n=function(){return t},function(t){var r,i,o=(r=t,function(t){return Z(r.getOption(t),d6(function(i){var o=n(i);return o===i?t:r.reverseGet(o)}))});return function(t){return Z(o(t),pN(function(){return t}))}}},VA=function(t){return VM(dW(t),F)},Vj=function(t,n){return{getOption:t,set:n}},VN=function(t){return VW(function(n){return function(r){return function(i){return Z(t.getOption(i),pj(function(){return n.of(i)},function(o){return n.map(r(o),function(n){return t.set(n)(i)})}))}}})},VP=function(t){return function(n){return function(r){return Z(n.getOption(r),d6(function(i){var o=t(i);return o===i?r:n.set(o)(r)}))}}},VL=function(t){return function(n){var r=VP(t)(n);return function(t){return Z(r(t),pN(function(){return t}))}}},VF=function(t){return function(n){return Vj(q(n.getOption,pn(t.getOption)),function(r){return VL(t.set(r))(n)})}},VD=function(t,n,r){if(r[t]===n)return r;var i=Vf([r[0]],r.slice(1),!0);return i[t]=n,i},VW=function(t){return{modifyF:t}};function VU(t){return function(n){return VW(function(r){return function(i){return n.modifyF(r)(t.modifyF(r)(i))}})}}var Vz={URI:"Identity",map:function(t,n){return n(t)},of:F,ap:function(t,n){return t(n)}},VB=function(t){return{index:t}},Vq=q(Vp,Vx),VV=function(t){return q(Vv,VF(t))},V$=function(t){return q(Vb,VU(t))},VK=function(t){return function(n){return function(r){var i=n.get(r),o=t(i);return i===o?r:n.set(o)(r)}}},VH=function(t){return VS(VM(pq,F))(t)},VZ=function(t){var n;return q(Vv,function(n){return Z(n,VF(VB(function(t){return Vj(function(n){return u$(t,n)},function(n){return function(r){return Z(u$(t,r),pj(function(){return r},function(){return cq(t,n,r)}))}})}).index(t)))})},VG=function(t){var n;return q(Vv,function(n){return Z(n,VF(VB(function(t){return Vj(function(n){return u$(t,n)},function(n){return function(r){return Z(u$(t,r),pj(function(){return r},function(){return VD(t,n,r)}))}})}).index(t)))})},VJ=function(t){var n;return q(Vv,function(n){return Z(n,VF(VB(function(t){return Vj(function(n){return rV(t,n)},function(n){return function(r){return r[t]===n||pA(rV(t,r))?r:rD(t,n)(r)}})}).index(t)))})},VY=VS(VM(F,ev)),VQ=VS(VM(dz,eS)),VX=VS(VM(function(t){return ml(t)?ev(t.left):ey},e_)),V0=function(t,n){return function(r){return V1(r,t,n)}},V1=function(t,n,r){return Vy(q(t.get,n),q(r,t.set))},V2="monocle-ts/Lens",V3={URI:V2,compose:function(t,n){return Vx(t)(n)}},V4={URI:V2,compose:V3.compose,id:VT};let V5=Object.freeze(Object.defineProperty({__proto__:null,Category:V4,Invariant:{URI:V2,imap:V1},Semigroupoid:V3,URI:V2,asOptional:Vv,asTraversal:Vb,atKey:VI,component:Vk,compose:Vx,composeIso:Vq,composeLens:Vx,composeOptional:VV,composePrism:VS,composeTraversal:V$,filter:function(t){return VS(VA(t))},findFirst:function(t){var n;return VV(Vj(u2(t),function(n){return function(r){return Z(u1(t)(r),pj(function(){return r},function(t){return cq(t,n,r)}))}}))},findFirstNonEmpty:function(t){var n;return VV(Vj(u2(t),function(n){return function(r){return Z(u1(t)(r),pj(function(){return r},function(t){return VD(t,n,r)}))}}))},fromNullable:VH,id:VT,imap:V0,index:VZ,indexNonEmpty:VG,key:VJ,left:VX,lens:Vy,modify:VK,modifyF:function(t){return function(n){return function(r){return function(i){return Z(r.get(i),n,function(n){return t.map(n,function(t){return r.set(t)(i)})})}}}},prop:Vw,props:VO,right:VQ,some:VY,traverse:function(t){var n,r;return q(Vb,VU(VW(function(n){var r,i="Identity"===n.URI?t.map:t.traverse(n);return function(t){return function(n){return i(n,t)}}})))}},Symbol.toStringTag,{value:"Module"}));var V6=function(t){return function(n){return n.modifyF(Vz)(t)}},V9=function(t){return new $r(t.get,t.reverseGet)},V8=function(t){return new $i(t.get,t.set)},V7=function(t){return new $o(t.getOption,t.reverseGet)},$e=function(t){return new $u(t.getOption,t.set)},$t=function(t){return new $s(t.modifyF)},$n=function(t,n,r){var i;return r===t[n]?t:Object.assign({},t,((i={})[n]=r,i))},$r=function(){function t(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 t.prototype.reverse=function(){var t;return V9(Vd(this.reverseGet,this.get))},t.prototype.modify=function(t){var n,r;return r=this,function(n){return r.reverseGet(t(r.get(n)))}},t.prototype.asLens=function(){return V8(Vp(this))},t.prototype.asPrism=function(){return V7(Vh(this))},t.prototype.asOptional=function(){return $e(Vm(this))},t.prototype.asTraversal=function(){return $t(Vg(this))},t.prototype.asFold=function(){var t=this;return new $l(function(){return function(n){return function(r){return n(t.get(r))}}})},t.prototype.asGetter=function(){var t=this;return new $c(function(n){return t.get(n)})},t.prototype.asSetter=function(){var t=this;return new $f(function(n){return t.modify(n)})},t.prototype.compose=function(t){var n,r;return V9((r=this,Vd(q(r.get,t.get),q(t.reverseGet,r.reverseGet))))},t.prototype.composeIso=function(t){return this.compose(t)},t.prototype.composeLens=function(t){return V8(Z(this,Vp,Vx(t)))},t.prototype.composePrism=function(t){return V7(Z(this,Vh,V_(t)))},t.prototype.composeOptional=function(t){return $e(Z(this,Vm,VF(t)))},t.prototype.composeTraversal=function(t){return $t(Z(this,Vg,VU(t)))},t.prototype.composeFold=function(t){return this.asFold().compose(t)},t.prototype.composeGetter=function(t){return this.asGetter().compose(t)},t.prototype.composeSetter=function(t){return this.asSetter().compose(t)},t}(),$i=function(){function t(t,n){this.get=t,this.set=n,this._tag="Lens"}return t.fromPath=function(){var n=t.fromProp();return function(t){var r=n(t[0]);return t.slice(1).reduce(function(t,r){return t.compose(n(r))},r)}},t.fromProp=function(){return function(t){return V8(Z(VT(),Vw(t)))}},t.fromProps=function(){return function(t){return V8(Z(VT(),VO.apply(V5,t)))}},t.fromNullableProp=function(){return function(n,r){return new t(function(t){var i=pq(t[n]);return pA(i)?r:i.value},function(t){return function(r){return $n(r,n,t)}})}},t.prototype.modify=function(t){return VK(t)(this)},t.prototype.asOptional=function(){return $e(Vv(this))},t.prototype.asTraversal=function(){return $t(Vb(this))},t.prototype.asSetter=function(){var t=this;return new $f(function(n){return t.modify(n)})},t.prototype.asGetter=function(){var t=this;return new $c(function(n){return t.get(n)})},t.prototype.asFold=function(){var t=this;return new $l(function(){return function(n){return function(r){return n(t.get(r))}}})},t.prototype.compose=function(t){return V8(Vx(t)(this))},t.prototype.composeLens=function(t){return this.compose(t)},t.prototype.composeGetter=function(t){return this.asGetter().compose(t)},t.prototype.composeFold=function(t){return this.asFold().compose(t)},t.prototype.composeOptional=function(t){return $e(Z(this,Vv,VF(t)))},t.prototype.composeTraversal=function(t){return $t(Z(this,Vb,VU(t)))},t.prototype.composeSetter=function(t){return this.asSetter().compose(t)},t.prototype.composeIso=function(t){return V8(Z(this,Vx(Z(t,Vp))))},t.prototype.composePrism=function(t){return $e(VS(t)(this))},t}(),$o=function(){function t(t,n){this.getOption=t,this.reverseGet=n,this._tag="Prism"}return t.fromPredicate=function(t){return V7(VA(t))},t.some=function(){return $a},t.prototype.modify=function(t){var n=this;return function(r){var i=n.modifyOption(t)(r);return pA(i)?r:i.value}},t.prototype.modifyOption=function(t){var n=this;return function(r){return p6.map(n.getOption(r),function(i){var o=t(i);return o===i?r:n.reverseGet(o)})}},t.prototype.set=function(t){return this.modify(function(){return t})},t.prototype.asOptional=function(){return $e(VC(this))},t.prototype.asTraversal=function(){return $t(VR(this))},t.prototype.asSetter=function(){var t=this;return new $f(function(n){return t.modify(n)})},t.prototype.asFold=function(){var t=this;return new $l(function(n){return function(r){return function(i){var o=t.getOption(i);return pA(o)?n.empty:r(o.value)}}})},t.prototype.compose=function(t){return V7(V_(t)(this))},t.prototype.composePrism=function(t){return this.compose(t)},t.prototype.composeOptional=function(t){return $e(Z(this,VC,VF(t)))},t.prototype.composeTraversal=function(t){return $t(Z(this,VR,VU(t)))},t.prototype.composeFold=function(t){return this.asFold().compose(t)},t.prototype.composeSetter=function(t){return this.asSetter().compose(t)},t.prototype.composeIso=function(t){return V7(Z(this,V_(Z(t,Vh))))},t.prototype.composeLens=function(t){var n;return $e((n=t,function(t){return VF(Vv(n))(VC(t))})(this))},t.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},t}(),$a=new $o(F,ev),$u=function(){function t(t,n){this.getOption=t,this.set=n,this._tag="Optional"}return t.fromPath=function(){var n=t.fromNullableProp();return function(t){var r=n(t[0]);return t.slice(1).reduce(function(t,r){return t.compose(n(r))},r)}},t.fromNullableProp=function(){return function(n){return new t(function(t){return pq(t[n])},function(t){return function(r){return null==r[n]?r:$n(r,n,t)}})}},t.fromOptionProp=function(){var t=$i.fromProp();return function(n){return t(n).composePrism($a)}},t.prototype.modify=function(t){return VL(t)(this)},t.prototype.modifyOption=function(t){return VP(t)(this)},t.prototype.asTraversal=function(){return $t(VN(this))},t.prototype.asFold=function(){var t=this;return new $l(function(n){return function(r){return function(i){var o=t.getOption(i);return pA(o)?n.empty:r(o.value)}}})},t.prototype.asSetter=function(){var t=this;return new $f(function(n){return t.modify(n)})},t.prototype.compose=function(t){return $e(VF(t)(this))},t.prototype.composeOptional=function(t){return this.compose(t)},t.prototype.composeTraversal=function(t){return $t(Z(this,VN,VU(t)))},t.prototype.composeFold=function(t){return this.asFold().compose(t)},t.prototype.composeSetter=function(t){return this.asSetter().compose(t)},t.prototype.composeLens=function(t){return $e(Z(this,VF(Z(t,Vv))))},t.prototype.composePrism=function(t){return $e(Z(this,VF(Z(t,VC))))},t.prototype.composeIso=function(t){return $e(Z(this,VF(Z(t,Vm))))},t.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},t}(),$s=function(){function t(t){this.modifyF=t,this._tag="Traversal"}return t.prototype.modify=function(t){return V6(t)(this)},t.prototype.set=function(t){var n;return V6(function(){return t})(this)},t.prototype.filter=function(t){var n;return $t(VU(VR(VA(t)))(this))},t.prototype.asFold=function(){var t=this;return new $l(function(n){return function(r){return t.modifyF(hf(n))(function(t){return F(r(t))})}})},t.prototype.asSetter=function(){var t=this;return new $f(function(n){return t.modify(n)})},t.prototype.compose=function(t){return $t(VU(t)(this))},t.prototype.composeTraversal=function(t){return this.compose(t)},t.prototype.composeFold=function(t){return this.asFold().compose(t)},t.prototype.composeSetter=function(t){return this.asSetter().compose(t)},t.prototype.composeOptional=function(t){return this.compose(t.asTraversal())},t.prototype.composeLens=function(t){return $t(Z(this,VU(Z(t,Vb))))},t.prototype.composePrism=function(t){return $t(Z(this,VU(Z(t,VR))))},t.prototype.composeIso=function(t){return $t(Z(this,VU(Z(t,Vg))))},t.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},t}(),$c=function(){function t(t){this.get=t,this._tag="Getter"}return t.prototype.asFold=function(){var t=this;return new $l(function(){return function(n){return function(r){return n(t.get(r))}}})},t.prototype.compose=function(n){var r=this;return new t(function(t){return n.get(r.get(t))})},t.prototype.composeGetter=function(t){return this.compose(t)},t.prototype.composeFold=function(t){return this.asFold().compose(t)},t.prototype.composeLens=function(t){return this.compose(t.asGetter())},t.prototype.composeIso=function(t){return this.compose(t.asGetter())},t.prototype.composeTraversal=function(t){return this.asFold().compose(t.asFold())},t.prototype.composeOptional=function(t){return this.asFold().compose(t.asFold())},t.prototype.composePrism=function(t){return this.asFold().compose(t.asFold())},t}(),$l=function(){function t(t){this.foldMap=t,this._tag="Fold",this.getAll=t(fC())(am),this.exist=t(TU),this.all=t(TW),this.foldMapFirst=t(p7())}return t.prototype.compose=function(n){var r=this;return new t(function(t){return function(i){return r.foldMap(t)(n.foldMap(t)(i))}})},t.prototype.composeFold=function(t){return this.compose(t)},t.prototype.composeGetter=function(t){return this.compose(t.asFold())},t.prototype.composeTraversal=function(t){return this.compose(t.asFold())},t.prototype.composeOptional=function(t){return this.compose(t.asFold())},t.prototype.composeLens=function(t){return this.compose(t.asFold())},t.prototype.composePrism=function(t){return this.compose(t.asFold())},t.prototype.composeIso=function(t){return this.compose(t.asFold())},t.prototype.find=function(t){return this.foldMapFirst(dW(t))},t.prototype.headOption=function(t){return this.find(function(){return!0})(t)},t}(),$f=function(){function t(t){this.modify=t,this._tag="Setter"}return t.prototype.set=function(t){return this.modify(D(t))},t.prototype.compose=function(n){var r=this;return new t(function(t){return r.modify(n.modify(t))})},t.prototype.composeSetter=function(t){return this.compose(t)},t.prototype.composeTraversal=function(t){return this.compose(t.asSetter())},t.prototype.composeOptional=function(t){return this.compose(t.asSetter())},t.prototype.composeLens=function(t){return this.compose(t.asSetter())},t.prototype.composePrism=function(t){return this.compose(t.asSetter())},t.prototype.composeIso=function(t){return this.compose(t.asSetter())},t}(),$d=new $r(F,F),$p=U5({_tag:WK("None")}),$h=WK("Some");function $m(t,n){return void 0===n&&(n="Option<"+t.name+">"),UX([$p,U5({_tag:$h,value:t},"Some<"+t.name+">")],n)}var $g=new Wt("DateFromISOString",function(t){return t instanceof Date},function(t,n){return Z(WN.validate(t,n),h4(function(r){var i=new Date(r);return isNaN(i.getTime())?We(t,n):eS(i)}))},function(t){return t.toISOString()});function $y(t){var n=Object.create(Object.getPrototypeOf(t));return Object.assign(n,t),n}var $v=new Wt("DateFromNumber",function(t){return t instanceof Date},function(t,n){return Z(WL.validate(t,n),h4(function(r){var i=new Date(r);return isNaN(i.getTime())?We(t,n):eS(i)}))},function(t){return t.getTime()});function $b(t,n,r){void 0===r&&(r=t.name);var i=$y(t);return i.validate=n,i.decode=function(t){return n(t,zr(i))},i.name=r,i}var $x,$_,$S,$T=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,$w=zl(WN,$_=function(t){return $T.test(t)},"UUID"),$O=new Wt("BooleanFromString",WU.is,function(t,n){return Z(WN.validate(t,n),h4(function(r){return"true"===r?eS(!0):"false"===r?eS(!1):We(t,n)}))},String);function $k(t){switch(t._tag){case"InterfaceType":return t.props;case"ExactType":return $k(t.type)}}var $I=$i.fromProp(),$M=Vc("RegExp",function(t){return"[object RegExp]"===Object.prototype.toString.call(t)}),$C=new Wt("DateFromUnixTime",function(t){return t instanceof Date},function(t,n){return Z(UB.validate(t,n),h4(function(r){var i=new Date(1e3*r);return isNaN(i.getTime())?We(t,n):eS(i)}))},function(t){return Math.floor(t.getTime()/1e3)}),$R=new Wt("NumberFromString",WL.is,function(t,n){return Z(WN.validate(t,n),h4(function(r){var i=+r;return isNaN(i)||""===r.trim()?We(t,n):eS(i)}))},String),$E=new Wt("IntFromString",UB.is,function(t,n){return Z($R.validate(t,n),h4(function(r){return UB.is(r)?eS(r):We(t,n)}))},$R.encode),$A=UV("JsonArray",function(){return U4($N)}),$j=UV("JsonRecord",function(){return UY(WN,$N)}),$N=UX([WU,WL,WN,Wk,$A,$j],"Json"),$P=new Wt("JsonFromString",$N.is,function(t,n){try{return eS(JSON.parse(t))}catch{return We(t,n)}},function(t){return JSON.stringify(t)}),$L=WK("Left"),$F=WK("Right"),$D=new Wt("BigIntFromString",function(t){return"bigint"==typeof t},function(t,n){return Z(WN.validate(t,n),h4(function(r){if(!Va.is(r.trim()))return We(t,n);try{return eS(BigInt(r))}catch{return We(t,n)}}))},String),$W=new Wt("BooleanFromNumber",WU.is,function(t,n){return Z(WL.validate(t,n),hJ(function(t){return 0!==t}))},Number);let $U=Object.freeze(Object.defineProperty({__proto__:null,BigIntFromString:$D,BooleanFromNumber:$W,BooleanFromString:$O,DateFromISOString:$g,DateFromNumber:$v,DateFromUnixTime:$C,IntFromString:$E,Json:$N,JsonArray:$A,JsonFromString:$P,JsonRecord:$j,NonEmptyString:Va,NumberFromString:$R,UUID:$w,clone:$y,date:Vl,either:function(t,n,r){return void 0===r&&(r="Either<"+t.name+", "+n.name+">"),UX([U5({_tag:$L,left:t},"Left<"+t.name+">"),U5({_tag:$F,right:n},"Right<"+t.name+">")],r)},fromNewtype:function(t,n){return void 0===n&&(n="fromNewtype("+t.name+")"),new Wt(n,function(n){return t.is(n)},function(n,r){return Z(t.validate(n,r),hJ($d.wrap))},function(n){return t.encode($d.unwrap(n))})},fromNullable:function(t,n,r){return void 0===r&&(r="fromNullable("+t.name+")"),$b(t,function(r,i){return null==r?eS(n):t.validate(r,i)},r)},fromRefinement:Vc,getLenses:function(t){var n={};for(var r in $k(t))n[r]=$I(r);return n},mapOutput:zx,nonEmptyArray:Vu,option:$m,optionFromNullable:function(t,n){return void 0===n&&(n="Option<"+t.name+">"),new Wt(n,$m(t).is,function(n,r){return null==n?eS(ey):Z(t.validate(n,r),hJ(ev))},function(n){return pZ(Z(n,d6(t.encode)))})},readonlyNonEmptyArray:function(t,n){return void 0===n&&(n="ReadonlyNonEmptyArray<"+t.name+">"),Vu(t,n)},readonlySetFromArray:function(t,n,r){return void 0===r&&(r="ReadonlySet<"+t.name+">"),Vs(t,n,r)},regexp:$M,setFromArray:Vs,withEncode:function(t,n,r){return void 0===r&&(r=t.name),new Wt(r,t.is,t.validate,n)},withFallback:function(t,n,r){return void 0===r&&(r="withFallback("+t.name+")"),$b(t,function(r,i){return mw(function(){return eS(n)})(t.validate(r,i))},r)},withMessage:function(t,n){return $b(t,function(r,i){return mr(function(){return[{value:r,context:i,message:n(r,i),actual:r}]})(t.validate(r,i))})},withValidate:$b},Symbol.toStringTag,{value:"Module"})),$z=k($U);function $B(){return $q||($q=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.LinkContent=t.Link=t.LinkContentLegacy=t.LinkLegacy=t.isLinkContent=t.LinkContentType=t.ExternalLinkContent=t.ExternalLinkType=t.DocumentLinkContent=t.DocumentLinkType=t.FileLinkContent=t.FileLinkType=t.ImageLinkContent=t.ImageLinkType=void 0;let n=oN,r=(0,n.__importStar)(zm),i=zP();t.ImageLinkType="ImageLink";let o=r.exact(r.intersection([r.type({id:r.string,url:r.string,height:r.string,width:r.string,size:r.string,name:r.string,kind:r.string}),r.partial({date:zz.StringOrNull})])),a=new r.Type("ImageLink",n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.ImageLinkType,n=>(0,Dc.pipe)(o.decode(n),Do.either.map(n=>t.ImageLinkContent.encode({...n,__TYPE__:t.ImageLinkType}))),t=>o.encode(t));t.ImageLinkContent=r.intersection([r.strict({__TYPE__:r.literal(t.ImageLinkType)}),o]),t.FileLinkType="FileLink";let u=r.exact(r.intersection([r.type({id:r.string,url:r.string,name:r.string,kind:r.string,size:(0,$z.withFallback)(r.string,"0")}),r.partial({date:(0,zv.nullable)(r.string)})])),s=new r.Type("FileLink",n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.FileLinkType,n=>(0,Dc.pipe)(u.decode(n),Do.either.map(n=>t.FileLinkContent.encode({...n,__TYPE__:t.FileLinkType}))),t=>u.encode(t));t.FileLinkContent=r.intersection([u,r.exact(r.intersection([r.type({__TYPE__:r.literal(t.FileLinkType)}),r.partial({size:(0,$z.withFallback)(r.string,"0")})]))]),t.DocumentLinkType="DocumentLink";let c=r.strict({id:zz.NonEmptyString}),l=new r.Type("DocumentLink",n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.DocumentLinkType,n=>(0,Dc.pipe)(c.decode(n),Do.either.map(n=>t.DocumentLinkContent.encode({...n,__TYPE__:t.DocumentLinkType}))),t=>c.encode(t));t.DocumentLinkContent=r.intersection([r.strict({__TYPE__:r.literal(t.DocumentLinkType)}),c]),t.ExternalLinkType="ExternalLink";let f=r.exact(r.intersection([r.type({url:r.string}),r.partial({kind:r.literal("web"),target:zz.StringOrNull,preview:(0,zv.nullable)(r.partial({title:r.string}))})])),d=new r.Type("ExternalLink",n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.ExternalLinkType,n=>(0,Dc.pipe)(f.decode(n),Do.either.map(n=>t.ExternalLinkContent.encode({...n,__TYPE__:t.ExternalLinkType}))),t=>f.encode(t));t.ExternalLinkContent=r.intersection([r.strict({__TYPE__:r.literal(t.ExternalLinkType)}),f]),t.LinkContentType="LinkContent";let p=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.LinkContentType;t.isLinkContent=p,t.LinkLegacy=r.union([a,s,l,d]);let h=n=>new r.Type("LinkLegacy",t.isLinkContent,n=>(0,Dc.pipe)(t.LinkLegacy.decode(n),Do.either.map(n=>t.LinkContent.encode({value:n,__TYPE__:t.LinkContentType}))),r=>({content:t.LinkLegacy.encode(r.value),types:{[n.keyOfType]:"Link"}}));t.LinkContentLegacy=h,t.Link=r.union([t.ImageLinkContent,t.FileLinkContent,t.DocumentLinkContent,t.ExternalLinkContent]),t.LinkContent=r.strict({__TYPE__:r.literal(t.LinkContentType),value:t.Link})}(Vo)),Vo}var $q,$V,$$={},$K={},$H={};function $Z(){return $V||($V=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Block=t.BlockLegacy=t.TextBlock=t.checkEmbedBlock=t.EmbedBlock=t.checkImageBlock=t.ImageBlock=t.ValidatedMetas=t.Span=t.Meta=void 0;let n=oN,r=(0,n.__importStar)(zm),i=qI(),o=q9(),a=$B();t.Meta=r.exact(r.intersection([r.partial({data:r.unknown}),r.type({start:r.number,end:r.number,type:r.union([B4.RichTextNodeTypeCodec,r.literal("label")])})])),t.Span=t.Meta;let u=n=>new r.Type("ValidatedMetas",n=>Array.isArray(n)&&n.every(t.Meta.is),(i,o)=>{if(!Array.isArray(i))return r.failure(i,o);{let a=i.reduce((r,i)=>{let o=t.Meta.decode(i);if((0,Da.isRight)(o)){let a=o.right;if(a.data&&"hyperlink"===a.type){let u=n.decode(a.data);return(0,Da.isLeft)(u)?r:[...r,{...a,data:u.right}]}if("hyperlink"!==a.type)return[...r,a]}return r},[]).sort((t,n)=>t.start-n.start);return r.success(a)}},r=>r.reduce((r,i)=>{if("hyperlink"===i.type&&i.data){let o=n.decode(i.data);return(0,Da.isLeft)(o)?r:[...r,{...i,data:n.encode(o.right)}]}return[...r,t.Meta.encode(i)]},[]));t.ValidatedMetas=u;let s=t=>r.exact(r.intersection([r.type({type:r.literal(B4.RichTextNodeType.image),data:r.intersection([o.ImageContentView,r.partial({linkTo:(0,zv.nullable)(t)})])}),r.partial({label:zz.StringOrNull,direction:zz.StringOrNull})]));t.ImageBlock=s(a.Link);let c=s(a.LinkLegacy);t.checkImageBlock=function(t){return t.type===B4.RichTextNodeType.image};let l=r.exact(r.intersection([r.type({type:r.literal(B4.RichTextNodeType.embed),data:r.unknown}),r.partial({label:zz.StringOrNull,direction:zz.StringOrNull})])),f=new r.Type("EmbedBlockLegacy",t=>"embed"===t.type,n=>(0,Dc.pipe)(l.decode(n),Do.either.chain(t=>Do.either.map(n=>[t,n])(i.EmbedContentLegacy.decode(t.data))),Do.either.map(([n,r])=>t.EmbedBlock.encode({...n,data:{...r,__TYPE__:i.EmbedContentType,all:n.data}}))),t=>({...l.encode(t),data:i.EmbedContentLegacy.encode(t.data)}));t.EmbedBlock=r.exact(r.intersection([r.type({type:r.literal(B4.RichTextNodeType.embed),data:i.EmbedContent}),r.partial({label:zz.StringOrNull,direction:zz.StringOrNull})])),t.checkEmbedBlock=function(t){return t.type===B4.RichTextNodeType.embed};let d=n=>r.exact(r.intersection([r.type({type:(0,zv.refineType)(B4.RichTextNodeTypeCodec,`string which isn't ${B4.RichTextNodeType.image} ${B4.RichTextNodeType.embed}`,t=>t!==B4.RichTextNodeType.image&&t!==B4.RichTextNodeType.embed),content:r.intersection([r.type({text:r.string}),r.partial({spans:(0,t.ValidatedMetas)(n)})])}),r.partial({label:r.string,direction:r.string})]));t.TextBlock=d(a.Link);let p=d(a.LinkLegacy),h=r.union([f,c,p]);t.BlockLegacy=new r.Type("BlockLegacy",t=>f.is(t)||c.is(t)||p.is(t),t=>h.decode(t),n=>t.ImageBlock.is(n)?c.encode(n):t.EmbedBlock.is(n)?f.encode(n):p.encode(n)),t.Block=r.union([t.ImageBlock,t.EmbedBlock,t.TextBlock])}($H)),$H}function $G(){return $J||($J=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RichTextLegacy=t.RichTextContent=t.isRichTextContent=t.RichTextContentType=void 0;let n=oN,r=(0,n.__importStar)(zm),i=zP(),o=$Z();t.RichTextContentType="StructuredTextContent";let a=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.RichTextContentType;t.isRichTextContent=a;let u=r.array(o.BlockLegacy);t.RichTextContent=r.strict({__TYPE__:r.literal(t.RichTextContentType),value:r.array(o.Block)}),(0,n.__exportStar)($Z(),t);let s=n=>new r.Type("RichTextLegacy",t.isRichTextContent,n=>(0,Dc.pipe)(u.decode(n),Do.either.map(n=>({value:n,__TYPE__:t.RichTextContentType}))),t=>({content:u.encode(t.value),types:{[n.keyOfType]:"StructuredText"}}));t.RichTextLegacy=s}($K)),$K}var $J,$Y,$Q={};function $X(){return $Y||($Y=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SeparatorContent=t.SeparatorLegacy=t.isSeparatorContent=t.SeparatorContentType=void 0;let n=(0,oN.__importStar)(zm),r=zP();t.SeparatorContentType="SeparatorContent";let i=n=>(0,r.hasContentType)(n)&&n.__TYPE__===t.SeparatorContentType;t.isSeparatorContent=i;let o=r=>new n.Type("SeparatorLegacy",t.isSeparatorContent,()=>n.success(t.SeparatorContent.encode({__TYPE__:t.SeparatorContentType})),()=>({content:{},types:{[r.keyOfType]:"Separator"}}));t.SeparatorLegacy=o,t.SeparatorContent=n.strict({__TYPE__:n.literal(t.SeparatorContentType)})}($Q)),$Q}function $0(){return $3||($3=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=oN;(0,n.__exportStar)(qw(),t),(0,n.__exportStar)(qI(),t),(0,n.__exportStar)(q0(),t),(0,n.__exportStar)(q4(),t),(0,n.__exportStar)(q9(),t),(0,n.__exportStar)(Vt(),t),(0,n.__exportStar)($B(),t),(0,n.__exportStar)(function(){if($2)return $$;$2=1,Object.defineProperty($$,"__esModule",{value:!0}),$$.NestableLegacy=$$.isNestableContent=$$.NestableContent=void 0;let t=oN,n=(0,t.__importStar)(zm),r=zL(),i=qw(),o=qI(),a=q0(),u=q4(),s=q9(),c=Vt(),l=$B(),f=$G(),d=$X();$$.NestableContent=n.union([r.EmptyContent,i.BooleanContent,o.EmbedContent,a.TextContent,a.TimestampContent,a.SelectContent,a.RangeContent,a.NumberContent,a.DateContent,a.ColorContent,u.GeoPointContent,s.ImageContent,c.IntegrationFieldContent,l.LinkContent,f.RichTextContent,d.SeparatorContent]);let p=t=>(0,a.isTextContent)(t)||(0,a.isColorContent)(t)||(0,a.isDateContent)(t)||(0,a.isTimestampContent)(t)||(0,a.isNumberContent)(t)||(0,a.isRangeContent)(t)||(0,a.isSelectContent)(t)||(0,u.isGeoPointContent)(t)||(0,f.isRichTextContent)(t)||(0,i.isBooleanContent)(t)||(0,o.isEmbedContent)(t)||(0,s.isImageContent)(t)||(0,c.isIntegrationFieldContent)(t)||(0,l.isLinkContent)(t)||(0,d.isSeparatorContent)(t)||(0,r.isEmptyContent)(t);$$.isNestableContent=p;let h=t=>({decode(n){if(!t.fieldType)return;let p=(0,r.EmptyLegacy)(t.fieldType).decode(n);if((0,Da.isRight)(p))return p;let h=(()=>{switch(t.fieldType){case"Text":return(0,a.TextLegacy)(t);case"Color":return(0,a.ColorLegacy)(t);case"Date":return(0,a.DateLegacy)(t);case"Timestamp":return(0,a.TimestampLegacy)(t);case"Number":return(0,a.NumberLegacy)(t);case"Range":return(0,a.RangeLegacy)(t);case"Select":return(0,a.SelectLegacy)(t);case"GeoPoint":return(0,u.GeoPointLegacy)(t);case"StructuredText":return(0,f.RichTextLegacy)(t);case"Boolean":return(0,i.BooleanLegacy)(t);case"Embed":return(0,o.EmbedLegacy)(t);case"Image":return(0,s.ImageLegacy)(t);case"IntegrationFields":return(0,c.IntegrationFieldLegacy)(t);case"Link":return(0,l.LinkContentLegacy)(t);case"Separator":return(0,d.SeparatorLegacy)(t);default:return}})();if(h)return h.decode(n)},encode(n){switch(n.__TYPE__){case qj.FieldContentType:return"Text"===n.type?(0,a.TextLegacy)(t).encode(n):"Color"===n.type?(0,a.ColorLegacy)(t).encode(n):"Range"===n.type?(0,a.RangeLegacy)(t).encode(n):"Date"===n.type?(0,a.DateLegacy)(t).encode(n):"Number"===n.type?(0,a.NumberLegacy)(t).encode(n):"Timestamp"===n.type?(0,a.TimestampLegacy)(t).encode(n):"Select"===n.type?(0,a.SelectLegacy)(t).encode(n):void 0;case u.GeoPointContentType:return(0,u.GeoPointLegacy)(t).encode(n);case f.RichTextContentType:return(0,f.RichTextLegacy)(t).encode(n);case o.EmbedContentType:return(0,o.EmbedLegacy)(t).encode(n);case i.BooleanContentType:return(0,i.BooleanLegacy)(t).encode(n);case s.ImageContentType:return(0,s.ImageLegacy)(t).encode(n);case c.IntegrationFieldContentType:return(0,c.IntegrationFieldLegacy)(t).encode(n);case l.LinkContentType:return(0,l.LinkContentLegacy)(t).encode(n);case d.SeparatorContentType:return(0,d.SeparatorLegacy)(t).encode(n);default:return}}});return $$.NestableLegacy=h,$$}(),t),(0,n.__exportStar)($G(),t),(0,n.__exportStar)($X(),t)}(qS)),qS}function $1(){return $4||($4=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.GroupContent=t.isGroupContent=t.GroupContentType=t.GroupLegacy=t.GroupItemLegacy=t.GroupItemContent=t.GroupItemContentType=void 0;let n=oN,r=(0,n.__importStar)(zm),i=zP(),o=$0();t.GroupItemContentType="GroupItemContent",t.GroupItemContent=r.strict({__TYPE__:r.literal(t.GroupItemContentType),value:r.array(r.tuple([r.string,o.NestableContent]))});let a=r.record(r.string,r.unknown),u=n=>new r.Type("GroupItemLegacy",n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.GroupItemContentType,r=>(0,Dc.pipe)(a.decode(r),Do.either.map(r=>({value:Object.entries(r).reduce((t,[r,i])=>{let a=(0,zD.getFieldCtx)(r,n),u=(0,o.NestableLegacy)(a).decode(i);return!u||(0,Da.isLeft)(u)?t:[...t,[r,u.right]]},[]),__TYPE__:t.GroupItemContentType}))),t=>t.value.reduce((t,[r,i])=>{let a=(0,zD.getFieldCtx)(r,n),u=(0,o.NestableLegacy)(a).encode(i);return u?{content:{...t.content,[r]:u.content},types:{...t.types,...u.types}}:t},{content:{},types:{}}));t.GroupItemLegacy=u;let s=n=>{let i=r.array(r.union([r.null,(0,t.GroupItemLegacy)(n)])),o=r.array((0,t.GroupItemLegacy)(n));return new r.Type("GroupLegacy",t.isGroupContent,n=>(0,Dc.pipe)(i.decode(n),Do.either.map(n=>({value:n.map(n=>null===n?{__TYPE__:t.GroupItemContentType,value:[]}:n),__TYPE__:t.GroupContentType}))),t=>{let r=o.encode(t.value);return{content:r.map(t=>t.content),types:r.reduce((t,n)=>({...t,...n.types}),{[n.keyOfType]:"Group"})}})};t.GroupLegacy=s,t.GroupContentType="GroupContentType";let c=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.GroupContentType;t.isGroupContent=c,t.GroupContent=r.strict({__TYPE__:r.literal(t.GroupContentType),value:r.array(t.GroupItemContent)})}(zF)),zF}var $2,$3,$4,$5,$6={},$9={},$8={},$7={};function Ke(){if($5)return $7;$5=1,Object.defineProperty($7,"__esModule",{value:!0}),$7.RepeatableWidgets=$7.RepeatableWidgetsLegacy=void 0;let t=(0,oN.__importStar)(zm),n=$1(),r=$0(),i=r=>t.array((0,n.GroupItemLegacy)(r));$7.RepeatableWidgetsLegacy=i;let o=t.tuple([t.string,r.NestableContent]),a=t.strict({__TYPE__:t.literal(n.GroupItemContentType),value:t.array(o)});return t.array(o),$7.RepeatableWidgets=t.array(a),$7}function Kt(){return Kn||(Kn=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CompositeSliceContent=t.CompositeSliceLegacy=t.isCompositeSliceContent=t.CompositeSliceContentType=void 0;let n=oN,r=(0,n.__importStar)(zm),i=zP(),o=$0(),a=Ke();t.CompositeSliceContentType="CompositeSliceContent";let u=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.CompositeSliceContentType;t.isCompositeSliceContent=u;let s=r.exact(r.partial({repeat:r.array(r.unknown),"non-repeat":r.UnknownRecord})),c=n=>new r.Type("CompositeSliceLegacy",t.isCompositeSliceContent,r=>(0,Dc.pipe)(s.decode(r),Do.either.map(r=>{let i=(()=>{let t=(0,zD.getFieldCtx)("repeat",n),i=(0,a.RepeatableWidgetsLegacy)(t).decode(r.repeat);if(!(!i||(0,Da.isLeft)(i)))return i.right})()||[];return{nonRepeat:Object.entries(r["non-repeat"]||{}).reduce((t,[r,i])=>{let a=(0,zD.getFieldCtx)(r,n,["non-repeat"]);if(!a)return t;let u=(0,o.NestableLegacy)(a).decode(i);return!u||(0,Da.isLeft)(u)?t:{...t,[r]:u.right}},{}),repeat:i,__TYPE__:t.CompositeSliceContentType}})),t=>{let r=Object.entries(t.nonRepeat).reduce((t,[r,i])=>{let a=(0,zD.getFieldCtx)(r,n,["non-repeat"]),u=(0,o.NestableLegacy)(a).encode(i);return u?{content:{...t.content,[r]:u.content},types:{...t.types,...u.types}}:t},{content:{},types:{}}),i=(()=>{let r=(0,zD.getFieldCtx)("repeat",n);return(0,a.RepeatableWidgetsLegacy)(r).encode(t.repeat)})()||[];return{content:{"non-repeat":r.content,repeat:i.map(t=>t.content)},types:{[n.keyOfType]:"Slice",...r.types,...i.reduce((t,n)=>({...t,...n.types}),{})}}});t.CompositeSliceLegacy=c,t.CompositeSliceContent=r.strict({__TYPE__:r.literal(t.CompositeSliceContentType),nonRepeat:r.record(r.string,o.NestableContent),repeat:a.RepeatableWidgets})}($8)),$8}var Kn,Kr,Ki={};function Ko(){return Kr||(Kr=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SharedSliceContent=t.SharedSliceLegacy=t.isSharedSliceContent=t.SharedSliceContentType=void 0;let n=oN,r=(0,n.__importStar)(zm),i=zP(),o=$0(),a=Ke();t.SharedSliceContentType="SharedSliceContent";let u=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.SharedSliceContentType;t.isSharedSliceContent=u;let s=r.exact(r.type({variation:r.string,items:(0,$z.withFallback)(r.array(r.unknown),[]),primary:(0,$z.withFallback)(r.UnknownRecord,{})})),c=n=>new r.Type("SharedSliceLegacy",t.isSharedSliceContent,r=>(0,Dc.pipe)(s.decode(r),Do.either.map(r=>{let i=(()=>{let t=(0,zD.getFieldCtx)("items",n,["variations",r.variation]),i=(0,a.RepeatableWidgetsLegacy)(t).decode(r.items);if(!(!i||(0,Da.isLeft)(i)))return i.right})()||[],u=Object.entries(r.primary).reduce((t,[i,a])=>{let u=(0,zD.getFieldCtx)(i,n,["variations",r.variation,"primary"]),s=(0,o.NestableLegacy)(u).decode(a);return!s||(0,Da.isLeft)(s)?t:{...t,[i]:s.right}},{});return{variation:r.variation,primary:u,items:i,__TYPE__:t.SharedSliceContentType}})),t=>{let r=Object.entries(t.primary).reduce((r,[i,a])=>{let u=(0,zD.getFieldCtx)(i,n,["variations",t.variation,"primary"]),s=(0,o.NestableLegacy)(u).encode(a);return s?{content:{...r.content,[i]:s.content},types:{...r.types,...s.types}}:r},{content:{},types:{}}),i=(()=>{let r=(0,zD.getFieldCtx)("items",n,["variations",t.variation]);return(0,a.RepeatableWidgetsLegacy)(r).encode(t.items)})()||[];return{content:{primary:r.content,items:i.map(t=>t.content),variation:t.variation},types:{[n.keyOfType]:"SharedSlice",...r.types,...i.reduce((t,n)=>({...t,...n.types}),{})}}});t.SharedSliceLegacy=c,t.SharedSliceContent=r.strict({__TYPE__:r.literal(t.SharedSliceContentType),variation:r.string,primary:r.record(r.string,o.NestableContent),items:a.RepeatableWidgets})}(Ki)),Ki}var Ka,Ku={};function Ks(){if(Ka)return Ku;Ka=1,Object.defineProperty(Ku,"__esModule",{value:!0}),Ku.SimpleSliceLegacy=Ku.isSimpleSliceContent=Ku.SimpleSliceContent=void 0;let t=(0,oN.__importStar)(zm),n=$1(),r=$0();Ku.SimpleSliceContent=t.union([r.NestableContent,n.GroupContent]);let i=t=>(0,r.isNestableContent)(t)||(0,n.isGroupContent)(t);Ku.isSimpleSliceContent=i;let o=t=>({decode:"Group"===t.fieldType?(0,n.GroupLegacy)(t).decode.bind(null):(0,r.NestableLegacy)(t).decode.bind(null),encode:i=>"GroupContentType"===i.__TYPE__?(0,n.GroupLegacy)(t).encode(i):(0,r.NestableLegacy)(t).encode(i)});return Ku.SimpleSliceLegacy=o,Ku}function Kc(){return Kl||(Kl=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SliceContent=t.SliceLegacy=void 0;let n=oN,r=(0,n.__importStar)(zm),i=Kt(),o=Ko(),a=Ks(),u=t=>({decode:n=>(()=>{switch(t.fieldType){case"Slice":return(0,i.CompositeSliceLegacy)(t);case"SharedSlice":return(0,o.SharedSliceLegacy)(t);default:return(0,a.SimpleSliceLegacy)(t)}})().decode(n),encode(n){switch(n.__TYPE__){case"SharedSliceContent":return(0,o.SharedSliceLegacy)(t).encode(n);case"CompositeSliceContent":return(0,i.CompositeSliceLegacy)(t).encode(n);default:return(0,a.SimpleSliceLegacy)(t).encode(n)}}});t.SliceLegacy=u,t.SliceContent=r.union([i.CompositeSliceContent,o.SharedSliceContent,a.SimpleSliceContent]),(0,n.__exportStar)(Kt(),t),(0,n.__exportStar)(Ko(),t),(0,n.__exportStar)(Ks(),t)}($9)),$9}var Kl,Kf,Kd={};function Kp(){if(Kf)return Kd;Kf=1,Object.defineProperty(Kd,"__esModule",{value:!0}),Kd.SlicesItemLegacy=Kd.SliceItemContent=void 0;let t=oN,n=(0,t.__importStar)(zm),r=Kc(),i=Kt(),o=Ko(),a=Ks();Kd.SliceItemContent=n.type({key:n.string,name:n.string,maybeLabel:n.union([n.string,n.undefined]),widget:r.SliceContent});let u=n.exact(n.intersection([n.type({key:n.string,value:n.unknown}),n.partial({label:(0,zv.nullable)(n.string)})])),s=t=>new n.Type("SlicesItemLegacy",t=>((0,o.isSharedSliceContent)(t.widget),(0,i.isCompositeSliceContent)(t.widget),(0,a.isSimpleSliceContent)(t.widget)),(i,o)=>(0,Dc.pipe)(u.decode(i),Do.either.chain(a=>{var u;let s=a.key.indexOf("$"),c=a.key.substring(0,s>0?s:void 0),l=(0,zD.getFieldCtx)(c,t),f=(0,r.SliceLegacy)(l).decode(a.value);return!f||(0,Da.isLeft)(f)?n.failure(i,o):n.success({key:a.key,name:c,maybeLabel:null!==(u=a.label)&&void 0!==u?u:void 0,widget:f.right})})),n=>{let i=(0,zD.getFieldCtx)(n.name,t),o=(0,r.SliceLegacy)(i).encode(n.widget);return{content:{key:n.key,label:n.maybeLabel,value:(null==o?void 0:o.content)||{}},types:(null==o?void 0:o.types)||{}}});return Kd.SlicesItemLegacy=s,Kd}var Kh,Km={};function Kg(){return Ky||(Ky=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=oN;(0,n.__exportStar)(Kc(),t),(0,n.__exportStar)(Kp(),t),(0,n.__exportStar)((Kh||(Kh=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SlicesContent=t.SlicesLegacy=t.isSlicesContent=t.SlicesContentType=void 0;let n=oN,r=(0,n.__importStar)(zm),i=zP(),o=Kp();t.SlicesContentType="SliceContentType";let a=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.SlicesContentType;t.isSlicesContent=a;let u=n=>{let i=r.array((0,o.SlicesItemLegacy)(n));return new r.Type("SlicesLegacy",t.isSlicesContent,n=>(0,Dc.pipe)(i.decode(n),Do.either.map(n=>({__TYPE__:t.SlicesContentType,value:n}))),t=>{let r=i.encode(t.value);return{content:r.map(t=>t.content),types:r.reduce((t,n)=>({...t,...n.types}),{[n.keyOfType]:"Slices"})}})};t.SlicesLegacy=u,t.SlicesContent=r.type({__TYPE__:r.literal(t.SlicesContentType),value:r.array(o.SliceItemContent)})}(Km)),Km),t)}($6)),$6}var Ky,Kv,Kb={};function Kx(){return Kv||(Kv=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.UIDContent=t.UIDLegacy=t.isUIDContent=t.UIDContentType=void 0;let n=oN,r=(0,n.__importStar)(zm),i=zP();t.UIDContentType="UIDContent";let o=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.UIDContentType;t.isUIDContent=o;let a=n=>new r.Type("UIDLegacy",t.isUIDContent,n=>(0,Dc.pipe)(r.string.decode(n),Do.either.map(n=>t.UIDContent.encode({value:n,__TYPE__:t.UIDContentType}))),t=>({content:t.value,types:{[n.keyOfType]:"UID"}}));t.UIDLegacy=a,t.UIDContent=r.type({__TYPE__:r.literal(t.UIDContentType),value:r.string})}(Kb)),Kb}var K_,KS={};function KT(){return i||(i=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=oN;(0,n.__exportStar)(zL(),t),(0,n.__exportStar)($1(),t),(0,n.__exportStar)($0(),t),(0,n.__exportStar)(Kg(),t),(0,n.__exportStar)(Kx(),t),(0,n.__exportStar)(function(){if(K_)return KS;K_=1,Object.defineProperty(KS,"__esModule",{value:!0}),KS.WidgetLegacy=KS.isWidgetContent=KS.WidgetContent=void 0;let t=(0,oN.__importStar)(zm),n=$1(),r=$0(),i=Kg(),o=Kx();KS.WidgetContent=t.union([n.GroupContent,r.NestableContent,o.UIDContent,i.SlicesContent]);let a=t=>(0,n.isGroupContent)(t)||(0,r.isNestableContent)(t)||(0,o.isUIDContent)(t)||(0,i.isSlicesContent)(t);KS.isWidgetContent=a;let u=t=>({decode(a){if(!t.fieldType)return;let u=(()=>{switch(t.fieldType){case"UID":return(0,o.UIDLegacy)(t);case"Group":return(0,n.GroupLegacy)(t);case"Choice":case"Slices":return(0,i.SlicesLegacy)(t);default:return(0,r.NestableLegacy)(t)}})();if(u)return u.decode(a)},encode(a){switch(a.__TYPE__){case o.UIDContentType:return(0,o.UIDLegacy)(t).encode(a);case n.GroupContentType:return(0,n.GroupLegacy)(t).encode(a);case i.SlicesContentType:return(0,i.SlicesLegacy)(t).encode(a);default:return(0,r.NestableLegacy)(t).encode(a)}}});return KS.WidgetLegacy=u,KS}(),t)}(zA)),zA}Object.defineProperty(oP,"__esModule",{value:!0}),oP.DocumentLegacy=oP.Document=void 0;let Kw=oN,KO=(0,Kw.__importStar)(zm),Kk=KT();oP.Document=KO.record(zg.WidgetKey,Kk.WidgetContent);let KI=KO.record(zg.WidgetKey,KO.unknown),KM=t=>new KO.Type("Document",t=>!!t&&"object"==typeof t,n=>(0,Dc.pipe)(KI.decode(n),Do.either.map(n=>Object.entries(n).reduce((n,[r,i])=>{let o=(0,zD.defaultCtx)(r,t),a=(0,Kk.WidgetLegacy)(o).decode(i);return!a||(0,Da.isLeft)(a)?n:{...n,[r]:a.right}},{}))),n=>Object.entries(n).reduce((n,[r,i])=>{let o=(0,zD.defaultCtx)(r,t),a=(0,Kk.WidgetLegacy)(o).encode(i);return a?{content:{...n.content,[r]:a.content},types:{...n.types,...a.types}}:n},{content:{},types:{}}));function KC(t){let n=Object.entries(t),{types:r,widgets:i}=n.reduce((t,[n,r])=>{if(n.endsWith("_TYPE")){let i=zD.FieldOrSliceType.decode(r);if((0,Da.isRight)(i))return{...t,types:t.types.set(n.substring(0,n.length-5),i.right)}}return n.endsWith("_POSITION")||n.endsWith("_TYPE")?t:{...t,widgets:{...t.widgets,[n]:r}}},{types:new Map,widgets:{}}),o=t.slugs_INTERNAL||[],a=t.uid;return{widgets:i,types:r,uid:a,slugs:o}}function KR(t){var n;return(null==(n=t.config)?void 0:n.label)??("Boolean"===t.type||"Separator"===t.type?void 0:t.fieldset)??t.type}function KE(t,n){var r,i,o;return"Boolean"===t.type?(n?null==(r=t.config)?void 0:r.placeholder_true:null==(i=t.config)?void 0:i.placeholder_false)??"...":(null==(o=t.config)?void 0:o.placeholder)??"..."}function KA(t){var n;let{content:r,field:i,id:o,onContentChange:a,readOnly:u}=t,s=(null==r?void 0:r.value)??(null==(n=i.config)?void 0:n.default_value)??!1;return M.jsxs(l.gN,{children:[M.jsx(l.fw,{name:"toggleOff"}),M.jsx(l.Qy,{htmlFor:o,children:KR(i)}),M.jsxs(l.JO,{children:[M.jsx(l.xu,{padding:4,alignItems:"center",children:M.jsx(l.xv,{children:KE(i,s)})}),M.jsx(l.rs,{checked:s,id:o,onCheckedChange(t){var n;u||a((n=t,{__TYPE__:"BooleanContent",value:n}))}})]})]})}function Kj(t){let{id:n,field:r,content:i,onContentChange:o}=t;return M.jsxs(l.gN,{children:[M.jsx(l.fw,{name:"colorLens"}),M.jsx(l.Qy,{id:n,children:KR(r)}),M.jsx(l.JO,{children:M.jsx(l.xu,{padding:{left:4},alignItems:"center",children:M.jsx(l.TC,{onValueChange(t){var n;return o((n=t,void 0===n?void 0:{__TYPE__:"FieldContent",type:"Color",value:n}))},value:null==i?void 0:i.value,"aria-labelledby":n,placeholder:KE(r)})})})]})}function KN(t){let{id:n,readOnly:r,field:i,content:o,onContentChange:a}=t;return M.jsxs(l.gN,{children:[M.jsx(l.fw,{name:"dateRange"}),M.jsx(l.Qy,{id:n,children:KR(i)}),M.jsx(l.JO,{children:M.jsx(l.xu,{padding:{left:4,right:12},width:"100%",flexDirection:"column",justifyContent:"center",children:M.jsx(l.Wr,{mode:"date","aria-labelledby":n,readOnly:r,value:null==o?void 0:o.value,onValueChange(t){var n;return a((n=t,void 0===n?void 0:{__TYPE__:"FieldContent",type:"Date",value:n}))}})})})]})}oP.DocumentLegacy={_codec:KM,extractMetadata:KC,parse:function(t){let n=(0,Dc.pipe)(KO.record(zg.WidgetKey,KO.unknown).decode(t),Do.either.chain(t=>{let{types:n,widgets:r}=KC(t);return KM(n).decode(r)}));return(0,Da.isLeft)(n)?void 0:n.right},encode:function(t){let n=KM().encode(t);return{...n.content,...n.types}}},function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=oN;(0,n.__exportStar)(oP,t),(0,n.__exportStar)(KT(),t),(0,n.__exportStar)(zD,t)}(oj),(erU=o||(o={})).assertEqual=t=>t,erU.assertIs=function(t){},erU.assertNever=function(t){throw Error()},erU.arrayToEnum=t=>{let n={};for(let r of t)n[r]=r;return n},erU.getValidEnumValues=t=>{let n=erU.objectKeys(t).filter(n=>"number"!=typeof t[t[n]]),r={};for(let i of n)r[i]=t[i];return erU.objectValues(r)},erU.objectValues=t=>erU.objectKeys(t).map(function(n){return t[n]}),erU.objectKeys="function"==typeof Object.keys?t=>Object.keys(t):t=>{let n=[];for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&n.push(r);return n},erU.find=(t,n)=>{for(let r of t)if(n(r))return r},erU.isInteger="function"==typeof Number.isInteger?t=>Number.isInteger(t):t=>"number"==typeof t&&isFinite(t)&&Math.floor(t)===t,erU.joinValues=function(t,n=" | "){return t.map(t=>"string"==typeof t?`'${t}'`:t).join(n)},erU.jsonStringifyReplacer=(t,n)=>"bigint"==typeof n?n.toString():n,(erz=a||(a={})).mergeShapes=(t,n)=>({...t,...n});let KP=o.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),KL=t=>{switch(typeof t){case"undefined":return KP.undefined;case"string":return KP.string;case"number":return isNaN(t)?KP.nan:KP.number;case"boolean":return KP.boolean;case"function":return KP.function;case"bigint":return KP.bigint;case"symbol":return KP.symbol;case"object":return Array.isArray(t)?KP.array:null===t?KP.null:t.then&&"function"==typeof t.then&&t.catch&&"function"==typeof t.catch?KP.promise:"u">typeof Map&&t instanceof Map?KP.map:"u">typeof Set&&t instanceof Set?KP.set:"u">typeof Date&&t instanceof Date?KP.date:KP.object;default:return KP.unknown}},KF=o.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"]),KD=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class KW extends Error{constructor(t){super(),this.issues=[],this.addIssue=t=>{this.issues=[...this.issues,t]},this.addIssues=(t=[])=>{this.issues=[...this.issues,...t]};let 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){let n=t||function(t){return t.message},r={_errors:[]},i=t=>{for(let o of t.issues)if("invalid_union"===o.code)o.unionErrors.map(i);else if("invalid_return_type"===o.code)i(o.returnTypeError);else if("invalid_arguments"===o.code)i(o.argumentsError);else if(0===o.path.length)r._errors.push(n(o));else{let a=r,u=0;for(;u<o.path.length;){let s=o.path[u];u===o.path.length-1?(a[s]=a[s]||{_errors:[]},a[s]._errors.push(n(o))):a[s]=a[s]||{_errors:[]},a=a[s],u++}}};return i(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,o.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(t=t=>t.message){let n={},r=[];for(let 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()}}KW.create=t=>new KW(t);let KU=(t,n)=>{let r;switch(t.code){case KF.invalid_type:r=t.received===KP.undefined?"Required":`Expected ${t.expected}, received ${t.received}`;break;case KF.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,o.jsonStringifyReplacer)}`;break;case KF.unrecognized_keys:r=`Unrecognized key(s) in object: ${o.joinValues(t.keys,", ")}`;break;case KF.invalid_union:r="Invalid input";break;case KF.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${o.joinValues(t.options)}`;break;case KF.invalid_enum_value:r=`Invalid enum value. Expected ${o.joinValues(t.options)}, received '${t.received}'`;break;case KF.invalid_arguments:r="Invalid function arguments";break;case KF.invalid_return_type:r="Invalid function return type";break;case KF.invalid_date:r="Invalid date";break;case KF.invalid_string:"object"==typeof t.validation?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,"number"==typeof t.validation.position&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:o.assertNever(t.validation):r="regex"!==t.validation?`Invalid ${t.validation}`:"Invalid";break;case KF.too_small:r="array"===t.type?`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:"string"===t.type?`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:"number"===t.type?`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:"date"===t.type?`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:"Invalid input";break;case KF.too_big:r="array"===t.type?`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:"string"===t.type?`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:"number"===t.type?`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:"bigint"===t.type?`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:"date"===t.type?`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:"Invalid input";break;case KF.custom:r="Invalid input";break;case KF.invalid_intersection_types:r="Intersection results could not be merged";break;case KF.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case KF.not_finite:r="Number must be finite";break;default:r=n.defaultError,o.assertNever(t)}return{message:r}},Kz=KU;function KB(t){Kz=t}function Kq(){return Kz}let KV=t=>{let{data:n,path:r,errorMaps:i,issueData:o}=t,a=[...r,...o.path||[]],u={...o,path:a},s="",c=i.filter(t=>!!t).slice().reverse();for(let l of c)s=l(u,{data:n,defaultError:s}).message;return{...o,path:a,message:o.message||s}};function K$(t,n){let r=KV({issueData:n,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Kz,KU].filter(t=>!!t)});t.common.issues.push(r)}class KK{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(t,n){let r=[];for(let i of n){if("aborted"===i.status)return KH;"dirty"===i.status&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){let r=[];for(let i of n)r.push({key:await i.key,value:await i.value});return KK.mergeObjectSync(t,r)}static mergeObjectSync(t,n){let r={};for(let i of n){let{key:o,value:a}=i;if("aborted"===o.status||"aborted"===a.status)return KH;"dirty"===o.status&&t.dirty(),"dirty"===a.status&&t.dirty(),("u">typeof a.value||i.alwaysSet)&&(r[o.value]=a.value)}return{status:t.value,value:r}}}let KH=Object.freeze({status:"aborted"}),KZ=t=>({status:"dirty",value:t}),KG=t=>({status:"valid",value:t}),KJ=t=>"aborted"===t.status,KY=t=>"dirty"===t.status,KQ=t=>"valid"===t.status,KX=t=>"u">typeof Promise&&t instanceof Promise;(erB=u||(u={})).errToObj=t=>"string"==typeof t?{message:t}:t||{},erB.toString=t=>"string"==typeof t?t:null==t?void 0:t.message;class K0{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}}let K1=(t,n)=>{if(KQ(n))return{success:!0,data:n.value};if(!t.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new KW(t.common.issues);return this._error=r,this._error}}};function K2(t){if(!t)return{};let{errorMap:n,invalid_type_error:r,required_error:i,description:o}=t;if(n&&(r||i))throw Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return n?{errorMap:n,description:o}:{errorMap:(t,n)=>"invalid_type"!==t.code?{message:n.defaultError}:typeof n.data>"u"?{message:i??n.defaultError}:{message:r??n.defaultError},description:o}}class K3{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 KL(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:KL(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new KK,ctx:{common:t.parent.common,data:t.data,parsedType:KL(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(KX(n))throw Error("Synchronous parse encountered promise.");return n}_parseAsync(t){let n=this._parse(t);return Promise.resolve(n)}parse(t,n){let r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;let i={common:{issues:[],async:null!==(r=null==n?void 0:n.async)&&void 0!==r&&r,contextualErrorMap:null==n?void 0:n.errorMap},path:(null==n?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:KL(t)},o=this._parseSync({data:t,path:i.path,parent:i});return K1(i,o)}async parseAsync(t,n){let r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){let r={common:{issues:[],contextualErrorMap:null==n?void 0:n.errorMap,async:!0},path:(null==n?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:KL(t)},i=this._parse({data:t,path:r.path,parent:r}),o=await (KX(i)?i:Promise.resolve(i));return K1(r,o)}refine(t,n){let r=t=>"string"==typeof n||typeof n>"u"?{message:n}:"function"==typeof n?n(t):n;return this._refinement((n,i)=>{let o=t(n),a=()=>i.addIssue({code:KF.custom,...r(n)});return"u">typeof Promise&&o instanceof Promise?o.then(t=>!!t||(a(),!1)):!!o||(a(),!1)})}refinement(t,n){return this._refinement((r,i)=>!!t(r)||(i.addIssue("function"==typeof n?n(r,i):n),!1))}_refinement(t){return new HN({schema:this,typeName:s.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return HP.create(this,this._def)}nullable(){return HL.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Hy.create(this,this._def)}promise(){return Hj.create(this,this._def)}or(t){return Hb.create([this,t],this._def)}and(t){return HS.create(this,t,this._def)}transform(t){return new HN({...K2(this._def),schema:this,typeName:s.ZodEffects,effect:{type:"transform",transform:t}})}default(t){return new HF({...K2(this._def),innerType:this,defaultValue:"function"==typeof t?t:()=>t,typeName:s.ZodDefault})}brand(){return new Hz({typeName:s.ZodBranded,type:this,...K2(this._def)})}catch(t){return new HD({...K2(this._def),innerType:this,catchValue:"function"==typeof t?t:()=>t,typeName:s.ZodCatch})}describe(t){let n=this.constructor;return new n({...this._def,description:t})}pipe(t){return HB.create(this,t)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}let K4=/^c[^\s-]{8,}$/i,K5=/^[a-z][a-z0-9]*$/,K6=/[0-9A-HJKMNP-TV-Z]{26}/,K9=/^([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,K8=/^(([^<>()[\]\\.,;:\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,})+))$/,K7=/^(\p{Extended_Pictographic}|\p{Emoji_Component})+$/u,He=/^(((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}))$/,Ht=/^(([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})))$/,Hn=t=>t.precision?t.offset?RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):0===t.precision?t.offset?RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function Hr(t,n){return!!(("v4"===n||!n)&&He.test(t)||("v6"===n||!n)&&Ht.test(t))}class Hi extends K3{constructor(){super(...arguments),this._regex=(t,n,r)=>this.refinement(n=>t.test(n),{validation:n,code:KF.invalid_string,...u.errToObj(r)}),this.nonempty=t=>this.min(1,u.errToObj(t)),this.trim=()=>new Hi({...this._def,checks:[...this._def.checks,{kind:"trim"}]}),this.toLowerCase=()=>new Hi({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]}),this.toUpperCase=()=>new Hi({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==KP.string){let n=this._getOrReturnCtx(t);return K$(n,{code:KF.invalid_type,expected:KP.string,received:n.parsedType}),KH}let r=new KK,i;for(let a of this._def.checks)if("min"===a.kind)t.data.length<a.value&&(K$(i=this._getOrReturnCtx(t,i),{code:KF.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if("max"===a.kind)t.data.length>a.value&&(K$(i=this._getOrReturnCtx(t,i),{code:KF.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if("length"===a.kind){let u=t.data.length>a.value,s=t.data.length<a.value;(u||s)&&(i=this._getOrReturnCtx(t,i),u?K$(i,{code:KF.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):s&&K$(i,{code:KF.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),r.dirty())}else if("email"===a.kind)K8.test(t.data)||(K$(i=this._getOrReturnCtx(t,i),{validation:"email",code:KF.invalid_string,message:a.message}),r.dirty());else if("emoji"===a.kind)K7.test(t.data)||(K$(i=this._getOrReturnCtx(t,i),{validation:"emoji",code:KF.invalid_string,message:a.message}),r.dirty());else if("uuid"===a.kind)K9.test(t.data)||(K$(i=this._getOrReturnCtx(t,i),{validation:"uuid",code:KF.invalid_string,message:a.message}),r.dirty());else if("cuid"===a.kind)K4.test(t.data)||(K$(i=this._getOrReturnCtx(t,i),{validation:"cuid",code:KF.invalid_string,message:a.message}),r.dirty());else if("cuid2"===a.kind)K5.test(t.data)||(K$(i=this._getOrReturnCtx(t,i),{validation:"cuid2",code:KF.invalid_string,message:a.message}),r.dirty());else if("ulid"===a.kind)K6.test(t.data)||(K$(i=this._getOrReturnCtx(t,i),{validation:"ulid",code:KF.invalid_string,message:a.message}),r.dirty());else if("url"===a.kind)try{new URL(t.data)}catch{K$(i=this._getOrReturnCtx(t,i),{validation:"url",code:KF.invalid_string,message:a.message}),r.dirty()}else"regex"===a.kind?(a.regex.lastIndex=0,a.regex.test(t.data)||(K$(i=this._getOrReturnCtx(t,i),{validation:"regex",code:KF.invalid_string,message:a.message}),r.dirty())):"trim"===a.kind?t.data=t.data.trim():"includes"===a.kind?t.data.includes(a.value,a.position)||(K$(i=this._getOrReturnCtx(t,i),{code:KF.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),r.dirty()):"toLowerCase"===a.kind?t.data=t.data.toLowerCase():"toUpperCase"===a.kind?t.data=t.data.toUpperCase():"startsWith"===a.kind?t.data.startsWith(a.value)||(K$(i=this._getOrReturnCtx(t,i),{code:KF.invalid_string,validation:{startsWith:a.value},message:a.message}),r.dirty()):"endsWith"===a.kind?t.data.endsWith(a.value)||(K$(i=this._getOrReturnCtx(t,i),{code:KF.invalid_string,validation:{endsWith:a.value},message:a.message}),r.dirty()):"datetime"===a.kind?Hn(a).test(t.data)||(K$(i=this._getOrReturnCtx(t,i),{code:KF.invalid_string,validation:"datetime",message:a.message}),r.dirty()):"ip"===a.kind?Hr(t.data,a.version)||(K$(i=this._getOrReturnCtx(t,i),{validation:"ip",code:KF.invalid_string,message:a.message}),r.dirty()):o.assertNever(a);return{status:r.value,value:t.data}}_addCheck(t){return new Hi({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...u.errToObj(t)})}url(t){return this._addCheck({kind:"url",...u.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...u.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...u.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...u.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...u.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...u.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...u.errToObj(t)})}datetime(t){var n;return"string"==typeof t?this._addCheck({kind:"datetime",precision:null,offset:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(null==t?void 0:t.precision)>"u"?null:null==t?void 0:t.precision,offset:null!==(n=null==t?void 0:t.offset)&&void 0!==n&&n,...u.errToObj(null==t?void 0:t.message)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...u.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:null==n?void 0:n.position,...u.errToObj(null==n?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...u.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...u.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...u.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...u.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...u.errToObj(n)})}get isDatetime(){return!!this._def.checks.find(t=>"datetime"===t.kind)}get isEmail(){return!!this._def.checks.find(t=>"email"===t.kind)}get isURL(){return!!this._def.checks.find(t=>"url"===t.kind)}get isEmoji(){return!!this._def.checks.find(t=>"emoji"===t.kind)}get isUUID(){return!!this._def.checks.find(t=>"uuid"===t.kind)}get isCUID(){return!!this._def.checks.find(t=>"cuid"===t.kind)}get isCUID2(){return!!this._def.checks.find(t=>"cuid2"===t.kind)}get isULID(){return!!this._def.checks.find(t=>"ulid"===t.kind)}get isIP(){return!!this._def.checks.find(t=>"ip"===t.kind)}get minLength(){let t=null;for(let n of this._def.checks)"min"===n.kind&&(null===t||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(let n of this._def.checks)"max"===n.kind&&(null===t||n.value<t)&&(t=n.value);return t}}function Ho(t,n){let r=(t.toString().split(".")[1]||"").length,i=(n.toString().split(".")[1]||"").length,o=r>i?r:i,a=parseInt(t.toFixed(o).replace(".","")),u=parseInt(n.toFixed(o).replace(".",""));return a%u/Math.pow(10,o)}Hi.create=t=>{var n;return new Hi({checks:[],typeName:s.ZodString,coerce:null!==(n=null==t?void 0:t.coerce)&&void 0!==n&&n,...K2(t)})};class Ha extends K3{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)!==KP.number){let n=this._getOrReturnCtx(t);return K$(n,{code:KF.invalid_type,expected:KP.number,received:n.parsedType}),KH}let r,i=new KK;for(let a of this._def.checks)"int"===a.kind?o.isInteger(t.data)||(K$(r=this._getOrReturnCtx(t,r),{code:KF.invalid_type,expected:"integer",received:"float",message:a.message}),i.dirty()):"min"===a.kind?(a.inclusive?t.data<a.value:t.data<=a.value)&&(K$(r=this._getOrReturnCtx(t,r),{code:KF.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):"max"===a.kind?(a.inclusive?t.data>a.value:t.data>=a.value)&&(K$(r=this._getOrReturnCtx(t,r),{code:KF.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):"multipleOf"===a.kind?0!==Ho(t.data,a.value)&&(K$(r=this._getOrReturnCtx(t,r),{code:KF.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):"finite"===a.kind?Number.isFinite(t.data)||(K$(r=this._getOrReturnCtx(t,r),{code:KF.not_finite,message:a.message}),i.dirty()):o.assertNever(a);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,u.toString(n))}gt(t,n){return this.setLimit("min",t,!1,u.toString(n))}lte(t,n){return this.setLimit("max",t,!0,u.toString(n))}lt(t,n){return this.setLimit("max",t,!1,u.toString(n))}setLimit(t,n,r,i){return new Ha({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:u.toString(i)}]})}_addCheck(t){return new Ha({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:u.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:u.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:u.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:u.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:u.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:u.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:u.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:u.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:u.toString(t)})}get minValue(){let t=null;for(let n of this._def.checks)"min"===n.kind&&(null===t||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)"max"===n.kind&&(null===t||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>"int"===t.kind||"multipleOf"===t.kind&&o.isInteger(t.value))}get isFinite(){let t=null,n=null;for(let r of this._def.checks){if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;"min"===r.kind?(null===n||r.value>n)&&(n=r.value):"max"===r.kind&&(null===t||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}Ha.create=t=>new Ha({checks:[],typeName:s.ZodNumber,coerce:(null==t?void 0:t.coerce)||!1,...K2(t)});class Hu extends K3{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)!==KP.bigint){let n=this._getOrReturnCtx(t);return K$(n,{code:KF.invalid_type,expected:KP.bigint,received:n.parsedType}),KH}let r,i=new KK;for(let a of this._def.checks)"min"===a.kind?(a.inclusive?t.data<a.value:t.data<=a.value)&&(K$(r=this._getOrReturnCtx(t,r),{code:KF.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):"max"===a.kind?(a.inclusive?t.data>a.value:t.data>=a.value)&&(K$(r=this._getOrReturnCtx(t,r),{code:KF.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):"multipleOf"===a.kind?t.data%a.value!==BigInt(0)&&(K$(r=this._getOrReturnCtx(t,r),{code:KF.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):o.assertNever(a);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,u.toString(n))}gt(t,n){return this.setLimit("min",t,!1,u.toString(n))}lte(t,n){return this.setLimit("max",t,!0,u.toString(n))}lt(t,n){return this.setLimit("max",t,!1,u.toString(n))}setLimit(t,n,r,i){return new Hu({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:u.toString(i)}]})}_addCheck(t){return new Hu({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:u.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:u.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:u.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:u.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:u.toString(n)})}get minValue(){let t=null;for(let n of this._def.checks)"min"===n.kind&&(null===t||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)"max"===n.kind&&(null===t||n.value<t)&&(t=n.value);return t}}Hu.create=t=>{var n;return new Hu({checks:[],typeName:s.ZodBigInt,coerce:null!==(n=null==t?void 0:t.coerce)&&void 0!==n&&n,...K2(t)})};class Hs extends K3{_parse(t){if(this._def.coerce&&(t.data=Boolean(t.data)),this._getType(t)!==KP.boolean){let n=this._getOrReturnCtx(t);return K$(n,{code:KF.invalid_type,expected:KP.boolean,received:n.parsedType}),KH}return KG(t.data)}}Hs.create=t=>new Hs({typeName:s.ZodBoolean,coerce:(null==t?void 0:t.coerce)||!1,...K2(t)});class Hc extends K3{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==KP.date){let n=this._getOrReturnCtx(t);return K$(n,{code:KF.invalid_type,expected:KP.date,received:n.parsedType}),KH}if(isNaN(t.data.getTime())){let r=this._getOrReturnCtx(t);return K$(r,{code:KF.invalid_date}),KH}let i=new KK,a;for(let u of this._def.checks)"min"===u.kind?t.data.getTime()<u.value&&(K$(a=this._getOrReturnCtx(t,a),{code:KF.too_small,message:u.message,inclusive:!0,exact:!1,minimum:u.value,type:"date"}),i.dirty()):"max"===u.kind?t.data.getTime()>u.value&&(K$(a=this._getOrReturnCtx(t,a),{code:KF.too_big,message:u.message,inclusive:!0,exact:!1,maximum:u.value,type:"date"}),i.dirty()):o.assertNever(u);return{status:i.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Hc({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:u.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:u.toString(n)})}get minDate(){let t=null;for(let n of this._def.checks)"min"===n.kind&&(null===t||n.value>t)&&(t=n.value);return null!=t?new Date(t):null}get maxDate(){let t=null;for(let n of this._def.checks)"max"===n.kind&&(null===t||n.value<t)&&(t=n.value);return null!=t?new Date(t):null}}Hc.create=t=>new Hc({checks:[],coerce:(null==t?void 0:t.coerce)||!1,typeName:s.ZodDate,...K2(t)});class Hl extends K3{_parse(t){if(this._getType(t)!==KP.symbol){let n=this._getOrReturnCtx(t);return K$(n,{code:KF.invalid_type,expected:KP.symbol,received:n.parsedType}),KH}return KG(t.data)}}Hl.create=t=>new Hl({typeName:s.ZodSymbol,...K2(t)});class Hf extends K3{_parse(t){if(this._getType(t)!==KP.undefined){let n=this._getOrReturnCtx(t);return K$(n,{code:KF.invalid_type,expected:KP.undefined,received:n.parsedType}),KH}return KG(t.data)}}Hf.create=t=>new Hf({typeName:s.ZodUndefined,...K2(t)});class Hd extends K3{_parse(t){if(this._getType(t)!==KP.null){let n=this._getOrReturnCtx(t);return K$(n,{code:KF.invalid_type,expected:KP.null,received:n.parsedType}),KH}return KG(t.data)}}Hd.create=t=>new Hd({typeName:s.ZodNull,...K2(t)});class Hp extends K3{constructor(){super(...arguments),this._any=!0}_parse(t){return KG(t.data)}}Hp.create=t=>new Hp({typeName:s.ZodAny,...K2(t)});class Hh extends K3{constructor(){super(...arguments),this._unknown=!0}_parse(t){return KG(t.data)}}Hh.create=t=>new Hh({typeName:s.ZodUnknown,...K2(t)});class Hm extends K3{_parse(t){let n=this._getOrReturnCtx(t);return K$(n,{code:KF.invalid_type,expected:KP.never,received:n.parsedType}),KH}}Hm.create=t=>new Hm({typeName:s.ZodNever,...K2(t)});class Hg extends K3{_parse(t){if(this._getType(t)!==KP.undefined){let n=this._getOrReturnCtx(t);return K$(n,{code:KF.invalid_type,expected:KP.void,received:n.parsedType}),KH}return KG(t.data)}}Hg.create=t=>new Hg({typeName:s.ZodVoid,...K2(t)});class Hy extends K3{_parse(t){let{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==KP.array)return K$(n,{code:KF.invalid_type,expected:KP.array,received:n.parsedType}),KH;if(null!==i.exactLength){let o=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(o||a)&&(K$(n,{code:o?KF.too_big:KF.too_small,minimum:a?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(null!==i.minLength&&n.data.length<i.minLength.value&&(K$(n,{code:KF.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),null!==i.maxLength&&n.data.length>i.maxLength.value&&(K$(n,{code:KF.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((t,r)=>i.type._parseAsync(new K0(n,t,n.path,r)))).then(t=>KK.mergeArray(r,t));let u=[...n.data].map((t,r)=>i.type._parseSync(new K0(n,t,n.path,r)));return KK.mergeArray(r,u)}get element(){return this._def.type}min(t,n){return new Hy({...this._def,minLength:{value:t,message:u.toString(n)}})}max(t,n){return new Hy({...this._def,maxLength:{value:t,message:u.toString(n)}})}length(t,n){return new Hy({...this._def,exactLength:{value:t,message:u.toString(n)}})}nonempty(t){return this.min(1,t)}}Hy.create=(t,n)=>new Hy({type:t,minLength:null,maxLength:null,exactLength:null,typeName:s.ZodArray,...K2(n)});class Hv extends K3{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;let t=this._def.shape(),n=o.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==KP.object){let n=this._getOrReturnCtx(t);return K$(n,{code:KF.invalid_type,expected:KP.object,received:n.parsedType}),KH}let{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),u=[];if(!(this._def.catchall instanceof Hm&&"strip"===this._def.unknownKeys))for(let s in i.data)a.includes(s)||u.push(s);let c=[];for(let l of a){let f=o[l],d=i.data[l];c.push({key:{status:"valid",value:l},value:f._parse(new K0(i,d,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof Hm){let p=this._def.unknownKeys;if("passthrough"===p)for(let h of u)c.push({key:{status:"valid",value:h},value:{status:"valid",value:i.data[h]}});else if("strict"===p)u.length>0&&(K$(i,{code:KF.unrecognized_keys,keys:u}),r.dirty());else if("strip"!==p)throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let m=this._def.catchall;for(let g of u){let y=i.data[g];c.push({key:{status:"valid",value:g},value:m._parse(new K0(i,y,i.path,g)),alwaysSet:g in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let t=[];for(let n of c){let r=await n.key;t.push({key:r,value:await n.value,alwaysSet:n.alwaysSet})}return t}).then(t=>KK.mergeObjectSync(r,t)):KK.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(t){return u.errToObj,new Hv({...this._def,unknownKeys:"strict",...void 0!==t?{errorMap:(n,r)=>{var i,o,a,s;let c=null!==(a=null===(o=(i=this._def).errorMap)||void 0===o?void 0:o.call(i,n,r).message)&&void 0!==a?a:r.defaultError;return"unrecognized_keys"===n.code?{message:null!==(s=u.errToObj(t).message)&&void 0!==s?s:c}:{message:c}}}:{}})}strip(){return new Hv({...this._def,unknownKeys:"strip"})}passthrough(){return new Hv({...this._def,unknownKeys:"passthrough"})}extend(t){return new Hv({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Hv({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:s.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Hv({...this._def,catchall:t})}pick(t){let n={};return o.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new Hv({...this._def,shape:()=>n})}omit(t){let n={};return o.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new Hv({...this._def,shape:()=>n})}deepPartial(){return function t(n){if(!(n instanceof Hv))return n instanceof Hy?new Hy({...n._def,type:t(n.element)}):n instanceof HP?HP.create(t(n.unwrap())):n instanceof HL?HL.create(t(n.unwrap())):n instanceof HT?HT.create(n.items.map(n=>t(n))):n;{let r={};for(let i in n.shape){let o=n.shape[i];r[i]=HP.create(t(o))}return new Hv({...n._def,shape:()=>r})}}(this)}partial(t){let n={};return o.objectKeys(this.shape).forEach(r=>{let i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new Hv({...this._def,shape:()=>n})}required(t){let n={};return o.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof HP;)i=i._def.innerType;n[r]=i}}),new Hv({...this._def,shape:()=>n})}keyof(){return HR(o.objectKeys(this.shape))}}Hv.create=(t,n)=>new Hv({shape:()=>t,unknownKeys:"strip",catchall:Hm.create(),typeName:s.ZodObject,...K2(n)}),Hv.strictCreate=(t,n)=>new Hv({shape:()=>t,unknownKeys:"strict",catchall:Hm.create(),typeName:s.ZodObject,...K2(n)}),Hv.lazycreate=(t,n)=>new Hv({shape:t,unknownKeys:"strip",catchall:Hm.create(),typeName:s.ZodObject,...K2(n)});class Hb extends K3{_parse(t){let{ctx:n}=this._processInputParams(t),r=this._def.options;if(n.common.async)return Promise.all(r.map(async t=>{let r={...n,common:{...n.common,issues:[]},parent:null};return{result:await t._parseAsync({data:n.data,path:n.path,parent:r}),ctx:r}})).then(function(t){for(let r of t)if("valid"===r.result.status)return r.result;for(let i of t)if("dirty"===i.result.status)return n.common.issues.push(...i.ctx.common.issues),i.result;let o=t.map(t=>new KW(t.ctx.common.issues));return K$(n,{code:KF.invalid_union,unionErrors:o}),KH});{let i,o=[];for(let a of r){let u={...n,common:{...n.common,issues:[]},parent:null},s=a._parseSync({data:n.data,path:n.path,parent:u});if("valid"===s.status)return s;"dirty"!==s.status||i||(i={result:s,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;let c=o.map(t=>new KW(t));return K$(n,{code:KF.invalid_union,unionErrors:c}),KH}}get options(){return this._def.options}}Hb.create=(t,n)=>new Hb({options:t,typeName:s.ZodUnion,...K2(n)});let Hx=t=>t instanceof HM?Hx(t.schema):t instanceof HN?Hx(t.innerType()):t instanceof HC?[t.value]:t instanceof HE?t.options:t instanceof HA?Object.keys(t.enum):t instanceof HF?Hx(t._def.innerType):t instanceof Hf?[void 0]:t instanceof Hd?[null]:null;class H_ extends K3{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==KP.object)return K$(n,{code:KF.invalid_type,expected:KP.object,received:n.parsedType}),KH;let 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}):(K$(n,{code:KF.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),KH)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let o of n){let a=Hx(o.shape[t]);if(!a)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let u of a){if(i.has(u))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(u)}`);i.set(u,o)}}return new H_({typeName:s.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...K2(r)})}}class HS extends K3{_parse(t){let{status:n,ctx:r}=this._processInputParams(t),i=(t,i)=>{if(KJ(t)||KJ(i))return KH;let a=function t(n,r){let i=KL(n),a=KL(r);if(n===r)return{valid:!0,data:n};if(i===KP.object&&a===KP.object){let u=o.objectKeys(r),s=o.objectKeys(n).filter(t=>-1!==u.indexOf(t)),c={...n,...r};for(let l of s){let f=t(n[l],r[l]);if(!f.valid)return{valid:!1};c[l]=f.data}return{valid:!0,data:c}}if(i!==KP.array||a!==KP.array)return i===KP.date&&a===KP.date&&+n==+r?{valid:!0,data:n}:{valid:!1};{if(n.length!==r.length)return{valid:!1};let d=[];for(let p=0;p<n.length;p++){let h=n[p],m=r[p],g=t(h,m);if(!g.valid)return{valid:!1};d.push(g.data)}return{valid:!0,data:d}}}(t.value,i.value);return a.valid?((KY(t)||KY(i))&&n.dirty(),{status:n.value,value:a.data}):(K$(r,{code:KF.invalid_intersection_types}),KH)};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(([t,n])=>i(t,n)):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}))}}HS.create=(t,n,r)=>new HS({left:t,right:n,typeName:s.ZodIntersection,...K2(r)});class HT extends K3{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==KP.array)return K$(r,{code:KF.invalid_type,expected:KP.array,received:r.parsedType}),KH;if(r.data.length<this._def.items.length)return K$(r,{code:KF.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),KH;!this._def.rest&&r.data.length>this._def.items.length&&(K$(r,{code:KF.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let i=[...r.data].map((t,n)=>{let i=this._def.items[n]||this._def.rest;return i?i._parse(new K0(r,t,r.path,n)):null}).filter(t=>!!t);return r.common.async?Promise.all(i).then(t=>KK.mergeArray(n,t)):KK.mergeArray(n,i)}get items(){return this._def.items}rest(t){return new HT({...this._def,rest:t})}}HT.create=(t,n)=>{if(!Array.isArray(t))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new HT({items:t,typeName:s.ZodTuple,rest:null,...K2(n)})};class Hw extends K3{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==KP.object)return K$(r,{code:KF.invalid_type,expected:KP.object,received:r.parsedType}),KH;let i=[],o=this._def.keyType,a=this._def.valueType;for(let u in r.data)i.push({key:o._parse(new K0(r,u,r.path,u)),value:a._parse(new K0(r,r.data[u],r.path,u))});return r.common.async?KK.mergeObjectAsync(n,i):KK.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return new Hw(n instanceof K3?{keyType:t,valueType:n,typeName:s.ZodRecord,...K2(r)}:{keyType:Hi.create(),valueType:t,typeName:s.ZodRecord,...K2(n)})}}class HO extends K3{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==KP.map)return K$(r,{code:KF.invalid_type,expected:KP.map,received:r.parsedType}),KH;let i=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([t,n],a)=>({key:i._parse(new K0(r,t,r.path,[a,"key"])),value:o._parse(new K0(r,n,r.path,[a,"value"]))}));if(r.common.async){let u=new Map;return Promise.resolve().then(async()=>{for(let t of a){let r=await t.key,i=await t.value;if("aborted"===r.status||"aborted"===i.status)return KH;("dirty"===r.status||"dirty"===i.status)&&n.dirty(),u.set(r.value,i.value)}return{status:n.value,value:u}})}{let s=new Map;for(let c of a){let l=c.key,f=c.value;if("aborted"===l.status||"aborted"===f.status)return KH;("dirty"===l.status||"dirty"===f.status)&&n.dirty(),s.set(l.value,f.value)}return{status:n.value,value:s}}}}HO.create=(t,n,r)=>new HO({valueType:n,keyType:t,typeName:s.ZodMap,...K2(r)});class Hk extends K3{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==KP.set)return K$(r,{code:KF.invalid_type,expected:KP.set,received:r.parsedType}),KH;let i=this._def;null!==i.minSize&&r.data.size<i.minSize.value&&(K$(r,{code:KF.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),null!==i.maxSize&&r.data.size>i.maxSize.value&&(K$(r,{code:KF.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());let o=this._def.valueType;function a(t){let r=new Set;for(let i of t){if("aborted"===i.status)return KH;"dirty"===i.status&&n.dirty(),r.add(i.value)}return{status:n.value,value:r}}let u=[...r.data.values()].map((t,n)=>o._parse(new K0(r,t,r.path,n)));return r.common.async?Promise.all(u).then(t=>a(t)):a(u)}min(t,n){return new Hk({...this._def,minSize:{value:t,message:u.toString(n)}})}max(t,n){return new Hk({...this._def,maxSize:{value:t,message:u.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}Hk.create=(t,n)=>new Hk({valueType:t,minSize:null,maxSize:null,typeName:s.ZodSet,...K2(n)});class HI extends K3{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==KP.function)return K$(n,{code:KF.invalid_type,expected:KP.function,received:n.parsedType}),KH;function r(t,r){return KV({data:t,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Kz,KU].filter(t=>!!t),issueData:{code:KF.invalid_arguments,argumentsError:r}})}function i(t,r){return KV({data:t,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Kz,KU].filter(t=>!!t),issueData:{code:KF.invalid_return_type,returnTypeError:r}})}let o={errorMap:n.common.contextualErrorMap},a=n.data;return this._def.returns instanceof Hj?KG(async(...t)=>{let n=new KW([]),u=await this._def.args.parseAsync(t,o).catch(i=>{throw n.addIssue(r(t,i)),n}),s=await a(...u);return await this._def.returns._def.type.parseAsync(s,o).catch(t=>{throw n.addIssue(i(s,t)),n})}):KG((...t)=>{let n=this._def.args.safeParse(t,o);if(!n.success)throw new KW([r(t,n.error)]);let u=a(...n.data),s=this._def.returns.safeParse(u,o);if(!s.success)throw new KW([i(u,s.error)]);return s.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new HI({...this._def,args:HT.create(t).rest(Hh.create())})}returns(t){return new HI({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new HI({args:t||HT.create([]).rest(Hh.create()),returns:n||Hh.create(),typeName:s.ZodFunction,...K2(r)})}}class HM extends K3{get schema(){return this._def.getter()}_parse(t){let{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}HM.create=(t,n)=>new HM({getter:t,typeName:s.ZodLazy,...K2(n)});class HC extends K3{_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return K$(n,{received:n.data,code:KF.invalid_literal,expected:this._def.value}),KH}return{status:"valid",value:t.data}}get value(){return this._def.value}}function HR(t,n){return new HE({values:t,typeName:s.ZodEnum,...K2(n)})}HC.create=(t,n)=>new HC({value:t,typeName:s.ZodLiteral,...K2(n)});class HE extends K3{_parse(t){if("string"!=typeof t.data){let n=this._getOrReturnCtx(t),r=this._def.values;return K$(n,{expected:o.joinValues(r),received:n.parsedType,code:KF.invalid_type}),KH}if(-1===this._def.values.indexOf(t.data)){let i=this._getOrReturnCtx(t),a=this._def.values;return K$(i,{received:i.data,code:KF.invalid_enum_value,options:a}),KH}return KG(t.data)}get options(){return this._def.values}get enum(){let t={};for(let n of this._def.values)t[n]=n;return t}get Values(){let t={};for(let n of this._def.values)t[n]=n;return t}get Enum(){let t={};for(let n of this._def.values)t[n]=n;return t}extract(t){return HE.create(t)}exclude(t){return HE.create(this.options.filter(n=>!t.includes(n)))}}HE.create=HR;class HA extends K3{_parse(t){let n=o.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==KP.string&&r.parsedType!==KP.number){let i=o.objectValues(n);return K$(r,{expected:o.joinValues(i),received:r.parsedType,code:KF.invalid_type}),KH}if(-1===n.indexOf(t.data)){let a=o.objectValues(n);return K$(r,{received:r.data,code:KF.invalid_enum_value,options:a}),KH}return KG(t.data)}get enum(){return this._def.values}}HA.create=(t,n)=>new HA({values:t,typeName:s.ZodNativeEnum,...K2(n)});class Hj extends K3{unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==KP.promise&&!1===n.common.async)return K$(n,{code:KF.invalid_type,expected:KP.promise,received:n.parsedType}),KH;let r=n.parsedType===KP.promise?n.data:Promise.resolve(n.data);return KG(r.then(t=>this._def.type.parseAsync(t,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Hj.create=(t,n)=>new Hj({type:t,typeName:s.ZodPromise,...K2(n)});class HN extends K3{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===s.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null;if("preprocess"===i.type){let a=i.transform(r.data);return r.common.async?Promise.resolve(a).then(t=>this._def.schema._parseAsync({data:t,path:r.path,parent:r})):this._def.schema._parseSync({data:a,path:r.path,parent:r})}let u={addIssue(t){K$(r,t),t.fatal?n.abort():n.dirty()},get path(){return r.path}};if(u.addIssue=u.addIssue.bind(u),"refinement"===i.type){let s=t=>{let n=i.refinement(t,u);if(r.common.async)return Promise.resolve(n);if(n instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return t};if(!1!==r.common.async)return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(t=>"aborted"===t.status?KH:("dirty"===t.status&&n.dirty(),s(t.value).then(()=>({status:n.value,value:t.value}))));{let c=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===c.status?KH:("dirty"===c.status&&n.dirty(),s(c.value),{status:n.value,value:c.value})}}if("transform"===i.type){if(!1!==r.common.async)return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(t=>KQ(t)?Promise.resolve(i.transform(t.value,u)).then(t=>({status:n.value,value:t})):t);{let l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!KQ(l))return l;let f=i.transform(l.value,u);if(f instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:f}}}o.assertNever(i)}}HN.create=(t,n,r)=>new HN({schema:t,typeName:s.ZodEffects,effect:n,...K2(r)}),HN.createWithPreprocess=(t,n,r)=>new HN({schema:n,effect:{type:"preprocess",transform:t},typeName:s.ZodEffects,...K2(r)});class HP extends K3{_parse(t){return this._getType(t)===KP.undefined?KG(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}HP.create=(t,n)=>new HP({innerType:t,typeName:s.ZodOptional,...K2(n)});class HL extends K3{_parse(t){return this._getType(t)===KP.null?KG(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}HL.create=(t,n)=>new HL({innerType:t,typeName:s.ZodNullable,...K2(n)});class HF extends K3{_parse(t){let{ctx:n}=this._processInputParams(t),r=n.data;return n.parsedType===KP.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}HF.create=(t,n)=>new HF({innerType:t,typeName:s.ZodDefault,defaultValue:"function"==typeof n.default?n.default:()=>n.default,...K2(n)});class HD extends K3{_parse(t){let{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 KX(i)?i.then(t=>({status:"valid",value:"valid"===t.status?t.value:this._def.catchValue({get error(){return new KW(r.common.issues)},input:r.data})})):{status:"valid",value:"valid"===i.status?i.value:this._def.catchValue({get error(){return new KW(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}HD.create=(t,n)=>new HD({innerType:t,typeName:s.ZodCatch,catchValue:"function"==typeof n.catch?n.catch:()=>n.catch,...K2(n)});class HW extends K3{_parse(t){if(this._getType(t)!==KP.nan){let n=this._getOrReturnCtx(t);return K$(n,{code:KF.invalid_type,expected:KP.nan,received:n.parsedType}),KH}return{status:"valid",value:t.data}}}HW.create=t=>new HW({typeName:s.ZodNaN,...K2(t)});let HU=Symbol("zod_brand");class Hz extends K3{_parse(t){let{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 HB extends K3{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{let t=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===t.status?KH:"dirty"===t.status?(n.dirty(),KZ(t.value)):this._def.out._parseAsync({data:t.value,path:r.path,parent:r})})();{let i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===i.status?KH:"dirty"===i.status?(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 HB({in:t,out:n,typeName:s.ZodPipeline})}}let Hq=(t,n={},r)=>t?Hp.create().superRefine((i,o)=>{var a,u;if(!t(i)){let s="function"==typeof n?n(i):"string"==typeof n?{message:n}:n,c=null===(u=null!==(a=s.fatal)&&void 0!==a?a:r)||void 0===u||u;o.addIssue({code:"custom",..."string"==typeof s?{message:s}:s,fatal:c})}}):Hp.create(),HV={object:Hv.lazycreate};(erq=s||(s={})).ZodString="ZodString",erq.ZodNumber="ZodNumber",erq.ZodNaN="ZodNaN",erq.ZodBigInt="ZodBigInt",erq.ZodBoolean="ZodBoolean",erq.ZodDate="ZodDate",erq.ZodSymbol="ZodSymbol",erq.ZodUndefined="ZodUndefined",erq.ZodNull="ZodNull",erq.ZodAny="ZodAny",erq.ZodUnknown="ZodUnknown",erq.ZodNever="ZodNever",erq.ZodVoid="ZodVoid",erq.ZodArray="ZodArray",erq.ZodObject="ZodObject",erq.ZodUnion="ZodUnion",erq.ZodDiscriminatedUnion="ZodDiscriminatedUnion",erq.ZodIntersection="ZodIntersection",erq.ZodTuple="ZodTuple",erq.ZodRecord="ZodRecord",erq.ZodMap="ZodMap",erq.ZodSet="ZodSet",erq.ZodFunction="ZodFunction",erq.ZodLazy="ZodLazy",erq.ZodLiteral="ZodLiteral",erq.ZodEnum="ZodEnum",erq.ZodEffects="ZodEffects",erq.ZodNativeEnum="ZodNativeEnum",erq.ZodOptional="ZodOptional",erq.ZodNullable="ZodNullable",erq.ZodDefault="ZodDefault",erq.ZodCatch="ZodCatch",erq.ZodPromise="ZodPromise",erq.ZodBranded="ZodBranded",erq.ZodPipeline="ZodPipeline";let H$=(t,n={message:`Input not instance of ${t.name}`})=>Hq(n=>n instanceof t,n),HK=Hi.create,HH=Ha.create,HZ=HW.create,HG=Hu.create,HJ=Hs.create,HY=Hc.create,HQ=Hl.create,HX=Hf.create,H0=Hd.create,H1=Hp.create,H2=Hh.create,H3=Hm.create,H4=Hg.create,H5=Hy.create,H6=Hv.create,H9=Hv.strictCreate,H8=Hb.create,H7=H_.create,Ze=HS.create,Zt=HT.create,Zn=Hw.create,Zr=HO.create,Zi=Hk.create,Zo=HI.create,Za=HM.create,Zu=HC.create,Zs=HE.create,Zc=HA.create,Zl=Hj.create,Zf=HN.create,Zd=HP.create,Zp=HL.create,Zh=HN.createWithPreprocess,Zm=HB.create,Zg=()=>HK().optional(),Zy=()=>HH().optional(),Zv=()=>HJ().optional();var Zb=Object.freeze({__proto__:null,defaultErrorMap:KU,setErrorMap:KB,getErrorMap:Kq,makeIssue:KV,EMPTY_PATH:[],addIssueToContext:K$,ParseStatus:KK,INVALID:KH,DIRTY:KZ,OK:KG,isAborted:KJ,isDirty:KY,isValid:KQ,isAsync:KX,get util(){return o},get objectUtil(){return a},ZodParsedType:KP,getParsedType:KL,ZodType:K3,ZodString:Hi,ZodNumber:Ha,ZodBigInt:Hu,ZodBoolean:Hs,ZodDate:Hc,ZodSymbol:Hl,ZodUndefined:Hf,ZodNull:Hd,ZodAny:Hp,ZodUnknown:Hh,ZodNever:Hm,ZodVoid:Hg,ZodArray:Hy,ZodObject:Hv,ZodUnion:Hb,ZodDiscriminatedUnion:H_,ZodIntersection:HS,ZodTuple:HT,ZodRecord:Hw,ZodMap:HO,ZodSet:Hk,ZodFunction:HI,ZodLazy:HM,ZodLiteral:HC,ZodEnum:HE,ZodNativeEnum:HA,ZodPromise:Hj,ZodEffects:HN,ZodTransformer:HN,ZodOptional:HP,ZodNullable:HL,ZodDefault:HF,ZodCatch:HD,ZodNaN:HW,BRAND:HU,ZodBranded:Hz,ZodPipeline:HB,custom:Hq,Schema:K3,ZodSchema:K3,late:HV,get ZodFirstPartyTypeKind(){return s},coerce:{string:t=>Hi.create({...t,coerce:!0}),number:t=>Ha.create({...t,coerce:!0}),boolean:t=>Hs.create({...t,coerce:!0}),bigint:t=>Hu.create({...t,coerce:!0}),date:t=>Hc.create({...t,coerce:!0})},any:H1,array:H5,bigint:HG,boolean:HJ,date:HY,discriminatedUnion:H7,effect:Zf,enum:Zs,function:Zo,instanceof:H$,intersection:Ze,lazy:Za,literal:Zu,map:Zr,nan:HZ,nativeEnum:Zc,never:H3,null:H0,nullable:Zp,number:HH,object:H6,oboolean:Zv,onumber:Zy,optional:Zd,ostring:Zg,pipeline:Zm,preprocess:Zh,promise:Zl,record:Zn,set:Zi,strictObject:H9,string:HK,symbol:HQ,transformer:Zf,tuple:Zt,undefined:HX,union:H8,unknown:H2,void:H4,NEVER:KH,ZodIssueCode:KF,quotelessJson:KD,ZodError:KW});function Zx(t){let{debouncedUrl:n,content:r,onContentChange:i,selected:o}=t,a=(0,c.useRef)(null),[u,s]=(0,c.useState)(!1);return(0,f.pQ)(n,()=>{var t;u&&(s(!1),null==(t=a.current)||t.reset())}),n===(null==r?void 0:r.embed_url)?M.jsx(ZS,{content:r}):M.jsx(l.SV,{ref:a,renderError:Z_,onError:function(){s(!0),i(void 0)},children:M.jsx(c.Suspense,{fallback:r&&M.jsx(ZS,{content:r}),children:M.jsx(ZT,{url:n,selected:o,onContentChange:i})})})}function Z_(){return M.jsx(l.yO,{title:"There is no embed data available."})}function ZS(t){let{content:n,selected:r}=t;return M.jsx(l.fu,{...function(t){let n="";switch(t.type){case"video":n=t.title??"";break;case"photo":n="View this post"+(t.provider_name?` on ${t.provider_name}`:"");break;default:n="Open"+(t.provider_name?` on ${t.provider_name}`:"")}return{url:t.embed_url,thumbnail:{url:t.thumbnail_url??"",aspectRatio:"video"===t.type?"16:9":"1:1"},provider:t.provider_name??"",author:t.author_name??"",subtitle:n}}(n),selected:r})}function ZT(t){let{url:n,onContentChange:r,selected:i}=t,o=function(t){let{url:n,onContentChange:r}=t,{embedsUrl:i}=i7(),o=(0,h.QT)(Zw,[n,i]),a=(0,f.R9)(r);return(0,c.useEffect)(()=>{let t=setTimeout(()=>a(o));return()=>{clearTimeout(t)}},[o,a]),o}({url:n,onContentChange:r});return M.jsx(ZS,{content:o,selected:i})}function Zw(t,n){var r;let i=new URL(n);return i.search=new URLSearchParams({url:t}).toString(),(0,p.WY)(i.toString(),{okType:(r=t,Zb.object({type:Zb.string(),version:Zb.string().or(Zb.number()).nullish(),title:Zb.string().nullish(),author_name:Zb.string().nullish(),author_url:Zb.string().nullish(),provider_name:Zb.string().nullish(),provider_url:Zb.string().nullish(),cache_age:Zb.string().or(Zb.number()).nullish(),thumbnail_url:Zb.string().nullish(),thumbnail_width:Zb.number().nullish(),thumbnail_height:Zb.number().nullish(),html:Zb.string().nullish()}).passthrough().transform(t=>{let n={embed_url:r};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 ZO(t){let{id:n,readOnly:r,field:i,content:o,onContentChange:a}=t,[u,s]=(0,c.useState)((null==o?void 0:o.embed_url)??"");function d(t){s(t),(0,g.j)(t)||a(void 0)}let[p,h]=(0,c.useState)(u),m=(0,c.useCallback)(t=>(0,c.startTransition)(()=>h(t)),[]);return(0,f.Nr)(u,300,m),M.jsxs(l.gN,{footer:(0,g.j)(u)&&M.jsx(l.mS,{children:M.jsx(Zx,{debouncedUrl:p,content:o,onContentChange:a})}),children:[M.jsx(l.fw,{name:"cloud"}),M.jsx(l.Qy,{htmlFor:n,children:KR(i)}),M.jsx(l.JO,{children:M.jsx(l.oi,{id:n,readOnly:r,placeholder:KE(i),value:u,onValueChange:d,variant:(0,g.j)(u)?"link":"normal",endAdornment:M.jsx(l.zx,{startIcon:"close",variant:"secondary",size:"small",disabled:!u,onClick:()=>d("")})})})]})}function Zk(t){return!(t.lat>85||t.lat<-85||t.lng>180||t.lng<-180)}function ZI(t){let n=t.match(/^.*@(-?\d+.\d+),(-?\d+.\d+).*$/);if(!n)return;let r=parseFloat(n[1]??""),i=parseFloat(n[2]??"");if(isNaN(r)||isNaN(i))return;let o={lat:r,lng:i};if(Zk(o))return o}function ZM(t){return t?`${t.lat}, ${t.lng}`:""}function ZC(t){let n=t.match(/\(?([\d|.|-]*)[\s+]*,[\s]*([\d|.|-]*)\)?/);if(!n)return ZI(t);let r=parseFloat(n[1]??""),i=parseFloat(n[2]??"");if(isNaN(r)||isNaN(i))return ZI(t);let o={lat:r,lng:i};return Zk(o)?o:ZI(t)}function ZR(t){let{field:n,id:r,readOnly:i,...o}=t,{onValueChange:a,displayedValue:u,onBlur:s,clearValue:f,isValidCoordinates:d}=function(t){let{content:n,onContentChange:r}=t,i=ZM(null==n?void 0:n.position),[o,a]=(0,c.useState)(i),u=Boolean(ZC(o));return{displayedValue:o,isValidCoordinates:u,onValueChange:a,onBlur:function(){let t=ZC(o);if(!t)return a(""),r(void 0);let{lat:n,lng:i}=t;a(ZM({lat:n,lng:i})),r({__TYPE__:"GeoPointContent",position:{lat:n,lng:i}})},clearValue:function(){a(""),r(void 0)}}}(o);return M.jsxs(l.gN,{children:[M.jsx(l.fw,{name:"place"}),M.jsx(l.Qy,{htmlFor:r,children:KR(n)}),M.jsx(l.JO,{children:M.jsx(l.oi,{id:r,onValueChange:a,placeholder:"...",readOnly:i,value:u,onBlur:s,variant:d?"link":"normal",endAdornment:M.jsx(l.zx,{startIcon:"close",variant:"secondary",size:"small",disabled:!u,onClick:f})})})]})}let ZE="__MAIN_THUMBNAIL__";function ZA(t,n,r){let i=t.name===ZE?void 0:t.name,o;return[i,(o=n?(0,d.$)(r)?[r.width,r.height]:(0,d.$)(t.width)||(0,d.$)(t.height)?[t.width??void 0,t.height??void 0]:[n.origin.width,n.origin.height]:void 0)?`${o[0]??"auto"}x${o[1]??"auto"}px`:void 0]}function Zj(t,n){let{width:r,height:i}=n??{};return r&&i?[r,i]:r?[r,Math.round(t.height*(r/t.width))]:i?[Math.round(t.width*(i/t.height)),i]:[t.width,t.height]}function ZN(t,n,r,i,o){let a=new URL(t);if(o){let{x:u,y:s,width:c,height:l}=n;a.searchParams.set("rect",[u,s,c,l].join(",")),a.searchParams.set("w",r.toString()),a.searchParams.set("h",i.toString())}return a.toString()}function ZP(t){let n=new URL(t);return n.searchParams.delete("q"),n.searchParams.set("w","800"),n.searchParams.set("h","800"),n.searchParams.set("auto","compress,format"),n.searchParams.set("fit","max"),n.toString()}function ZL(t){let n=new URL(t);return n.searchParams.delete("q"),n.searchParams.delete("fm"),n.searchParams.set("w","300"),n.searchParams.set("auto","compress,format"),n.toString()}function ZF(t){return null!=t&&t.url?ZP(t.url):void 0}let ZD=H6({id:HK(),kind:HK(),extension:HK(),filename:HK(),width:HH().optional(),height:HH().optional(),last_modified:HH(),url:HK(),alt:HK().optional()}),ZW=H6({total:HH(),cursor:HK().optional(),items:H5(ZD)});function ZU(t,n,r,i){let o=new URLSearchParams({assetType:"image",limit:"30",...i&&{cursor:i}});return(0,p.WY)(`${t}?${o.toString()}`,{headers:{repository:n},credentials:(0,p.xb)(r),okType:ZW})}function Zz(t){let{onFilesSelected:n}=t,[r,i]=(0,c.useTransition)(),[o,a]=(0,c.useState)(!1);return(0,f.Nr)(r,100,()=>a(r)),M.jsx(l.SV,{renderError:ZH,children:M.jsx(c.Suspense,{children:M.jsxs(l.Zz,{onFilesSelected:n,overlay:M.jsx(ZV,{}),children:[M.jsx(ZB,{...t,startTransition:i}),M.jsx(l.xu,{position:"relative",width:"100%",justifyContent:"center",children:M.jsx(l.FN,{anchor:M.jsx(l.xu,{position:"fixed",bottom:72}),loadingIndicator:!0,open:o,title:"Loading media ...",seconds:1})})]})})})}function ZB(t){let{uploadingFiles:n,onFilesSelected:r,onSuccessFiles:i,onFailedFiles:o,onTryAgain:a,onMediaSelected:u,startTransition:s}=t,{media:f,limit:d,onHasReachedBottom:p,response:m,updateMedia:g}=function(){let t=i7(),[n,r]=(0,c.useState)(),[i,o]=(0,c.useState)([]),[a,u]=(0,c.useState)(i);t.mediaLibrary||ot("mediaLibrary");let{assetsUrl:s,repository:l}=t,f=(0,h.QT)(ZU,[s,l,t.env,n]);return a!==f.items&&(u(f.items),o(t=>[...t,...f.items])),{media:i,limit:30,onHasReachedBottom:function(){0!==f.total&&r(f.cursor)},response:f,updateMedia:function(r){let a=[...r,...i];o([]),(0,h.VA)(ZU,[s,l,t.env,n],{total:a.length,items:a,cursor:void 0})}}}();return(0,c.useEffect)(()=>{let t=n.filter(t=>"success"===t.status).map(t=>t.response),r=n.filter(t=>"failed"===t.status);t.length>0&&(g(t),i()),r.length>0&&o(r)},[o,i,g,n]),0===f.length?M.jsx(Zq,{onFilesSelected:r}):M.jsxs(Z$,{onScrollToBottom(){m.total===d&&s(p)},children:[M.jsx(l.xu,{flexDirection:"column",gap:6,children:n.map((t,n)=>M.jsx(l.tK,{file:t.file,failed:"failed"===t.status,onTryAgain:()=>a(t)},`${t.file.name}${n}`))}),M.jsx(l.Rk,{items:f,getItemInfo:ZK,children:t=>M.jsx(c.Suspense,{fallback:M.jsx(l.Od,{width:"100%",height:"100%"}),children:M.jsx(l.P0,{url:ZL(t.url),onClick:()=>u({...t,width:t.width??2e3,height:t.height??2e3})})})})]})}function Zq(t){let{onFilesSelected:n}=t;return M.jsx(l.xu,{justifyContent:"center",flexDirection:"column",height:"100%",padding:24,children:M.jsx(l.xu,{justifyContent:"center",flexDirection:"column",height:"100%",backgroundColor:"grey2",borderRadius:4,padding:{inline:80},children:M.jsxs(l.R$,{children:[M.jsx(l.av,{name:"cloudUpload",lineColor:"purple10",backgroundColor:"purple12"}),M.jsx(l._T,{size:"big",children:"Drop files here or"}),M.jsx(l.nf,{children:M.jsxs(l.xv,{color:"grey11",align:"center",variant:"normal",children:["Explore our documentation to find out the"," ",M.jsx(l.hh,{underline:!0,color:"grey11",href:" https://prismic.io/docs/guides/manage-images#maximum-file-size",children:"maximum size"})," ","and"," ",M.jsx(l.hh,{underline:!0,color:"grey11",href:" https://prismic.io/docs/guides/manage-images#supported-media",children:"supported image formats"})," ","for uploads in the media library."]})}),M.jsx(l.Qj,{children:M.jsx(l.ZD,{title:"Upload Media",onFilesSelected:n})})]})})})}function ZV(){return M.jsx(l.xu,{justifyContent:"center",flexDirection:"column",height:"100%",children:M.jsxs(l.R$,{children:[M.jsx(l.av,{name:"cloudUpload",lineColor:"purple10",backgroundColor:"purple12"}),M.jsx(l._T,{size:"big",children:"Drop files here"}),M.jsx(l.nf,{children:"Drop your files to upload them instantly to your media library"})]})})}function Z$(t){let{children:n,onScrollToBottom:r}=t;return M.jsx(l.xr,{style:{height:"100%",paddingInline:l.TV.space[24],paddingBlock:l.TV.space[16],gap:l.TV.space[16]},onScrollToBottom:r,children:n})}function ZK(t){return{key:t.id,aspectRatio:(t.width??2e3)/(t.height??2e3)}}function ZH(){return M.jsx(l.xu,{height:"100%",flexDirection:"column",alignItems:"center",justifyContent:"center",children:M.jsx(l.Iq,{title:"Request failed",description:"An error occurred while searching for your image.",errorImageSrc:l.Os})})}h.Fs.registerFetcherConfig(ZU,{cacheCapacity:100,revalidationStrategy:{type:"never"}});let ZZ,ZG=new Uint8Array(16);function ZJ(){if(!ZZ&&!(ZZ="u">typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ZZ(ZG)}let ZY=[];for(let ZQ=0;ZQ<256;++ZQ)ZY.push((ZQ+256).toString(16).slice(1));let ZX="u">typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Z0={randomUUID:ZX},Z1=H6({id:HK(),width:HH(),height:HH(),urls:H6({full:HK(),small:HK().transform(ZL)})}),Z2=H6({results:H5(Z1)}).transform(t=>t.results);function Z3(t,n){let r=new URLSearchParams({page:"1",per_page:"30",query:n});return(0,p.WY)(`${t}/search/photos?${r.toString()}`,{okType:Z2})}h.Fs.registerFetcherConfig(Z3,{cacheCapacity:5,revalidationStrategy:{type:"never"}});let Z4=t=>{let{onMediaSelected:n}=t,[r,i]=(0,c.useState)(""),[o,a]=(0,c.useState)(r),[u,s]=(0,c.useTransition)(),d=(0,c.useCallback)(t=>s(()=>a(t)),[]);return(0,f.Nr)(r,200,d),M.jsxs(M.Fragment,{children:[M.jsx(l.xu,{padding:{inline:24,top:16},flexDirection:"column",children:M.jsx(l.Mj,{value:r,placeholder:"Search on Unsplash.com",onValueChange:i})}),M.jsx(Z6,{children:M.jsx(l.SV,{renderError:Z8,children:M.jsx(c.Suspense,{fallback:M.jsx(l.DW,{}),children:M.jsx(Z5,{term:o,isUpdating:u,onMediaSelected:n})})})})]})},Z5=t=>{var n,r,i;let{term:o,isUpdating:a,onMediaSelected:u}=t,s=i7(),c=(n=s.unsplashUrl,(0,h.QT)(Z3,[n,o||"fruit"])),f=(i=a,{opacity:i?.4:1,transitionProperty:i?"opacity":"none",transitionDuration:l.TV.transitionDuration[300],transitionTimingFunction:l.TV.transitionTimingFunction.easeInOut});return c.length?M.jsx(l.Rk,{items:c,getItemInfo:Z9,style:f,children:t=>M.jsx(l.P0,{url:t.urls.small,onClick:()=>u({id:t.id,url:t.urls.full,width:t.width,height:t.height})})}):M.jsxs(l.R$,{style:{marginTop:"auto",marginBottom:"auto",...f},children:[M.jsx(l.u2,{children:M.jsx("img",{src:l.Os,alt:"No results"})}),M.jsx(l._T,{size:"big",children:"Oh no ..."}),M.jsx(l.nf,{children:"The search returned no result."})]})},Z6=({children:t})=>M.jsx(l.xr,{style:{height:"100%",paddingInline:l.TV.space[24],paddingTop:l.TV.space[4]},children:t});function Z9(t){return{key:t.id,aspectRatio:t.width/t.height}}function Z8(){return M.jsx(l.xu,{height:"100%",flexDirection:"column",alignItems:"center",justifyContent:"center",children:M.jsx(l.Iq,{title:"Request failed",description:"An error occurred while searching for your image.",errorImageSrc:l.Os})})}function Z7(t){let{trigger:n,onMediaSelected:r}=t,i=i7(),{onFilesSelected:o,uploadingFiles:a,onSuccessFiles:u,onFailedFiles:s,onTryAgain:f}=function(){let[t,n]=(0,c.useState)([]),r=i7();function i(t){if(!r.mediaLibrary)return;let{assetsUrl:i,repository:o,env:a}=r;t.forEach(t=>(function(t){let{file:n,url:r,repository:i,env:o}=t,a=new FormData;return a.append(n.name,n),(0,p.WY)(r,{headers:{repository:i,"Content-Type":"multipart/form-data"},method:"POST",body:a,credentials:(0,p.xb)(o),okType:ZD})})({file:t.file,url:i??"",repository:o??"",env:a}).then(r=>{n(n=>n.map(n=>n.id===t.id?{...n,status:"success",response:r}:n))}).catch(()=>{n(n=>n.map(n=>n.id===t.id?{...n,status:"failed"}:n))}))}let{onFailedFiles:o,onTryAgain:a}=function(t){let{setUploadingFiles:n,tryPostMedia:r}=t,i=(0,c.useRef)();return{onTryAgain:function(t){clearTimeout(i.current),n(n=>n.map(n=>n.id===t.id?{...t,status:"loading"}:n)),r([t])},onFailedFiles:function(t){let r=()=>n(n=>n.filter(n=>!t.includes(n)));i.current=window.setTimeout(r,3e3)}}}({setUploadingFiles:n,tryPostMedia:i});return{onFilesSelected:function(t){let r=t.map(t=>({id:function(t,n,r){if(Z0.randomUUID&&!n&&!t)return Z0.randomUUID();t=t||{};let i=t.random||(t.rng||ZJ)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,n){r=r||0;for(let o=0;o<16;++o)n[r+o]=i[o];return n}return function(t,n=0){return(ZY[t[n+0]]+ZY[t[n+1]]+ZY[t[n+2]]+ZY[t[n+3]]+"-"+ZY[t[n+4]]+ZY[t[n+5]]+"-"+ZY[t[n+6]]+ZY[t[n+7]]+"-"+ZY[t[n+8]]+ZY[t[n+9]]+"-"+ZY[t[n+10]]+ZY[t[n+11]]+ZY[t[n+12]]+ZY[t[n+13]]+ZY[t[n+14]]+ZY[t[n+15]]).toLowerCase()}(i)}(),file:t,status:"loading"}));n(t=>[...t,...r]),i(r)},uploadingFiles:t,onSuccessFiles:function(){n(t=>t.filter(t=>"success"!==t.status))},onFailedFiles:o,onTryAgain:a}}(),[d,h]=(0,c.useState)(!1),[m,g]=(0,c.useState)(i.mediaLibrary?"media":"unsplash"),y=t=>{if("media"!==t&&"unsplash"!==t)throw Error(`Invalid option ${t}.`);g(t)};return M.jsxs(l.Vq,{trigger:n,open:d,onOpenChange:h,children:[M.jsx(l.fK,{icon:"folder",title:"Add an image"}),M.jsxs(l.Zp,{value:m,onValueChange:y,children:[i.mediaLibrary&&M.jsx(l.T9,{value:"media",title:"Media library",subtitle:"From Prismic",icon:"photo"}),M.jsx(l.T9,{value:"unsplash",title:"Unsplash",subtitle:"Source of free images",icon:"unsplash"}),i.mediaLibrary&&M.jsx(l.xu,{flexDirection:"column",justifyContent:"end",flexGrow:1,animation:{name:"fadeIn"},children:M.jsx(l.ZD,{startIcon:"cloudUpload",title:"Upload media",onFilesSelected:o})})]}),M.jsx(l.cZ,{children:M.jsx(Ge,{option:m,uploadingFiles:a,onSuccessFiles:u,onFailedFiles:s,onFilesSelected:o,onTryAgain:f,onMediaSelected(t){h(!1),null==r||r(t)}})})]})}function Ge(t){let{option:n,onMediaSelected:r,...i}=t,o=i7();switch(n){case"media":return o.mediaLibrary?M.jsx(Zz,{onMediaSelected:r,...i}):null;case"unsplash":return M.jsx(Z4,{onMediaSelected:r})}}function Gt(t){let{onMediaSelected:n,readOnly:r,isUpdating:i}=t;return M.jsx(l.aY,{children:M.jsx(l.Zb,{color:"grey3",variant:"outlined",children:M.jsx(l.aY,{children:M.jsx(l.xu,{padding:{block:48},flexDirection:"column",children:M.jsxs(l.R$,{children:[M.jsx(l.av,{name:"cloudUpload"}),M.jsx(l._T,{children:i?"Preparing your image...":"You haven't selected an image"}),!r&&M.jsx(l.Qj,{children:M.jsx(Z7,{trigger:M.jsx(l.zx,{disabled:i,children:"Select image"}),onMediaSelected:n})})]})})})})})}function Gn(t){let{id:n,readOnly:r,altText:i,onValueChange:o,selected:a}=t;return M.jsxs(l.gN,{labelPosition:"side",selected:a,children:[M.jsx(l.Qy,{htmlFor:n,children:"Alt text"}),M.jsx(l.JO,{children:M.jsx(l.oi,{id:n,onValueChange:o,placeholder:"Short description for the visually impaired",readOnly:r,value:i})})]})}let Gr=({contentView:t,constraints:n,croppedImage:r})=>{let[i,o]=Zj(t.origin,n),a=ZN(t.origin.url,r,i,o,!0);return{...t,width:i,height:o,url:a,edit:{...t.edit,zoom:r.zoom,crop:{x:r.x,y:r.y}}}},Gi=({field:t,content:n,thumbnail:r,croppedImage:i})=>{var o,a,u,s;if(r===ZE){let c=Gr({contentView:n,constraints:null==(o=null==t?void 0:t.config)?void 0:o.constraint,croppedImage:i});return c.url===n.url?n:{...n,...c}}let l=null==(u=null==(a=null==t?void 0:t.config)?void 0:a.thumbnails)?void 0:u.find(t=>t.name===r),f=null==(s=n.thumbnails)?void 0:s[r];if(!l||!f)return n;let d=Gr({contentView:f,constraints:l,croppedImage:i});return d.url===f.url?n:{...n,thumbnails:{...n.thumbnails,[r]:d}}},Go=({initialSize:t,constraints:n})=>{let r=null!=n&&n.width&&null!=n&&n.height?n.width/n.height:t.width/t.height,[i,o]=t.width<t.height?[t.width,Math.round(t.width/r)]:[Math.round(t.height*r),t.height],a=Math.max(i/t.width,o/t.height,1);return{width:Math.round(i/a),height:Math.round(o/a)}},Ga=({contentView:t,constraints:n})=>{let r=Go({initialSize:t.origin,constraints:n}),i=t.edit.zoom??1,o=Math.round(r.width/i),a=Math.round(r.height/i);return{...t.edit.crop,width:o,height:a,zoom:i}},Gu={x:0,y:0,width:0,height:0,zoom:1},Gs=({selectedImage:{thumbnail:t,contentView:n}})=>t.width&&t.height?t.width/t.height:n?n.origin.width/n.origin.height:1,Gc=({trigger:t,initialImages:n,initialOption:r,onClose:i})=>{var o;let[a,u]=(0,c.useState)({}),[s,f]=(0,c.useState)({}),[d,p]=(0,c.useState)(!1),[h,m]=(0,c.useState)(!1),[g,y]=(0,c.useState)(r),v=n[g],b=t=>{if(!v)return;let n=v.thumbnail.name,r=a[n]??Gu;u({...a,[n]:{...r,zoom:t}})},x=t=>{if(!v)return;let n=v.thumbnail.name,r=a[n]??Gu;u({...a,[n]:{...r,...t}})},_=t=>{if(!v)return;let n=v.thumbnail.name,r=s[n];f({...s,[n]:{...r,crop:t}})},S=t=>{if(!v)return;let n=v.thumbnail.name,r=s[n]??{};f({...s,[n]:{...r,aspectRatio:t}})},T=a[(null==v?void 0:v.thumbnail.name)??""],w=d?T??((null==v?void 0:v.contentView)&&Ga({contentView:v.contentView,constraints:v.thumbnail})):void 0,O=s[(null==v?void 0:v.thumbnail.name)??""];return M.jsxs(l.Vq,{trigger:t,onAnimationEnd:()=>m(!0),open:d,onOpenChange(t){t?(y(r),u({}),f({})):(m(!1),i({option:g,croppedImages:a})),p(t)},children:[M.jsx(l.fK,{icon:"photo",title:"Image editor"}),M.jsx(l.Zp,{value:String(g),onValueChange:t=>y(Number(t)),children:n.map((t,n)=>M.jsx(l.T9,{value:String(n),icon:"photo",title:t.labels[0]??"Main",subtitle:t.labels[1]??""},t.thumbnail.name))}),v&&M.jsx(l.cZ,{children:h&&M.jsx(l.tP,{image:(null==(o=v.contentView)?void 0:o.origin.url)??"",crop:(null==O?void 0:O.crop)??{x:0,y:0},onCropChange:_,zoom:(null==T?void 0:T.zoom)??1,onZoomChange:b,aspectRatio:Gs({selectedImage:v,cropper:O}),onAspectRatioChange:S,initialCroppedArea:w,onCropAreaChange:x},v.thumbnail.name)})]})};function Gl(t){var n,r;let{content:i,selected:o,fieldLabel:a,readOnly:u,imageLabel:s,onMediaSelected:c,initialImages:f,initialOption:d=0,onCropperDialogClose:p,onClear:h,children:m}=t,g=(null==(r=null==(n=null==i?void 0:i.url)?void 0:n.split("?")[0])?void 0:r.slice(-4))===".svg",y=null!=i&&i.url&&!u?"visible":"hidden";return M.jsxs(l.Zb,{color:o?"indigo2":"grey2",variant:o?"selected":"dashed",children:[M.jsxs(l.Ol,{children:[M.jsxs(l.wP,{children:[a,0!==s.length&&M.jsx(l.xv,{color:"grey11",component:"span",noSelect:!0,children:` • ${s.join(" • ")}`})]}),M.jsxs(l.Pf,{style:{visibility:y},children:[M.jsx(Gc,{trigger:M.jsx(l.zx,{startIcon:"crop",disabled:g,children:"Crop & Resize"}),initialImages:f,initialOption:d,onClose:p}),M.jsx(Z7,{trigger:M.jsx(l.zx,{startIcon:"imageSearch",children:"Replace"}),onMediaSelected:c}),M.jsx(l.zx,{onClick:h,startIcon:"delete",children:"Clear"})]})]}),m]})}function Gf(t,n){let{width:r,height:i,rect:o}=function(t,n){let[r,i]=Zj(t,n),o=Math.max(r/t.width,i/t.height),a=Math.round((t.width-r/o)/2),u=Math.round((t.height-i/o)/2);return{width:r,height:i,rect:{x:a,y:u,width:Math.round(r/o),height:Math.round(i/o)}}}(t,n),a=Boolean((null==n?void 0:n.width)||(null==n?void 0:n.height));return{url:ZN(t.url,o,r,i,a),alt:t.alt,origin:{id:t.id,url:t.url,width:t.width,height:t.height},width:r,height:i,edit:{background:"transparent",zoom:1,crop:{x:o.x,y:o.y}}}}function Gd(t){let{content:n,field:r,id:i,onContentChange:o,readOnly:a}=t,{onCropperDialogClose:u,onPageChange:s,onMediaSelected:l,isUpdating:f,page:p,thumbnail:h,allThumbnails:g,allContentViews:y,contentView:v,onClear:b}=function(t){var n;let{content:r,onContentChange:i,field:o}=t,[a,u]=(0,c.useState)(0),[s,l]=(0,c.useTransition)(),f=(n=o,(0,c.useMemo)(()=>{var t,r,i;return[{...null==(r=n.config)?void 0:r.constraint,name:ZE}].concat((null==(i=n.config)?void 0:i.thumbnails)??[])},[n])),d=f[a],p=r?function(t,n){var r,i;let{__TYPE__:o,thumbnails:a,...u}=n,s=null==(i=null==(r=t.config)?void 0:r.thumbnails)?void 0:i.map(({name:t})=>null==a?void 0:a[t]);return[u,...s??[]]}(o,r):void 0,h=null==p?void 0:p[a];return{onCropperDialogClose:function({option:t,croppedImages:n}){if(u(t),!r)return;let a=Object.entries(n).reduce((t,[n,r])=>Gi({field:o,content:t,thumbnail:n,croppedImage:r}),r);a!==r&&l(()=>i(a))},onPageChange:function(t){l(()=>u(t))},onMediaSelected:function(t){if(!d)return;let n=function(t,n,r,i){var o,a,u,s,c,l;if(!r){let f=null==(o=n.config)?void 0:o.thumbnails,d=f&&Object.fromEntries(f.map(t=>[t.name,Gf(i,t)]));return{__TYPE__:"ImageContent",...Gf(i,null==(a=n.config)?void 0:a.constraint),thumbnails:d}}if(t===ZE){let p=Gf(i,null==(u=n.config)?void 0:u.constraint);return p.url===r.url?r:{...r,...p}}let h=null==(c=null==(s=n.config)?void 0:s.thumbnails)?void 0:c.find(n=>n.name===t);if(!h)return r;let g=null==(l=r.thumbnails)?void 0:l[t],y=Gf(i,h);return y.url===(null==g?void 0:g.url)?r:{...r,thumbnails:(0,m.Q8)(r.thumbnails??{},(n,r)=>r===t?y:n)}}(d.name,o,r,t);n!==r&&l(()=>i(n))},isUpdating:s,page:a,thumbnail:d,allThumbnails:f,allContentViews:p,contentView:h,onClear:function(){null==u||u(0),i(void 0)}}}({field:r,content:n,onContentChange:o}),x=KR(r),_=g.map((t,r)=>{let i=null==y?void 0:y[r];return{thumbnail:t,contentView:i,labels:ZA(t,n,i)}}),S=h?ZA(h,n,v).filter(d.$):[];return M.jsx(Gl,{content:n,fieldLabel:x,imageLabel:S,initialOption:p,initialImages:_,readOnly:a,onMediaSelected:l,onCropperDialogClose:u,onClear:b,children:M.jsx(c.Suspense,{fallback:M.jsx("div",{style:{height:466}}),children:h&&n&&y?M.jsx(Gp,{allContentViews:y,content:n,contentView:v,id:i,onContentChange:o,onPageChange:s,page:p,readOnly:a,thumbnailName:h.name,isUpdating:f}):M.jsx(Gt,{onMediaSelected:l,readOnly:a,isUpdating:f})})})}function Gp(t){let{allContentViews:n,content:r,contentView:i,id:o,onContentChange:a,onPageChange:u,page:s,readOnly:c,thumbnailName:f,isUpdating:d}=t;return M.jsxs(l.aY,{children:[M.jsx(l.lr,{getItemSource:ZF,items:n,onPageChange:u,page:s,style:{height:400},children:t=>(null==t?void 0:t.url)&&M.jsx(l.d$,{src:ZP(t.url),alt:t.alt??void 0,isUpdating:d},`${f}_${t.url}`)}),M.jsx(Gn,{id:o,readOnly:c||!i,altText:(null==i?void 0:i.alt)??"",onValueChange(t){i&&a(function(t,n,r,i){let o=0===i.length?void 0:i;return t===ZE?{...n,alt:o}:{...n,thumbnails:{...n.thumbnails,[t]:{...r,alt:o}}}}(f,r,i,t))}})]})}function Gh(t){let{content:n,field:r,id:i,onContentChange:o,readOnly:a}=t;return M.jsxs(l.gN,{children:[M.jsx(l.fw,{name:"notes"}),M.jsx(l.Qy,{htmlFor:i,children:KR(r)}),M.jsx(l.JO,{children:M.jsx(l.Kx,{id:i,placeholder:KE(r),readOnly:a,value:(null==n?void 0:n.value)??"",onChange(t){var n;o((n=t,0===n.length?void 0:{__TYPE__:"FieldContent",type:"Text",value:n}))}})})]})}let Gm={unclassified:["unclassified","published"],archived:["unclassified","published"],release:["release","published"],published:["published"]};function Gg(t,n,r,i){return(0,y.W)(t,n,r,i,30)}function Gy(){let t=i7();t.searchDocuments||ot("searchDocuments");let{coreApiUrl:n,env:r}=t;return(0,h.QT)(Gx,[n,r]).results}function Gv(){let t=i7();t.searchDocuments||ot("searchDocuments");let{customTypesApiUrl:n,env:r,repository:i}=t;return(0,h.QT)(GS,[n,r,i??""]).map(t=>t.id)}h.Fs.registerFetcherConfig(Gg,{cacheCapacity:500,revalidationStrategy:{type:"never"}});let Gb=H6({results:H5(HK())});function Gx(t,n){return(0,p.WY)(`${t}/repository/tags`,{credentials:(0,p.xb)(n),okType:Gb})}let G_=H5(H6({id:HK(),label:HK()}));function GS(t,n,r){return(0,p.WY)(`${t}/customtypes`,{headers:{repository:r},credentials:(0,p.xb)(n),okType:G_})}function GT(t){let{onSelectDocument:n,fixedCustomTypes:r=new Set,fixedTags:i=new Set,...o}=t,a=i7(),[u,s]=(0,c.useState)(""),[d,p]=(0,c.useState)("");(0,f.Nr)(u,300,()=>p(u));let[h,m]=(0,c.useState)([]),[g,y]=(0,c.useState)(!1),[v,b]=(0,c.useState)([]),[x,_]=(0,c.useState)(!1),[S,T]=(0,c.useTransition)(),[w,O]=(0,c.useState)(!1);return(0,f.Nr)(S,100,()=>O(S)),M.jsx(l.Vq,{size:{height:727,width:656},hasClose:!1,...o,children:M.jsx(l.cZ,{children:M.jsxs(l.xu,{flexDirection:"column",height:"100%",children:[M.jsxs(l.xu,{padding:16,flexDirection:"column",gap:12,children:[M.jsx(l.yt,{value:u,onValueChange:s,placeholder:"Search a page",icon:"search"}),M.jsx(GI,{open:g,setOpen:y,selectedValues:new Set(h),fixedSelectedValues:i,onSelectedValuesChange:t=>m(Array.from(t)),label:"Tags",icon:"label",fetchFilters:Gy}),M.jsx(GI,{open:x,setOpen:_,selectedValues:new Set(v),fixedSelectedValues:r,onSelectedValuesChange:t=>b(Array.from(t)),label:"Type",icon:"description",fetchFilters:Gv}),M.jsx(l.xv,{variant:"smallBold",color:"grey11",children:"Link to a document"})]}),a.searchDocuments?M.jsx(l.SV,{renderError:Gw,children:M.jsx(c.Suspense,{children:M.jsx(GO,{searchTerm:d,tagsFilter:h,typesFilter:v,startTransition:T,onSelectDocument:n})})}):M.jsx(Gk,{message:"Slice Machine does not yet support mock data for linked documents in the simulator."}),M.jsx(l.FN,{anchor:M.jsx(l.xu,{position:"relative",width:"100%",justifyContent:"center",bottom:72}),loadingIndicator:!0,open:w,title:"Loading more results ...",seconds:1})]})})})}function Gw(){return M.jsx(l.xu,{height:"100%",flexDirection:"column",alignItems:"center",justifyContent:"center",children:M.jsx(l.Iq,{title:"Request failed",description:"An error occurred while fetching documents.",errorImageSrc:l.Os})})}function GO(t){let{searchTerm:n,tagsFilter:r,typesFilter:i,startTransition:o,onSelectDocument:a}=t,{documents:u,onHasReachedBottom:s}=function(t){var n,r;let{searchTerm:i,tagsFilter:o,typesFilter:a}=t,u=i7();u.searchDocuments||ot("searchDocuments");let{coreApiUrl:s,env:l,status:f}=u,[d,p]=(0,c.useState)(""),[m,g]=(0,c.useState)([]),[v,b]=(0,c.useState)(""),x=new URLSearchParams((0,y.f)([{name:"tags",values:o},{name:"customTypes",values:a},{name:"status",values:Gm[f]},{name:"term",values:[i]}])).toString(),_=(0,h.QT)(Gg,[s,x===v?d:"",l,x]);return x!==v?(b(x),p(""),g(_.results)):_.results.length>0&&(null==(n=m.at(-1))?void 0:n.id)!==(null==(r=_.results.at(-1))?void 0:r.id)&&g(t=>t.concat(_.results)),{documents:m,onHasReachedBottom:function(){_.cursor&&p(_.cursor)},response:_}}({searchTerm:n,tagsFilter:r,typesFilter:i});return M.jsx(l.xr,{onScrollToBottom:()=>o(s),style:{height:"100%",gap:l.TV.space[16],padding:l.TV.space[16]},children:M.jsxs(l.xu,{flexDirection:"column",gap:12,children:[0===u.length&&M.jsx(Gk,{}),u.map(t=>{var n,r,i,o,u,s,c;let f=`/pages/${t.id}?version=${(null==(n=t.versions[0])?void 0:n.version_id)??""}`??0;return M.jsx(l.z4,{documentType:(null==(r=t.versions[0])?void 0:r.custom_type_label)??"",documentURL:f,description:null==(i=t.versions[0])?void 0:i.preview_summary,tags:(null==(o=t.versions[0])?void 0:o.tags)??[],title:t.title,previewImageUrl:null==(u=t.versions[0])?void 0:u.preview_image,onSelect:()=>a(t.id),status:null==(s=t.versions[0])?void 0:s.status},`${t.id}-${(null==(c=t.versions[0])?void 0:c.status)??""}`)})]})})}function Gk(t){let{message:n="There are no versions matching this request"}=t;return M.jsxs(l.xu,{justifyContent:"center",flexDirection:"column",alignItems:"center",gap:16,children:[M.jsx(l.xu,{height:56,width:56,backgroundColor:"purple12",alignItems:"center",justifyContent:"center",borderRadius:"100%",children:M.jsx(l.I5,{name:"close",size:"large",color:"purple10"})}),M.jsx(l.xu,{maxWidth:204,children:M.jsx(l.xv,{color:"grey11",align:"center",children:n})})]})}function GI(t){let{open:n,setOpen:r,onSelectedValuesChange:i,fixedSelectedValues:o,selectedValues:a,label:u,icon:s,fetchFilters:f}=t,d=(0,c.useContext)(h.U9);return M.jsx(l.SV,{renderError:()=>M.jsx(l.R0,{mode:"error",onErrorRetry:null==d?void 0:d.reset,open:n,setOpen:r,label:u,icon:s,selectedValues:a,values:new Set,fixedSelectedValues:o,onSelectedValuesChange:i}),children:M.jsx(c.Suspense,{fallback:M.jsx(l.R0,{mode:"loading",open:n,setOpen:r,label:u,icon:s,selectedValues:a,values:new Set,fixedSelectedValues:o,onSelectedValuesChange:i}),children:M.jsx(GM,{open:n,setOpen:r,label:u,icon:s,selectedValues:a,fixedSelectedValues:o,onSelectedValuesChange:i,fetchFilters:f})})})}function GM(t){let{open:n,setOpen:r,onSelectedValuesChange:i,fixedSelectedValues:o,selectedValues:a,label:u,icon:s,fetchFilters:c}=t,f=c();return M.jsx(l.R0,{open:n,setOpen:r,label:u,icon:s,selectedValues:a,values:new Set(f),fixedSelectedValues:o,onSelectedValuesChange:i})}function GC(t){let{hasLink:n,onUnlink:r,selectEnabled:i,selectedType:o,onValueChange:a,openInNewTab:u=!0,setOpenInNewTab:s}=t;return M.jsxs(M.Fragment,{children:[s&&"web"===o&&M.jsx(l.zx,{startIcon:u?"checkBox":"checkBoxOutlinedBlank",variant:"secondary",size:"small",onClick:()=>s(!u),children:"Open in new tab"}),M.jsxs(l.Ph,{value:o,variant:"secondary",size:"small",startIcon:function(t){if(t)switch(t){case"document":return"description";case"web":return"public";case"media":return"image"}}(o),disabled:!i,onValueChange:a,placeholder:"Choose link type",children:[M.jsx(l.Ql,{value:"web",icon:"public",children:"Link to web page"}),M.jsx(l.Ql,{value:"document",icon:"description",children:"Link to Prismic page"})]}),M.jsx(l.zx,{startIcon:"close",variant:"secondary",size:"small",disabled:!n,onClick:r})]})}let GR={DocumentLink:"document",ExternalLink:"web",FileLink:"media",ImageLink:"media"},GE={document:"DocumentLink",web:"ExternalLink",media:"FileLink"},GA=H6({id:HK(),title:HK()});function Gj(t,n,r){return(0,p.WY)(`${t}/documents/${r}`,{credentials:(0,p.xb)(n),okType:GA})}function GN(t){var n,r;let{content:i,field:o,id:a,onContentChange:u,readOnly:s}=t,[d,p]=(0,c.useState)(!1),[h,m]=(0,c.useState)(!1),[y,v]=(0,c.useState)(!1),{contentType:b,isUnsupportedField:x,fieldValue:_,errorBoundaryRef:S,onDocumentSelected:T,onError:w,...O}=function(t){var n,r;let{field:i,content:o,onContentChange:a}=t,u=o?"DocumentLink"===o.value.__TYPE__?o.value.id:"ExternalLink"===o.value.__TYPE__?o.value.url:o.value.name:"",[s,l]=(0,c.useState)(()=>{var t,n;return null!=(t=i.config)&&t.select?GE[null==(n=i.config)?void 0:n.select]:null==o?void 0:o.value.__TYPE__}),[d,p]=(0,c.useState)(()=>(null==o?void 0:o.value.__TYPE__)==="ExternalLink"?o.value.target:""),[h,m]=(0,c.useState)(!1),g=(0,c.useRef)(null);(0,f.pQ)(u,function(){var t;h&&(m(!1),null==(t=g.current)||t.reset())});let y=s?GR[s]:void 0,v=(null==o?void 0:o.value.__TYPE__)&&["FileLink","ImageLink"].includes(null==o?void 0:o.value.__TYPE__),b=(null==(n=i.config)?void 0:n.select)&&"media"===i.config.select;function x(t){if(!t)return a(void 0);switch(s){case"ExternalLink":return a({__TYPE__:"LinkContent",value:{__TYPE__:"ExternalLink",url:t,target:d}});case"DocumentLink":return a({__TYPE__:"LinkContent",value:{__TYPE__:"DocumentLink",id:t}});default:return a(void 0)}}function _(t){x(t)}return{contentType:s,selectType:y,isUnsupportedField:b||v,fieldValue:u,onValueChange:x,onTypeChange:function(t){l(GE[t]),x("")},placeholder:KE(i),isTypeSelectEnabled:!(null!=(r=i.config)&&r.select),onDocumentSelected:_,onError:function(){m(!0)},errorBoundaryRef:g,isTargetNewTab:"_blank"===d,updateWebLinkTarget:function(t){let n=t?"_blank":null;p(n),a({__TYPE__:"LinkContent",value:{__TYPE__:"ExternalLink",url:u,target:n}})}}}({content:i,field:o,onContentChange:u});if(x)return M.jsx(GF,{id:a,field:o,content:i});let k=(0,g.j)(_),I=(d||h)&&Boolean(k),C={id:a,contentType:b,onBlur:()=>p(!1),onFocus(){p(!0),"DocumentLink"===b&&v(!0)},readOnly:s||!b,textType:k?"link":"normal",value:_,...O};return M.jsxs(M.Fragment,{children:[M.jsx(l.J2,{onMouseOverChange:m,open:I,align:"start",sideOffset:-3,openDelay:100,closeDelay:200,focusOnEnter:!1,anchor:M.jsxs(l.gN,{onMouseOverChange:p,children:[M.jsx(l.fw,{name:"link"}),M.jsx(l.Qy,{htmlFor:a,children:KR(o)}),M.jsx(l.JO,{children:"DocumentLink"===b&&""!==_?M.jsx(c.Suspense,{fallback:M.jsx(GP,{...C,value:"..."}),children:M.jsx(l.SV,{ref:S,onError:w,renderError(){var t;return t=C,M.jsx(GP,{...t,textType:"link"})},children:M.jsx(GL,{...C,documentId:_,openDocumentListModal:()=>v(!0)})})}):M.jsx(GP,{...C})})]}),children:k&&M.jsx(l.oZ,{url:k})}),M.jsx(GT,{open:y,onOpenChange:v,onSelectDocument(t){v(!1),T(t)},fixedCustomTypes:new Set(null==(n=o.config)?void 0:n.customtypes),fixedTags:new Set(null==(r=o.config)?void 0:r.tags)})]})}function GP(t){let{id:n,onValueChange:r,placeholder:i,readOnly:o,value:a,textType:u,onFocus:s,onBlur:c,contentType:f,isTypeSelectEnabled:d,selectType:p,onTypeChange:h,isTargetNewTab:m,updateWebLinkTarget:g}=t;return M.jsx(l.oi,{id:n,onValueChange:r,placeholder:i,readOnly:o||"DocumentLink"===f,value:a,variant:u,onFocus:s,onBlur:c,cursor:"DocumentLink"===f?"pointer":"text",endAdornment:M.jsx(GC,{hasLink:Boolean(a),onUnlink:()=>r(""),selectEnabled:d,selectedType:p,onValueChange:h,openInNewTab:m,setOpenInNewTab:g})})}function GL(t){let{id:n,documentId:r,openDocumentListModal:i,onValueChange:o,isTypeSelectEnabled:a,selectType:u,onTypeChange:s}=t,c=function(t){let n=i7();n.searchDocuments||ot("searchDocuments");let{coreApiUrl:r,env:i}=n;return(0,h.QT)(Gj,[r,i,t]).title}(r);return M.jsx(l.oi,{id:n,readOnly:!0,value:c,variant:"link",onFocus:i,cursor:"pointer",endAdornment:M.jsx(GC,{hasLink:!0,onUnlink:()=>o(""),selectEnabled:a,selectedType:u,onValueChange:s})})}function GF({id:t,field:n,content:r}){let[i,o]=(0,c.useState)(!1),[a,u]=(0,c.useState)(!1);(0,f.Nr)(i,300,()=>u(i));let s=(null==r?void 0:r.value.__TYPE__)==="DocumentLink"?null==r?void 0:r.value.id:null==r?void 0:r.value.url;return M.jsxs(l.gN,{onMouseOverChange:o,children:[M.jsx(l.u,{title:"Coming soon",content:"This feature is currently in development and will be available soon. Stay tuned for updates!",side:"bottom",open:a,children:M.jsx(GD,{})}),M.jsx(l.fw,{disabled:!0,name:"link"}),M.jsx(l.Qy,{htmlFor:t,children:KR(n)}),M.jsx(l.JO,{disabled:!0,children:M.jsx(l.Kx,{id:t,onChange(){},placeholder:KE(n),readOnly:!0,value:s})})]})}let GD=(0,c.forwardRef)(function(t,n){return M.jsx("div",{ref:n,style:{width:50,position:"absolute",top:40,left:30}})}),GW=({content:t,field:n,id:r,onContentChange:i,readOnly:o})=>{var a,u;let s=Number(null==t?void 0:t.value),c=Number.isFinite(s)?s:void 0;return M.jsxs(l.gN,{children:[M.jsx(l.fw,{name:"pin"}),M.jsx(l.Qy,{htmlFor:r,children:KR(n)}),M.jsx(l.JO,{children:M.jsx(l.Y2,{id:r,value:c,min:null==(a=n.config)?void 0:a.min,max:null==(u=n.config)?void 0:u.max,placeholder:KE(n),readOnly:o,onValueChange(t){var n;return i((n=t,void 0===n?void 0:{__TYPE__:"FieldContent",type:"Number",value:String(n)}))}})})]})};function GU(t){this.content=t}GU.prototype={constructor:GU,find:function(t){for(var n=0;n<this.content.length;n+=2)if(this.content[n]===t)return n;return -1},get:function(t){var n=this.find(t);return -1==n?void 0:this.content[n+1]},update:function(t,n,r){var i=r&&r!=t?this.remove(r):this,o=i.find(t),a=i.content.slice();return -1==o?a.push(r||t,n):(a[o+1]=n,r&&(a[o]=r)),new GU(a)},remove:function(t){var n=this.find(t);if(-1==n)return this;var r=this.content.slice();return r.splice(n,2),new GU(r)},addToStart:function(t,n){return new GU([t,n].concat(this.remove(t).content))},addToEnd:function(t,n){var r=this.remove(t).content.slice();return r.push(t,n),new GU(r)},addBefore:function(t,n,r){var i=this.remove(n),o=i.content.slice(),a=i.find(t);return o.splice(-1==a?o.length:a,0,n,r),new GU(o)},forEach:function(t){for(var n=0;n<this.content.length;n+=2)t(this.content[n],this.content[n+1])},prepend:function(t){return(t=GU.from(t)).size?new GU(t.content.concat(this.subtract(t).content)):this},append:function(t){return(t=GU.from(t)).size?new GU(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var n=this;t=GU.from(t);for(var r=0;r<t.content.length;r+=2)n=n.remove(t.content[r]);return n},toObject:function(){var t={};return this.forEach(function(n,r){t[n]=r}),t},get size(){return this.content.length>>1}},GU.from=function(t){if(t instanceof GU)return t;var n=[];if(t)for(var r in t)n.push(r,t[r]);return new GU(n)};class Gz{constructor(t,n){if(this.content=t,this.size=n||0,null==n)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&&!1!==r(s,i+u,o||null,a)&&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+="function"==typeof i?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 Gz(i,this.size+t.size)}cut(t,n=this.size){if(0==t&&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=u.isText?u.cut(Math.max(0,t-a),Math.min(u.text.length,n-a)):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 Gz(r,i)}cutByIndex(t,n){return t==n?Gz.empty:0==t&&n==this.content.length?this:new Gz(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 Gz(i,o)}addToStart(t){return new Gz([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new Gz(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 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 function t(n,r,i){for(let o=0;;o++){if(o==n.childCount||o==r.childCount)return n.childCount==r.childCount?null:i;let a=n.child(o),u=r.child(o);if(a==u){i+=a.nodeSize;continue}if(!a.sameMarkup(u))return i;if(a.isText&&a.text!=u.text){for(let s=0;a.text[s]==u.text[s];s++)i++;return i}if(a.content.size||u.content.size){let c=t(a.content,u.content,i+1);if(null!=c)return c}i+=a.nodeSize}}(this,t,n)}findDiffEnd(t,n=this.size,r=t.size){return function t(n,r,i,o){for(let a=n.childCount,u=r.childCount;;){if(0==a||0==u)return a==u?null:{a:i,b:o};let s=n.child(--a),c=r.child(--u),l=s.nodeSize;if(s==c){i-=l,o-=l;continue}if(!s.sameMarkup(c))return{a:i,b:o};if(s.isText&&s.text!=c.text){let f=0,d=Math.min(s.text.length,c.text.length);for(;f<d&&s.text[s.text.length-f-1]==c.text[c.text.length-f-1];)f++,i--,o--;return{a:i,b:o}}if(s.content.size||c.content.size){let p=t(s.content,c.content,i-1,o-1);if(p)return p}i-=l,o-=l}}(this,t,n,r)}findIndex(t,n=-1){if(0==t)return Gq(0,t);if(t==this.size)return Gq(this.content.length,t);if(t>this.size||t<0)throw RangeError(`Position ${t} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=i+this.child(r).nodeSize;if(o>=t)return o==t||n>0?Gq(r+1,o):Gq(r,i);i=o}}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 Gz.empty;if(!Array.isArray(n))throw RangeError("Invalid input for Fragment.fromJSON");return new Gz(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return Gz.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 Gz(n||t,r)}static from(t){if(!t)return Gz.empty;if(t instanceof Gz)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new Gz([t],t.nodeSize);throw RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Gz.empty=new Gz([],0);let GB={index:0,offset:0};function Gq(t,n){return GB.index=t,GB.offset=n,GB}function GV(t,n){if(t===n)return!0;if(!(t&&"object"==typeof t)||!(n&&"object"==typeof n))return!1;let r=Array.isArray(t);if(Array.isArray(n)!=r)return!1;if(r){if(t.length!=n.length)return!1;for(let i=0;i<t.length;i++)if(!GV(t[i],n[i]))return!1}else{for(let o in t)if(!(o in n)||!GV(t[o],n[o]))return!1;for(let a in n)if(!(a in t))return!1}return!0}let G$=class t{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&&GV(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 RangeError("Invalid input for Mark.fromJSON");let r=t.marks[n.type];if(!r)throw 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(n){if(!n||Array.isArray(n)&&0==n.length)return t.none;if(n instanceof t)return[n];let r=n.slice();return r.sort((t,n)=>t.type.rank-n.type.rank),r}};G$.none=[];class GK extends Error{}class GH{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=function t(n,r,i,o){let{index:a,offset:u}=n.findIndex(r),s=n.maybeChild(a);if(u==r||s.isText)return o&&!o.canReplace(a,a,i)?null:n.cut(0,r).append(i).append(n.cut(r));let c=t(s.content,r-u-1,i);return c&&n.replaceChild(a,s.copy(c))}(this.content,t+this.openStart,n);return r&&new GH(r,this.openStart,this.openEnd)}removeBetween(t,n){return new GH(function t(n,r,i){let{index:o,offset:a}=n.findIndex(r),u=n.maybeChild(o),{index:s,offset:c}=n.findIndex(i);if(a==r||u.isText){if(c!=i&&!n.child(s).isText)throw RangeError("Removing non-flat range");return n.cut(0,r).append(n.cut(i))}if(o!=s)throw RangeError("Removing non-flat range");return n.replaceChild(o,u.copy(t(u.content,r-a-1,i-a-1)))}(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 GH.empty;let r=n.openStart||0,i=n.openEnd||0;if("number"!=typeof r||"number"!=typeof i)throw RangeError("Invalid input for Slice.fromJSON");return new GH(Gz.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 a=t.lastChild;a&&!a.isLeaf&&(n||!a.type.spec.isolating);a=a.lastChild)i++;return new GH(t,r,i)}}function GZ(t,n){if(!n.type.compatibleContent(t.type))throw new GK("Cannot join "+n.type.name+" onto "+t.type.name)}function GG(t,n,r){let i=t.node(r);return GZ(i,n.node(r)),i}function GJ(t,n){let r=n.length-1;r>=0&&t.isText&&t.sameMarkup(n[r])?n[r]=t.withText(n[r].text+t.text):n.push(t)}function GY(t,n,r,i){let o=(n||t).node(r),a=0,u=n?n.index(r):o.childCount;t&&(a=t.index(r),t.depth>r?a++:t.textOffset&&(GJ(t.nodeAfter,i),a++));for(let s=a;s<u;s++)GJ(o.child(s),i);n&&n.depth==r&&n.textOffset&&GJ(n.nodeBefore,i)}function GQ(t,n){return t.type.checkContent(n),t.copy(n)}function GX(t,n,r){let i=[];return GY(null,t,r,i),t.depth>r&&GJ(GQ(GG(t,n,r+1),GX(t,n,r+1)),i),GY(n,null,r,i),new Gz(i)}GH.empty=new GH(Gz.empty,0,0);class G0{constructor(t,n,r){this.pos=t,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(t){return null==t?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[3*this.resolveDepth(t)]}index(t){return this.path[3*this.resolveDepth(t)+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)}start(t){return 0==(t=this.resolveDepth(t))?0:this.path[3*t-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(!(t=this.resolveDepth(t)))throw RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]}after(t){if(!(t=this.resolveDepth(t)))throw RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].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):0==t?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let r=this.path[3*n],i=0==n?0:this.path[3*n-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(0==t.content.size)return G$.none;if(this.textOffset)return t.child(n).marks;let r=t.maybeChild(n-1),i=t.maybeChild(n);if(!r){let o=r;r=i,i=o}let a=r.marks;for(var u=0;u<a.length;u++)!1!==a[u].type.spec.inclusive||i&&a[u].isInSet(i.marks)||(a=a[u--].removeFromSet(a));return a}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++)!1!==r[o].type.spec.inclusive||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 G4(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 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)).isText)break;o=c-1,i+=s+1}return new G0(n,r,o)}static resolveCached(t,n){for(let r=0;r<G1.length;r++){let i=G1[r];if(i.pos==n&&i.doc==t)return i}let o=G1[G2]=G0.resolve(t,n);return G2=(G2+1)%G3,o}}let G1=[],G2=0,G3=12;class G4{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)}}let G5=Object.create(null),G6=class t{constructor(t,n,r,i=G$.none){this.type=t,this.attrs=n,this.marks=i,this.content=r||Gz.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&&GV(this.attrs,n||t.defaultAttrs||G5)&&G$.sameSet(this.marks,r||G$.none)}copy(n=null){return n==this.content?this:new t(this.type,this.attrs,n,this.marks)}mark(n){return n==this.marks?this:new t(this.type,this.attrs,this.content,n)}cut(t,n=this.content.size){return 0==t&&n==this.content.size?this:this.copy(this.content.cut(t,n))}slice(t,n=this.content.size,r=!1){if(t==n)return GH.empty;let i=this.resolve(t),o=this.resolve(n),a=r?0:i.sharedDepth(n),u=i.start(a),s=i.node(a).content.cut(i.pos-u,o.pos-u);return new GH(s,i.depth-a,o.depth-a)}replace(t,n,r){return function(t,n,r){if(r.openStart>t.depth)throw new GK("Inserted content deeper than insertion position");if(t.depth-r.openStart!=n.depth-r.openEnd)throw new GK("Inconsistent open depths");return function t(n,r,i,o){let a=n.index(o),u=n.node(o);if(a==r.index(o)&&o<n.depth-i.openStart){let s=t(n,r,i,o+1);return u.copy(u.content.replaceChild(a,s))}if(!i.content.size)return GQ(u,GX(n,r,o));if(i.openStart||i.openEnd||n.depth!=o||r.depth!=o){let{start:c,end:l}=function(t,n){let r=n.depth-t.openStart,i=n.node(r).copy(t.content);for(let o=r-1;o>=0;o--)i=n.node(o).copy(Gz.from(i));return{start:i.resolveNoCache(t.openStart+r),end:i.resolveNoCache(i.content.size-t.openEnd-r)}}(i,n);return GQ(u,function t(n,r,i,o,a){let u=n.depth>a&&GG(n,r,a+1),s=o.depth>a&&GG(i,o,a+1),c=[];return GY(null,n,a,c),u&&s&&r.index(a)==i.index(a)?(GZ(u,s),GJ(GQ(u,t(n,r,i,o,a+1)),c)):(u&&GJ(GQ(u,GX(n,r,a+1)),c),GY(r,i,a,c),s&&GJ(GQ(s,GX(i,o,a+1)),c)),GY(o,null,a,c),new Gz(c)}(n,c,l,r,o))}{let f=n.parent,d=f.content;return GQ(f,d.cut(0,n.parentOffset).append(i.content).append(d.cut(r.parentOffset)))}}(t,n,r,0)}(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)))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(0==t)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 G0.resolveCached(this,t)}resolveNoCache(t){return G0.resolve(this,t)}rangeHasMark(t,n,r){let i=!1;return n>t&&this.nodesBetween(t,n,t=>(r.isInSet(t.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()+")"),G8(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,r=Gz.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}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=G$.none;for(let n=0;n<this.marks.length;n++)t=this.marks[n].addToSet(t);if(!G$.sameSet(t,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.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(t=>t.toJSON())),t}static fromJSON(t,n){if(!n)throw RangeError("Invalid input for Node.fromJSON");let r=null;if(n.marks){if(!Array.isArray(n.marks))throw RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(t.markFromJSON)}if("text"==n.type){if("string"!=typeof n.text)throw RangeError("Invalid text node in JSON");return t.text(n.text,r)}let i=Gz.fromJSON(t,n.content);return t.nodeType(n.type).create(n.attrs,i,r)}};G6.prototype.text=void 0;class G9 extends G6{constructor(t,n,r,i){if(super(t,n,null,i),!r)throw RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):G8(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 G9(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new G9(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return 0==t&&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 G8(t,n){for(let r=t.length-1;r>=0;r--)n=t[r].type.name+"("+n+")";return n}class G7{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){var r;let i=new Je(t,n);if(null==i.next)return G7.empty;let o=Jt(i);i.next&&i.err("Unexpected trailing text");let a,u=(r=function(t){let n=[[]];return o(a(t,0),r()),n;function r(){return n.push([])-1}function i(t,r,i){let o={term:i,to:r};return n[t].push(o),o}function o(t,n){t.forEach(t=>t.to=n)}function a(t,n){if("choice"==t.type)return t.exprs.reduce((t,r)=>t.concat(a(r,n)),[]);if("seq"==t.type)for(let u=0;;u++){let s=a(t.exprs[u],n);if(u==t.exprs.length-1)return s;o(s,n=r())}else if("star"==t.type){let c=r();return i(n,c),o(a(t.expr,c),c),[i(c)]}else if("plus"==t.type){let l=r();return o(a(t.expr,n),l),o(a(t.expr,l),l),[i(l)]}else{if("opt"==t.type)return[i(n)].concat(a(t.expr,n));if("range"==t.type){let f=n;for(let d=0;d<t.min;d++){let p=r();o(a(t.expr,f),p),f=p}if(-1==t.max)o(a(t.expr,f),f);else for(let h=t.min;h<t.max;h++){let m=r();i(f,m),o(a(t.expr,f),m),f=m}return[i(f)]}if("name"==t.type)return[i(n,void 0,t.value)];throw Error("Unknown expr type")}}}(o),a=Object.create(null),function t(n){let i=[];n.forEach(t=>{r[t].forEach(({term:t,to:n})=>{if(!t)return;let o;for(let a=0;a<i.length;a++)i[a][0]==t&&(o=i[a][1]);Js(r,n).forEach(n=>{o||i.push([t,o=[]]),-1==o.indexOf(n)&&o.push(n)})})});let o=a[n.join(",")]=new G7(n.indexOf(r.length-1)>-1);for(let u=0;u<i.length;u++){let s=i[u][1].sort(Ju);o.next.push({type:i[u][0],next:a[s.join(",")]||t(s)})}return o}(Js(r,0)));return function(t,n){for(let r=0,i=[t];r<i.length;r++){let o=i[r],a=!o.validEnd,u=[];for(let s=0;s<o.next.length;s++){let{type:c,next:l}=o.next[s];u.push(c.name),a&&!(c.isText||c.hasRequiredAttrs())&&(a=!1),-1==i.indexOf(l)&&i.push(l)}a&&n.err("Only non-generatable nodes ("+u.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(u,i),u}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 0!=this.next.length&&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];return function o(a,u){let s=a.matchFragment(t,r);if(s&&(!n||s.validEnd))return Gz.from(u.map(t=>t.createAndFill()));for(let c=0;c<a.next.length;c++){let{type:l,next:f}=a.next[c];if(!(l.isText||l.hasRequiredAttrs())&&-1==i.indexOf(f)){i.push(f);let d=o(f,u.concat(l));if(d)return d}}return null}(this,[])}findWrapping(t){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==t)return this.wrapCache[n+1];let r=this.computeWrapping(t);return this.wrapCache.push(t,r),r}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 s=0;s<o.next.length;s++){let{type:c,next:l}=o.next[s];c.isLeaf||c.hasRequiredAttrs()||c.name in n||i.type&&!l.validEnd||(r.push({match:c.contentMatch,type:c,via:i}),n[c.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];return function n(r){t.push(r);for(let i=0;i<r.next.length;i++)-1==t.indexOf(r.next[i].next)&&n(r.next[i].next)}(this),t.map((n,r)=>{let i=r+(n.validEnd?"*":" ")+" ";for(let o=0;o<n.next.length;o++)i+=(o?", ":"")+n.next[o].type.name+"->"+t.indexOf(n.next[o].next);return i}).join(`
3
- `)}}G7.empty=new G7(!0);class Je{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 SyntaxError(t+" (in content expression '"+this.string+"')")}}function Jt(t){let n=[];do n.push(Jn(t));while(t.eat("|"));return 1==n.length?n[0]:{type:"choice",exprs:n}}function Jn(t){let n=[];do n.push(Jr(t));while(t.next&&")"!=t.next&&"|"!=t.next);return 1==n.length?n[0]:{type:"seq",exprs:n}}function Jr(t){let n=Ja(t);for(;;)if(t.eat("+"))n={type:"plus",expr:n};else if(t.eat("*"))n={type:"star",expr:n};else if(t.eat("?"))n={type:"opt",expr:n};else if(t.eat("{"))n=Jo(t,n);else break;return n}function Ji(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let n=Number(t.next);return t.pos++,n}function Jo(t,n){let r=Ji(t),i=r;return t.eat(",")&&(i="}"!=t.next?Ji(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:r,max:i,expr:n}}function Ja(t){if(t.eat("(")){let n=Jt(t);return t.eat(")")||t.err("Missing closing paren"),n}if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let r=(function(t,n){let r=t.nodeTypes,i=r[n];if(i)return[i];let o=[];for(let a in r){let u=r[a];u.groups.indexOf(n)>-1&&o.push(u)}return 0==o.length&&t.err("No node type or group '"+n+"' found"),o})(t,t.next).map(n=>(null==t.inline?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,1==r.length?r[0]:{type:"choice",exprs:r}}}function Ju(t,n){return n-t}function Js(t,n){let r=[];return function n(i){let o=t[i];if(1==o.length&&!o[0].term)return n(o[0].to);r.push(i);for(let a=0;a<o.length;a++){let{term:u,to:s}=o[a];u||-1!=r.indexOf(s)||n(s)}}(n),r.sort(Ju)}function Jc(t){let n=Object.create(null);for(let r in t){let i=t[r];if(!i.hasDefault)return null;n[r]=i.default}return n}function Jl(t,n){let r=Object.create(null);for(let i in t){let o=n&&n[i];if(void 0===o){let a=t[i];if(a.hasDefault)o=a.default;else throw RangeError("No value supplied for attribute "+i)}r[i]=o}return r}function Jf(t){let n=Object.create(null);if(t)for(let r in t)n[r]=new Jp(t[r]);return n}let Jd=class t{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=Jf(r.attrs),this.defaultAttrs=Jc(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||"text"==t),this.isText="text"==t}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==G7.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:Jl(this.attrs,t)}create(t=null,n,r){if(this.isText)throw Error("NodeType.create can't construct text nodes");return new G6(this,this.computeAttrs(t),Gz.from(n),G$.setFrom(r))}createChecked(t=null,n,r){return n=Gz.from(n),this.checkContent(n),new G6(this,this.computeAttrs(t),n,G$.setFrom(r))}createAndFill(t=null,n,r){if(t=this.computeAttrs(t),(n=Gz.from(n)).size){let i=this.contentMatch.fillBefore(n);if(!i)return null;n=i.append(n)}let o=this.contentMatch.matchFragment(n),a=o&&o.fillBefore(Gz.empty,!0);return a?new G6(this,t,n.append(a),G$.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 RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}allowsMarkType(t){return null==this.markSet||this.markSet.indexOf(t)>-1}allowsMarks(t){if(null==this.markSet)return!0;for(let n=0;n<t.length;n++)if(!this.allowsMarkType(t[n].type))return!1;return!0}allowedMarks(t){if(null==this.markSet)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:G$.none:t}static compile(n,r){let i=Object.create(null);n.forEach((n,o)=>i[n]=new t(n,r,o));let o=r.spec.topNode||"doc";if(!i[o])throw RangeError("Schema is missing its top node type ('"+o+"')");if(!i.text)throw RangeError("Every schema needs a 'text' type");for(let a in i.text.attrs)throw RangeError("The text node type should not have attributes");return i}};class Jp{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class Jh{constructor(t,n,r,i){this.name=t,this.rank=n,this.schema=r,this.spec=i,this.attrs=Jf(i.attrs),this.excluded=null;let o=Jc(this.attrs);this.instance=o?new G$(this,o):null}create(t=null){return!t&&this.instance?this.instance:new G$(this,Jl(this.attrs,t))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,o)=>r[t]=new Jh(t,i++,n,o)),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 Jm{constructor(t){this.cached=Object.create(null);let n=this.spec={};for(let r in t)n[r]=t[r];n.nodes=GU.from(t.nodes),n.marks=GU.from(t.marks||{}),this.nodes=Jd.compile(this.spec.nodes,this),this.marks=Jh.compile(this.spec.marks,this);let i=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw RangeError(o+" can not be both a node and a mark");let a=this.nodes[o],u=a.spec.content||"",s=a.spec.marks;a.contentMatch=i[u]||(i[u]=G7.parse(u,this.nodes)),a.inlineContent=a.contentMatch.inlineContent,a.markSet="_"==s?null:s?Jg(this,s.split(" ")):""!=s&&a.inlineContent?null:[]}for(let c in this.marks){let l=this.marks[c],f=l.spec.excludes;l.excluded=null==f?[l]:""==f?[]:Jg(this,f.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("string"==typeof t)t=this.nodeType(t);else if(t instanceof Jd){if(t.schema!=this)throw RangeError("Node type from different schema used ("+t.name+")")}else throw RangeError("Invalid node type: "+t);return t.createChecked(n,r,i)}text(t,n){let r=this.nodes.text;return new G9(r,r.defaultAttrs,t,G$.setFrom(n))}mark(t,n){return"string"==typeof t&&(t=this.marks[t]),t.create(n)}nodeFromJSON(t){return G6.fromJSON(this,t)}markFromJSON(t){return G$.fromJSON(this,t)}nodeType(t){let n=this.nodes[t];if(!n)throw RangeError("Unknown node type: "+t);return n}}function Jg(t,n){let r=[];for(let i=0;i<n.length;i++){let o=n[i],a=t.marks[o],u=a;if(a)r.push(a);else for(let s in t.marks){let c=t.marks[s];("_"==o||c.spec.group&&c.spec.group.split(" ").indexOf(o)>-1)&&r.push(u=c)}if(!u)throw SyntaxError("Unknown mark type: '"+n[i]+"'")}return r}class Jy{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[],n.forEach(t=>{t.tag?this.tags.push(t):t.style&&this.styles.push(t)}),this.normalizeLists=!this.tags.some(n=>{if(!/^(ul|ol)\b/.test(n.tag)||!n.node)return!1;let r=t.nodes[n.node];return r.contentMatch.matchType(r)})}parse(t,n={}){let r=new JT(this,n,!1);return r.addAll(t,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new JT(this,n,!0);return r.addAll(t,n.from,n.to),GH.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(Jw(t,o.tag)&&(void 0===o.namespace||t.namespaceURI==o.namespace)&&(!o.context||n.matchesContext(o.context))){if(o.getAttrs){let a=o.getAttrs(t);if(!1===a)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(!(0!=u.indexOf(t)||a.context&&!r.matchesContext(a.context)||u.length>t.length&&(61!=u.charCodeAt(t.length)||u.slice(t.length+1)!=n))){if(a.getAttrs){let s=a.getAttrs(n);if(!1===s)continue;a.attrs=s||void 0}return a}}}static schemaRules(t){let n=[];function r(t){let r=null==t.priority?50:t.priority,i=0;for(;i<n.length;i++){let o=n[i];if((null==o.priority?50:o.priority)<r)break}n.splice(i,0,t)}for(let i in t.marks){let o=t.marks[i].spec.parseDOM;o&&o.forEach(t=>{r(t=JO(t)),t.mark||t.ignore||t.clearMark||(t.mark=i)})}for(let a in t.nodes){let u=t.nodes[a].spec.parseDOM;u&&u.forEach(t=>{r(t=JO(t)),t.node||t.ignore||t.mark||(t.node=a)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new Jy(t,Jy.schemaRules(t)))}}let Jv={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},Jb={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Jx={ol:!0,ul:!0};function J_(t,n,r){return null!=n?(n?1:0)|("full"===n?2:0):t&&"pre"==t.whitespace?3:-5&r}class JS{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=G$.none,this.stashMarks=[],this.match=a||(4&u?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(Gz.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(!(1&this.options)){let n=this.content[this.content.length-1],r;n&&n.isText&&(r=/[ \t\r\n\u000c]+$/.exec(n.text))&&(n.text.length==r[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-r[0].length)))}let i=Gz.from(this.content);return!t&&this.match&&(i=i.append(this.match.fillBefore(Gz.empty,!0))),this.type?this.type.create(this.attrs,i,this.marks):i}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):Jk(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&&!Jv.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class JT{constructor(t,n,r){this.parser=t,this.options=n,this.isOpen=r,this.open=0;let i=n.topNode,o,a=J_(null,n.preserveWhitespace,0)|(r?4:0);o=i?new JS(i.type,i.attrs,G$.none,G$.none,!0,n.topMatch||i.type.contentMatch,a):r?new JS(null,null,G$.none,G$.none,!0,null,a):new JS(t.schema.topNodeType,null,G$.none,G$.none,!0,null,a),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t){if(3==t.nodeType)this.addTextNode(t);else if(1==t.nodeType){let n=t.getAttribute("style");if(n){let r=this.readStyles(function(t){let n=/\s*([\w-]+)\s*:\s*([^;]+)/g,r,i=[];for(;r=n.exec(t);)i.push(r[1],r[2].trim());return i}(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 s=0;s<i.length;s++)this.addPendingMark(i[s]);this.addElement(t);for(let c=0;c<i.length;c++)this.removePendingMark(i[c],a);for(let l=0;l<o.length;l++)this.addPendingMark(o[l])}else this.addElement(t)}}addTextNode(t){let n=t.nodeValue,r=this.top;if(2&r.options||r.inlineContext(t)||/[^ \t\r\n\u000c]/.test(n)){if(1&r.options)n=2&r.options?n.replace(/\r\n?/g,`
4
- `):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&&"BR"==o.nodeName||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;Jx.hasOwnProperty(r)&&this.parser.normalizeLists&&function(t){for(let n=t.firstChild,r=null;n;n=n.nextSibling){let i=1==n.nodeType?n.nodeName.toLowerCase():null;i&&Jx.hasOwnProperty(i)&&r?(r.appendChild(n),n=r):"li"==i?r=n:i&&(r=null)}}(t);let o=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(i=this.parser.matchTag(t,this,n));if(o?o.ignore:Jb.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(Jv.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,!1===o.consuming?i:void 0)}leafFallback(t){"BR"==t.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(`
5
- `))}ignoreFallback(t){"BR"!=t.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))}readStyles(t){let n=G$.none,r=G$.none;e:for(let i=0;i<t.length;i+=2)for(let o;;){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(t=>{a.clearMark(t)&&(r=t.addToSet(r))}):n=this.parser.schema.marks[a.mark].create(a.attrs).addToSet(n),!1===a.consuming)o=a;else break}return[n,r]}addElementByRule(t,n,r){let i,o,a;n.node?(o=this.parser.schema.nodes[n.node]).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(t=>this.insertNode(t));else{let s=t;"string"==typeof n.contentElement?s=t.querySelector(n.contentElement):"function"==typeof n.contentElement?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=null==r?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 u=0;u<n.length;u++)this.enterInner(n[u],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 r=this.top;r.applyPending(t.type),r.match&&(r.match=r.match.matchType(t.type));let i=r.activeMarks;for(let o=0;o<t.marks.length;o++)(!r.type||r.type.allowsMarkType(t.marks[o].type))&&(i=t.marks[o].addToSet(i));return r.content.push(t.mark(i)),!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=J_(t,i,o.options);4&o.options&&0==o.content.length&&(a|=4),this.nodes.push(new JS(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++)null==this.find[n].pos&&1==t.nodeType&&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++)null==this.find[i].pos&&1==t.nodeType&&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=(t,u)=>{for(;t>=0;t--){let s=n[t];if(""==s){if(t==n.length-1||0==t)continue;for(;u>=o;u--)if(a(t-1,u))return!0;return!1}{let c=u>0||0==u&&i?this.nodes[u].type:r&&u>=o?r.node(u-o).type:null;if(!c||c.name!=s&&-1==c.groups.indexOf(s))return!1;u--}}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 i in this.parser.schema.nodes){let o=this.parser.schema.nodes[i];if(o.isTextblock&&o.defaultAttrs)return o}}addPendingMark(t){let n=function(t,n){for(let r=0;r<n.length;r++)if(t.eq(n[r]))return n[r]}(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 o=i.popFromStashMark(t);o&&i.type&&i.type.allowsMarkType(o.type)&&(i.activeMarks=o.addToSet(i.activeMarks))}if(i==n)break}}}function Jw(t,n){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,n)}function JO(t){let n={};for(let r in t)n[r]=t[r];return n}function Jk(t,n){let r=n.schema.nodes;for(let i in r){let o=r[i];if(!o.allowsMarkType(t))continue;let a=[],u=t=>{a.push(t);for(let r=0;r<t.edgeCount;r++){let{type:i,next:o}=t.edge(r);if(i==n||0>a.indexOf(o)&&u(o))return!0}};if(u(o.contentMatch))return!0}}class JI{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},r){r||(r=JC(n).createDocumentFragment());let i=r,o=[];return t.forEach(t=>{if(o.length||t.marks.length){let r=0,a=0;for(;r<o.length&&a<t.marks.length;){let u=t.marks[a];if(!this.marks[u.type.name]){a++;continue}if(!u.eq(o[r][0])||!1===u.type.spec.spanning)break;r++,a++}for(;r<o.length;)i=o.pop()[1];for(;a<t.marks.length;){let s=t.marks[a++],c=this.serializeMark(s,t.isInline,n);c&&(o.push([s,i]),i.appendChild(c.dom),i=c.contentDOM||c.dom)}}i.appendChild(this.serializeNodeInner(t,n))}),r}serializeNodeInner(t,n){let{dom:r,contentDOM:i}=JI.renderSpec(JC(n),this.nodes[t.type.name](t));if(i){if(t.isLeaf)throw 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&&JI.renderSpec(JC(r),i(t,n))}static renderSpec(t,n,r=null){if("string"==typeof n)return{dom:t.createTextNode(n)};if(null!=n.nodeType)return{dom:n};if(n.dom&&null!=n.dom.nodeType)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&&"object"==typeof s&&null==s.nodeType&&!Array.isArray(s)){for(let l in c=2,s)if(null!=s[l]){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 d=c;d<n.length;d++){let p=n[d];if(0===p){if(d<n.length-1||d>c)throw RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u}}{let{dom:h,contentDOM:m}=JI.renderSpec(t,p,r);if(u.appendChild(h),m){if(a)throw RangeError("Multiple content holes");a=m}}}return{dom:u,contentDOM:a}}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new JI(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=JM(t.nodes);return n.text||(n.text=t=>t.text),n}static marksFromSchema(t){return JM(t.marks)}}function JM(t){let n={};for(let r in t){let i=t[r].spec.toDOM;i&&(n[r]=i)}return n}function JC(t){return t.document||window.document}function JR(t,n){return t+65536*n}function JE(t){return 65535&t}class JA{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class Jj{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&Jj.empty)return Jj.empty}recover(t){var n;let r=0,i=JE(t);if(!this.inverted)for(let o=0;o<i;o++)r+=this.ranges[3*o+2]-this.ranges[3*o+1];return this.ranges[3*i]+r+(t-(65535&t))/65536}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:JR(u/3,t-s),m=t==s?2:t==f?1:4;return(n<0?t!=s:t!=f)&&(m|=8),new JA(p,m,h)}i+=l-c}return r?t+i:new JA(t+i,0,null)}touches(t,n){let r=0,i=JE(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];if(t<=s+c&&u==3*i)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 Jj(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return 0==t?Jj.empty:new Jj(t<0?[0,-t,0]:[0,0,t])}}Jj.empty=new Jj([]);class JN{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 JN(this.maps,this.mirror,t,n)}copy(){return new JN(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(t,n){this.to=this.maps.push(t),null!=n&&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],null!=i&&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(),null!=i&&i>n?r-i-1:void 0)}}invert(){let t=new JN;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].mapResult(t,n);if(null!=a.recover){let u=this.getMirror(o);if(null!=u&&u>o&&u<this.to){o=u,t=this.maps[u].recover(a.recover);continue}}i|=a.delInfo,t=a.pos}return r?t:new JA(t,i,null)}}let JP=Object.create(null);class JL{getMap(){return Jj.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw RangeError("Invalid input for Step.fromJSON");let r=JP[n.stepType];if(!r)throw RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in JP)throw RangeError("Duplicate use of step JSON ID "+t);return JP[t]=n,n.prototype.jsonID=t,n}}class JF{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new JF(t,null)}static fail(t){return new JF(null,t)}static fromReplace(t,n,r,i){try{return JF.ok(t.replace(n,r,i))}catch(o){if(o instanceof GK)return JF.fail(o.message);throw o}}}function JD(t,n,r){let i=[];for(let o=0;o<t.childCount;o++){let a=t.child(o);a.content.size&&(a=a.copy(JD(a.content,n,a))),a.isInline&&(a=n(a,r,o)),i.push(a)}return Gz.fromArray(i)}class JW extends JL{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 GH(JD(n.content,(t,n)=>t.isAtom&&n.type.allowsMarkType(this.mark.type)?t.mark(this.mark.addToSet(t.marks)):t,i),n.openStart,n.openEnd);return JF.fromReplace(t,this.from,this.to,o)}invert(){return new JU(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 JW(n.pos,r.pos,this.mark)}merge(t){return t instanceof JW&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new JW(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("number"!=typeof n.from||"number"!=typeof n.to)throw RangeError("Invalid input for AddMarkStep.fromJSON");return new JW(n.from,n.to,t.markFromJSON(n.mark))}}JL.jsonID("addMark",JW);class JU extends JL{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 GH(JD(n.content,t=>t.mark(this.mark.removeFromSet(t.marks)),t),n.openStart,n.openEnd);return JF.fromReplace(t,this.from,this.to,r)}invert(){return new JW(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 JU(n.pos,r.pos,this.mark)}merge(t){return t instanceof JU&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new JU(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("number"!=typeof n.from||"number"!=typeof n.to)throw RangeError("Invalid input for RemoveMarkStep.fromJSON");return new JU(n.from,n.to,t.markFromJSON(n.mark))}}JL.jsonID("removeMark",JU);class Jz extends JL{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return JF.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return JF.fromReplace(t,this.pos,this.pos+1,new GH(Gz.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 Jz(this.pos,n.marks[i]);return new Jz(this.pos,this.mark)}}return new JB(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Jz(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if("number"!=typeof n.pos)throw RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Jz(n.pos,t.markFromJSON(n.mark))}}JL.jsonID("addNodeMark",Jz);class JB extends JL{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return JF.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return JF.fromReplace(t,this.pos,this.pos+1,new GH(Gz.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return n&&this.mark.isInSet(n.marks)?new Jz(this.pos,this.mark):this}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new JB(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if("number"!=typeof n.pos)throw RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new JB(n.pos,t.markFromJSON(n.mark))}}JL.jsonID("removeNodeMark",JB);class Jq extends JL{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&J$(t,this.from,this.to)?JF.fail("Structure replace would overwrite content"):JF.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new Jj([this.from,this.to-this.from,this.slice.size])}invert(t){return new Jq(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 Jq(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof Jq)||t.structure||this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openEnd||t.slice.openStart){if(t.to!=this.from||this.slice.openStart||t.slice.openEnd)return null;{let n=this.slice.size+t.slice.size==0?GH.empty:new GH(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new Jq(t.from,this.to,n,this.structure)}}{let r=this.slice.size+t.slice.size==0?GH.empty:new GH(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new Jq(this.from,this.to+(t.to-t.from),r,this.structure)}}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("number"!=typeof n.from||"number"!=typeof n.to)throw RangeError("Invalid input for ReplaceStep.fromJSON");return new Jq(n.from,n.to,GH.fromJSON(t,n.slice),!!n.structure)}}JL.jsonID("replace",Jq);class JV extends JL{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&&(J$(t,this.from,this.gapFrom)||J$(t,this.gapTo,this.to)))return JF.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return JF.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?JF.fromReplace(t,this.from,this.to,r):JF.fail("Content does not fit in gap")}getMap(){return new Jj([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 JV(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 JV(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("number"!=typeof n.from||"number"!=typeof n.to||"number"!=typeof n.gapFrom||"number"!=typeof n.gapTo||"number"!=typeof n.insert)throw RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new JV(n.from,n.to,n.gapFrom,n.gapTo,GH.fromJSON(t,n.slice),n.insert,!!n.structure)}}function J$(t,n,r){let i=t.resolve(n),o=r-n,a=i.depth;for(;o>0&&a>0&&i.indexAfter(a)==i.node(a).childCount;)a--,o--;if(o>0){let u=i.node(a).maybeChild(i.indexAfter(a));for(;o>0;){if(!u||u.isLeaf)return!0;u=u.firstChild,o--}}return!1}function JK(t,n,r){return(0==n||t.canReplace(n,t.childCount))&&(r==t.childCount||t.canReplace(0,r))}function JH(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let i=t.$from.node(r),o=t.$from.index(r),a=t.$to.indexAfter(r);if(r<t.depth&&i.canReplace(o,a,n))return r;if(0==r||i.type.spec.isolating||!JK(i,o,a))break}return null}function JZ(t,n,r=null,i=t){let o=function(t,n){let{parent:r,startIndex:i,endIndex:o}=t,a=r.contentMatchAt(i).findWrapping(n);if(!a)return null;let u=a.length?a[0]:n;return r.canReplaceWith(i,o,u)?a:null}(t,n),a=o&&function(t,n){let{parent:r,startIndex:i,endIndex:o}=t,a=r.child(i),u=n.contentMatch.findWrapping(a.type);if(!u)return null;let s=(u.length?u[u.length-1]:n).contentMatch;for(let c=i;s&&c<o;c++)s=s.matchType(r.child(c).type);return s&&s.validEnd?u:null}(i,n);return a?o.map(JG).concat({type:n,attrs:r}).concat(a.map(JG)):null}function JG(t){return{type:t,attrs:null}}function JJ(t,n,r=1,i){let o=t.resolve(n),a=o.depth-r,u=i&&i[i.length-1]||o.parent;if(a<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!u.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let s=o.depth-1,c=r-2;s>a;s--,c--){let l=o.node(s),f=o.index(s);if(l.type.spec.isolating)return!1;let d=l.content.cutByIndex(f,l.childCount),p=i&&i[c+1];p&&(d=d.replaceChild(0,p.type.create(p.attrs)));let h=i&&i[c]||l;if(!l.canReplace(f+1,l.childCount)||!h.type.validContent(d))return!1}let m=o.indexAfter(a),g=i&&i[0];return o.node(a).canReplaceWith(m,m,g?g.type:o.node(a+1).type)}function JY(t,n){let r=t.resolve(n),i=r.index();return JQ(r.nodeBefore,r.nodeAfter)&&r.parent.canReplace(i,i+1)}function JQ(t,n){return!!(t&&n&&!t.isLeaf&&t.canAppend(n))}function JX(t,n,r=-1){let i=t.resolve(n);for(let o=i.depth;;o--){let a,u,s=i.index(o);if(o==i.depth?(a=i.nodeBefore,u=i.nodeAfter):r>0?(a=i.node(o+1),s++,u=i.node(o).maybeChild(s)):(a=i.node(o).maybeChild(s-1),u=i.node(o+1)),a&&!a.isTextblock&&JQ(a,u)&&i.node(o).canReplace(s,s+1))return n;if(0==o)break;n=r<0?i.before(o):i.after(o)}}function J0(t,n,r=n,i=GH.empty){if(n==r&&!i.size)return null;let o=t.resolve(n),a=t.resolve(r);return J1(o,a,i)?new Jq(n,r,i):new J2(o,a,i).fit()}function J1(t,n,r){return!r.openStart&&!r.openEnd&&t.start()==n.start()&&t.parent.canReplace(t.index(),n.index(),r.content)}JL.jsonID("replaceAround",JV);class J2{constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=Gz.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 a=t.depth;a>0;a--)this.placed=Gz.from(t.node(a).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}let n=this.mustMoveInline(),r=this.placed.size-this.depth-this.$from.depth,i=this.$from,o=this.close(n<0?this.$to:i.doc.resolve(n));if(!o)return null;let a=this.placed,u=i.depth,s=o.depth;for(;u&&s&&1==a.childCount;)a=a.firstChild.content,u--,s--;let c=new GH(a,u,s);return n>-1?new JV(i.pos,n,this.$to.pos,this.$to.end(),c,r):c.size||i.pos!=this.$to.pos?new Jq(i.pos,o.pos,c):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 a=1;a<=2;a++)for(let u=1==a?t:this.unplaced.openStart;u>=0;u--){let s,c=null,l=(u?(c=J5(this.unplaced.content,u-1).firstChild).content:this.unplaced.content).firstChild;for(let f=this.depth;f>=0;f--){let{type:d,match:p}=this.frontier[f],h,m=null;if(1==a&&(l?p.matchType(l.type)||(m=p.fillBefore(Gz.from(l),!1)):c&&d.compatibleContent(c.type)))return{sliceDepth:u,frontierDepth:f,parent:c,inject:m};if(2==a&&l&&(h=p.findWrapping(l.type)))return{sliceDepth:u,frontierDepth:f,parent:c,wrap:h};if(c&&p.matchType(c.type))break}}}openMore(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=J5(t,n);return!!i.childCount&&!i.firstChild.isLeaf&&(this.unplaced=new GH(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=J5(t,n);if(i.childCount<=1&&n>0){let o=t.size-n<=n+i.size;this.unplaced=new GH(J3(t,n-1,1),n-1,o?n-1:r)}else this.unplaced=new GH(J3(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 a=0;a<o.length;a++)this.openFrontierNode(o[a]);let u=this.unplaced,s=r?r.content:u.content,c=u.openStart-t,l=0,f=[],{match:d,type:p}=this.frontier[n];if(i){for(let h=0;h<i.childCount;h++)f.push(i.child(h));d=d.matchFragment(i)}let m=s.size+t-(u.content.size-u.openEnd);for(;l<s.childCount;){let g=s.child(l),y=d.matchType(g.type);if(!y)break;(++l>1||0==c||g.content.size)&&(d=y,f.push(J6(g.mark(p.allowedMarks(g.marks)),1==l?c:0,l==s.childCount?m:-1)))}let v=l==s.childCount;v||(m=-1),this.placed=J4(this.placed,n,Gz.from(f)),this.frontier[n].match=d,v&&m<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let b=0,x=s;b<m;b++){let _=x.lastChild;this.frontier.push({type:_.type,match:_.contentMatchAt(_.childCount)}),x=_.content}this.unplaced=v?0==t?GH.empty:new GH(J3(u.content,t-1,1),t-1,m<0?u.openEnd:t-1):new GH(J3(u.content,t,l),u.openStart,u.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return -1;let t=this.frontier[this.depth],n;if(!t.type.isTextblock||!J9(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=J9(t,n,i,r,o);if(a){for(let u=n-1;u>=0;u--){let{match:s,type:c}=this.frontier[u],l=J9(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=J4(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=J4(this.placed,this.depth,Gz.from(t.create(n,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(Gz.empty,!0);t.childCount&&(this.placed=J4(this.placed,this.frontier.length,t))}}function J3(t,n,r){return 0==n?t.cutByIndex(r,t.childCount):t.replaceChild(0,t.firstChild.copy(J3(t.firstChild.content,n-1,r)))}function J4(t,n,r){return 0==n?t.append(r):t.replaceChild(t.childCount-1,t.lastChild.copy(J4(t.lastChild.content,n-1,r)))}function J5(t,n){for(let r=0;r<n;r++)t=t.firstChild.content;return t}function J6(t,n,r){if(n<=0)return t;let i=t.content;return n>1&&(i=i.replaceChild(0,J6(i.firstChild,n-1,1==i.childCount?r-1:0))),n>0&&(i=t.type.contentMatch.fillBefore(i).append(i),r<=0&&(i=i.append(t.type.contentMatch.matchFragment(i).fillBefore(Gz.empty,!0)))),t.copy(i)}function J9(t,n,r,i,o){let a=t.node(n),u=o?t.indexAfter(n):t.index(n);if(u==a.childCount&&!r.compatibleContent(a.type))return null;let s=i.fillBefore(a.content,!0,u);return s&&!function(t,n,r){for(let i=r;i<n.childCount;i++)if(!t.allowsMarks(n.child(i).marks))return!0;return!1}(r,a.content,u)?s:null}function J8(t){return t.spec.defining||t.spec.definingForContent}function J7(t,n,r,i,o){if(n<r){let a=t.firstChild;t=t.replaceChild(0,a.copy(J7(a.content,n+1,r,i,a)))}if(n>i){let u=o.contentMatchAt(0),s=u.fillBefore(t).append(t);t=s.append(u.matchFragment(s).fillBefore(Gz.empty,!0))}return t}function Ye(t,n){let r=[],i=Math.min(t.depth,n.depth);for(let o=i;o>=0;o--){let a=t.start(o);if(a<t.pos-(t.depth-o)||n.end(o)>n.pos+(n.depth-o)||t.node(o).type.spec.isolating||n.node(o).type.spec.isolating)break;(a==n.start(o)||o==t.depth&&o==n.depth&&t.parent.inlineContent&&n.parent.inlineContent&&o&&n.start(o-1)==a-1)&&r.push(o)}return r}class Yt extends JL{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 JF.fail("No node at attribute step's position");let r=Object.create(null);for(let i in n.attrs)r[i]=n.attrs[i];r[this.attr]=this.value;let o=n.type.create(r,null,n.marks);return JF.fromReplace(t,this.pos,this.pos+1,new GH(Gz.from(o),0,n.isLeaf?0:1))}getMap(){return Jj.empty}invert(t){return new Yt(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 Yt(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if("number"!=typeof n.pos||"string"!=typeof n.attr)throw RangeError("Invalid input for AttrStep.fromJSON");return new Yt(n.pos,n.attr,n.value)}}JL.jsonID("attr",Yt);let Yn=class extends Error{};(Yn=function t(n){let r=Error.call(this,n);return r.__proto__=t.prototype,r}).prototype=Object.create(Error.prototype),Yn.prototype.constructor=Yn,Yn.prototype.name="TransformError";class Yr{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new JN}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new Yn(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=GH.empty){let i=J0(this.doc,t,n,r);return i&&this.step(i),this}replaceWith(t,n,r){return this.replace(t,n,new GH(Gz.from(r),0,0))}delete(t,n){return this.replace(t,n,GH.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,r){return function(t,n,r,i){if(!i.size)return t.deleteRange(n,r);let o=t.doc.resolve(n),a=t.doc.resolve(r);if(J1(o,a,i))return t.step(new Jq(n,r,i));let u=Ye(o,t.doc.resolve(r));0==u[u.length-1]&&u.pop();let s=-(o.depth+1);u.unshift(s);for(let c=o.depth,l=o.pos-1;c>0;c--,l--){let f=o.node(c).type.spec;if(f.defining||f.definingAsContext||f.isolating)break;u.indexOf(c)>-1?s=c:o.before(c)==l&&u.splice(1,0,-c)}let d=u.indexOf(s),p=[],h=i.openStart;for(let m=i.content,g=0;;g++){let y=m.firstChild;if(p.push(y),g==i.openStart)break;m=y.content}for(let v=h-1;v>=0;v--){let b=p[v].type,x=J8(b);if(x&&o.node(d).type!=b)h=v;else if(x||!b.isTextblock)break}for(let _=i.openStart;_>=0;_--){let S=(_+h+1)%(i.openStart+1),T=p[S];if(T)for(let w=0;w<u.length;w++){let O=u[(w+d)%u.length],k=!0;O<0&&(k=!1,O=-O);let I=o.node(O-1),M=o.index(O-1);if(I.canReplaceWith(M,M,T.type,T.marks))return t.replace(o.before(O),k?a.after(O):r,new GH(J7(i.content,0,i.openStart,S),S,i.openEnd))}}let C=t.steps.length;for(let R=u.length-1;R>=0&&(t.replace(n,r,i),!(t.steps.length>C));R--){let E=u[R];E<0||(n=o.before(E),r=a.after(E))}}(this,t,n,r),this}replaceRangeWith(t,n,r){return function(t,n,r,i){if(!i.isInline&&n==r&&t.doc.resolve(n).parent.content.size){let o=function(t,n,r){let i=t.resolve(n);if(i.parent.canReplaceWith(i.index(),i.index(),r))return n;if(0==i.parentOffset)for(let o=i.depth-1;o>=0;o--){let a=i.index(o);if(i.node(o).canReplaceWith(a,a,r))return i.before(o+1);if(a>0)return null}if(i.parentOffset==i.parent.content.size)for(let u=i.depth-1;u>=0;u--){let s=i.indexAfter(u);if(i.node(u).canReplaceWith(s,s,r))return i.after(u+1);if(s<i.node(u).childCount)break}return null}(t.doc,n,i.type);null!=o&&(n=r=o)}t.replaceRange(n,r,new GH(Gz.from(i),0,0))}(this,t,n,r),this}deleteRange(t,n){return function(t,n,r){let i=t.doc.resolve(n),o=t.doc.resolve(r),a=Ye(i,o);for(let u=0;u<a.length;u++){let s=a[u],c=u==a.length-1;if(c&&0==s||i.node(s).type.contentMatch.validEnd)return t.delete(i.start(s),o.end(s));if(s>0&&(c||i.node(s-1).canReplace(i.index(s-1),o.indexAfter(s-1))))return t.delete(i.before(s),o.after(s))}for(let l=1;l<=i.depth&&l<=o.depth;l++)if(n-i.start(l)==i.depth-l&&r>i.end(l)&&o.end(l)-r!=o.depth-l)return t.delete(i.before(l),r);t.delete(n,r)}(this,t,n),this}lift(t,n){return function(t,n,r){let{$from:i,$to:o,depth:a}=n,u=i.before(a+1),s=o.after(a+1),c=u,l=s,f=Gz.empty,d=0;for(let p=a,h=!1;p>r;p--)h||i.index(p)>0?(h=!0,f=Gz.from(i.node(p).copy(f)),d++):c--;let m=Gz.empty,g=0;for(let y=a,v=!1;y>r;y--)v||o.after(y+1)<o.end(y)?(v=!0,m=Gz.from(o.node(y).copy(m)),g++):l++;t.step(new JV(c,l,u,s,new GH(f.append(m),d,g),f.size-d,!0))}(this,t,n),this}join(t,n=1){return function(t,n,r){let i=new Jq(n-r,n+r,GH.empty,!0);t.step(i)}(this,t,n),this}wrap(t,n){return function(t,n,r){let i=Gz.empty;for(let o=r.length-1;o>=0;o--){if(i.size){let a=r[o].type.contentMatch.matchFragment(i);if(!a||!a.validEnd)throw RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=Gz.from(r[o].type.create(r[o].attrs,i))}let u=n.start,s=n.end;t.step(new JV(u,s,u,s,new GH(i,0,0),r.length,!0))}(this,t,n),this}setBlockType(t,n=t,r,i=null){return function(t,n,r,i,o){if(!i.isTextblock)throw RangeError("Type given to setBlockType should be a textblock");let a=t.steps.length;t.doc.nodesBetween(n,r,(n,r)=>{var u,s,c;let l,f;if(n.isTextblock&&!n.hasMarkup(i,o)&&(u=t.doc,s=t.mapping.slice(a).map(r),c=i,l=u.resolve(s),f=l.index(),l.parent.canReplaceWith(f,f+1,c))){t.clearIncompatible(t.mapping.slice(a).map(r,1),i);let d=t.mapping.slice(a),p=d.map(r,1),h=d.map(r+n.nodeSize,1);return t.step(new JV(p,h,p+1,h-1,new GH(Gz.from(i.create(o,null,n.marks)),0,0),1,!0)),!1}})}(this,t,n,r,i),this}setNodeMarkup(t,n,r=null,i){return function(t,n,r,i,o){let a=t.doc.nodeAt(n);if(!a)throw RangeError("No node at given position");r||(r=a.type);let u=r.create(i,null,o||a.marks);if(a.isLeaf)return t.replaceWith(n,n+a.nodeSize,u);if(!r.validContent(a.content))throw RangeError("Invalid content for node type "+r.name);t.step(new JV(n,n+a.nodeSize,n+1,n+a.nodeSize-1,new GH(Gz.from(u),0,0),1,!0))}(this,t,n,r,i),this}setNodeAttribute(t,n,r){return this.step(new Yt(t,n,r)),this}addNodeMark(t,n){return this.step(new Jz(t,n)),this}removeNodeMark(t,n){if(!(n instanceof G$)){let r=this.doc.nodeAt(t);if(!r)throw RangeError("No node at position "+t);if(!(n=n.isInSet(r.marks)))return this}return this.step(new JB(t,n)),this}split(t,n=1,r){return function(t,n,r=1,i){let o=t.doc.resolve(n),a=Gz.empty,u=Gz.empty;for(let s=o.depth,c=o.depth-r,l=r-1;s>c;s--,l--){a=Gz.from(o.node(s).copy(a));let f=i&&i[l];u=Gz.from(f?f.type.create(f.attrs,u):o.node(s).copy(u))}t.step(new Jq(n,n,new GH(a.append(u),r,r),!0))}(this,t,n,r),this}addMark(t,n,r){var i,o,a,u;let s,c,l,f;return i=this,s=[],c=[],i.doc.nodesBetween(t,n,(i,o,a)=>{if(!i.isInline)return;let u=i.marks;if(!r.isInSet(u)&&a.type.allowsMarkType(r.type)){let d=Math.max(o,t),p=Math.min(o+i.nodeSize,n),h=r.addToSet(u);for(let m=0;m<u.length;m++)u[m].isInSet(h)||(l&&l.to==d&&l.mark.eq(u[m])?l.to=p:s.push(l=new JU(d,p,u[m])));f&&f.to==d?f.to=p:c.push(f=new JW(d,p,r))}}),s.forEach(t=>i.step(t)),c.forEach(t=>i.step(t)),this}removeMark(t,n,r){var i,o,a,u;let s,c;return i=this,s=[],c=0,i.doc.nodesBetween(t,n,(i,o)=>{if(!i.isInline)return;c++;let a=null;if(r instanceof Jh){let u=i.marks,l;for(;l=r.isInSet(u);)(a||(a=[])).push(l),u=l.removeFromSet(u)}else r?r.isInSet(i.marks)&&(a=[r]):a=i.marks;if(a&&a.length){let f=Math.min(o+i.nodeSize,n);for(let d=0;d<a.length;d++){let p=a[d],h;for(let m=0;m<s.length;m++){let g=s[m];g.step==c-1&&p.eq(s[m].style)&&(h=g)}h?(h.to=f,h.step=c):s.push({style:p,from:Math.max(o,t),to:f,step:c})}}}),s.forEach(t=>i.step(new JU(t.from,t.to,t.style))),this}clearIncompatible(t,n,r){return function(t,n,r,i=r.contentMatch){let o=t.doc.nodeAt(n),a=[],u=n+1;for(let s=0;s<o.childCount;s++){let c=o.child(s),l=u+c.nodeSize,f=i.matchType(c.type);if(f){i=f;for(let d=0;d<c.marks.length;d++)r.allowsMarkType(c.marks[d].type)||t.step(new JU(u,l,c.marks[d]))}else a.push(new Jq(u,l,GH.empty));u=l}if(!i.validEnd){let p=i.fillBefore(Gz.empty,!0);t.replace(u,u,new GH(p,0,0))}for(let h=a.length-1;h>=0;h--)t.step(a[h])}(this,t,n,r),this}}let Yi=Object.create(null);class Yo{constructor(t,n,r){this.$anchor=t,this.$head=n,this.ranges=r||[new Ya(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=GH.empty){let r=n.content.lastChild,i=null;for(let o=0;o<n.openEnd;o++)i=r,r=r.lastChild;let a=t.steps.length,u=this.ranges;for(let s=0;s<u.length;s++){let{$from:c,$to:l}=u[s],f=t.mapping.slice(a);t.replaceRange(f.map(c.pos),f.map(l.pos),s?GH.empty:n),0==s&&Yg(t,a,(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),Yg(t,r,n.isInline?-1:1))}}static findFrom(t,n,r=!1){let i=t.parent.inlineContent?new Yc(t):Ym(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?Ym(t.node(0),t.node(o),t.before(o+1),t.index(o),n,r):Ym(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 Yp(t.node(0))}static atStart(t){return Ym(t,t,0,0,1)||new Yp(t)}static atEnd(t){return Ym(t,t,t.content.size,t.childCount,-1)||new Yp(t)}static fromJSON(t,n){if(!n||!n.type)throw RangeError("Invalid input for Selection.fromJSON");let r=Yi[n.type];if(!r)throw RangeError(`No selection type ${n.type} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in Yi)throw RangeError("Duplicate use of selection JSON ID "+t);return Yi[t]=n,n.prototype.jsonID=t,n}getBookmark(){return Yc.between(this.$anchor,this.$head).getBookmark()}}Yo.prototype.visible=!0;class Ya{constructor(t,n){this.$from=t,this.$to=n}}let Yu=!1;function Ys(t){Yu||t.parent.inlineContent||(Yu=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Yc extends Yo{constructor(t,n=t){Ys(t),Ys(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 Yo.near(r);let i=t.resolve(n.map(this.anchor));return new Yc(i.parent.inlineContent?i:r,r)}replace(t,n=GH.empty){if(super.replace(t,n),n==GH.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof Yc&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Yl(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if("number"!=typeof n.anchor||"number"!=typeof n.head)throw RangeError("Invalid input for TextSelection.fromJSON");return new Yc(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=Yo.findFrom(n,r,!0)||Yo.findFrom(n,-r,!0);if(!o)return Yo.near(n,r);n=o.$head}return t.parent.inlineContent||(0==i?t=n:(t=(Yo.findFrom(t,-r,!0)||Yo.findFrom(t,r,!0)).$anchor).pos<n.pos!=i<0&&(t=n)),new Yc(t,n)}}Yo.jsonID("text",Yc);class Yl{constructor(t,n){this.anchor=t,this.head=n}map(t){return new Yl(t.map(this.anchor),t.map(this.head))}resolve(t){return Yc.between(t.resolve(this.anchor),t.resolve(this.head))}}class Yf extends Yo{constructor(t){let n=t.nodeAfter;super(t,t.node(0).resolve(t.pos+n.nodeSize)),this.node=n}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),o=t.resolve(i);return r?Yo.near(o):new Yf(o)}content(){return new GH(Gz.from(this.node),0,0)}eq(t){return t instanceof Yf&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Yd(this.anchor)}static fromJSON(t,n){if("number"!=typeof n.anchor)throw RangeError("Invalid input for NodeSelection.fromJSON");return new Yf(t.resolve(n.anchor))}static create(t,n){return new Yf(t.resolve(n))}static isSelectable(t){return!t.isText&&!1!==t.type.spec.selectable}}Yf.prototype.visible=!1,Yo.jsonID("node",Yf);class Yd{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new Yl(r,r):new Yd(r)}resolve(t){let n=t.resolve(this.anchor),r=n.nodeAfter;return r&&Yf.isSelectable(r)?new Yf(n):Yo.near(n)}}class Yp extends Yo{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,n=GH.empty){if(n==GH.empty){t.delete(0,t.doc.content.size);let r=Yo.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(t){return new Yp(t)}map(t){return new Yp(t)}eq(t){return t instanceof Yp}getBookmark(){return Yh}}Yo.jsonID("all",Yp);let Yh={map(){return this},resolve:t=>new Yp(t)};function Ym(t,n,r,i,o,a=!1){if(n.inlineContent)return Yc.create(t,r);for(let u=i-(o>0?0:1);o>0?u<n.childCount:u>=0;u+=o){let s=n.child(u);if(s.isAtom){if(!a&&Yf.isSelectable(s))return Yf.create(t,r-(o<0?s.nodeSize:0))}else{let c=Ym(t,s,r+o,o<0?s.childCount:0,o,a);if(c)return c}r+=s.nodeSize*o}return null}function Yg(t,n,r){let i=t.steps.length-1;if(i<n)return;let o=t.steps[i];if(!(o instanceof Jq||o instanceof JV))return;let a;t.mapping.maps[i].forEach((t,n,r,i)=>{null==a&&(a=i)}),t.setSelection(Yo.near(t.doc.resolve(a),r))}class Yy extends Yr{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 RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=(1|this.updated)&-3,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=2,this}ensureMarks(t){return G$.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(2&this.updated)>0}addStep(t,n){super.addStep(t,n),this.updated=-3&this.updated,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)||G$.none))),r.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,n,r){let i=this.doc.type.schema;if(null==n)return t?this.replaceSelectionWith(i.text(t),!0):this.deleteSelection();{if(null==r&&(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(Yo.near(this.selection.$to)),this}}setMeta(t,n){return this.meta["string"==typeof t?t:t.key]=n,this}getMeta(t){return this.meta["string"==typeof t?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function Yv(t,n){return n&&t?t.bind(n):t}class Yb{constructor(t,n,r){this.name=t,this.init=Yv(n.init,r),this.apply=Yv(n.apply,r)}}let Yx=[new Yb("doc",{init:t=>t.doc||t.schema.topNodeType.createAndFill(),apply:t=>t.doc}),new Yb("selection",{init:(t,n)=>t.selection||Yo.atStart(n.doc),apply:t=>t.selection}),new Yb("storedMarks",{init:t=>t.storedMarks||null,apply:(t,n,r,i)=>i.selection.$cursor?t.storedMarks:null}),new Yb("scrollToSelection",{init:()=>0,apply:(t,n)=>t.scrolledIntoView?n+1:n})];class Y_{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Yx.slice(),n&&n.forEach(t=>{if(this.pluginsByKey[t.key])throw RangeError("Adding different instances of a keyed plugin ("+t.key+")");this.plugins.push(t),this.pluginsByKey[t.key]=t,t.spec.state&&this.fields.push(new Yb(t.key,t.spec.state,t))})}}class YS{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 RangeError("Applying a mismatched transaction");let n=new YS(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 Yy(this)}static create(t){let n=new Y_(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new YS(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 Y_(this.schema,t.plugins),r=n.fields,i=new YS(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(t=>t.toJSON())),t&&"object"==typeof t)for(let r in t){if("doc"==r||"selection"==r)throw 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 RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw RangeError("Required config field 'schema' missing");let i=new Y_(t.schema,t.plugins),o=new YS(i);return i.fields.forEach(i=>{if("doc"==i.name)o.doc=G6.fromJSON(t.schema,n.doc);else if("selection"==i.name)o.selection=Yo.fromJSON(o.doc,n.selection);else if("storedMarks"==i.name)n.storedMarks&&(o.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let a in r){let u=r[a],s=u.spec.state;if(u.key==i.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){o[i.name]=s.fromJSON.call(u,t,n[a],o);return}}o[i.name]=i.init(t,o)}}),o}}class YT{constructor(t){this.spec=t,this.props={},t.props&&function t(n,r,i){for(let o in n){let a=n[o];a instanceof Function?a=a.bind(r):"handleDOMEvents"==o&&(a=t(a,r,{})),i[o]=a}return i}(t.props,this,this.props),this.key=t.key?t.key.key:YO("plugin")}getState(t){return t[this.key]}}let Yw=Object.create(null);function YO(t){return t in Yw?t+"$"+ ++Yw[t]:(Yw[t]=0,t+"$")}class Yk{constructor(t="key"){this.key=YO(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}let YI=function(t){for(var n=0;;n++)if(!(t=t.previousSibling))return n},YM=function(t){let n=t.assignedSlot||t.parentNode;return n&&11==n.nodeType?n.host:n},YC=null,YR=function(t,n,r){let i=YC||(YC=document.createRange());return i.setEnd(t,r??t.nodeValue.length),i.setStart(t,n||0),i},YE=function(t,n,r,i){return r&&(Yj(t,n,r,i,-1)||Yj(t,n,r,i,1))},YA=/^(img|br|input|textarea|hr)$/i;function Yj(t,n,r,i,o){for(;;){if(t==r&&n==i)return!0;if(n==(o<0?0:YN(t))){let a=t.parentNode;if(!a||1!=a.nodeType||YP(t)||YA.test(t.nodeName)||"false"==t.contentEditable)return!1;n=YI(t)+(o<0?0:1),t=a}else{if(1!=t.nodeType||"false"==(t=t.childNodes[n+(o<0?-1:0)]).contentEditable)return!1;n=o<0?YN(t):0}}}function YN(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function YP(t){let n;for(let r=t;r&&!(n=r.pmViewDesc);r=r.parentNode);return n&&n.node&&n.node.isBlock&&(n.dom==t||n.contentDOM==t)}let YL=function(t){return t.focusNode&&YE(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function YF(t,n){let r=document.createEvent("Event");return r.initEvent("keydown",!0,!0),r.keyCode=t,r.key=r.code=n,r}function YD(t,n,r){if(t.caretPositionFromPoint)try{let i=t.caretPositionFromPoint(n,r);if(i)return{node:i.offsetNode,offset:i.offset}}catch{}if(t.caretRangeFromPoint){let o=t.caretRangeFromPoint(n,r);if(o)return{node:o.startContainer,offset:o.startOffset}}}let YW="u">typeof navigator?navigator:null,YU="u">typeof document?document:null,Yz=YW&&YW.userAgent||"",YB=/Edge\/(\d+)/.exec(Yz),Yq=/MSIE \d/.exec(Yz),YV=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Yz),Y$=!!(Yq||YV||YB),YK=Yq?document.documentMode:YV?+YV[1]:YB?+YB[1]:0,YH=!Y$&&/gecko\/(\d+)/i.test(Yz);YH&&(/Firefox\/(\d+)/.exec(Yz)||[0,0])[1];let YZ=!Y$&&/Chrome\/(\d+)/.exec(Yz),YG=!!YZ,YJ=YZ?+YZ[1]:0,YY=!Y$&&!!YW&&/Apple Computer/.test(YW.vendor),YQ=YY&&(/Mobile\/\w+/.test(Yz)||!!YW&&YW.maxTouchPoints>2),YX=YQ||!!YW&&/Mac/.test(YW.platform),Y0=!!YW&&/Win/.test(YW.platform),Y1=/Android \d/.test(Yz),Y2=!!YU&&"webkitFontSmoothing"in YU.documentElement.style,Y3=Y2?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Y4(t){return{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Y5(t,n){return"number"==typeof t?t:t[n]}function Y6(t){let n=t.getBoundingClientRect(),r=n.width/t.offsetWidth||1,i=n.height/t.offsetHeight||1;return{left:n.left,right:n.left+t.clientWidth*r,top:n.top,bottom:n.top+t.clientHeight*i}}function Y9(t,n,r){let i=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,a=t.dom.ownerDocument;for(let u=r||t.dom;u;u=YM(u)){if(1!=u.nodeType)continue;let s=u,c=s==a.body,l=c?Y4(a):Y6(s),f=0,d=0;if(n.top<l.top+Y5(i,"top")?d=-(l.top-n.top+Y5(o,"top")):n.bottom>l.bottom-Y5(i,"bottom")&&(d=n.bottom-l.bottom+Y5(o,"bottom")),n.left<l.left+Y5(i,"left")?f=-(l.left-n.left+Y5(o,"left")):n.right>l.right-Y5(i,"right")&&(f=n.right-l.right+Y5(o,"right")),f||d){if(c)a.defaultView.scrollBy(f,d);else{let p=s.scrollLeft,h=s.scrollTop;d&&(s.scrollTop+=d),f&&(s.scrollLeft+=f);let m=s.scrollLeft-p,g=s.scrollTop-h;n={left:n.left-m,top:n.top-g,right:n.right-m,bottom:n.bottom-g}}}if(c)break}}function Y8(t){let n=[],r=t.ownerDocument;for(let i=t;i&&(n.push({dom:i,top:i.scrollTop,left:i.scrollLeft}),t!=r);i=YM(i));return n}function Y7(t,n){for(let r=0;r<t.length;r++){let{dom:i,top:o,left:a}=t[r];i.scrollTop!=o+n&&(i.scrollTop=o+n),i.scrollLeft!=a&&(i.scrollLeft=a)}}let Qe=null;function Qt(t,n){return t.left>=n.left-1&&t.left<=n.right+1&&t.top>=n.top-1&&t.top<=n.bottom+1}function Qn(t){return t.top<t.bottom||t.left<t.right}function Qr(t,n){let r=t.getClientRects();if(r.length){let i=r[n<0?0:r.length-1];if(Qn(i))return i}return Array.prototype.find.call(r,Qn)||t.getBoundingClientRect()}let Qi=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Qo(t,n,r){let{node:i,offset:o,atom:a}=t.docView.domFromPos(n,r<0?-1:1),u=Y2||YH;if(3==i.nodeType){if(u&&(Qi.test(i.nodeValue)||(r<0?!o:o==i.nodeValue.length))){let s=Qr(YR(i,o,o),r);if(YH&&o&&/\s/.test(i.nodeValue[o-1])&&o<i.nodeValue.length){let c=Qr(YR(i,o-1,o-1),-1);if(c.top==s.top){let l=Qr(YR(i,o,o+1),-1);if(l.top!=s.top)return Qa(l,l.left<c.left)}}return s}{let f=o,d=o,p=r<0?1:-1;return r<0&&!o?(d++,p=-1):r>=0&&o==i.nodeValue.length?(f--,p=1):r<0?f--:d++,Qa(Qr(YR(i,f,d),p),p<0)}}if(!t.state.doc.resolve(n-(a||0)).parent.inlineContent){if(null==a&&o&&(r<0||o==YN(i))){let h=i.childNodes[o-1];if(1==h.nodeType)return Qu(h.getBoundingClientRect(),!1)}if(null==a&&o<YN(i)){let m=i.childNodes[o];if(1==m.nodeType)return Qu(m.getBoundingClientRect(),!0)}return Qu(i.getBoundingClientRect(),r>=0)}if(null==a&&o&&(r<0||o==YN(i))){let g=i.childNodes[o-1],y=3==g.nodeType?YR(g,YN(g)-(u?0:1)):1!=g.nodeType||"BR"==g.nodeName&&g.nextSibling?null:g;if(y)return Qa(Qr(y,1),!1)}if(null==a&&o<YN(i)){let v=i.childNodes[o];for(;v.pmViewDesc&&v.pmViewDesc.ignoreForCoords;)v=v.nextSibling;let b=v?3==v.nodeType?YR(v,0,u?0:1):1==v.nodeType?v:null:null;if(b)return Qa(Qr(b,-1),!0)}return Qa(Qr(3==i.nodeType?YR(i):i,-r),r>=0)}function Qa(t,n){if(0==t.width)return t;let r=n?t.left:t.right;return{top:t.top,bottom:t.bottom,left:r,right:r}}function Qu(t,n){if(0==t.height)return t;let r=n?t.top:t.bottom;return{top:r,bottom:r,left:t.left,right:t.right}}function Qs(t,n,r){let i=t.state,o=t.root.activeElement;i!=n&&t.updateState(n),o!=t.dom&&t.focus();try{return r()}finally{i!=n&&t.updateState(i),o!=t.dom&&o&&o.focus()}}let Qc=/[\u0590-\u08ac]/,Ql=null,Qf=null,Qd=!1;class Qp{constructor(t,n,r,i){this.parent=t,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=0,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(1==t.nodeType?t:t.parentNode)){if(r<0){let i,o;if(t==this.contentDOM)i=t.childNodes[n-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;i=t.previousSibling}for(;i&&!((o=i.pmViewDesc)&&o.parent==this);)i=i.previousSibling;return i?this.posBeforeChild(o)+o.size:this.posAtStart}{let a,u;if(t==this.contentDOM)a=t.childNodes[n];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;a=t.nextSibling}for(;a&&!((u=a.pmViewDesc)&&u.parent==this);)a=a.nextSibling;return a?this.posBeforeChild(u):this.posAtEnd}}let s;if(t==this.dom&&this.contentDOM)s=n>YI(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))s=2&t.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==n)for(let c=t;;c=c.parentNode){if(c==this.dom){s=!1;break}if(c.previousSibling)break}if(null==s&&n==t.childNodes.length)for(let l=t;;l=l.parentNode){if(l==this.dom){s=!0;break}if(l.nextSibling)break}}return s??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)||(1==a.nodeType?a.contains(1==t.nodeType?t:t.parentNode):a==t))return o;r=!1}}}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 Qx){i=t-o;break}o=u}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let s;r&&!(s=this.children[r-1]).size&&s instanceof Qh&&s.side>=0;r--);if(n<=0){let c,l=!0;for(;!(!(c=r?this.children[r-1]:null)||c.dom.parentNode==this.contentDOM);r--,l=!1);return c&&n&&l&&!c.border&&!c.domAtom?c.domFromPos(c.size,n):{node:this.contentDOM,offset:c?YI(c.dom)+1:0}}{let f,d=!0;for(;!(!(f=r<this.children.length?this.children[r]:null)||f.dom.parentNode==this.contentDOM);r++,d=!1);return f&&d&&!f.border&&!f.domAtom?f.domFromPos(0,n):{node:this.contentDOM,offset:f?YI(f.dom):this.contentDOM.childNodes.length}}}parseRange(t,n,r=0){if(0==this.children.length)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(-1==i&&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=YI(d.dom)+1;break}t-=d.size}-1==i&&(i=0)}if(i>-1&&(c>n||u==this.children.length-1)){n=c;for(let p=u+1;p<this.children.length;p++){let h=this.children[p];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(-1)){o=YI(h.dom);break}n+=h.size}-1==o&&(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 0==n.size||n.emptyChildAt(t)}domAfterPos(t){let{node:n,offset:r}=this.domFromPos(t,0);if(1!=n.nodeType||r==n.childNodes.length)throw 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 u=0,s=0;u<this.children.length;u++){let c=this.children[u],l=s+c.size;if(o>s&&a<l)return c.setSelection(t-s-c.border,n-s-c.border,r,i);s=l}let f=this.domFromPos(t,t?-1:1),d=n==t?f:this.domFromPos(n,n?-1:1),p=r.getSelection(),h=!1;if((YH||YY)&&t==n){let{node:m,offset:g}=f;if(3==m.nodeType){if((h=!!(g&&m.nodeValue[g-1]==`
6
- `))&&g==m.nodeValue.length)for(let y=m,v;y;y=y.parentNode){if(v=y.nextSibling){"BR"==v.nodeName&&(f=d={node:v.parentNode,offset:YI(v)+1});break}let b=y.pmViewDesc;if(b&&b.node&&b.node.isBlock)break}}else{let x=m.childNodes[g-1];h=x&&("BR"==x.nodeName||"false"==x.contentEditable)}}if(YH&&p.focusNode&&p.focusNode!=d.node&&1==p.focusNode.nodeType){let _=p.focusNode.childNodes[p.focusOffset];_&&"false"==_.contentEditable&&(i=!0)}if(!(i||h&&YY)&&YE(f.node,f.offset,p.anchorNode,p.anchorOffset)&&YE(d.node,d.offset,p.focusNode,p.focusOffset))return;let S=!1;if((p.extend||t==n)&&!h){p.collapse(f.node,f.offset);try{t!=n&&p.extend(d.node,d.offset),S=!0}catch{}}if(!S){if(t>n){let T=f;f=d,d=T}let w=document.createRange();w.setEnd(d.node,d.offset),w.setStart(f.node,f.offset),p.removeAllRanges(),p.addRange(w)}}ignoreMutation(t){return!this.contentDOM&&"selection"!=t.type}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?2:1,t==u&&n==s&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=3:o.markDirty(t-u,n-u);return}o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?3:2}r=a}this.dirty=2}markParentsDirty(){let t=1;for(let n=this.parent;n;n=n.parent,t++){let r=1==t?2:1;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class Qh extends Qp{constructor(t,n,r,i){let o,a=n.type.toDOM;if("function"==typeof a&&(a=a(r,()=>o?o.parent?o.parent.posBeforeChild(o):void 0:i)),!n.type.spec.raw){if(1!=a.nodeType){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 0==this.dirty&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let n=this.widget.spec.stopEvent;return!!n&&n(t)}ignoreMutation(t){return"selection"!=t.type||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 Qm extends Qp{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"characterData"===t.type&&t.target.nodeValue==t.oldValue}}class Qg extends Qp{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=JI.renderSpec(document,n.type.spec.toDOM(n,r))),new Qg(t,n,a.dom,a.contentDOM||a.dom)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM||void 0}}matchesMark(t){return 3!=this.dirty&&this.mark.eq(t)}markDirty(t,n){if(super.markDirty(t,n),0!=this.dirty){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=0}}slice(t,n,r){let i=Qg.create(this.parent,this.mark,!0,r),o=this.children,a=this.size;n<a&&(o=QA(o,n,a,r)),t>0&&(o=QA(o,0,t,r));for(let u=0;u<o.length;u++)o[u].parent=i;return i.children=o,i}}class Qy extends Qp{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,()=>s?s.parent?s.parent.posBeforeChild(s):void 0:a,r,i),l=c&&c.dom,f=c&&c.contentDOM;if(n.isText){if(l){if(3!=l.nodeType)throw RangeError("Text must be rendered as a DOM text node")}else l=document.createTextNode(n.text)}else l||({dom:l,contentDOM:f}=JI.renderSpec(document,n.type.spec.toDOM(n)));f||n.isText||"BR"==l.nodeName||(l.hasAttribute("contenteditable")||(l.contentEditable="false"),n.type.spec.draggable&&(l.draggable=!0));let d=l;return l=QI(l,r,n),c?s=new Q_(t,n,r,i,l,f||null,d,c,o,a+1):n.isText?new Qb(t,n,r,i,l,d,o):new Qy(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("pre"==this.node.type.whitespace&&(t.preserveWhitespace="full"),this.contentDOM){if(this.contentLost){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=()=>Gz.empty)}else t.contentElement=this.contentDOM}else t.getContent=()=>this.node.content;return t}matchesNode(t,n,r){return 0==this.dirty&&t.eq(this.node)&&QM(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 QR(this,a&&a.node,t);(function(t,n,r,i){let o=n.locals(t),a=0;if(0==o.length){for(let u=0;u<t.childCount;u++){let s=t.child(u);i(s,o,n.forChild(a,s),u),a+=s.nodeSize}return}let c=0,l=[],f=null;for(let d=0;;){if(c<o.length&&o[c].to==a){let p=o[c++],h;for(;c<o.length&&o[c].to==a;)(h||(h=[p])).push(o[c++]);if(h){h.sort(QE);for(let m=0;m<h.length;m++)r(h[m],d,!!f)}else r(p,d,!!f)}let g,y;if(f)y=-1,g=f,f=null;else if(d<t.childCount)y=d,g=t.child(d++);else break;for(let v=0;v<l.length;v++)l[v].to<=a&&l.splice(v--,1);for(;c<o.length&&o[c].from<=a&&o[c].to>a;)l.push(o[c++]);let b=a+g.nodeSize;if(g.isText){let x=b;c<o.length&&o[c].from<x&&(x=o[c].from);for(let _=0;_<l.length;_++)l[_].to<x&&(x=l[_].to);x<b&&(f=g.cut(x-a),g=g.cut(0,x-a),b=x,y=-1)}let S=g.isInline&&!g.isLeaf?l.filter(t=>!t.inline):l.slice();i(g,S,n.forChild(a,g),y),a=b}})(this.node,this.innerDeco,(n,o,a)=>{n.spec.marks?s.syncToMarks(n.spec.marks,r,t):n.type.side>=0&&!a&&s.syncToMarks(o==this.node.childCount?G$.none:this.node.child(o).marks,r,t),s.placeWidget(n,t,i)},(n,a,c,l)=>{s.syncToMarks(n.marks,r,t);let f;s.findNodeMatch(n,a,c,l)||u&&t.state.selection.from>i&&t.state.selection.to<i+n.nodeSize&&(f=s.findIndexWithChild(o.node))>-1&&s.updateNodeAt(n,a,c,f,t)||s.updateNextNode(n,a,c,t,l,i)||s.addNode(n,a,c,t,i),i+=n.nodeSize}),s.syncToMarks([],r,t),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||2==this.dirty)&&(a&&this.protectLocalComposition(t,a),function t(n,r,i){let o=n.firstChild,a=!1;for(let u=0;u<r.length;u++){let s=r[u],c=s.dom;if(c.parentNode==n){for(;c!=o;)o=QC(o),a=!0;o=o.nextSibling}else a=!0,n.insertBefore(c,o);if(s instanceof Qg){let l=o?o.previousSibling:n.lastChild;t(s.contentDOM,s.children,i),o=l?l.nextSibling:n.firstChild}}for(;o;)o=QC(o),a=!0;a&&i.trackWrites==n&&(i.trackWrites=null)}(this.contentDOM,this.children,t),YQ&&function(t){if("UL"==t.nodeName||"OL"==t.nodeName){let n=t.style.cssText;t.style.cssText=n+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=n}}(this.dom))}localCompositionInfo(t,n){let{from:r,to:i}=t.state.selection;if(!(t.state.selection instanceof Yc)||r<n||i>n+this.node.content.size)return null;let o=t.domSelectionRange(),a=function(t,n){for(;;){if(3==t.nodeType)return t;if(1==t.nodeType&&n>0){if(t.childNodes.length>n&&3==t.childNodes[n].nodeType)return t.childNodes[n];n=YN(t=t.childNodes[n-1])}else{if(1!=t.nodeType||!(n<t.childNodes.length))return null;t=t.childNodes[n],n=0}}}(o.focusNode,o.focusOffset);if(!a||!this.dom.contains(a.parentNode))return null;if(!this.node.inlineContent)return{node:a,pos:-1,text:""};{let u=a.nodeValue,s=function(t,n,r,i){for(let o=0,a=0;o<t.childCount&&a<=i;){let u=t.child(o++);if(a+=u.nodeSize,!u.isText)continue;let s=u.text;for(;o<t.childCount;){let c=t.child(o++);if(a+=c.nodeSize,!c.isText)break;s+=c.text}if(a>=r){let l=a<i?s.lastIndexOf(n,i-a-1):-1;if(l>=0&&l+n.length+a>=r)return a+l;if(r==i&&s.length>=i+n.length-a&&s.slice(i-a,i-a+n.length)==n)return i}}return -1}(this.node.content,u,r-n,i-n);return s<0?null:{node:a,pos:s,text:u}}}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 Qm(this,o,n,i);t.input.compositionNodes.push(a),this.children=QA(this.children,r,r+i.length,t,a)}update(t,n,r,i){return!!(3!=this.dirty&&t.sameMarkup(this.node))&&(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=0}updateOuterDeco(t){if(QM(t,this.outerDeco))return;let n=1!=this.nodeDOM.nodeType,r=this.dom;this.dom=QO(this.dom,this.nodeDOM,Qw(this.outerDeco,this.node,n),Qw(t,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function Qv(t,n,r,i,o){QI(i,n,t);let a=new Qy(void 0,t,n,r,i,i,i,o,0);return a.contentDOM&&a.updateChildren(o,0),a}class Qb extends Qy{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!!(3!=this.dirty&&(0==this.dirty||this.inParent())&&t.sameMarkup(this.node))&&(this.updateOuterDeco(n),(0!=this.dirty||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=0,!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"characterData"!=t.type&&"selection"!=t.type}slice(t,n,r){let i=this.node.cut(t,n),o=document.createTextNode(i.text);return new Qb(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(t,n){super.markDirty(t,n),this.dom!=this.nodeDOM&&(0==t||n==this.nodeDOM.nodeValue.length)&&(this.dirty=3)}get domAtom(){return!1}}class Qx extends Qp{parseRule(){return{ignore:!0}}matchesHack(t){return 0==this.dirty&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class Q_ extends Qy{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(3==this.dirty)return!1;if(!this.spec.update)return(!!this.contentDOM||!!t.isLeaf)&&super.update(t,n,r,i);{let o=this.spec.update(t,n,r);return o&&this.updateInner(t,n,r,i),o}}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)}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}let QS=function(t){t&&(this.nodeName=t)};QS.prototype=Object.create(null);let QT=[new QS];function Qw(t,n,r){if(0==t.length)return QT;let i=r?QT[0]:new QS,o=[i];for(let a=0;a<t.length;a++){let u=t[a].type.attrs;if(u)for(let s in u.nodeName&&o.push(i=new QS(u.nodeName)),u){let c=u[s];null!=c&&(r&&1==o.length&&o.push(i=new QS(n.isInline?"span":"div")),"class"==s?i.class=(i.class?i.class+" ":"")+c:"style"==s?i.style=(i.style?i.style+";":"")+c:"nodeName"!=s&&(i[s]=c))}}return o}function QO(t,n,r,i){if(r==QT&&i==QT)return n;let o=n;for(let a=0;a<i.length;a++){let u=i[a],s=r[a];if(a){let c;s&&s.nodeName==u.nodeName&&o!=t&&(c=o.parentNode)&&c.nodeName.toLowerCase()==u.nodeName||((c=document.createElement(u.nodeName)).pmIsDeco=!0,c.appendChild(o),s=QT[0]),o=c}Qk(o,s||QT[0],u)}return o}function Qk(t,n,r){for(let i in n)"class"==i||"style"==i||"nodeName"==i||i in r||t.removeAttribute(i);for(let o in r)"class"!=o&&"style"!=o&&"nodeName"!=o&&r[o]!=n[o]&&t.setAttribute(o,r[o]);if(n.class!=r.class){let a=n.class?n.class.split(" ").filter(Boolean):[],u=r.class?r.class.split(" ").filter(Boolean):[];for(let s=0;s<a.length;s++)-1==u.indexOf(a[s])&&t.classList.remove(a[s]);for(let c=0;c<u.length;c++)-1==a.indexOf(u[c])&&t.classList.add(u[c]);0==t.classList.length&&t.removeAttribute("class")}if(n.style!=r.style){if(n.style){let l=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,f;for(;f=l.exec(n.style);)t.style.removeProperty(f[1])}r.style&&(t.style.cssText+=r.style)}}function QI(t,n,r){return QO(t,t,QT,Qw(n,r,1!=t.nodeType))}function QM(t,n){if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].type.eq(n[r].type))return!1;return!0}function QC(t){let n=t.nextSibling;return t.parentNode.removeChild(t),n}class QR{constructor(t,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=function(t,n){let r=n,i=r.children.length,o=t.childCount,a=new Map,u=[];e:for(;o>0;){let s;for(;;)if(i){let c=r.children[i-1];if(c instanceof Qg)r=c,i=c.children.length;else{s=c,i--;break}}else{if(r==n)break e;i=r.parent.children.indexOf(r),r=r.parent}let l=s.node;if(l){if(l!=t.child(o-1))break;--o,a.set(s,o),u.push(s)}}return{index:o,matched:a,matches:u.reverse()}}(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])&&!1!==t[i].type.spec.spanning;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=0,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 l=Qg.create(this.top,t[o],n,r);this.top.children.splice(this.index,0,l),this.top=l,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)&&(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(t,n,r,i,o){let a=this.top.children[i];return 3==a.dirty&&a.dom==a.contentDOM&&(a.dirty=2),!!a.update(t,n,r,o)&&(this.destroyBetween(this.index,i),this.index++,!0)}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 Qy){let c=this.preMatch.matched.get(s);if(null!=c&&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&&3!=s.dirty&&QM(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=2,f.updateChildren(i,a+1),f.dirty=0,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=Qy.create(this.top,n,r,i,o,a);if(!u.contentDOM)return null;for(let s of(u.children=t.children,t.children=[],t.destroy(),u.children))s.parent=u;return u}addNode(t,n,r,i,o){let a=Qy.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 Qh(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 Qg;)t=(n=t).children[n.children.length-1];(!t||!(t instanceof Qb)||/\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(t.node.text))&&((YY||YG)&&t&&"false"==t.dom.contentEditable&&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);"IMG"==t&&(r.className="ProseMirror-separator",r.alt=""),"BR"==t&&(r.className="ProseMirror-trailingBreak");let i=new Qx(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||1==t.nodeType&&t.contains(this.lock.parentNode))}}function QE(t,n){return t.type.side-n.type.side}function QA(t,n,r,i,o){let a=[];for(let u=0,s=0;u<t.length;u++){let c=t[u],l=s+=c.size;s>=r||l<=n?a.push(c):(s<n&&a.push(c.slice(0,n-s,i)),o&&(a.push(o),o=void 0),l>r&&a.push(c.slice(r-s,c.size,i)))}return a}function Qj(t,n=null){let r=t.domSelectionRange(),i=t.state.doc;if(!r.focusNode)return null;let o=t.docView.nearestDesc(r.focusNode),a=o&&0==o.size,u=t.docView.posFromDOM(r.focusNode,r.focusOffset,1);if(u<0)return null;let s=i.resolve(u),c,l;if(YL(r)){for(c=s;o&&!o.node;)o=o.parent;let f=o.node;if(o&&f.isAtom&&Yf.isSelectable(f)&&o.parent&&!(f.isInline&&function(t,n,r){for(let i=0==n,o=n==YN(t);i||o;){if(t==r)return!0;let a=YI(t);if(!(t=t.parentNode))return!1;i=i&&0==a,o=o&&a==YN(t)}}(r.focusNode,r.focusOffset,o.dom))){let d=o.posBefore;l=new Yf(u==d?s:i.resolve(d))}}else{let p=t.docView.posFromDOM(r.anchorNode,r.anchorOffset,1);if(p<0)return null;c=i.resolve(p)}if(!l){let h="pointer"==n||t.state.selection.head<s.pos&&!a?1:-1;l=QB(t,c,s,h)}return l}function QN(t){return t.editable?t.hasFocus():QV(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function QP(t,n=!1){let r=t.state.selection;if(QU(t,r),QN(t)){var i,o;if(!n&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&YG){let a=t.domSelectionRange(),u=t.domObserver.currentSelection;if(a.anchorNode&&u.anchorNode&&YE(a.anchorNode,a.anchorOffset,u.anchorNode,u.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper){let s,c,l,f;i=t,s=i.domSelection(),c=document.createRange(),l=i.cursorWrapper.dom,f="IMG"==l.nodeName,f?c.setEnd(l.parentNode,YI(l)+1):c.setEnd(l,0),c.collapse(!1),s.removeAllRanges(),s.addRange(c),!f&&!i.state.selection.visible&&Y$&&YK<=11&&(l.disabled=!0,l.disabled=!1)}else{let{anchor:d,head:p}=r,h,m,g,y,v,b;!QL||r instanceof Yc||(r.$from.parent.inlineContent||(h=QF(t,r.from)),r.empty||r.$from.parent.inlineContent||(m=QF(t,r.to))),t.docView.setSelection(d,p,t.root,n),QL&&(h&&QW(h),m&&QW(m)),r.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&(o=t,g=o.dom.ownerDocument,g.removeEventListener("selectionchange",o.input.hideSelectionGuard),y=o.domSelectionRange(),v=y.anchorNode,b=y.anchorOffset,g.addEventListener("selectionchange",o.input.hideSelectionGuard=()=>{(y.anchorNode!=v||y.anchorOffset!=b)&&(g.removeEventListener("selectionchange",o.input.hideSelectionGuard),setTimeout(()=>{(!QN(o)||o.state.selection.visible)&&o.dom.classList.remove("ProseMirror-hideselection")},20))})))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}let QL=YY||YG&&YJ<63;function QF(t,n){let{node:r,offset:i}=t.docView.domFromPos(n,0),o=i<r.childNodes.length?r.childNodes[i]:null,a=i?r.childNodes[i-1]:null;if(YY&&o&&"false"==o.contentEditable)return QD(o);if((!o||"false"==o.contentEditable)&&(!a||"false"==a.contentEditable)){if(o)return QD(o);if(a)return QD(a)}}function QD(t){return t.contentEditable="true",YY&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function QW(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function QU(t,n){if(n instanceof Yf){let r=t.docView.descAt(n.from);r!=t.lastSelectedViewDesc&&(Qz(t),r&&r.selectNode(),t.lastSelectedViewDesc=r)}else Qz(t)}function Qz(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function QB(t,n,r,i){return t.someProp("createSelectionBetween",i=>i(t,n,r))||Yc.between(n,r,i)}function Qq(t){return(!t.editable||!!t.hasFocus())&&QV(t)}function QV(t){let n=t.domSelectionRange();if(!n.anchorNode)return!1;try{return t.dom.contains(3==n.anchorNode.nodeType?n.anchorNode.parentNode:n.anchorNode)&&(t.editable||t.dom.contains(3==n.focusNode.nodeType?n.focusNode.parentNode:n.focusNode))}catch{return!1}}function Q$(t,n){let{$anchor:r,$head:i}=t.selection,o=n>0?r.max(i):r.min(i),a=o.parent.inlineContent?o.depth?t.doc.resolve(n>0?o.after():o.before()):null:o;return a&&Yo.findFrom(a,n)}function QK(t,n){return t.dispatch(t.state.tr.setSelection(n).scrollIntoView()),!0}function QH(t,n,r){let i=t.state.selection;if(i instanceof Yc){if(!i.empty||r.indexOf("s")>-1)return!1;if(t.endOfTextblock(n>0?"forward":"backward")){let o=Q$(t.state,n);return!!o&&o instanceof Yf&&QK(t,o)}if(!(YX&&r.indexOf("m")>-1)){let a=i.$head,u=a.textOffset?null:n<0?a.nodeBefore:a.nodeAfter,s;if(!u||u.isText)return!1;let c=n<0?a.pos-u.nodeSize:a.pos;return!!(u.isAtom||(s=t.docView.descAt(c))&&!s.contentDOM)&&(Yf.isSelectable(u)?QK(t,new Yf(n<0?t.state.doc.resolve(a.pos-u.nodeSize):a)):!!Y2&&QK(t,new Yc(t.state.doc.resolve(n<0?c:c+u.nodeSize))))}}else{if(i instanceof Yf&&i.node.isInline)return QK(t,new Yc(n>0?i.$to:i.$from));{let l=Q$(t.state,n);return!!l&&QK(t,l)}}}function QZ(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function QG(t){let n=t.pmViewDesc;return n&&0==n.size&&(t.nextSibling||"BR"!=t.nodeName)}function QJ(t,n){return n<0?function(t){let n=t.domSelectionRange(),r=n.focusNode,i=n.focusOffset;if(!r)return;let o,a,u=!1;for(YH&&1==r.nodeType&&i<QZ(r)&&QG(r.childNodes[i])&&(u=!0);;)if(i>0){if(1!=r.nodeType)break;{let s=r.childNodes[i-1];if(QG(s))o=r,a=--i;else if(3==s.nodeType)i=(r=s).nodeValue.length;else break}}else{if(QQ(r))break;{let c=r.previousSibling;for(;c&&QG(c);)o=r.parentNode,a=YI(c),c=c.previousSibling;if(c)i=QZ(r=c);else{if((r=r.parentNode)==t.dom)break;i=0}}}u?QX(t,r,i):o&&QX(t,o,a)}(t):QY(t)}function QY(t){let n=t.domSelectionRange(),r=n.focusNode,i=n.focusOffset;if(!r)return;let o=QZ(r),a,u;for(;;)if(i<o){if(1!=r.nodeType)break;if(QG(r.childNodes[i]))a=r,u=++i;else break}else{if(QQ(r))break;{let s=r.nextSibling;for(;s&&QG(s);)a=s.parentNode,u=YI(s)+1,s=s.nextSibling;if(s)i=0,o=QZ(r=s);else{if((r=r.parentNode)==t.dom)break;i=o=0}}}a&&QX(t,a,u)}function QQ(t){let n=t.pmViewDesc;return n&&n.node&&n.node.isBlock}function QX(t,n,r){let i=t.domSelection();if(YL(i)){let o=document.createRange();o.setEnd(n,r),o.setStart(n,r),i.removeAllRanges(),i.addRange(o)}else i.extend&&i.extend(n,r);t.domObserver.setCurSelection();let{state:a}=t;setTimeout(()=>{t.state==a&&QP(t)},50)}function Q0(t,n){let r=t.state.doc.resolve(n);if(!(YG||Y0)&&r.parent.inlineContent){let i=t.coordsAtPos(n);if(n>r.start()){let o=t.coordsAtPos(n-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(n<r.end()){let u=t.coordsAtPos(n+1),s=(u.top+u.bottom)/2;if(s>i.top&&s<i.bottom&&Math.abs(u.left-i.left)>1)return u.left>i.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(t.dom).direction?"rtl":"ltr"}function Q1(t,n,r){let i=t.state.selection;if(i instanceof Yc&&!i.empty||r.indexOf("s")>-1||YX&&r.indexOf("m")>-1)return!1;let{$from:o,$to:a}=i;if(!o.parent.inlineContent||t.endOfTextblock(n<0?"up":"down")){let u=Q$(t.state,n);if(u&&u instanceof Yf)return QK(t,u)}if(!o.parent.inlineContent){let s=n<0?o:a,c=i instanceof Yp?Yo.near(s,n):Yo.findFrom(s,n);return!!c&&QK(t,c)}return!1}function Q2(t,n){if(!(t.state.selection instanceof Yc))return!0;let{$head:r,$anchor:i,empty:o}=t.state.selection;if(!r.sameParent(i))return!0;if(!o)return!1;if(t.endOfTextblock(n>0?"forward":"backward"))return!0;let a=!r.textOffset&&(n<0?r.nodeBefore:r.nodeAfter);if(a&&!a.isText){let u=t.state.tr;return n<0?u.delete(r.pos-a.nodeSize,r.pos):u.delete(r.pos,r.pos+a.nodeSize),t.dispatch(u),!0}return!1}function Q3(t,n,r){t.domObserver.stop(),n.contentEditable=r,t.domObserver.start()}function Q4(t,n){t.someProp("transformCopied",r=>{n=r(n,t)});let r=[],{content:i,openStart:o,openEnd:a}=n;for(;o>1&&a>1&&1==i.childCount&&1==i.firstChild.childCount;){o--,a--;let u=i.firstChild;r.push(u.type.name,u.attrs!=u.type.defaultAttrs?u.attrs:null),i=u.content}let s=t.someProp("clipboardSerializer")||JI.fromSchema(t.state.schema),c=Xi(),l=c.createElement("div");l.appendChild(s.serializeFragment(i,{document:c}));let f=l.firstChild,d,p=0;for(;f&&1==f.nodeType&&(d=Xn[f.nodeName.toLowerCase()]);){for(let h=d.length-1;h>=0;h--){let m=c.createElement(d[h]);for(;l.firstChild;)m.appendChild(l.firstChild);l.appendChild(m),p++}f=l.firstChild}return f&&1==f.nodeType&&f.setAttribute("data-pm-slice",`${o} ${a}${p?` -${p}`:""} ${JSON.stringify(r)}`),{dom:l,text:t.someProp("clipboardTextSerializer",r=>r(n,t))||n.content.textBetween(0,n.content.size,`
7
-
8
- `)}}function Q5(t,n,r,i,o){let a=o.parent.type.spec.code,u,s;if(!r&&!n)return null;let c=n&&(i||a||!r);if(c){if(t.someProp("transformPastedText",r=>{n=r(n,a||i,t)}),a)return n?new GH(Gz.from(t.state.schema.text(n.replace(/\r\n?/g,`
9
- `))),0,0):GH.empty;let l=t.someProp("clipboardTextParser",r=>r(n,o,i,t));if(l)s=l;else{let f=o.marks(),{schema:d}=t.state,p=JI.fromSchema(d);u=document.createElement("div"),n.split(/(?:\r\n?|\n)+/).forEach(t=>{let n=u.appendChild(document.createElement("p"));t&&n.appendChild(p.serializeNode(d.text(t,f)))})}}else t.someProp("transformPastedHTML",n=>{r=n(r,t)}),u=function(t){let n=/^(\s*<meta [^>]*>)*/.exec(t);n&&(t=t.slice(n[0].length));let r=Xi().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(t),o;if((o=i&&Xn[i[1].toLowerCase()])&&(t=o.map(t=>"<"+t+">").join("")+t+o.map(t=>"</"+t+">").reverse().join("")),r.innerHTML=t,o)for(let a=0;a<o.length;a++)r=r.querySelector(o[a])||r;return r}(r),Y2&&function(t){let n=t.querySelectorAll(YG?"span:not([class]):not([style])":"span.Apple-converted-space");for(let r=0;r<n.length;r++){let i=n[r];1==i.childNodes.length&&"\xa0"==i.textContent&&i.parentNode&&i.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),i)}}(u);let h=u&&u.querySelector("[data-pm-slice]"),m=h&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(h.getAttribute("data-pm-slice")||"");if(m&&m[3])for(let g=+m[3];g>0;g--){let y=u.firstChild;for(;y&&1!=y.nodeType;)y=y.nextSibling;if(!y)break;u=y}if(s||(s=(t.someProp("clipboardParser")||t.someProp("domParser")||Jy.fromSchema(t.state.schema)).parseSlice(u,{preserveWhitespace:!!(c||m),context:o,ruleFromNode:t=>"BR"!=t.nodeName||t.nextSibling||!t.parentNode||Q6.test(t.parentNode.nodeName)?null:{ignore:!0}})),m)s=function(t,n){if(!t.size)return t;let r=t.content.firstChild.type.schema,i;try{i=JSON.parse(n)}catch{return t}let{content:o,openStart:a,openEnd:u}=t;for(let s=i.length-2;s>=0;s-=2){let c=r.nodes[i[s]];if(!c||c.hasRequiredAttrs())break;o=Gz.from(c.create(i[s+1],o)),a++,u++}return new GH(o,a,u)}(Xt(s,+m[1],+m[2]),m[4]);else if((s=GH.maxOpen(function(t,n){if(t.childCount<2)return t;for(let r=n.depth;r>=0;r--){let i=n.node(r).contentMatchAt(n.index(r)),o,a=[];if(t.forEach(t=>{if(!a)return;let n=i.findWrapping(t.type),r;if(!n)return a=null;if(r=a.length&&o.length&&Q8(n,o,t,a[a.length-1],0))a[a.length-1]=r;else{a.length&&(a[a.length-1]=Q7(a[a.length-1],o.length));let u=Q9(t,n);a.push(u),i=i.matchType(u.type),o=n}}),a)return Gz.from(a)}return t}(s.content,o),!0)).openStart||s.openEnd){let v=0,b=0;for(let x=s.content.firstChild;v<s.openStart&&!x.type.spec.isolating;v++,x=x.firstChild);for(let _=s.content.lastChild;b<s.openEnd&&!_.type.spec.isolating;b++,_=_.lastChild);s=Xt(s,v,b)}return t.someProp("transformPasted",n=>{s=n(s,t)}),s}let Q6=/^(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 Q9(t,n,r=0){for(let i=n.length-1;i>=r;i--)t=n[i].create(null,Gz.from(t));return t}function Q8(t,n,r,i,o){if(o<t.length&&o<n.length&&t[o]==n[o]){let a=Q8(t,n,r,i.lastChild,o+1);if(a)return i.copy(i.content.replaceChild(i.childCount-1,a));if(i.contentMatchAt(i.childCount).matchType(o==t.length-1?r.type:t[o+1]))return i.copy(i.content.append(Gz.from(Q9(r,t,o+1))))}}function Q7(t,n){if(0==n)return t;let r=t.content.replaceChild(t.childCount-1,Q7(t.lastChild,n-1)),i=t.contentMatchAt(t.childCount).fillBefore(Gz.empty,!0);return t.copy(r.append(i))}function Xe(t,n,r,i,o,a){let u=n<0?t.firstChild:t.lastChild,s=u.content;return t.childCount>1&&(a=0),o<i-1&&(s=Xe(s,n,r,i,o+1,a)),o>=r&&(s=n<0?u.contentMatchAt(0).fillBefore(s,a<=o).append(s):s.append(u.contentMatchAt(u.childCount).fillBefore(Gz.empty,!0))),t.replaceChild(n<0?0:t.childCount-1,u.copy(s))}function Xt(t,n,r){return n<t.openStart&&(t=new GH(Xe(t.content,-1,n,t.openStart,0,t.openEnd),n,t.openEnd)),r<t.openEnd&&(t=new GH(Xe(t.content,1,r,t.openEnd,0,0),t.openStart,r)),t}let Xn={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},Xr=null;function Xi(){return Xr||(Xr=document.implementation.createHTMLDocument("title"))}let Xo={},Xa={},Xu={touchstart:!0,touchmove:!0};class Xs{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 Xc(t,n){t.input.lastSelectionOrigin=n,t.input.lastSelectionTime=Date.now()}function Xl(t){t.someProp("handleDOMEvents",n=>{for(let r in n)t.input.eventHandlers[r]||t.dom.addEventListener(r,t.input.eventHandlers[r]=n=>Xf(t,n))})}function Xf(t,n){return t.someProp("handleDOMEvents",r=>{let i=r[n.type];return!!i&&(i(t,n)||n.defaultPrevented)})}function Xd(t,n){if(!n.bubbles)return!0;if(n.defaultPrevented)return!1;for(let r=n.target;r!=t.dom;r=r.parentNode)if(!r||11==r.nodeType||r.pmViewDesc&&r.pmViewDesc.stopEvent(n))return!1;return!0}function Xp(t){return{left:t.clientX,top:t.clientY}}function Xh(t,n,r,i,o){if(-1==i)return!1;let a=t.state.doc.resolve(i);for(let u=a.depth+1;u>0;u--)if(t.someProp(n,n=>u>a.depth?n(t,r,a.nodeAfter,a.before(u),o,!0):n(t,r,a.node(u),a.before(u),o,!1)))return!0;return!1}function Xm(t,n,r){t.focused||t.focus();let i=t.state.tr.setSelection(n);"pointer"==r&&i.setMeta("pointer",!0),t.dispatch(i)}function Xg(t,n,r,i){return Xh(t,"handleDoubleClickOn",n,r,i)||t.someProp("handleDoubleClick",r=>r(t,n,i))}function Xy(t,n,r,i){return Xh(t,"handleTripleClickOn",n,r,i)||t.someProp("handleTripleClick",r=>r(t,n,i))||function(t,n,r){if(0!=r.button)return!1;let i=t.state.doc;if(-1==n)return!!i.inlineContent&&(Xm(t,Yc.create(i,0,i.content.size),"pointer"),!0);let o=i.resolve(n);for(let a=o.depth+1;a>0;a--){let u=a>o.depth?o.nodeAfter:o.node(a),s=o.before(a);if(u.inlineContent)Xm(t,Yc.create(i,s+1,s+1+u.content.size),"pointer");else{if(!Yf.isSelectable(u))continue;Xm(t,Yf.create(i,s),"pointer")}return!0}}(t,r,i)}Xa.keydown=(t,n)=>{if(t.input.shiftKey=16==n.keyCode||n.shiftKey,!Xx(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Y1&&YG&&13==n.keyCode))){if(229!=n.keyCode&&t.domObserver.forceFlush(),!YQ||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)t.someProp("handleKeyDown",r=>r(t,n))||function(t,n){var r;let i,o=n.keyCode,a=(i="",n.ctrlKey&&(i+="c"),n.metaKey&&(i+="m"),n.altKey&&(i+="a"),n.shiftKey&&(i+="s"),i);if(8==o||YX&&72==o&&"c"==a)return Q2(t,-1)||QJ(t,-1);if(46==o&&!n.shiftKey||YX&&68==o&&"c"==a)return Q2(t,1)||QJ(t,1);if(13==o||27==o)return!0;if(37==o||YX&&66==o&&"c"==a){let u=37==o?"ltr"==Q0(t,t.state.selection.from)?-1:1:-1;return QH(t,u,a)||QJ(t,u)}if(39==o||YX&&70==o&&"c"==a){let s=39==o?"ltr"==Q0(t,t.state.selection.from)?1:-1:1;return QH(t,s,a)||QJ(t,s)}return 38==o||YX&&80==o&&"c"==a?Q1(t,-1,a)||QJ(t,-1):40==o||YX&&78==o&&"c"==a?function(t){if(!YY||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:n,focusOffset:r}=t.domSelectionRange();if(n&&1==n.nodeType&&0==r&&n.firstChild&&"false"==n.firstChild.contentEditable){let i=n.firstChild;Q3(t,i,"true"),setTimeout(()=>Q3(t,i,"false"),20)}return!1}(t)||Q1(t,1,a)||QY(t):a==(YX?"m":"c")&&(66==o||73==o||89==o||90==o)}(t,n)?n.preventDefault():Xc(t,"key");else{let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",n=>n(t,YF(13,"Enter"))),t.input.lastIOSEnter=0)},200)}}},Xa.keyup=(t,n)=>{16==n.keyCode&&(t.input.shiftKey=!1)},Xa.keypress=(t,n)=>{if(Xx(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||YX&&n.metaKey)return;if(t.someProp("handleKeyPress",r=>r(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof Yc)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode);/[\r\n]/.test(i)||t.someProp("handleTextInput",n=>n(t,r.$from.pos,r.$to.pos,i))||t.dispatch(t.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}};let Xv=YX?"metaKey":"ctrlKey";Xo.mousedown=(t,n)=>{var r,i,o;t.input.shiftKey=n.shiftKey;let a=Xw(t),u=Date.now(),s="singleClick",c,l;u-t.input.lastClick.time<500&&(c=(o=t.input.lastClick).x-n.clientX,c*c+(l=o.y-n.clientY)*l<100)&&!n[Xv]&&("singleClick"==t.input.lastClick.type?s="doubleClick":"doubleClick"==t.input.lastClick.type&&(s="tripleClick")),t.input.lastClick={time:u,x:n.clientX,y:n.clientY,type:s};let f=t.posAtCoords(Xp(n));f&&("singleClick"==s?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new Xb(t,f,n,!!a)):("doubleClick"==s?Xg:Xy)(t,f.pos,f.inside,n)?n.preventDefault():Xc(t,"pointer"))};class Xb{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[Xv],this.allowDefault=r.shiftKey;let o,a;if(n.inside>-1)o=t.state.doc.nodeAt(n.inside),a=n.inside;else{let u=t.state.doc.resolve(n.pos);o=u.parent,a=u.depth?u.before():0}let s=i?null:r.target,c=s?t.docView.nearestDesc(s,!0):null;this.target=c?c.dom:null;let{selection:l}=t.state;(0==r.button&&o.type.spec.draggable&&!1!==o.type.spec.selectable||l instanceof Yf&&l.from<=a&&l.to>a)&&(this.mightDrag={node:o,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&YH&&!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)),Xc(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(()=>QP(this.view)),this.view.input.mouseDown=null}up(t){var n,r,i,o,a;if(this.done(),!this.view.dom.contains(t.target))return;let u=this.pos;this.view.state.doc!=this.startDoc&&(u=this.view.posAtCoords(Xp(t))),this.updateAllowDefault(t),this.allowDefault||!u?Xc(this.view,"pointer"):(n=this.view,r=u.pos,i=u.inside,a=this.selectNode,Xh(n,"handleClickOn",r,i,t)||n.someProp("handleClick",i=>i(n,r,t))||(a?function(t,n){if(-1==n)return!1;let r=t.state.selection,i,o;r instanceof Yf&&(i=r.node);let a=t.state.doc.resolve(n);for(let u=a.depth+1;u>0;u--){let s=u>a.depth?a.nodeAfter:a.node(u);if(Yf.isSelectable(s)){o=i&&r.$from.depth>0&&u>=r.$from.depth&&a.before(r.$from.depth+1)==r.$from.pos?a.before(r.$from.depth):a.before(u);break}}return null!=o&&(Xm(t,Yf.create(t.state.doc,o),"pointer"),!0)}(n,i):function(t,n){if(-1==n)return!1;let r=t.state.doc.resolve(n),i=r.nodeAfter;return!!(i&&i.isAtom&&Yf.isSelectable(i))&&(Xm(t,new Yf(r),"pointer"),!0)}(n,i)))?t.preventDefault():0==t.button&&(this.flushed||YY&&this.mightDrag&&!this.mightDrag.node.isAtom||YG&&!this.view.state.selection.visible&&2>=Math.min(Math.abs(u.pos-this.view.state.selection.from),Math.abs(u.pos-this.view.state.selection.to)))?(Xm(this.view,Yo.near(this.view.state.doc.resolve(u.pos)),"pointer"),t.preventDefault()):Xc(this.view,"pointer")}move(t){this.updateAllowDefault(t),Xc(this.view,"pointer"),0==t.buttons&&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)}}function Xx(t,n){return!!t.composing||!!(YY&&500>Math.abs(n.timeStamp-t.input.compositionEndedAt))&&(t.input.compositionEndedAt=-2e8,!0)}Xo.touchstart=t=>{t.input.lastTouch=Date.now(),Xw(t),Xc(t,"pointer")},Xo.touchmove=t=>{t.input.lastTouch=Date.now(),Xc(t,"pointer")},Xo.contextmenu=t=>{var n;return Xw(t)};let X_=Y1?5e3:-1;function XS(t,n){clearTimeout(t.input.composingTimeout),n>-1&&(t.input.composingTimeout=setTimeout(()=>Xw(t),n))}function XT(t){let n;for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=(n=document.createEvent("Event"),n.initEvent("event",!0,!0),n.timeStamp));t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function Xw(t,n=!1){if(!(Y1&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),XT(t),n||t.docView&&t.docView.dirty){let r=Qj(t);return r&&!r.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(r)):t.updateState(t.state),!0}return!1}}Xa.compositionstart=Xa.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:n}=t,r=n.selection.$from;if(n.selection.empty&&(n.storedMarks||!r.textOffset&&r.parentOffset&&r.nodeBefore.marks.some(t=>!1===t.type.spec.inclusive)))t.markCursor=t.state.storedMarks||r.marks(),Xw(t,!0),t.markCursor=null;else if(Xw(t),YH&&n.selection.empty&&r.parentOffset&&!r.textOffset&&r.nodeBefore.marks.length){let i=t.domSelectionRange();for(let o=i.focusNode,a=i.focusOffset;o&&1==o.nodeType&&0!=a;){let u=a<0?o.lastChild:o.childNodes[a-1];if(!u)break;if(3==u.nodeType){t.domSelection().collapse(u,u.nodeValue.length);break}o=u,a=-1}}t.input.composing=!0}XS(t,X_)},Xa.compositionend=(t,n)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=n.timeStamp,t.input.compositionID++,XS(t,20))};let XO=Y$&&YK<15||YQ&&Y3<604;function Xk(t,n,r,i,o){var a;let u=Q5(t,n,r,i,t.state.selection.$from);if(t.someProp("handlePaste",n=>n(t,o,u||GH.empty)))return!0;if(!u)return!1;let s=0==u.openStart&&0==u.openEnd&&1==u.content.childCount?u.content.firstChild:null,c=s?t.state.tr.replaceSelectionWith(s,i):t.state.tr.replaceSelection(u);return t.dispatch(c.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}Xo.copy=Xa.cut=(t,n)=>{let r=t.state.selection,i="cut"==n.type;if(r.empty)return;let o=XO?null:n.clipboardData,{dom:a,text:u}=Q4(t,r.content());o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",u)):function(t,n){if(!t.dom.parentNode)return;let r=t.dom.parentNode.appendChild(document.createElement("div"));r.appendChild(n),r.style.cssText="position: fixed; left: -10000px; top: 10px";let i=getSelection(),o=document.createRange();o.selectNodeContents(n),t.dom.blur(),i.removeAllRanges(),i.addRange(o),setTimeout(()=>{r.parentNode&&r.parentNode.removeChild(r),t.focus()},50)}(t,a),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},Xa.paste=(t,n)=>{if(t.composing&&!Y1)return;let r=XO?null:n.clipboardData,i=t.input.shiftKey&&45!=t.input.lastKeyCode;r&&Xk(t,r.getData("text/plain"),r.getData("text/html"),i,n)?n.preventDefault():function(t,n){if(!t.dom.parentNode)return;let r=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,i=t.dom.parentNode.appendChild(document.createElement(r?"textarea":"div"));r||(i.contentEditable="true"),i.style.cssText="position: fixed; left: -10000px; top: 10px",i.focus();let o=t.input.shiftKey&&45!=t.input.lastKeyCode;setTimeout(()=>{t.focus(),i.parentNode&&i.parentNode.removeChild(i),r?Xk(t,i.value,null,o,n):Xk(t,i.textContent,i.innerHTML,o,n)},50)}(t,n)};class XI{constructor(t,n){this.slice=t,this.move=n}}let XM=YX?"altKey":"ctrlKey";for(let XC in Xo.dragstart=(t,n)=>{let r=n,i=t.input.mouseDown;if(i&&i.done(),!r.dataTransfer)return;let o=t.state.selection,a=o.empty?null:t.posAtCoords(Xp(r));if(!(a&&a.pos>=o.from&&a.pos<=(o instanceof Yf?o.to-1:o.to))){if(i&&i.mightDrag)t.dispatch(t.state.tr.setSelection(Yf.create(t.state.doc,i.mightDrag.pos)));else if(r.target&&1==r.target.nodeType){let u=t.docView.nearestDesc(r.target,!0);u&&u.node.type.spec.draggable&&u!=t.docView&&t.dispatch(t.state.tr.setSelection(Yf.create(t.state.doc,u.posBefore)))}}let s=t.state.selection.content(),{dom:c,text:l}=Q4(t,s);r.dataTransfer.clearData(),r.dataTransfer.setData(XO?"Text":"text/html",c.innerHTML),r.dataTransfer.effectAllowed="copyMove",XO||r.dataTransfer.setData("text/plain",l),t.dragging=new XI(s,!r[XM])},Xo.dragend=t=>{let n=t.dragging;window.setTimeout(()=>{t.dragging==n&&(t.dragging=null)},50)},Xa.dragover=Xa.dragenter=(t,n)=>n.preventDefault(),Xa.drop=(t,n)=>{let r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(Xp(n));if(!i)return;let o=t.state.doc.resolve(i.pos),a=r&&r.slice;a?t.someProp("transformPasted",n=>{a=n(a,t)}):a=Q5(t,n.dataTransfer.getData(XO?"Text":"text/plain"),XO?null:n.dataTransfer.getData("text/html"),!1,o);let u=!!(r&&!n[XM]);if(t.someProp("handleDrop",r=>r(t,n,a||GH.empty,u))){n.preventDefault();return}if(!a)return;n.preventDefault();let s=a?function(t,n,r){let i=t.resolve(n);if(!r.content.size)return n;let o=r.content;for(let a=0;a<r.openStart;a++)o=o.firstChild.content;for(let u=1;u<=(0==r.openStart&&r.size?2:1);u++)for(let s=i.depth;s>=0;s--){let c=s==i.depth?0:i.pos<=(i.start(s+1)+i.end(s+1))/2?-1:1,l=i.index(s)+(c>0?1:0),f=i.node(s),d=!1;if(1==u)d=f.canReplace(l,l,o);else{let p=f.contentMatchAt(l).findWrapping(o.firstChild.type);d=p&&f.canReplaceWith(l,l,p[0])}if(d)return 0==c?i.pos:c<0?i.before(s+1):i.after(s+1)}return null}(t.state.doc,o.pos,a):o.pos;null==s&&(s=o.pos);let c=t.state.tr;u&&c.deleteSelection();let l=c.mapping.map(s),f=0==a.openStart&&0==a.openEnd&&1==a.content.childCount,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&&Yf.isSelectable(a.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new Yf(p));else{let h=c.mapping.map(s);c.mapping.maps[c.mapping.maps.length-1].forEach((t,n,r,i)=>h=i),c.setSelection(QB(t,p,c.doc.resolve(h)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))},Xo.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&QP(t)},20))},Xo.blur=(t,n)=>{t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)},Xo.beforeinput=(t,n)=>{if(YG&&Y1&&"deleteContentBackward"==n.inputType){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",n=>n(t,YF(8,"Backspace")))))return;let{$cursor:n}=t.state.selection;n&&n.pos>0&&t.dispatch(t.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}},Xa)Xo[XC]=Xa[XC];function XR(t,n){if(t==n)return!0;for(let r in t)if(t[r]!==n[r])return!1;for(let i in n)if(!(i in t))return!1;return!0}class XE{constructor(t,n){this.toDOM=t,this.spec=n||XL,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 XN(o-r,o-r,this)}valid(){return!0}eq(t){return this==t||t instanceof XE&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&XR(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class XA{constructor(t,n){this.attrs=t,this.spec=n||XL}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 XN(o,a,this)}valid(t,n){return n.from<n.to}eq(t){return this==t||t instanceof XA&&XR(this.attrs,t.attrs)&&XR(this.spec,t.spec)}static is(t){return t.type instanceof XA}destroy(){}}let Xj=class t{constructor(t,n){this.attrs=t,this.spec=n||XL}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 XN(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(n){return this==n||n instanceof t&&XR(this.attrs,n.attrs)&&XR(this.spec,n.spec)}destroy(){}};class XN{constructor(t,n,r){this.from=t,this.to=n,this.type=r}copy(t,n){return new XN(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 XN(t,t,new XE(n,r))}static inline(t,n,r,i){return new XN(t,n,new XA(r,i))}static node(t,n,r,i){return new XN(t,n,new Xj(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof XA}}let XP=[],XL={};class XF{constructor(t,n){this.local=t.length?t:XP,this.children=n.length?n:XP}static create(t,n){return n.length?Xq(n,t,0,XL):XD}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 s=0;s<this.children.length;s+=3)if(this.children[s]<n&&this.children[s+1]>t){let c=this.children[s]+1;this.children[s+2].findInner(t-c,n-c,r,i+c,o)}}map(t,n,r){return this==XD||0==t.maps.length?this:this.mapInner(t,n,0,0,r||XL)}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?function(t,n,r,i,o,a,u){let s=t.slice();for(let c=0,l=a;c<r.maps.length;c++){let f=0;r.maps[c].forEach((t,n,r,i)=>{let a=i-r-(n-t);for(let u=0;u<s.length;u+=3){let c=s[u+1];if(c<0||t>c+l-f)continue;let d=s[u]+l-f;n>=d?s[u+1]=t<=d?-2:-1:r>=o&&a&&(s[u]+=a,s[u+1]+=a)}f+=a}),l=r.maps[c].map(l,-1)}let d=!1;for(let p=0;p<s.length;p+=3)if(s[p+1]<0){if(-2==s[p+1]){d=!0,s[p+1]=-1;continue}let h=r.map(t[p]+a),m=h-o;if(m<0||m>=i.content.size){d=!0;continue}let g=r.map(t[p+1]+a,-1)-o,{index:y,offset:v}=i.content.findIndex(m),b=i.maybeChild(y);if(b&&v==m&&v+b.nodeSize==g){let x=s[p+2].mapInner(r,b,h+1,t[p]+a+1,u);x!=XD?(s[p]=m,s[p+1]=g,s[p+2]=x):(s[p+1]=-2,d=!0)}else d=!0}if(d){let _=function(t,n,r,i,o,a,u){function s(t,n){for(let a=0;a<t.local.length;a++){let c=t.local[a].map(i,o,n);c?r.push(c):u.onRemove&&u.onRemove(t.local[a].spec)}for(let l=0;l<t.children.length;l+=3)s(t.children[l+2],t.children[l]+n+1)}for(let c=0;c<t.length;c+=3)-1==t[c+1]&&s(t[c+2],n[c]+a+1);return r}(s,t,n,r,o,a,u),S=Xq(_,i,0,u);n=S.local;for(let T=0;T<s.length;T+=3)s[T+1]<0&&(s.splice(T,3),T-=3);for(let w=0,O=0;w<S.children.length;w+=3){let k=S.children[w];for(;O<s.length&&s[O]<k;)O+=3;s.splice(O,0,S.children[w],S.children[w+1],S.children[w+2])}}return new XF(n.sort(XV),s)}(this.children,a||[],t,n,r,i,o):a?new XF(a.sort(XV),XP):XD}add(t,n){return n.length?this==XD?XF.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,o=0;t.forEach((t,a)=>{let u=a+r,s;if(s=Xz(n,t,u)){for(i||(i=this.children.slice());o<i.length&&i[o]<a;)o+=3;i[o]==a?i[o+2]=i[o+2].addInner(t,s,u+1):i.splice(o,0,a,a+t.nodeSize,Xq(s,t,u+1,XL)),o+=3}});let a=XU(o?XB(n):n,-r);for(let u=0;u<a.length;u++)a[u].type.valid(t,a[u])||a.splice(u--,1);return new XF(a.length?this.local.concat(a).sort(XV):this.local,i||this.children)}remove(t){return 0==t.length||this==XD?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 c=0,l;c<t.length;c++)(l=t[c])&&l.from>u&&l.to<s&&(t[c]=null,(a||(a=[])).push(l));if(!a)continue;r==this.children&&(r=this.children.slice());let f=r[o+2].removeInner(a,u+1);f!=XD?r[o+2]=f:(r.splice(o,3),o-=3)}if(i.length){for(let d=0,p;d<t.length;d++)if(p=t[d])for(let h=0;h<i.length;h++)i[h].eq(p,n)&&(i==this.local&&(i=this.local.slice()),i.splice(h--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new XF(i,r):XD}forChild(t,n){if(this==XD)return this;if(n.isLeaf)return XF.empty;let r,i;for(let o=0;o<this.children.length;o+=3)if(this.children[o]>=t){this.children[o]==t&&(r=this.children[o+2]);break}let a=t+1,u=a+n.content.size;for(let s=0;s<this.local.length;s++){let c=this.local[s];if(c.from<u&&c.to>a&&c.type instanceof XA){let l=Math.max(a,c.from)-a,f=Math.min(u,c.to)-a;l<f&&(i||(i=[])).push(c.copy(l,f))}}if(i){let d=new XF(i.sort(XV),XP);return r?new XW([d,r]):d}return r||XD}eq(t){if(this==t)return!0;if(!(t instanceof XF)||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 r=0;r<this.children.length;r+=3)if(this.children[r]!=t.children[r]||this.children[r+1]!=t.children[r+1]||!this.children[r+2].eq(t.children[r+2]))return!1;return!0}locals(t){return X$(this.localsInner(t))}localsInner(t){if(this==XD)return XP;if(t.inlineContent||!this.local.some(XA.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof XA||n.push(this.local[r]);return n}}XF.empty=new XF([],[]),XF.removeOverlap=X$;let XD=XF.empty;class XW{constructor(t){this.members=t}map(t,n){let r=this.members.map(r=>r.map(t,n,XL));return XW.from(r)}forChild(t,n){if(n.isLeaf)return XF.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(t,n);o!=XD&&(o instanceof XW?r=r.concat(o.members):r.push(o))}return XW.from(r)}eq(t){if(!(t instanceof XW)||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){r&&(n=n.slice(),r=!1);for(let a=0;a<o.length;a++)n.push(o[a])}else n=o}}return n?X$(r?n:n.sort(XV)):XP}static from(t){switch(t.length){case 0:return XD;case 1:return t[0];default:return new XW(t.every(t=>t instanceof XF)?t:t.reduce((t,n)=>t.concat(n instanceof XF?n:n.members),[]))}}}function XU(t,n){if(!n||!t.length)return t;let r=[];for(let i=0;i<t.length;i++){let o=t[i];r.push(new XN(o.from+n,o.to+n,o.type))}return r}function Xz(t,n,r){if(n.isLeaf)return null;let i=r+n.nodeSize,o=null;for(let a=0,u;a<t.length;a++)(u=t[a])&&u.from>r&&u.to<i&&((o||(o=[])).push(u),t[a]=null);return o}function XB(t){let n=[];for(let r=0;r<t.length;r++)null!=t[r]&&n.push(t[r]);return n}function Xq(t,n,r,i){let o=[],a=!1;n.forEach((n,u)=>{let s=Xz(t,n,u+r);if(s){a=!0;let c=Xq(s,n,r+u+1,i);c!=XD&&o.push(u,u+n.nodeSize,c)}});let u=XU(a?XB(t):t,-r).sort(XV);for(let s=0;s<u.length;s++)u[s].type.valid(n,u[s])||(i.onRemove&&i.onRemove(u[s].spec),u.splice(s--,1));return u.length||o.length?new XF(u,o):XD}function XV(t,n){return t.from-n.from||t.to-n.to}function X$(t){let n=t;for(let r=0;r<n.length-1;r++){let i=n[r];if(i.from!=i.to)for(let o=r+1;o<n.length;o++){let a=n[o];if(a.from==i.from){a.to!=i.to&&(n==t&&(n=t.slice()),n[o]=a.copy(a.from,i.to),XK(n,o+1,a.copy(i.to,a.to)));continue}a.from<i.to&&(n==t&&(n=t.slice()),n[r]=i.copy(i.from,a.from),XK(n,o,i.copy(a.from,i.to)));break}}return n}function XK(t,n,r){for(;n<t.length&&XV(r,t[n])>0;)n++;t.splice(n,0,r)}function XH(t){let n=[];return t.someProp("decorations",r=>{let i=r(t.state);i&&i!=XD&&n.push(i)}),t.cursorWrapper&&n.push(XF.create(t.state.doc,[t.cursorWrapper.deco])),XW.from(n)}let XZ={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},XG=Y$&&YK<=11;class XJ{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 XY{constructor(t,n){this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new XJ,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let n=0;n<t.length;n++)this.queue.push(t[n]);Y$&&YK<=11&&t.some(t=>"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length)?this.flushSoon():this.flush()}),XG&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.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,XZ)),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(Qq(this.view)){if(this.suppressingSelectionUpdates)return QP(this.view);if(Y$&&YK<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&YE(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 i=t.focusNode;i;i=YM(i))n.add(i);for(let o=t.anchorNode;o;o=YM(o))if(n.has(o)){r=o;break}let a=r&&this.view.docView.nearestDesc(r);if(a&&a.ignoreMutation({type:"selection",target:3==r.nodeType?r.parentNode:r}))return this.setCurSelection(),!0}flush(){var t;let{view:n}=this;if(!n.docView||this.flushingSoon>-1)return;let r=this.observer?this.observer.takeRecords():[];this.queue.length&&(r=this.queue.concat(r),this.queue.length=0);let i=n.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(i)&&Qq(n)&&!this.ignoreSelectionChange(i),a=-1,u=-1,s=!1,c=[];if(n.editable)for(let l=0;l<r.length;l++){let f=this.registerMutation(r[l],c);f&&(a=a<0?f.from:Math.min(f.from,a),u=u<0?f.to:Math.max(f.to,u),f.typeOver&&(s=!0))}if(YH&&c.length>1){let d=c.filter(t=>"BR"==t.nodeName);if(2==d.length){let p=d[0],h=d[1];p.parentNode&&p.parentNode.parentNode==h.parentNode?h.remove():p.remove()}}let m=null;a<0&&o&&n.input.lastFocus>Date.now()-200&&Math.max(n.input.lastTouch,n.input.lastClick.time)<Date.now()-300&&YL(i)&&(m=Qj(n))&&m.eq(Yo.near(n.state.doc.resolve(0),1))?(n.input.lastFocus=0,QP(n),this.currentSelection.set(i),n.scrollToSelection()):(a>-1||o)&&(a>-1&&(n.docView.markDirty(a,u),t=n,XQ.has(t)||(XQ.set(t,null),-1===["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace))||(t.requiresGeckoHackNode=YH,XX||(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."),XX=!0))),this.handleDOMChange(a,u,s,c),n.docView&&n.docView.dirty?n.updateState(n.state):this.currentSelection.eq(i)||QP(n),this.currentSelection.set(i))}registerMutation(t,n){if(n.indexOf(t.target)>-1)return null;let r=this.view.docView.nearestDesc(t.target);if("attributes"==t.type&&(r==this.view.docView||"contenteditable"==t.attributeName||"style"==t.attributeName&&!t.oldValue&&!t.target.getAttribute("style"))||!r||r.ignoreMutation(t))return null;if("childList"!=t.type)return"attributes"==t.type?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:{from:r.posAtStart,to:r.posAtEnd,typeOver:t.target.nodeValue==t.oldValue};{for(let i=0;i<t.addedNodes.length;i++)n.push(t.addedNodes[i]);if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(t.target))return{from:r.posBefore,to:r.posAfter};let o=t.previousSibling,a=t.nextSibling;if(Y$&&YK<=11&&t.addedNodes.length)for(let u=0;u<t.addedNodes.length;u++){let{previousSibling:s,nextSibling:c}=t.addedNodes[u];(!s||0>Array.prototype.indexOf.call(t.addedNodes,s))&&(o=s),(!c||0>Array.prototype.indexOf.call(t.addedNodes,c))&&(a=c)}let l=o&&o.parentNode==t.target?YI(o)+1:0,f=r.localPosFromDOM(t.target,l,-1),d=a&&a.parentNode==t.target?YI(a):t.target.childNodes.length,p=r.localPosFromDOM(t.target,d,1);return{from:f,to:p}}}}let XQ=new WeakMap,XX=!1;function X0(t){let n=t.pmViewDesc;if(n)return n.parseRule();if("BR"==t.nodeName&&t.parentNode){if(YY&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let r=document.createElement("div");return r.appendChild(document.createElement("li")),{skip:r}}if(t.parentNode.lastChild==t||YY&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if("IMG"==t.nodeName&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}let X1=/^(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 X2(t,n,r){return Math.max(r.anchor,r.head)>n.content.size?null:QB(t,n.resolve(r.anchor),n.resolve(r.head))}function X3(t,n,r){let i=t.depth,o=n?t.end():t.pos;for(;i>0&&(n||t.indexAfter(i)==t.node(i).childCount);)i--,o++,n=!1;if(r){let a=t.node(i).maybeChild(t.indexAfter(i));for(;a&&!a.isLeaf;)a=a.firstChild,o++}return o}class X4{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 Xs,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(X7),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):"function"==typeof t?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=X9(this),X6(this),this.nodeViews=X8(this),this.docView=Qv(this.state.doc,X5(this),XH(this),this.dom,this),this.domObserver=new XY(this,(t,n,r,i)=>(function(t,n,r,i,o){if(n<0){let a=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,u=Qj(t,a);if(u&&!t.state.selection.eq(u)){if(YG&&Y1&&13===t.input.lastKeyCode&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",n=>n(t,YF(13,"Enter"))))return;let s=t.state.tr.setSelection(u);"pointer"==a?s.setMeta("pointer",!0):"key"==a&&s.scrollIntoView(),t.composing&&s.setMeta("composition",t.input.compositionID),t.dispatch(s)}return}let c=t.state.doc.resolve(n),l=c.sharedDepth(r);n=c.before(l+1),r=t.state.doc.resolve(r).after(l+1);let f=t.state.selection,d=function(t,n,r){let{node:i,fromOffset:o,toOffset:a,from:u,to:s}=t.docView.parseRange(n,r),c=t.domSelectionRange(),l,f=c.anchorNode;if(f&&t.dom.contains(1==f.nodeType?f:f.parentNode)&&(l=[{node:f,offset:c.anchorOffset}],YL(c)||l.push({node:c.focusNode,offset:c.focusOffset})),YG&&8===t.input.lastKeyCode)for(let d=a;d>o;d--){let p=i.childNodes[d-1],h=p.pmViewDesc;if("BR"==p.nodeName&&!h){a=d;break}if(!h||h.size)break}let m=t.state.doc,g=t.someProp("domParser")||Jy.fromSchema(t.state.schema),y=m.resolve(u),v=null,b=g.parse(i,{topNode:y.parent,topMatch:y.parent.contentMatchAt(y.index()),topOpen:!0,from:o,to:a,preserveWhitespace:"pre"!=y.parent.type.whitespace||"full",findPositions:l,ruleFromNode:X0,context:y});if(l&&null!=l[0].pos){let x=l[0].pos,_=l[1]&&l[1].pos;null==_&&(_=x),v={anchor:x+u,head:_+u}}return{doc:b,sel:v,from:u,to:s}}(t,n,r),p=t.state.doc,h=p.slice(d.from,d.to),m,g;8===t.input.lastKeyCode&&Date.now()-100<t.input.lastKeyCodeTime?(m=t.state.selection.to,g="end"):(m=t.state.selection.from,g="start"),t.input.lastKeyCode=null;let y=function(t,n,r,i,o){let a=t.findDiffStart(n,r);if(null==a)return null;let{a:u,b:s}=t.findDiffEnd(n,r+t.size,r+n.size);if("end"==o){let c=Math.max(0,a-Math.min(u,s));i-=u+c-a}if(u<a&&t.size<n.size){let l=i<=a&&i>=u?a-i:0;a-=l,s=a+(s-u),u=a}else if(s<a){let f=i<=a&&i>=s?a-i:0;a-=f,u=a+(u-s),s=a}return{start:a,endA:u,endB:s}}(h.content,d.doc.content,d.from,m,g);if((YQ&&t.input.lastIOSEnter>Date.now()-225||Y1)&&o.some(t=>1==t.nodeType&&!X1.test(t.nodeName))&&(!y||y.endA>=y.endB)&&t.someProp("handleKeyDown",n=>n(t,YF(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!y){if(i&&f instanceof Yc&&!f.empty&&f.$head.sameParent(f.$anchor)&&!t.composing&&!(d.sel&&d.sel.anchor!=d.sel.head))y={start:f.from,endA:f.to,endB:f.to};else{if(d.sel){let v=X2(t,t.state.doc,d.sel);if(v&&!v.eq(t.state.selection)){let b=t.state.tr.setSelection(v);t.composing&&b.setMeta("composition",t.input.compositionID),t.dispatch(b)}}return}}if(YG&&t.cursorWrapper&&d.sel&&d.sel.anchor==t.cursorWrapper.deco.from&&d.sel.head==d.sel.anchor){let x=y.endB-y.start;d.sel={anchor:d.sel.anchor+x,head:d.sel.anchor+x}}t.input.domChangeCount++,t.state.selection.from<t.state.selection.to&&y.start==y.endB&&t.state.selection instanceof Yc&&(y.start>t.state.selection.from&&y.start<=t.state.selection.from+2&&t.state.selection.from>=d.from?y.start=t.state.selection.from:y.endA<t.state.selection.to&&y.endA>=t.state.selection.to-2&&t.state.selection.to<=d.to&&(y.endB+=t.state.selection.to-y.endA,y.endA=t.state.selection.to)),Y$&&YK<=11&&y.endB==y.start+1&&y.endA==y.start&&y.start>d.from&&" \xa0"==d.doc.textBetween(y.start-d.from-1,y.start-d.from+1)&&(y.start--,y.endA--,y.endB--);let _=d.doc.resolveNoCache(y.start-d.from),S=d.doc.resolveNoCache(y.endB-d.from),T=p.resolve(y.start),w=_.sameParent(S)&&_.parent.inlineContent&&T.end()>=y.endA,O;if((YQ&&t.input.lastIOSEnter>Date.now()-225&&(!w||o.some(t=>"DIV"==t.nodeName||"P"==t.nodeName))||!w&&_.pos<d.doc.content.size&&!_.sameParent(S)&&(O=Yo.findFrom(d.doc.resolve(_.pos+1),1,!0))&&O.head==S.pos)&&t.someProp("handleKeyDown",n=>n(t,YF(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>y.start&&function(t,n,r,i,o){if(!i.parent.isTextblock||r-n<=o.pos-i.pos||X3(i,!0,!1)<o.pos)return!1;let a=t.resolve(n);if(a.parentOffset<a.parent.content.size||!a.parent.isTextblock)return!1;let u=t.resolve(X3(a,!0,!0));return!(!u.parent.isTextblock||u.pos>r||X3(u,!0,!1)<r)&&i.parent.content.cut(i.parentOffset).eq(u.parent.content)}(p,y.start,y.endA,_,S)&&t.someProp("handleKeyDown",n=>n(t,YF(8,"Backspace")))){Y1&&YG&&t.domObserver.suppressSelectionUpdates();return}YG&&Y1&&y.endB==y.start&&(t.input.lastAndroidDelete=Date.now()),Y1&&!w&&_.start()!=S.start()&&0==S.parentOffset&&_.depth==S.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==y.endA&&(y.endB-=2,S=d.doc.resolveNoCache(y.endB-d.from),setTimeout(()=>{t.someProp("handleKeyDown",function(n){return n(t,YF(13,"Enter"))})},20));let k=y.start,I=y.endA,M,C,R;if(w){if(_.pos==S.pos)Y$&&YK<=11&&0==_.parentOffset&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>QP(t),20)),M=t.state.tr.delete(k,I),C=p.resolve(y.start).marksAcross(p.resolve(y.endA));else if(y.endA==y.endB&&(R=function(t,n){let r=t.firstChild.marks,i=n.firstChild.marks,o=r,a=i,u,s,c;for(let l=0;l<i.length;l++)o=i[l].removeFromSet(o);for(let f=0;f<r.length;f++)a=r[f].removeFromSet(a);if(1==o.length&&0==a.length)s=o[0],u="add",c=t=>t.mark(s.addToSet(t.marks));else{if(0!=o.length||1!=a.length)return null;s=a[0],u="remove",c=t=>t.mark(s.removeFromSet(t.marks))}let d=[];for(let p=0;p<n.childCount;p++)d.push(c(n.child(p)));if(Gz.from(d).eq(t))return{mark:s,type:u}}(_.parent.content.cut(_.parentOffset,S.parentOffset),T.parent.content.cut(T.parentOffset,y.endA-T.start()))))M=t.state.tr,"add"==R.type?M.addMark(k,I,R.mark):M.removeMark(k,I,R.mark);else if(_.parent.child(_.index()).isText&&_.index()==S.index()-(S.textOffset?0:1)){let E=_.parent.textBetween(_.parentOffset,S.parentOffset);if(t.someProp("handleTextInput",n=>n(t,k,I,E)))return;M=t.state.tr.insertText(E,k,I)}}if(M||(M=t.state.tr.replace(k,I,d.doc.slice(y.start-d.from,y.endB-d.from))),d.sel){let A=X2(t,M.doc,d.sel);A&&!(YG&&Y1&&t.composing&&A.empty&&(y.start!=y.endB||t.input.lastAndroidDelete<Date.now()-100)&&(A.head==k||A.head==M.mapping.map(I)-1)||Y$&&A.empty&&A.head==k)&&M.setSelection(A)}C&&M.ensureMarks(C),t.composing&&M.setMeta("composition",t.input.compositionID),t.dispatch(M.scrollIntoView())})(this,t,n,r,i)),this.domObserver.start(),function(t){for(let n in Xo){let r=Xo[n];t.dom.addEventListener(n,t.input.eventHandlers[n]=n=>{!Xd(t,n)||Xf(t,n)||!t.editable&&n.type in Xa||r(t,n)},Xu[n]?{passive:!0}:void 0)}YY&&t.dom.addEventListener("input",()=>null),Xl(t)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;for(let n in this._props={},t)this._props[n]=t[n];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&Xl(this);let n=this._props;this._props=t,t.plugins&&(t.plugins.forEach(X7),this.directPlugins=t.plugins),this.updateStateInner(t.state,n)}setProps(t){let n={};for(let r in this._props)n[r]=this._props[r];for(let i in n.state=this.state,t)n[i]=t[i];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&&(XT(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 u=X8(this);(function(t,n){let r=0,i=0;for(let o in t){if(t[o]!=n[o])return!0;r++}for(let a in n)i++;return r!=i})(u,this.nodeViews)&&(this.nodeViews=u,i=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&Xl(this),this.editable=X9(this),X6(this);let s=XH(this),c=X5(this),l=r.plugins==t.plugins||r.doc.eq(t.doc)?t.scrollToSelection>r.scrollToSelection?"to selection":"preserve":"reset",f=i||!this.docView.matchesNode(t.doc,c,s);(f||!t.selection.eq(r.selection))&&(o=!0);let d="preserve"==l&&o&&null==this.dom.style.overflowAnchor&&function(t){let n=t.dom.getBoundingClientRect(),r=Math.max(0,n.top),i,o;for(let a=(n.left+n.right)/2,u=r+1;u<Math.min(innerHeight,n.bottom);u+=5){let s=t.root.elementFromPoint(a,u);if(!s||s==t.dom||!t.dom.contains(s))continue;let c=s.getBoundingClientRect();if(c.top>=r-20){i=s,o=c.top;break}}return{refDOM:i,refTop:o,stack:Y8(t.dom)}}(this);if(o){var p,h,m;this.domObserver.stop();let g,y=f&&(Y$||YG)&&!this.composing&&!r.selection.empty&&!t.selection.empty&&(h=r.selection,m=t.selection,g=Math.min(h.$anchor.sharedDepth(h.head),m.$anchor.sharedDepth(m.head)),h.$anchor.start(g)!=m.$anchor.start(g));if(f){let v=YG?this.trackWrites=this.domSelectionRange().focusNode:null;(i||!this.docView.update(t.doc,c,s,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=Qv(t.doc,c,s,this.dom,this)),v&&!this.trackWrites&&(y=!0)}let b,x;y||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&(b=this.docView.domFromPos(this.state.selection.anchor,0),x=this.domSelectionRange(),YE(b.node,b.offset,x.anchorNode,x.anchorOffset)))?QP(this,y):(QU(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),"reset"==l?this.dom.scrollTop=0:"to selection"==l?this.scrollToSelection():d&&function({refDOM:t,refTop:n,stack:r}){let i=t?t.getBoundingClientRect().top:0;Y7(r,0==i?0:i-n)}(d)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",t=>t(this))){if(this.state.selection instanceof Yf){let n=this.docView.domAfterPos(this.state.selection.from);1==n.nodeType&&Y9(this,n.getBoundingClientRect(),t)}else Y9(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)for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,t)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let i=0;i<this.directPlugins.length;i++){let o=this.directPlugins[i];o.spec.view&&this.pluginViews.push(o.spec.view(this))}for(let a=0;a<this.state.plugins.length;a++){let u=this.state.plugins[a];u.spec.view&&this.pluginViews.push(u.spec.view(this))}}}someProp(t,n){let r=this._props&&this._props[t],i;if(null!=r&&(i=n?n(r):r))return i;for(let o=0;o<this.directPlugins.length;o++){let a=this.directPlugins[o].props[t];if(null!=a&&(i=n?n(a):a))return i}let u=this.state.plugins;if(u)for(let s=0;s<u.length;s++){let c=u[s].props[t];if(null!=c&&(i=n?n(c):c))return i}}hasFocus(){if(Y$){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("false"==t.contentEditable)return!1;t=t.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(t){if(t.setActive)return t.setActive();if(Qe)return t.focus(Qe);let n=Y8(t);t.focus(null==Qe?{get preventScroll(){return Qe={preventScroll:!0},!0}}:void 0),Qe||(Qe=!1,Y7(n,0))}(this.dom),QP(this),this.domObserver.start()}get root(){let t=this._root;if(null==t){for(let n=this.dom.parentNode;n;n=n.parentNode)if(9==n.nodeType||11==n.nodeType&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return t||document}posAtCoords(t){return function(t,n){var r,i;let o=t.dom.ownerDocument,a,u=0,s=YD(o,n.left,n.top);s&&({node:a,offset:u}=s);let c=(t.root.elementFromPoint?t.root:o).elementFromPoint(n.left,n.top),l;if(!c||!t.dom.contains(1!=c.nodeType?c.parentNode:c)){let f=t.dom.getBoundingClientRect();if(!Qt(n,f)||!(c=function t(n,r,i){let o=n.childNodes.length;if(o&&i.top<i.bottom)for(let a=Math.max(0,Math.min(o-1,Math.floor(o*(r.top-i.top)/(i.bottom-i.top))-2)),u=a;;){let s=n.childNodes[u];if(1==s.nodeType){let c=s.getClientRects();for(let l=0;l<c.length;l++){let f=c[l];if(Qt(r,f))return t(s,r,f)}}if((u=(u+1)%o)==a)break}return n}(t.dom,n,f)))return null}if(YY)for(let d=c;a&&d;d=YM(d))d.draggable&&(a=void 0);let p;if(c=(p=(r=c).parentNode)&&/^li$/i.test(p.nodeName)&&n.left<r.getBoundingClientRect().left?p:r,a){if(YH&&1==a.nodeType&&(u=Math.min(u,a.childNodes.length))<a.childNodes.length){let h=a.childNodes[u],m;"IMG"==h.nodeName&&(m=h.getBoundingClientRect()).right<=n.left&&m.bottom>n.top&&u++}a==t.dom&&u==a.childNodes.length-1&&1==a.lastChild.nodeType&&n.top>a.lastChild.getBoundingClientRect().bottom?l=t.state.doc.content.size:(0==u||1!=a.nodeType||"BR"!=a.childNodes[u-1].nodeName)&&(l=function(t,n,r,i){let o=-1;for(let a=n,u=!1;a!=t.dom;){let s=t.docView.nearestDesc(a,!0);if(!s)return null;if(1==s.dom.nodeType&&(s.node.isBlock&&s.parent&&!u||!s.contentDOM)){let c=s.dom.getBoundingClientRect();if(s.node.isBlock&&s.parent&&!u&&(u=!0,c.left>i.left||c.top>i.top?o=s.posBefore:(c.right<i.left||c.bottom<i.top)&&(o=s.posAfter)),!s.contentDOM&&o<0)return(s.node.isBlock?i.top<(c.top+c.bottom)/2:i.left<(c.left+c.right)/2)?s.posBefore:s.posAfter}a=s.dom.parentNode}return o>-1?o:t.docView.posFromDOM(n,r,-1)}(t,a,u,n))}null==l&&(l=function(t,n,r){let{node:i,offset:o}=function t(n,r){let i,o=2e8,a,u=0,s=r.top,c=r.top,l,f;for(let d=n.firstChild,p=0;d;d=d.nextSibling,p++){let h;if(1==d.nodeType)h=d.getClientRects();else{if(3!=d.nodeType)continue;h=YR(d).getClientRects()}for(let m=0;m<h.length;m++){let g=h[m];if(g.top<=s&&g.bottom>=c){s=Math.max(g.bottom,s),c=Math.min(g.top,c);let y=g.left>r.left?g.left-r.left:g.right<r.left?r.left-g.right:0;if(y<o){i=d,o=y,a=y&&3==i.nodeType?{left:g.right<r.left?g.right:g.left,top:r.top}:r,1==d.nodeType&&y&&(u=p+(r.left>=(g.left+g.right)/2?1:0));continue}}else g.top>r.top&&!l&&g.left<=r.left&&g.right>=r.left&&(l=d,f={left:Math.max(g.left,Math.min(g.right,r.left)),top:g.top});!i&&(r.left>=g.right&&r.top>=g.top||r.left>=g.left&&r.top>=g.bottom)&&(u=p+1)}}return!i&&l&&(i=l,a=f,o=0),i&&3==i.nodeType?function(t,n){let r=t.nodeValue.length,i=document.createRange();for(let o=0;o<r;o++){i.setEnd(t,o+1),i.setStart(t,o);let a=Qr(i,1);if(a.top!=a.bottom&&Qt(n,a))return{node:t,offset:o+(n.left>=(a.left+a.right)/2?1:0)}}return{node:t,offset:0}}(i,a):!i||o&&1==i.nodeType?{node:n,offset:u}:t(i,a)}(n,r),a=-1;if(1==i.nodeType&&!i.firstChild){let u=i.getBoundingClientRect();a=u.left!=u.right&&r.left>(u.left+u.right)/2?1:-1}return t.docView.posFromDOM(i,o,a)}(t,c,n));let g=t.docView.nearestDesc(c,!0);return{pos:l,inside:g?g.posAtStart-g.border:-1}}(this,t)}coordsAtPos(t,n=1){return Qo(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(null==i)throw RangeError("DOM position not inside the editor");return i}endOfTextblock(t,n){var r,i,o,a,u,s;let c,l;return Ql==(i=n||this.state)&&Qf==t?Qd:(Ql=i,Qf=t,Qd="up"==t||"down"==t?(a=this,c=i.selection,l="up"==t?c.$from:c.$to,Qs(a,i,()=>{let{node:n}=a.docView.domFromPos(l.pos,"up"==t?-1:1);for(;;){let r=a.docView.nearestDesc(n,!0);if(!r)break;if(r.node.isBlock){n=r.contentDOM||r.dom;break}n=r.dom.parentNode}let i=Qo(a,l.pos,1);for(let o=n.firstChild;o;o=o.nextSibling){let u;if(1==o.nodeType)u=o.getClientRects();else{if(3!=o.nodeType)continue;u=YR(o,0,o.nodeValue.length).getClientRects()}for(let s=0;s<u.length;s++){let c=u[s];if(c.bottom>c.top+1&&("up"==t?i.top-c.top>(c.bottom-i.top)*2:c.bottom-i.bottom>(i.bottom-c.top)*2))return!1}}return!0})):function(t,n,r){let{$head:i}=n.selection;if(!i.parent.isTextblock)return!1;let o=i.parentOffset,a=o==i.parent.content.size,u=t.domSelection();return Qc.test(i.parent.textContent)&&u.modify?Qs(t,n,()=>{let{focusNode:n,focusOffset:o,anchorNode:a,anchorOffset:s}=t.domSelectionRange(),c=u.caretBidiLevel;u.modify("move",r,"character");let l=i.depth?t.docView.domAfterPos(i.before()):t.dom,{focusNode:f,focusOffset:d}=t.domSelectionRange(),p=f&&!l.contains(1==f.nodeType?f:f.parentNode)||n==f&&o==d;try{u.collapse(a,s),n&&(n!=a||o!=s)&&u.extend&&u.extend(n,o)}catch{}return null!=c&&(u.caretBidiLevel=c),p}):"left"==r||"backward"==r?!o:a}(this,i,t))}pasteHTML(t,n){return Xk(this,"",t,!1,n||new ClipboardEvent("paste"))}pasteText(t,n){return Xk(this,t,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(function(t){for(let n in t.domObserver.stop(),t.input.eventHandlers)t.dom.removeEventListener(n,t.input.eventHandlers[n]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],XH(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return null==this.docView}dispatchEvent(t){var n,r;Xf(this,t)||!Xo[t.type]||!this.editable&&t.type in Xa||Xo[t.type](this,t)}dispatch(t){let n=this._props.dispatchTransaction;n?n.call(this,t):this.updateState(this.state.apply(t))}domSelectionRange(){return YY&&11===this.root.nodeType&&function(t){let n=t.activeElement;for(;n&&n.shadowRoot;)n=n.shadowRoot.activeElement;return n}(this.dom.ownerDocument)==this.dom?function(t){let n;function r(t){t.preventDefault(),t.stopImmediatePropagation(),n=t.getTargetRanges()[0]}t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0);let i=n.startContainer,o=n.startOffset,a=n.endContainer,u=n.endOffset,s=t.domAtPos(t.state.selection.anchor);return YE(s.node,s.offset,a,u)&&([i,o,a,u]=[a,u,i,o]),{anchorNode:i,anchorOffset:o,focusNode:a,focusOffset:u}}(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function X5(t){let n=Object.create(null);return n.class="ProseMirror",n.contenteditable=String(t.editable),t.someProp("attributes",r=>{if("function"==typeof r&&(r=r(t.state)),r)for(let i in r)"class"==i?n.class+=" "+r[i]:"style"==i?n.style=(n.style?n.style+";":"")+r[i]:n[i]||"contenteditable"==i||"nodeName"==i||(n[i]=String(r[i]))}),n.translate||(n.translate="no"),[XN.node(0,t.state.doc.content.size,n)]}function X6(t){if(t.markCursor){let n=document.createElement("img");n.className="ProseMirror-separator",n.setAttribute("mark-placeholder","true"),n.setAttribute("alt",""),t.cursorWrapper={dom:n,deco:XN.widget(t.state.selection.head,n,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function X9(t){return!t.someProp("editable",n=>!1===n(t.state))}function X8(t){let n=Object.create(null);function r(t){for(let r in t)Object.prototype.hasOwnProperty.call(n,r)||(n[r]=t[r])}return t.someProp("nodeViews",r),t.someProp("markViews",r),n}function X7(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw RangeError("Plugins passed directly to the view must not have a state component")}for(var eee={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:"'"},eet={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},een="u">typeof navigator&&/Mac/.test(navigator.platform),eer="u">typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),eei=0;eei<10;eei++)eee[48+eei]=eee[96+eei]=String(eei);for(var eei=1;eei<=24;eei++)eee[eei+111]="F"+eei;for(var eei=65;eei<=90;eei++)eee[eei]=String.fromCharCode(eei+32),eet[eei]=String.fromCharCode(eei);for(var eeo in eee)eet.hasOwnProperty(eeo)||(eet[eeo]=eee[eeo]);let eea="u">typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function eeu(t){let n=t.split(/-(?!$)/),r=n[n.length-1];"Space"==r&&(r=" ");let i,o,a,u;for(let s=0;s<n.length-1;s++){let c=n[s];if(/^(cmd|meta|m)$/i.test(c))u=!0;else if(/^a(lt)?$/i.test(c))i=!0;else if(/^(c|ctrl|control)$/i.test(c))o=!0;else if(/^s(hift)?$/i.test(c))a=!0;else if(/^mod$/i.test(c))eea?u=!0:o=!0;else throw Error("Unrecognized modifier name: "+c)}return i&&(r="Alt-"+r),o&&(r="Ctrl-"+r),u&&(r="Meta-"+r),a&&(r="Shift-"+r),r}function ees(t,n,r=!0){return n.altKey&&(t="Alt-"+t),n.ctrlKey&&(t="Ctrl-"+t),n.metaKey&&(t="Meta-"+t),r&&n.shiftKey&&(t="Shift-"+t),t}let eec=(t,n)=>!t.selection.empty&&(n&&n(t.tr.deleteSelection().scrollIntoView()),!0),eel=(t,n,r)=>{let i=function(t,n){let{$cursor:r}=t.selection;return r&&(n?n.endOfTextblock("backward",t):!(r.parentOffset>0))?r:null}(t,r);if(!i)return!1;let o=eep(i);if(!o){let a=i.blockRange(),u=a&&JH(a);return null!=u&&(n&&n(t.tr.lift(a,u).scrollIntoView()),!0)}let s=o.nodeBefore;if(!s.type.spec.isolating&&eek(t,o,n))return!0;if(0==i.parent.content.size&&(eef(s,"end")||Yf.isSelectable(s))){let c=J0(t.doc,i.before(),i.after(),GH.empty);if(c&&c.slice.size<c.to-c.from){if(n){let l=t.tr.step(c);l.setSelection(eef(s,"end")?Yo.findFrom(l.doc.resolve(l.mapping.map(o.pos,-1)),-1):Yf.create(l.doc,o.pos-s.nodeSize)),n(l.scrollIntoView())}return!0}}return!!s.isAtom&&o.depth==i.depth-1&&(n&&n(t.tr.delete(o.pos-s.nodeSize,o.pos).scrollIntoView()),!0)};function eef(t,n,r=!1){for(let i=t;i;i="start"==n?i.firstChild:i.lastChild){if(i.isTextblock)return!0;if(r&&1!=i.childCount)break}return!1}let eed=(t,n,r)=>{let{$head:i,empty:o}=t.selection,a=i;if(!o)return!1;if(i.parent.isTextblock){if(r?!r.endOfTextblock("backward",t):i.parentOffset>0)return!1;a=eep(i)}let u=a&&a.nodeBefore;return!!(u&&Yf.isSelectable(u))&&(n&&n(t.tr.setSelection(Yf.create(t.doc,a.pos-u.nodeSize)).scrollIntoView()),!0)};function eep(t){if(!t.parent.type.spec.isolating)for(let n=t.depth-1;n>=0;n--){if(t.index(n)>0)return t.doc.resolve(t.before(n+1));if(t.node(n).type.spec.isolating)break}return null}let eeh=(t,n,r)=>{let i=function(t,n){let{$cursor:r}=t.selection;return r&&(n?n.endOfTextblock("forward",t):!(r.parentOffset<r.parent.content.size))?r:null}(t,r);if(!i)return!1;let o=eeg(i);if(!o)return!1;let a=o.nodeAfter;if(eek(t,o,n))return!0;if(0==i.parent.content.size&&(eef(a,"start")||Yf.isSelectable(a))){let u=J0(t.doc,i.before(),i.after(),GH.empty);if(u&&u.slice.size<u.to-u.from){if(n){let s=t.tr.step(u);s.setSelection(eef(a,"start")?Yo.findFrom(s.doc.resolve(s.mapping.map(o.pos)),1):Yf.create(s.doc,s.mapping.map(o.pos))),n(s.scrollIntoView())}return!0}}return!!a.isAtom&&o.depth==i.depth-1&&(n&&n(t.tr.delete(o.pos,o.pos+a.nodeSize).scrollIntoView()),!0)},eem=(t,n,r)=>{let{$head:i,empty:o}=t.selection,a=i;if(!o)return!1;if(i.parent.isTextblock){if(r?!r.endOfTextblock("forward",t):i.parentOffset<i.parent.content.size)return!1;a=eeg(i)}let u=a&&a.nodeAfter;return!!(u&&Yf.isSelectable(u))&&(n&&n(t.tr.setSelection(Yf.create(t.doc,a.pos)).scrollIntoView()),!0)};function eeg(t){if(!t.parent.type.spec.isolating)for(let n=t.depth-1;n>=0;n--){let r=t.node(n);if(t.index(n)+1<r.childCount)return t.doc.resolve(t.after(n+1));if(r.type.spec.isolating)break}return null}let eey=(t,n)=>{let r=t.selection,i=r instanceof Yf,o;if(i){if(r.node.isTextblock||!JY(t.doc,r.from))return!1;o=r.from}else if(null==(o=JX(t.doc,r.from,-1)))return!1;if(n){let a=t.tr.join(o);i&&a.setSelection(Yf.create(a.doc,o-t.doc.resolve(o).nodeBefore.nodeSize)),n(a.scrollIntoView())}return!0},eev=(t,n)=>{let r=t.selection,i;if(r instanceof Yf){if(r.node.isTextblock||!JY(t.doc,r.to))return!1;i=r.to}else if(null==(i=JX(t.doc,r.to,1)))return!1;return n&&n(t.tr.join(i).scrollIntoView()),!0},eeb=(t,n)=>{let{$from:r,$to:i}=t.selection,o=r.blockRange(i),a=o&&JH(o);return null!=a&&(n&&n(t.tr.lift(o,a).scrollIntoView()),!0)},eex=(t,n)=>{let{$head:r,$anchor:i}=t.selection;return!!(r.parent.type.spec.code&&r.sameParent(i))&&(n&&n(t.tr.insertText(`
10
- `).scrollIntoView()),!0)};function ee_(t){for(let n=0;n<t.edgeCount;n++){let{type:r}=t.edge(n);if(r.isTextblock&&!r.hasRequiredAttrs())return r}return null}let eeS=(t,n)=>{let{$head:r,$anchor:i}=t.selection;if(!r.parent.type.spec.code||!r.sameParent(i))return!1;let o=r.node(-1),a=r.indexAfter(-1),u=ee_(o.contentMatchAt(a));if(!u||!o.canReplaceWith(a,a,u))return!1;if(n){let s=r.after(),c=t.tr.replaceWith(s,s,u.createAndFill());c.setSelection(Yo.near(c.doc.resolve(s),1)),n(c.scrollIntoView())}return!0},eeT=(t,n)=>{let r=t.selection,{$from:i,$to:o}=r;if(r instanceof Yp||i.parent.inlineContent||o.parent.inlineContent)return!1;let a=ee_(o.parent.contentMatchAt(o.indexAfter()));if(!a||!a.isTextblock)return!1;if(n){let u=(!i.parentOffset&&o.index()<o.parent.childCount?i:o).pos,s=t.tr.insert(u,a.createAndFill());s.setSelection(Yc.create(s.doc,u+1)),n(s.scrollIntoView())}return!0},eew=(t,n)=>{let{$cursor:r}=t.selection;if(!r||r.parent.content.size)return!1;if(r.depth>1&&r.after()!=r.end(-1)){let i=r.before();if(JJ(t.doc,i))return n&&n(t.tr.split(i).scrollIntoView()),!0}let o=r.blockRange(),a=o&&JH(o);return null!=a&&(n&&n(t.tr.lift(o,a).scrollIntoView()),!0)},eeO=(t,n)=>{let{$from:r,to:i}=t.selection,o,a=r.sharedDepth(i);return 0!=a&&(o=r.before(a),n&&n(t.tr.setSelection(Yf.create(t.doc,o))),!0)};function eek(t,n,r){var i,o,a;let u=n.nodeBefore,s=n.nodeAfter,c,l;if(u.type.spec.isolating||s.type.spec.isolating)return!1;let f,d,p;if(f=n.nodeBefore,d=n.nodeAfter,p=n.index(),f&&d&&f.type.compatibleContent(d.type)&&(!f.content.size&&n.parent.canReplace(p-1,p)?(r&&r(t.tr.delete(n.pos-f.nodeSize,n.pos).scrollIntoView()),!0):!!(n.parent.canReplace(p,p+1)&&(d.isTextblock||JY(t.doc,n.pos)))&&(r&&r(t.tr.clearIncompatible(n.pos,f.type,f.contentMatchAt(f.childCount)).join(n.pos).scrollIntoView()),!0)))return!0;let h=n.parent.canReplace(n.index(),n.index()+1);if(h&&(c=(l=u.contentMatchAt(u.childCount)).findWrapping(s.type))&&l.matchType(c[0]||s.type).validEnd){if(r){let m=n.pos+s.nodeSize,g=Gz.empty;for(let y=c.length-1;y>=0;y--)g=Gz.from(c[y].create(null,g));g=Gz.from(u.copy(g));let v=t.tr.step(new JV(n.pos-1,m,n.pos,m,new GH(g,1,0),c.length,!0)),b=m+2*c.length;JY(v.doc,b)&&v.join(b),r(v.scrollIntoView())}return!0}let x=Yo.findFrom(n,1),_=x&&x.$from.blockRange(x.$to),S=_&&JH(_);if(null!=S&&S>=n.depth)return r&&r(t.tr.lift(_,S).scrollIntoView()),!0;if(h&&eef(s,"start",!0)&&eef(u,"end")){let T=u,w=[];for(;w.push(T),!T.isTextblock;)T=T.lastChild;let O=s,k=1;for(;!O.isTextblock;O=O.firstChild)k++;if(T.canReplace(T.childCount,T.childCount,O.content)){if(r){let I=Gz.empty;for(let M=w.length-1;M>=0;M--)I=Gz.from(w[M].copy(I));let C=t.tr.step(new JV(n.pos-w.length,n.pos+s.nodeSize,n.pos+k,n.pos+s.nodeSize-k,new GH(I,w.length,0),0,!0));r(C.scrollIntoView())}return!0}}return!1}function eeI(t){return function(n,r){let i=n.selection,o=t<0?i.$from:i.$to,a=o.depth;for(;o.node(a).isInline;){if(!a)return!1;a--}return!!o.node(a).isTextblock&&(r&&r(n.tr.setSelection(Yc.create(n.doc,t<0?o.start(a):o.end(a)))),!0)}}let eeM=eeI(-1),eeC=eeI(1);function eeR(t,n=null){return function(r,i){let o=!1;for(let a=0;a<r.selection.ranges.length&&!o;a++){let{$from:{pos:u},$to:{pos:s}}=r.selection.ranges[a];r.doc.nodesBetween(u,s,(i,a)=>{if(o)return!1;if(!(!i.isTextblock||i.hasMarkup(t,n))){if(i.type==t)o=!0;else{let u=r.doc.resolve(a),s=u.index();o=u.parent.canReplaceWith(s,s+1,t)}}})}if(!o)return!1;if(i){let c=r.tr;for(let l=0;l<r.selection.ranges.length;l++){let{$from:{pos:f},$to:{pos:d}}=r.selection.ranges[l];c.setBlockType(f,d,t,n)}i(c.scrollIntoView())}return!0}}function eeE(t){let{state:n,transaction:r}=t,{selection:i}=r,{doc:o}=r,{storedMarks:a}=r;return{...n,apply:n.apply.bind(n),applyTransaction:n.applyTransaction.bind(n),filterTransaction:n.filterTransaction,plugins:n.plugins,schema:n.schema,reconfigure:n.reconfigure.bind(n),toJSON:n.toJSON.bind(n),get storedMarks(){return a},get selection(){return i},get doc(){return o},get tr(){return i=r.selection,o=r.doc,a=r.storedMarks,r}}}"u">typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"u">typeof os&&os.platform&&os.platform();class eeA{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(){let{rawCommands:t,editor:n,state:r}=this,{view:i}=n,{tr:o}=r,a=this.buildProps(o);return Object.fromEntries(Object.entries(t).map(([t,n])=>[t,(...t)=>{let r=n(...t)(a);return o.getMeta("preventDispatch")||this.hasCustomState||i.dispatch(o),r}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,n=!0){let{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(t=>!0===t)),f={...Object.fromEntries(Object.entries(r).map(([t,r])=>[t,(...t)=>{let i=this.buildProps(c,n),o=r(...t)(i);return u.push(o),f}])),run:l};return f}createCan(t){let{rawCommands:n,state:r}=this,i=t||r.tr,o=this.buildProps(i,!1);return{...Object.fromEntries(Object.entries(n).map(([t,n])=>[t,(...t)=>n(...t)({...o,dispatch:void 0})])),chain:()=>this.createChain(i,!1)}}buildProps(t,n=!0){let{rawCommands:r,editor:i,state:o}=this,{view:a}=i;o.storedMarks&&t.setStoredMarks(o.storedMarks);let u={tr:t,editor:i,view:a,state:eeE({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(([t,n])=>[t,(...t)=>n(...t)(u)]))}};return u}}class eej{constructor(){this.callbacks={}}on(t,n){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(n),this}emit(t,...n){let r=this.callbacks[t];return r&&r.forEach(t=>t.apply(this,n)),this}off(t,n){let r=this.callbacks[t];return r&&(n?this.callbacks[t]=r.filter(t=>t!==n):delete this.callbacks[t]),this}removeAllListeners(){this.callbacks={}}}function eeN(t,n,r){return void 0===t.config[n]&&t.parent?eeN(t.parent,n,r):"function"==typeof t.config[n]?t.config[n].bind({...r,parent:t.parent?eeN(t.parent,n,r):null}):t.config[n]}function eeP(t){let n=t.filter(t=>"extension"===t.type),r=t.filter(t=>"node"===t.type),i=t.filter(t=>"mark"===t.type);return{baseExtensions:n,nodeExtensions:r,markExtensions:i}}function eeL(t){let n=[],{nodeExtensions:r,markExtensions:i}=eeP(t),o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(t=>{let r={name:t.name,options:t.options,storage:t.storage},i=eeN(t,"addGlobalAttributes",r);i&&i().forEach(t=>{t.types.forEach(r=>{Object.entries(t.attributes).forEach(([t,i])=>{n.push({type:r,name:t,attribute:{...o,...i}})})})})}),[...r,...i].forEach(t=>{let r={name:t.name,options:t.options,storage:t.storage},i=eeN(t,"addAttributes",r);if(!i)return;let a=i();Object.entries(a).forEach(([r,i])=>{let a={...o,...i};"function"==typeof(null==a?void 0:a.default)&&(a.default=a.default()),null!=a&&a.isRequired&&(null==a?void 0:a.default)===void 0&&delete a.default,n.push({type:t.name,name:r,attribute:a})})}),n}function eeF(t,n){if("string"==typeof t){if(!n.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return n.nodes[t]}return t}function eeD(...t){return t.filter(t=>!!t).reduce((t,n)=>{let r={...t};return Object.entries(n).forEach(([t,n])=>{if(!r[t]){r[t]=n;return}"class"===t?r[t]=[r[t],n].join(" "):"style"===t?r[t]=[r[t],n].join("; "):r[t]=n}),r},{})}function eeW(t,n){return n.filter(t=>t.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((t,n)=>eeD(t,n),{})}function eeU(t){return"function"==typeof t}function eez(t,n,...r){return eeU(t)?n?t.bind(n)(...r):t(...r):t}function eeB(t,n){return t.style?t:{...t,getAttrs(r){let i=t.getAttrs?t.getAttrs(r):t.attrs;if(!1===i)return!1;let o=n.reduce((t,n)=>{var i;let o=n.attribute.parseHTML?n.attribute.parseHTML(r):"string"!=typeof(i=r.getAttribute(n.name))?i:i.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(i):"true"===i||"false"!==i&&i;return null==o?t:{...t,[n.name]:o}},{});return{...i,...o}}}}function eeq(t){return Object.fromEntries(Object.entries(t).filter(([t,n])=>!("attrs"===t&&function(t={}){return 0===Object.keys(t).length&&t.constructor===Object}(n))&&null!=n))}function eeV(t,n){var r;let i=eeL(t),{nodeExtensions:o,markExtensions:a}=eeP(t),u=null===(r=o.find(t=>eeN(t,"topNode")))||void 0===r?void 0:r.name,s=Object.fromEntries(o.map(r=>{let o=i.filter(t=>t.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:n},u=t.reduce((t,n)=>{let i=eeN(n,"extendNodeSchema",a);return{...t,...i?i(r):{}}},{}),s=eeq({...u,content:eez(eeN(r,"content",a)),marks:eez(eeN(r,"marks",a)),group:eez(eeN(r,"group",a)),inline:eez(eeN(r,"inline",a)),atom:eez(eeN(r,"atom",a)),selectable:eez(eeN(r,"selectable",a)),draggable:eez(eeN(r,"draggable",a)),code:eez(eeN(r,"code",a)),defining:eez(eeN(r,"defining",a)),isolating:eez(eeN(r,"isolating",a)),attrs:Object.fromEntries(o.map(t=>{var n;return[t.name,{default:null===(n=null==t?void 0:t.attribute)||void 0===n?void 0:n.default}]}))}),c=eez(eeN(r,"parseHTML",a));c&&(s.parseDOM=c.map(t=>eeB(t,o)));let l=eeN(r,"renderHTML",a);l&&(s.toDOM=t=>l({node:t,HTMLAttributes:eeW(t,o)}));let f=eeN(r,"renderText",a);return f&&(s.toText=f),[r.name,s]})),c=Object.fromEntries(a.map(r=>{let o=i.filter(t=>t.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:n},u=t.reduce((t,n)=>{let i=eeN(n,"extendMarkSchema",a);return{...t,...i?i(r):{}}},{}),s=eeq({...u,inclusive:eez(eeN(r,"inclusive",a)),excludes:eez(eeN(r,"excludes",a)),group:eez(eeN(r,"group",a)),spanning:eez(eeN(r,"spanning",a)),code:eez(eeN(r,"code",a)),attrs:Object.fromEntries(o.map(t=>{var n;return[t.name,{default:null===(n=null==t?void 0:t.attribute)||void 0===n?void 0:n.default}]}))}),c=eez(eeN(r,"parseHTML",a));c&&(s.parseDOM=c.map(t=>eeB(t,o)));let l=eeN(r,"renderHTML",a);return l&&(s.toDOM=t=>l({mark:t,HTMLAttributes:eeW(t,o)})),[r.name,s]}));return new Jm({topNode:u,nodes:s,marks:c})}function ee$(t,n){return n.nodes[t]||n.marks[t]||null}function eeK(t,n){return Array.isArray(n)?n.some(n=>("string"==typeof n?n:n.name)===t.name):n}let eeH=(t,n=500)=>{let r="",i=t.parentOffset;return t.parent.nodesBetween(Math.max(0,i-n),i,(t,n,o,a)=>{var u,s;let c=(null===(s=(u=t.type.spec).toText)||void 0===s?void 0:s.call(u,{node:t,pos:n,parent:o,index:a}))||t.textContent||"%leaf%";r+=c.slice(0,Math.max(0,i-n))}),r};function eeZ(t){return"[object RegExp]"===Object.prototype.toString.call(t)}class eeG{constructor(t){this.find=t.find,this.handler=t.handler}}let eeJ=(t,n)=>{if(eeZ(n))return n.exec(t);let r=n(t);if(!r)return null;let i=[r.text];return i.index=r.index,i.input=t,i.data=r.data,r.replaceWith&&(r.text.includes(r.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),i.push(r.replaceWith)),i};function eeY(t){var n;let{editor:r,from:i,to:o,text:a,rules:u,plugin:s}=t,{view:c}=r;if(c.composing)return!1;let l=c.state.doc.resolve(i);if(l.parent.type.spec.code||!(null===(n=l.nodeBefore||l.nodeAfter)||void 0===n)&&n.marks.find(t=>t.type.spec.code))return!1;let f=!1,d=eeH(l)+a;return u.forEach(t=>{if(f)return;let n=eeJ(d,t.find);if(!n)return;let u=c.state.tr,l=eeE({state:c.state,transaction:u}),p={from:i-(n[0].length-a.length),to:o},{commands:h,chain:m,can:g}=new eeA({editor:r,state:l});null!==t.handler({state:l,range:p,match:n,commands:h,chain:m,can:g})&&u.steps.length&&(u.setMeta(s,{transform:u,from:i,to:o,text:a}),c.dispatch(u),f=!0)}),f}class eeQ{constructor(t){this.find=t.find,this.handler=t.handler}}let eeX=(t,n)=>{if(eeZ(n))return[...t.matchAll(n)];let r=n(t);return r?r.map(n=>{let r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),r.push(n.replaceWith)),r}):[]};class ee0{constructor(t,n){this.splittableMarks=[],this.editor=n,this.extensions=ee0.resolve(t),this.schema=eeV(this.extensions,n),this.extensions.forEach(t=>{var n;this.editor.extensionStorage[t.name]=t.storage;let r={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:ee$(t.name,this.schema)};"mark"===t.type&&(!(null!==(n=eez(eeN(t,"keepOnSplit",r)))&&void 0!==n)||n)&&this.splittableMarks.push(t.name);let i=eeN(t,"onBeforeCreate",r);i&&this.editor.on("beforeCreate",i);let o=eeN(t,"onCreate",r);o&&this.editor.on("create",o);let a=eeN(t,"onUpdate",r);a&&this.editor.on("update",a);let u=eeN(t,"onSelectionUpdate",r);u&&this.editor.on("selectionUpdate",u);let s=eeN(t,"onTransaction",r);s&&this.editor.on("transaction",s);let c=eeN(t,"onFocus",r);c&&this.editor.on("focus",c);let l=eeN(t,"onBlur",r);l&&this.editor.on("blur",l);let f=eeN(t,"onDestroy",r);f&&this.editor.on("destroy",f)})}static resolve(t){let n=ee0.sort(ee0.flatten(t)),r=function(t){let n=t.filter((n,r)=>t.indexOf(n)!==r);return[...new Set(n)]}(n.map(t=>t.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(t=>`'${t}'`).join(", ")}]. This can lead to issues.`),n}static flatten(t){return t.map(t=>{let n={name:t.name,options:t.options,storage:t.storage},r=eeN(t,"addExtensions",n);return r?[t,...this.flatten(r())]:t}).flat(10)}static sort(t){return t.sort((t,n)=>{let r=eeN(t,"priority")||100,i=eeN(n,"priority")||100;return r>i?-1:r<i?1:0})}get commands(){return this.extensions.reduce((t,n)=>{let r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:ee$(n.name,this.schema)},i=eeN(n,"addCommands",r);return i?{...t,...i()}:t},{})}get plugins(){let{editor:t}=this,n=ee0.sort([...this.extensions].reverse()),r=[],i=[],o=n.map(n=>{var o,a;let u={name:n.name,options:n.options,storage:n.storage,editor:t,type:ee$(n.name,this.schema)},s=[],c=eeN(n,"addKeyboardShortcuts",u),l={};if("mark"===n.type&&n.config.exitable&&(l.ArrowRight=()=>enO.handleExit({editor:t,mark:n})),c){let f=Object.fromEntries(Object.entries(c()).map(([n,r])=>[n,()=>r({editor:t})]));l={...l,...f}}let d,p=(o=l,new YT({props:{handleKeyDown:(a=o,d=function(t){let n=Object.create(null);for(let r in t)n[eeu(r)]=t[r];return n}(a),function(t,n){var r,i;let o=("Esc"==(i=!(een&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||eer&&n.shiftKey&&n.key&&1==n.key.length||"Unidentified"==n.key)&&n.key||(n.shiftKey?eet:eee)[n.keyCode]||n.key||"Unidentified")&&(i="Escape"),"Del"==i&&(i="Delete"),"Left"==i&&(i="ArrowLeft"),"Up"==i&&(i="ArrowUp"),"Right"==i&&(i="ArrowRight"),"Down"==i&&(i="ArrowDown"),i),a,u=d[ees(o,n)];if(u&&u(t.state,t.dispatch,t))return!0;if(1==o.length&&" "!=o){if(n.shiftKey){let s=d[ees(o,n,!1)];if(s&&s(t.state,t.dispatch,t))return!0}if((n.shiftKey||n.altKey||n.metaKey||o.charCodeAt(0)>127)&&(a=eee[n.keyCode])&&a!=o){let c=d[ees(a,n)];if(c&&c(t.state,t.dispatch,t))return!0}}return!1})}}));s.push(p);let h=eeN(n,"addInputRules",u);eeK(n,t.options.enableInputRules)&&h&&r.push(...h());let m=eeN(n,"addPasteRules",u);eeK(n,t.options.enablePasteRules)&&m&&i.push(...m());let g=eeN(n,"addProseMirrorPlugins",u);if(g){let y=g();s.push(...y)}return s}).flat();return[function(t){let{editor:n,rules:r}=t,i=new YT({state:{init:()=>null,apply(t,n){let r=t.getMeta(i);return r||(t.selectionSet||t.docChanged?null:n)}},props:{handleTextInput:(t,o,a,u)=>eeY({editor:n,from:o,to:a,text:u,rules:r,plugin:i}),handleDOMEvents:{compositionend:t=>(setTimeout(()=>{let{$cursor:o}=t.state.selection;o&&eeY({editor:n,from:o.pos,to:o.pos,text:"",rules:r,plugin:i})}),!1)},handleKeyDown(t,o){if("Enter"!==o.key)return!1;let{$cursor:a}=t.state.selection;return!!a&&eeY({editor:n,from:a.pos,to:a.pos,text:`
11
- `,rules:r,plugin:i})}},isInputRules:!0});return i}({editor:t,rules:r}),...function(t){let{editor:n,rules:r}=t,i=null,o=!1,a=!1;return r.map(t=>new YT({view(t){let n=n=>{var r;i=!(null===(r=t.dom.parentElement)||void 0===r)&&r.contains(n.target)?t.dom.parentElement:null};return window.addEventListener("dragstart",n),{destroy(){window.removeEventListener("dragstart",n)}}},props:{handleDOMEvents:{drop:t=>(a=i===t.dom.parentElement,!1),paste(t,n){var r;let i=null===(r=n.clipboardData)||void 0===r?void 0:r.getData("text/html");return o=!!(null!=i&&i.includes("data-pm-slice")),!1}}},appendTransaction(r,i,u){var s;let c=r[0],l="paste"===c.getMeta("uiEvent")&&!o,f="drop"===c.getMeta("uiEvent")&&!a;if(!l&&!f)return;let d=i.doc.content.findDiffStart(u.doc.content),p=i.doc.content.findDiffEnd(u.doc.content);if("number"!=typeof d||!p||d===p.b)return;let h=u.tr,m=eeE({state:u,transaction:h});if(!(!function(t){let{editor:n,state:r,from:i,to:o,rule:a}=t,{commands:u,chain:s,can:c}=new eeA({editor:n,state:r}),l=[];return r.doc.nodesBetween(i,o,(t,n)=>{if(!t.isTextblock||t.type.spec.code)return;let f=Math.max(i,n),d=Math.min(o,n+t.content.size),p=t.textBetween(f-n,d-n,void 0,"");eeX(p,a.find).forEach(t=>{if(void 0===t.index)return;let n=f+t.index+1,i=n+t[0].length,o={from:r.tr.mapping.map(n),to:r.tr.mapping.map(i)},d=a.handler({state:r,range:o,match:t,commands:u,chain:s,can:c});l.push(d)})}),l.every(t=>null!==t)}({editor:n,state:m,from:Math.max(d-1,0),to:p.b-1,rule:t})||!h.steps.length))return h}}))}({editor:t,rules:i}),...o]}get attributes(){return eeL(this.extensions)}get nodeViews(){let{editor:t}=this,{nodeExtensions:n}=eeP(this.extensions);return Object.fromEntries(n.filter(t=>!!eeN(t,"addNodeView")).map(n=>{let r=this.attributes.filter(t=>t.type===n.name),i={name:n.name,options:n.options,storage:n.storage,editor:t,type:eeF(n.name,this.schema)},o=eeN(n,"addNodeView",i);if(!o)return[];let a=(i,a,u,s)=>{let c=eeW(i,r);return o()({editor:t,node:i,getPos:u,decorations:s,HTMLAttributes:c,extension:n})};return[n.name,a]}))}}function ee1(t){var n;return"Object"===Object.prototype.toString.call(t).slice(8,-1)&&t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function ee2(t,n){let r={...t};return ee1(t)&&ee1(n)&&Object.keys(n).forEach(i=>{ee1(n[i])&&i in t?r[i]=ee2(t[i],n[i]):Object.assign(r,{[i]:n[i]})}),r}class ee3{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=eez(eeN(this,"addOptions",{name:this.name}))),this.storage=eez(eeN(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new ee3(t)}configure(t={}){let n=this.extend();return n.options=ee2(this.options,t),n.storage=eez(eeN(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){let n=new ee3(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=eez(eeN(n,"addOptions",{name:n.name})),n.storage=eez(eeN(n,"addStorage",{name:n.name,options:n.options})),n}}function ee4(t,n,r){let{from:i,to:o}=n,{blockSeparator:a=`
12
-
13
- `,textSerializers:u={}}=r||{},s="",c=!0;return t.nodesBetween(i,o,(t,r,l,f)=>{var d;let p=null==u?void 0:u[t.type.name];p?(t.isBlock&&!c&&(s+=a,c=!0),l&&(s+=p({node:t,pos:r,parent:l,index:f,range:n}))):t.isText?(s+=null===(d=null==t?void 0:t.text)||void 0===d?void 0:d.slice(Math.max(i,r)-r,o-r),c=!1):t.isBlock&&!c&&(s+=a,c=!0)}),s}function ee5(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}let ee6=ee3.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new YT({key:new Yk("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{let{editor:t}=this,{state:n,schema:r}=t,{doc:i,selection:o}=n,{ranges:a}=o,u=Math.min(...a.map(t=>t.$from.pos)),s=Math.max(...a.map(t=>t.$to.pos)),c=ee5(r);return ee4(i,{from:u,to:s},{textSerializers:c})}}})]}}),ee9=()=>({editor:t,view:n})=>(requestAnimationFrame(()=>{var r;t.isDestroyed||(n.dom.blur(),null===(r=null==window?void 0:window.getSelection())||void 0===r||r.removeAllRanges())}),!0),ee8=(t=!1)=>({commands:n})=>n.setContent("",t),ee7=()=>({state:t,tr:n,dispatch:r})=>{let{selection:i}=n,{ranges:o}=i;return r&&o.forEach(({$from:r,$to:i})=>{t.doc.nodesBetween(r.pos,i.pos,(t,r)=>{if(t.type.isText)return;let{doc:i,mapping:o}=n,a=i.resolve(o.map(r)),u=i.resolve(o.map(r+t.nodeSize)),s=a.blockRange(u);if(!s)return;let c=JH(s);if(t.type.isTextblock){let{defaultType:l}=a.parent.contentMatchAt(a.index());n.setNodeMarkup(s.start,l)}(c||0===c)&&n.lift(s,c)})}),!0},ete=t=>n=>t(n),ett=()=>({state:t,dispatch:n})=>eeT(t,n),etn=()=>({tr:t,dispatch:n})=>{let{selection:r}=t,i=r.$anchor.node();if(i.content.size>0)return!1;let o=t.selection.$anchor;for(let a=o.depth;a>0;a-=1)if(o.node(a).type===i.type){if(n){let u=o.before(a),s=o.after(a);t.delete(u,s).scrollIntoView()}return!0}return!1},etr=t=>({tr:n,state:r,dispatch:i})=>{let o=eeF(t,r.schema),a=n.selection.$anchor;for(let u=a.depth;u>0;u-=1)if(a.node(u).type===o){if(i){let s=a.before(u),c=a.after(u);n.delete(s,c).scrollIntoView()}return!0}return!1},eti=t=>({tr:n,dispatch:r})=>{let{from:i,to:o}=t;return r&&n.delete(i,o),!0},eto=()=>({state:t,dispatch:n})=>eec(t,n),eta=()=>({commands:t})=>t.keyboardShortcut("Enter"),etu=()=>({state:t,dispatch:n})=>eeS(t,n);function ets(t,n,r={strict:!0}){let i=Object.keys(n);return!i.length||i.every(i=>r.strict?n[i]===t[i]:eeZ(n[i])?n[i].test(t[i]):n[i]===t[i])}function etc(t,n,r={}){return t.find(t=>t.type===n&&ets(t.attrs,r))}function etl(t,n,r={}){return!!etc(t,n,r)}function etf(t,n,r={}){if(!t||!n)return;let i=t.parent.childAfter(t.parentOffset);if(t.parentOffset===i.offset&&0!==i.offset&&(i=t.parent.childBefore(t.parentOffset)),!i.node)return;let o=etc([...i.node.marks],n,r);if(!o)return;let a=i.index,u=t.start()+i.offset,s=a+1,c=u+i.node.nodeSize;for(etc([...i.node.marks],n,r);a>0&&o.isInSet(t.parent.child(a-1).marks);)a-=1,u-=t.parent.child(a).nodeSize;for(;s<t.parent.childCount&&etl([...t.parent.child(s).marks],n,r);)c+=t.parent.child(s).nodeSize,s+=1;return{from:u,to:c}}function etd(t,n){if("string"==typeof t){if(!n.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return n.marks[t]}return t}let etp=(t,n={})=>({tr:r,state:i,dispatch:o})=>{let a=etd(t,i.schema),{doc:u,selection:s}=r,{$from:c,from:l,to:f}=s;if(o){let d=etf(c,a,n);if(d&&d.from<=l&&d.to>=f){let p=Yc.create(u,d.from,d.to);r.setSelection(p)}}return!0},eth=t=>n=>{let r="function"==typeof t?t(n):t;for(let i=0;i<r.length;i+=1)if(r[i](n))return!0;return!1};function etm(t){return t instanceof Yc}function etg(t=0,n=0,r=0){return Math.min(Math.max(t,n),r)}function ety(t,n=null){if(!n)return null;let r=Yo.atStart(t),i=Yo.atEnd(t);if("start"===n||!0===n)return r;if("end"===n)return i;let o=r.from,a=i.to;return"all"===n?Yc.create(t,etg(0,o,a),etg(t.content.size,o,a)):Yc.create(t,etg(n,o,a),etg(n,o,a))}function etv(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}let etb=(t=null,n={})=>({editor:r,view:i,tr:o,dispatch:a})=>{n={scrollIntoView:!0,...n};let u=()=>{etv()&&i.dom.focus(),requestAnimationFrame(()=>{r.isDestroyed||(i.focus(),null!=n&&n.scrollIntoView&&r.commands.scrollIntoView())})};if(i.hasFocus()&&null===t||!1===t)return!0;if(a&&null===t&&!etm(r.state.selection))return u(),!0;let s=ety(o.doc,t)||r.state.selection,c=r.state.selection.eq(s);return a&&(c||o.setSelection(s),c&&o.storedMarks&&o.setStoredMarks(o.storedMarks),u()),!0},etx=(t,n)=>r=>t.every((t,i)=>n(t,{...r,index:i})),et_=(t,n)=>({tr:r,commands:i})=>i.insertContentAt({from:r.selection.from,to:r.selection.to},t,n);function etS(t){let n=`<body>${t}</body>`;return new window.DOMParser().parseFromString(n,"text/html").body}function etT(t,n,r){if(r={slice:!0,parseOptions:{},...r},"object"==typeof t&&null!==t)try{return Array.isArray(t)&&t.length>0?Gz.fromArray(t.map(t=>n.nodeFromJSON(t))):n.nodeFromJSON(t)}catch(i){return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",i),etT("",n,r)}if("string"==typeof t){let o=Jy.fromSchema(n);return r.slice?o.parseSlice(etS(t),r.parseOptions).content:o.parse(etS(t),r.parseOptions)}return etT("",n,r)}let etw=t=>t.toString().startsWith("<"),etO=(t,n,r)=>({tr:i,dispatch:o,editor:a})=>{if(o){r={parseOptions:{},updateSelection:!0,...r};let u=etT(n,a.schema,{parseOptions:{preserveWhitespace:"full",...r.parseOptions}});if("<>"===u.toString())return!0;let{from:s,to:c}="number"==typeof t?{from:t,to:t}:t,l=!0,f=!0;if((etw(u)?u:[u]).forEach(t=>{t.check(),l=!!l&&t.isText&&0===t.marks.length,f=!!f&&t.isBlock}),s===c&&f){let{parent:d}=i.doc.resolve(s);!d.isTextblock||d.type.spec.code||d.childCount||(s-=1,c+=1)}l?Array.isArray(n)?i.insertText(n.map(t=>t.text||"").join(""),s,c):"object"==typeof n&&n&&n.text?i.insertText(n.text,s,c):i.insertText(n,s,c):i.replaceWith(s,c,u),r.updateSelection&&function(t,n,r){let i=t.steps.length-1;if(i<n)return;let o=t.steps[i];if(!(o instanceof Jq||o instanceof JV))return;let a=t.mapping.maps[i],u=0;a.forEach((t,n,r,i)=>{0===u&&(u=i)}),t.setSelection(Yo.near(t.doc.resolve(u),-1))}(i,i.steps.length-1,-1)}return!0},etk=()=>({state:t,dispatch:n})=>eey(t,n),etI=()=>({state:t,dispatch:n})=>eev(t,n),etM=()=>({state:t,dispatch:n})=>eel(t,n),etC=()=>({state:t,dispatch:n})=>eeh(t,n);function etR(){return"u">typeof navigator&&/Mac/.test(navigator.platform)}let etE=t=>({editor:n,view:r,tr:i,dispatch:o})=>{let a=(function(t){let n=t.split(/-(?!$)/),r=n[n.length-1];"Space"===r&&(r=" ");let i,o,a,u;for(let s=0;s<n.length-1;s+=1){let c=n[s];if(/^(cmd|meta|m)$/i.test(c))u=!0;else if(/^a(lt)?$/i.test(c))i=!0;else if(/^(c|ctrl|control)$/i.test(c))o=!0;else if(/^s(hift)?$/i.test(c))a=!0;else if(/^mod$/i.test(c))etv()||etR()?u=!0:o=!0;else throw Error(`Unrecognized modifier name: ${c}`)}return i&&(r=`Alt-${r}`),o&&(r=`Ctrl-${r}`),u&&(r=`Meta-${r}`),a&&(r=`Shift-${r}`),r})(t).split(/-(?!$)/),u=a.find(t=>!["Alt","Ctrl","Meta","Shift"].includes(t)),s=new KeyboardEvent("keydown",{key:"Space"===u?" ":u,altKey:a.includes("Alt"),ctrlKey:a.includes("Ctrl"),metaKey:a.includes("Meta"),shiftKey:a.includes("Shift"),bubbles:!0,cancelable:!0}),c=n.captureTransaction(()=>{r.someProp("handleKeyDown",t=>t(r,s))});return null==c||c.steps.forEach(t=>{let n=t.map(i.mapping);n&&o&&i.maybeStep(n)}),!0};function etA(t,n,r={}){let{from:i,to:o,empty:a}=t.selection,u=n?eeF(n,t.schema):null,s=[];t.doc.nodesBetween(i,o,(t,n)=>{if(t.isText)return;let r=Math.min(o,n+t.nodeSize);s.push({node:t,from:Math.max(i,n),to:r})});let c=s.filter(t=>!u||u.name===t.node.type.name).filter(t=>ets(t.node.attrs,r,{strict:!1}));return a?!!c.length:c.reduce((t,n)=>t+n.to-n.from,0)>=o-i}let etj=(t,n={})=>({state:r,dispatch:i})=>{let o=eeF(t,r.schema);return!!etA(r,o,n)&&eeb(r,i)},etN=()=>({state:t,dispatch:n})=>eew(t,n),etP=t=>({state:n,dispatch:r})=>{var i;let o=eeF(t,n.schema);return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==o);return!!a&&(!n||(r.node(a.depth-1).type==o?function(t,n,r,i){let o=t.tr,a=i.end,u=i.$to.end(i.depth);a<u&&(o.step(new JV(a-1,u,a,u,new GH(Gz.from(r.create(null,i.parent.copy())),1,0),1,!0)),i=new G4(o.doc.resolve(i.$from.pos),o.doc.resolve(u),i.depth));let s=JH(i);if(null==s)return!1;o.lift(i,s);let c=o.mapping.map(a,-1)-1;return JY(o.doc,c)&&o.join(c),n(o.scrollIntoView()),!0}(t,n,o,a):function(t,n,r){let i=t.tr,o=r.parent;for(let a=r.end,u=r.endIndex-1,s=r.startIndex;u>s;u--)a-=o.child(u).nodeSize,i.delete(a-1,a+1);let c=i.doc.resolve(r.start),l=c.nodeAfter;if(i.mapping.map(r.end)!=r.start+c.nodeAfter.nodeSize)return!1;let f=0==r.startIndex,d=r.endIndex==o.childCount,p=c.node(-1),h=c.index(-1);if(!p.canReplace(h+(f?0:1),h+1,l.content.append(d?Gz.empty:Gz.from(o))))return!1;let m=c.pos,g=m+l.nodeSize;return i.step(new JV(m-(f?1:0),g+(d?1:0),m+1,g-1,new GH((f?Gz.empty:Gz.from(o.copy(Gz.empty))).append(d?Gz.empty:Gz.from(o.copy(Gz.empty))),f?0:1,d?0:1),f?0:1)),n(i.scrollIntoView()),!0}(t,n,a)))}(n,r)},etL=()=>({state:t,dispatch:n})=>eex(t,n);function etF(t,n){return n.nodes[t]?"node":n.marks[t]?"mark":null}function etD(t,n){let r="string"==typeof n?[n]:n;return Object.keys(t).reduce((n,i)=>(r.includes(i)||(n[i]=t[i]),n),{})}let etW=(t,n)=>({tr:r,state:i,dispatch:o})=>{let a=null,u=null,s=etF("string"==typeof t?t:t.name,i.schema);return!!s&&("node"===s&&(a=eeF(t,i.schema)),"mark"===s&&(u=etd(t,i.schema)),o&&r.selection.ranges.forEach(t=>{i.doc.nodesBetween(t.$from.pos,t.$to.pos,(t,i)=>{a&&a===t.type&&r.setNodeMarkup(i,void 0,etD(t.attrs,n)),u&&t.marks.length&&t.marks.forEach(o=>{u===o.type&&r.addMark(i,i+t.nodeSize,u.create(etD(o.attrs,n)))})})}),!0)},etU=()=>({tr:t,dispatch:n})=>(n&&t.scrollIntoView(),!0),etz=()=>({tr:t,commands:n})=>n.setTextSelection({from:0,to:t.doc.content.size}),etB=()=>({state:t,dispatch:n})=>eed(t,n),etq=()=>({state:t,dispatch:n})=>eem(t,n),etV=()=>({state:t,dispatch:n})=>eeO(t,n),et$=()=>({state:t,dispatch:n})=>eeC(t,n),etK=()=>({state:t,dispatch:n})=>eeM(t,n);function etH(t,n,r={}){return etT(t,n,{slice:!1,parseOptions:r})}let etZ=(t,n=!1,r={})=>({tr:i,editor:o,dispatch:a})=>{let{doc:u}=i,s=etH(t,o.schema,r);return a&&i.replaceWith(0,u.content.size,s).setMeta("preventUpdate",!n),!0};function etG(t){return n=>(function(t,n){for(let r=t.depth;r>0;r-=1){let i=t.node(r);if(n(i))return{pos:r>0?t.before(r):0,start:t.start(r),depth:r,node:i}}})(n.$from,t)}function etJ(t,n){let r=etd(n,t.schema),{from:i,to:o,empty:a}=t.selection,u=[];a?(t.storedMarks&&u.push(...t.storedMarks),u.push(...t.selection.$head.marks())):t.doc.nodesBetween(i,o,t=>{u.push(...t.marks)});let s=u.find(t=>t.type.name===r.name);return s?{...s.attrs}:{}}function etY(t,n){let r=etF("string"==typeof n?n:n.name,t.schema);return"node"===r?function(t,n){let r=eeF(n,t.schema),{from:i,to:o}=t.selection,a=[];t.doc.nodesBetween(i,o,t=>{a.push(t)});let u=a.reverse().find(t=>t.type.name===r.name);return u?{...u.attrs}:{}}(t,n):"mark"===r?etJ(t,n):{}}function etQ(t,n,r){let i=[];return t===n?r.resolve(t).marks().forEach(n=>{let o=r.resolve(t-1),a=etf(o,n.type);a&&i.push({mark:n,...a})}):r.nodesBetween(t,n,(t,n)=>{i.push(...t.marks.map(r=>({from:n,to:n+t.nodeSize,mark:r})))}),i}function etX(t,n,r){return Object.fromEntries(Object.entries(r).filter(([r])=>{let i=t.find(t=>t.type===n&&t.name===r);return!!i&&i.attribute.keepOnSplit}))}function et0(t,n,r={}){let{empty:i,ranges:o}=t.selection,a=n?etd(n,t.schema):null;if(i)return!!(t.storedMarks||t.selection.$from.marks()).filter(t=>!a||a.name===t.type.name).find(t=>ets(t.attrs,r,{strict:!1}));let u=0,s=[];if(o.forEach(({$from:n,$to:r})=>{let i=n.pos,o=r.pos;t.doc.nodesBetween(i,o,(t,n)=>{if(!t.isText&&!t.marks.length)return;let r=Math.max(i,n),a=Math.min(o,n+t.nodeSize);u+=a-r,s.push(...t.marks.map(t=>({mark:t,from:r,to:a})))})}),0===u)return!1;let c=s.filter(t=>!a||a.name===t.mark.type.name).filter(t=>ets(t.mark.attrs,r,{strict:!1})).reduce((t,n)=>t+n.to-n.from,0),l=s.filter(t=>!a||t.mark.type!==a&&t.mark.type.excludes(a)).reduce((t,n)=>t+n.to-n.from,0);return(c>0?c+l:c)>=u}function et1(t,n){let{nodeExtensions:r}=eeP(n),i=r.find(n=>n.name===t);if(!i)return!1;let o={name:i.name,options:i.options,storage:i.storage},a=eez(eeN(i,"group",o));return"string"==typeof a&&a.split(" ").includes("list")}let et2=(t,n={})=>({tr:r,state:i,dispatch:o})=>{let{selection:a}=r,{empty:u,ranges:s}=a,c=etd(t,i.schema);if(o){if(u){let l=etJ(i,c);r.addStoredMark(c.create({...l,...n}))}else s.forEach(t=>{let o=t.$from.pos,a=t.$to.pos;i.doc.nodesBetween(o,a,(t,i)=>{let u=Math.max(i,o),s=Math.min(i+t.nodeSize,a);t.marks.find(t=>t.type===c)?t.marks.forEach(t=>{c===t.type&&r.addMark(u,s,c.create({...t.attrs,...n}))}):r.addMark(u,s,c.create(n))})})}return function(t,n,r){var i;let{selection:o}=n,a=null;if(etm(o)&&(a=o.$cursor),a){let u=null!==(i=t.storedMarks)&&void 0!==i?i:a.marks();return!!r.isInSet(u)||!u.some(t=>t.type.excludes(r))}let{ranges:s}=o;return s.some(({$from:n,$to:i})=>{let o=0===n.depth&&t.doc.inlineContent&&t.doc.type.allowsMarkType(r);return t.doc.nodesBetween(n.pos,i.pos,(t,n,i)=>{if(o)return!1;if(t.isInline){let a=!i||i.type.allowsMarkType(r),u=!!r.isInSet(t.marks)||!t.marks.some(t=>t.type.excludes(r));o=a&&u}return!o}),o})}(i,r,c)},et3=(t,n)=>({tr:r})=>(r.setMeta(t,n),!0),et4=(t,n={})=>({state:r,dispatch:i,chain:o})=>{let a=eeF(t,r.schema);return a.isTextblock?o().command(({commands:t})=>!!eeR(a,n)(r)||t.clearNodes()).command(({state:t})=>eeR(a,n)(t,i)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},et5=t=>({tr:n,dispatch:r})=>{if(r){let{doc:i}=n,o=etg(t,0,i.content.size),a=Yf.create(i,o);n.setSelection(a)}return!0},et6=t=>({tr:n,dispatch:r})=>{if(r){let{doc:i}=n,{from:o,to:a}="number"==typeof t?{from:t,to:t}:t,u=Yc.atStart(i).from,s=Yc.atEnd(i).to,c=etg(o,u,s),l=etg(a,u,s),f=Yc.create(i,c,l);n.setSelection(f)}return!0},et9=t=>({state:n,dispatch:r})=>{var i;let o=eeF(t,n.schema);return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==o);if(!a)return!1;let u=a.startIndex;if(0==u)return!1;let s=a.parent,c=s.child(u-1);if(c.type!=o)return!1;if(n){let l=c.lastChild&&c.lastChild.type==s.type,f=Gz.from(l?o.create():null),d=new GH(Gz.from(o.create(null,Gz.from(s.type.create(null,f)))),l?3:1,0),p=a.start,h=a.end;n(t.tr.step(new JV(p-(l?3:1),h,p,h,d,1,!0)).scrollIntoView())}return!0}(n,r)};function et8(t,n){let r=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(r){let i=r.filter(t=>null==n?void 0:n.includes(t.type.name));t.tr.ensureMarks(i)}}let et7=({keepMarks:t=!0}={})=>({tr:n,state:r,dispatch:i,editor:o})=>{let{selection:a,doc:u}=n,{$from:s,$to:c}=a,l=o.extensionManager.attributes,f=etX(l,s.node().type.name,s.node().attrs);if(a instanceof Yf&&a.node.isBlock)return!!(s.parentOffset&&JJ(u,s.pos))&&(i&&(t&&et8(r,o.extensionManager.splittableMarks),n.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;if(i){let d=c.parentOffset===c.parent.content.size;a instanceof Yc&&n.deleteSelection();let p=0===s.depth?void 0:function(t){for(let n=0;n<t.edgeCount;n+=1){let{type:r}=t.edge(n);if(r.isTextblock&&!r.hasRequiredAttrs())return r}return null}(s.node(-1).contentMatchAt(s.indexAfter(-1))),h=d&&p?[{type:p,attrs:f}]:void 0,m=JJ(n.doc,n.mapping.map(s.pos),1,h);if(!h&&!m&&JJ(n.doc,n.mapping.map(s.pos),1,p?[{type:p}]:void 0)&&(m=!0,h=p?[{type:p,attrs:f}]:void 0),m&&(n.split(n.mapping.map(s.pos),1,h),p&&!d&&!s.parentOffset&&s.parent.type!==p)){let g=n.mapping.map(s.before()),y=n.doc.resolve(g);s.node(-1).canReplaceWith(y.index(),y.index()+1,p)&&n.setNodeMarkup(n.mapping.map(s.before()),p)}t&&et8(r,o.extensionManager.splittableMarks),n.scrollIntoView()}return!0},ene=t=>({tr:n,state:r,dispatch:i,editor:o})=>{var a;let u=eeF(t,r.schema),{$from:s,$to:c}=r.selection,l=r.selection.node;if(l&&l.isBlock||s.depth<2||!s.sameParent(c))return!1;let f=s.node(-1);if(f.type!==u)return!1;let d=o.extensionManager.attributes;if(0===s.parent.content.size&&s.node(-1).childCount===s.indexAfter(-1)){if(2===s.depth||s.node(-3).type!==u||s.index(-2)!==s.node(-2).childCount-1)return!1;if(i){let p=Gz.empty,h=s.index(-1)?1:s.index(-2)?2:3;for(let m=s.depth-h;m>=s.depth-3;m-=1)p=Gz.from(s.node(m).copy(p));let g=s.indexAfter(-1)<s.node(-2).childCount?1:s.indexAfter(-2)<s.node(-3).childCount?2:3,y=etX(d,s.node().type.name,s.node().attrs),v=(null===(a=u.contentMatch.defaultType)||void 0===a?void 0:a.createAndFill(y))||void 0;p=p.append(Gz.from(u.createAndFill(null,v)||void 0));let b=s.before(s.depth-(h-1));n.replace(b,s.after(-g),new GH(p,4-h,0));let x=-1;n.doc.nodesBetween(b,n.doc.content.size,(t,n)=>{if(x>-1)return!1;t.isTextblock&&0===t.content.size&&(x=n+1)}),x>-1&&n.setSelection(Yc.near(n.doc.resolve(x))),n.scrollIntoView()}return!0}let _=c.pos===s.end()?f.contentMatchAt(0).defaultType:null,S=etX(d,f.type.name,f.attrs),T=etX(d,s.node().type.name,s.node().attrs);if(n.delete(s.pos,c.pos),!JJ(n.doc,s.pos,2))return!1;if(i){let{selection:w,storedMarks:O}=r,{splittableMarks:k}=o.extensionManager,I=O||w.$to.parentOffset&&w.$from.marks();if(n.split(s.pos,2,_?[{type:u,attrs:S},{type:_,attrs:T}]:[{type:u,attrs:S}]).scrollIntoView(),!I||!i)return!0;let M=I.filter(t=>k.includes(t.type.name));n.ensureMarks(M)}return!0},ent=(t,n)=>{let r=etG(t=>t.type===n)(t.selection);if(!r)return!0;let i=t.doc.resolve(Math.max(0,r.pos-1)).before(r.depth);if(void 0===i)return!0;let o=t.doc.nodeAt(i);return r.node.type===(null==o?void 0:o.type)&&JY(t.doc,r.pos)&&t.join(r.pos),!0},enn=(t,n)=>{let r=etG(t=>t.type===n)(t.selection);if(!r)return!0;let i=t.doc.resolve(r.start).after(r.depth);if(void 0===i)return!0;let o=t.doc.nodeAt(i);return r.node.type===(null==o?void 0:o.type)&&JY(t.doc,i)&&t.join(i),!0},enr=(t,n,r,i={})=>({editor:o,tr:a,state:u,dispatch:s,chain:c,commands:l,can:f})=>{let{extensions:d,splittableMarks:p}=o.extensionManager,h=eeF(t,u.schema),m=eeF(n,u.schema),{selection:g,storedMarks:y}=u,{$from:v,$to:b}=g,x=v.blockRange(b),_=y||g.$to.parentOffset&&g.$from.marks();if(!x)return!1;let S=etG(t=>et1(t.type.name,d))(g);if(x.depth>=1&&S&&x.depth-S.depth<=1){if(S.node.type===h)return l.liftListItem(m);if(et1(S.node.type.name,d)&&h.validContent(S.node.content)&&s)return c().command(()=>(a.setNodeMarkup(S.pos,h),!0)).command(()=>ent(a,h)).command(()=>enn(a,h)).run()}return r&&_&&s?c().command(()=>{let t=f().wrapInList(h,i),n=_.filter(t=>p.includes(t.type.name));return a.ensureMarks(n),!!t||l.clearNodes()}).wrapInList(h,i).command(()=>ent(a,h)).command(()=>enn(a,h)).run():c().command(()=>!!f().wrapInList(h,i)||l.clearNodes()).wrapInList(h,i).command(()=>ent(a,h)).command(()=>enn(a,h)).run()},eni=(t,n={},r={})=>({state:i,commands:o})=>{let{extendEmptyMarkRange:a=!1}=r,u=etd(t,i.schema);return et0(i,u,n)?o.unsetMark(u,{extendEmptyMarkRange:a}):o.setMark(u,n)},eno=(t,n,r={})=>({state:i,commands:o})=>{let a=eeF(t,i.schema),u=eeF(n,i.schema);return etA(i,a,r)?o.setNode(u):o.setNode(a,r)},ena=(t,n={})=>({state:r,commands:i})=>{let o=eeF(t,r.schema);return etA(r,o,n)?i.lift(o):i.wrapIn(o,n)},enu=()=>({state:t,dispatch:n})=>{let r=t.plugins;for(let i=0;i<r.length;i+=1){let o=r[i],a;if(o.spec.isInputRules&&(a=o.getState(t))){if(n){let u=t.tr,s=a.transform;for(let c=s.steps.length-1;c>=0;c-=1)u.step(s.steps[c].invert(s.docs[c]));if(a.text){let l=u.doc.resolve(a.from).marks();u.replaceWith(a.from,a.to,t.schema.text(a.text,l))}else u.delete(a.from,a.to)}return!0}}return!1},ens=()=>({tr:t,dispatch:n})=>{let{selection:r}=t,{empty:i,ranges:o}=r;return i||n&&o.forEach(n=>{t.removeMark(n.$from.pos,n.$to.pos)}),!0},enc=(t,n={})=>({tr:r,state:i,dispatch:o})=>{var a;let{extendEmptyMarkRange:u=!1}=n,{selection:s}=r,c=etd(t,i.schema),{$from:l,empty:f,ranges:d}=s;if(!o)return!0;if(f&&u){let{from:p,to:h}=s,m=null===(a=l.marks().find(t=>t.type===c))||void 0===a?void 0:a.attrs,g=etf(l,c,m);g&&(p=g.from,h=g.to),r.removeMark(p,h,c)}else d.forEach(t=>{r.removeMark(t.$from.pos,t.$to.pos,c)});return r.removeStoredMark(c),!0},enl=(t,n={})=>({tr:r,state:i,dispatch:o})=>{let a=null,u=null,s=etF("string"==typeof t?t:t.name,i.schema);return!!s&&("node"===s&&(a=eeF(t,i.schema)),"mark"===s&&(u=etd(t,i.schema)),o&&r.selection.ranges.forEach(t=>{let o=t.$from.pos,s=t.$to.pos;i.doc.nodesBetween(o,s,(t,i)=>{a&&a===t.type&&r.setNodeMarkup(i,void 0,{...t.attrs,...n}),u&&t.marks.length&&t.marks.forEach(a=>{if(u===a.type){let c=Math.min(i+t.nodeSize,s);r.addMark(Math.max(i,o),c,u.create({...a.attrs,...n}))}})})}),!0)},enf=(t,n={})=>({state:r,dispatch:i})=>{let o=eeF(t,r.schema);return(function(t,n=null){return function(r,i){let{$from:o,$to:a}=r.selection,u=o.blockRange(a),s=u&&JZ(u,t,n);return!!s&&(i&&i(r.tr.wrap(u,s).scrollIntoView()),!0)}})(o,n)(r,i)},end=(t,n={})=>({state:r,dispatch:i})=>{let o=eeF(t,r.schema);return(function(t,n=null){return function(r,i){let{$from:o,$to:a}=r.selection,u=o.blockRange(a),s=!1,c=u;if(!u)return!1;if(u.depth>=2&&o.node(u.depth-1).type.compatibleContent(t)&&0==u.startIndex){if(0==o.index(u.depth-1))return!1;let l=r.doc.resolve(u.start-2);c=new G4(l,l,u.depth),u.endIndex<u.parent.childCount&&(u=new G4(o,r.doc.resolve(a.end(u.depth)),u.depth)),s=!0}let f=JZ(c,t,n,u);return!!f&&(i&&i((function(t,n,r,i,o){let a=Gz.empty;for(let u=r.length-1;u>=0;u--)a=Gz.from(r[u].type.create(r[u].attrs,a));t.step(new JV(n.start-(i?2:0),n.end,n.start,n.end,new GH(a,0,0),r.length,!0));let s=0;for(let c=0;c<r.length;c++)r[c].type==o&&(s=c+1);let l=r.length-s,f=n.start+r.length-(i?2:0),d=n.parent;for(let p=n.startIndex,h=n.endIndex,m=!0;p<h;p++,m=!1)!m&&JJ(t.doc,f,l)&&(t.split(f,l),f+=2*l),f+=d.child(p).nodeSize;return t})(r.tr,u,f,s,t).scrollIntoView()),!0)}})(o,n)(r,i)};var enp=Object.freeze({__proto__:null,blur:ee9,clearContent:ee8,clearNodes:ee7,command:ete,createParagraphNear:ett,deleteCurrentNode:etn,deleteNode:etr,deleteRange:eti,deleteSelection:eto,enter:eta,exitCode:etu,extendMarkRange:etp,first:eth,focus:etb,forEach:etx,insertContent:et_,insertContentAt:etO,joinUp:etk,joinDown:etI,joinBackward:etM,joinForward:etC,keyboardShortcut:etE,lift:etj,liftEmptyBlock:etN,liftListItem:etP,newlineInCode:etL,resetAttributes:etW,scrollIntoView:etU,selectAll:etz,selectNodeBackward:etB,selectNodeForward:etq,selectParentNode:etV,selectTextblockEnd:et$,selectTextblockStart:etK,setContent:etZ,setMark:et2,setMeta:et3,setNode:et4,setNodeSelection:et5,setTextSelection:et6,sinkListItem:et9,splitBlock:et7,splitListItem:ene,toggleList:enr,toggleMark:eni,toggleNode:eno,toggleWrap:ena,undoInputRule:enu,unsetAllMarks:ens,unsetMark:enc,updateAttributes:enl,wrapIn:enf,wrapInList:end});let enh=ee3.create({name:"commands",addCommands:()=>({...enp})}),enm=ee3.create({name:"editable",addProseMirrorPlugins(){return[new YT({key:new Yk("editable"),props:{editable:()=>this.editor.options.editable}})]}}),eng=ee3.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:t}=this;return[new YT({key:new Yk("focusEvents"),props:{handleDOMEvents:{focus(n,r){t.isFocused=!0;let i=t.state.tr.setMeta("focus",{event:r}).setMeta("addToHistory",!1);return n.dispatch(i),!1},blur(n,r){t.isFocused=!1;let i=t.state.tr.setMeta("blur",{event:r}).setMeta("addToHistory",!1);return n.dispatch(i),!1}}}})]}}),eny=ee3.create({name:"keymap",addKeyboardShortcuts(){let t=()=>this.editor.commands.first(({commands:t})=>[()=>t.undoInputRule(),()=>t.command(({tr:n})=>{let{selection:r,doc:i}=n,{empty:o,$anchor:a}=r,{pos:u,parent:s}=a,c=Yo.atStart(i).from===u;return!!o&&!!c&&!!s.type.isTextblock&&!s.textContent.length&&t.clearNodes()}),()=>t.deleteSelection(),()=>t.joinBackward(),()=>t.selectNodeBackward()]),n=()=>this.editor.commands.first(({commands:t})=>[()=>t.deleteSelection(),()=>t.deleteCurrentNode(),()=>t.joinForward(),()=>t.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:t})=>[()=>t.newlineInCode(),()=>t.createParagraphNear(),()=>t.liftEmptyBlock(),()=>t.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:n,"Mod-Delete":n,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":n,"Ctrl-Alt-Backspace":n,"Alt-Delete":n,"Alt-d":n,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return etv()||etR()?o:i},addProseMirrorPlugins(){return[new YT({key:new Yk("clearDocument"),appendTransaction:(t,n,r)=>{if(!(t.some(t=>t.docChanged)&&!n.doc.eq(r.doc)))return;let{empty:i,from:o,to:a}=n.selection,u=Yo.atStart(n.doc).from,s=Yo.atEnd(n.doc).to;if(i||!(o===u&&a===s)||0!==r.doc.textBetween(0,r.doc.content.size," "," ").length)return;let c=r.tr,l=eeE({state:r,transaction:c}),{commands:f}=new eeA({editor:this.editor,state:l});if(f.clearNodes(),c.steps.length)return c}})]}}),env=ee3.create({name:"tabindex",addProseMirrorPlugins(){return[new YT({key:new Yk("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var enb=Object.freeze({__proto__:null,ClipboardTextSerializer:ee6,Commands:enh,Editable:enm,FocusEvents:eng,Keymap:eny,Tabindex:env});let enx=`.ProseMirror {
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[851],{71463:function(t,n,r){r.d(n,{kS:function(){return ecJ}});var i,o,a,u,s,c=r(2784),l=r(10873),f=r(74217),d=r(86579),p=r(1611),h=r(17329),m=r(98863),g=r(32184),y=r(661),v=r(52393),b=r(28316),x=r(87322),_=r(87598),S=Object.defineProperty,T=(t,n,r)=>n in t?S(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r,w=(t,n,r)=>(T(t,"symbol"!=typeof n?n+"":n,r),r),O="u">typeof globalThis?globalThis:"u">typeof window?window:"u">typeof r.g?r.g:"u">typeof self?self:{};function k(t){if(t.__esModule)return t;var n=t.default;if("function"==typeof n){var r=function t(){if(this instanceof t){var r=[null];return r.push.apply(r,arguments),new(Function.bind.apply(n,r))}return n.apply(this,arguments)};r.prototype=n.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var I,M={},C={get exports(){return M},set exports(e){M=e}},R={};(I=C).exports=function(){if(zR)return R;zR=1;var t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function a(n,a,u){var s,c={},l=null,f=null;for(s in void 0!==u&&(l=""+u),void 0!==a.key&&(l=""+a.key),void 0!==a.ref&&(f=a.ref),a)r.call(a,s)&&!o.hasOwnProperty(s)&&(c[s]=a[s]);if(n&&n.defaultProps)for(s in a=n.defaultProps)void 0===c[s]&&(c[s]=a[s]);return{$$typeof:t,type:n,key:l,ref:f,props:c,_owner:i.current}}return R.Fragment=n,R.jsx=a,R.jsxs=a,R}();var E=function(t){return function(){return{meet:function(n,r){return function(i){return t.meet(n(i),r(i))}},join:function(n,r){return function(i){return t.join(n(i),r(i))}},zero:function(){return t.zero},one:function(){return t.one},implies:function(n,r){return function(i){return t.implies(n(i),r(i))}},not:function(n){return function(r){return t.not(n(r))}}}}},A=function(t){return function(){return{concat:function(n,r){return function(i){return t.concat(n(i),r(i))}}}}},j=function(t){var n=A(t);return function(){return{concat:n().concat,empty:function(){return t.empty}}}},N=function(t){return{add:function(n,r){return function(i){return t.add(n(i),r(i))}},zero:function(){return t.zero},mul:function(n,r){return function(i){return t.mul(n(i),r(i))}},one:function(){return t.one}}},P=function(t){var n=N(t);return{add:n.add,mul:n.mul,one:n.one,zero:n.zero,sub:function(n,r){return function(i){return t.sub(n(i),r(i))}}}},L=function(t){return function(n){return n(t)}};function F(t){return t}function D(t){return function(){return t}}var W=D(!0),U=D(!1),z=D(null),B=D(void 0);function q(t,n,r,i,o,a,u,s,c){switch(arguments.length){case 1:return t;case 2:return function(){return n(t.apply(this,arguments))};case 3:return function(){return r(n(t.apply(this,arguments)))};case 4:return function(){return i(r(n(t.apply(this,arguments))))};case 5:return function(){return o(i(r(n(t.apply(this,arguments)))))};case 6:return function(){return a(o(i(r(n(t.apply(this,arguments))))))};case 7:return function(){return u(a(o(i(r(n(t.apply(this,arguments)))))))};case 8:return function(){return s(u(a(o(i(r(n(t.apply(this,arguments))))))))};case 9:return function(){return c(s(u(a(o(i(r(n(t.apply(this,arguments)))))))))}}}function V(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t}function $(t){return t+1}function K(t){return t-1}function H(t){throw Error("Called `absurd` function which should be uncallable")}function Z(t,n,r,i,o,a,u,s,c){switch(arguments.length){case 1:return t;case 2:return n(t);case 3:return r(n(t));case 4:return i(r(n(t)));case 5:return o(i(r(n(t))));case 6:return a(o(i(r(n(t)))));case 7:return u(a(o(i(r(n(t))))));case 8:return s(u(a(o(i(r(n(t)))))));case 9:return c(s(u(a(o(i(r(n(t))))))));default:for(var l=arguments[0],f=1;f<arguments.length;f++)l=arguments[f](l);return l}}var G=function(t,n){return n},J=function(){return{concat:function(t,n){return q(t,n)},empty:F}};let Y=Object.freeze(Object.defineProperty({__proto__:null,SK:G,absurd:H,apply:L,constFalse:U,constNull:z,constTrue:W,constUndefined:B,constVoid:B,constant:D,decrement:K,flip:function(t){return function(n,r){return t(r,n)}},flow:q,getBooleanAlgebra:E,getEndomorphismMonoid:J,getMonoid:j,getRing:P,getSemigroup:A,getSemiring:N,hole:H,identity:F,increment:$,not:function(t){return function(n){return!t(n)}},pipe:Z,tuple:V,tupled:function(t){return function(n){return t.apply(void 0,n)}},unsafeCoerce:F,untupled:function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t(n)}}},Symbol.toStringTag,{value:"Module"}));var Q=function(t){return{equals:function(n,r){return n===r||t(n,r)}}},X=function(t){return Q(function(n,r){for(var i in t)if(!t[i].equals(n[i],r[i]))return!1;return!0})},ee=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Q(function(n,r){return t.every(function(t,i){return t.equals(n[i],r[i])})})},et=function(t){return function(n){return Q(function(r,i){return n.equals(t(r),t(i))})}},en={equals:function(t,n){return t===n}},er={equals:function(){return!0}},ei=function(){return{concat:function(t,n){return Q(function(r,i){return t.equals(r,i)&&n.equals(r,i)})}}},eo=function(){return{concat:ei().concat,empty:er}},ea={URI:"Eq",contramap:function(t,n){return Z(t,et(n))}},eu=en.equals;let es=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:ea,URI:"Eq",contramap:et,eq:ea,eqBoolean:en,eqDate:{equals:function(t,n){return t.valueOf()===n.valueOf()}},eqNumber:en,eqStrict:en,eqString:en,fromEquals:Q,getMonoid:eo,getSemigroup:ei,getStructEq:X,getTupleEq:ee,strictEqual:eu,struct:X,tuple:ee},Symbol.toStringTag,{value:"Module"}));function ec(t,n){return function(r){return function(i){return t.map(i,function(t){return n.map(t,r)})}}}function el(t){return function(n){return function(r){return t.map(r,function(t){return t(n)})}}}function ef(t){return function(n){return function(r){return t.map(r,function(t){var r;return(r={})[n]=t,r})}}}function ed(t,n){var r=ec(t,n);return{map:function(t,n){return Z(t,r(n))}}}let ep=Object.freeze(Object.defineProperty({__proto__:null,bindTo:ef,flap:el,getFunctorComposition:ed,map:ec},Symbol.toStringTag,{value:"Module"}));var eh=globalThis&&globalThis.__spreadArray||function(t,n,r){if(r||2===arguments.length)for(var i,o=0,a=n.length;o<a;o++)!i&&o in n||(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return t.concat(i||Array.prototype.slice.call(n))},em=function(t){return"None"===t._tag},eg=function(t){return"Some"===t._tag},ey={_tag:"None"},ev=function(t){return{_tag:"Some",value:t}},eb=function(t){return"Left"===t._tag},ex=function(t){return"Right"===t._tag},e_=function(t){return{_tag:"Left",left:t}},eS=function(t){return{_tag:"Right",right:t}},eT=function(t){return[t]},ew=function(t){return t.length>0},eO=function(t){return t[0]},ek=function(t){return t.slice(1)},eI=[],eM={},eC=Object.prototype.hasOwnProperty,eR=function(t){return eh([t[0]],t.slice(1),!0)},eE=function(t,n){return{left:t,right:n}},eA=function(t,n){return Z(t,eP(n))},ej=function(t,n,r){return Z(t,eL(n,r))},eN=function(t){return function(n){return eE(eU(n),t(ez(n)))}},eP=function(t){return function(n){return eE(t(eU(n)),ez(n))}},eL=function(t,n){return function(r){return eE(t(eU(r)),n(ez(r)))}},eF="Separated",eD={URI:eF,map:function(t,n){return Z(t,eN(n))}},eW=el(eD),eU=function(t){return t.left},ez=function(t){return t.right};let eB=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:{URI:eF,mapLeft:eA,bimap:ej},Functor:eD,URI:eF,bimap:eL,flap:eW,left:eU,map:eN,mapLeft:eP,right:ez,separated:eE},Symbol.toStringTag,{value:"Module"}));function eq(t,n){return function(r){return function(i){return t.ap(t.map(i,function(t){return function(r){return n.ap(t,r)}}),r)}}}function eV(t){return function(n){return function(r){return t.ap(t.map(r,function(t){return function(){return t}}),n)}}}function e$(t){return function(n){return function(r){return t.ap(t.map(r,function(){return function(t){return t}}),n)}}}function eK(t){return function(n,r){return function(i){return t.ap(t.map(i,function(t){return function(r){var i;return Object.assign({},t,((i={})[n]=r,i))}}),r)}}}function eH(t){return function(n){return{concat:function(r,i){return t.ap(t.map(r,function(t){return function(r){return n.concat(t,r)}}),i)}}}}function eZ(t,n,r){return function(i){for(var o=Array(r.length+1),a=0;a<r.length;a++)o[a]=r[a];return o[r.length]=i,0===n?t.apply(null,o):eZ(t,n-1,o)}}var eG={1:function(t){return[t]},2:function(t){return function(n){return[t,n]}},3:function(t){return function(n){return function(r){return[t,n,r]}}},4:function(t){return function(n){return function(r){return function(i){return[t,n,r,i]}}}},5:function(t){return function(n){return function(r){return function(i){return function(o){return[t,n,r,i,o]}}}}}};function eJ(t){return eC.call(eG,t)||(eG[t]=eZ(V,t-1,[])),eG[t]}function eY(t){var n=t.length;switch(n){case 1:return function(n){var r;return(r={})[t[0]]=n,r};case 2:return function(n){return function(r){var i;return(i={})[t[0]]=n,i[t[1]]=r,i}};case 3:return function(n){return function(r){return function(i){var o;return(o={})[t[0]]=n,o[t[1]]=r,o[t[2]]=i,o}}};case 4:return function(n){return function(r){return function(i){return function(o){var a;return(a={})[t[0]]=n,a[t[1]]=r,a[t[2]]=i,a[t[3]]=o,a}}}};case 5:return function(n){return function(r){return function(i){return function(o){return function(a){var u;return(u={})[t[0]]=n,u[t[1]]=r,u[t[2]]=i,u[t[3]]=o,u[t[4]]=a,u}}}}};default:return eZ(function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];for(var o={},a=0;a<n;a++)o[t[a]]=r[a];return o},n-1,[])}}let eQ=Object.freeze(Object.defineProperty({__proto__:null,ap:eq,apFirst:eV,apS:eK,apSecond:e$,getApplySemigroup:eH,sequenceS:function(t){return function(n){for(var r=Object.keys(n),i=r.length,o=eY(r),a=t.map(n[r[0]],o),u=1;u<i;u++)a=t.ap(a,n[r[u]]);return a}},sequenceT:function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i=n.length,o=eJ(i),a=t.map(n[0],o),u=1;u<i;u++)a=t.ap(a,n[u]);return a}}},Symbol.toStringTag,{value:"Module"}));function eX(t){return function(n){return function(r){return t.chain(r,function(r){return t.map(n(r),function(){return r})})}}}function e0(t){return function(n,r){return function(i){return t.chain(i,function(i){return t.map(r(i),function(t){var r;return Object.assign({},i,((r={})[n]=t,r))})})}}}let e1=Object.freeze(Object.defineProperty({__proto__:null,bind:e0,chainFirst:eX},Symbol.toStringTag,{value:"Module"}));var e2=function(t){return function(n,r){return n===r||0===t(n,r)}},e3=function(t){return{equals:e2(t),compare:function(n,r){return n===r?0:t(n,r)}}},e4=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e3(function(n,r){for(var i=0;i<t.length-1;i++){var o=t[i].compare(n[i],r[i]);if(0!==o)return o}return t[i].compare(n[i],r[i])})},e5=function(t){return e3(function(n,r){return t.compare(r,n)})},e6=function(t){return function(n){return e3(function(r,i){return n.compare(t(r),t(i))})}},e9=function(){return{concat:function(t,n){return e3(function(r,i){var o=t.compare(r,i);return 0!==o?o:n.compare(r,i)})}}},e8=function(){return{concat:e9().concat,empty:e3(function(){return 0})}},e7={URI:"Ord",contramap:function(t,n){return Z(t,e6(n))}},te={equals:W,compare:D(0)},tt=function(t){return function(n){return function(r){return r===n||0===t.compare(r,n)}}},tn=function(t){return function(n,r){return -1===t.compare(n,r)}},tr=function(t){return function(n,r){return 1===t.compare(n,r)}},ti=function(t){return function(n,r){return 1!==t.compare(n,r)}},to=function(t){return function(n,r){return -1!==t.compare(n,r)}},ta=function(t){return function(n,r){return n===r||1>t.compare(n,r)?n:r}},tu=function(t){return function(n,r){return n===r||t.compare(n,r)>-1?n:r}},ts=function(t){var n=ta(t),r=tu(t);return function(t,i){return function(o){return r(n(o,i),t)}}},tc=function(t){var n=tn(t),r=tr(t);return function(t,i){return function(o){return!(n(o,t)||r(o,i))}}},tl={equals:en.equals,compare:function(t,n){return t<n?-1:t>n?1:0}},tf=Z(tl,e6(function(t){return t.valueOf()}));let td=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:e7,URI:"Ord",between:tc,clamp:ts,contramap:e6,equals:tt,equalsDefault:e2,fromCompare:e3,geq:to,getDualOrd:e5,getMonoid:e8,getSemigroup:e9,getTupleOrd:e4,gt:tr,leq:ti,lt:tn,max:tu,min:ta,ord:e7,ordBoolean:tl,ordDate:tf,ordNumber:tl,ordString:tl,reverse:e5,trivial:te,tuple:e4},Symbol.toStringTag,{value:"Module"}));var tp=function(t){return{concat:function(n,r){return t.concat(r,n)}}},th=function(t){return function(n){return{concat:function(r,i){return t(r)?n.concat(r,i):i}}}},tm=function(t){return function(n){return{concat:function(r,i){return t(i)?n.concat(r,i):r}}}},tg=function(t){return function(n){return{concat:function(r,i){return n.concat(t(r),t(i))}}}},ty=function(t){return function(n){return function(r){return r.reduce(function(n,r){return t.concat(n,r)},n)}}};let tv=Object.freeze(Object.defineProperty({__proto__:null,concatAll:ty,endo:tg,filterFirst:th,filterSecond:tm,reverse:tp},Symbol.toStringTag,{value:"Module"}));var tb=function(t){return{concat:ta(t)}},tx=function(t){return{concat:tu(t)}},t_=function(t){return{concat:function(){return t}}},tS=function(t){return{concat:function(n,r){var i={};for(var o in t)eC.call(t,o)&&(i[o]=t[o].concat(n[o],r[o]));return i}}},tT=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return{concat:function(n,r){return t.map(function(t,i){return t.concat(n[i],r[i])})}}},tw=function(t){return function(n){return{concat:function(r,i){return n.concat(r,n.concat(t,i))}}}},tO=function(){return{concat:F}},tk=function(){return{concat:function(t,n){return n}}},tI=t_(void 0),tM=function(){return{concat:function(t,n){return Object.assign({},t,n)}}},tC={concat:function(t,n){return t&&n}},tR={concat:function(t,n){return t||n}},tE={concat:function(t,n){return t+n}},tA={concat:function(t,n){return t+n}},tj={concat:function(t,n){return t*n}};let tN=Object.freeze(Object.defineProperty({__proto__:null,concatAll:ty,constant:t_,first:tO,fold:function(t){var n=ty(t);return function(t,r){return void 0===r?n(t):n(t)(r)}},getDualSemigroup:tp,getFirstSemigroup:tO,getFunctionSemigroup:A,getIntercalateSemigroup:tw,getJoinSemigroup:tx,getLastSemigroup:tk,getMeetSemigroup:tb,getObjectSemigroup:tM,getStructSemigroup:tS,getTupleSemigroup:tT,intercalate:tw,last:tk,max:tx,min:tb,reverse:tp,semigroupAll:tC,semigroupAny:tR,semigroupProduct:tj,semigroupString:tE,semigroupSum:tA,semigroupVoid:tI,struct:tS,tuple:tT},Symbol.toStringTag,{value:"Module"}));var tP=globalThis&&globalThis.__spreadArray||function(t,n,r){if(r||2===arguments.length)for(var i,o=0,a=n.length;o<a;o++)!i&&o in n||(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return t.concat(i||Array.prototype.slice.call(n))},tL=function(t,n){return t<0||t>=n.length},tF=function(t){return function(n){return tP([t],n,!0)}},tD=function(t){return function(n){return tP(tP([],n,!0),[t],!1)}},tW=function(t,n,r){if(ew(r)){var i=eR(r);return i.splice(t,0,n),i}return[n]},tU=function(t,n,r){if(r[t]===n)return r;var i=eR(r);return i[t]=n,i},tz=function(t){return function(n){if(1===n.length)return n;for(var r=[nQ(n)],i=nX(n),o=function(n){r.every(function(r){return!t.equals(r,n)})&&r.push(n)},a=0;a<i.length;a++)o(i[a]);return r}},tB=function(t){if(ew(t)){var n=e8();return t3(t.reduce(n.concat,n.empty))}return F},tq=function(t){var n=tz(t);return function(t){return function(r){return n(Z(r,tX(t)))}}},tV=function(t){return function(n){var r=n.length,i=Math.round(t)%r;if(tL(Math.abs(i),n)||0===i)return n;if(!(i<0))return tV(i-r)(n);var o=nn(-i)(n),a=o[0];return Z(o[1],tX(a))}},t$=function(t){return ew(t)?ev(t):ey},tK=function(t){return function(n){for(var r=Math.max(0,Math.floor(n)),i=[t(0)],o=1;o<r;o++)i.push(t(o));return i}},tH=function(t){return tK(function(){return t})},tZ=function(t,n){return t<=n?tK(function(n){return t+n})(n-t+1):[t]},tG=function(t){return[nQ(t),nX(t)]},tJ=function(t){return[n1(t),n0(t)]},tY=function(t){return t$(t.slice())};function tQ(t){return function(n){return n.concat(t)}}function tX(t,n){return n?t.concat(n):function(n){return n.concat(t)}}var t0=function(t){return 1===t.length?t:tP([n0(t)],t.slice(0,-1).reverse(),!0)};function t1(t){return function(n){var r=n.length;if(0===r)return eI;for(var i=[],o=n[0],a=[o],u=1;u<r;u++){var s=n[u];t.equals(s,o)?a.push(s):(i.push(a),a=[o=s])}return i.push(a),i}}var t2=function(t){return function(n){for(var r={},i=0;i<n.length;i++){var o=n[i],a=t(o);eC.call(r,a)?r[a].push(o):r[a]=[o]}return r}},t3=function(t){return function(n){return 1===n.length?n:n.slice().sort(t.compare)}},t4=function(t,n){return t5(t,function(){return n})},t5=function(t,n){return function(r){return tL(t,r)?ey:ev(tU(t,n(r[t]),r))}},t6=function(t,n,r){for(var i=[r(t[0],n[0])],o=Math.min(t.length,n.length),a=1;a<o;a++)i[a]=r(t[a],n[a]);return i},t9=function(t){for(var n=[t[0][0]],r=[t[0][1]],i=1;i<t.length;i++)n[i]=t[i][0],r[i]=t[i][1];return[n,r]},t8=function(t){return function(n){for(var r=[t,n[0]],i=1;i<n.length;i++)r.push(t,n[i]);return r}},t7=function(t){return function(n){var r=nX(n);return ew(r)?Z(r,t8(t),tF(nQ(n))):n}},ne=function(t){return function(n){for(var r=eR(t(0,nQ(n))),i=1;i<n.length;i++)r.push.apply(r,t(i,n[i]));return r}},nt=function(t){return function(n){for(var r=t(n),i=r[0],o=r[1],a=[i],u=o;ew(u);){var s=t(u),c=s[0],l=s[1];a.push(c),u=l}return a}},nn=function(t){return function(n){var r=Math.max(1,t);return r>=n.length?[n,eI]:[Z(n.slice(1,r),tF(nQ(n))),n.slice(r)]}},nr=function(t){return nt(nn(t))},ni=function(t,n){return Z(t,nO(n))},no=function(t,n){return Z(t,nk(n))},na=function(t,n){return Z(t,nx(n))},nu=function(t,n){return Z(t,n_(n))},ns=function(t,n){return Z(t,nS(n))},nc=function(t,n,r){return Z(t,nI(n,r))},nl=function(t){var n=nM(t);return function(t,r){return Z(t,n(r))}},nf=function(t,n,r){return Z(t,nC(n,r))},nd=function(t){var n=nj(t);return function(t,r){return Z(t,n(r))}},np=function(t,n){return Z(t,nb(n))},nh=function(t,n,r){return Z(t,nR(n,r))},nm=function(t){var n=nE(t);return function(t,r){return Z(t,n(r))}},ng=function(t,n,r){return Z(t,nA(n,r))},ny=function(t){var n=nP(t);return function(t,r){return Z(t,n(r))}},nv=function(t){return function(n){return Z(n,tQ(t()))}},nb=nv,nx=function(t){return n_(function(n){return Z(t,nO(n))})},n_=function(t){return ne(function(n,r){return t(r)})},nS=function(t){return function(n){for(var r=nX(n),i=[t(n)];ew(r);)i.push(t(r)),r=nX(r);return i}},nT=nS(F),nw=n_(F),nO=function(t){return nk(function(n,r){return t(r)})},nk=function(t){return function(n){for(var r=[t(0,nQ(n))],i=1;i<n.length;i++)r.push(t(i,n[i]));return r}},nI=function(t,n){return nR(t,function(t,r,i){return n(r,i)})},nM=function(t){return function(n){return function(r){return r.slice(1).reduce(function(r,i){return t.concat(r,n(i))},n(r[0]))}}},nC=function(t,n){return nA(t,function(t,r,i){return n(r,i)})},nR=function(t,n){return function(r){return r.reduce(function(t,r,i){return n(i,t,r)},t)}},nE=function(t){return function(n){return function(r){return r.slice(1).reduce(function(r,i,o){return t.concat(r,n(o+1,i))},n(0,r[0]))}}},nA=function(t,n){return function(r){return r.reduceRight(function(t,r,i){return n(i,r,t)},t)}},nj=function(t){var n=nP(t);return function(t){return n(function(n,r){return t(r)})}},nN=function(t){return nP(t)(G)},nP=function(t){return function(n){return function(r){for(var i=t.map(n(0,nQ(r)),eT),o=1;o<r.length;o++)i=t.ap(t.map(i,function(t){return function(n){return Z(t,tD(n))}}),n(o,r[o]));return i}}},nL="ReadonlyNonEmptyArray",nF=function(t){return{show:function(n){return"[".concat(n.map(t.show).join(", "),"]")}}},nD=function(){return{concat:tX}},nW=function(t){return Q(function(n,r){return n.length===r.length&&n.every(function(n,i){return t.equals(n,r[i])})})},nU=function(t){var n=tq(t);return{concat:function(t,r){return n(r)(t)}}},nz={URI:nL,map:ni},nB=el(nz),nq={URI:nL,map:ni,ap:na},nV=eV(nq),n$=e$(nq),nK={URI:nL,map:ni,ap:na,chain:nu},nH=eX(nK),nZ=eT(eM),nG=ef(nz),nJ=e0(nK),nY=eK(nq),nQ=eO,nX=ek,n0=function(t){return t[t.length-1]},n1=function(t){return t.slice(0,-1)},n2=function(t){var n=tb(t);return function(t){return t.reduce(n.concat)}},n3=function(t){var n=tx(t);return function(t){return t.reduce(n.concat)}},n4=function(t){return function(n){return n.reduce(t.concat)}},n5=function(t){return function(n){return t(nQ(n),nX(n))}},n6=function(t){return function(n){return t(n1(n),n0(n))}},n9=function(t){return function(n){return tP([t(nQ(n))],nX(n),!0)}},n8=function(t){return n9(function(){return t})},n7=function(t){return function(n){return Z(n1(n),tD(t(n0(n))))}},re=function(t){return n7(function(){return t})},rt=function(t){var n=n4(t);return function(t){return q(t7(t),n)}},rn=function(t){return function(n){return t$(n.filter(function(n,r){return t(r,n)}))}};function rr(t,n){return void 0===n?tF(t):Z(n,tF(t))}var ri=function(t,n){return Z(t,tX([n]))},ro=function(t,n){return function(r){return t<0||t>r.length?ey:ev(tW(t,n,r))}};let ra=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:nL,map:ni,alt:np},Applicative:{URI:nL,map:ni,ap:na,of:eT},Apply:nq,Chain:nK,Comonad:{URI:nL,map:ni,extend:ns,extract:eO},Do:nZ,Foldable:{URI:nL,reduce:nc,foldMap:nl,reduceRight:nf},FoldableWithIndex:{URI:nL,reduce:nc,foldMap:nl,reduceRight:nf,reduceWithIndex:nh,foldMapWithIndex:nm,reduceRightWithIndex:ng},Functor:nz,FunctorWithIndex:{URI:nL,map:ni,mapWithIndex:no},Monad:{URI:nL,map:ni,ap:na,of:eT,chain:nu},Pointed:{URI:nL,of:eT},Traversable:{URI:nL,map:ni,reduce:nc,foldMap:nl,reduceRight:nf,traverse:nd,sequence:nN},TraversableWithIndex:{URI:nL,map:ni,mapWithIndex:no,reduce:nc,foldMap:nl,reduceRight:nf,traverse:nd,sequence:nN,reduceWithIndex:nh,foldMapWithIndex:nm,reduceRightWithIndex:ng,traverseWithIndex:ny},URI:nL,alt:nb,altW:nv,ap:nx,apFirst:nV,apS:nY,apSecond:n$,append:tD,appendW:tD,bind:nJ,bindTo:nG,chain:n_,chainFirst:nH,chainWithIndex:ne,chop:nt,chunksOf:nr,concat:tX,concatAll:n4,concatW:tQ,cons:rr,duplicate:nT,empty:eI,extend:nS,extract:eO,filter:function(t){return rn(function(n,r){return t(r)})},filterWithIndex:rn,flap:nB,flatten:nw,fold:n4,foldMap:nM,foldMapWithIndex:nE,fromArray:tY,fromReadonlyArray:t$,getEq:nW,getSemigroup:nD,getShow:nF,getUnionSemigroup:nU,group:t1,groupBy:t2,groupSort:function(t){var n=t3(t),r=t1(t);return function(t){return ew(t)?r(n(t)):eI}},head:nQ,init:n1,insertAt:ro,intercalate:rt,intersperse:t7,isNonEmpty:ew,isOutOfBound:tL,last:n0,makeBy:tK,map:nO,mapWithIndex:nk,matchLeft:n5,matchRight:n6,max:n3,min:n2,modifyAt:t5,modifyHead:n9,modifyLast:n7,of:eT,prepend:tF,prependAll:t8,prependToAll:t8,prependW:tF,range:tZ,readonlyNonEmptyArray:{URI:nL,of:eT,map:ni,mapWithIndex:no,ap:na,chain:nu,extend:ns,extract:eO,reduce:nc,foldMap:nl,reduceRight:nf,traverse:nd,sequence:nN,reduceWithIndex:nh,foldMapWithIndex:nm,reduceRightWithIndex:ng,traverseWithIndex:ny,alt:np},reduce:nI,reduceRight:nC,reduceRightWithIndex:nA,reduceWithIndex:nR,replicate:tH,reverse:t0,rotate:tV,sequence:nN,snoc:ri,sort:t3,sortBy:tB,splitAt:nn,tail:nX,traverse:nj,traverseWithIndex:nP,unappend:tJ,uncons:tG,union:tq,uniq:tz,unprepend:tG,unsafeInsertAt:tW,unsafeUpdateAt:tU,unsnoc:tJ,unzip:t9,updateAt:t4,updateHead:n8,updateLast:re,zip:function t(n,r){return void 0===r?function(r){return t(r,n)}:t6(n,r,function(t,n){return[t,n]})},zipWith:t6},Symbol.toStringTag,{value:"Module"}));var ru={equals:function(t,n){return t===n}},rs={concat:function(t,n){return t+n}},rc={concat:rs.concat,empty:""},rl={equals:ru.equals,compare:function(t,n){return t<n?-1:t>n?1:0}},rf=function(t){return"string"==typeof t},rd=function(t){return t.toUpperCase()},rp=function(t){return t.toLowerCase()},rh=function(t,n){return function(r){return r.replace(t,n)}},rm=function(t){return t.trim()},rg=function(t){return t.trimLeft()},ry=function(t){return t.trimRight()},rv=function(t,n){return function(r){return r.slice(t,n)}},rb=function(t){return 0===t.length},rx=function(t){return t.length},r_=function(t){return function(n){var r=n.split(t);return ew(r)?r:[n]}},rS=function(t,n){return function(r){return r.includes(t,n)}},rT=function(t,n){return function(r){return r.startsWith(t,n)}},rw=function(t,n){return function(r){return r.endsWith(t,n)}};let rO=Object.freeze(Object.defineProperty({__proto__:null,Eq:ru,Monoid:rc,Ord:rl,Semigroup:rs,Show:{show:function(t){return JSON.stringify(t)}},empty:"",endsWith:rw,includes:rS,isEmpty:rb,isString:rf,replace:rh,size:rx,slice:rv,split:r_,startsWith:rT,toLowerCase:rp,toUpperCase:rd,trim:rm,trimLeft:rg,trimRight:ry},Symbol.toStringTag,{value:"Module"}));function rk(t,n){return function(r){var i=t.traverse(r);return function(t,o){return r.map(i(t,o),n.separate)}}}function rI(t,n){return function(r){var i=t.traverse(r);return function(t,o){return r.map(i(t,o),n.compact)}}}function rM(t){return function(n){var r=t.wither(n);return function(t){return function(i){return r(i,function(r){return n.map(t(r),function(t){return t?ev(r):ey})})}}}}let rC=Object.freeze(Object.defineProperty({__proto__:null,filterE:rM,wiltDefault:rk,witherDefault:rI},Symbol.toStringTag,{value:"Module"}));var rR=function(t){return Object.assign({},t)},rE=function(t){return Object.assign({},t)},rA=function(t){return Object.keys(t).length},rj=function(t){for(var n in t)if(eC.call(t,n))return!1;return!0},rN=function(t){return function(n){return Object.keys(n).sort(t.compare)}},rP=rN(rl);function rL(t){if("function"==typeof t)return rL(rl)(t);var n=rN(t);return function(t){return function(r){for(var i=[],o=0,a=n(r);o<a.length;o++){var u=a[o];i.push(t(u,r[u]))}return i}}}var rF=rL(rl)(function(t,n){return[t,n]}),rD=function(t,n){return function(r){if(eC.call(r,t)&&r[t]===n)return r;var i=Object.assign({},r);return i[t]=n,i}},rW=function(t,n){return eC.call(n,t)};function rU(t){return function(n){if(!eC.call(n,t))return n;var r=Object.assign({},n);return delete r[t],r}}var rz=function(t,n){return function(r){if(!rW(t,r))return ey;if(r[t]===n)return ev(r);var i=Object.assign({},r);return i[t]=n,ev(i)}},rB=function(t,n){return function(r){if(!rW(t,r))return ey;var i=n(r[t]);if(i===r[t])return ev(r);var o=Object.assign({},r);return o[t]=i,ev(o)}};function rq(t){return function(n,r){if(void 0===r){var i=rq(t);return function(t){return i(t,n)}}for(var o in n)if(!eC.call(r,o)||!t.equals(n[o],r[o]))return!1;return!0}}function rV(t,n){return void 0===n?function(n){return rV(t,n)}:eC.call(n,t)?ev(n[t]):ey}var r$={};function rK(t){return function(n){var r={};for(var i in n)eC.call(n,i)&&(r[i]=t(i,n[i]));return r}}function rH(t){return rK(function(n,r){return t(r)})}function rZ(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(2===t.length)return rZ(rl).apply(void 0,t);var r=rN(t[0]);return function(t,n){return function(i){for(var o=t,a=r(i),u=a.length,s=0;s<u;s++){var c=a[s];o=n(c,o,i[c])}return o}}}function rG(t){if("compare"in t){var n=rN(t);return function(t){return function(r){return function(i){for(var o=t.empty,a=n(i),u=a.length,s=0;s<u;s++){var c=a[s];o=t.concat(o,r(c,i[c]))}return o}}}}return rG(rl)(t)}function rJ(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(2===t.length)return rJ(rl).apply(void 0,t);var r=rN(t[0]);return function(t,n){return function(i){for(var o=t,a=r(i),u=a.length,s=u-1;s>=0;s--){var c=a[s];o=n(c,i[c],o)}return o}}}var rY=function(t,n){var r;return(r={})[t]=n,r};function rQ(t){var n=ik(rl)(t);return function(t){return function(r){return n(r,t)}}}function rX(t){var n=iw(rl)(t);return function(t){return function(r){return n(r,t)}}}function r0(t){return iO(rl)(t)}var r1=function(t){var n=rX(t);return function(r){return function(i){return t.map(Z(i,n(r)),iN)}}},r2=function(t){var n=rX(t);return function(r){return function(i){return t.map(Z(i,n(r)),iP)}}};function r3(t){return function(n){var r={},i={};for(var o in n)if(eC.call(n,o)){var a=t(o,n[o]);switch(a._tag){case"Left":r[o]=a.left;break;case"Right":i[o]=a.right}}return eE(r,i)}}function r4(t){return function(n){var r={},i={};for(var o in n)if(eC.call(n,o)){var a=n[o];t(o,a)?i[o]=a:r[o]=a}return eE(r,i)}}function r5(t){return function(n){var r={};for(var i in n)if(eC.call(n,i)){var o=t(i,n[i]);eg(o)&&(r[i]=o.value)}return r}}function r6(t){return function(n){var r={},i=!1;for(var o in n)if(eC.call(n,o)){var a=n[o];t(o,a)?r[o]=a:i=!0}return i?r:n}}function r9(t,n){var r=r8(t,n);return function(t){return r(t,F)}}function r8(t,n){return function(r,i){return n.reduce(r,{},function(n,r){var o=i(r),a=o[0],u=o[1];return n[a]=eC.call(n,a)?t.concat(n[a],u):u,n})}}var r7=function(t){for(var n={},r=0;r<t.length;r++){var i=t[r];n[i[0]]=i[1]}return n};function ie(t){return function(n){for(var r in n)if(!t(n[r]))return!1;return!0}}function it(t){return function(n){for(var r in n)if(t(n[r]))return!0;return!1}}function ir(t){return function(n,r){if(void 0===r){var i=ir(t);return function(t){return i(n,t)}}for(var o in r)if(t.equals(r[o],n))return!0;return!1}}var ii=function(t){return function(n){return function(r){if(rj(r))return n;if(rj(n))return r;var i={};for(var o in r)rW(o,n)?i[o]=t.concat(r[o],n[o]):i[o]=r[o];for(var o in n)rW(o,i)||(i[o]=n[o]);return i}}},io=function(t){return function(n){return function(r){if(rj(r)||rj(n))return r$;var i={};for(var o in r)rW(o,n)&&(i[o]=t.concat(r[o],n[o]));return i}}},ia=function(t){return function(n){if(rj(n))return t;if(rj(t))return n;var r={};for(var i in n)rW(i,t)||(r[i]=n[i]);for(var i in t)rW(i,n)||(r[i]=t[i]);return r}},iu=function(t,n){return Z(t,rH(n))},is=function(t,n){return Z(t,rK(n))},ic=function(t){var n=iE(t);return function(t,r,i){return Z(t,n(r,i))}},il=function(t){return function(n){var r=iA(t)(n);return function(t,n){return Z(t,r(n))}}},id=function(t){var n=ij(t);return function(t,r,i){return Z(t,n(r,i))}},ip=function(t,n){return Z(t,iI(n))},ih=function(t,n){return Z(t,iM(n))},im=function(t,n){return Z(t,iC(n))},ig=function(t,n){return Z(t,iR(n))},iy=function(t){var n=rZ(t);return function(t,r,i){return Z(t,n(r,i))}},iv=function(t){var n=rG(t);return function(t){var r=n(t);return function(t,n){return Z(t,r(n))}}},ib=function(t){var n=rJ(t);return function(t,r,i){return Z(t,n(r,i))}},ix=function(t,n){return Z(t,r3(n))},i_=function(t,n){return Z(t,r4(n))},iS=function(t,n){return Z(t,r5(n))},iT=function(t,n){return Z(t,r6(n))},iw=function(t){var n=ik(t);return function(t){var r=n(t);return function(t,n){return r(t,q(G,n))}}},iO=function(t){var n=iw(t);return function(t){var r=n(t);return function(t){return r(t,F)}}},ik=function(t){return function(n){var r=rN(t);return function(t,i){var o=r(t);if(0===o.length)return n.of(r$);for(var a=n.of({}),u=function(r){a=n.ap(n.map(a,function(t){return function(n){var i;return Object.assign({},t,((i={})[r]=n,i))}}),i(r,t[r]))},s=0;s<o.length;s++)u(o[s]);return a}}},iI=function(t){return r6(function(n,r){return t(r)})},iM=function(t){return r5(function(n,r){return t(r)})},iC=function(t){return r4(function(n,r){return t(r)})},iR=function(t){return r3(function(n,r){return t(r)})};function iE(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(1===t.length){var r=rZ(t[0]);return function(t,n){return r(t,function(t,r,i){return n(r,i)})}}return iE(rl).apply(void 0,t)}function iA(t){if("compare"in t){var n=rG(t);return function(t){var r=n(t);return function(t){return r(function(n,r){return t(r)})}}}return iA(rl)(t)}function ij(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(1===t.length){var r=rJ(t[0]);return function(t,n){return r(t,function(t,r,i){return n(r,i)})}}return ij(rl).apply(void 0,t)}var iN=function(t){var n={};for(var r in t)if(eC.call(t,r)){var i=t[r];eg(i)&&(n[r]=i.value)}return n},iP=function(t){var n={},r={};for(var i in t)if(eC.call(t,i)){var o=t[i];eb(o)?n[i]=o.left:r[i]=o.right}return eE(n,r)},iL="ReadonlyRecord";function iF(t){return"compare"in t?function(n){return{show:function(r){var i=rL(t)(function(t,r){return"".concat(JSON.stringify(t),": ").concat(n.show(r))})(r).join(", ");return""===i?"{}":"{ ".concat(i," }")}}}:iF(rl)(t)}function iD(t){var n=rq(t);return Q(function(t,r){return n(t)(r)&&n(r)(t)})}function iW(t){return{concat:function(n,r){if(rj(n))return r;if(rj(r))return n;var i=Object.assign({},n);for(var o in r)eC.call(r,o)&&(i[o]=eC.call(n,o)?t.concat(n[o],r[o]):r[o]);return i},empty:r$}}var iU={URI:iL,map:iu},iz=el(iU),iB=function(t){return{URI:iL,reduce:ic(t),foldMap:il(t),reduceRight:id(t)}},iq=function(t){return{URI:iL,reduce:ic(t),foldMap:il(t),reduceRight:id(t),reduceWithIndex:iy(t),foldMapWithIndex:iv(t),reduceRightWithIndex:ib(t)}},iV={URI:iL,compact:iN,separate:iP},i$=function(t){return{URI:iL,map:iu,reduce:ic(t),foldMap:il(t),reduceRight:id(t),traverse:iw(t),sequence:iO(t)}},iK=function(t){return{URI:iL,map:iu,mapWithIndex:is,reduce:ic(t),foldMap:il(t),reduceRight:id(t),reduceWithIndex:iy(t),foldMapWithIndex:iv(t),reduceRightWithIndex:ib(t),traverse:iw(t),sequence:iO(t),traverseWithIndex:ik(t)}},iH=function(t){var n=i$(t);return{URI:iL,map:iu,reduce:ic(t),foldMap:il(t),reduceRight:id(t),traverse:n.traverse,sequence:n.sequence,compact:iN,separate:iP,filter:ip,filterMap:ih,partition:im,partitionMap:ig,wither:rI(n,iV),wilt:rk(n,iV)}},iZ=function(t){var n=ii(t);return{concat:function(t,r){return n(r)(t)}}},iG=function(t){return{concat:iZ(t).concat,empty:r$}},iJ=function(t){var n=io(t);return{concat:function(t,r){return n(r)(t)}}},iY=function(){return{concat:function(t,n){return ia(n)(t)}}},iQ={URI:iL,reduce:ic(rl),foldMap:il(rl),reduceRight:id(rl)},iX={URI:iL,reduce:ic(rl),foldMap:il(rl),reduceRight:id(rl),reduceWithIndex:iy(rl),foldMapWithIndex:iv(rl),reduceRightWithIndex:ib(rl)},i0={URI:iL,map:iu,reduce:ic(rl),foldMap:il(rl),reduceRight:id(rl),traverse:iw(rl),sequence:r0},i1={URI:iL,map:iu,mapWithIndex:is,reduce:ic(rl),foldMap:il(rl),reduceRight:id(rl),reduceWithIndex:iy(rl),foldMapWithIndex:iv(rl),reduceRightWithIndex:ib(rl),traverse:iw(rl),sequence:r0,traverseWithIndex:ik(rl)},i2=rI(i0,iV),i3=rk(i0,iV),i4={URI:iL,map:iu,reduce:ic(rl),foldMap:il(rl),reduceRight:id(rl),traverse:iw(rl),sequence:r0,compact:iN,separate:iP,filter:ip,filterMap:ih,partition:im,partitionMap:ig,wither:i2,wilt:i3};function i5(t,n){return eC.call(void 0===n?this:n,t)}var i6={URI:iL,map:iu,reduce:ic(rl),foldMap:il(rl),reduceRight:id(rl),traverse:iw(rl),sequence:r0,compact:iN,separate:iP,filter:ip,filterMap:ih,partition:im,partitionMap:ig,mapWithIndex:is,reduceWithIndex:iy(rl),foldMapWithIndex:iv(rl),reduceRightWithIndex:ib(rl),filterMapWithIndex:iS,filterWithIndex:iT,partitionMapWithIndex:ix,partitionWithIndex:i_,traverseWithIndex:ik(rl),wither:i2,wilt:i3};let i9=Object.freeze(Object.defineProperty({__proto__:null,Compactable:iV,Filterable:{URI:iL,map:iu,compact:iN,separate:iP,filter:ip,filterMap:ih,partition:im,partitionMap:ig},FilterableWithIndex:{URI:iL,map:iu,mapWithIndex:is,compact:iN,separate:iP,filter:ip,filterMap:ih,partition:im,partitionMap:ig,filterMapWithIndex:iS,filterWithIndex:iT,partitionMapWithIndex:ix,partitionWithIndex:i_},Foldable:iQ,FoldableWithIndex:iX,Functor:iU,FunctorWithIndex:{URI:iL,map:iu,mapWithIndex:is},Traversable:i0,TraversableWithIndex:i1,URI:iL,Witherable:i4,_filter:ip,_filterMap:ih,_filterMapWithIndex:iS,_filterWithIndex:iT,_foldMap:il,_foldMapWithIndex:iv,_map:iu,_mapWithIndex:is,_partition:im,_partitionMap:ig,_partitionMapWithIndex:ix,_partitionWithIndex:i_,_reduce:ic,_reduceRight:id,_reduceRightWithIndex:ib,_reduceWithIndex:iy,_sequence:iO,_traverse:iw,collect:rL,compact:iN,deleteAt:rU,difference:ia,elem:ir,empty:r$,every:ie,filter:iI,filterMap:iM,filterMapWithIndex:r5,filterWithIndex:r6,flap:iz,foldMap:iA,foldMapWithIndex:rG,fromEntries:r7,fromFoldable:r9,fromFoldableMap:r8,fromRecord:rR,getDifferenceMagma:iY,getEq:iD,getFoldable:iB,getFoldableWithIndex:iq,getIntersectionSemigroup:iJ,getMonoid:iW,getShow:iF,getTraversable:i$,getTraversableWithIndex:iK,getUnionMonoid:iG,getUnionSemigroup:iZ,getWitherable:iH,has:rW,hasOwnProperty:i5,insertAt:rD,intersection:io,isEmpty:rj,isSubrecord:rq,keys:rP,lookup:rV,map:rH,mapWithIndex:rK,modifyAt:rB,partition:iC,partitionMap:iR,partitionMapWithIndex:r3,partitionWithIndex:r4,pop:function(t){var n=rU(t);return function(r){var i=rV(t,r);return em(i)?ey:ev([i.value,n(r)])}},readonlyRecord:i6,reduce:iE,reduceRight:ij,reduceRightWithIndex:rJ,reduceWithIndex:rZ,separate:iP,sequence:r0,singleton:rY,size:rA,some:it,toEntries:rF,toReadonlyArray:rF,toRecord:rE,toUnfoldable:function(t){return function(n){var r=rF(n),i=r.length;return t.unfold(0,function(t){return t<i?ev([r[t],t+1]):ey})}},traverse:rX,traverseWithIndex:rQ,union:ii,updateAt:rz,upsertAt:rD,wilt:r2,wither:r1},Symbol.toStringTag,{value:"Module"})),i8=(0,c.createContext)(void 0);function i7(){let t=(0,c.useContext)(i8);if(!t)throw Error("Missing EditorConfigContext.Provider");return t}class oe extends Error{}function ot(t){throw new oe(`Missing EditorConfig.${t}`)}var on,or,oi,oo,oa,ou,oc,ol,of,od,op,oh,om,og,oy,ov,ob,ox,o_,oS,oT,ow,oO,ok,oI,oM,oC,oR,oE,oA,oj={},oN={};on={get exports(){return oN},set exports(e){oN=e}},function(t){var n="object"==typeof O?O:"object"==typeof self?self:"object"==typeof this?this:{};function r(t,r){return t!==n&&("function"==typeof Object.create?Object.defineProperty(t,"__esModule",{value:!0}):t.__esModule=!0),function(n,i){return t[n]=r?r(n,i):i}}t(r(n,r(on.exports)))}(function(t){var n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])};or=function(t,r){if("function"!=typeof r&&null!==r)throw TypeError("Class extends value "+String(r)+" is not a constructor or null");function i(){this.constructor=t}n(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)},oi=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t},oo=function(t,n){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&0>n.indexOf(i)&&(r[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,i=Object.getOwnPropertySymbols(t);o<i.length;o++)0>n.indexOf(i[o])&&Object.prototype.propertyIsEnumerable.call(t,i[o])&&(r[i[o]]=t[i[o]]);return r},oa=function(t,n,r,i){var o,a=arguments.length,u=a<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)u=Reflect.decorate(t,n,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(u=(a<3?o(u):a>3?o(n,r,u):o(n,r))||u);return a>3&&u&&Object.defineProperty(n,r,u),u},ou=function(t,n){return function(r,i){n(r,i,t)}},oc=function(t,n,r,i,o,a){function u(t){if(void 0!==t&&"function"!=typeof t)throw TypeError("Function expected");return t}for(var s,c=i.kind,l="getter"===c?"get":"setter"===c?"set":"value",f=!n&&t?i.static?t:t.prototype:null,d=n||(f?Object.getOwnPropertyDescriptor(f,i.name):{}),p=!1,h=r.length-1;h>=0;h--){var m={};for(var g in i)m[g]="access"===g?{}:i[g];for(var g in i.access)m.access[g]=i.access[g];m.addInitializer=function(t){if(p)throw TypeError("Cannot add initializers after decoration has completed");a.push(u(t||null))};var y=(0,r[h])("accessor"===c?{get:d.get,set:d.set}:d[l],m);if("accessor"===c){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw TypeError("Object expected");(s=u(y.get))&&(d.get=s),(s=u(y.set))&&(d.set=s),(s=u(y.init))&&o.push(s)}else(s=u(y))&&("field"===c?o.push(s):d[l]=s)}f&&Object.defineProperty(f,i.name,d),p=!0},ol=function(t,n,r){for(var i=arguments.length>2,o=0;o<n.length;o++)r=i?n[o].call(t,r):n[o].call(t);return i?r:void 0},of=function(t){return"symbol"==typeof t?t:"".concat(t)},od=function(t,n,r){return"symbol"==typeof n&&(n=n.description?"[".concat(n.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",n):n})},op=function(t,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,n)},oh=function(t,n,r,i){return new(r||(r=Promise))(function(o,a){function u(t){try{c(i.next(t))}catch(n){a(n)}}function s(t){try{c(i.throw(t))}catch(n){a(n)}}function c(t){var n;t.done?o(t.value):((n=t.value)instanceof r?n:new r(function(t){t(n)})).then(u,s)}c((i=i.apply(t,n||[])).next())})},om=function(t,n){var r,i,o,a,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(u=0)),u;)try{if(r=1,i&&(o=2&s[0]?i.return:s[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;switch(i=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,i=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){u=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){u.label=s[1];break}if(6===s[0]&&u.label<o[1]){u.label=o[1],o=s;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(s);break}o[2]&&u.ops.pop(),u.trys.pop();continue}s=n.call(t,u)}catch(c){s=[6,c],i=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},og=function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||oA(n,t,r)},oA=Object.create?function(t,n,r,i){void 0===i&&(i=r);var o=Object.getOwnPropertyDescriptor(n,r);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[r]}}),Object.defineProperty(t,i,o)}:function(t,n,r,i){void 0===i&&(i=r),t[i]=n[r]},oy=function(t){var n="function"==typeof Symbol&&Symbol.iterator,r=n&&t[n],i=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")},ov=function(t,n){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,o,a=r.call(t),u=[];try{for(;(void 0===n||n-- >0)&&!(i=a.next()).done;)u.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}return u},ob=function(){for(var t=[],n=0;n<arguments.length;n++)t=t.concat(ov(arguments[n]));return t},ox=function(){for(var t=0,n=0,r=arguments.length;n<r;n++)t+=arguments[n].length;for(var i=Array(t),o=0,n=0;n<r;n++)for(var a=arguments[n],u=0,s=a.length;u<s;u++,o++)i[o]=a[u];return i},o_=function(t,n,r){if(r||2===arguments.length)for(var i,o=0,a=n.length;o<a;o++)!i&&o in n||(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return t.concat(i||Array.prototype.slice.call(n))},oS=function(t){return this instanceof oS?(this.v=t,this):new oS(t)},oT=function(t,n,r){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var i,o=r.apply(t,n||[]),a=[];return i={},u("next"),u("throw"),u("return"),i[Symbol.asyncIterator]=function(){return this},i;function u(t){o[t]&&(i[t]=function(n){return new Promise(function(r,i){a.push([t,n,r,i])>1||s(t,n)})})}function s(t,n){try{var r;r=o[t](n),r.value instanceof oS?Promise.resolve(r.value.v).then(c,l):f(a[0][2],r)}catch(i){f(a[0][3],i)}}function c(t){s("next",t)}function l(t){s("throw",t)}function f(t,n){t(n),a.shift(),a.length&&s(a[0][0],a[0][1])}},ow=function(t){var n,r;return n={},i("next"),i("throw",function(t){throw t}),i("return"),n[Symbol.iterator]=function(){return this},n;function i(i,o){n[i]=t[i]?function(n){return(r=!r)?{value:oS(t[i](n)),done:!1}:o?o(n):n}:o}},oO=function(t){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var n,r=t[Symbol.asyncIterator];return r?r.call(t):(t="function"==typeof oy?oy(t):t[Symbol.iterator](),n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n);function i(r){n[r]=t[r]&&function(n){return new Promise(function(i,o){(function(t,n,r,i){Promise.resolve(i).then(function(n){t({value:n,done:r})},n)})(i,o,(n=t[r](n)).done,n.value)})}}},ok=function(t,n){return Object.defineProperty?Object.defineProperty(t,"raw",{value:n}):t.raw=n,t};var r=Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n};oI=function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var i in t)"default"!==i&&Object.prototype.hasOwnProperty.call(t,i)&&oA(n,t,i);return r(n,t),n},oM=function(t){return t&&t.__esModule?t:{default:t}},oC=function(t,n,r,i){if("a"===r&&!i)throw TypeError("Private accessor was defined without a getter");if("function"==typeof n?t!==n||!i:!n.has(t))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(t):i?i.value:n.get(t)},oR=function(t,n,r,i,o){if("m"===i)throw TypeError("Private method is not writable");if("a"===i&&!o)throw TypeError("Private accessor was defined without a setter");if("function"==typeof n?t!==n||!o:!n.has(t))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?o.call(t,r):o?o.value=r:n.set(t,r),r},oE=function(t,n){if(null===n||"object"!=typeof n&&"function"!=typeof n)throw TypeError("Cannot use 'in' operator on non-object");return"function"==typeof t?n===t:t.has(n)},t("__extends",or),t("__assign",oi),t("__rest",oo),t("__decorate",oa),t("__param",ou),t("__esDecorate",oc),t("__runInitializers",ol),t("__propKey",of),t("__setFunctionName",od),t("__metadata",op),t("__awaiter",oh),t("__generator",om),t("__exportStar",og),t("__createBinding",oA),t("__values",oy),t("__read",ov),t("__spread",ob),t("__spreadArrays",ox),t("__spreadArray",o_),t("__await",oS),t("__asyncGenerator",oT),t("__asyncDelegator",ow),t("__asyncValues",oO),t("__makeTemplateObject",ok),t("__importStar",oI),t("__importDefault",oM),t("__classPrivateFieldGet",oC),t("__classPrivateFieldSet",oR),t("__classPrivateFieldIn",oE)});var oP={};function oL(t){return function(n){return function(r){return r.reduce(function(n,r){return t.alt(n,function(){return r})},n)}}}let oF=Object.freeze(Object.defineProperty({__proto__:null,altAll:oL},Symbol.toStringTag,{value:"Module"})),oD=Object.freeze(Object.defineProperty({__proto__:null,altAll:function(t){return oL(t)(t.zero())}},Symbol.toStringTag,{value:"Module"}));function oW(t){var n=eH(t);return function(r){return{concat:n(r).concat,empty:t.of(r.empty)}}}function oU(t,n){var r=ed(t,n).map,i=eq(t,n);return{map:r,of:function(r){return t.of(n.of(r))},ap:function(t,n){return Z(t,i(n))}}}let oz=Object.freeze(Object.defineProperty({__proto__:null,getApplicativeComposition:oU,getApplicativeMonoid:oW},Symbol.toStringTag,{value:"Module"}));function oB(t){return function(n){return function(r){return t.fromEither(em(r)?e_(n()):eS(r.value))}}}function oq(t){return function(n,r){return function(i){return t.fromEither(n(i)?eS(i):e_(r(i)))}}}function oV(t){var n=oB(t);return function(t){var r=n(t);return function(t){return q(t,r)}}}function o$(t,n){var r=oV(t);return function(t){var i=r(t);return function(t){return function(r){return n.chain(r,i(t))}}}}function oK(t){return function(n){return q(n,t.fromEither)}}function oH(t,n){var r=oK(t);return function(t){return function(i){return n.chain(i,r(t))}}}function oZ(t,n){return q(oK(t),eX(n))}function oG(t,n){return function(r,i){return function(o){return n.chain(o,function(n){return t.fromEither(r(n)?eS(n):e_(i(n)))})}}}let oJ=Object.freeze(Object.defineProperty({__proto__:null,chainEitherK:oH,chainFirstEitherK:oZ,chainOptionK:o$,filterOrElse:oG,fromEitherK:oK,fromOption:oB,fromOptionK:oV,fromPredicate:oq},Symbol.toStringTag,{value:"Module"}));var oY=globalThis&&globalThis.__spreadArray||function(t,n,r){if(r||2===arguments.length)for(var i,o=0,a=n.length;o<a;o++)!i&&o in n||(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return t.concat(i||Array.prototype.slice.call(n))},oQ=function(t){return t.length>0},oX=function(t,n){return t<0||t>=n.length},o0=function(t){return function(n){return oY([t],n,!0)}},o1=function(t){return function(n){return oY(oY([],n,!0),[t],!1)}},o2=function(t,n,r){if(oQ(r)){var i=o8(r);return i.splice(t,0,n),i}return[n]},o3=function(t,n,r){var i=o8(r);return i[t]=n,i},o4=function(t){return function(n){if(1===n.length)return ah(n);for(var r=[ui(n)],i=uo(n),o=function(n){r.every(function(r){return!t.equals(r,n)})&&r.push(n)},a=0;a<i.length;a++)o(i[a]);return r}},o5=function(t){if(oQ(t)){var n=e8();return al(t.reduce(n.concat,n.empty))}return ah},o6=function(t){var n=o4(t);return function(t){return function(r){return n(Z(r,aa(t)))}}},o9=function(t){return function(n){var r=n.length,i=Math.round(t)%r;if(oX(Math.abs(i),n)||0===i)return ah(n);if(!(i<0))return o9(i-r)(n);var o=aS(-i)(n),a=o[0];return Z(o[1],aa(a))}},o8=eR,o7=function(t){return oQ(t)?ev(t):ey},ae=function(t){return function(n){for(var r=Math.max(0,Math.floor(n)),i=[t(0)],o=1;o<r;o++)i.push(t(o));return i}},at=function(t){return ae(function(){return t})},an=function(t,n){return t<=n?ae(function(n){return t+n})(n-t+1):[t]},ar=function(t){return[ui(t),uo(t)]},ai=function(t){return[uu(t),ua(t)]};function ao(t){return function(n){return n.concat(t)}}function aa(t,n){return n?t.concat(n):function(n){return n.concat(t)}}var au=function(t){return oY([ua(t)],t.slice(0,-1).reverse(),!0)};function as(t){return function(n){var r=n.length;if(0===r)return[];for(var i=[],o=n[0],a=[o],u=1;u<r;u++){var s=n[u];t.equals(s,o)?a.push(s):(i.push(a),a=[o=s])}return i.push(a),i}}var ac=function(t){return function(n){for(var r={},i=0;i<n.length;i++){var o=n[i],a=t(o);eC.call(r,a)?r[a].push(o):r[a]=[o]}return r}},al=function(t){return function(n){return n.slice().sort(t.compare)}},af=function(t,n){return function(r){return t<0||t>r.length?ey:ev(o2(t,n,r))}},ad=function(t,n){return ap(t,function(){return n})},ap=function(t,n){return function(r){return oX(t,r)?ey:ev(o3(t,n(r[t]),r))}},ah=o8,am=function(t){return[t]},ag=function(t,n,r){for(var i=[r(t[0],n[0])],o=Math.min(t.length,n.length),a=1;a<o;a++)i[a]=r(t[a],n[a]);return i},ay=function(t){for(var n=[t[0][0]],r=[t[0][1]],i=1;i<t.length;i++)n[i]=t[i][0],r[i]=t[i][1];return[n,r]},av=function(t){return function(n){for(var r=[t,n[0]],i=1;i<n.length;i++)r.push(t,n[i]);return r}},ab=function(t){return function(n){var r=uo(n);return oQ(r)?Z(r,av(t),o0(ui(n))):ah(n)}},ax=function(t){return function(n){for(var r=o8(t(0,ui(n))),i=1;i<n.length;i++)r.push.apply(r,t(i,n[i]));return r}},a_=function(t){return function(n){for(var r=t(n),i=r[0],o=r[1],a=[i],u=o;oQ(u);){var s=t(u),c=s[0],l=s[1];a.push(c),u=l}return a}},aS=function(t){return function(n){var r=Math.max(1,t);return r>=n.length?[ah(n),[]]:[Z(n.slice(1,r),o0(ui(n))),n.slice(r)]}},aT=function(t){return a_(aS(t))},aw=function(t,n){return Z(t,a$(n))},aO=function(t,n){return Z(t,aK(n))},ak=function(t,n){return Z(t,aU(n))},aI=function(t,n){return Z(t,az(n))},aM=function(t,n){return Z(t,aB(n))},aC=function(t,n,r){return Z(t,aH(n,r))},aR=function(t){var n=nM(t);return function(t,r){return Z(t,n(r))}},aE=function(t,n,r){return Z(t,aG(n,r))},aA=function(t){var n=aY(t);return function(t,r){return Z(t,n(r))}},aj=function(t,n){return Z(t,aW(n))},aN=function(t,n,r){return Z(t,aZ(n,r))},aP=function(t){var n=nE(t);return function(t,r){return Z(t,n(r))}},aL=function(t,n,r){return Z(t,aJ(n,r))},aF=function(t){var n=aX(t);return function(t,r){return Z(t,n(r))}},aD=function(t){return function(n){return Z(n,ao(t()))}},aW=aD,aU=function(t){return az(function(n){return Z(t,a$(n))})},az=function(t){return ax(function(n,r){return t(r)})},aB=function(t){return function(n){for(var r=uo(n),i=[t(n)];oQ(r);)i.push(t(r)),r=uo(r);return i}},aq=aB(F),aV=az(F),a$=function(t){return aK(function(n,r){return t(r)})},aK=function(t){return function(n){for(var r=[t(0,ui(n))],i=1;i<n.length;i++)r.push(t(i,n[i]));return r}},aH=nI,aZ=nR,aG=nC,aJ=nA,aY=function(t){var n=aX(t);return function(t){return n(function(n,r){return t(r)})}},aQ=function(t){return aX(t)(function(t,n){return n})},aX=function(t){return function(n){return function(r){for(var i=t.map(n(0,ui(r)),am),o=1;o<r.length;o++)i=t.ap(t.map(i,function(t){return function(n){return Z(t,o1(n))}}),n(o,r[o]));return i}}},a0="NonEmptyArray",a1=function(){return{concat:aa}},a2=function(t){var n=o6(t);return{concat:function(t,r){return n(r)(t)}}},a3={URI:a0,map:aw},a4=el(a3),a5={URI:a0,map:aw,ap:ak},a6=eV(a5),a9=e$(a5),a8={URI:a0,map:aw,ap:ak,chain:aI},a7=eX(a8),ue=am(eM),ut=ef(a3),un=e0(a8),ur=eK(a5),ui=nQ,uo=function(t){return t.slice(1)},ua=n0,uu=function(t){return t.slice(0,-1)},us=function(t){return function(n){return n.reduce(t.concat)}},uc=function(t){return function(n){return t(ui(n),uo(n))}},ul=function(t){return function(n){return t(uu(n),ua(n))}},uf=function(t){return function(n){return oY([t(ui(n))],uo(n),!0)}},ud=function(t){return uf(function(){return t})},up=function(t){return function(n){return Z(uu(n),o1(t(ua(n))))}},uh=function(t){return up(function(){return t})},um=function(t){return function(n){return o7(n.filter(function(n,r){return t(r,n)}))}};function ug(t,n){return void 0===n?o0(t):Z(n,o0(t))}var uy=function(t,n){return Z(t,o1(n))};let uv=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:a0,map:aw,alt:aj},Applicative:{URI:a0,map:aw,ap:ak,of:am},Apply:a5,Chain:a8,Comonad:{URI:a0,map:aw,extend:aM,extract:nQ},Do:ue,Foldable:{URI:a0,reduce:aC,foldMap:aR,reduceRight:aE},FoldableWithIndex:{URI:a0,reduce:aC,foldMap:aR,reduceRight:aE,reduceWithIndex:aN,foldMapWithIndex:aP,reduceRightWithIndex:aL},Functor:a3,FunctorWithIndex:{URI:a0,map:aw,mapWithIndex:aO},Monad:{URI:a0,map:aw,ap:ak,of:am,chain:aI},Pointed:{URI:a0,of:am},Traversable:{URI:a0,map:aw,reduce:aC,foldMap:aR,reduceRight:aE,traverse:aA,sequence:aQ},TraversableWithIndex:{URI:a0,map:aw,mapWithIndex:aO,reduce:aC,foldMap:aR,reduceRight:aE,traverse:aA,sequence:aQ,reduceWithIndex:aN,foldMapWithIndex:aP,reduceRightWithIndex:aL,traverseWithIndex:aF},URI:a0,alt:aW,altW:aD,ap:aU,apFirst:a6,apS:ur,apSecond:a9,append:o1,appendW:o1,bind:un,bindTo:ut,chain:az,chainFirst:a7,chainWithIndex:ax,chop:a_,chunksOf:aT,concat:aa,concatAll:us,concatW:ao,cons:ug,copy:ah,duplicate:aq,extend:aB,extract:nQ,filter:function(t){return um(function(n,r){return t(r)})},filterWithIndex:um,flap:a4,flatten:aV,fold:n4,foldMap:nM,foldMapWithIndex:nE,fromArray:o7,fromReadonlyNonEmptyArray:o8,getEq:nW,getSemigroup:a1,getShow:nF,getUnionSemigroup:a2,group:as,groupBy:ac,groupSort:function(t){var n=al(t),r=as(t);return function(t){return oQ(t)?r(n(t)):[]}},head:ui,init:uu,insertAt:af,intercalate:rt,intersperse:ab,isNonEmpty:oQ,isOutOfBound:oX,last:ua,makeBy:ae,map:a$,mapWithIndex:aK,matchLeft:uc,matchRight:ul,max:n3,min:n2,modifyAt:ap,modifyHead:uf,modifyLast:up,nonEmptyArray:{URI:a0,of:am,map:aw,mapWithIndex:aO,ap:ak,chain:aI,extend:aM,extract:nQ,reduce:aC,foldMap:aR,reduceRight:aE,traverse:aA,sequence:aQ,reduceWithIndex:aN,foldMapWithIndex:aP,reduceRightWithIndex:aL,traverseWithIndex:aF,alt:aj},of:am,prepend:o0,prependAll:av,prependToAll:av,prependW:o0,range:an,reduce:aH,reduceRight:aG,reduceRightWithIndex:aJ,reduceWithIndex:aZ,replicate:at,reverse:au,rotate:o9,sequence:aQ,snoc:uy,sort:al,sortBy:o5,splitAt:aS,tail:uo,traverse:aY,traverseWithIndex:aX,unappend:ai,uncons:ar,union:o6,uniq:o4,unprepend:ar,unsafeInsertAt:o2,unsafeUpdateAt:o3,unsnoc:ai,unzip:ay,updateAt:ad,updateHead:ud,updateLast:uh,zip:function t(n,r){return void 0===r?function(r){return t(r,n)}:ag(n,r,function(t,n){return[t,n]})},zipWith:ag},Symbol.toStringTag,{value:"Module"}));var ub=function(t){return"number"==typeof t},ux={equals:function(t,n){return t===n}},u_={equals:ux.equals,compare:function(t,n){return t<n?-1:t>n?1:0}},uS={equals:ux.equals,compare:u_.compare,top:1/0,bottom:-1/0},uT={concat:function(t,n){return t-n}},uw={concat:function(t,n){return t+n}},uO={concat:function(t,n){return t*n}},uk={concat:uw.concat,empty:0},uI={concat:uO.concat,empty:1},uM={add:uw.concat,zero:0,mul:uO.concat,one:1,sub:uT.concat,degree:function(t){return 1},div:function(t,n){return t/n},mod:function(t,n){return t%n}};let uC=Object.freeze(Object.defineProperty({__proto__:null,Bounded:uS,Eq:ux,Field:uM,MagmaSub:uT,MonoidProduct:uI,MonoidSum:uk,Ord:u_,SemigroupProduct:uO,SemigroupSum:uw,Show:{show:function(t){return JSON.stringify(t)}},isNumber:ub},Symbol.toStringTag,{value:"Module"}));function uR(t,n){return function(r){return r?n.of(void 0):t.zero()}}let uE=Object.freeze(Object.defineProperty({__proto__:null,guard:uR},Symbol.toStringTag,{value:"Module"}));var uA=globalThis&&globalThis.__spreadArray||function(t,n,r){if(r||2===arguments.length)for(var i,o=0,a=n.length;o<a;o++)!i&&o in n||(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return t.concat(i||Array.prototype.slice.call(n))},uj=function(t){return 0===t.length},uN=function(t,n){return t<=0?cH:tK(n)(t)},uP=function(t,n){return uN(t,function(){return n})},uL=function(t){return em(t)?cH:[t.value]},uF=function(t){return eb(t)?cH:[t.right]},uD=function(t,n){return function(r){return ew(r)?n(r):t()}},uW=function(t,n){return function(r){return ew(r)?n(nQ(r),nX(r)):t()}},uU=function(t,n){return function(r){return ew(r)?n(n1(r),n0(r)):t()}},uz=function(t){return function(n){if(uj(n))return cH;for(var r=[],i=0;i<n.length;i++)r.push.apply(r,t(i,n[i]));return r}},uB=function(t,n){return function(r){var i=r.length,o=Array(i+1);o[0]=t;for(var a=0;a<i;a++)o[a+1]=n(o[a],r[a]);return o}},uq=function(t,n){return function(r){var i=r.length,o=Array(i+1);o[i]=t;for(var a=i-1;a>=0;a--)o[a]=n(r[a],o[a+1]);return o}},uV=function(t){return t.length};function u$(t,n){return void 0===n?function(n){return u$(t,n)}:tL(t,n)?ey:ev(n[t])}var uK=function(t){return ew(t)?ev(nQ(t)):ey},uH=function(t){return ew(t)?ev(n0(t)):ey},uZ=function(t){return ew(t)?ev(nX(t)):ey},uG=function(t){return ew(t)?ev(n1(t)):ey},uJ=function(t){return function(n){return tL(t,n)?n:0===t?cH:n.slice(0,t)}},uY=function(t){return function(n){return tL(t,n)?n:0===t?cH:n.slice(-t)}},uQ=function(t,n){for(var r=t.length,i=0;i<r&&n(t[i]);i++);return i},uX=function(t){return function(n){return t<=0||uj(n)?n:t>=n.length?cH:n.slice(t,n.length)}},u0=function(t){return function(n){return t<=0||uj(n)?n:t>=n.length?cH:n.slice(0,n.length-t)}},u1=function(t){return function(n){for(var r=0;r<n.length;r++)if(t(n[r]))return ev(r);return ey}};function u2(t){return function(n){for(var r=0;r<n.length;r++)if(t(n[r]))return ev(n[r]);return ey}}var u3=function(t){return function(n){for(var r=0;r<n.length;r++){var i=t(n[r]);if(eg(i))return i}return ey}};function u4(t){return function(n){for(var r=n.length-1;r>=0;r--)if(t(n[r]))return ev(n[r]);return ey}}var u5=function(t){return function(n){for(var r=n.length-1;r>=0;r--){var i=t(n[r]);if(eg(i))return i}return ey}},u6=function(t){return function(n){for(var r=n.length-1;r>=0;r--)if(t(n[r]))return ev(r);return ey}},u9=function(t,n){return function(r){return t<0||t>r.length?ey:ev(tW(t,n,r))}},u8=function(t,n){return se(t,function(){return n})},u7=function(t){return function(n){return tL(t,n)?ey:ev(cV(t,n))}},se=function(t,n){return function(r){return tL(t,r)?ey:ev(cq(t,n(r[t]),r))}},st=function(t){return t.length<=1?t:t.slice().reverse()},sn=function(t){for(var n=[],r=0;r<t.length;r++){var i=t[r];"Right"===i._tag&&n.push(i.right)}return n},sr=function(t){for(var n=[],r=0;r<t.length;r++){var i=t[r];"Left"===i._tag&&n.push(i.left)}return n},si=function(t){return function(n){return n.length<=1?n:n.slice().sort(t.compare)}},so=function(t,n,r){for(var i=[],o=Math.min(t.length,n.length),a=0;a<o;a++)i[a]=r(t[a],n[a]);return i},sa=function(t){for(var n=[],r=[],i=0;i<t.length;i++)n[i]=t[i][0],r[i]=t[i][1];return[n,r]},su=function(t){var n=t8(t);return function(t){return ew(t)?n(t):t}},ss=function(t){var n=t7(t);return function(t){return ew(t)?n(t):t}},sc=function(t){var n=tV(t);return function(t){return ew(t)?n(t):t}};function sl(t){return function(n,r){if(void 0===r){var i,o=sl(t);return function(t){return o(n,t)}}for(var a=0;a<r.length;a++)if(i=r[a],t.equals(i,n))return!0;return!1}}var sf=function(t){var n=tz(t);return function(t){return ew(t)?n(t):t}},sd=function(t){var n=tB(t);return function(t){return ew(t)?n(t):t}},sp=function(t){var n=nt(t);return function(t){return ew(t)?n(t):cH}},sh=function(t){return function(n){return t>=1&&ew(n)?nn(t)(n):uj(n)?[n,cH]:[cH,n]}},sm=function(t){var n=nr(t);return function(t){return ew(t)?n(t):cH}},sg=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return uL(t.apply(void 0,n))}},sy=function(t){return function(n){return uj(n)?t:uj(t)?n:n.concat(t)}};function sv(t){var n=tq(t);return function(r,i){if(void 0===i){var o=sv(t);return function(t){return o(t,r)}}return ew(r)&&ew(i)?n(i)(r):ew(r)?r:i}}function sb(t){var n=sl(t);return function(r,i){if(void 0===i){var o=sb(t);return function(t){return o(t,r)}}return r.filter(function(t){return n(t,i)})}}function sx(t){var n=sl(t);return function(r,i){if(void 0===i){var o=sx(t);return function(t){return o(t,r)}}return r.filter(function(t){return!n(t,i)})}}var s_=function(t,n){return Z(t,sY(n))},sS=function(t,n){return Z(t,sQ(n))},sT=function(t,n){return Z(t,sZ(n))},sw=function(t,n){return Z(t,sG(n))},sO=function(t,n){return Z(t,s0(n))},sk=function(t,n){return Z(t,s2(n))},sI=function(t,n){return Z(t,s4(n))},sM=function(t,n){return Z(t,s6(n))},sC=function(t,n){return Z(t,s5(n))},sR=function(t,n){return Z(t,s9(n))},sE=function(t,n){return Z(t,sH(n))},sA=function(t,n,r){return Z(t,cn(n,r))},sj=function(t){var n=cr(t);return function(t,r){return Z(t,n(r))}},sN=function(t,n,r){return Z(t,co(n,r))},sP=function(t,n,r){return Z(t,ci(n,r))},sL=function(t){var n=ct(t);return function(t,r){return Z(t,n(r))}},sF=function(t,n,r){return Z(t,ca(n,r))},sD=function(t,n){return Z(t,s1(n))},sW=function(t,n){return Z(t,s8(n))},sU=function(t,n){return Z(t,s7(n))},sz=function(t){var n=cu(t);return function(t,r){return Z(t,n(r))}},sB=function(t){var n=cc(t);return function(t,r){return Z(t,n(r))}},sq=function(t,n){return Z(t,cP(n))},sV=function(t,n){return Z(t,cL(n))},s$=function(){return cH},sK=function(t){return function(n){return n.concat(t())}},sH=sK,sZ=function(t){return sG(function(n){return Z(t,sY(n))})},sG=function(t){return function(n){return Z(n,uz(function(n,r){return t(r)}))}},sJ=sG(F),sY=function(t){return function(n){return n.map(function(n){return t(n)})}},sQ=function(t){return function(n){return n.map(function(n,r){return t(r,n)})}},sX=function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=t[i];"Left"===o._tag?n.push(o.left):r.push(o.right)}return eE(n,r)},s0=function(t){return function(n){return n.filter(t)}},s1=function(t){return function(n){for(var r=[],i=0;i<n.length;i++){var o=t(i,n[i]);eg(o)&&r.push(o.value)}return r}},s2=function(t){return s1(function(n,r){return t(r)})},s3=s2(F),s4=function(t){return s5(function(n,r){return t(r)})},s5=function(t){return function(n){for(var r=[],i=[],o=0;o<n.length;o++){var a=n[o];t(o,a)?i.push(a):r.push(a)}return eE(r,i)}},s6=function(t){return s9(function(n,r){return t(r)})},s9=function(t){return function(n){for(var r=[],i=[],o=0;o<n.length;o++){var a=t(o,n[o]);"Left"===a._tag?r.push(a.left):i.push(a.right)}return eE(r,i)}},s8=function(t){return function(n){return n.filter(function(n,r){return t(r,n)})}},s7=function(t){return function(n){return n.map(function(r,i){return t(n.slice(i))})}},ce=s7(F),ct=function(t){return function(n){return function(r){return r.reduce(function(r,i,o){return t.concat(r,n(o,i))},t.empty)}}},cn=function(t,n){return ci(t,function(t,r,i){return n(r,i)})},cr=function(t){var n=ct(t);return function(t){return n(function(n,r){return t(r)})}},ci=function(t,n){return function(r){for(var i=r.length,o=t,a=0;a<i;a++)o=n(a,o,r[a]);return o}},co=function(t,n){return ca(t,function(t,r,i){return n(r,i)})},ca=function(t,n){return function(r){return r.reduceRight(function(t,r,i){return n(i,r,t)},t)}},cu=function(t){var n=cc(t);return function(t){return n(function(n,r){return t(r)})}},cs=function(t){return function(n){return sA(n,t.of(s$()),function(n,r){return t.ap(t.map(n,function(t){return function(n){return Z(t,tD(n))}}),r)})}},cc=function(t){return function(n){return ci(t.of(s$()),function(r,i,o){return t.ap(t.map(i,function(t){return function(n){return Z(t,tD(n))}}),n(r,o))})}},cl=function(t){var n=cF(t);return function(t){return function(r){return n(r,t)}}},cf=function(t){var n=cD(t);return function(t){return function(r){return n(r,t)}}},cd=function(t,n){for(var r=[],i=t;;){var o=n(i);if(eg(o)){var a=o.value,u=a[0],s=a[1];r.push(u),i=s}else break}return r},cp="ReadonlyArray",ch=function(t){return{show:function(n){return"[".concat(n.map(t.show).join(", "),"]")}}},cm=function(){return{concat:function(t,n){return uj(t)?n:uj(n)?t:t.concat(n)}}},cg=function(){return{concat:cm().concat,empty:cH}},cy=function(t){return Q(function(n,r){return n.length===r.length&&n.every(function(n,i){return t.equals(n,r[i])})})},cv=function(t){return e3(function(n,r){for(var i=n.length,o=r.length,a=Math.min(i,o),u=0;u<a;u++){var s=t.compare(n[u],r[u]);if(0!==s)return s}return u_.compare(i,o)})},cb=function(t){var n=sv(t);return{concat:function(t,r){return n(r)(t)}}},cx=function(t){return{concat:cb(t).concat,empty:cH}},c_=function(t){var n=sb(t);return{concat:function(t,r){return n(r)(t)}}},cS=function(t){var n=sx(t);return{concat:function(t,r){return n(r)(t)}}},cT={URI:cp,map:s_},cw=el(cT),cO={URI:cp,of:eT},ck={URI:cp,map:s_,ap:sT},cI=eV(ck),cM=e$(ck),cC={URI:cp,map:s_,ap:sT,chain:sw},cR=eX(cC),cE={URI:cp,zero:s$},cA=uR(cE,cO),cj={URI:cp,compact:s3,separate:sX},cN={URI:cp,map:s_,reduce:sA,foldMap:sj,reduceRight:sN,traverse:sz,sequence:cs},cP=function(t){return function(n){for(var r=uA([],t(n),!0),i=[];r.length>0;){var o=r.shift();eb(o)?r.unshift.apply(r,t(o.left)):i.push(o.right)}return i}},cL=function(t){return function(n){var r=t(n),i=[],o=[];function a(n){eb(n)?t(n.left).forEach(function(t){return i.push(t)}):o.push(n.right)}for(var u=0;u<r.length;u++)a(r[u]);for(;i.length>0;)a(i.shift());return o}},cF=rI(cN,cj),cD=rk(cN,cj),cW={URI:cp,map:s_,compact:s3,separate:sX,filter:sO,filterMap:sk,partition:sI,partitionMap:sM,reduce:sA,foldMap:sj,reduceRight:sN,traverse:sz,sequence:cs,wither:cF,wilt:cD},cU=rM(cW),cz={URI:cp,fromEither:uF},cB=oK(cz),cq=function(t,n,r){return ew(r)?tU(t,n,r):r},cV=function(t,n){var r=n.slice();return r.splice(t,1),r},c$=function(t){return t.slice()},cK=function(t){return uj(t)?cH:t.slice()},cH=eI;function cZ(t){return function(n){return n.every(t)}}var cG=function(t){return function(n){return n.some(t)}},cJ=function(t){var n=rt(t);return function(r){return uD(function(){return t.empty},n(r))}},cY=eT(eM),cQ=ef(cT),cX=e0(cC),c0=eK(ck);let c1=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:cp,map:s_,alt:sE},Alternative:{URI:cp,map:s_,ap:sT,of:eT,alt:sE,zero:s$},Applicative:{URI:cp,map:s_,ap:sT,of:eT},Apply:ck,Chain:cC,ChainRecBreadthFirst:{URI:cp,map:s_,ap:sT,chain:sw,chainRec:sV},ChainRecDepthFirst:{URI:cp,map:s_,ap:sT,chain:sw,chainRec:sq},Compactable:cj,Do:cY,Extend:{URI:cp,map:s_,extend:sU},Filterable:{URI:cp,map:s_,compact:s3,separate:sX,filter:sO,filterMap:sk,partition:sI,partitionMap:sM},FilterableWithIndex:{URI:cp,map:s_,mapWithIndex:sS,compact:s3,separate:sX,filter:sO,filterMap:sk,partition:sI,partitionMap:sM,partitionMapWithIndex:sR,partitionWithIndex:sC,filterMapWithIndex:sD,filterWithIndex:sW},Foldable:{URI:cp,reduce:sA,foldMap:sj,reduceRight:sN},FoldableWithIndex:{URI:cp,reduce:sA,foldMap:sj,reduceRight:sN,reduceWithIndex:sP,foldMapWithIndex:sL,reduceRightWithIndex:sF},FromEither:cz,Functor:cT,FunctorWithIndex:{URI:cp,map:s_,mapWithIndex:sS},Monad:{URI:cp,map:s_,ap:sT,of:eT,chain:sw},Pointed:cO,Traversable:cN,TraversableWithIndex:{URI:cp,map:s_,mapWithIndex:sS,reduce:sA,foldMap:sj,reduceRight:sN,reduceWithIndex:sP,foldMapWithIndex:sL,reduceRightWithIndex:sF,traverse:sz,sequence:cs,traverseWithIndex:sB},URI:cp,Unfoldable:{URI:cp,unfold:cd},Witherable:cW,Zero:cE,_chainRecBreadthFirst:sV,_chainRecDepthFirst:sq,alt:sH,altW:sK,ap:sZ,apFirst:cI,apS:c0,apSecond:cM,append:tD,appendW:tD,bind:cX,bindTo:cQ,chain:sG,chainFirst:cR,chainRecBreadthFirst:cL,chainRecDepthFirst:cP,chainWithIndex:uz,chop:sp,chunksOf:sm,compact:s3,comprehension:function(t,n,r){void 0===r&&(r=function(){return!0});var i=function(t,o){return ew(o)?Z(nQ(o),sG(function(n){return i(Z(t,tD(n)),nX(o))})):r.apply(void 0,t)?[n.apply(void 0,t)]:cH};return i(cH,t)},concat:sy,concatW:sy,cons:rr,deleteAt:u7,difference:sx,dropLeft:uX,dropLeftWhile:function(t){return function(n){var r=uQ(n,t);return 0===r?n:r===n.length?cH:n.slice(r)}},dropRight:u0,duplicate:ce,elem:sl,empty:cH,every:cZ,exists:cG,extend:s7,filter:s0,filterE:cU,filterMap:s2,filterMapWithIndex:s1,filterWithIndex:s8,findFirst:u2,findFirstMap:u3,findIndex:u1,findLast:u4,findLastIndex:u6,findLastMap:u5,flap:cw,flatten:sJ,foldLeft:uW,foldMap:cr,foldMapWithIndex:ct,foldRight:uU,fromArray:cK,fromEither:uF,fromEitherK:cB,fromOption:uL,fromOptionK:sg,fromPredicate:function(t){return function(n){return t(n)?[n]:cH}},getDifferenceMagma:cS,getEq:cy,getIntersectionSemigroup:c_,getMonoid:cg,getOrd:cv,getSemigroup:cm,getShow:ch,getUnionMonoid:cx,getUnionSemigroup:cb,guard:cA,head:uK,init:uG,insertAt:u9,intercalate:cJ,intersection:sb,intersperse:ss,isEmpty:uj,isNonEmpty:ew,isOutOfBound:tL,last:uH,lefts:sr,lookup:u$,makeBy:uN,map:sY,mapWithIndex:sQ,match:uD,matchLeft:uW,matchLeftW:uW,matchRight:uU,matchRightW:uU,matchW:uD,modifyAt:se,of:eT,partition:s4,partitionMap:s6,partitionMapWithIndex:s9,partitionWithIndex:s5,prepend:tF,prependAll:su,prependToAll:su,prependW:tF,range:tZ,readonlyArray:{URI:cp,compact:s3,separate:sX,map:s_,ap:sT,of:eT,chain:sw,filter:sO,filterMap:sk,partition:sI,partitionMap:sM,mapWithIndex:sS,partitionMapWithIndex:sR,partitionWithIndex:sC,filterMapWithIndex:sD,filterWithIndex:sW,alt:sE,zero:s$,unfold:cd,reduce:sA,foldMap:sj,reduceRight:sN,traverse:sz,sequence:cs,reduceWithIndex:sP,foldMapWithIndex:sL,reduceRightWithIndex:sF,traverseWithIndex:sB,extend:sU,wither:cF,wilt:cD},reduce:cn,reduceRight:co,reduceRightWithIndex:ca,reduceWithIndex:ci,replicate:uP,reverse:st,rights:sn,rotate:sc,scanLeft:uB,scanRight:uq,separate:sX,sequence:cs,size:uV,snoc:ri,some:cG,sort:si,sortBy:sd,spanLeft:function(t){return function(n){var r,i=sh(uQ(n,t))(n);return{init:i[0],rest:i[1]}}},splitAt:sh,tail:uZ,takeLeft:uJ,takeLeftWhile:function(t){return function(n){for(var r=[],i=0;i<n.length;i++){var o=n[i];if(!t(o))break;r.push(o)}var a=r.length;return a===n.length?n:0===a?cH:r}},takeRight:uY,toArray:c$,traverse:cu,traverseWithIndex:cc,unfold:cd,union:sv,uniq:sf,unsafeDeleteAt:cV,unsafeInsertAt:tW,unsafeUpdateAt:cq,unzip:sa,updateAt:u8,wilt:cf,wither:cl,zero:s$,zip:function t(n,r){return void 0===r?function(r){return t(r,n)}:so(n,r,function(t,n){return[t,n]})},zipWith:so},Symbol.toStringTag,{value:"Module"}));var c2=function(t){return 0===t.length},c3=function(t,n){return t<=0?[]:ae(n)(t)},c4=function(t,n){return c3(t,function(){return n})},c5=function(t){return em(t)?[]:[t.value]},c6=function(t){return eb(t)?[]:[t.right]},c9=function(t,n){return function(r){return oQ(r)?n(r):t()}},c8=function(t,n){return function(r){return oQ(r)?n(ui(r),uo(r)):t()}},c7=function(t,n){return function(r){return oQ(r)?n(uu(r),ua(r)):t()}},le=function(t){return function(n){for(var r=[],i=0;i<n.length;i++)r.push.apply(r,t(i,n[i]));return r}},lt=function(t,n){return function(r){var i=r.length,o=Array(i+1);o[0]=t;for(var a=0;a<i;a++)o[a+1]=n(o[a],r[a]);return o}},ln=function(t,n){return function(r){var i=r.length,o=Array(i+1);o[i]=t;for(var a=i-1;a>=0;a--)o[a]=n(r[a],o[a+1]);return o}},lr=function(t){return t.length},li=function(t){return oQ(t)?ev(uo(t)):ey},lo=function(t){return oQ(t)?ev(uu(t)):ey},la=function(t){return function(n){return oX(t,n)?lp(n):n.slice(0,t)}},lu=function(t){return function(n){return oX(t,n)?lp(n):0===t?[]:n.slice(-t)}},ls=function(t,n){for(var r=t.length,i=0;i<r&&n(t[i]);i++);return i},lc=function(t){return function(n){return t<=0||c2(n)?lp(n):t>=n.length?[]:n.slice(t,n.length)}},ll=function(t){return function(n){return t<=0||c2(n)?lp(n):t>=n.length?[]:n.slice(0,n.length-t)}};function lf(t){return u2(t)}function ld(t){return u4(t)}var lp=function(t){return t.slice()},lh=function(t,n){return function(r){return t<0||t>r.length?ey:ev(fX(t,n,r))}},lm=function(t,n){return ly(t,function(){return n})},lg=function(t){return function(n){return oX(t,n)?ey:ev(f1(t,n))}},ly=function(t,n){return function(r){return oX(t,r)?ey:ev(f0(t,n(r[t]),r))}},lv=function(t){return c2(t)?[]:t.slice().reverse()},lb=function(t){for(var n=[],r=0;r<t.length;r++){var i=t[r];"Right"===i._tag&&n.push(i.right)}return n},lx=function(t){for(var n=[],r=0;r<t.length;r++){var i=t[r];"Left"===i._tag&&n.push(i.left)}return n},l_=function(t){return function(n){return n.length<=1?lp(n):n.slice().sort(t.compare)}},lS=function(t,n,r){for(var i=[],o=Math.min(t.length,n.length),a=0;a<o;a++)i[a]=r(t[a],n[a]);return i},lT=function(t){for(var n=[],r=[],i=0;i<t.length;i++)n[i]=t[i][0],r[i]=t[i][1];return[n,r]},lw=function(t){var n=av(t);return function(t){return oQ(t)?n(t):[]}},lO=function(t){var n=ab(t);return function(t){return oQ(t)?n(t):lp(t)}},lk=function(t){var n=o9(t);return function(t){return oQ(t)?n(t):lp(t)}},lI=function(t){var n=o4(t);return function(t){return oQ(t)?n(t):lp(t)}},lM=function(t){var n=o5(t);return function(t){return oQ(t)?n(t):lp(t)}},lC=function(t){var n=a_(t);return function(t){return oQ(t)?n(t):[]}},lR=function(t){return function(n){return t>=1&&oQ(n)?aS(t)(n):c2(n)?[lp(n),[]]:[[],lp(n)]}},lE=function(t){var n=aT(t);return function(t){return oQ(t)?n(t):[]}},lA=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return c5(t.apply(void 0,n))}},lj=function(t){return function(n){return c2(n)?lp(t):c2(t)?lp(n):n.concat(t)}};function lN(t){var n=o6(t);return function(r,i){if(void 0===i){var o=lN(t);return function(t){return o(t,r)}}return oQ(r)&&oQ(i)?n(i)(r):oQ(r)?lp(r):lp(i)}}function lP(t){var n=sl(t);return function(r,i){if(void 0===i){var o=lP(t);return function(t){return o(t,r)}}return r.filter(function(t){return n(t,i)})}}function lL(t){var n=sl(t);return function(r,i){if(void 0===i){var o=lL(t);return function(t){return o(t,r)}}return r.filter(function(t){return!n(t,i)})}}var lF=function(t,n){return Z(t,l6(n))},lD=function(t,n){return Z(t,fe(n))},lW=function(t,n){return Z(t,l9(n))},lU=function(t,n){return Z(t,l8(n))},lz=function(t,n){return Z(t,fo(n))},lB=function(t,n){return Z(t,fn(n))},lq=function(t,n){return Z(t,fa(n))},lV=function(t,n){return Z(t,fs(n))},l$=function(t,n){return Z(t,fu(n))},lK=function(t,n){return Z(t,fc(n))},lH=function(t,n){return Z(t,ff(n))},lZ=function(t,n,r){return Z(t,fy(n,r))},lG=function(t){var n=fm(t);return function(t,r){return Z(t,n(r))}},lJ=function(t,n,r){return Z(t,fb(n,r))},lY=function(t,n,r){return Z(t,fv(n,r))},lQ=function(t){var n=fg(t);return function(t,r){return Z(t,n(r))}},lX=function(t,n,r){return Z(t,fx(n,r))},l0=function(t,n){return Z(t,ft(n))},l1=function(t,n){return Z(t,fd(n))},l2=function(t,n){return Z(t,fp(n))},l3=function(t){var n=f_(t);return function(t,r){return Z(t,n(r))}},l4=function(t){var n=fT(t);return function(t,r){return Z(t,n(r))}},l5=function(){return[]},l6=function(t){return function(n){return n.map(function(n){return t(n)})}},l9=function(t){return l8(function(n){return Z(t,l6(n))})},l8=function(t){return function(n){return Z(n,le(function(n,r){return t(r)}))}},l7=l8(F),fe=function(t){return function(n){return n.map(function(n,r){return t(r,n)})}},ft=function(t){return function(n){for(var r=[],i=0;i<n.length;i++){var o=t(i,n[i]);eg(o)&&r.push(o.value)}return r}},fn=function(t){return ft(function(n,r){return t(r)})},fr=fn(F),fi=function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=t[i];"Left"===o._tag?n.push(o.left):r.push(o.right)}return eE(n,r)},fo=function(t){return function(n){return n.filter(t)}},fa=function(t){return fu(function(n,r){return t(r)})},fu=function(t){return function(n){for(var r=[],i=[],o=0;o<n.length;o++){var a=n[o];t(o,a)?i.push(a):r.push(a)}return eE(r,i)}},fs=function(t){return fc(function(n,r){return t(r)})},fc=function(t){return function(n){for(var r=[],i=[],o=0;o<n.length;o++){var a=t(o,n[o]);"Left"===a._tag?r.push(a.left):i.push(a.right)}return eE(r,i)}},fl=function(t){return function(n){return n.concat(t())}},ff=fl,fd=function(t){return function(n){return n.filter(function(n,r){return t(r,n)})}},fp=function(t){return function(n){return n.map(function(r,i){return t(n.slice(i))})}},fh=fp(F),fm=cr,fg=ct,fy=cn,fv=ci,fb=co,fx=ca,f_=function(t){var n=fT(t);return function(t){return n(function(n,r){return t(r)})}},fS=function(t){return function(n){return lZ(n,t.of(l5()),function(n,r){return t.ap(t.map(n,function(t){return function(n){return Z(t,o1(n))}}),r)})}},fT=function(t){return function(n){return fv(t.of(l5()),function(r,i,o){return t.ap(t.map(i,function(t){return function(n){return Z(t,o1(n))}}),n(r,o))})}},fw=function(t){var n=fH(t);return function(t){return function(r){return n(r,t)}}},fO=function(t){var n=fZ(t);return function(t){return function(r){return n(r,t)}}},fk=function(t,n){for(var r=[],i=t;;){var o=n(i);if(eg(o)){var a=o.value,u=a[0],s=a[1];r.push(u),i=s}else break}return r},fI="Array",fM=function(){return{concat:function(t,n){return t.concat(n)}}},fC=function(){return{concat:fM().concat,empty:[]}},fR=function(t){var n=lN(t);return{concat:function(t,r){return n(r)(t)}}},fE=function(t){return{concat:fR(t).concat,empty:[]}},fA=function(t){var n=lP(t);return{concat:function(t,r){return n(r)(t)}}},fj=function(t){var n=lL(t);return{concat:function(t,r){return n(r)(t)}}},fN={URI:fI,map:lF},fP=el(fN),fL={URI:fI,of:am},fF={URI:fI,map:lF,ap:lW},fD=eV(fF),fW=e$(fF),fU={URI:fI,map:lF,ap:lW,chain:lU},fz=eX(fU),fB={URI:fI,zero:l5},fq=uR(fB,fL),fV={URI:fI,compact:fr,separate:fi},f$={URI:fI,reduce:lZ,foldMap:lG,reduceRight:lJ},fK={URI:fI,map:lF,reduce:lZ,foldMap:lG,reduceRight:lJ,traverse:l3,sequence:fS},fH=rI(fK,fV),fZ=rk(fK,fV),fG={URI:fI,map:lF,compact:fr,separate:fi,filter:lz,filterMap:lB,partition:lq,partitionMap:lV,reduce:lZ,foldMap:lG,reduceRight:lJ,traverse:l3,sequence:fS,wither:fH,wilt:fZ},fJ=rM(fG),fY={URI:fI,fromEither:c6},fQ=oK(fY),fX=o2,f0=function(t,n,r){return oQ(r)?o3(t,n,r):[]},f1=function(t,n){var r=n.slice();return r.splice(t,1),r},f2=function(t){return function(n){return n.some(t)}},f3=am(eM),f4=ef(fN),f5=e0(fU),f6=eK(fF);let f9=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:fI,map:lF,alt:lH},Alternative:{URI:fI,map:lF,ap:lW,of:am,alt:lH,zero:l5},Applicative:{URI:fI,map:lF,ap:lW,of:am},Apply:fF,Chain:fU,ChainRecBreadthFirst:{URI:fI,map:lF,ap:lW,chain:lU,chainRec:sV},ChainRecDepthFirst:{URI:fI,map:lF,ap:lW,chain:lU,chainRec:sq},Compactable:fV,Do:f3,Extend:{URI:fI,map:lF,extend:l2},Filterable:{URI:fI,map:lF,compact:fr,separate:fi,filter:lz,filterMap:lB,partition:lq,partitionMap:lV},FilterableWithIndex:{URI:fI,map:lF,mapWithIndex:lD,compact:fr,separate:fi,filter:lz,filterMap:lB,partition:lq,partitionMap:lV,partitionMapWithIndex:lK,partitionWithIndex:l$,filterMapWithIndex:l0,filterWithIndex:l1},Foldable:f$,FoldableWithIndex:{URI:fI,reduce:lZ,foldMap:lG,reduceRight:lJ,reduceWithIndex:lY,foldMapWithIndex:lQ,reduceRightWithIndex:lX},FromEither:fY,Functor:fN,FunctorWithIndex:{URI:fI,map:lF,mapWithIndex:lD},Monad:{URI:fI,map:lF,ap:lW,of:am,chain:lU},Pointed:fL,Traversable:fK,TraversableWithIndex:{URI:fI,map:lF,mapWithIndex:lD,reduce:lZ,foldMap:lG,reduceRight:lJ,reduceWithIndex:lY,foldMapWithIndex:lQ,reduceRightWithIndex:lX,traverse:l3,sequence:fS,traverseWithIndex:l4},URI:fI,Unfoldable:{URI:fI,unfold:fk},Witherable:fG,Zero:fB,alt:ff,altW:fl,ap:l9,apFirst:fD,apS:f6,apSecond:fW,append:o1,appendW:o1,array:{URI:fI,compact:fr,separate:fi,map:lF,ap:lW,of:am,chain:lU,filter:lz,filterMap:lB,partition:lq,partitionMap:lV,mapWithIndex:lD,partitionMapWithIndex:lK,partitionWithIndex:l$,filterMapWithIndex:l0,filterWithIndex:l1,alt:lH,zero:l5,unfold:fk,reduce:lZ,foldMap:lG,reduceRight:lJ,traverse:l3,sequence:fS,reduceWithIndex:lY,foldMapWithIndex:lQ,reduceRightWithIndex:lX,traverseWithIndex:l4,extend:l2,wither:fH,wilt:fZ},bind:f5,bindTo:f4,chain:l8,chainFirst:fz,chainRecBreadthFirst:cL,chainRecDepthFirst:cP,chainWithIndex:le,chop:lC,chunksOf:lE,compact:fr,comprehension:function(t,n,r){void 0===r&&(r=function(){return!0});var i=function(t,o){return oQ(o)?Z(ui(o),l8(function(n){return i(Z(t,o1(n)),uo(o))})):r.apply(void 0,t)?[n.apply(void 0,t)]:[]};return i([],t)},concat:lj,concatW:lj,cons:ug,copy:lp,deleteAt:lg,difference:lL,dropLeft:lc,dropLeftWhile:function(t){return function(n){return n.slice(ls(n,t))}},dropRight:ll,duplicate:fh,elem:sl,empty:[],every:cZ,exists:f2,extend:fp,filter:fo,filterE:fJ,filterMap:fn,filterMapWithIndex:ft,filterWithIndex:fd,findFirst:lf,findFirstMap:u3,findIndex:u1,findLast:ld,findLastIndex:u6,findLastMap:u5,flap:fP,flatten:l7,foldLeft:c8,foldMap:fm,foldMapWithIndex:fg,foldRight:c7,fromEither:c6,fromEitherK:fQ,fromOption:c5,fromOptionK:lA,fromPredicate:function(t){return function(n){return t(n)?[n]:[]}},getDifferenceMagma:fj,getEq:cy,getIntersectionSemigroup:fA,getMonoid:fC,getOrd:cv,getSemigroup:fM,getShow:ch,getUnionMonoid:fE,getUnionSemigroup:fR,guard:fq,head:uK,init:lo,insertAt:lh,intercalate:cJ,intersection:lP,intersperse:lO,isEmpty:c2,isNonEmpty:oQ,isOutOfBound:oX,last:uH,lefts:lx,lookup:u$,makeBy:c3,map:l6,mapWithIndex:fe,match:c9,matchLeft:c8,matchLeftW:c8,matchRight:c7,matchRightW:c7,matchW:c9,modifyAt:ly,of:am,partition:fa,partitionMap:fs,partitionMapWithIndex:fc,partitionWithIndex:fu,prepend:o0,prependAll:lw,prependToAll:lw,prependW:o0,range:an,reduce:fy,reduceRight:fb,reduceRightWithIndex:fx,reduceWithIndex:fv,replicate:c4,reverse:lv,rights:lb,rotate:lk,scanLeft:lt,scanRight:ln,separate:fi,sequence:fS,size:lr,snoc:uy,some:f2,sort:l_,sortBy:lM,spanLeft:function(t){return function(n){var r,i=lR(ls(n,t))(n);return{init:i[0],rest:i[1]}}},splitAt:lR,tail:li,takeLeft:la,takeLeftWhile:function(t){return function(n){for(var r=[],i=0;i<n.length;i++){var o=n[i];if(!t(o))break;r.push(o)}return r}},takeRight:lu,traverse:f_,traverseWithIndex:fT,unfold:fk,union:lN,uniq:lI,unsafeDeleteAt:f1,unsafeInsertAt:fX,unsafeUpdateAt:f0,unzip:lT,updateAt:lm,wilt:fO,wither:fw,zero:l5,zip:function t(n,r){return void 0===r?function(r){return t(r,n)}:lS(n,r,function(t,n){return[t,n]})},zipWith:lS},Symbol.toStringTag,{value:"Module"})),f8=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var f7=function(t){return"boolean"==typeof t},de=function(t,n){return function(r){return r?n():t()}},dt={equals:function(t,n){return t===n}},dn={concat:function(t,n){return t&&n}},dr={concat:function(t,n){return t||n}},di={concat:dn.concat,empty:!0},da={concat:dr.concat,empty:!1},du={equals:dt.equals,compare:function(t,n){return t<n?-1:t>n?1:0}};let ds=Object.freeze(Object.defineProperty({__proto__:null,BooleanAlgebra:{meet:function(t,n){return t&&n},join:function(t,n){return t||n},zero:!1,one:!0,implies:function(t,n){return!t||n},not:function(t){return!t}},Eq:dt,MonoidAll:di,MonoidAny:da,Ord:du,SemigroupAll:dn,SemigroupAny:dr,Show:{show:function(t){return JSON.stringify(t)}},fold:de,foldW:de,isBoolean:f7,match:de,matchW:de},Symbol.toStringTag,{value:"Module"}));var dc=function(t){return{meet:function(n,r){return t.join(n,r)},join:function(n,r){return t.meet(n,r)},zero:t.one,one:t.zero,implies:function(n,r){return t.join(t.not(n),r)},not:t.not}};let dl=Object.freeze(Object.defineProperty({__proto__:null,booleanAlgebraBoolean:{meet:function(t,n){return t&&n},join:function(t,n){return t||n},zero:!1,one:!0,implies:function(t,n){return!t||n},not:function(t){return!t}},booleanAlgebraVoid:{meet:function(){},join:function(){},zero:void 0,one:void 0,implies:function(){},not:function(){}},getDualBooleanAlgebra:dc,getFunctionBooleanAlgebra:E,reverse:dc},Symbol.toStringTag,{value:"Module"}));var df=function(t){return ts(t)(t.bottom,t.top)},dd=function(t){var n=e5(t);return{equals:n.equals,compare:n.compare,top:t.bottom,bottom:t.top}},dp={equals:tl.equals,compare:tl.compare,top:1/0,bottom:-1/0};let dh=Object.freeze(Object.defineProperty({__proto__:null,boundedNumber:dp,clamp:df,reverse:dd},Symbol.toStringTag,{value:"Module"}));function dm(t){return{meet:ta(t),join:tu(t)}}let dg=Object.freeze(Object.defineProperty({__proto__:null,getMinMaxDistributiveLattice:dm},Symbol.toStringTag,{value:"Module"})),dy=Object.freeze(Object.defineProperty({__proto__:null,getMinMaxBoundedDistributiveLattice:function(t){var n=dm(t);return function(t,r){return{join:n.join,meet:n.meet,zero:t,one:r}}}},Symbol.toStringTag,{value:"Module"})),dv=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),db=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),dx=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),d_=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var dS=function(t,n){for(var r=n(t);"Left"===r._tag;)r=n(r.left);return r.right};let dT=Object.freeze(Object.defineProperty({__proto__:null,tailRec:dS},Symbol.toStringTag,{value:"Module"}));function dw(t,n){return function(r,i){return n.compose(t.right(i),t.left(r))}}function dO(t,n){var r=dw(t,n);return function(i,o){return n.compose(t.promap(n.id(),function(t){return"Left"===t._tag?t.left:t.right},F),r(i,o))}}let dk=Object.freeze(Object.defineProperty({__proto__:null,fanIn:dO,fanin:function(t){return dO(t,t)},split:dw,splitChoice:function(t){return dw(t,t)}},Symbol.toStringTag,{value:"Module"})),dI=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var dM=function(t,n){return Z(t,dC(n))},dC=function(t){return function(n){return q(t,n)}},dR="Predicate",dE=function(){return{concat:function(t,n){return Z(t,dL(n))}}},dA=function(){return{concat:dE().concat,empty:U}},dj=function(){return{concat:function(t,n){return Z(t,dF(n))}}},dN=function(){return{concat:dj().concat,empty:W}},dP=function(t){return function(n){return!t(n)}},dL=function(t){return function(n){return function(r){return n(r)||t(r)}}},dF=function(t){return function(n){return function(r){return n(r)&&t(r)}}};let dD=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:{URI:dR,contramap:dM},URI:dR,and:dF,contramap:dC,getMonoidAll:dN,getMonoidAny:dA,getSemigroupAll:dj,getSemigroupAny:dE,not:dP,or:dL},Symbol.toStringTag,{value:"Module"}));function dW(t){return function(n){return t(n)?ev(n):ey}}var dU=function(t){return"Right"===t._tag?ey:ev(t.left)},dz=function(t){return"Left"===t._tag?ey:ev(t.right)},dB=function(t,n){return Z(t,d6(n))},dq=function(t,n){return Z(t,d7(n))},dV=function(t,n){return Z(t,pn(n))},d$=function(t,n,r){return Z(t,pi(n,r))},dK=function(t){var n=po(t);return function(t,r){return Z(t,n(r))}},dH=function(t,n,r){return Z(t,pa(n,r))},dZ=function(t){var n=pS(t);return function(t,r){return Z(t,n(r))}},dG=function(t,n){return Z(t,ps(n))},dJ=function(t,n){return Z(t,py(n))},dY=function(t,n){return Z(t,pv(n))},dQ=function(t,n){return Z(t,pd(n))},dX=function(t,n){return Z(t,pb(n))},d0=function(t,n){return Z(t,px(n))},d1="Option",d2=function(t){return{show:function(n){return pA(n)?"none":"some(".concat(t.show(n.value),")")}}},d3=function(t){return{equals:function(n,r){return n===r||(pA(n)?pA(r):!pA(r)&&t.equals(n.value,r.value))}}},d4=function(t){return{equals:d3(t).equals,compare:function(n,r){return n===r?0:pE(n)?pE(r)?t.compare(n.value,r.value):1:-1}}},d5=function(t){return{concat:function(n,r){return pA(n)?r:pA(r)?n:ev(t.concat(n.value,r.value))},empty:ey}},d6=function(t){return function(n){return pA(n)?ey:ev(t(n.value))}},d9={URI:d1,map:dB},d8={URI:d1,of:ev},d7=function(t){return function(n){return pA(n)||pA(t)?ey:ev(n.value(t.value))}},pe={URI:d1,map:dB,ap:dq},pt={URI:d1,map:dB,ap:dq,of:ev},pn=function(t){return function(n){return pA(n)?ey:t(n.value)}},pr={URI:d1,map:dB,ap:dq,chain:dV},pi=function(t,n){return function(r){return pA(r)?t:n(t,r.value)}},po=function(t){return function(n){return function(r){return pA(r)?t.empty:n(r.value)}}},pa=function(t,n){return function(r){return pA(r)?t:n(r.value,t)}},pu=function(t){return function(n){return pA(n)?t():n}},ps=pu,pc=function(){return ey},pl={URI:d1,zero:pc},pf=uR(pl,d8),pd=function(t){return function(n){return pA(n)?ey:ev(t(n))}},pp=pn(F),ph=eE(ey,ey),pm=function(t){return pA(t)?ph:eE(dU(t.value),dz(t.value))},pg={URI:d1,compact:pp,separate:pm},py=function(t){return function(n){return pA(n)?ey:t(n.value)?n:ey}},pv=function(t){return function(n){return pA(n)?ey:t(n.value)}},pb=function(t){return function(n){return eE(dJ(n,dP(t)),dJ(n,t))}},px=function(t){return q(d6(t),pm)},p_={URI:d1,map:dB,compact:pp,separate:pm,filter:dJ,filterMap:dY,partition:dX,partitionMap:d0},pS=function(t){return function(n){return function(r){return pA(r)?t.of(ey):t.map(n(r.value),ev)}}},pT=function(t){return function(n){return pA(n)?t.of(ey):t.map(n.value,ev)}},pw={URI:d1,map:dB,reduce:d$,foldMap:dK,reduceRight:dH,traverse:dZ,sequence:pT},pO=rI(pw,pg),pk=rk(pw,pg),pI=function(t){var n=pO(t);return function(t){return function(r){return n(r,t)}}},pM=function(t){var n=pk(t);return function(t){return function(r){return n(r,t)}}},pC=function(){return ey},pR={URI:d1,fromEither:dz},pE=eg,pA=function(t){return"None"===t._tag},pj=function(t,n){return function(r){return pA(r)?t():n(r.value)}},pN=function(t){return function(n){return pA(n)?t():n.value}},pP=el(d9),pL=eV(pe),pF=e$(pe),pD=eX(pr),pW=pd(F),pU=oK(pR),pz=oH(pR,pr),pB=oZ(pR,pr),pq=function(t){return null==t?ey:ev(t)},pV=function(t){try{return ev(t())}catch{return ey}},p$=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return pV(function(){return t.apply(void 0,n)})}},pK=function(t){return q(t,pq)},pH=function(t){return function(n){return pA(n)?ey:pq(t(n.value))}},pZ=pj(z,F),pG=pj(B,F),pJ=function(t){return function(n){return!pA(n)&&t(n.value)}},pY=ev(eM),pQ=ef(d9),pX=e0(pr),p0=eK(pe),p1=ev(eI),p2=function(t){return function(n){var r=t(0,eO(n));if(pA(r))return ey;for(var i=[r.value],o=1;o<n.length;o++){var a=t(o,n[o]);if(pA(a))return ey;i.push(a.value)}return ev(i)}},p3=function(t){var n=p2(t);return function(t){return ew(t)?n(t):p1}},p4=function(t){return p3(function(n,r){return t(r)})},p5=p4(F),p6={URI:d1,map:dB,of:ev,ap:dq,chain:dV,reduce:d$,foldMap:dK,reduceRight:dH,traverse:dZ,sequence:pT,zero:pc,alt:dG,extend:dQ,compact:pp,separate:pm,filter:dJ,filterMap:dY,partition:dX,partitionMap:d0,wither:pO,wilt:pk,throwError:pC},p9=eH(pe),p8=oW(pt),p7=function(){return d5(tO())},he=function(){return d5(tk())};let ht=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:d1,map:dB,alt:dG},Alternative:{URI:d1,map:dB,ap:dq,of:ev,alt:dG,zero:pc},ApT:p1,Applicative:pt,Apply:pe,Chain:pr,Compactable:pg,Do:pY,Extend:{URI:d1,map:dB,extend:dQ},Filterable:p_,Foldable:{URI:d1,reduce:d$,foldMap:dK,reduceRight:dH},FromEither:pR,Functor:d9,Monad:{URI:d1,map:dB,ap:dq,of:ev,chain:dV},MonadThrow:{URI:d1,map:dB,ap:dq,of:ev,chain:dV,throwError:pC},Pointed:d8,Traversable:pw,URI:d1,Witherable:{URI:d1,map:dB,reduce:d$,foldMap:dK,reduceRight:dH,traverse:dZ,sequence:pT,compact:pp,separate:pm,filter:dJ,filterMap:dY,partition:dX,partitionMap:d0,wither:pO,wilt:pk},Zero:pl,alt:ps,altW:pu,ap:d7,apFirst:pL,apS:p0,apSecond:pF,bind:pX,bindTo:pQ,chain:pn,chainEitherK:pz,chainFirst:pD,chainFirstEitherK:pB,chainNullableK:pH,compact:pp,duplicate:pW,elem:function t(n){return function(r,i){if(void 0===i){var o=t(n);return function(t){return o(r,t)}}return!pA(i)&&n.equals(r,i.value)}},exists:pJ,extend:pd,filter:py,filterMap:pv,flap:pP,flatten:pp,fold:pj,foldMap:po,foldW:pj,fromEither:dz,fromEitherK:pU,fromNullable:pq,fromNullableK:pK,fromPredicate:dW,getApplyMonoid:p8,getApplySemigroup:p9,getEq:d3,getFirstMonoid:p7,getLastMonoid:he,getLeft:dU,getMonoid:d5,getOrElse:pN,getOrElseW:pN,getOrd:d4,getRefinement:function(t){return function(n){return pE(t(n))}},getRight:dz,getShow:d2,guard:pf,isNone:pA,isSome:pE,map:d6,mapNullable:pH,match:pj,matchW:pj,none:ey,of:ev,option:p6,partition:pb,partitionMap:px,reduce:pi,reduceRight:pa,separate:pm,sequence:pT,sequenceArray:p5,some:ev,throwError:pC,toNullable:pZ,toUndefined:pG,traverse:pS,traverseArray:p4,traverseArrayWithIndex:p3,traverseReadonlyArrayWithIndex:p3,traverseReadonlyNonEmptyArrayWithIndex:p2,tryCatch:pV,tryCatchK:p$,wilt:pM,wither:pI,zero:pc},Symbol.toStringTag,{value:"Module"}));function hn(t,n){return function(r){return t.map(r,n.compact)}}function hr(t,n,r){var i=hn(t,n),o=ec(t,r);return function(t){return eE(i(Z(t,o(dU))),i(Z(t,o(dz))))}}let hi=Object.freeze(Object.defineProperty({__proto__:null,compact:hn,getCompactableComposition:function(t,n){return{map:ed(t,n).map,compact:hn(t,n),separate:hr(t,n,n)}},separate:hr},Symbol.toStringTag,{value:"Module"}));var ho=function(t){return function(){return console.log(t)}},ha=function(t){return function(){return console.warn(t)}},hu=function(t){return function(){return console.error(t)}},hs=function(t){return function(){return console.info(t)}};let hc=Object.freeze(Object.defineProperty({__proto__:null,error:hu,info:hs,log:ho,warn:ha},Symbol.toStringTag,{value:"Module"}));function hl(t){return{URI:hx,_E:void 0,map:hp,ap:function(n,r){return F(t.concat(n,r))}}}function hf(t){var n=hl(t);return{URI:hx,_E:void 0,map:n.map,ap:n.ap,of:function(){return F(t.empty)}}}var hd=function(t,n){return Z(t,hg())},hp=function(t,n){return Z(t,hy())},hh=function(t,n,r){return Z(t,hv(n))},hm=function(t,n){return Z(t,hb(n))},hg=function(){return F},hy=function(){return F},hv=function(t){return function(n){return F(t(n))}},hb=function(t){return function(n){return F(t(n))}},hx="Const",h_={URI:hx,map:hp},hS=el(h_);let hT=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:{URI:hx,bimap:hh,mapLeft:hm},Contravariant:{URI:hx,contramap:hd},Functor:h_,URI:hx,bimap:hv,const_:{URI:hx,map:hp,contramap:hd,bimap:hh,mapLeft:hm},contramap:hg,flap:hS,getApplicative:hf,getApply:hl,getBooleanAlgebra:F,getBounded:F,getEq:F,getHeytingAlgebra:F,getMonoid:F,getOrd:F,getRing:F,getSemigroup:F,getSemiring:F,getShow:function(t){return{show:function(n){return"make(".concat(t.show(n),")")}}},make:F,map:hy,mapLeft:hb},Symbol.toStringTag,{value:"Module"})),hw=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var hO=Z(u_,e6(function(t){return t.valueOf()})),hk=function(){return new Date},hI=function(){return new Date().getTime()};let hM=Object.freeze(Object.defineProperty({__proto__:null,Eq:{equals:function(t,n){return t.valueOf()===n.valueOf()}},Ord:hO,create:hk,eqDate:{equals:function(t,n){return t.getDate()===n.getDate()}},eqMonth:{equals:function(t,n){return t.getMonth()===n.getMonth()}},eqYear:{equals:function(t,n){return t.getFullYear()===n.getFullYear()}},now:hI},Symbol.toStringTag,{value:"Module"}));var hC=function(t,n){return Z(t,hJ(n))},hR=function(t,n){return Z(t,h0(n))},hE=function(t,n){return Z(t,h4(n))},hA=function(t,n,r){return Z(t,h6(n,r))},hj=function(t){return function(n,r){var i=h9(t);return Z(n,i(r))}},hN=function(t,n,r){return Z(t,h8(n,r))},hP=function(t){var n=h7(t);return function(t,r){return Z(t,n(r))}},hL=function(t,n,r){return Z(t,mn(n,r))},hF=function(t,n){return Z(t,mr(n))},hD=function(t,n){return Z(t,mo(n))},hW=function(t,n){return Z(t,ma(n))},hU=function(t,n){return dS(n(t),function(t){return ml(t)?eS(e_(t.left)):ml(t.right)?e_(n(t.right.left)):eS(eS(t.right.right))})},hz="Either",hB=function(t,n){return{show:function(r){return ml(r)?"left(".concat(t.show(r.left),")"):"right(".concat(n.show(r.right),")")}}},hq=function(t,n){return{equals:function(r,i){return r===i||(ml(r)?ml(i)&&t.equals(r.left,i.left):mf(i)&&n.equals(r.right,i.right))}}},hV=function(t){return{concat:function(n,r){return ml(r)?n:ml(n)?r:eS(t.concat(n.right,r.right))}}},h$=function(t){var n=e_(t.empty);return{URI:hz,_E:void 0,compact:function(t){return ml(t)?t:"None"===t.right._tag?n:eS(t.right.value)},separate:function(t){return ml(t)?eE(t,t):ml(t.right)?eE(eS(t.right.left),n):eE(n,eS(t.right.right))}}},hK=function(t){var n,r=e_(t.empty),i=h$(t),o=i.compact;return{URI:hz,_E:void 0,map:hC,compact:o,separate:i.separate,filter:function(t,n){return ml(t)||n(t.right)?t:r},filterMap:function(t,n){if(ml(t))return t;var i=n(t.right);return"None"===i._tag?r:eS(i.value)},partition:function(t,n){return ml(t)?eE(t,t):n(t.right)?eE(r,eS(t.right)):eE(eS(t.right),r)},partitionMap:function(t,n){if(ml(t))return eE(t,t);var i=n(t.right);return ml(i)?eE(eS(i.left),r):eE(r,eS(i.right))}}},hH=function(t){var n=hK(t),r=h$(t);return{URI:hz,_E:void 0,map:hC,compact:n.compact,separate:n.separate,filter:n.filter,filterMap:n.filterMap,partition:n.partition,partitionMap:n.partitionMap,traverse:hP,sequence:me,reduce:hA,foldMap:hj,reduceRight:hN,wither:rI(mt,r),wilt:rk(mt,r)}},hZ=function(t){return{URI:hz,_E:void 0,map:hC,ap:function(n,r){return ml(n)?ml(r)?e_(t.concat(n.left,r.left)):n:ml(r)?r:eS(n.right(r.right))},of:hQ}},hG=function(t){return{URI:hz,_E:void 0,map:hC,alt:function(n,r){if(mf(n))return n;var i=r();return ml(i)?e_(t.concat(n.left,i.left)):i}}},hJ=function(t){return function(n){return ml(n)?n:eS(t(n.right))}},hY={URI:hz,map:hC},hQ=eS,hX=function(t){return function(n){return ml(n)?n:ml(t)?t:eS(n.right(t.right))}},h0=hX,h1={URI:hz,map:hC,ap:hR},h2={URI:hz,map:hC,ap:hR,of:hQ},h3=function(t){return function(n){return ml(n)?n:t(n.right)}},h4=h3,h5={URI:hz,map:hC,ap:hR,chain:hE},h6=function(t,n){return function(r){return ml(r)?t:n(t,r.right)}},h9=function(t){return function(n){return function(r){return ml(r)?t.empty:n(r.right)}}},h8=function(t,n){return function(r){return ml(r)?t:n(r.right,t)}},h7=function(t){return function(n){return function(r){return ml(r)?t.of(e_(r.left)):t.map(n(r.right),eS)}}},me=function(t){return function(n){return ml(n)?t.of(e_(n.left)):t.map(n.right,eS)}},mt={URI:hz,map:hC,reduce:hA,foldMap:hj,reduceRight:hN,traverse:hP,sequence:me},mn=function(t,n){return function(r){return ml(r)?e_(t(r.left)):eS(n(r.right))}},mr=function(t){return function(n){return ml(n)?e_(t(n.left)):n}},mi=function(t){return function(n){return ml(n)?t():n}},mo=mi,ma=function(t){return function(n){return ml(n)?n:eS(t(n))}},mu={URI:hz,fromEither:F},ms=oq(mu),mc=oB(mu),ml=eb,mf=ex,md=function(t,n){return function(r){return ml(r)?t(r.left):n(r.right)}},mp=function(t){return function(n){return ml(n)?t(n.left):n.right}},mh=el(hY),mm=eV(h1),mg=e$(h1),my=eX(h5),mv=h3(F),mb=ma(F),mx=oV(mu),m_=o$(mu,h5),mS=oG(mu,h5),mT=function(t){return ml(t)?eS(t.left):e_(t.right)},mw=function(t){return function(n){return ml(n)?t(n.left):n}},mO=function(t){return function(n){return null==n?e_(t):eS(n)}},mk=function(t,n){try{return eS(t())}catch(r){return e_(n(r))}},mI=function(t,n){return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return mk(function(){return t.apply(void 0,r)},n)}},mM=function(t){var n=mO(t);return function(t){return q(t,n)}},mC=function(t){var n=mM(t);return function(t){return h4(n(t))}},mR=md(F,F),mE=function(t){return function(n){return!ml(n)&&t(n.right)}},mA=hQ(eM),mj=ef(hY),mN=e0(h5),mP=eK(h1),mL=hQ(eI),mF=function(t){return function(n){var r=t(0,eO(n));if(ml(r))return r;for(var i=[r.right],o=1;o<n.length;o++){var a=t(o,n[o]);if(ml(a))return a;i.push(a.right)}return eS(i)}},mD=function(t){var n=mF(t);return function(t){return ew(t)?n(t):mL}},mW=function(t){return mD(function(n,r){return t(r)})},mU=mW(F),mz=function(t,n){return mk(function(){var n=JSON.stringify(t);if("string"!=typeof n)throw Error("Converting unsupported structure to JSON");return n},n)},mB=eH(h1),mq=oW(h2),mV=function(t,n){return eH(hZ(t))(n)},m$=function(t,n){return oW(hZ(t))(n)};let mK=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:hz,map:hC,alt:hD},ApT:mL,Applicative:h2,Apply:h1,Bifunctor:{URI:hz,bimap:hL,mapLeft:hF},Chain:h5,ChainRec:{URI:hz,map:hC,ap:hR,chain:hE,chainRec:hU},Do:mA,Extend:{URI:hz,map:hC,extend:hW},Foldable:{URI:hz,reduce:hA,foldMap:hj,reduceRight:hN},FromEither:mu,Functor:hY,Monad:{URI:hz,map:hC,ap:hR,of:hQ,chain:hE},MonadThrow:{URI:hz,map:hC,ap:hR,of:hQ,chain:hE,throwError:e_},Pointed:{URI:hz,of:hQ},Traversable:mt,URI:hz,alt:mo,altW:mi,ap:h0,apFirst:mm,apFirstW:mm,apS:mP,apSW:mP,apSecond:mg,apSecondW:mg,apW:hX,bimap:mn,bind:mN,bindTo:mj,bindW:mN,chain:h4,chainFirst:my,chainFirstW:my,chainNullableK:mC,chainOptionK:m_,chainW:h3,duplicate:mb,either:{URI:hz,map:hC,of:hQ,ap:hR,chain:hE,reduce:hA,foldMap:hj,reduceRight:hN,traverse:hP,sequence:me,bimap:hL,mapLeft:hF,alt:hD,extend:hW,chainRec:hU,throwError:e_},elem:function t(n){return function(r,i){if(void 0===i){var o=t(n);return function(t){return o(r,t)}}return!ml(i)&&n.equals(r,i.right)}},exists:mE,extend:ma,filterOrElse:mS,filterOrElseW:mS,flap:mh,flatten:mv,flattenW:mv,fold:md,foldMap:h9,foldW:md,fromNullable:mO,fromNullableK:mM,fromOption:mc,fromOptionK:mx,fromPredicate:ms,getAltValidation:hG,getApplicativeValidation:hZ,getApplyMonoid:mq,getApplySemigroup:mB,getCompactable:h$,getEq:hq,getFilterable:hK,getOrElse:mp,getOrElseW:mp,getSemigroup:hV,getShow:hB,getValidation:function(t){var n=hZ(t).ap,r=hG(t).alt;return{URI:hz,_E:void 0,map:hC,of:hQ,chain:hE,bimap:hL,mapLeft:hF,reduce:hA,foldMap:hj,reduceRight:hN,extend:hW,traverse:hP,sequence:me,chainRec:hU,throwError:e_,ap:n,alt:r}},getValidationMonoid:m$,getValidationSemigroup:mV,getWitherable:hH,isLeft:ml,isRight:mf,left:e_,map:hJ,mapLeft:mr,match:md,matchW:md,of:hQ,orElse:mw,orElseW:mw,parseJSON:function(t,n){return mk(function(){return JSON.parse(t)},n)},reduce:h6,reduceRight:h8,right:eS,sequence:me,sequenceArray:mU,stringifyJSON:mz,swap:mT,throwError:e_,toError:function(t){return t instanceof Error?t:Error(String(t))},toUnion:mR,traverse:h7,traverseArray:mW,traverseArrayWithIndex:mD,traverseReadonlyArrayWithIndex:mD,traverseReadonlyNonEmptyArrayWithIndex:mF,tryCatch:mk,tryCatchK:mI},Symbol.toStringTag,{value:"Module"}));function mH(t){return q(eS,t.of)}function mZ(t){return q(e_,t.of)}function mG(t){return function(n){return t.map(n,eS)}}function mJ(t){return function(n){return t.map(n,e_)}}function mY(t){return function(n){return q(mO(n),t.of)}}function mQ(t){var n=mY(t);return function(t){var r=n(t);return function(t){return q(t,r)}}}function mX(t){var n=m2(t),r=mQ(t);return function(t){var i=r(t);return function(t){return n(i(t))}}}function m0(t){return ec(t,hY)}function m1(t){return eq(t,h1)}function m2(t){return function(n){return function(r){return t.chain(r,function(r){return ml(r)?t.of(r):n(r.right)})}}}function m3(t){return function(n){return function(r){return t.chain(r,function(r){return ml(r)?n():t.of(r)})}}}function m4(t){return function(n,r){return function(i){return t.map(i,mn(n,r))}}}function m5(t){return function(n){return function(r){return t.map(r,mr(n))}}}function m6(t,n){return function(r){return function(i){return t.chain(i,md(function(i){return t.map(r(),mr(function(t){return n.concat(i,t)}))},mH(t)))}}}function m9(t){return function(n,r){return function(i){return t.map(i,md(n,r))}}}function m8(t){return function(n,r){return function(i){return t.chain(i,md(n,r))}}}function m7(t){return function(n){return function(r){return t.chain(r,md(n,t.of))}}}function ge(t){return function(n){return function(r){return t.chain(r,function(r){return ml(r)?n(r.left):t.of(r)})}}}function gt(t){var n=ge(t);return function(r){return n(function(n){return t.map(r(n),function(t){return ml(t)?t:e_(n)})})}}function gn(t){return function(n){return function(r){return t.chain(r,md(function(r){return t.map(n(r),e_)},function(n){return t.of(eS(n))}))}}}function gr(t){return function(n){return t.map(n,mT)}}function gi(t){return function(n){return t.map(n,mR)}}let go=Object.freeze(Object.defineProperty({__proto__:null,alt:m3,altValidation:m6,ap:m1,bimap:m4,chain:m2,chainNullableK:mX,fromNullable:mY,fromNullableK:mQ,getEitherM:function(t){var n=m1(t),r=m0(t),i=m2(t),o=m3(t),a=m4(t),u=m5(t),s=m8(t),c=m7(t),l=ge(t);return{map:function(t,n){return Z(t,r(n))},ap:function(t,r){return Z(t,n(r))},of:mH(t),chain:function(t,n){return Z(t,i(n))},alt:function(t,n){return Z(t,o(n))},bimap:function(t,n,r){return Z(t,a(n,r))},mapLeft:function(t,n){return Z(t,u(n))},fold:function(t,n,r){return Z(t,s(n,r))},getOrElse:function(t,n){return Z(t,c(n))},orElse:function(t,n){return Z(t,l(n))},swap:gr(t),rightM:mG(t),leftM:mJ(t),left:mZ(t)}},getOrElse:m7,left:mZ,leftF:mJ,map:m0,mapLeft:m5,match:m9,matchE:m8,orElse:ge,orElseFirst:gt,orLeft:gn,right:mH,rightF:mG,swap:gr,toUnion:gi},Symbol.toStringTag,{value:"Module"}));var ga=function(){return{concat:function(t,n){return q(t,n)}}},gu=function(){return{concat:ga().concat,empty:F}};let gs=Object.freeze(Object.defineProperty({__proto__:null,URI:"Endomorphism",getMonoid:gu,getSemigroup:ga},Symbol.toStringTag,{value:"Module"})),gc=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function gl(t,n){var r=n.zero,i=function(o,a){return t.equals(a,r)?o:i(a,n.mod(o,a))};return i}let gf=Object.freeze(Object.defineProperty({__proto__:null,fieldNumber:{add:function(t,n){return t+n},zero:0,mul:function(t,n){return t*n},one:1,sub:function(t,n){return t-n},degree:function(t){return 1},div:function(t,n){return t/n},mod:function(t,n){return t%n}},gcd:gl,lcm:function(t,n){var r=n.zero,i=gl(t,n);return function(o,a){return t.equals(o,r)||t.equals(a,r)?r:n.div(n.mul(o,a),i(o,a))}}},Symbol.toStringTag,{value:"Module"}));function gd(t,n){return function(r){return function(i){return t.map(i,function(t){return n.filter(t,r)})}}}function gp(t,n){return function(r){return function(i){return t.map(i,function(t){return n.filterMap(t,r)})}}}function gh(t,n){var r=gd(t,n);return function(t){var n=r(dP(t)),i=r(t);return function(t){return eE(n(t),i(t))}}}function gm(t,n){var r=gp(t,n);return function(t){return function(n){return eE(Z(n,r(function(n){return dU(t(n))})),Z(n,r(function(n){return dz(t(n))})))}}}let gg=Object.freeze(Object.defineProperty({__proto__:null,filter:gd,filterMap:gp,getFilterableComposition:function(t,n){var r=ed(t,n).map,i=hn(t,n),o=hr(t,n,n),a=gd(t,n),u=gp(t,n),s=gh(t,n),c=gm(t,n);return{map:r,compact:i,separate:o,filter:function(t,n){return Z(t,a(n))},filterMap:function(t,n){return Z(t,u(n))},partition:function(t,n){return Z(t,s(n))},partitionMap:function(t,n){return Z(t,c(n))}}},partition:gh,partitionMap:gm},Symbol.toStringTag,{value:"Module"})),gy=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function gv(t,n){return function(r,i){return function(o){return t.reduce(o,r,function(t,r){return n.reduce(r,t,i)})}}}function gb(t,n){return function(r){var i=t.foldMap(r),o=n.foldMap(r);return function(t){return function(n){return i(n,function(n){return o(n,t)})}}}}function gx(t,n){return function(r,i){return function(o){return t.reduceRight(o,r,function(t,r){return n.reduceRight(t,r,i)})}}}function g_(t){return function(n){return t.reduce(n,[],function(t,n){return t.push(n),t})}}function gS(t,n){var r=gv(t,n),i=gb(t,n),o=gx(t,n);return{reduce:function(t,n,i){return Z(t,r(n,i))},foldMap:function(t){var n=i(t);return function(t,r){return Z(t,n(r))}},reduceRight:function(t,n,r){return Z(t,o(n,r))}}}let gT=Object.freeze(Object.defineProperty({__proto__:null,foldM:function(t,n){return function(r,i,o){return n.reduce(r,t.of(i),function(n,r){return t.chain(n,function(t){return o(t,r)})})}},foldMap:gb,getFoldableComposition:gS,intercalate:function(t,n){return function(r,i){var o=function(n,i){var o=n.init,a=n.acc;return o?{init:!1,acc:i}:{init:!1,acc:t.concat(t.concat(a,r),i)}};return n.reduce(i,{init:!0,acc:t.empty},o).acc}},reduce:gv,reduceM:function(t,n){return function(r,i){return function(o){return n.reduce(o,t.of(r),function(n,r){return t.chain(n,function(t){return i(t,r)})})}}},reduceRight:gx,toArray:g_,toReadonlyArray:g_,traverse_:function(t,n){var r=t.of(void 0);return function(i,o){return n.reduce(i,r,function(n,r){var i,a;return a=o(r),t.ap(t.map(n,D),a)})}}},Symbol.toStringTag,{value:"Module"}));function gw(t,n){return function(r,i){return function(o){return t.reduceWithIndex(o,r,function(t,r,o){return n.reduceWithIndex(o,r,function(n,r,o){return i([t,n],r,o)})})}}}function gO(t,n){return function(r){var i=t.foldMapWithIndex(r),o=n.foldMapWithIndex(r);return function(t){return function(n){return i(n,function(n,r){return o(r,function(r,i){return t([n,r],i)})})}}}}function gk(t,n){return function(r,i){return function(o){return t.reduceRightWithIndex(o,r,function(t,r,o){return n.reduceRightWithIndex(r,o,function(n,r,o){return i([t,n],r,o)})})}}}let gI=Object.freeze(Object.defineProperty({__proto__:null,foldMapWithIndex:gO,getFoldableWithIndexComposition:function(t,n){var r=gS(t,n),i=gw(t,n),o=gO(t,n),a=gk(t,n);return{reduce:r.reduce,foldMap:r.foldMap,reduceRight:r.reduceRight,reduceWithIndex:function(t,n,r){return Z(t,i(n,r))},foldMapWithIndex:function(t){var n=o(t);return function(t,r){return Z(t,n(r))}},reduceRightWithIndex:function(t,n,r){return Z(t,a(n,r))}}},reduceRightWithIndex:gk,reduceWithIndex:gw},Symbol.toStringTag,{value:"Module"}));function gM(t){return function(n){return q(n,t.fromIO)}}function gC(t,n){return function(r){var i=q(r,t.fromIO);return function(t){return n.chain(t,i)}}}function gR(t,n){var r=eX(n);return function(n){return r(q(n,t.fromIO))}}let gE=Object.freeze(Object.defineProperty({__proto__:null,chainFirstIOK:gR,chainIOK:gC,fromIOK:gM},Symbol.toStringTag,{value:"Module"}));var gA=function(){return F},gj=function(t){return function(n){return function(r){return n(t(r))}}},gN=function(t){return function(n){return t(n)(n)}},gP=function(t,n){return Z(t,gU(n))},gL=function(t,n){return Z(t,gB(n))},gF=function(t,n){return Z(t,gV(n))},gD=function(t,n){return Z(t,gK(n))},gW=function(t,n,r){return Z(t,gH(n,r))},gU=function(t){return function(n){return function(r){return t(n(r))}}},gz=function(t){return function(n){return function(r){return n(r)(t(r))}}},gB=gz,gq=function(t){return function(n){return function(r){return t(n(r))(r)}}},gV=gq,g$=gq(F),gK=function(t){return function(n){return q(t,n)}},gH=function(t,n){return function(r){return function(i){return n(r(t(i)))}}},gZ=function(){return F},gG=function(t){return function(n){var r=n[0],i=n[1];return[t(r),i]}},gJ=function(t){return function(n){var r;return[n[0],t(n[1])]}},gY=function(t){return md(function(n){return e_(t(n))},eS)},gQ=function(t){return md(e_,function(n){return eS(t(n))})},gX="Reader",g0={URI:gX,map:gP},g1=el(g0),g2={URI:gX,of:D},g3={URI:gX,map:gP,ap:gL},g4=eV(g3),g5=e$(g3),g6={URI:gX,map:gP,ap:gL,of:D},g9={URI:gX,map:gP,ap:gL,chain:gF},g8={URI:gX,map:gP,of:D,ap:gL,chain:gF},g7=eX(g9),ye=ef(g0),yt=e0(g9),yn=D(eM),yr=eK(g3),yi=D(eI),yo=function(t){return function(n){return function(r){for(var i=[t(0,eO(n))(r)],o=1;o<n.length;o++)i.push(t(o,n[o])(r));return i}}},ya=function(t){var n=yo(t);return function(t){return ew(t)?n(t):yi}},yu=function(t){return ya(function(n,r){return t(r)})},ys=yu(F),yc=eH(g3),yl=oW(g6);let yf=Object.freeze(Object.defineProperty({__proto__:null,ApT:yi,Applicative:g6,Apply:g3,Category:{URI:gX,compose:gD,id:gZ},Chain:g9,Choice:{URI:gX,map:gP,promap:gW,left:gY,right:gQ},Do:yn,Functor:g0,Monad:g8,Pointed:g2,Profunctor:{URI:gX,map:gP,promap:gW},Strong:{URI:gX,map:gP,promap:gW,first:gG,second:gJ},URI:gX,ap:gB,apFirst:g4,apFirstW:g4,apS:yr,apSW:yr,apSecond:g5,apSecondW:g5,apW:gz,ask:gA,asks:F,asksReader:gN,asksReaderW:gN,bind:yt,bindTo:ye,bindW:yt,chain:gV,chainFirst:g7,chainFirstW:g7,chainW:gq,compose:gK,first:gG,flap:g1,flatten:g$,flattenW:g$,getMonoid:yl,getSemigroup:yc,id:gZ,left:gY,local:gj,map:gU,of:D,promap:gH,reader:{URI:gX,map:gP,of:D,ap:gL,chain:gF,promap:gW,compose:gD,id:gZ,first:gG,second:gJ,left:gY,right:gQ},right:gQ,second:gJ,sequenceArray:ys,traverseArray:yu,traverseArrayWithIndex:ya,traverseReadonlyArrayWithIndex:ya,traverseReadonlyNonEmptyArrayWithIndex:yo},Symbol.toStringTag,{value:"Module"}));function yd(t){return function(){return t.fromReader(gA())}}function yp(t){return t.fromReader}function yh(t){return function(n){return q(n,t.fromReader)}}function ym(t,n){var r=yh(t);return function(t){return function(i){return n.chain(i,r(t))}}}function yg(t,n){return q(yh(t),eX(n))}let yy=Object.freeze(Object.defineProperty({__proto__:null,ask:yd,asks:yp,chainFirstReaderK:yg,chainReaderK:ym,fromReaderK:yh},Symbol.toStringTag,{value:"Module"}));var yv=function(){return function(t){return[t,t]}},yb=function(t){return function(){return[void 0,t]}},yx=function(t){return function(n){return[void 0,t(n)]}},y_=function(t){return function(n){return[t(n),n]}},yS=function(t,n){return Z(t,yO(n))},yT=function(t,n){return Z(t,yk(n))},yw=function(t,n){return Z(t,yM(n))},yO=function(t){return function(n){return function(r){var i=n(r),o=i[0],a=i[1];return[t(o),a]}}},yk=function(t){return function(n){return function(r){var i=n(r),o=i[0],a=t(i[1]),u=a[0],s=a[1];return[o(u),s]}}},yI=function(t){return function(n){return[t,n]}},yM=function(t){return function(n){return function(r){var i=n(r),o=i[0],a=i[1];return t(o)(a)}}},yC=yM(F),yR="State",yE={URI:yR,map:yS},yA=el(yE),yj={URI:yR,map:yS,ap:yT},yN=eV(yj),yP=e$(yj),yL={URI:yR,map:yS,ap:yT,chain:yw},yF={URI:yR,map:yS,ap:yT,of:yI,chain:yw},yD=eX(yL),yW=function(t){return function(n){return n(t)[0]}},yU=function(t){return function(n){return n(t)[1]}},yz=ef(yE),yB=e0(yL),yq=eK(yj),yV=function(t){return function(n){return function(r){for(var i=t(0,eO(n))(r),o=i[0],a=i[1],u=[o],s=a,c=1;c<n.length;c++){var l=t(c,n[c])(s),f=l[0],d=l[1];u.push(f),s=d}return[u,s]}}},y$=function(t){var n=yV(t);return function(t){return ew(t)?n(t):yI(eI)}},yK=function(t){return y$(function(n,r){return t(r)})},yH=yK(F),yZ=function(t,n){return t(n)[0]},yG=function(t,n){return t(n)[1]};let yJ=Object.freeze(Object.defineProperty({__proto__:null,Applicative:{URI:yR,map:yS,ap:yT,of:yI},Apply:yj,Chain:yL,FromState:{URI:yR,fromState:F},Functor:yE,Monad:yF,Pointed:{URI:yR,of:yI},URI:yR,ap:yk,apFirst:yN,apS:yq,apSecond:yP,bind:yB,bindTo:yz,chain:yM,chainFirst:yD,evalState:yZ,evaluate:yW,execState:yG,execute:yU,flap:yA,flatten:yC,get:yv,gets:y_,map:yO,modify:yx,of:yI,put:yb,sequenceArray:yH,state:yF,traverseArray:yK,traverseArrayWithIndex:y$,traverseReadonlyArrayWithIndex:y$,traverseReadonlyNonEmptyArrayWithIndex:yV},Symbol.toStringTag,{value:"Module"}));function yY(t){return function(){return t.fromState(yv())}}function yQ(t){return function(n){return t.fromState(yb(n))}}function yX(t){return q(yx,t.fromState)}function y0(t){return q(y_,t.fromState)}function y1(t){return function(n){return q(n,t.fromState)}}function y2(t,n){var r=y1(t);return function(t){return function(i){return n.chain(i,r(t))}}}let y3=Object.freeze(Object.defineProperty({__proto__:null,chainStateK:y2,fromStateK:y1,get:yY,gets:y0,modify:yX,put:yQ},Symbol.toStringTag,{value:"Module"}));function y4(t){return function(n){return q(n,t.fromTask)}}function y5(t,n){return function(r){var i=q(r,t.fromTask);return function(t){return n.chain(t,i)}}}function y6(t,n){var r=eX(n);return function(n){return r(q(n,t.fromTask))}}let y9=Object.freeze(Object.defineProperty({__proto__:null,chainFirstTaskK:y6,chainTaskK:y5,fromTaskK:y4},Symbol.toStringTag,{value:"Module"}));function y8(t){return function(n){return q(n,t.fromThese)}}let y7=Object.freeze(Object.defineProperty({__proto__:null,fromTheseK:y8},Symbol.toStringTag,{value:"Module"}));function ve(t,n){return function(r){return function(i){return t.mapWithIndex(i,function(t,i){return n.mapWithIndex(i,function(n,i){return r([t,n],i)})})}}}let vt=Object.freeze(Object.defineProperty({__proto__:null,getFunctorWithIndexComposition:function(t,n){var r=ed(t,n).map,i=ve(t,n);return{map:r,mapWithIndex:function(t,n){return Z(t,i(n))}}},mapWithIndex:ve},Symbol.toStringTag,{value:"Module"})),vn=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),vr=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),vi=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var vo=function(t,n){return Z(t,vh(n))},va=function(t,n){return Z(t,vm(n))},vu=function(t,n){return Z(t,vg(n))},vs=function(t,n,r){return Z(t,vx(n,r))},vc=function(t){return function(t,n){return Z(t,v_()(n))}},vl=function(t,n,r){return Z(t,vS(n,r))},vf=function(t,n){return Z(t,vk())},vd=function(t,n){return Z(t,vy(n))},vp=function(t){var n=vT(t);return function(t,r){return Z(t,n(r))}},vh=function(t){return function(n){return t(n)}},vm=function(t){return function(n){return n(t)}},vg=function(t){return function(n){return t(n)}},vy=function(t){return function(n){return t(n)}},vv=vy(F),vb=vg(F),vx=function(t,n){return function(r){return n(t,r)}},v_=function(){return function(t){return function(n){return t(n)}}},vS=function(t,n){return function(r){return n(r,t)}},vT=function(t){return function(n){return function(r){return t.map(n(r),F)}}},vw=function(t){return function(n){return t.map(n,F)}},vO=function(){return F},vk=vO,vI="Identity",vM={URI:vI,map:vo},vC=el(vM),vR={URI:vI,map:vo,ap:va},vE=eV(vR),vA=e$(vR),vj={URI:vI,map:vo,ap:va,chain:vu},vN=eX(vj),vP=F(eM),vL=ef(vM),vF=e0(vj),vD=eK(vR);let vW=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:vI,map:vo,alt:vf},Applicative:{URI:vI,map:vo,ap:va,of:F},Apply:vR,Chain:vj,ChainRec:{URI:vI,map:vo,ap:va,chain:vu,chainRec:dS},Comonad:{URI:vI,map:vo,extend:vd,extract:F},Do:vP,Foldable:{URI:vI,reduce:vs,foldMap:vc,reduceRight:vl},Functor:vM,Monad:{URI:vI,map:vo,ap:va,of:F,chain:vu},Pointed:{URI:vI,of:F},Traversable:{URI:vI,map:vo,reduce:vs,foldMap:vc,reduceRight:vl,traverse:vp,sequence:vw},URI:vI,alt:vk,altW:vO,ap:vm,apFirst:vE,apS:vD,apSecond:vA,bind:vF,bindTo:vL,chain:vg,chainFirst:vN,duplicate:vv,extend:vy,extract:F,flap:vC,flatten:vb,foldMap:v_,getEq:F,getShow:F,identity:{URI:vI,map:vo,ap:va,of:F,chain:vu,reduce:vs,foldMap:vc,reduceRight:vl,traverse:vp,sequence:vw,alt:vf,extract:F,extend:vd,chainRec:dS},map:vh,of:F,reduce:vx,reduceRight:vS,sequence:vw,traverse:vT},Symbol.toStringTag,{value:"Module"})),vU=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var vz=function(t,n){return function(){return n(t())}},vB=function(t,n){return function(){return t()(n())}},vq=function(t,n){return function(){return n(t())()}},vV=function(t,n){return function(){for(var r=n(t)();"Left"===r._tag;)r=n(r.left)();return r.right}},v$=function(t){return function(n){return vz(n,t)}},vK=function(t){return function(n){return vB(n,t)}},vH=function(t){return function(n){return vq(n,t)}},vZ=vH(F),vG={URI:"IO",map:vz},vJ=el(vG),vY={URI:"IO",of:D},vQ={URI:"IO",map:vz,ap:vB},vX=eV(vQ),v0=e$(vQ),v1={URI:"IO",map:vz,ap:vB,of:D},v2={URI:"IO",map:vz,ap:vB,chain:vq},v3={URI:"IO",map:vz,ap:vB,of:D,chain:vq},v4=eX(v2),v5=D(eM),v6=ef(vG),v9=e0(v2),v8=eK(vQ),v7=D(eI),be=function(t){return function(n){return function(){for(var r=[t(0,eO(n))()],i=1;i<n.length;i++)r.push(t(i,n[i])());return r}}},bt=function(t){var n=be(t);return function(t){return ew(t)?n(t):v7}},bn=function(t){return bt(function(n,r){return t(r)})},br=bn(F),bi=eH(vQ),bo=oW(v1);let ba=Object.freeze(Object.defineProperty({__proto__:null,ApT:v7,Applicative:v1,Apply:vQ,Chain:v2,ChainRec:{URI:"IO",map:vz,ap:vB,chain:vq,chainRec:vV},Do:v5,FromIO:{URI:"IO",fromIO:F},Functor:vG,Monad:v3,MonadIO:{URI:"IO",map:vz,ap:vB,of:D,chain:vq,fromIO:F},Pointed:vY,URI:"IO",ap:vK,apFirst:vX,apS:v8,apSecond:v0,bind:v9,bindTo:v6,chain:vH,chainFirst:v4,flap:vJ,flatten:vZ,fromIO:F,getMonoid:bo,getSemigroup:bi,io:{URI:"IO",map:vz,of:D,ap:vB,chain:vq,fromIO:F,chainRec:vV},map:v$,of:D,sequenceArray:br,traverseArray:bn,traverseArrayWithIndex:bt,traverseReadonlyArrayWithIndex:bt,traverseReadonlyNonEmptyArrayWithIndex:be},Symbol.toStringTag,{value:"Module"}));var bu=mZ(vY),bs=mH(vY),bc=mG(vG),bl=mJ(vG),bf=m9(vG),bd=m8(v3),bp=m7(v3),bh=function(t,n){return function(){return mk(t,n)}},bm=function(t,n){return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return bh(function(){return t.apply(void 0,r)},n)}},bg=gi(vG),by=ge(v3),bv=gt(v3),bb=function(t){return bv(bG(t))},bx=gn(v3),b_=gr(vG),bS=function(t,n){return Z(t,bC(n))},bT=function(t,n){return Z(t,bA(n))},bw=function(t,n){return Z(t,bj(function(t){return Z(n,bC(t))}))},bO=function(t,n){return Z(t,bj(n))},bk=function(t,n,r){return Z(t,bR(n,r))},bI=function(t,n){return Z(t,bE(n))},bM=function(t,n){return Z(t,bP(n))},bC=m0(vG),bR=m4(vG),bE=m5(vG),bA=m1(vQ),bj=m2(v3),bN=bj(F),bP=m3(v3),bL="IOEither";function bF(t){var n=eq(vQ,hZ(t));return{URI:bL,_E:void 0,map:bS,ap:function(t,r){return Z(t,n(r))},of:bs}}function bD(t){var n=m6(v3,t);return{URI:bL,_E:void 0,map:bS,alt:function(t,r){return Z(t,n(r))}}}var bW=function(t){var n=h$(t);return{URI:bL,_E:void 0,compact:hn(vG,n),separate:hr(vG,n,hY)}},bU={URI:bL,map:bS},bz=el(bU),bB={URI:bL,map:bS,ap:bT},bq=eV(bB),bV=e$(bB),b$={URI:bL,map:bS,ap:bT,of:bs},bK={URI:bL,map:bS,ap:bT,chain:bO},bH=eX(bK),bZ={URI:bL,fromIO:bc},bG=gM(bZ),bJ=gC(bZ,bK),bY=gR(bZ,bK),bQ={URI:bL,fromEither:D},bX=oB(bQ),b0=oV(bQ),b1=o$(bQ,bK),b2=oH(bQ,bK),b3=oZ(bQ,bK),b4=oq(bQ),b5=oG(bQ,bK),b6=oK(bQ),b9=function(t,n,r){return b8(t,n,r)},b8=function(t,n,r){return Z(t,bj(function(t){return Z(n(t),vH(function(n){return Z(r(t,n),bj(function(){return D(n)}))}))}))},b7=bs(eM),xe=ef(bU),xt=e0(bK),xn=eK(bB),xr=bs(eI),xi=function(t){return q(be(t),v$(mF(G)))},xo=function(t){var n=xi(t);return function(t){return ew(t)?n(t):xr}},xa=function(t){return function(n){return function(){var r=t(0,eO(n))();if(eb(r))return r;for(var i=[r.right],o=1;o<n.length;o++){var a=t(o,n[o])();if(eb(a))return a;i.push(a.right)}return eS(i)}}},xu=function(t){var n=xa(t);return function(t){return ew(t)?n(t):xr}},xs=function(t){return xo(function(n,r){return t(r)})},xc=xs(F),xl=function(t){return xu(function(n,r){return t(r)})},xf=xl(F),xd=eH(bB),xp=oW(b$),xh=function(t){return eH(vQ)(hV(t))};let xm=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:bL,map:bS,alt:bM},ApT:xr,Applicative:b$,ApplicativePar:b$,ApplicativeSeq:{URI:bL,map:bS,ap:bw,of:bs},ApplyPar:bB,Bifunctor:{URI:bL,bimap:bk,mapLeft:bI},Chain:bK,Do:b7,FromEither:bQ,FromIO:bZ,Functor:bU,Monad:{URI:bL,map:bS,ap:bT,of:bs,chain:bO},MonadIO:{URI:bL,map:bS,ap:bT,of:bs,chain:bO,fromIO:bc},MonadThrow:{URI:bL,map:bS,ap:bT,of:bs,chain:bO,throwError:bu},Pointed:{URI:bL,of:bs},URI:bL,alt:bP,altW:bP,ap:bA,apFirst:bq,apFirstW:bq,apS:xn,apSW:xn,apSecond:bV,apSecondW:bV,apW:bA,bimap:bR,bind:xt,bindTo:xe,bindW:xt,bracket:b9,bracketW:b8,chain:bj,chainEitherK:b2,chainEitherKW:b2,chainFirst:bH,chainFirstEitherK:b3,chainFirstEitherKW:b3,chainFirstIOK:bY,chainFirstW:bH,chainIOK:bJ,chainOptionK:b1,chainW:bj,filterOrElse:b5,filterOrElseW:b5,flap:bz,flatten:bN,flattenW:bN,fold:bd,foldW:bd,fromEither:D,fromEitherK:b6,fromIO:bc,fromIOK:bG,fromOption:bX,fromOptionK:b0,fromPredicate:b4,getAltIOValidation:bD,getApplicativeIOValidation:bF,getApplyMonoid:xp,getApplySemigroup:xd,getCompactable:bW,getFilterable:function(t){var n=hK(t),r=bW(t),i=gd(vG,n),o=gp(vG,n),a=gh(vG,n),u=gm(vG,n);return{URI:bL,_E:void 0,map:bS,compact:r.compact,separate:r.separate,filter:function(t,n){return Z(t,i(n))},filterMap:function(t,n){return Z(t,o(n))},partition:function(t,n){return Z(t,a(n))},partitionMap:function(t,n){return Z(t,u(n))}}},getIOValidation:function(t){var n=bF(t),r=bD(t);return{URI:bL,_E:void 0,map:bS,ap:n.ap,of:bs,chain:bO,bimap:bk,mapLeft:bI,alt:r.alt,fromIO:bc,throwError:bu}},getOrElse:bp,getOrElseW:bp,getSemigroup:xh,ioEither:{URI:bL,bimap:bk,mapLeft:bI,map:bS,of:bs,ap:bT,chain:bO,alt:bM,fromIO:bc,throwError:bu},left:bu,leftIO:bl,map:bC,mapLeft:bE,match:bf,matchE:bd,matchEW:bd,matchW:bf,of:bs,orElse:by,orElseFirst:bv,orElseFirstIOK:bb,orElseFirstW:bv,orElseW:by,orLeft:bx,right:bs,rightIO:bc,sequenceArray:xc,sequenceSeqArray:xf,swap:b_,throwError:bu,toUnion:bg,traverseArray:xs,traverseArrayWithIndex:xo,traverseReadonlyArrayWithIndex:xo,traverseReadonlyArrayWithIndexSeq:xu,traverseReadonlyNonEmptyArrayWithIndex:xi,traverseReadonlyNonEmptyArrayWithIndexSeq:xa,traverseSeqArray:xl,traverseSeqArrayWithIndex:xu,tryCatch:bh,tryCatchK:bm},Symbol.toStringTag,{value:"Module"}));function xg(t){return q(ev,t.of)}function xy(t){return D(t.of(ey))}function xv(t){return function(n){return t.map(n,ev)}}function xb(t){return q(pq,t.of)}function xx(t){var n=xb(t);return function(t){return q(t,n)}}function x_(t){var n=xE(t),r=xx(t);return function(t){return n(r(t))}}function xS(t){return function(n){return q(n,t.of)}}function xT(t){var n=xE(t),r=xS(t);return function(t){return n(r(t))}}function xw(t){return function(n){return function(r){return t.of(dW(n)(r))}}}function xO(t){return q(dz,t.of)}function xk(t){return function(n,r){return function(i){return t.map(i,pj(n,r))}}}function xI(t){return function(n,r){return function(i){return t.chain(i,pj(n,r))}}}function xM(t){return function(n){return function(r){return t.chain(r,pj(n,t.of))}}}function xC(t){return ec(t,d9)}function xR(t){return eq(t,pe)}function xE(t){var n=xy(t);return function(r){return function(i){return t.chain(i,pj(function(){return n()},r))}}}function xA(t){var n=xg(t);return function(r){return function(i){return t.chain(i,pj(r,n))}}}let xj=Object.freeze(Object.defineProperty({__proto__:null,alt:xA,ap:xR,chain:xE,chainNullableK:x_,chainOptionK:xT,fromEither:xO,fromF:xv,fromNullable:xb,fromNullableK:xx,fromOptionK:xS,fromPredicate:xw,getOptionM:function(t){var n=xR(t),r=xC(t),i=xE(t),o=xA(t),a=xI(t),u=xM(t),s=xy(t);return{map:function(t,n){return Z(t,r(n))},ap:function(t,r){return Z(t,n(r))},of:xg(t),chain:function(t,n){return Z(t,i(n))},alt:function(t,n){return Z(t,o(n))},fold:function(t,n,r){return Z(t,a(n,r))},getOrElse:function(t,n){return Z(t,u(n))},fromM:xv(t),none:function(){return s()}}},getOrElse:xM,map:xC,match:xk,matchE:xI,some:xg,zero:xy},Symbol.toStringTag,{value:"Module"}));var xN=xg(vY),xP=xw(vY),xL=xO(vY),xF=xv(vG),xD=v$(dz),xW=xk(vG),xU=xI(v2),xz=xM(v3),xB=v$(pG),xq=v$(pZ),xV=xb(vY),x$=xx(vY),xK=x_(v3),xH=xS(vY),xZ=xT(v3),xG=xC(vG),xJ=xR(vQ),xY=xE(v3),xQ=xY(F),xX=xA(v3),x0=xy(vY),x1=x0(),x2=hn(vG,pg),x3=hr(vG,pg,d9),x4=gd(vG,p_),x5=gp(vG,p_),x6=gh(vG,p_),x9=gm(vG,p_),x8=function(t,n){return Z(t,xG(n))},x7=function(t,n){return Z(t,xJ(n))},_e=function(t,n){return Z(t,xY(n))},_t=function(t,n){return Z(t,xX(n))},_n=function(t,n){return Z(t,x4(n))},_r=function(t,n){return Z(t,x5(n))},_i=function(t,n){return Z(t,x6(n))},_o=function(t,n){return Z(t,x9(n))},_a="IOOption",_u={URI:_a,map:x8},_s=el(_u),_c={URI:_a,of:xN},_l={URI:_a,map:x8,ap:x7},_f=eV(_l),_d=e$(_l),_p={URI:_a,map:x8,ap:x7,chain:_e},_h=eX(_p),_m={URI:_a,zero:x0},_g=uR(_m,_c),_y={URI:_a,fromIO:xF},_v=gM(_y),_b=gC(_y,_p),_x=gR(_y,_p),__={URI:_a,fromEither:xL},_S=oK(__),_T=oH(__,_p),_w=oZ(__,_p),_O=xN(eM),_k=ef(_u),_I=e0(_p),_M=eK(_l),_C=xN(eI),_R=function(t){return q(be(t),v$(p2(G)))},_E=function(t){var n=_R(t);return function(t){return ew(t)?n(t):_C}};let _A=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:_a,map:x8,alt:_t},Alternative:{URI:_a,map:x8,ap:x7,of:xN,alt:_t,zero:x0},ApT:_C,Applicative:{URI:_a,map:x8,ap:x7,of:xN},Apply:_l,Chain:_p,Compactable:{URI:_a,compact:x2,separate:x3},Do:_O,Filterable:{URI:_a,map:x8,compact:x2,separate:x3,filter:_n,filterMap:_r,partition:_i,partitionMap:_o},FromEither:__,FromIO:_y,Functor:_u,Monad:{URI:_a,map:x8,ap:x7,of:xN,chain:_e},MonadIO:{URI:_a,map:x8,ap:x7,of:xN,chain:_e,fromIO:xF},Pointed:_c,Zero:_m,alt:xX,altW:xX,ap:xJ,apFirst:_f,apS:_M,apSecond:_d,bind:_I,bindTo:_k,chain:xY,chainEitherK:_T,chainFirst:_h,chainFirstEitherK:_w,chainFirstIOK:_x,chainIOK:_b,chainNullableK:xK,chainOptionK:xZ,compact:x2,filter:x4,filterMap:x5,flap:_s,flatten:xQ,fold:xU,fromEither:xL,fromEitherK:_S,fromIO:xF,fromIOEither:xD,fromIOK:_v,fromNullable:xV,fromNullableK:x$,fromOption:D,fromOptionK:xH,fromPredicate:xP,getOrElse:xz,getOrElseW:xz,guard:_g,map:xG,match:xW,matchE:xU,matchEW:xU,matchW:xW,none:x1,of:xN,partition:x6,partitionMap:x9,separate:x3,some:xN,toNullable:xq,toUndefined:xB,traverseReadonlyArrayWithIndex:_E,traverseReadonlyNonEmptyArrayWithIndex:_R,zero:x0},Symbol.toStringTag,{value:"Module"}));var _j=function(){function t(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 t.prototype.write=function(t){var n=this;return function(){n.value=t}},t.prototype.modify=function(t){var n=this;return function(){n.value=t(n.value)}},t}();let _N=Object.freeze(Object.defineProperty({__proto__:null,IORef:_j,newIORef:function(t){return function(){return new _j(t)}}},Symbol.toStringTag,{value:"Module"})),_P=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var _L=function(t){return mk(function(){return JSON.parse(t)},F)},_F=function(t){return mk(function(){var n=JSON.stringify(t);if("string"!=typeof n)throw Error("Converting unsupported structure to JSON");return n},F)};let _D=Object.freeze(Object.defineProperty({__proto__:null,parse:_L,stringify:_F},Symbol.toStringTag,{value:"Module"})),_W=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var _U=function(t){return new Map(t)};function _z(t,n){return{show:function(r){var i=[];return r.forEach(function(r,o){i.push("[".concat(t.show(o),", ").concat(n.show(r),"]"))}),"new Map([".concat(i.sort().join(", "),"])")}}}var _B=function(t){return t.size},_q=function(t){return 0===t.size};function _V(t){var n=_1(t);return function(r,i){if(void 0===i){var o=_V(t);return function(t){return o(r,t)}}return eg(n(r,i))}}function _$(t){return function(n,r){if(void 0===r){var i=_$(t);return function(t){return i(n,t)}}for(var o,a=r.values();!(o=a.next()).done;){var u=o.value;if(t.equals(n,u))return!0}return!1}}var _K=function(t){return function(n){return Array.from(n.keys()).sort(t.compare)}},_H=function(t){return function(n){return Array.from(n.values()).sort(t.compare)}};function _Z(t){var n=_K(t);return function(t){return function(r){for(var i=[],o=n(r),a=0;a<o.length;a++){var u=o[a];i.push(t(u,r.get(u)))}return i}}}var _G=function(t){return _Z(t)(function(t,n){return[t,n]})},_J=function(t){var n=_0(t);return function(t,r){var i=n(t);return function(n){var o=i(n);if(em(o)){var a=new Map(n);return a.set(t,r),a}if(o.value[1]!==r){var a=new Map(n);return a.set(o.value[0],r),a}return n}}},_Y=function(t){var n=_0(t);return function(t){return function(r){var i=n(t,r);if(eg(i)){var o=new Map(r);return o.delete(i.value[0]),o}return r}}},_Q=function(t){var n=_X(t);return function(t,r){return n(t,function(){return r})}},_X=function(t){var n=_0(t);return function(t,r){return function(i){var o=n(t,i);if(em(o))return ey;var a=o.value,u=a[0],s=a[1],c=r(s);if(c===s)return ev(i);var l=new Map(i);return l.set(u,c),ev(l)}}};function _0(t){return function(n,r){if(void 0===r){var i=_0(t);return function(t){return i(n,t)}}for(var o,a=r.entries();!(o=a.next()).done;){var u=o.value,s=u[0],c=u[1];if(t.equals(s,n))return ev([s,c])}return ey}}function _1(t){var n=_0(t);return function(r,i){if(void 0===i){var o=_1(t);return function(t){return o(r,t)}}return Z(n(r,i),d6(function(t){return t[0],t[1]}))}}function _2(t,n){var r=_0(t);return function(i,o){if(void 0===o){var a=_2(t,n);return function(t){return a(t,i)}}for(var u,s=i.entries();!(u=s.next()).done;){var c=u.value,l=c[0],f=c[1],d=r(l,o);if(em(d)||!t.equals(l,d.value[0])||!n.equals(f,d.value[1]))return!1}return!0}}var _3=new Map;function _4(t,n){var r=_2(t,n);return Q(function(t,n){return r(t,n)&&r(n,t)})}var _5=function(t,n){return new Map([[t,n]])},_6=function(t,n){for(var r,i=new Map,o=t.entries();!(r=o.next()).done;){var a=r.value,u=a[0],s=a[1];i.set(u,n(u,s))}return i},_9=function(t){return function(n){for(var r,i=new Map,o=new Map,a=n.entries();!(r=a.next()).done;){var u=r.value,s=u[0],c=t(s,u[1]);eb(c)?i.set(s,c.left):o.set(s,c.right)}return eE(i,o)}};function _8(t){return function(n){for(var r,i=new Map,o=new Map,a=n.entries();!(r=a.next()).done;){var u=r.value,s=u[0],c=u[1];t(s,c)?o.set(s,c):i.set(s,c)}return eE(i,o)}}var _7=function(t){return function(n){for(var r,i=new Map,o=n.entries();!(r=o.next()).done;){var a=r.value,u=a[0],s=t(u,a[1]);eg(s)&&i.set(u,s.value)}return i}};function Se(t){return function(n){for(var r,i=new Map,o=n.entries();!(r=o.next()).done;){var a=r.value,u=a[0],s=a[1];t(u,s)&&i.set(u,s)}return i}}var St=function(t,n){return _6(t,function(t,r){return n(r)})},Sn=function(t,n){return Sa(t,function(t,r){return n(r)})},Sr=function(t,n){return Su(t,function(t,r){return n(r)})},Si=function(t,n){return Ss(t,function(t,r){return n(r)})},So=function(t,n){return Sc(t,function(t,r){return n(r)})},Sa=function(t,n){return Z(t,Se(n))},Su=function(t,n){return Z(t,_7(n))},Ss=function(t,n){return Z(t,_8(n))},Sc=function(t,n){return Z(t,_9(n))},Sl=function(t){for(var n,r=new Map,i=t.entries();!(n=i.next()).done;){var o=n.value,a=o[0],u=o[1];eg(u)&&r.set(a,u.value)}return r},Sf=function(t){return function(n){return Sn(n,t)}},Sd=function(t){return function(n){return Sr(n,t)}},Sp=function(t){return function(n){return St(n,t)}},Sh=function(t){return function(n){return _6(n,t)}},Sm=function(t){return function(n){return Si(n,t)}},Sg=function(t){return function(n){return So(n,t)}},Sy=function(t){for(var n,r=new Map,i=new Map,o=t.entries();!(n=o.next()).done;){var a=n.value,u=a[0],s=a[1];eb(s)?r.set(u,s.left):i.set(u,s.right)}return eE(r,i)},Sv="ReadonlyMap",Sb=function(t,n){var r=SF(t,n);return{concat:function(t,n){return r(n)(t)}}},Sx=function(t,n){return{concat:Sb(t,n).concat,empty:_3}},S_=function(t,n){var r=SD(t,n);return{concat:function(t,n){return r(n)(t)}}},SS=function(t){return function(){var n=SW(t);return{concat:function(t,r){return n(r)(t)}}}},ST={URI:Sv,map:St},Sw=el(ST),SO=function(){return{URI:Sv,_E:void 0,map:St,mapWithIndex:_6}},Sk={URI:Sv,compact:Sl,separate:Sy},SI=function(t){var n=SE(t);return function(t,r){return n(t,function(t,n,i){return r(n,i)})}},SM=function(t){var n=SA(t);return function(t){var r=n(t);return function(t){return r(function(n,r){return t(r)})}}},SC=function(t){var n=Sj(t);return function(t,r){return n(t,function(t,n,i){return r(n,i)})}},SR=function(t){var n=SI(t),r=SM(t),i=SC(t);return{URI:Sv,_E:void 0,reduce:function(t,r,i){return Z(t,n(r,i))},foldMap:function(t){var n=r(t);return function(t,r){return Z(t,n(r))}},reduceRight:function(t,n,r){return Z(t,i(n,r))}}},SE=function(t){var n=_K(t);return function(t,r){return function(i){for(var o=t,a=0,u=n(i);a<u.length;a++){var s=u[a];o=r(s,o,i.get(s))}return o}}},SA=function(t){var n=_K(t);return function(t){return function(r){return function(i){for(var o=t.empty,a=0,u=n(i);a<u.length;a++){var s=u[a];o=t.concat(o,r(s,i.get(s)))}return o}}}},Sj=function(t){var n=_K(t);return function(t,r){return function(i){for(var o=t,a=n(i),u=a.length,s=u-1;s>=0;s--){var c=a[s];o=r(c,i.get(c),o)}return o}}},SN=function(t){var n=SR(t),r=SE(t),i=SA(t),o=Sj(t);return{URI:Sv,_E:void 0,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,reduceWithIndex:function(t,n,i){return Z(t,r(n,i))},foldMapWithIndex:function(t){var n=i(t);return function(t,r){return Z(t,n(r))}},reduceRightWithIndex:function(t,n,r){return Z(t,o(n,r))}}},SP=function(t){var n=SL(t),r=SR(t);return{URI:Sv,_E:void 0,map:St,reduce:r.reduce,foldMap:r.foldMap,reduceRight:r.reduceRight,traverse:n.traverse,sequence:n.sequence}},SL=function(t){var n=SN(t),r=_K(t),i=function(t){return function(n,i){for(var o=t.of(new Map),a=r(n),u=a.length,s=0;s<u;s++)!function(r){var u=a[r],s=n.get(u);o=t.ap(t.map(o,function(t){return function(n){return t.set(u,n)}}),i(u,s))}(s);return o}},o=function(t){var n=i(t);return function(t,r){return n(t,function(t,n){return r(n)})}},a=function(t){var n=i(t);return function(t){return n(t,G)}};return{URI:Sv,_E:void 0,map:St,mapWithIndex:_6,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,reduceWithIndex:n.reduceWithIndex,foldMapWithIndex:n.foldMapWithIndex,reduceRightWithIndex:n.reduceRightWithIndex,traverse:o,sequence:a,traverseWithIndex:i}},SF=function(t,n){var r=_1(t);return function(t){return function(i){if(_q(i))return t;if(_q(t))return i;for(var o,a=new Map,u=i.entries();!(o=u.next()).done;){var s=o.value,c=s[0],l=s[1],f=r(c)(t);eg(f)?a.set(c,n.concat(l,f.value)):a.set(c,l)}for(var d=t.entries();!(o=d.next()).done;){var p=o.value,c=p[0],l=p[1],f=r(c)(a);em(f)&&a.set(c,l)}return a}}},SD=function(t,n){var r=_1(t);return function(t){return function(i){if(_q(i)||_q(t))return _3;for(var o,a=new Map,u=i.entries();!(o=u.next()).done;){var s=o.value,c=s[0],l=s[1],f=r(c)(t);eg(f)&&a.set(c,n.concat(l,f.value))}return a}}},SW=function(t){var n=_V(t);return function(t){return function(r){if(_q(r))return t;if(_q(t))return r;for(var i,o=new Map,a=r.entries();!(i=a.next()).done;){var u=i.value,s=u[0],c=u[1];n(s)(t)||o.set(s,c)}for(var l=t.entries();!(i=l.next()).done;){var f=i.value,s=f[0],c=f[1];n(s)(r)||o.set(s,c)}return o}}};let SU=Object.freeze(Object.defineProperty({__proto__:null,Compactable:Sk,Filterable:{URI:Sv,map:St,compact:Sl,separate:Sy,filter:Sn,filterMap:Sr,partition:Si,partitionMap:So},Functor:ST,URI:Sv,collect:_Z,compact:Sl,deleteAt:_Y,difference:SW,elem:_$,empty:_3,filter:Sf,filterMap:Sd,filterMapWithIndex:_7,filterWithIndex:Se,flap:Sw,foldMap:SM,foldMapWithIndex:SA,fromFoldable:function(t,n,r){return function(i){var o=_0(t);return r.reduce(i,new Map,function(t,r){var i=r[0],a=r[1],u=o(i,t);return eg(u)?t.set(u.value[0],n.concat(u.value[1],a)):t.set(i,a),t})}},fromMap:_U,getDifferenceMagma:SS,getEq:_4,getFilterableWithIndex:function(){return{URI:Sv,_E:void 0,map:St,mapWithIndex:_6,compact:Sl,separate:Sy,filter:Sn,filterMap:Sr,partition:Si,partitionMap:So,partitionMapWithIndex:Sc,partitionWithIndex:Ss,filterMapWithIndex:Su,filterWithIndex:Sa}},getFoldable:SR,getFoldableWithIndex:SN,getFunctorWithIndex:SO,getIntersectionSemigroup:S_,getMonoid:function(t,n){var r=_0(t);return{concat:function(t,i){if(_q(t))return i;if(_q(i))return t;for(var o,a=new Map(t),u=i.entries();!(o=u.next()).done;){var s=o.value,c=s[0],l=s[1],f=r(c,t);eg(f)?a.set(f.value[0],n.concat(f.value[1],l)):a.set(c,l)}return a},empty:_3}},getShow:_z,getTraversable:SP,getTraversableWithIndex:SL,getUnionMonoid:Sx,getUnionSemigroup:Sb,getWitherable:function(t){var n=SL(t);return{URI:Sv,_E:void 0,map:St,compact:Sl,separate:Sy,filter:Sn,filterMap:Sr,partition:Si,partitionMap:So,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,traverse:n.traverse,sequence:n.sequence,mapWithIndex:_6,reduceWithIndex:n.reduceWithIndex,foldMapWithIndex:n.foldMapWithIndex,reduceRightWithIndex:n.reduceRightWithIndex,traverseWithIndex:n.traverseWithIndex,wilt:rk(n,Sk),wither:rI(n,Sk)}},insertAt:_J,intersection:SD,isEmpty:_q,isSubmap:_2,keys:_K,lookup:_1,lookupWithKey:_0,map:Sp,mapWithIndex:Sh,member:_V,modifyAt:_X,partition:Sm,partitionMap:Sg,partitionMapWithIndex:_9,partitionWithIndex:_8,pop:function(t){var n=_1(t),r=_Y(t);return function(t){var i=r(t);return function(r){return Z(n(t,r),d6(function(t){return[t,i(r)]}))}}},readonlyMap:{URI:Sv,map:St,compact:Sl,separate:Sy,filter:Sn,filterMap:Sr,partition:Si,partitionMap:So},reduce:SI,reduceRight:SC,reduceRightWithIndex:Sj,reduceWithIndex:SE,separate:Sy,singleton:_5,size:_B,toMap:function(t){return new Map(t)},toReadonlyArray:_G,toUnfoldable:function(t,n){var r=_G(t);return function(t){var i=r(t),o=i.length;return n.unfold(0,function(t){return t<o?ev([i[t],t+1]):ey})}},union:SF,updateAt:_Q,upsertAt:_J,values:_H},Symbol.toStringTag,{value:"Module"}));var Sz=globalThis&&globalThis.__assign||function(){return(Sz=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t}).apply(this,arguments)},SB=function(t){return function(n){return Array.from(n.keys()).sort(t.compare)}},Sq=function(t){return function(n){return Array.from(n.values()).sort(t.compare)}};function SV(t){var n=SB(t);return function(t){return function(r){for(var i=[],o=n(r),a=0;a<o.length;a++){var u=o[a];i.push(t(u,r.get(u)))}return i}}}function S$(t){return SV(t)(function(t,n){return[t,n]})}var SK=function(t){var n=SJ(t);return function(t,r){var i=n(t);return function(n){var o=i(n);if(em(o)){var a=new Map(n);return a.set(t,r),a}if(o.value[1]!==r){var a=new Map(n);return a.set(o.value[0],r),a}return n}}},SH=function(t){var n=SJ(t);return function(t){return function(r){var i=n(t,r);if(eg(i)){var o=new Map(r);return o.delete(i.value[0]),o}return r}}},SZ=function(t){var n=SG(t);return function(t,r){return n(t,function(){return r})}},SG=function(t){var n=SJ(t);return function(t,r){return function(i){var o=n(t,i);if(em(o))return ey;var a=new Map(i);return a.set(o.value[0],r(o.value[1])),ev(a)}}};function SJ(t){return function(n,r){if(void 0===r){var i=SJ(t);return function(t){return i(n,t)}}for(var o,a=r.entries();!(o=a.next()).done;){var u=o.value,s=u[0],c=u[1];if(t.equals(s,n))return ev([s,c])}return ey}}var SY=function(t,n){return new Map([[t,n]])},SQ=function(t,n){for(var r,i=new Map,o=t.entries();!(r=o.next()).done;){var a=r.value,u=a[0],s=a[1];i.set(u,n(u,s))}return i},SX=function(t){return function(n){for(var r,i=new Map,o=new Map,a=n.entries();!(r=a.next()).done;){var u=r.value,s=u[0],c=t(s,u[1]);eb(c)?i.set(s,c.left):o.set(s,c.right)}return eE(i,o)}};function S0(t){return function(n){for(var r,i=new Map,o=new Map,a=n.entries();!(r=a.next()).done;){var u=r.value,s=u[0],c=u[1];t(s,c)?o.set(s,c):i.set(s,c)}return eE(i,o)}}var S1=function(t){return function(n){for(var r,i=new Map,o=n.entries();!(r=o.next()).done;){var a=r.value,u=a[0],s=t(u,a[1]);eg(s)&&i.set(u,s.value)}return i}};function S2(t){return function(n){for(var r,i=new Map,o=n.entries();!(r=o.next()).done;){var a=r.value,u=a[0],s=a[1];t(u,s)&&i.set(u,s)}return i}}var S3=function(t,n){return SQ(t,function(t,r){return n(r)})},S4=function(t,n){return S8(t,function(t,r){return n(r)})},S5=function(t,n){return S7(t,function(t,r){return n(r)})},S6=function(t,n){return Te(t,function(t,r){return n(r)})},S9=function(t,n){return Tt(t,function(t,r){return n(r)})},S8=function(t,n){return Z(t,S2(n))},S7=function(t,n){return Z(t,S1(n))},Te=function(t,n){return Z(t,S0(n))},Tt=function(t,n){return Z(t,SX(n))},Tn=function(t){for(var n,r=new Map,i=t.entries();!(n=i.next()).done;){var o=n.value,a=o[0],u=o[1];eg(u)&&r.set(a,u.value)}return r},Tr=function(t){return function(n){return S4(n,t)}},Ti=function(t){return function(n){return S5(n,t)}},To=function(t){return function(n){return S3(n,t)}},Ta=function(t){return function(n){return SQ(n,t)}},Tu=function(t){return function(n){return S6(n,t)}},Ts=function(t){return function(n){return S9(n,t)}},Tc=function(t){for(var n,r=new Map,i=new Map,o=t.entries();!(n=o.next()).done;){var a=n.value,u=a[0],s=a[1];eb(s)?r.set(u,s.left):i.set(u,s.right)}return eE(r,i)},Tl=function(t,n){var r=TS(t,n);return{concat:function(t,n){return r(n)(t)}}},Tf=function(t,n){return{concat:Tl(t,n).concat,empty:new Map}},Td=function(t,n){var r=TT(t,n);return{concat:function(t,n){return r(n)(t)}}},Tp=function(t){return function(){var n=Tw(t);return{concat:function(t,r){return n(r)(t)}}}},Th=function(t){return Sz(Sz({},SR(t)),{URI:"Map"})},Tm=function(t){return Sz(Sz({},SN(t)),{URI:"Map"})},Tg=function(t){var n=Tm(t),r=SB(t),i=function(t){return function(n,i){for(var o=t.of(new Map),a=r(n),u=a.length,s=0;s<u;s++)!function(r){var u=a[r],s=n.get(u);o=t.ap(t.map(o,function(t){return function(n){return t.set(u,n)}}),i(u,s))}(s);return o}},o=function(t){var n=i(t);return function(t,r){return n(t,function(t,n){return r(n)})}},a=function(t){var n=i(t);return function(t){return n(t,function(t,n){return n})}};return{URI:"Map",_E:void 0,map:S3,mapWithIndex:SQ,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,reduceWithIndex:n.reduceWithIndex,foldMapWithIndex:n.foldMapWithIndex,reduceRightWithIndex:n.reduceRightWithIndex,traverse:o,sequence:a,traverseWithIndex:i}},Ty={URI:"Map",map:S3},Tv=el(Ty),Tb={URI:"Map",compact:Tn,separate:Tc},Tx={URI:"Map",map:S3,compact:Tn,separate:Tc,filter:S4,filterMap:S5,partition:S6,partitionMap:S9},T_=function(t){return new Map(t)},TS=function(t,n){var r=SF(t,n);return function(t){return function(n){return _q(n)?T_(t):_q(t)?T_(n):r(t)(n)}}},TT=function(t,n){var r=SD(t,n);return function(t){return function(n){return _q(n)||_q(t)?new Map:r(t)(n)}}},Tw=function(t){var n=SW(t);return function(t){return function(r){return _q(r)?T_(t):_q(t)?T_(r):n(t)(r)}}},TO=new Map;let Tk=Object.freeze(Object.defineProperty({__proto__:null,Compactable:Tb,Filterable:Tx,Functor:Ty,URI:"Map",collect:SV,compact:Tn,deleteAt:SH,difference:Tw,elem:_$,empty:TO,filter:Tr,filterMap:Ti,filterMapWithIndex:S1,filterWithIndex:S2,flap:Tv,foldMap:SM,foldMapWithIndex:SA,fromFoldable:function(t,n,r){return function(i){var o=SJ(t);return r.reduce(i,new Map,function(t,r){var i=r[0],a=r[1],u=o(i,t);return eg(u)?t.set(u.value[0],n.concat(u.value[1],a)):t.set(i,a),t})}},getDifferenceMagma:Tp,getEq:_4,getFilterableWithIndex:function(){return{URI:"Map",_E:void 0,map:S3,mapWithIndex:SQ,compact:Tn,separate:Tc,filter:S4,filterMap:S5,partition:S6,partitionMap:S9,partitionMapWithIndex:Tt,partitionWithIndex:Te,filterMapWithIndex:S7,filterWithIndex:S8}},getFoldable:Th,getFoldableWithIndex:Tm,getIntersectionSemigroup:Td,getMonoid:function(t,n){var r=SJ(t);return{concat:function(t,i){if(_q(t))return i;if(_q(i))return t;for(var o,a=new Map(t),u=i.entries();!(o=u.next()).done;){var s=o.value,c=s[0],l=s[1],f=r(c,t);eg(f)?a.set(f.value[0],n.concat(f.value[1],l)):a.set(c,l)}return a},empty:new Map}},getShow:_z,getTraversableWithIndex:Tg,getUnionMonoid:Tf,getUnionSemigroup:Tl,getWitherable:function(t){var n=Tg(t);return{URI:"Map",_E:void 0,map:S3,compact:Tn,separate:Tc,filter:S4,filterMap:S5,partition:S6,partitionMap:S9,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,traverse:n.traverse,sequence:n.sequence,mapWithIndex:SQ,reduceWithIndex:n.reduceWithIndex,foldMapWithIndex:n.foldMapWithIndex,reduceRightWithIndex:n.reduceRightWithIndex,traverseWithIndex:n.traverseWithIndex,wilt:rk(n,Tb),wither:rI(n,Tb)}},insertAt:SK,intersection:TT,isEmpty:_q,isSubmap:_2,keys:SB,lookup:_1,lookupWithKey:SJ,map:To,mapWithIndex:Ta,map_:Tx,member:_V,modifyAt:SG,partition:Tu,partitionMap:Ts,partitionMapWithIndex:SX,partitionWithIndex:S0,pop:function(t){var n=_1(t),r=SH(t);return function(t){var i=r(t);return function(r){return Z(n(t,r),d6(function(t){return[t,i(r)]}))}}},reduce:SI,reduceRight:SC,reduceRightWithIndex:Sj,reduceWithIndex:SE,separate:Tc,singleton:SY,size:_B,toArray:S$,toUnfoldable:function(t,n){var r=S$(t);return function(t){var i=r(t),o=i.length;return n.unfold(0,function(t){return t<o?ev([i[t],t+1]):ey})}},union:TS,updateAt:SZ,upsertAt:SK,values:Sq},Symbol.toStringTag,{value:"Module"})),TI=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),TM=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),TC=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),TR=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),TE=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var TA=function(t){return{concat:tb(t).concat,empty:t.top}},Tj=function(t){return{concat:tx(t).concat,empty:t.bottom}},TN=function(t){return{concat:tp(t).concat,empty:t.empty}},TP=function(t){var n={};for(var r in t)eC.call(t,r)&&(n[r]=t[r].empty);return{concat:tS(t).concat,empty:n}},TL=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return{concat:tT.apply(tN,t).concat,empty:t.map(function(t){return t.empty})}},TF=function(t){return ty(t)(t.empty)},TD={concat:tI.concat,empty:void 0},TW={concat:tC.concat,empty:!0},TU={concat:tR.concat,empty:!1},Tz=function(){return TN(gu())},TB={concat:tE.concat,empty:""},Tq={concat:tA.concat,empty:0},TV={concat:tj.concat,empty:1};let T$=Object.freeze(Object.defineProperty({__proto__:null,concatAll:TF,fold:TF,getDualMonoid:TN,getEndomorphismMonoid:Tz,getFunctionMonoid:j,getJoinMonoid:Tj,getMeetMonoid:TA,getStructMonoid:TP,getTupleMonoid:TL,max:Tj,min:TA,monoidAll:TW,monoidAny:TU,monoidProduct:TV,monoidString:TB,monoidSum:Tq,monoidVoid:TD,reverse:TN,struct:TP,tuple:TL},Symbol.toStringTag,{value:"Module"})),TK=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var TH=function(t,n,r){return function(i){return -1===i?t():0===i?n():r()}},TZ=function(t){return -1===t?1:1===t?-1:0},TG={equals:function(t,n){return t===n}},TJ={concat:function(t,n){return 0!==t?t:n}},TY={concat:TJ.concat,empty:0},TQ=function(t){return t<=-1?-1:t>=1?1:0};let TX=Object.freeze(Object.defineProperty({__proto__:null,Eq:TG,Monoid:TY,Semigroup:TJ,eqOrdering:TG,invert:TZ,match:TH,matchW:TH,monoidOrdering:TY,reverse:TZ,semigroupOrdering:TJ,sign:TQ},Symbol.toStringTag,{value:"Module"})),T0=Object.freeze(Object.defineProperty({__proto__:null,pipe:Z,pipeable:function(t){var n,r,i,o,a,u,s,c,l,f,d,p,h,m,g,y={};if("function"==typeof t.map){var v=function(n){return function(r){return t.map(r,n)}};y.map=v}if("function"==typeof t.contramap){var b=function(n){return function(r){return t.contramap(r,n)}};y.contramap=b}if("function"==typeof t.mapWithIndex){var x=function(n){return function(r){return t.mapWithIndex(r,n)}};y.mapWithIndex=x}if("function"==typeof t.ap){var _=function(n){return function(r){return t.ap(r,n)}},S=function(n){return function(r){return t.ap(t.map(r,function(t){return function(){return t}}),n)}};y.ap=_,y.apFirst=S,y.apSecond=function(n){return function(r){return t.ap(t.map(r,function(){return function(t){return t}}),n)}}}if("function"==typeof t.chain){var T=function(n){return function(r){return t.chain(r,n)}},w=function(n){return function(r){return t.chain(r,function(r){return t.map(n(r),function(){return r})})}},O=function(n){return t.chain(n,F)};y.chain=T,y.chainFirst=w,y.flatten=O}if("function"==typeof t.bimap){var k=function(n,r){return function(i){return t.bimap(i,n,r)}},I=function(n){return function(r){return t.mapLeft(r,n)}};y.bimap=k,y.mapLeft=I}if("function"==typeof t.extend){var M=function(n){return function(r){return t.extend(r,n)}},C=function(n){return t.extend(n,F)};y.extend=M,y.duplicate=C}if("function"==typeof t.reduce){var R=function(n,r){return function(i){return t.reduce(i,n,r)}},E=function(n){var r=t.foldMap(n);return function(t){return function(n){return r(n,t)}}},A=function(n,r){return function(i){return t.reduceRight(i,n,r)}};y.reduce=R,y.foldMap=E,y.reduceRight=A}if("function"==typeof t.reduceWithIndex){var j=function(n,r){return function(i){return t.reduceWithIndex(i,n,r)}},N=function(n){var r=t.foldMapWithIndex(n);return function(t){return function(n){return r(n,t)}}},P=function(n,r){return function(i){return t.reduceRightWithIndex(i,n,r)}};y.reduceWithIndex=j,y.foldMapWithIndex=N,y.reduceRightWithIndex=P}if("function"==typeof t.alt){var L=function(n){return function(r){return t.alt(r,n)}};y.alt=L}if("function"==typeof t.compact&&(y.compact=t.compact,y.separate=t.separate),"function"==typeof t.filter){var D=function(n){return function(r){return t.filter(r,n)}},W=function(n){return function(r){return t.filterMap(r,n)}},U=function(n){return function(r){return t.partition(r,n)}},z=function(n){return function(r){return t.partitionMap(r,n)}};y.filter=D,y.filterMap=W,y.partition=U,y.partitionMap=z}if("function"==typeof t.filterWithIndex){var B=function(n){return function(r){return t.filterWithIndex(r,n)}},q=function(n){return function(r){return t.filterMapWithIndex(r,n)}},V=function(n){return function(r){return t.partitionWithIndex(r,n)}},$=function(n){return function(r){return t.partitionMapWithIndex(r,n)}};y.filterWithIndex=B,y.filterMapWithIndex=q,y.partitionWithIndex=V,y.partitionMapWithIndex=$}if("function"==typeof t.promap){var K=function(n,r){return function(i){return t.promap(i,n,r)}};y.promap=K}if("function"==typeof t.compose){var H=function(n){return function(r){return t.compose(r,n)}};y.compose=H}if("function"==typeof t.throwError){var Z=function(n){return function(r){return"None"===r._tag?t.throwError(n()):t.of(r.value)}},G=function(n){return"Left"===n._tag?t.throwError(n.left):t.of(n.right)},J=function(n,r){return function(i){return n(i)?t.of(i):t.throwError(r(i))}},Y=function(n,r){return function(i){return t.chain(i,function(i){return n(i)?t.of(i):t.throwError(r(i))})}};y.fromOption=Z,y.fromEither=G,y.fromPredicate=J,y.filterOrElse=Y}return y}},Symbol.toStringTag,{value:"Module"})),T1=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),T2=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var T3=function(){return Math.random()};function T4(t,n){return Z(T3,v$(function(r){return Math.floor((n-t+1)*r+t)}))}var T5=Z(T3,v$(function(t){return t<.5})),T6=function(t){return Z(T4(0,t.length-1),v$(function(n){return t[n]}))};let T9=Object.freeze(Object.defineProperty({__proto__:null,random:T3,randomBool:T5,randomElem:T6,randomInt:T4,randomRange:function(t,n){return Z(T3,v$(function(r){return(n-t)*r+t}))}},Symbol.toStringTag,{value:"Module"}));var T8=mZ(g2),T7=mH(g2),we=mG(g0),wt=mJ(g0),wn=m9(g0),wr=m8(g8),wi=m7(g8),wo=gi(g0),wa=ge(g8),wu=gt(g8),ws=gn(g8),wc=gr(g0),wl=function(t,n){return Z(t,wg(n))},wf=function(t,n,r){return Z(t,wy(n,r))},wd=function(t,n){return Z(t,wv(n))},wp=function(t,n){return Z(t,wb(n))},wh=function(t,n){return Z(t,wx(n))},wm=function(t,n){return Z(t,wS(n))},wg=m0(g0),wy=m4(g0),wv=m5(g0),wb=m1(g3),wx=m2(g8),w_=wx(F),wS=m3(g8),wT="ReaderEither",ww=function(t){var n=h$(t);return{URI:wT,_E:void 0,compact:hn(g0,n),separate:hr(g0,n,hY)}};function wO(t){var n=eq(g3,hZ(t));return{URI:wT,_E:void 0,map:wl,ap:function(t,r){return Z(t,n(r))},of:T7}}function wk(t){var n=m6(g8,t);return{URI:wT,_E:void 0,map:wl,alt:function(t,r){return Z(t,n(r))}}}var wI={URI:wT,map:wl},wM=el(wI),wC={URI:wT,map:wl,ap:wp},wR=eV(wC),wE=e$(wC),wA={URI:wT,map:wl,ap:wp,of:T7},wj={URI:wT,map:wl,ap:wp,chain:wh},wN=eX(wj),wP={URI:wT,fromReader:we},wL=yd(wP),wF=yp(wP),wD=yh(wP),wW=ym(wP,wj),wU=yg(wP,wj),wz={URI:wT,fromEither:D},wB=oB(wz),wq=oV(wz),wV=o$(wz,wj),w$=oH(wz,wj),wK=oZ(wz,wj),wH=oq(wz),wZ=oG(wz,wj),wG=oK(wz),wJ=T7(eM),wY=ef(wI),wQ=e0(wj),wX=eK(wC),w0=T7(eI),w1=function(t){return q(yo(t),gU(mF(G)))},w2=function(t){var n=w1(t);return function(t){return ew(t)?n(t):w0}},w3=function(t){return w2(function(n,r){return t(r)})},w4=w3(F),w5=eH(wC),w6=oW(wA),w9=function(t){return eH(g3)(hV(t))};let w8=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:wT,map:wl,alt:wm},ApT:w0,Applicative:wA,Apply:wC,Bifunctor:{URI:wT,bimap:wf,mapLeft:wd},Chain:wj,Do:wJ,FromEither:wz,FromReader:wP,Functor:wI,Monad:{URI:wT,map:wl,ap:wp,of:T7,chain:wh},MonadThrow:{URI:wT,map:wl,ap:wp,of:T7,chain:wh,throwError:T8},Pointed:{URI:wT,of:T7},URI:wT,alt:wS,altW:wS,ap:wb,apFirst:wR,apFirstW:wR,apS:wX,apSW:wX,apSecond:wE,apSecondW:wE,apW:wb,ask:wL,asks:wF,asksReaderEither:gN,asksReaderEitherW:gN,bimap:wy,bind:wQ,bindTo:wY,bindW:wQ,chain:wx,chainEitherK:w$,chainEitherKW:w$,chainFirst:wN,chainFirstEitherK:wK,chainFirstEitherKW:wK,chainFirstReaderK:wU,chainFirstReaderKW:wU,chainFirstW:wN,chainOptionK:wV,chainReaderK:wW,chainReaderKW:wW,chainW:wx,filterOrElse:wZ,filterOrElseW:wZ,flap:wM,flatten:w_,flattenW:w_,fold:wr,foldW:wr,fromEither:D,fromEitherK:wG,fromOption:wB,fromOptionK:wq,fromPredicate:wH,fromReader:we,fromReaderK:wD,getAltReaderValidation:wk,getApplicativeReaderValidation:wO,getApplyMonoid:w6,getApplySemigroup:w5,getCompactable:ww,getFilterable:function(t){var n=hK(t),r=ww(t),i=gd(g0,n),o=gp(g0,n),a=gh(g0,n),u=gm(g0,n);return{URI:wT,_E:void 0,map:wl,compact:r.compact,separate:r.separate,filter:function(t,n){return Z(t,i(n))},filterMap:function(t,n){return Z(t,o(n))},partition:function(t,n){return Z(t,a(n))},partitionMap:function(t,n){return Z(t,u(n))}}},getOrElse:wi,getOrElseW:wi,getReaderValidation:function(t){var n=wO(t),r=wk(t);return{URI:wT,_E:void 0,map:wl,ap:n.ap,of:T7,chain:wh,bimap:wf,mapLeft:wd,alt:r.alt,throwError:T8}},getSemigroup:w9,left:T8,leftReader:wt,local:gj,map:wg,mapLeft:wv,match:wn,matchE:wr,matchEW:wr,matchW:wn,of:T7,orElse:wa,orElseFirst:wu,orElseFirstW:wu,orElseW:wa,orLeft:ws,readerEither:{URI:wT,bimap:wf,mapLeft:wd,map:wl,of:T7,ap:wp,chain:wh,alt:wm,throwError:T8},right:T7,rightReader:we,sequenceArray:w4,swap:wc,throwError:T8,toUnion:wo,traverseArray:w3,traverseArrayWithIndex:w2,traverseReadonlyArrayWithIndex:w2,traverseReadonlyNonEmptyArrayWithIndex:w1},Symbol.toStringTag,{value:"Module"}));function w7(t){return function(n){return function(){return t.of(n)}}}function Oe(t){return function(n){return function(r){return function(i){return t.map(r(i),n)}}}}function Ot(t){return function(n){return function(r){return function(i){return t.ap(r(i),n(i))}}}}function On(t){return function(n){return function(r){return function(i){return t.chain(r(i),function(t){return n(t)(i)})}}}}function Or(t){return function(n){return q(n,t.of)}}let Oi=Object.freeze(Object.defineProperty({__proto__:null,ap:Ot,chain:On,fromNaturalTransformation:function(t){return function(n){return q(n,t)}},fromReader:Or,getReaderM:function(t){var n=Ot(t),r=Oe(t),i=On(t);return{map:function(t,n){return Z(t,r(n))},ap:function(t,r){return Z(t,n(r))},of:w7(t),chain:function(t,n){return Z(t,i(n))},ask:function(){return t.of},asks:function(n){return q(n,t.of)},local:function(t,n){return function(r){return t(n(r))}},fromReader:Or(t),fromM:function(t){return function(){return t}}}},map:Oe,of:w7},Symbol.toStringTag,{value:"Module"}));var Oo=function(t){return function(){return Promise.resolve().then(t)}},Oa=function(t,n){return Z(t,Ol(n))},Ou=function(t,n){return Z(t,Of(n))},Os=function(t,n){return Z(t,Op(function(t){return Z(n,Ol(t))}))},Oc=function(t,n){return Z(t,Op(n))},Ol=function(t){return function(n){return function(){return Promise.resolve().then(n).then(t)}}},Of=function(t){return function(n){return function(){return Promise.all([Promise.resolve().then(n),Promise.resolve().then(t)]).then(function(t){var n;return(0,t[0])(t[1])})}}},Od=function(t){return function(){return Promise.resolve(t)}},Op=function(t){return function(n){return function(){return Promise.resolve().then(n).then(function(n){return t(n)()})}}},Oh=Op(F),Om="Task",Og={URI:Om,map:Oa},Oy=el(Og),Ov={URI:Om,of:Od},Ob={URI:Om,map:Oa,ap:Ou},Ox=eV(Ob),O_=e$(Ob),OS={URI:Om,map:Oa,ap:Ou,of:Od},OT={URI:Om,map:Oa,ap:Os},Ow={URI:Om,map:Oa,ap:Os,of:Od},OO={URI:Om,map:Oa,ap:Ou,chain:Oc},Ok={URI:Om,map:Oa,of:Od,ap:Ou,chain:Oc},OI=eX(OO),OM={URI:Om,fromIO:Oo},OC=gM(OM),OR=gC(OM,OO),OE=gR(OM,OO),OA=function(){return new Promise(function(t){})},Oj=Od(eM),ON=ef(Og),OP=e0(OO),OL=eK(Ob),OF=Od(eI),OD=function(t){return function(n){return function(){return Promise.all(n.map(function(n,r){return Promise.resolve().then(function(){return t(r,n)()})}))}}},OW=function(t){var n=OD(t);return function(t){return ew(t)?n(t):OF}},OU=function(t){return function(n){return function(){return ek(n).reduce(function(n,r,i){return n.then(function(n){return Promise.resolve().then(t(i+1,r)).then(function(t){return n.push(t),n})})},Promise.resolve().then(t(0,eO(n))).then(eT))}}},Oz=function(t){var n=OU(t);return function(t){return ew(t)?n(t):OF}},OB=function(t){return OW(function(n,r){return t(r)})},Oq=OB(F),OV=function(t){return Oz(function(n,r){return t(r)})},O$=OV(F),OK=eH(OT),OH=oW(Ow);let OZ=Object.freeze(Object.defineProperty({__proto__:null,ApT:OF,ApplicativePar:OS,ApplicativeSeq:Ow,ApplyPar:Ob,ApplySeq:OT,Chain:OO,Do:Oj,FromIO:OM,FromTask:{URI:Om,fromIO:Oo,fromTask:F},Functor:Og,Monad:Ok,MonadIO:{URI:Om,map:Oa,of:Od,ap:Ou,chain:Oc,fromIO:Oo},MonadTask:{URI:Om,map:Oa,of:Od,ap:Ou,chain:Oc,fromIO:Oo,fromTask:F},Pointed:Ov,URI:Om,ap:Of,apFirst:Ox,apS:OL,apSecond:O_,bind:OP,bindTo:ON,chain:Op,chainFirst:OI,chainFirstIOK:OE,chainIOK:OR,delay:function(t){return function(n){return function(){return new Promise(function(r){setTimeout(function(){Promise.resolve().then(n).then(r)},t)})}}},flap:Oy,flatten:Oh,fromIO:Oo,fromIOK:OC,fromTask:F,getMonoid:OH,getRaceMonoid:function(){return{concat:function(t,n){return function(){return Promise.race([Promise.resolve().then(t),Promise.resolve().then(n)])}},empty:OA}},getSemigroup:OK,map:Ol,never:OA,of:Od,sequenceArray:Oq,sequenceSeqArray:O$,task:{URI:Om,map:Oa,of:Od,ap:Ou,chain:Oc,fromIO:Oo,fromTask:F},taskSeq:{URI:Om,map:Oa,of:Od,ap:Os,chain:Oc,fromIO:Oo,fromTask:F},traverseArray:OB,traverseArrayWithIndex:OW,traverseReadonlyArrayWithIndex:OW,traverseReadonlyArrayWithIndexSeq:Oz,traverseReadonlyNonEmptyArrayWithIndex:OD,traverseReadonlyNonEmptyArrayWithIndexSeq:OU,traverseSeqArray:OV,traverseSeqArrayWithIndex:Oz},Symbol.toStringTag,{value:"Module"}));var OG=Or(Ov),OJ=q(Oo,D),OY=function(t,n){return Z(t,O1(n))},OQ=function(t,n){return Z(t,O2(n))},OX=function(t,n){return Z(t,O4(function(t){return Z(n,O1(t))}))},O0=function(t,n){return Z(t,O4(n))},O1=Oe(Og),O2=Ot(Ob),O3=w7(Ov),O4=On(Ok),O5=O4(F),O6="ReaderTask",O9={URI:O6,map:OY},O8=el(O9),O7={URI:O6,of:O3},ke={URI:O6,map:OY,ap:OQ},kt=eV(ke),kn=e$(ke),kr={URI:O6,map:OY,ap:OX},ki={URI:O6,map:OY,ap:OX,of:O3},ko={URI:O6,map:OY,ap:OQ,chain:O0},ka={URI:O6,map:OY,of:O3,ap:OQ,chain:O0},ku=eX(ko),ks={URI:O6,fromIO:OJ},kc=gM(ks),kl=gC(ks,ko),kf=gR(ks,ko),kd={URI:O6,fromReader:OG},kp=yd(kd),kh=yp(kd),km=yh(kd),kg=ym(kd,ko),ky=yg(kd,ko),kv={URI:O6,fromIO:OJ,fromTask:D},kb=y4(kv),kx=y5(kv,ko),k_=y6(kv,ko),kS=O3(eM),kT=ef(O9),kw=e0(ko),kO=eK(ke),kk=O3(eI),kI=function(t){return q(yo(t),gU(OD(G)))},kM=function(t){var n=kI(t);return function(t){return ew(t)?n(t):kk}},kC=function(t){return q(yo(t),gU(OU(G)))},kR=function(t){var n=kC(t);return function(t){return ew(t)?n(t):kk}},kE=function(t){return kM(function(n,r){return t(r)})},kA=kE(F),kj=function(t){return kR(function(n,r){return t(r)})},kN=kj(F),kP=eH(kr),kL=oW(ki);function kF(t,n){return t(n)()}let kD=Object.freeze(Object.defineProperty({__proto__:null,ApT:kk,ApplicativePar:{URI:O6,map:OY,ap:OQ,of:O3},ApplicativeSeq:ki,ApplyPar:ke,ApplySeq:kr,Chain:ko,Do:kS,FromIO:ks,FromReader:kd,FromTask:kv,Functor:O9,Monad:ka,MonadIO:{URI:O6,map:OY,of:O3,ap:OQ,chain:O0,fromIO:OJ},MonadTask:{URI:O6,map:OY,of:O3,ap:OQ,chain:O0,fromIO:OJ,fromTask:D},Pointed:O7,URI:O6,ap:O2,apFirst:kt,apS:kO,apSW:kO,apSecond:kn,apW:O2,ask:kp,asks:kh,asksReaderTask:gN,asksReaderTaskW:gN,bind:kw,bindTo:kT,bindW:kw,chain:O4,chainFirst:ku,chainFirstIOK:kf,chainFirstReaderK:ky,chainFirstReaderKW:ky,chainFirstTaskK:k_,chainFirstW:ku,chainIOK:kl,chainReaderK:kg,chainReaderKW:kg,chainTaskK:kx,chainW:O4,flap:O8,flatten:O5,flattenW:O5,fromIO:OJ,fromIOK:kc,fromReader:OG,fromReaderK:km,fromTask:D,fromTaskK:kb,getMonoid:kL,getSemigroup:kP,local:gj,map:O1,of:O3,readerTask:{URI:O6,map:OY,of:O3,ap:OQ,chain:O0,fromIO:OJ,fromTask:D},readerTaskSeq:{URI:O6,map:OY,of:O3,ap:OX,chain:O0,fromIO:OJ,fromTask:D},run:kF,sequenceArray:kA,sequenceSeqArray:kN,traverseArray:kE,traverseArrayWithIndex:kM,traverseReadonlyArrayWithIndex:kM,traverseReadonlyArrayWithIndexSeq:kR,traverseReadonlyNonEmptyArrayWithIndex:kI,traverseReadonlyNonEmptyArrayWithIndexSeq:kC,traverseSeqArray:kj,traverseSeqArrayWithIndex:kR},Symbol.toStringTag,{value:"Module"}));var kW=globalThis&&globalThis.__awaiter||function(t,n,r,i){return new(r||(r=Promise))(function(o,a){function u(t){try{c(i.next(t))}catch(n){a(n)}}function s(t){try{c(i.throw(t))}catch(n){a(n)}}function c(t){var n;t.done?o(t.value):((n=t.value)instanceof r?n:new r(function(t){t(n)})).then(u,s)}c((i=i.apply(t,n||[])).next())})},kU=globalThis&&globalThis.__generator||function(t,n){var r,i,o,a,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(r)throw TypeError("Generator is already executing.");for(;u;)try{if(r=1,i&&(o=2&a[0]?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,i=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){u=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){u.label=a[1];break}if(6===a[0]&&u.label<o[1]){u.label=o[1],o=a;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(a);break}o[2]&&u.ops.pop(),u.trys.pop();continue}a=n.call(t,u)}catch(s){a=[6,s],i=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},kz=mZ(Ov),kB=mH(Ov),kq=mG(Og),kV=mJ(Og),k$=q(Oo,kq),kK=q(Oo,kV),kH=function(t){return Ol(mc(t))},kZ=m9(Og),kG=m8(Ok),kJ=m7(Ok),kY=function(t,n){return function(){return kW(void 0,void 0,void 0,function(){var r;return kU(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,t().then(eS)];case 1:return[2,r.sent()];case 2:return[2,e_(n(r.sent()))];case 3:return[2]}})})}},kQ=function(t,n){return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return kY(function(){return t.apply(void 0,r)},n)}},kX=gi(Og),k0=mY(Ov),k1=mQ(Ov),k2=mX(Ok),k3=ge(Ok),k4=gt(Ok),k5=function(t){return k4(Iz(t))},k6=function(t){return k4(I$(t))},k9=gn(Ok),k8=gr(Og),k7=function(t){var n=kH(t);return function(t){return q(t,n)}},Ie=function(t){return function(n){return function(r){return Z(r,Ih(k7(t)(n)))}}},It=function(t){return q(t,Oo)},In=function(t){return Im(It(t))},Ir=function(t,n){return Z(t,Il(n))},Ii=function(t,n){return Z(t,Ip(n))},Io=function(t,n){return Z(t,Ih(function(t){return Z(n,Il(t))}))},Ia=function(t,n){return Z(t,Ih(n))},Iu=function(t,n,r){return Z(t,If(n,r))},Is=function(t,n){return Z(t,Id(n))},Ic=function(t,n){return Z(t,Iy(n))},Il=m0(Og),If=m4(Og),Id=m5(Og),Ip=m1(Ob),Ih=m2(Ok),Im=Ih,Ig=Im(F),Iy=m3(Ok),Iv="TaskEither";function Ib(t,n){var r=eq(t,hZ(n));return{URI:Iv,_E:void 0,map:Ir,ap:function(t,n){return Z(t,r(n))},of:kB}}function Ix(t){var n=m6(Ok,t);return{URI:Iv,_E:void 0,map:Ir,alt:function(t,r){return Z(t,n(r))}}}var I_=function(t){var n=h$(t);return{URI:Iv,_E:void 0,compact:hn(Og,n),separate:hr(Og,n,hY)}},IS={URI:Iv,map:Ir},IT=el(IS),Iw={URI:Iv,map:Ir,ap:Ii},IO=eV(Iw),Ik=e$(Iw),II={URI:Iv,map:Ir,ap:Io},IM={URI:Iv,map:Ir,ap:Io,of:kB},IC={URI:Iv,map:Ir,ap:Ii,chain:Ia},IR=eX(IC),IE={URI:Iv,fromEither:Od},IA=oB(IE),Ij=oV(IE),IN=o$(IE,IC),IP=oH(IE,IC),IL=oZ(IE,IC),IF=oq(IE),ID=oG(IE,IC),IW=oK(IE),IU={URI:Iv,fromIO:k$},Iz=gM(IU),IB=gC(IU,IC),Iq=gR(IU,IC),IV={URI:Iv,fromIO:k$,fromTask:kq},I$=y4(IV),IK=y5(IV,IC),IH=y6(IV,IC),IZ=function(t,n,r){return IG(t,n,r)},IG=function(t,n,r){return Z(t,Im(function(t){return Z(n(t),Op(function(n){return Z(r(t,n),Im(function(){return Od(n)}))}))}))},IJ=kB(eM),IY=ef(IS),IQ=e0(IC),IX=eK(Iw),I0=kB(eI),I1=function(t){return q(OD(t),Ol(mF(G)))},I2=function(t){var n=I1(t);return function(t){return ew(t)?n(t):I0}},I3=function(t){return function(n){return function(){return ek(n).reduce(function(n,r,i){return n.then(function(o){return eb(o)?n:t(i+1,r)().then(function(t){return eb(t)?t:(o.right.push(t.right),o)})})},t(0,eO(n))().then(hJ(eT)))}}},I4=function(t){var n=I3(t);return function(t){return ew(t)?n(t):I0}},I5=function(t){return I2(function(n,r){return t(r)})},I6=I5(F),I9=function(t){return I4(function(n,r){return t(r)})},I8=I9(F),I7=eH(II),Me=oW(IM),Mt=function(t){return eH(OT)(hV(t))};let Mn=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:Iv,map:Ir,alt:Ic},ApT:I0,ApplicativePar:{URI:Iv,map:Ir,ap:Ii,of:kB},ApplicativeSeq:IM,ApplyPar:Iw,ApplySeq:II,Bifunctor:{URI:Iv,bimap:Iu,mapLeft:Is},Chain:IC,Do:IJ,FromEither:IE,FromIO:IU,FromTask:IV,Functor:IS,Monad:{URI:Iv,map:Ir,ap:Ii,chain:Ia,of:kB},MonadIO:{URI:Iv,map:Ir,ap:Ii,chain:Ia,of:kB,fromIO:k$},MonadTask:{URI:Iv,map:Ir,ap:Ii,chain:Ia,of:kB,fromIO:k$,fromTask:kq},MonadThrow:{URI:Iv,map:Ir,ap:Ii,chain:Ia,of:kB,throwError:kz},Pointed:{URI:Iv,of:kB},URI:Iv,alt:Iy,altW:Iy,ap:Ip,apFirst:IO,apFirstW:IO,apS:IX,apSW:IX,apSecond:Ik,apSecondW:Ik,apW:Ip,bimap:If,bind:IQ,bindTo:IY,bindW:IQ,bracket:IZ,bracketW:IG,chain:Ih,chainEitherK:IP,chainEitherKW:IP,chainFirst:IR,chainFirstEitherK:IL,chainFirstEitherKW:IL,chainFirstIOK:Iq,chainFirstTaskK:IH,chainFirstW:IR,chainIOEitherK:In,chainIOEitherKW:In,chainIOK:IB,chainNullableK:k2,chainOptionK:IN,chainTaskK:IK,chainTaskOptionK:Ie,chainTaskOptionKW:Ie,chainW:Im,filterOrElse:ID,filterOrElseW:ID,flap:IT,flatten:Ig,flattenW:Ig,fold:kG,foldW:kG,fromEither:Od,fromEitherK:IW,fromIO:k$,fromIOEither:Oo,fromIOEitherK:It,fromIOK:Iz,fromNullable:k0,fromNullableK:k1,fromOption:IA,fromOptionK:Ij,fromPredicate:IF,fromTask:kq,fromTaskK:I$,fromTaskOption:kH,fromTaskOptionK:k7,getAltTaskValidation:Ix,getApplicativeTaskValidation:Ib,getApplyMonoid:Me,getApplySemigroup:I7,getCompactable:I_,getFilterable:function(t){var n=hK(t),r=I_(t),i=gd(Og,n),o=gp(Og,n),a=gh(Og,n),u=gm(Og,n);return{URI:Iv,_E:void 0,map:Ir,compact:r.compact,separate:r.separate,filter:function(t,n){return Z(t,i(n))},filterMap:function(t,n){return Z(t,o(n))},partition:function(t,n){return Z(t,a(n))},partitionMap:function(t,n){return Z(t,u(n))}}},getOrElse:kJ,getOrElseW:kJ,getSemigroup:Mt,getTaskValidation:function(t){var n=Ib(OS,t),r=Ix(t);return{URI:Iv,_E:void 0,map:Ir,ap:n.ap,of:kB,chain:Ia,bimap:Iu,mapLeft:Is,alt:r.alt,fromIO:k$,fromTask:kq,throwError:kz}},left:kz,leftIO:kK,leftTask:kV,map:Il,mapLeft:Id,match:kZ,matchE:kG,matchEW:kG,matchW:kZ,of:kB,orElse:k3,orElseFirst:k4,orElseFirstIOK:k5,orElseFirstTaskK:k6,orElseFirstW:k4,orElseW:k3,orLeft:k9,right:kB,rightIO:k$,rightTask:kq,sequenceArray:I6,sequenceSeqArray:I8,swap:k8,taskEither:{URI:Iv,bimap:Iu,mapLeft:Is,map:Ir,of:kB,ap:Ii,chain:Ia,alt:Ic,fromIO:k$,fromTask:kq,throwError:kz},taskEitherSeq:{URI:Iv,bimap:Iu,mapLeft:Is,map:Ir,of:kB,ap:Io,chain:Ia,alt:Ic,fromIO:k$,fromTask:kq,throwError:kz},taskify:function(t){return function(){var n=Array.prototype.slice.call(arguments);return function(){return new Promise(function(r){var i=function(t,n){return null!=t?r(e_(t)):r(eS(n))};t.apply(null,n.concat(i))})}}},throwError:kz,toUnion:kX,traverseArray:I5,traverseArrayWithIndex:I2,traverseReadonlyArrayWithIndex:I2,traverseReadonlyArrayWithIndexSeq:I4,traverseReadonlyNonEmptyArrayWithIndex:I1,traverseReadonlyNonEmptyArrayWithIndexSeq:I3,traverseSeqArray:I9,traverseSeqArrayWithIndex:I4,tryCatch:kY,tryCatchK:kQ},Symbol.toStringTag,{value:"Module"}));var Mr=mZ(O7),Mi=mH(O7),Mo=q(kq,D),Ma=q(kV,D),Mu=function(t){return q(t,kB)},Ms=function(t){return q(t,kz)},Mc=mG(O9),Ml=mJ(O9),Mf=q(k$,D),Md=q(kK,D),Mp=q(Oo,D),Mh=function(t){return q(t,Od)},Mm=m9(O9),Mg=m8(ko),My=m7(ka),Mv=gi(O9),Mb=mY(O7),Mx=mQ(O7),M_=mX(ka),MS=ge(ka),MT=gt(ka),Mw=gn(ka),MO=gr(O9),Mk=function(t){return q(t,Mp)},MI=function(t){return MK(Mk(t))},MM=function(t){return q(t,D)},MC=function(t){return MK(MM(t))},MR=function(t){return M7(MM(t))},ME=function(t){return q(t,Mh)},MA=function(t){return MK(ME(t))},Mj=function(t){return M7(ME(t))},MN=function(t,n){return Z(t,Mz(n))},MP=function(t,n){return Z(t,MV(n))},ML=function(t,n){return Z(t,M$(function(t){return Z(n,Mz(t))}))},MF=function(t,n){return Z(t,M$(n))},MD=function(t,n){return Z(t,MZ(n))},MW=function(t,n,r){return Z(t,MB(n,r))},MU=function(t,n){return Z(t,Mq(n))},Mz=m0(O9),MB=m4(O9),Mq=m5(O9),MV=m1(ke),M$=m2(ka),MK=M$,MH=MK(F),MZ=m3(ka),MG="ReaderTaskEither",MJ=function(t){var n=h$(t);return{URI:MG,_E:void 0,compact:hn(O9,n),separate:hr(O9,n,hY)}};function MY(t,n){var r=eq(g3,Ib(t,n));return{URI:MG,_E:void 0,map:MN,ap:function(t,n){return Z(t,r(n))},of:Mi}}function MQ(t){var n=m6(ka,t);return{URI:MG,_E:void 0,map:MN,alt:function(t,r){return Z(t,n(r))}}}var MX={URI:MG,map:MN},M0=el(MX),M1={URI:MG,of:Mi},M2={URI:MG,map:MN,ap:MP},M3=eV(M2),M4=e$(M2),M5={URI:MG,map:MN,ap:ML},M6={URI:MG,map:MN,ap:ML,of:Mi},M9={URI:MG,map:MN,ap:MP,chain:MF},M8=eX(M9),M7=M8,Ce={URI:MG,fromReader:Mu},Ct=yd(Ce),Cn=yp(Ce),Cr=yh(Ce),Ci=ym(Ce,M9),Co=yg(Ce,M9),Ca=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return Mc(t.apply(void 0,n))}},Cu=function(t){return MK(Ca(t))},Cs=function(t){return M7(Ca(t))},Cc={URI:MG,fromEither:O3},Cl=oB(Cc),Cf=oV(Cc),Cd=o$(Cc,M9),Cp=oH(Cc,M9),Ch=oZ(Cc,M9),Cm=oq(Cc),Cg=oG(Cc,M9),Cy=oK(Cc),Cv={URI:MG,fromIO:Mf},Cb=gM(Cv),Cx=gC(Cv,M9),C_=gR(Cv,M9),CS={URI:MG,fromIO:Mf,fromTask:Mo},CT=y4(CS),Cw=y5(CS,M9),CO=y6(CS,M9);function Ck(t,n,r){return CI(t,n,r)}function CI(t,n,r){return function(i){return IG(t(i),function(t){return n(t)(i)},function(t,n){return r(t,n)(i)})}}var CM=Mi(eM),CC=ef(MX),CR=e0(M9),CE=eK(M2),CA=Mi(eI),Cj=function(t){return q(yo(t),gU(I1(G)))},CN=function(t){var n=Cj(t);return function(t){return ew(t)?n(t):CA}},CP=function(t){return q(yo(t),gU(I3(G)))},CL=function(t){var n=CP(t);return function(t){return ew(t)?n(t):CA}},CF=function(t){return CN(function(n,r){return t(r)})},CD=CF(F),CW=function(t){return CL(function(n,r){return t(r)})},CU=CW(F),Cz=eH(M5),CB=oW(M6),Cq=function(t){return eH(kr)(hV(t))};function CV(t,n){return t(n)()}let C$=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:MG,map:MN,alt:MD},ApT:CA,ApplicativePar:{URI:MG,map:MN,ap:MP,of:Mi},ApplicativeSeq:M6,ApplyPar:M2,ApplySeq:M5,Bifunctor:{URI:MG,bimap:MW,mapLeft:MU},Chain:M9,Do:CM,FromEither:Cc,FromIO:Cv,FromReader:Ce,FromTask:CS,Functor:MX,Monad:{URI:MG,map:MN,ap:MP,chain:MF,of:Mi},MonadIO:{URI:MG,map:MN,ap:MP,chain:MF,of:Mi,fromIO:Mf},MonadTask:{URI:MG,map:MN,ap:MP,chain:MF,of:Mi,fromIO:Mf,fromTask:Mo},MonadThrow:{URI:MG,map:MN,ap:MP,chain:MF,of:Mi,throwError:Mr},Pointed:M1,URI:MG,alt:MZ,altW:MZ,ap:MV,apFirst:M3,apFirstW:M3,apS:CE,apSW:CE,apSecond:M4,apSecondW:M4,apW:MV,ask:Ct,asks:Cn,asksReaderTaskEither:gN,asksReaderTaskEitherW:gN,bimap:MB,bind:CR,bindTo:CC,bindW:CR,bracket:Ck,bracketW:CI,chain:M$,chainEitherK:Cp,chainEitherKW:Cp,chainFirst:M8,chainFirstEitherK:Ch,chainFirstEitherKW:Ch,chainFirstIOK:C_,chainFirstReaderEitherK:Mj,chainFirstReaderEitherKW:Mj,chainFirstReaderK:Co,chainFirstReaderKW:Co,chainFirstReaderTaskK:Cs,chainFirstReaderTaskKW:Cs,chainFirstTaskEitherK:MR,chainFirstTaskEitherKW:MR,chainFirstTaskK:CO,chainFirstW:M7,chainIOEitherK:MI,chainIOEitherKW:MI,chainIOK:Cx,chainNullableK:M_,chainOptionK:Cd,chainReaderEitherK:MA,chainReaderEitherKW:MA,chainReaderK:Ci,chainReaderKW:Ci,chainReaderTaskK:Cu,chainReaderTaskKW:Cu,chainTaskEitherK:MC,chainTaskEitherKW:MC,chainTaskK:Cw,chainW:MK,filterOrElse:Cg,filterOrElseW:Cg,flap:M0,flatten:MH,flattenW:MH,fold:Mg,foldW:Mg,fromEither:O3,fromEitherK:Cy,fromIO:Mf,fromIOEither:Mp,fromIOEitherK:Mk,fromIOK:Cb,fromNullable:Mb,fromNullableK:Mx,fromOption:Cl,fromOptionK:Cf,fromPredicate:Cm,fromReader:Mu,fromReaderEither:Mh,fromReaderEitherK:ME,fromReaderK:Cr,fromReaderTaskK:Ca,fromTask:Mo,fromTaskEither:D,fromTaskEitherK:MM,fromTaskK:CT,getAltReaderTaskValidation:MQ,getApplicativeReaderTaskValidation:MY,getApplyMonoid:CB,getApplySemigroup:Cz,getCompactable:MJ,getFilterable:function(t){var n=hK(t),r=MJ(t),i=gd(O9,n),o=gp(O9,n),a=gh(O9,n),u=gm(O9,n);return{URI:MG,_E:void 0,map:MN,compact:r.compact,separate:r.separate,filter:function(t,n){return Z(t,i(n))},filterMap:function(t,n){return Z(t,o(n))},partition:function(t,n){return Z(t,a(n))},partitionMap:function(t,n){return Z(t,u(n))}}},getOrElse:My,getOrElseW:My,getReaderTaskValidation:function(t){var n=MY(OS,t),r=MQ(t);return{URI:MG,_E:void 0,map:MN,of:Mi,chain:MF,bimap:MW,mapLeft:MU,ap:n.ap,alt:r.alt,fromIO:Mf,fromTask:Mo,throwError:Mr}},getSemigroup:Cq,left:Mr,leftIO:Md,leftReader:Ms,leftReaderTask:Ml,leftTask:Ma,local:gj,map:Mz,mapLeft:Mq,match:Mm,matchE:Mg,matchEW:Mg,matchW:Mm,of:Mi,orElse:MS,orElseFirst:MT,orElseFirstW:MT,orElseW:MS,orLeft:Mw,readerTaskEither:{URI:MG,map:MN,of:Mi,ap:MP,chain:MF,alt:MD,bimap:MW,mapLeft:MU,fromIO:Mf,fromTask:Mo,throwError:Mr},readerTaskEitherSeq:{URI:MG,map:MN,of:Mi,ap:ML,chain:MF,alt:MD,bimap:MW,mapLeft:MU,fromIO:Mf,fromTask:Mo,throwError:Mr},right:Mi,rightIO:Mf,rightReader:Mu,rightReaderTask:Mc,rightTask:Mo,run:CV,sequenceArray:CD,sequenceSeqArray:CU,swap:MO,throwError:Mr,toUnion:Mv,traverseArray:CF,traverseArrayWithIndex:CN,traverseReadonlyArrayWithIndex:CN,traverseReadonlyArrayWithIndexSeq:CL,traverseReadonlyNonEmptyArrayWithIndex:Cj,traverseReadonlyNonEmptyArrayWithIndexSeq:CP,traverseSeqArray:CW,traverseSeqArrayWithIndex:CL},Symbol.toStringTag,{value:"Module"}));var CK=function(t){return new Set(t)},CH=function(t){return new Set([t])},CZ=function(t){return function(n){for(var r=n.length,i=new Set,o=Rr(t),a=0;a<r;a++){var u=n[a];o(u,i)||i.add(u)}return i}};function CG(t){return function(n){for(var r,i=n.values(),o=new Set;!(r=i.next()).done;){var a=r.value;t(a)&&o.add(a)}return o}}function CJ(t){var n=Rr(t);return function(r,i){if(void 0===i){var o=CJ(t);return function(t){return o(r,t)}}if(C8(r))return i;if(C8(i))return r;var a=new Set(r);return i.forEach(function(t){n(t,a)||a.add(t)}),a}}function CY(t){var n=Rr(t);return function(r,i){if(void 0===i){var o=CY(t);return function(t){return o(t,r)}}if(C8(r)||C8(i))return C9;var a=new Set;return r.forEach(function(t){n(t,i)&&a.add(t)}),a}}function CQ(t){var n=Rr(t);return function(r,i){if(void 0===i){var o=CQ(t);return function(t){return o(t,r)}}return CG(function(t){return!n(t,i)})(r)}}function CX(t){var n=Ri(t);return function(t,r){return function(i){return n(i).reduce(r,t)}}}function C0(t,n){var r=Ri(t);return function(t){return function(i){return r(i).reduce(function(r,i){return n.concat(r,t(i))},n.empty)}}}var C1=function(t){var n=Ri(t);return function(t,r){return function(i){return n(i).reduceRight(function(t,n){return r(n,t)},t)}}};function C2(t){var n=Rr(t);return function(t){return function(r){if(n(t)(r))return r;var i=new Set(r);return i.add(t),i}}}var C3=function(t){return function(n){return function(r){return CG(function(r){return!t.equals(n,r)})(r)}}},C4=function(t){var n=Rr(t),r=C3(t),i=C2(t);return function(t){return function(o){return(n(t,o)?r:i)(t)(o)}}},C5=function(t){return C6(t)(F)};function C6(t){var n=Rr(t);return function(t){return function(r){var i=new Set;return r.forEach(function(r){var o=t(r);"Some"!==o._tag||n(o.value,i)||i.add(o.value)}),i}}}var C9=new Set,C8=function(t){return 0===t.size},C7=function(t){return t.size},Re=function(t){return function(n){for(var r,i=n.values(),o=!1;!o&&!(r=i.next()).done;)o=t(r.value);return o}};function Rt(t){return dP(Re(dP(t)))}function Rn(t){var n=Rr(t);return function(r,i){if(void 0===i){var o=Rn(t);return function(t){return o(t,r)}}return Rt(function(t){return n(t,i)})(r)}}function Rr(t){return function(n,r){if(void 0===r){var i=Rr(t);return function(t){return i(n,t)}}for(var o,a=r.values(),u=!1;!u&&!(o=a.next()).done;)u=t.equals(n,o.value);return u}}var Ri=function(t){return function(n){var r=[];return n.forEach(function(t){return r.push(t)}),r.sort(t.compare)}};function Ro(t){return{show:function(n){var r=[];return n.forEach(function(n){r.push(t.show(n))}),"new Set([".concat(r.sort().join(", "),"])")}}}function Ra(t){var n=Rn(t);return Q(function(t,r){return n(t,r)&&n(r,t)})}var Ru=function(t){return{concat:CJ(t)}},Rs=function(t){return{concat:Ru(t).concat,empty:C9}},Rc=function(t){return{concat:CY(t)}},Rl=function(t){return{concat:CQ(t)}};let Rf=Object.freeze(Object.defineProperty({__proto__:null,URI:"ReadonlySet",chain:function(t){var n=Rr(t);return function(t){return function(r){var i=new Set;return r.forEach(function(r){t(r).forEach(function(t){n(t,i)||i.add(t)})}),i}}},compact:C5,difference:CQ,elem:Rr,empty:C9,every:Rt,filter:CG,filterMap:C6,foldMap:C0,fromArray:CZ,fromReadonlyArray:CZ,fromSet:CK,getDifferenceMagma:Rl,getEq:Ra,getIntersectionSemigroup:Rc,getShow:Ro,getUnionMonoid:Rs,getUnionSemigroup:Ru,insert:C2,intersection:CY,isEmpty:C8,isSubset:Rn,map:function(t){var n=Rr(t);return function(t){return function(r){var i=new Set;return r.forEach(function(r){var o=t(r);n(o,i)||i.add(o)}),i}}},partition:function(t){return function(n){for(var r,i=n.values(),o=new Set,a=new Set;!(r=i.next()).done;){var u=r.value;t(u)?o.add(u):a.add(u)}return eE(a,o)}},partitionMap:function(t,n){return function(r){return function(i){for(var o,a=i.values(),u=new Set,s=new Set,c=Rr(t),l=Rr(n);!(o=a.next()).done;){var f=r(o.value);switch(f._tag){case"Left":c(f.left,u)||u.add(f.left);break;case"Right":l(f.right,s)||s.add(f.right)}}return eE(u,s)}}},reduce:CX,reduceRight:C1,remove:C3,separate:function(t,n){return function(r){var i=Rr(t),o=Rr(n),a=new Set,u=new Set;return r.forEach(function(t){switch(t._tag){case"Left":i(t.left,a)||a.add(t.left);break;case"Right":o(t.right,u)||u.add(t.right)}}),eE(a,u)}},singleton:CH,size:C7,some:Re,toReadonlyArray:Ri,toSet:function(t){return new Set(t)},toggle:C4,union:CJ},Symbol.toStringTag,{value:"Module"}));function Rd(t){return t[0]}function Rp(t){return t[1]}var Rh=function(t){var n;return[Rp(t),t[0]]};function Rm(t){return{URI:RD,_E:void 0,map:Rb,ap:function(n,r){var i,o;return[(0,n[0])(r[0]),t.concat(Rp(n),Rp(r))]}}}var Rg=function(t){return function(n){return[n,t.empty]}};function Ry(t){var n=Rm(t);return{URI:RD,_E:void 0,map:n.map,ap:n.ap,chain:function(n,r){var i,o=r(n[0]),a=o[0],u=o[1];return[a,t.concat(Rp(n),u)]}}}var Rv=function(t,n){return Z(t,RR(n))},Rb=function(t,n){return Z(t,RM(n))},Rx=function(t,n,r){return Z(t,RI(n,r))},R_=function(t,n){return Z(t,RC(n))},RS=function(t,n){return Z(t,RE(n))},RT=function(t,n,r){return Z(t,Rj(n,r))},Rw=function(t){var n=RN();return function(t,r){return Z(t,n(r))}},RO=function(t,n,r){return Z(t,RP(n,r))},Rk=function(t){var n=RL(t);return function(t,r){return Z(t,n(r))}},RI=function(t,n){return function(r){var i;return[n(r[0]),t(Rp(r))]}},RM=function(t){return function(n){var r;return[t(n[0]),Rp(n)]}},RC=function(t){return function(n){var r;return[n[0],t(Rp(n))]}},RR=function(t){return function(n){var r;return[n[0],Rp(t)]}},RE=function(t){return function(n){return[t(n),Rp(n)]}},RA=RE(F),Rj=function(t,n){return function(r){var i;return n(t,r[0])}},RN=function(){return function(t){return function(n){var r;return t(n[0])}}},RP=function(t,n){return function(r){var i;return n(r[0],t)}},RL=function(t){return function(n){return function(r){var i;return t.map(n(r[0]),function(t){return[t,Rp(r)]})}}},RF=function(t){return function(n){var r;return t.map(n[0],function(t){return[t,Rp(n)]})}},RD="ReadonlyTuple",RW={URI:RD,map:Rb},RU=el(RW);let Rz=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:{URI:RD,bimap:Rx,mapLeft:R_},Comonad:{URI:RD,map:Rb,extend:RS,extract:Rd},Foldable:{URI:RD,reduce:RT,foldMap:Rw,reduceRight:RO},Functor:RW,Semigroupoid:{URI:RD,compose:Rv},Traversable:{URI:RD,map:Rb,reduce:RT,foldMap:Rw,reduceRight:RO,traverse:Rk,sequence:RF},URI:RD,bimap:RI,compose:RR,duplicate:RA,extend:RE,extract:Rd,flap:RU,foldMap:RN,fst:Rd,getApplicative:function(t){var n=Rm(t);return{URI:RD,_E:void 0,map:n.map,ap:n.ap,of:Rg(t)}},getApply:Rm,getChain:Ry,getChainRec:function(t){var n=function(n,r){for(var i,o,a=r(n),u=t.empty,s=(i=a)[0];"Left"===s._tag;)u=t.concat(u,Rp(a)),s=(a=r(s.left))[0];return[s.right,t.concat(u,Rp(a))]},r=Ry(t);return{URI:RD,_E:void 0,map:r.map,ap:r.ap,chain:r.chain,chainRec:n}},getMonad:function(t){var n=Ry(t);return{URI:RD,_E:void 0,map:n.map,ap:n.ap,chain:n.chain,of:Rg(t)}},map:RM,mapFst:RM,mapLeft:RC,mapSnd:RC,readonlyTuple:{URI:RD,compose:Rv,map:Rb,bimap:Rx,mapLeft:R_,extract:Rd,extend:RS,reduce:RT,foldMap:Rw,reduceRight:RO,traverse:Rk,sequence:RF},reduce:Rj,reduceRight:RP,sequence:RF,snd:Rp,swap:Rh,traverse:RL},Symbol.toStringTag,{value:"Module"}));var RB=globalThis&&globalThis.__assign||function(){return(RB=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t}).apply(this,arguments)},Rq=function(t){return function(n){return Object.keys(n).sort(t.compare)}},RV=Rq(rl);function R$(t){if("function"==typeof t)return R$(rl)(t);var n=Rq(t);return function(t){return function(r){for(var i=[],o=0,a=n(r);o<a.length;o++){var u=a[o];i.push(t(u,r[u]))}return i}}}var RK=R$(rl)(function(t,n){return[t,n]});function RH(t){return function(n){if(!eC.call(n,t))return n;var r=Object.assign({},n);return delete r[t],r}}var RZ=function(t,n){return RG(t,function(){return n})},RG=function(t,n){return function(r){if(!rW(t,r))return ey;var i=Object.assign({},r);return i[t]=n(r[t]),ev(i)}};function RJ(t){return rQ(t)}function RY(t){return rX(t)}function RQ(t){return r0(t)}var RX=function(t){var n,r=rX(t);return function(n){return function(i){return t.map(Z(i,r(n)),Ee)}}},R0=function(t){var n,r=rX(t);return function(n){return function(i){return t.map(Z(i,r(n)),Et)}}};function R1(t){return r4(t)}function R2(t){return r6(t)}function R3(t,n){return r9(t,n)}var R4=function(t){var n,r;return(n=tk(),r9(n,f$))(t)};function R5(t,n){return r8(t,n)}var R6=function(t){var n=ii(t);return function(t){return function(r){return rj(r)?RB({},t):rj(t)?RB({},r):n(t)(r)}}},R9=function(t){return function(n){return function(r){return rj(r)||rj(n)?{}:io(t)(n)(r)}}},R8=function(t){return function(n){return rj(n)?RB({},t):rj(t)?RB({},n):ia(t)(n)}},R7=function(t){return function(n){var r=Rq(t);return function(t,i){var o=r(t);if(0===o.length)return n.of({});for(var a=n.of({}),u=function(r){a=n.ap(n.map(a,function(t){return function(n){return t[r]=n,t}}),i(r,t[r]))},s=0;s<o.length;s++)u(o[s]);return a}}},Ee=iN,Et=iP,En="Record",Er={URI:En,map:iu},Ei=el(Er),Eo=function(t){return{URI:En,reduce:ic(t),foldMap:il(t),reduceRight:id(t)}},Ea=function(t){return{URI:En,reduce:ic(t),foldMap:il(t),reduceRight:id(t),reduceWithIndex:iy(t),foldMapWithIndex:iv(t),reduceRightWithIndex:ib(t)}},Eu={URI:En,compact:Ee,separate:Et},Es=function(t){return{URI:En,map:iu,reduce:ic(t),foldMap:il(t),reduceRight:id(t),traverse:iw(t),sequence:iO(t)}},Ec=function(t){return{URI:En,map:iu,mapWithIndex:is,reduce:ic(t),foldMap:il(t),reduceRight:id(t),reduceWithIndex:iy(t),foldMapWithIndex:iv(t),reduceRightWithIndex:ib(t),traverse:iw(t),sequence:iO(t),traverseWithIndex:R7(t)}},El=function(t){var n=Es(t);return{URI:En,map:iu,reduce:ic(t),foldMap:il(t),reduceRight:id(t),traverse:n.traverse,sequence:n.sequence,compact:Ee,separate:Et,filter:ip,filterMap:ih,partition:im,partitionMap:ig,wither:rI(n,Eu),wilt:rk(n,Eu)}},Ef=function(t){var n=R6(t);return{concat:function(t,r){return n(r)(t)}}},Ed=function(t){return{concat:Ef(t).concat,empty:{}}},Ep=function(t){var n=R9(t);return{concat:function(t,r){return n(r)(t)}}},Eh=function(){return{concat:function(t,n){return R8(n)(t)}}},Em={URI:En,reduce:ic(rl),foldMap:il(rl),reduceRight:id(rl)},Eg={URI:En,reduce:ic(rl),foldMap:il(rl),reduceRight:id(rl),reduceWithIndex:iy(rl),foldMapWithIndex:iv(rl),reduceRightWithIndex:ib(rl)},Ey={URI:En,map:iu,reduce:ic(rl),foldMap:il(rl),reduceRight:id(rl),traverse:iw(rl),sequence:RQ},Ev={URI:En,map:iu,mapWithIndex:is,reduce:ic(rl),foldMap:il(rl),reduceRight:id(rl),reduceWithIndex:iy(rl),foldMapWithIndex:iv(rl),reduceRightWithIndex:ib(rl),traverse:iw(rl),sequence:RQ,traverseWithIndex:R7(rl)},Eb=rI(Ey,Eu),Ex=rk(Ey,Eu),E_={URI:En,map:iu,reduce:ic(rl),foldMap:il(rl),reduceRight:id(rl),traverse:iw(rl),sequence:RQ,compact:Ee,separate:Et,filter:ip,filterMap:ih,partition:im,partitionMap:ig,wither:Eb,wilt:Ex},ES={URI:En,map:iu,reduce:ic(rl),foldMap:il(rl),reduceRight:id(rl),traverse:iw(rl),sequence:RQ,compact:Ee,separate:Et,filter:ip,filterMap:ih,partition:im,partitionMap:ig,mapWithIndex:is,reduceWithIndex:iy(rl),foldMapWithIndex:iv(rl),reduceRightWithIndex:ib(rl),filterMapWithIndex:iS,filterWithIndex:iT,partitionMapWithIndex:ix,partitionWithIndex:i_,traverseWithIndex:R7(rl),wither:Eb,wilt:Ex};let ET=Object.freeze(Object.defineProperty({__proto__:null,Compactable:Eu,Filterable:{URI:En,map:iu,compact:Ee,separate:Et,filter:ip,filterMap:ih,partition:im,partitionMap:ig},FilterableWithIndex:{URI:En,map:iu,mapWithIndex:is,compact:Ee,separate:Et,filter:ip,filterMap:ih,partition:im,partitionMap:ig,filterMapWithIndex:iS,filterWithIndex:iT,partitionMapWithIndex:ix,partitionWithIndex:i_},Foldable:Em,FoldableWithIndex:Eg,Functor:Er,FunctorWithIndex:{URI:En,map:iu,mapWithIndex:is},Traversable:Ey,TraversableWithIndex:Ev,URI:En,Witherable:E_,collect:R$,compact:Ee,deleteAt:RH,difference:R8,elem:ir,empty:{},every:ie,filter:iI,filterMap:iM,filterMapWithIndex:r5,filterWithIndex:R2,flap:Ei,foldMap:function(t){return"compare"in t?iA(t):iA(rl)(t)},foldMapWithIndex:function(t){return"compare"in t?rG(t):rG(rl)(t)},fromEntries:R4,fromFoldable:R3,fromFoldableMap:R5,getDifferenceMagma:Eh,getEq:iD,getFoldable:Eo,getFoldableWithIndex:Ea,getIntersectionSemigroup:Ep,getMonoid:iW,getShow:function(t){return"compare"in t?iF(t):iF(rl)(t)},getTraversable:Es,getTraversableWithIndex:Ec,getUnionMonoid:Ed,getUnionSemigroup:Ef,getWitherable:El,has:rW,hasOwnProperty:i5,insertAt:rD,intersection:R9,isEmpty:rj,isSubrecord:rq,keys:RV,lookup:rV,map:rH,mapWithIndex:rK,modifyAt:RG,partition:iC,partitionMap:iR,partitionMapWithIndex:r3,partitionWithIndex:R1,pop:function(t){var n=RH(t);return function(r){var i=rV(t,r);return em(i)?ey:ev([i.value,n(r)])}},record:ES,reduce:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1===t.length?iE(t[0]):iE(rl).apply(void 0,t)},reduceRight:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1===t.length?ij(t[0]):ij(rl).apply(void 0,t)},reduceRightWithIndex:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1===t.length?rJ(t[0]):rJ(rl).apply(void 0,t)},reduceWithIndex:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1===t.length?rZ(t[0]):rZ(rl).apply(void 0,t)},separate:Et,sequence:RQ,singleton:rY,size:rA,some:it,toArray:RK,toEntries:RK,toUnfoldable:function(t){return function(n){var r=RK(n),i=r.length;return t.unfold(0,function(t){return t<i?ev([r[t],t+1]):ey})}},traverse:RY,traverseWithIndex:RJ,union:R6,updateAt:RZ,upsertAt:rD,wilt:R0,wither:RX},Symbol.toStringTag,{value:"Module"}));var Ew=function(t){return function(n){return eg(t(n))}},EO=function(t){return function(n){return ex(t(n))}},Ek=function(){return function(t){return!0}},EI=function(t){return function(n){return!t(n)}},EM=function(t){return function(n){return function(r){return n(r)||t(r)}}},EC=function(t){return function(n){return function(r){return n(r)&&t(r)}}},ER=function(){return function(t){return!1}},EE=function(t){return function(n){return function(r){return n(r)&&t(r)}}};let EA=Object.freeze(Object.defineProperty({__proto__:null,and:EC,compose:EE,fromEitherK:EO,fromOptionK:Ew,id:Ek,not:EI,or:EM,zero:ER},Symbol.toStringTag,{value:"Module"}));var Ej=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return{add:function(n,r){return t.map(function(t,i){return t.add(n[i],r[i])})},zero:t.map(function(t){return t.zero}),mul:function(n,r){return t.map(function(t,i){return t.mul(n[i],r[i])})},one:t.map(function(t){return t.one}),sub:function(n,r){return t.map(function(t,i){return t.sub(n[i],r[i])})}}},EN=function(t){return function(n){return t.sub(t.zero,n)}};let EP=Object.freeze(Object.defineProperty({__proto__:null,getFunctionRing:P,getTupleRing:Ej,negate:EN,tuple:Ej},Symbol.toStringTag,{value:"Module"})),EL=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),EF=Object.freeze(Object.defineProperty({__proto__:null,getFunctionSemiring:N},Symbol.toStringTag,{value:"Module"}));function ED(t){return function(n){for(var r,i=n.values(),o=new Set;!(r=i.next()).done;){var a=r.value;t(a)&&o.add(a)}return o}}function EW(t){var n=E2(t);return function(r,i){if(void 0===i){var o=EW(t);return function(t){return o(r,t)}}if(E0(r))return i;if(E0(i))return r;var a=new Set(r);return i.forEach(function(t){n(t,a)||a.add(t)}),a}}function EU(t){var n=E2(t);return function(r,i){if(void 0===i){var o=EU(t);return function(t){return o(t,r)}}if(E0(r)||E0(i))return new Set;var a=new Set;return r.forEach(function(t){n(t,i)&&a.add(t)}),a}}function Ez(t){var n=E2(t);return function(r,i){if(void 0===i){var o=Ez(t);return function(t){return o(t,r)}}return ED(function(t){return!n(t,i)})(r)}}var EB=function(t){return{concat:EW(t)}},Eq=function(t){return{concat:EB(t).concat,empty:new Set}},EV=function(t){return{concat:EU(t)}},E$=function(t){return{concat:Ez(t)}},EK=function(t){return new Set([t])};function EH(t){var n=E2(t);return function(t){return function(r){if(n(t)(r))return r;var i=new Set(r);return i.add(t),i}}}var EZ=function(t){return function(n){return function(r){return ED(function(r){return!t.equals(n,r)})(r)}}},EG=function(t){var n=E2(t),r=EZ(t),i=EH(t);return function(t){return function(o){return(n(t,o)?r:i)(t)(o)}}},EJ=function(t){return function(n){for(var r=n.length,i=new Set,o=E2(t),a=0;a<r;a++){var u=n[a];o(u,i)||i.add(u)}return i}},EY=function(t){return EQ(t)(F)};function EQ(t){var n=E2(t);return function(t){return function(r){var i=new Set;return r.forEach(function(r){var o=t(r);"Some"!==o._tag||n(o.value,i)||i.add(o.value)}),i}}}var EX=new Set,E0=function(t){return 0===t.size},E1=function(t){return t.size},E2=Rr,E3=function(t){return function(n){var r=[];return n.forEach(function(t){return r.push(t)}),r.sort(t.compare)}};let E4=Object.freeze(Object.defineProperty({__proto__:null,chain:function(t){var n=E2(t);return function(t){return function(r){var i=new Set;return r.forEach(function(r){t(r).forEach(function(t){n(t,i)||i.add(t)})}),i}}},compact:EY,difference:Ez,elem:E2,empty:EX,every:Rt,filter:ED,filterMap:EQ,foldMap:C0,fromArray:EJ,getDifferenceMagma:E$,getEq:Ra,getIntersectionSemigroup:EV,getShow:Ro,getUnionMonoid:Eq,getUnionSemigroup:EB,insert:EH,intersection:EU,isEmpty:E0,isSubset:Rn,map:function(t){var n=E2(t);return function(t){return function(r){var i=new Set;return r.forEach(function(r){var o=t(r);n(o,i)||i.add(o)}),i}}},partition:function(t){return function(n){for(var r,i=n.values(),o=new Set,a=new Set;!(r=i.next()).done;){var u=r.value;t(u)?o.add(u):a.add(u)}return eE(a,o)}},partitionMap:function(t,n){return function(r){return function(i){for(var o,a=i.values(),u=new Set,s=new Set,c=E2(t),l=E2(n);!(o=a.next()).done;){var f=r(o.value);switch(f._tag){case"Left":c(f.left,u)||u.add(f.left);break;case"Right":l(f.right,s)||s.add(f.right)}}return eE(u,s)}}},reduce:CX,reduceRight:C1,remove:EZ,separate:function(t,n){return function(r){var i=E2(t),o=E2(n),a=new Set,u=new Set;return r.forEach(function(t){switch(t._tag){case"Left":i(t.left,a)||a.add(t.left);break;case"Right":o(t.right,u)||u.add(t.right)}}),eE(a,u)}},singleton:EK,size:E1,some:Re,subset:Rn,toArray:E3,toggle:EG,union:EW},Symbol.toStringTag,{value:"Module"}));var E5=function(t){return{show:function(n){var r="{";for(var i in t)eC.call(t,i)&&(r+=" ".concat(i,": ").concat(t[i].show(n[i]),","));return r.length>1&&(r=r.slice(0,-1)+" "),r+="}"}}},E6=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return{show:function(n){return"[".concat(n.map(function(n,r){return t[r].show(n)}).join(", "),"]")}}};let E9=Object.freeze(Object.defineProperty({__proto__:null,getStructShow:E5,getTupleShow:E6,showBoolean:{show:function(t){return JSON.stringify(t)}},showNumber:{show:function(t){return JSON.stringify(t)}},showString:{show:function(t){return JSON.stringify(t)}},struct:E5,tuple:E6},Symbol.toStringTag,{value:"Module"}));function E8(t){return function(n){return function(r){return t.of([n,r])}}}function E7(t){return function(n){return function(r){return function(i){return t.map(r(i),function(t){var r=t[0],i=t[1];return[n(r),i]})}}}}function Ae(t){return function(n){return function(r){return function(i){return t.chain(r(i),function(r){var i=r[0],o=r[1];return t.map(n(o),function(t){var n=t[0],r=t[1];return[i(n),r]})})}}}}function At(t){return function(n){return function(r){return function(i){return t.chain(r(i),function(t){var r=t[0],i=t[1];return n(r)(i)})}}}}function An(t){return function(n){return function(r){return t.of(n(r))}}}function Ar(t){return function(n){return function(r){return t.map(n,function(t){return[t,r]})}}}function Ai(t){return function(n){return function(r){return t.map(r(n),function(t){return t[0]})}}}function Ao(t){return function(n){return function(r){return t.map(r(n),Rp)}}}let Aa=Object.freeze(Object.defineProperty({__proto__:null,ap:Ae,chain:At,evaluate:Ai,execute:Ao,fromF:Ar,fromState:An,getStateM:function(t){var n=Ae(t),r=E7(t),i=At(t),o=Ai(t),a=Ao(t);return{map:function(t,n){return Z(t,r(n))},ap:function(t,r){return Z(t,n(r))},of:E8(t),chain:function(t,n){return Z(t,i(n))},get:function(){return function(n){return t.of([n,n])}},put:function(n){return function(){return t.of([void 0,n])}},modify:function(n){return function(r){return t.of([void 0,n(r)])}},gets:function(n){return function(r){return t.of([n(r),r])}},fromState:An(t),fromM:Ar(t),evalState:function(t,n){return Z(t,o(n))},execState:function(t,n){return Z(t,a(n))}}},map:E7,of:E8},Symbol.toStringTag,{value:"Module"}));var Au=function(t){return function(){return Mr(t)}},As=E8(M1);function Ac(t){return Ab(Mo(t))}function Al(t){return Ab(Mu(t))}function Af(t){return Ab(Mf(t))}var Ad=function(t){return q(t,Mi)},Ap=function(t){return function(n){return Mr(t(n)[0])}},Ah=md(function(t){return Au(t)},As),Am=An(M1),Ag=function(t){return Ab(D(t))},Ay=function(t){return Ab(Mp(t))},Av=function(t){return Ab(Mh(t))},Ab=Ar(MX),Ax=function(t){return function(n){return q(n,gj(t))}},A_=function(t){return function(n){return function(r){return t(r)(n)(r)}}},AS=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return Ay(t.apply(void 0,n))}},AT=function(t){return function(n){return Z(n,AW(AS(t)))}},Aw=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return Ag(t.apply(void 0,n))}},AO=function(t){return function(n){return Z(n,AW(Aw(t)))}},Ak=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return Ab(t.apply(void 0,n))}},AI=function(t){return function(n){return Z(n,AW(Ak(t)))}},AM=function(t,n){return Z(t,AN(n))},AC=function(t,n){return Z(t,AF(n))},AR=function(t,n){return Z(t,AD(n))},AE=function(t,n){return function(r){return Z(t(r),MZ(function(){return n()(r)}))}},AA=function(t,n,r){return function(i){return Z(t(i),MB(n,function(t){var n=t[0],i=t[1];return[r(n),i]}))}},Aj=function(t,n){return function(r){return Z(t(r),Mq(n))}},AN=E7(MX),AP=function(t,n){return function(r){return AA(r,t,n)}},AL=function(t){return function(n){return Aj(n,t)}},AF=Ae(M9),AD=At(M9),AW=AD,AU=AW(F),Az=function(t){return function(n){return function(r){return Z(n(r),MZ(function(){return t()(r)}))}}},AB="StateReaderTaskEither",Aq={URI:AB,map:AM},AV=el(Aq),A$={URI:AB,map:AM,ap:AC},AK=eV(A$),AH=e$(A$),AZ={URI:AB,map:AM,ap:AC,chain:AR},AG={URI:AB,fromState:Am},AJ=yY(AG),AY=yQ(AG),AQ=yX(AG),AX=y0(AG),A0=y1(AG),A1=y2(AG,AZ),A2=eX(AZ),A3={URI:AB,fromReader:Al},A4=yd(A3),A5=yp(A3),A6=yh(A3),A9=ym(A3,AZ),A8=yg(A3,AZ),A7={URI:AB,fromEither:Ah},je=oB(A7),jt=oV(A7),jn=o$(A7,AZ),jr=oH(A7,AZ),ji=oZ(A7,AZ),jo=oq(A7),ja=oG(A7,AZ),ju=oK(A7),js={URI:AB,fromIO:Af},jc=gM(js),jl=gC(js,AZ),jf=gR(js,AZ),jd={URI:AB,fromIO:Af,fromTask:Ac},jp=y4(jd),jh=y5(jd,AZ),jm=y6(jd,AZ),jg=Ai(MX),jy=Ao(MX),jv=ef(Aq),jb=e0(AZ),jx=eK(A$),j_=function(t){return function(n){return function(r){return function(i){return function(){return ek(n).reduce(function(n,r,o){return n.then(function(a){return eb(a)?n:t(o+1,r)(a.right[1])(i)().then(function(t){if(eb(t))return t;var n=t.right,r=n[0],i=n[1];return a.right[0].push(r),a.right[1]=i,a})})},t(0,eO(n))(r)(i)().then(hJ(function(t){var n;return[[t[0]],t[1]]})))}}}}},jS=function(t){var n=j_(t);return function(t){return ew(t)?n(t):As(eI)}},jT=function(t){return jS(function(n,r){return t(r)})},jw=jT(F),jO=function(t,n){return Z(t(n),Mz(function(t){return t[0]}))},jk=function(t,n){return Z(t(n),Mz(function(t){return t[0],t[1]}))};let jI=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:AB,map:AM,alt:AE},Applicative:{URI:AB,map:AM,ap:AC,of:As},Apply:A$,Bifunctor:{URI:AB,bimap:AA,mapLeft:Aj},Chain:AZ,FromEither:A7,FromIO:js,FromReader:A3,FromState:AG,FromTask:jd,Functor:Aq,Monad:{URI:AB,map:AM,ap:AC,of:As,chain:AR},MonadIO:{URI:AB,map:AM,ap:AC,of:As,chain:AR,fromIO:Af},MonadTask:{URI:AB,map:AM,ap:AC,of:As,chain:AR,fromIO:Af,fromTask:Ac},MonadThrow:{URI:AB,map:AM,ap:AC,of:As,chain:AR,throwError:Au},Pointed:{URI:AB,of:As},URI:AB,alt:Az,altW:Az,ap:AF,apFirst:AK,apFirstW:AK,apS:jx,apSW:jx,apSecond:AH,apSecondW:AH,apW:AF,ask:A4,asks:A5,asksStateReaderTaskEither:A_,asksStateReaderTaskEitherW:A_,bimap:AP,bind:jb,bindTo:jv,bindW:jb,chain:AD,chainEitherK:jr,chainEitherKW:jr,chainFirst:A2,chainFirstEitherK:ji,chainFirstEitherKW:ji,chainFirstIOK:jf,chainFirstReaderK:A8,chainFirstReaderKW:A8,chainFirstTaskK:jm,chainFirstW:A2,chainIOEitherK:AT,chainIOEitherKW:AT,chainIOK:jl,chainOptionK:jn,chainReaderK:A9,chainReaderKW:A9,chainReaderTaskEitherK:AI,chainReaderTaskEitherKW:AI,chainStateK:A1,chainTaskEitherK:AO,chainTaskEitherKW:AO,chainTaskK:jh,chainW:AW,evalState:jO,evaluate:jg,execState:jk,execute:jy,filterOrElse:ja,filterOrElseW:ja,flap:AV,flatten:AU,flattenW:AU,fromEither:Ah,fromEitherK:ju,fromIO:Af,fromIOEither:Ay,fromIOEitherK:AS,fromIOK:jc,fromOption:je,fromOptionK:jt,fromPredicate:jo,fromReader:Al,fromReaderEither:Av,fromReaderK:A6,fromReaderTaskEither:Ab,fromReaderTaskEitherK:Ak,fromState:Am,fromStateK:A0,fromTask:Ac,fromTaskEither:Ag,fromTaskEitherK:Aw,fromTaskK:jp,get:AJ,gets:AX,left:Au,leftIO:function(t){return Ab(Md(t))},leftReader:function(t){return Ab(Ms(t))},leftState:Ap,leftTask:function(t){return Ab(Ma(t))},local:Ax,map:AN,mapLeft:AL,modify:AQ,of:As,put:AY,right:As,rightIO:Af,rightReader:Al,rightState:Ad,rightTask:Ac,run:function(t,n,r){return t(n)(r)()},sequenceArray:jw,stateReaderTaskEither:{URI:AB,map:AM,of:As,ap:AC,chain:AR,bimap:AA,mapLeft:Aj,alt:AE,fromIO:Af,fromTask:Ac,throwError:Au},stateReaderTaskEitherSeq:{URI:AB,map:AM,of:As,ap:AC,chain:AR,bimap:AA,mapLeft:Aj,alt:AE,fromIO:Af,fromTask:Ac,throwError:Au},throwError:Au,traverseArray:jT,traverseArrayWithIndex:jS,traverseReadonlyArrayWithIndex:jS,traverseReadonlyNonEmptyArrayWithIndex:j_},Symbol.toStringTag,{value:"Module"}));var jM=function(t,n){return Z(t,jj(n))},jC=function(t,n){return Z(t,jR(n))},jR=function(t){return function(n){return{peek:function(r){return t({peek:n.peek,pos:r})},pos:n.pos}}},jE=function(t){return t.peek(t.pos)},jA=jR(F),jj=function(t){return function(n){return{peek:function(r){return t(n.peek(r))},pos:n.pos}}},jN="Store",jP={URI:jN,map:jM},jL=el(jP),jF={URI:jN,map:jM,extend:jC,extract:jE};let jD=Object.freeze(Object.defineProperty({__proto__:null,Comonad:jF,Functor:jP,URI:jN,duplicate:jA,experiment:function(t){return function(n){return function(r){return t.map(n(r.pos),function(t){return r.peek(t)})}}},extend:jR,extract:jE,flap:jL,map:jj,peeks:function(t){return function(n){return n.peek(t(n.pos))}},seek:function(t){return function(n){return{peek:n.peek,pos:t}}},seeks:function(t){return function(n){return{peek:n.peek,pos:t(n.pos)}}},store:jF},Symbol.toStringTag,{value:"Module"}));function jW(t,n){return function(r,i){return n.compose(t.second(i),t.first(r))}}function jU(t,n){var r=jW(t,n);return function(i,o){return n.compose(r(i,o),t.promap(n.id(),F,function(t){return[t,t]}))}}let jz=Object.freeze(Object.defineProperty({__proto__:null,fanOut:jU,fanout:function(t){return jU(t,t)},split:jW,splitStrong:function(t){return jW(t,t)}},Symbol.toStringTag,{value:"Module"}));var jB=function(){return{concat:function(t,n){return Object.assign({},t,n)}}},jq=function(t){return function(n){var r={};for(var i in n)eC.call(n,i)&&(r[i]=t[i](n[i]));return r}};let jV=Object.freeze(Object.defineProperty({__proto__:null,evolve:jq,getAssignSemigroup:jB},Symbol.toStringTag,{value:"Module"}));var j$=globalThis&&globalThis.__awaiter||function(t,n,r,i){return new(r||(r=Promise))(function(o,a){function u(t){try{c(i.next(t))}catch(n){a(n)}}function s(t){try{c(i.throw(t))}catch(n){a(n)}}function c(t){var n;t.done?o(t.value):((n=t.value)instanceof r?n:new r(function(t){t(n)})).then(u,s)}c((i=i.apply(t,n||[])).next())})},jK=globalThis&&globalThis.__generator||function(t,n){var r,i,o,a,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(r)throw TypeError("Generator is already executing.");for(;u;)try{if(r=1,i&&(o=2&a[0]?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,i=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){u=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){u.label=a[1];break}if(6===a[0]&&u.label<o[1]){u.label=o[1],o=a;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(a);break}o[2]&&u.ops.pop(),u.trys.pop();continue}a=n.call(t,u)}catch(s){a=[6,s],i=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},jH=xg(Ov),jZ=xw(Ov),jG=xO(Ov),jJ=function(t){return jY(Oo(t))},jY=xv(Og),jQ=Ol(dz),jX=xk(Og),j0=xI(OO),j1=xM(Ok),j2=xb(Ov),j3=function(t){return function(){return j$(void 0,void 0,void 0,function(){return jK(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,t().then(ev)];case 1:return[2,n.sent()];case 2:return n.sent(),[2,ey];case 3:return[2]}})})}},j4=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return j3(function(){return t.apply(void 0,n)})}},j5=xx(Ov),j6=x_(Ok),j9=xS(Ov),j8=xT(Ok),j7=xC(Og),Ne=xR(Ob),Nt=xE(Ok),Nn=Nt(F),Nr=xA(Ok),Ni=xy(Ov),No=Ni(),Na=hn(Og,pg),Nu=hr(Og,pg,d9),Ns=gd(Og,p_),Nc=gp(Og,p_),Nl=gh(Og,p_),Nf=gm(Og,p_),Nd=function(t,n){return Z(t,j7(n))},Np=function(t,n){return Z(t,Ne(n))},Nh=function(t,n){return Z(t,Nt(n))},Nm=function(t,n){return Z(t,Nr(n))},Ng=function(t,n){return Z(t,Ns(n))},Ny=function(t,n){return Z(t,Nc(n))},Nv=function(t,n){return Z(t,Nl(n))},Nb=function(t,n){return Z(t,Nf(n))},Nx="TaskOption",N_={URI:Nx,map:Nd},NS=el(N_),NT={URI:Nx,of:jH},Nw={URI:Nx,map:Nd,ap:Np},NO=eV(Nw),Nk=e$(Nw),NI=function(t,n){return Z(t,Nt(function(t){return Z(n,j7(t))}))},NM={URI:Nx,map:Nd,ap:Np,chain:Nh},NC=eX(NM),NR={URI:Nx,zero:Ni},NE=uR(NR,NT),NA={URI:Nx,fromIO:jJ},Nj=gM(NA),NN=gC(NA,NM),NP=gR(NA,NM),NL={URI:Nx,fromEither:jG},NF=oK(NL),ND=oH(NL,NM),NW=oZ(NL,NM),NU={URI:Nx,fromIO:jJ,fromTask:jY},Nz=y4(NU),NB=y5(NU,NM),Nq=y6(NU,NM),NV=jH(eM),N$=ef(N_),NK=e0(NM),NH=eK(Nw),NZ=jH(eI),NG=function(t){return q(OD(t),Ol(p2(G)))},NJ=function(t){var n=NG(t);return function(t){return ew(t)?n(t):NZ}},NY=function(t){return function(n){return function(){return ek(n).reduce(function(n,r,i){return n.then(function(o){return em(o)?n:t(i+1,r)().then(function(t){return em(t)?t:(o.value.push(t.value),o)})})},t(0,eO(n))().then(d6(eT)))}}},NQ=function(t){var n=NY(t);return function(t){return ew(t)?n(t):NZ}},NX=function(t){return NJ(function(n,r){return t(r)})},N0=NX(F),N1=function(t){return NQ(function(n,r){return t(r)})},N2=N1(F);let N3=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:Nx,map:Nd,alt:Nm},Alternative:{URI:Nx,map:Nd,ap:Np,of:jH,alt:Nm,zero:Ni},ApT:NZ,ApplicativePar:{URI:Nx,map:Nd,ap:Np,of:jH},ApplicativeSeq:{URI:Nx,map:Nd,ap:NI,of:jH},ApplyPar:Nw,ApplySeq:{URI:Nx,map:Nd,ap:NI},Chain:NM,Compactable:{URI:Nx,compact:Na,separate:Nu},Do:NV,Filterable:{URI:Nx,map:Nd,compact:Na,separate:Nu,filter:Ng,filterMap:Ny,partition:Nv,partitionMap:Nb},FromEither:NL,FromIO:NA,FromTask:NU,Functor:N_,Monad:{URI:Nx,map:Nd,ap:Np,of:jH,chain:Nh},MonadIO:{URI:Nx,map:Nd,ap:Np,of:jH,chain:Nh,fromIO:jJ},MonadTask:{URI:Nx,map:Nd,ap:Np,of:jH,chain:Nh,fromIO:jJ,fromTask:jY},Pointed:NT,Zero:NR,alt:Nr,altW:Nr,ap:Ne,apFirst:NO,apS:NH,apSecond:Nk,bind:NK,bindTo:N$,chain:Nt,chainEitherK:ND,chainFirst:NC,chainFirstEitherK:NW,chainFirstIOK:NP,chainFirstTaskK:Nq,chainIOK:NN,chainNullableK:j6,chainOptionK:j8,chainTaskK:NB,compact:Na,filter:Ns,filterMap:Nc,flap:NS,flatten:Nn,fold:j0,foldW:j0,fromEither:jG,fromEitherK:NF,fromIO:jJ,fromIOK:Nj,fromNullable:j2,fromNullableK:j5,fromOption:Od,fromOptionK:j9,fromPredicate:jZ,fromTask:jY,fromTaskEither:jQ,fromTaskK:Nz,getOrElse:j1,getOrElseW:j1,guard:NE,map:j7,match:jX,matchE:j0,matchEW:j0,matchW:jX,none:No,of:jH,partition:Nl,partitionMap:Nf,separate:Nu,sequenceArray:N0,sequenceSeqArray:N2,some:jH,traverseArray:NX,traverseArrayWithIndex:NJ,traverseReadonlyArrayWithIndex:NJ,traverseReadonlyArrayWithIndexSeq:NQ,traverseReadonlyNonEmptyArrayWithIndex:NG,traverseReadonlyNonEmptyArrayWithIndexSeq:NY,traverseSeqArray:N1,traverseSeqArrayWithIndex:NQ,tryCatch:j3,tryCatchK:j4,zero:Ni},Symbol.toStringTag,{value:"Module"}));var N4=function(t){return"Left"===t._tag},N5=function(t){return"Right"===t._tag};function N6(t){return"Both"===t._tag}function N9(t){return{_tag:"Left",left:t}}function N8(t){return{_tag:"Right",right:t}}function N7(t,n){return{_tag:"Both",left:t,right:n}}var Pe=function(t,n,r){return function(i){switch(i._tag){case"Left":return t(i.left);case"Right":return n(i.right);case"Both":return r(i.left,i.right)}}},Pt=Pe(N8,N9,function(t,n){return N7(n,t)});function Pn(t,n){return{concat:function(r,i){return N4(r)?N4(i)?N9(t.concat(r.left,i.left)):N5(i)?N7(r.left,i.right):N7(t.concat(r.left,i.left),i.right):N5(r)?N4(i)?N7(i.left,r.right):N5(i)?N8(n.concat(r.right,i.right)):N7(i.left,n.concat(r.right,i.right)):N4(i)?N7(t.concat(r.left,i.left),r.right):N5(i)?N7(r.left,n.concat(r.right,i.right)):N7(t.concat(r.left,i.left),n.concat(r.right,i.right))}}}var Pr=function(t){return{URI:P_,_E:void 0,map:Pa,ap:function(n,r){return N4(n)?N4(r)?N9(t.concat(n.left,r.left)):N5(r)?N9(n.left):N9(t.concat(n.left,r.left)):N5(n)?N4(r)?N9(r.left):N5(r)?N8(n.right(r.right)):N7(r.left,n.right(r.right)):N4(r)?N9(t.concat(n.left,r.left)):N5(r)?N7(n.left,n.right(r.right)):N7(t.concat(n.left,r.left),n.right(r.right))}}};function Pi(t){var n=Pr(t),r=function(n,r){if(N4(n))return n;if(N5(n))return r(n.right);var i=r(n.right);return N4(i)?N9(t.concat(n.left,i.left)):N5(i)?N7(n.left,i.right):N7(t.concat(n.left,i.left),i.right)};return{URI:P_,_E:void 0,map:Pa,ap:n.ap,chain:r}}var Po=function(t,n){return em(t)?em(n)?ey:ev(N8(n.value)):em(n)?ev(N9(t.value)):ev(N7(t.value,n.value))},Pa=function(t,n){return Z(t,Pm(n))},Pu=function(t,n,r){return Z(t,Pp(n,r))},Ps=function(t,n){return Z(t,Ph(n))},Pc=function(t,n,r){return Z(t,Pg(n,r))},Pl=function(t){var n=Py(t);return function(t,r){return Z(t,n(r))}},Pf=function(t,n,r){return Z(t,Pv(n,r))},Pd=function(t){var n=Pb(t);return function(t,r){return Z(t,n(r))}},Pp=function(t,n){return function(r){return N4(r)?N9(t(r.left)):N5(r)?N8(n(r.right)):N7(t(r.left),n(r.right))}},Ph=function(t){return function(n){return N4(n)?N9(t(n.left)):N6(n)?N7(t(n.left),n.right):n}},Pm=function(t){return function(n){return N4(n)?n:N5(n)?N8(t(n.right)):N7(n.left,t(n.right))}},Pg=function(t,n){return function(r){return N4(r)?t:n(t,r.right)}},Py=function(t){return function(n){return function(r){return N4(r)?t.empty:n(r.right)}}},Pv=function(t,n){return function(r){return N4(r)?t:n(r.right,t)}},Pb=function(t){return function(n){return function(r){return N4(r)?t.of(r):N5(r)?t.map(n(r.right),N8):t.map(n(r.right),function(t){return N7(r.left,t)})}}},Px=function(t){return function(n){return N4(n)?t.of(n):N5(n)?t.map(n.right,N8):t.map(n.right,function(t){return N7(n.left,t)})}},P_="These",PS={URI:P_,map:Pa},PT=el(PS),Pw={URI:P_,fromEither:F},PO=oB(Pw),Pk=oV(Pw),PI=function(t){return function(n){return function(r){return!N4(r)&&t.equals(n,r.right)}}},PM=function(t){return function(n){return!N4(n)&&t(n.right)}},PC=function(t,n){return function(r){return N4(r)?[r.left,n()]:N5(r)?[t(),r.right]:[r.left,r.right]}},PR=function(t,n){return PC(function(){return t},function(){return n})},PE=N8(eI),PA=function(t){return function(n){return function(r){var i=ey,o=n(0,eO(r));if(N4(o))return o;N6(o)&&(i=ev(o.left));for(var a=[o.right],u=1;u<r.length;u++){var s=n(u,r[u]);if(N4(s))return s;N6(s)&&(i=em(i)?ev(s.left):ev(t.concat(i.value,s.left))),a.push(s.right)}return em(i)?N8(a):N7(i.value,a)}}},Pj=function(t){return function(n){var r=PA(t)(n);return function(t){return ew(t)?r(t):PE}}};let PN=Object.freeze(Object.defineProperty({__proto__:null,ApT:PE,Bifunctor:{URI:P_,bimap:Pu,mapLeft:Ps},Foldable:{URI:P_,reduce:Pc,foldMap:Pl,reduceRight:Pf},FromEither:Pw,FromThese:{URI:P_,fromThese:F},Functor:PS,Pointed:{URI:P_,of:N8},Traversable:{URI:P_,map:Pa,reduce:Pc,foldMap:Pl,reduceRight:Pf,traverse:Pd,sequence:Px},URI:P_,bimap:Pp,both:N7,elem:PI,exists:PM,flap:PT,fold:Pe,foldMap:Py,foldW:Pe,fromOption:PO,fromOptionK:Pk,fromOptions:Po,getApplicative:function(t){var n=Pr(t);return{URI:P_,_E:void 0,map:Pa,ap:n.ap,of:N8}},getApply:Pr,getChain:Pi,getEq:function(t,n){return Q(function(r,i){return N4(r)?N4(i)&&t.equals(r.left,i.left):N5(r)?N5(i)&&n.equals(r.right,i.right):N6(i)&&t.equals(r.left,i.left)&&n.equals(r.right,i.right)})},getLeft:function(t){return N4(t)?ev(t.left):N5(t)?ey:ev(t.left)},getLeftOnly:function(t){return N4(t)?ev(t.left):ey},getMonad:function(t){var n=Pi(t);return{URI:P_,_E:void 0,map:Pa,of:N8,ap:n.ap,chain:n.chain,throwError:N9}},getRight:function(t){return N4(t)?ey:(N5(t),ev(t.right))},getRightOnly:function(t){return N5(t)?ev(t.right):ey},getSemigroup:Pn,getShow:function(t,n){return{show:Pe(function(n){return"left(".concat(t.show(n),")")},function(t){return"right(".concat(n.show(t),")")},function(r,i){return"both(".concat(t.show(r),", ").concat(n.show(i),")")})}},isBoth:N6,isLeft:N4,isRight:N5,left:N9,leftOrBoth:function(t){return function(n){return em(n)?N9(t):N7(t,n.value)}},map:Pm,mapLeft:Ph,match:Pe,matchW:Pe,of:N8,reduce:Pg,reduceRight:Pv,right:N8,rightOrBoth:function(t){return function(n){return em(n)?N8(t):N7(n.value,t)}},sequence:Px,swap:Pt,these:{URI:P_,map:Pa,bimap:Pu,mapLeft:Ps,reduce:Pc,foldMap:Pl,reduceRight:Pf,traverse:Pd,sequence:Px},toTuple:PR,toTuple2:PC,traverse:Pb,traverseReadonlyArrayWithIndex:Pj,traverseReadonlyNonEmptyArrayWithIndex:PA},Symbol.toStringTag,{value:"Module"}));function PP(t){return q(N8,t.of)}function PL(t){return q(N9,t.of)}function PF(t){return q(N7,t.of)}function PD(t){return function(n){return t.map(n,N8)}}function PW(t){return function(n){return t.map(n,N9)}}function PU(t){return ec(t,PS)}function Pz(t,n){return eq(t,Pr(n))}function PB(t,n){var r=PL(t);return function(i){return function(o){return t.chain(o,Pe(r,i,function(r,o){return t.map(i(o),Pe(function(t){return N9(n.concat(r,t))},function(t){return N7(r,t)},function(t,i){return N7(n.concat(r,t),i)}))}))}}}function Pq(t){return function(n,r){return function(i){return t.map(i,Pp(n,r))}}}function PV(t){return function(n){return function(r){return t.map(r,Ph(n))}}}function P$(t){return function(n,r,i){return function(o){return t.map(o,Pe(n,r,i))}}}function PK(t){return function(n,r,i){return function(o){return t.chain(o,Pe(n,r,i))}}}function PH(t){return function(n){return t.map(n,Pt)}}function PZ(t){return function(n,r){return function(i){return t.map(i,PC(n,r))}}}let PG=Object.freeze(Object.defineProperty({__proto__:null,ap:Pz,bimap:Pq,both:PF,chain:PB,getTheseM:function(t){var n=PU(t),r=Pq(t),i=PV(t),o=PK(t),a=PZ(t),u=PP(t),s=function(t,r){return Z(t,n(r))};return{map:s,bimap:function(t,n,i){return Z(t,r(n,i))},mapLeft:function(t,n){return Z(t,i(n))},fold:function(t,n,r,i){return Z(t,o(n,r,i))},swap:PH(t),rightM:PD(t),leftM:PW(t),left:PL(t),right:PP(t),both:PF(t),toTuple:function(t,n,r){return Z(t,a(function(){return n},function(){return r}))},getMonad:function(n){var r=Pz(t,n),i=PB(t,n);return{_E:void 0,map:s,of:u,ap:function(t,n){return Z(t,r(n))},chain:function(t,n){return Z(t,i(n))}}}}},left:PL,leftF:PW,map:PU,mapLeft:PV,match:P$,matchE:PK,right:PP,rightF:PD,swap:PH,toTuple2:PZ},Symbol.toStringTag,{value:"Module"}));var PJ=PL(Ov),PY=PP(Ov),PQ=PF(Ov),PX=PD(Og),P0=PW(Og),P1=q(Oo,PX),P2=q(Oo,P0),P3=P$(Og),P4=PK(Ok),P5=PH(Og),P6=function(t,n){return Z(t,P7(n))},P9=function(t,n,r){return Z(t,Le(n,r))},P8=function(t,n){return Z(t,Lt(n))},P7=PU(Og),Le=Pq(Og),Lt=PV(Og),Ln="TaskThese",Lr=function(t,n){var r=Pz(t,n);return{URI:Ln,_E:void 0,map:P6,ap:function(t,n){return Z(t,r(n))}}};function Li(t,n){var r=Lr(t,n).ap;return{URI:Ln,_E:void 0,map:P6,ap:r,of:PY}}function Lo(t){var n=Lr(OS,t),r=PB(Ok,t);return{URI:Ln,_E:void 0,map:P6,ap:n.ap,chain:function(t,n){return Z(t,r(n))}}}var La={URI:Ln,map:P6},Lu=el(La),Ls={URI:Ln,fromEither:Od},Lc=oB(Ls),Ll=oV(Ls),Lf=oq(Ls),Ld={URI:Ln,fromThese:Od},Lp=y8(Ld),Lh={URI:Ln,fromIO:P1},Lm=gM(Lh),Lg={URI:Ln,fromIO:P1,fromTask:PX},Ly=y4(Lg),Lv=PZ(Og),Lb=PY(eI),Lx=function(t){var n=PA(t);return function(t){return q(OD(t),Ol(n(G)))}},L_=function(t){return function(n){var r=Lx(t)(n);return function(t){return ew(t)?r(t):Lb}}},LS=function(t){return function(n){return function(r){return function(){return ek(r).reduce(function(r,i,o){return r.then(function(a){return N4(a)?r:n(o+1,i)().then(function(n){if(N4(n))return n;if(N6(n)){var r=a.right;return r.push(n.right),N6(a)?N7(t.concat(a.left,n.left),r):N7(n.left,r)}return a.right.push(n.right),a})})},n(0,eO(r))().then(Pm(eT)))}}}},LT=function(t){return function(n){var r=LS(t)(n);return function(t){return ew(t)?r(t):Lb}}},Lw=function(t,n){return Lv(function(){return t},function(){return n})},LO=function(t,n){return eH(OT)(Pn(t,n))};let Lk=Object.freeze(Object.defineProperty({__proto__:null,ApT:Lb,Bifunctor:{URI:Ln,bimap:P9,mapLeft:P8},FromEither:Ls,FromIO:Lh,FromTask:Lg,FromThese:Ld,Functor:La,Pointed:{URI:Ln,of:PY},URI:Ln,bifunctorTaskThese:{URI:Ln,bimap:P9,mapLeft:P8},bimap:Le,both:PQ,flap:Lu,fold:P4,foldW:P4,fromEither:Od,fromIO:P1,fromIOEither:Oo,fromIOK:Lm,fromOption:Lc,fromOptionK:Ll,fromPredicate:Lf,fromTask:PX,fromTaskK:Ly,fromThese:Od,fromTheseK:Lp,functorTaskThese:{URI:Ln,map:P6},getApplicative:Li,getApply:Lr,getChain:Lo,getMonad:function(t){var n=Li(OS,t),r=Lo(t);return{URI:Ln,_E:void 0,map:P6,ap:n.ap,of:PY,chain:r.chain,fromIO:P1,fromTask:PX}},getSemigroup:LO,left:PJ,leftIO:P2,leftTask:P0,map:P7,mapLeft:Lt,match:P3,matchE:P4,matchEW:P4,matchW:P3,of:PY,right:PY,rightIO:P1,rightTask:PX,swap:P5,taskThese:{URI:Ln,map:P6,bimap:P9,mapLeft:P8},toTuple:Lw,toTuple2:Lv,traverseReadonlyArrayWithIndex:L_,traverseReadonlyArrayWithIndexSeq:LT,traverseReadonlyNonEmptyArrayWithIndex:Lx,traverseReadonlyNonEmptyArrayWithIndexSeq:LS},Symbol.toStringTag,{value:"Module"}));var LI=function(t,n){return Z(t,LM(n))},LM=function(t){return function(n){return function(r){return t(n(r))}}},LC="Traced",LR={URI:LC,map:LI},LE=el(LR);let LA=Object.freeze(Object.defineProperty({__proto__:null,Functor:LR,URI:LC,censor:function(t){return function(n){return function(r){return n(t(r))}}},flap:LE,getComonad:function(t){return{URI:LC,_E:void 0,map:LI,extend:function(n,r){return function(i){return r(function(r){return n(t.concat(i,r))})}},extract:function(n){return n(t.empty)}}},listen:function(t){return function(n){return[t(n),n]}},listens:function(t){return function(n){return function(r){return[n(r),t(r)]}}},map:LM,traced:LR,tracks:function(t,n){return function(r){return r(n(r(t.empty)))}}},Symbol.toStringTag,{value:"Module"}));function Lj(t,n){return function(r){var i=t.traverse(r),o=n.traverse(r);return function(t){return function(n){return i(n,function(n){return o(n,t)})}}}}function LN(t,n){return function(r){var i=t.sequence(r),o=n.sequence(r);return function(n){return i(t.map(n,o))}}}let LP=Object.freeze(Object.defineProperty({__proto__:null,getTraversableComposition:function(t,n){var r=ed(t,n).map,i=gS(t,n),o=Lj(t,n),a=LN(t,n);return{map:r,reduce:i.reduce,foldMap:i.foldMap,reduceRight:i.reduceRight,traverse:function(t){var n=o(t);return function(t,r){return Z(t,n(r))}},sequence:function(t){var n=a(t);return function(t){return Z(t,n)}}}},sequence:LN,traverse:Lj},Symbol.toStringTag,{value:"Module"})),LL=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function LF(t,n){return void 0===n&&(n=[]),{value:t,forest:n}}var LD=function(t,n){for(var r,i="",o=n.length,a=0;a<o;a++){r=n[a];var u=a===o-1;i+=t+(u?"└":"├")+"─ "+r.value,i+=LD(t+(o>1&&!u?"│ ":" "),r.forest)}return i};function LW(t){return LD(`
2
+ `,t)}function LU(t,n){var r,i=n(t);return{value:i[0],forest:Lz(i[1],n)}}function Lz(t,n){return t.map(function(t){return LU(t,n)})}function LB(t){var n=Lq(t);return function(r,i){return t.chain(i(r),function(r){var o=r[0],a=r[1];return t.map(n(a,i),function(t){return{value:o,forest:t}})})}}function Lq(t){var n=f_(t);return function(r,i){return Z(r,n(function(n){return LB(t)(n,i)}))}}var LV=function(t,n){return Z(t,L3(n))},L$=function(t,n){return Z(t,LX(function(t){return Z(n,L3(t))}))},LK=function(t,n){return Z(t,LX(n))},LH=function(t,n,r){return Z(t,L4(n,r))},LZ=function(t){var n=L5(t);return function(t,r){return Z(t,n(r))}},LG=function(t,n,r){return Z(t,L6(n,r))},LJ=function(t,n){return Z(t,L0(n))},LY=function(t){var n=L8(t);return function(t,r){return Z(t,n(r))}},LQ=function(t){return function(n){return L$(n,t)}},LX=function(t){return function(n){var r=t(n.value),i=r.value,o=r.forest,a=fC().concat;return{value:i,forest:a(o,n.forest.map(LX(t)))}}},L0=function(t){return function(n){return{value:t(n),forest:n.forest.map(L0(t))}}},L1=L0(F),L2=LX(F),L3=function(t){return function(n){return{value:t(n.value),forest:n.forest.map(L3(t))}}},L4=function(t,n){return function(r){for(var i=n(t,r.value),o=r.forest.length,a=0;a<o;a++)i=Z(r.forest[a],L4(i,n));return i}},L5=function(t){return function(n){return L4(t.empty,function(r,i){return t.concat(r,n(i))})}},L6=function(t,n){return function(r){for(var i=t,o=r.forest.length,a=o-1;a>=0;a--)i=Z(r.forest[a],L6(i,n));return n(r.value,i)}},L9=function(t){return t.value},L8=function(t){var n=f_(t),r=function(i){return function(o){return t.ap(t.map(i(o.value),function(t){return function(n){return{value:t,forest:n}}}),Z(o.forest,n(r(i))))}};return r},L7=function(t){return L8(t)(F)},Fe=function(t){return LF(t)},Ft="Tree",Fn={URI:Ft,map:LV},Fr=el(Fn),Fi={URI:Ft,map:LV,ap:L$},Fo=eV(Fi),Fa=e$(Fi),Fu={URI:Ft,map:LV,ap:L$,chain:LK},Fs=eX(Fu),Fc=Fe(eM),Fl=ef(Fn),Ff=e0(Fu),Fd=eK(Fi),Fp=function(t){return function(n){return t(n.value)||n.forest.some(Fp(t))}};let Fh=Object.freeze(Object.defineProperty({__proto__:null,Applicative:{URI:Ft,map:LV,ap:L$,of:Fe},Apply:Fi,Chain:Fu,Comonad:{URI:Ft,map:LV,extend:LJ,extract:L9},Do:Fc,Foldable:{URI:Ft,reduce:LH,foldMap:LZ,reduceRight:LG},Functor:Fn,Monad:{URI:Ft,map:LV,ap:L$,of:Fe,chain:LK},Pointed:{URI:Ft,of:Fe},Traversable:{URI:Ft,map:LV,reduce:LH,foldMap:LZ,reduceRight:LG,traverse:LY,sequence:L7},URI:Ft,ap:LQ,apFirst:Fo,apS:Fd,apSecond:Fa,bind:Ff,bindTo:Fl,chain:LX,chainFirst:Fs,drawForest:LW,drawTree:function(t){return t.value+LW(t.forest)},duplicate:L1,elem:function(t){var n=function(r,i){return t.equals(r,i.value)||i.forest.some(function(t){return n(r,t)})};return n},exists:Fp,extend:L0,extract:L9,flap:Fr,flatten:L2,fold:function(t){var n=function(r){return t(r.value,r.forest.map(n))};return n},foldMap:L5,getEq:function(t){var n,r=Q(function(r,i){return t.equals(r.value,i.value)&&n.equals(r.forest,i.forest)});return n=cy(r),r},getShow:function(t){var n=function(r){return c2(r.forest)?"make(".concat(t.show(r.value),")"):"make(".concat(t.show(r.value),", [").concat(r.forest.map(n).join(", "),"])")};return{show:n}},make:LF,map:L3,of:Fe,reduce:L4,reduceRight:L6,sequence:L7,traverse:L8,tree:{URI:Ft,map:LV,of:Fe,ap:L$,chain:LK,reduce:LH,foldMap:LZ,reduceRight:LG,traverse:LY,sequence:L7,extract:L9,extend:LJ},unfoldForest:Lz,unfoldForestM:Lq,unfoldTree:LU,unfoldTreeM:LB},Symbol.toStringTag,{value:"Module"}));var Fm=function(t){var n;return[Rp(t),(n=t,n[0])]};function Fg(t){return{URI:FW,_E:void 0,map:Fx,ap:function(n,r){var i,o;return[(i=n,i[0])((o=r,o[0])),t.concat(Rp(n),Rp(r))]}}}var Fy=function(t){return function(n){return[n,t.empty]}};function Fv(t){var n=Fg(t);return{URI:FW,_E:void 0,map:n.map,ap:n.ap,chain:function(n,r){var i,o=r((i=n,i[0])),a=o[0],u=o[1];return[a,t.concat(Rp(n),u)]}}}var Fb=function(t,n){return Z(t,FE(n))},Fx=function(t,n){return Z(t,FC(n))},F_=function(t,n,r){return Z(t,FM(n,r))},FS=function(t,n){return Z(t,FR(n))},FT=function(t,n){return Z(t,FA(n))},Fw=function(t,n,r){return Z(t,FP(n,r))},FO=function(t){var n=FN();return function(t,r){return Z(t,n(r))}},Fk=function(t,n,r){return Z(t,FL(n,r))};function FI(t){var n=FF(t);return function(t,r){return Z(t,n(r))}}var FM=function(t,n){return function(r){var i;return[n((i=r,i[0])),t(Rp(r))]}},FC=function(t){return function(n){var r;return[t((r=n,r[0])),Rp(n)]}},FR=function(t){return function(n){var r;return[(r=n,r[0]),t(Rp(n))]}},FE=function(t){return function(n){var r;return[(r=n,r[0]),Rp(t)]}},FA=function(t){return function(n){return[t(n),Rp(n)]}},Fj=FA(F),FN=RN,FP=Rj,FL=RP,FF=function(t){return function(n){return function(r){var i;return t.map(n((i=r,i[0])),function(t){return[t,Rp(r)]})}}},FD=function(t){return function(n){var r;return t.map((r=n,r[0]),function(t){return[t,Rp(n)]})}},FW="Tuple",FU={URI:FW,map:Fx},Fz=el(FU);let FB=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:{URI:FW,bimap:F_,mapLeft:FS},Comonad:{URI:FW,map:Fx,extend:FT,extract:Rd},Foldable:{URI:FW,reduce:Fw,foldMap:FO,reduceRight:Fk},Functor:FU,Semigroupoid:{URI:FW,compose:Fb},Traversable:{URI:FW,map:Fx,reduce:Fw,foldMap:FO,reduceRight:Fk,traverse:FI,sequence:FD},URI:FW,bimap:FM,compose:FE,duplicate:Fj,extend:FA,extract:Rd,flap:Fz,foldMap:FN,fst:Rd,getApplicative:function(t){var n=Fg(t);return{URI:FW,_E:void 0,map:n.map,ap:n.ap,of:Fy(t)}},getApply:Fg,getChain:Fv,getChainRec:function(t){var n=function(n,r){for(var i,o,a=r(n),u=t.empty,s=(i=a,i[0]);"Left"===s._tag;){u=t.concat(u,Rp(a)),s=(o=a=r(s.left))[0]}return[s.right,t.concat(u,Rp(a))]},r=Fv(t);return{URI:FW,_E:void 0,map:r.map,ap:r.ap,chain:r.chain,chainRec:n}},getMonad:function(t){var n=Fv(t);return{URI:FW,_E:void 0,map:n.map,ap:n.ap,chain:n.chain,of:Fy(t)}},map:FC,mapFst:FC,mapLeft:FR,mapSnd:FR,reduce:FP,reduceRight:FL,sequence:FD,snd:Rp,swap:Fm,traverse:FF,tuple:{URI:FW,compose:Fb,map:Fx,bimap:F_,mapLeft:FS,extract:Rd,extend:FT,reduce:Fw,foldMap:FO,reduceRight:Fk,traverse:FI,sequence:FD}},Symbol.toStringTag,{value:"Module"})),Fq=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),FV=Object.freeze(Object.defineProperty({__proto__:null,getValidationM:function(t,n){var r=oU(n,hZ(t));return{map:r.map,ap:r.ap,of:r.of,chain:function(t,r){return n.chain(t,function(t){return eb(t)?n.of(e_(t.left)):r(t.right)})},alt:function(r,i){return n.chain(r,function(r){return ex(r)?n.of(r):n.map(i(),function(n){return eb(n)?e_(t.concat(r.left,n.left)):n})})}}}},Symbol.toStringTag,{value:"Module"}));var F$=t_(void 0),FK={concat:F$.concat,empty:void 0};let FH=Object.freeze(Object.defineProperty({__proto__:null,Monoid:FK,Semigroup:F$},Symbol.toStringTag,{value:"Module"}));var FZ=function(t){return function(){return[void 0,t]}},FG=function(t){return function(){var n=t(),r=n[0],i=n[1];return[[r,i],i]}},FJ=function(t){return function(){var n,r=t(),i=r[0],o=i[0];return[o,(0,i[1])(r[1])]}},FY=function(t){return function(n){return function(){var r=n(),i=r[0],o=r[1];return[[i,t(o)],o]}}},FQ=function(t){return function(n){return function(){var r,i=n();return[i[0],t(i[1])]}}},FX=function(t,n){return Z(t,F0(n))},F0=function(t){return function(n){return function(){var r=n(),i=r[0],o=r[1];return[t(i),o]}}},F1="Writer",F2=function(t){return{URI:F1,_E:void 0,of:function(n){return function(){return[n,t.empty]}}}},F3=function(t){return{URI:F1,_E:void 0,map:FX,ap:function(n,r){return function(){var i=n(),o=i[0],a=i[1],u=r(),s=u[0],c=u[1];return[o(s),t.concat(a,c)]}}}},F4=function(t){var n=F3(t),r=F2(t);return{URI:F1,_E:void 0,map:FX,ap:n.ap,of:r.of}};function F5(t){var n=F3(t);return{URI:F1,_E:void 0,map:FX,ap:n.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,t.concat(a,c)]}}}}var F6={URI:F1,map:FX},F9=el(F6),F8=function(t){return t()[0]},F7=function(t){return t()[1]},De=function(t){return t()[0]},Dt=function(t){return t()[1]};let Dn=Object.freeze(Object.defineProperty({__proto__:null,Functor:F6,URI:F1,censor:FQ,evalWriter:De,evaluate:F8,execWriter:Dt,execute:F7,flap:F9,getApplicative:F4,getApply:F3,getChain:F5,getMonad:function(t){var n=F4(t),r=F5(t);return{URI:F1,_E:void 0,map:FX,ap:n.ap,of:n.of,chain:r.chain}},getPointed:F2,listen:FG,listens:FY,map:F0,pass:FJ,tell:FZ,writer:F6},Symbol.toStringTag,{value:"Module"})),Dr=Object.freeze(Object.defineProperty({__proto__:null,getWriterM:function(t){var n=function(n,r){return function(){return t.map(n(),function(t){var n=t[0],i=t[1];return[r(n),i]})}};return{map:n,evalWriter:function(n){return t.map(n(),function(t){return t[0]})},execWriter:function(n){return t.map(n(),function(t){return t[0],t[1]})},tell:function(n){return function(){return t.of([void 0,n])}},listen:function(n){return function(){return t.map(n(),function(t){var n=t[0],r=t[1];return[[n,r],r]})}},pass:function(n){return function(){return t.map(n(),function(t){var n,r=t[0],i=r[0];return[i,(0,r[1])(t[1])]})}},listens:function(n,r){return function(){return t.map(n(),function(t){var n=t[0],i=t[1];return[[n,r(i)],i]})}},censor:function(n,r){return function(){return t.map(n(),function(t){var n;return[t[0],r(t[1])]})}},getMonad:function(r){return{_E:void 0,map:n,of:function(n){return function(){return t.of([n,r.empty])}},ap:function(n,i){return function(){return t.chain(n(),function(n){var o=n[0],a=n[1];return t.map(i(),function(t){var n=t[0],i=t[1];return[o(n),r.concat(a,i)]})})}},chain:function(n,i){return function(){return t.chain(n(),function(n){var o=n[0],a=n[1];return t.map(i(o)(),function(t){var n=t[0],i=t[1];return[n,r.concat(a,i)]})})}}}}}}},Symbol.toStringTag,{value:"Module"})),Di=Object.freeze(Object.defineProperty({__proto__:null,alt:oF,alternative:oD,applicative:oz,apply:eQ,array:f9,bifunctor:f8,boolean:ds,booleanAlgebra:dl,bounded:dh,boundedDistributiveLattice:dy,boundedJoinSemilattice:dv,boundedLattice:db,boundedMeetSemilattice:dx,category:d_,chain:e1,chainRec:dT,choice:dk,comonad:dI,compactable:hi,console:hc,const:hT,contravariant:hw,date:hM,distributiveLattice:dg,either:mK,eitherT:go,endomorphism:gs,eq:es,extend:gc,field:gf,filterable:gg,filterableWithIndex:gy,foldable:gT,foldableWithIndex:gI,fromEither:oJ,fromIO:gE,fromReader:yy,fromState:y3,fromTask:y9,fromThese:y7,function:Y,functor:ep,functorWithIndex:vt,group:vn,heytingAlgebra:vr,hkt:vi,identity:vW,invariant:vU,io:ba,ioEither:xm,ioOption:_A,ioRef:_N,joinSemilattice:_P,json:_D,lattice:_W,magma:tv,map:Tk,meetSemilattice:TI,monad:TM,monadIO:TC,monadTask:TR,monadThrow:TE,monoid:T$,naturalTransformation:TK,nonEmptyArray:uv,number:uC,option:ht,optionT:xj,ord:td,ordering:TX,pipeable:T0,pointed:T1,predicate:dD,profunctor:T2,random:T9,reader:yf,readerEither:w8,readerT:Oi,readerTask:kD,readerTaskEither:C$,readonlyArray:c1,readonlyMap:SU,readonlyNonEmptyArray:ra,readonlyRecord:i9,readonlySet:Rf,readonlyTuple:Rz,record:ET,refinement:EA,ring:EP,semigroup:tN,semigroupoid:EL,semiring:EF,separated:eB,set:E4,show:E9,state:yJ,stateReaderTaskEither:jI,stateT:Aa,store:jD,string:rO,strong:jz,struct:jV,task:OZ,taskEither:Mn,taskOption:N3,taskThese:Lk,these:PN,theseT:PG,traced:LA,traversable:LP,traversableWithIndex:LL,tree:Fh,tuple:FB,unfoldable:Fq,validationT:FV,void:FH,witherable:rC,writer:Dn,writerT:Dr,zero:uE},Symbol.toStringTag,{value:"Module"})),Do=k(Di);var Da={},Du={},Ds={},Dc={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getEndomorphismMonoid=t.not=t.SK=t.hole=t.pipe=t.untupled=t.tupled=t.absurd=t.decrement=t.increment=t.tuple=t.flow=t.flip=t.constVoid=t.constUndefined=t.constNull=t.constFalse=t.constTrue=t.constant=t.unsafeCoerce=t.identity=t.apply=t.getRing=t.getSemiring=t.getMonoid=t.getSemigroup=t.getBooleanAlgebra=void 0;var n=function(t){return function(){return{meet:function(n,r){return function(i){return t.meet(n(i),r(i))}},join:function(n,r){return function(i){return t.join(n(i),r(i))}},zero:function(){return t.zero},one:function(){return t.one},implies:function(n,r){return function(i){return t.implies(n(i),r(i))}},not:function(n){return function(r){return t.not(n(r))}}}}};t.getBooleanAlgebra=n;var r=function(t){return function(){return{concat:function(n,r){return function(i){return t.concat(n(i),r(i))}}}}};t.getSemigroup=r;var i=function(n){var r=(0,t.getSemigroup)(n);return function(){return{concat:r().concat,empty:function(){return n.empty}}}};t.getMonoid=i;var o=function(t){return{add:function(n,r){return function(i){return t.add(n(i),r(i))}},zero:function(){return t.zero},mul:function(n,r){return function(i){return t.mul(n(i),r(i))}},one:function(){return t.one}}};t.getSemiring=o;var a=function(n){var r=(0,t.getSemiring)(n);return{add:r.add,mul:r.mul,one:r.one,zero:r.zero,sub:function(t,r){return function(i){return n.sub(t(i),r(i))}}}};t.getRing=a;var u=function(t){return function(n){return n(t)}};function s(t){return t}function c(t){return function(){return t}}function l(t,n,r,i,o,a,u,s,c){switch(arguments.length){case 1:return t;case 2:return function(){return n(t.apply(this,arguments))};case 3:return function(){return r(n(t.apply(this,arguments)))};case 4:return function(){return i(r(n(t.apply(this,arguments))))};case 5:return function(){return o(i(r(n(t.apply(this,arguments)))))};case 6:return function(){return a(o(i(r(n(t.apply(this,arguments))))))};case 7:return function(){return u(a(o(i(r(n(t.apply(this,arguments)))))))};case 8:return function(){return s(u(a(o(i(r(n(t.apply(this,arguments))))))))};case 9:return function(){return c(s(u(a(o(i(r(n(t.apply(this,arguments)))))))))}}}function f(t){return t+1}function d(t){return t-1}function p(t){throw Error("Called `absurd` function which should be uncallable")}t.apply=u,t.identity=s,t.unsafeCoerce=s,t.constant=c,t.constTrue=c(!0),t.constFalse=c(!1),t.constNull=c(null),t.constUndefined=c(void 0),t.constVoid=t.constUndefined,t.flip=function(t){return function(n,r){return t(r,n)}},t.flow=l,t.tuple=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t},t.increment=f,t.decrement=d,t.absurd=p,t.tupled=function(t){return function(n){return t.apply(void 0,n)}},t.untupled=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t(n)}},t.pipe=function(t,n,r,i,o,a,u,s,c){switch(arguments.length){case 1:return t;case 2:return n(t);case 3:return r(n(t));case 4:return i(r(n(t)));case 5:return o(i(r(n(t))));case 6:return a(o(i(r(n(t)))));case 7:return u(a(o(i(r(n(t))))));case 8:return s(u(a(o(i(r(n(t)))))));case 9:return c(s(u(a(o(i(r(n(t))))))));default:for(var l=arguments[0],f=1;f<arguments.length;f++)l=arguments[f](l);return l}},t.hole=p;var h=function(t,n){return n};t.SK=h,t.not=function(t){return function(n){return!t(n)}};var m=function(){return{concat:function(t,n){return l(t,n)},empty:s}};t.getEndomorphismMonoid=m}(Dc);var Dl={},Df=O&&O.__spreadArray||function(t,n,r){if(r||2===arguments.length)for(var i,o=0,a=n.length;o<a;o++)!i&&o in n||(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return t.concat(i||Array.prototype.slice.call(n))};Object.defineProperty(Dl,"__esModule",{value:!0}),Dl.fromReadonlyNonEmptyArray=Dl.has=Dl.emptyRecord=Dl.emptyReadonlyArray=Dl.tail=Dl.head=Dl.isNonEmpty=Dl.singleton=Dl.right=Dl.left=Dl.isRight=Dl.isLeft=Dl.some=Dl.none=Dl.isSome=Dl.isNone=void 0;var Dd=function(t){return"None"===t._tag};Dl.isNone=Dd;var Dp=function(t){return"Some"===t._tag};Dl.isSome=Dp,Dl.none={_tag:"None"};var Dh=function(t){return{_tag:"Some",value:t}};Dl.some=Dh;var Dm=function(t){return"Left"===t._tag};Dl.isLeft=Dm;var Dg=function(t){return"Right"===t._tag};Dl.isRight=Dg;var Dy=function(t){return{_tag:"Left",left:t}};Dl.left=Dy;var Dv=function(t){return{_tag:"Right",right:t}};Dl.right=Dv;var Db=function(t){return[t]};Dl.singleton=Db;var Dx=function(t){return t.length>0};Dl.isNonEmpty=Dx;var D_=function(t){return t[0]};Dl.head=D_;var DS=function(t){return t.slice(1)};Dl.tail=DS,Dl.emptyReadonlyArray=[],Dl.emptyRecord={},Dl.has=Object.prototype.hasOwnProperty;var DT=function(t){return Df([t[0]],t.slice(1),!0)};Dl.fromReadonlyNonEmptyArray=DT;var Dw=O&&O.__createBinding||(Object.create?function(t,n,r,i){void 0===i&&(i=r);var o=Object.getOwnPropertyDescriptor(n,r);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[r]}}),Object.defineProperty(t,i,o)}:function(t,n,r,i){void 0===i&&(i=r),t[i]=n[r]}),DO=O&&O.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),Dk=O&&O.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&Dw(n,t,r);return DO(n,t),n};Object.defineProperty(Ds,"__esModule",{value:!0}),Ds.sequenceS=Ds.sequenceT=Ds.getApplySemigroup=Ds.apS=Ds.apSecond=Ds.apFirst=Ds.ap=void 0;var DI=Dk(Dl);function DM(t,n,r){return function(i){for(var o=Array(r.length+1),a=0;a<r.length;a++)o[a]=r[a];return o[r.length]=i,0===n?t.apply(null,o):DM(t,n-1,o)}}Ds.ap=function(t,n){return function(r){return function(i){return t.ap(t.map(i,function(t){return function(r){return n.ap(t,r)}}),r)}}},Ds.apFirst=function(t){return function(n){return function(r){return t.ap(t.map(r,function(t){return function(){return t}}),n)}}},Ds.apSecond=function(t){return function(n){return function(r){return t.ap(t.map(r,function(){return function(t){return t}}),n)}}},Ds.apS=function(t){return function(n,r){return function(i){return t.ap(t.map(i,function(t){return function(r){var i;return Object.assign({},t,((i={})[n]=r,i))}}),r)}}},Ds.getApplySemigroup=function(t){return function(n){return{concat:function(r,i){return t.ap(t.map(r,function(t){return function(r){return n.concat(t,r)}}),i)}}}};var DC={1:function(t){return[t]},2:function(t){return function(n){return[t,n]}},3:function(t){return function(n){return function(r){return[t,n,r]}}},4:function(t){return function(n){return function(r){return function(i){return[t,n,r,i]}}}},5:function(t){return function(n){return function(r){return function(i){return function(o){return[t,n,r,i,o]}}}}}};function DR(t){return DI.has.call(DC,t)||(DC[t]=DM(Dc.tuple,t-1,[])),DC[t]}function DE(t){var n=t.length;switch(n){case 1:return function(n){var r;return(r={})[t[0]]=n,r};case 2:return function(n){return function(r){var i;return(i={})[t[0]]=n,i[t[1]]=r,i}};case 3:return function(n){return function(r){return function(i){var o;return(o={})[t[0]]=n,o[t[1]]=r,o[t[2]]=i,o}}};case 4:return function(n){return function(r){return function(i){return function(o){var a;return(a={})[t[0]]=n,a[t[1]]=r,a[t[2]]=i,a[t[3]]=o,a}}}};case 5:return function(n){return function(r){return function(i){return function(o){return function(a){var u;return(u={})[t[0]]=n,u[t[1]]=r,u[t[2]]=i,u[t[3]]=o,u[t[4]]=a,u}}}}};default:return DM(function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];for(var o={},a=0;a<n;a++)o[t[a]]=r[a];return o},n-1,[])}}Ds.sequenceT=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i=n.length,o=DR(i),a=t.map(n[0],o),u=1;u<i;u++)a=t.ap(a,n[u]);return a}},Ds.sequenceS=function(t){return function(n){for(var r=Object.keys(n),i=r.length,o=DE(r),a=t.map(n[r[0]],o),u=1;u<i;u++)a=t.ap(a,n[r[u]]);return a}};var DA={};function Dj(t,n){return function(r){return function(i){return t.map(i,function(t){return n.map(t,r)})}}}Object.defineProperty(DA,"__esModule",{value:!0}),DA.getFunctorComposition=DA.bindTo=DA.flap=DA.map=void 0,DA.map=Dj,DA.flap=function(t){return function(n){return function(r){return t.map(r,function(t){return t(n)})}}},DA.bindTo=function(t){return function(n){return function(r){return t.map(r,function(t){var r;return(r={})[n]=t,r})}}},DA.getFunctorComposition=function(t,n){var r=Dj(t,n);return{map:function(t,n){return(0,Dc.pipe)(t,r(n))}}},Object.defineProperty(Du,"__esModule",{value:!0}),Du.getApplicativeComposition=Du.getApplicativeMonoid=void 0,Du.getApplicativeMonoid=function(t){var n=(0,Ds.getApplySemigroup)(t);return function(r){return{concat:n(r).concat,empty:t.of(r.empty)}}},Du.getApplicativeComposition=function(t,n){var r=(0,DA.getFunctorComposition)(t,n).map,i=(0,Ds.ap)(t,n);return{map:r,of:function(r){return t.of(n.of(r))},ap:function(t,n){return(0,Dc.pipe)(t,i(n))}}};var DN={};Object.defineProperty(DN,"__esModule",{value:!0}),DN.bind=DN.chainFirst=void 0,DN.chainFirst=function(t){return function(n){return function(r){return t.chain(r,function(r){return t.map(n(r),function(){return r})})}}},DN.bind=function(t){return function(n,r){return function(i){return t.chain(i,function(i){return t.map(r(i),function(t){var r;return Object.assign({},i,((r={})[n]=t,r))})})}}};var DP={};Object.defineProperty(DP,"__esModule",{value:!0}),DP.tailRec=void 0;var DL=function(t,n){for(var r=n(t);"Left"===r._tag;)r=n(r.left);return r.right};DP.tailRec=DL;var DF={},DD=O&&O.__createBinding||(Object.create?function(t,n,r,i){void 0===i&&(i=r);var o=Object.getOwnPropertyDescriptor(n,r);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[r]}}),Object.defineProperty(t,i,o)}:function(t,n,r,i){void 0===i&&(i=r),t[i]=n[r]}),DW=O&&O.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),DU=O&&O.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&DD(n,t,r);return DW(n,t),n};Object.defineProperty(DF,"__esModule",{value:!0}),DF.filterOrElse=DF.chainFirstEitherK=DF.chainEitherK=DF.fromEitherK=DF.chainOptionK=DF.fromOptionK=DF.fromPredicate=DF.fromOption=void 0;var Dz=DU(Dl);function DB(t){return function(n){return function(r){return t.fromEither(Dz.isNone(r)?Dz.left(n()):Dz.right(r.value))}}}function Dq(t){var n=DB(t);return function(t){var r=n(t);return function(t){return(0,Dc.flow)(t,r)}}}function DV(t){return function(n){return(0,Dc.flow)(n,t.fromEither)}}DF.fromOption=DB,DF.fromPredicate=function(t){return function(n,r){return function(i){return t.fromEither(n(i)?Dz.right(i):Dz.left(r(i)))}}},DF.fromOptionK=Dq,DF.chainOptionK=function(t,n){var r=Dq(t);return function(t){var i=r(t);return function(t){return function(r){return n.chain(r,i(t))}}}},DF.fromEitherK=DV,DF.chainEitherK=function(t,n){var r=DV(t);return function(t){return function(i){return n.chain(i,r(t))}}},DF.chainFirstEitherK=function(t,n){return(0,Dc.flow)(DV(t),(0,DN.chainFirst)(n))},DF.filterOrElse=function(t,n){return function(r,i){return function(o){return n.chain(o,function(n){return t.fromEither(r(n)?Dz.right(n):Dz.left(i(n)))})}}};var D$,DK,DH,DZ,DG,DJ,DY,DQ,DX,D0,D1={};Object.defineProperty(D$=D1,"__esModule",{value:!0}),D$.right=D$.left=D$.flap=D$.Functor=D$.Bifunctor=D$.URI=D$.bimap=D$.mapLeft=D$.map=D$.separated=void 0,DK=function(t,n){return{left:t,right:n}},D$.separated=DK,DH=function(t,n){return(0,Dc.pipe)(t,(0,D$.map)(n))},DZ=function(t,n){return(0,Dc.pipe)(t,(0,D$.mapLeft)(n))},DG=function(t,n,r){return(0,Dc.pipe)(t,(0,D$.bimap)(n,r))},DJ=function(t){return function(n){return(0,D$.separated)((0,D$.left)(n),t((0,D$.right)(n)))}},D$.map=DJ,DY=function(t){return function(n){return(0,D$.separated)(t((0,D$.left)(n)),(0,D$.right)(n))}},D$.mapLeft=DY,DQ=function(t,n){return function(r){return(0,D$.separated)(t((0,D$.left)(r)),n((0,D$.right)(r)))}},D$.bimap=DQ,D$.URI="Separated",D$.Bifunctor={URI:D$.URI,mapLeft:DZ,bimap:DG},D$.Functor={URI:D$.URI,map:DH},D$.flap=(0,DA.flap)(D$.Functor),DX=function(t){return t.left},D$.left=DX,D0=function(t){return t.right},D$.right=D0;var D2={},D3=O&&O.__createBinding||(Object.create?function(t,n,r,i){void 0===i&&(i=r);var o=Object.getOwnPropertyDescriptor(n,r);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[r]}}),Object.defineProperty(t,i,o)}:function(t,n,r,i){void 0===i&&(i=r),t[i]=n[r]}),D4=O&&O.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),D5=O&&O.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&D3(n,t,r);return D4(n,t),n};Object.defineProperty(D2,"__esModule",{value:!0}),D2.filterE=D2.witherDefault=D2.wiltDefault=void 0;var D6=D5(Dl);D2.wiltDefault=function(t,n){return function(r){var i=t.traverse(r);return function(t,o){return r.map(i(t,o),n.separate)}}},D2.witherDefault=function(t,n){return function(r){var i=t.traverse(r);return function(t,o){return r.map(i(t,o),n.compact)}}},D2.filterE=function(t){return function(n){var r=t.wither(n);return function(t){return function(i){return r(i,function(r){return n.map(t(r),function(t){return t?D6.some(r):D6.none})})}}}},WJ=Da,WY=O&&O.__createBinding||(Object.create?function(t,n,r,i){void 0===i&&(i=r);var o=Object.getOwnPropertyDescriptor(n,r);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[r]}}),Object.defineProperty(t,i,o)}:function(t,n,r,i){void 0===i&&(i=r),t[i]=n[r]}),WQ=O&&O.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),WX=O&&O.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&WY(n,t,r);return WQ(n,t),n},Object.defineProperty(WJ,"__esModule",{value:!0}),WJ.fold=WJ.match=WJ.foldW=WJ.matchW=WJ.isRight=WJ.isLeft=WJ.fromOption=WJ.fromPredicate=WJ.FromEither=WJ.MonadThrow=WJ.throwError=WJ.ChainRec=WJ.Extend=WJ.extend=WJ.Alt=WJ.alt=WJ.altW=WJ.Bifunctor=WJ.mapLeft=WJ.bimap=WJ.Traversable=WJ.sequence=WJ.traverse=WJ.Foldable=WJ.reduceRight=WJ.foldMap=WJ.reduce=WJ.Monad=WJ.Chain=WJ.chain=WJ.chainW=WJ.Applicative=WJ.Apply=WJ.ap=WJ.apW=WJ.Pointed=WJ.of=WJ.Functor=WJ.map=WJ.getAltValidation=WJ.getApplicativeValidation=WJ.getWitherable=WJ.getFilterable=WJ.getCompactable=WJ.getSemigroup=WJ.getEq=WJ.getShow=WJ.URI=WJ.right=WJ.left=void 0,WJ.getValidation=WJ.getValidationMonoid=WJ.getValidationSemigroup=WJ.getApplyMonoid=WJ.getApplySemigroup=WJ.either=WJ.stringifyJSON=WJ.parseJSON=WJ.sequenceArray=WJ.traverseArray=WJ.traverseArrayWithIndex=WJ.traverseReadonlyArrayWithIndex=WJ.traverseReadonlyNonEmptyArrayWithIndex=WJ.ApT=WJ.apSW=WJ.apS=WJ.bindW=WJ.bind=WJ.bindTo=WJ.Do=WJ.exists=WJ.elem=WJ.toError=WJ.toUnion=WJ.chainNullableK=WJ.fromNullableK=WJ.tryCatchK=WJ.tryCatch=WJ.fromNullable=WJ.orElse=WJ.orElseW=WJ.swap=WJ.filterOrElseW=WJ.filterOrElse=WJ.chainOptionK=WJ.fromOptionK=WJ.duplicate=WJ.flatten=WJ.flattenW=WJ.chainFirstW=WJ.chainFirst=WJ.apSecondW=WJ.apSecond=WJ.apFirstW=WJ.apFirst=WJ.flap=WJ.getOrElse=WJ.getOrElseW=void 0,W0=WX(Dl),WJ.left=W0.left,WJ.right=W0.right,W1=function(t,n){return(0,Dc.pipe)(t,(0,WJ.map)(n))},W2=function(t,n){return(0,Dc.pipe)(t,(0,WJ.ap)(n))},W3=function(t,n){return(0,Dc.pipe)(t,(0,WJ.chain)(n))},W4=function(t,n,r){return(0,Dc.pipe)(t,(0,WJ.reduce)(n,r))},W5=function(t){return function(n,r){var i=(0,WJ.foldMap)(t);return(0,Dc.pipe)(n,i(r))}},W6=function(t,n,r){return(0,Dc.pipe)(t,(0,WJ.reduceRight)(n,r))},W9=function(t){var n=(0,WJ.traverse)(t);return function(t,r){return(0,Dc.pipe)(t,n(r))}},W8=function(t,n,r){return(0,Dc.pipe)(t,(0,WJ.bimap)(n,r))},W7=function(t,n){return(0,Dc.pipe)(t,(0,WJ.mapLeft)(n))},Ue=function(t,n){return(0,Dc.pipe)(t,(0,WJ.alt)(n))},Ut=function(t,n){return(0,Dc.pipe)(t,(0,WJ.extend)(n))},Un=function(t,n){return(0,DP.tailRec)(n(t),function(t){return(0,WJ.isLeft)(t)?(0,WJ.right)((0,WJ.left)(t.left)):(0,WJ.isLeft)(t.right)?(0,WJ.left)(n(t.right.left)):(0,WJ.right)((0,WJ.right)(t.right.right))})},WJ.URI="Either",Ur=function(t,n){return{show:function(r){return(0,WJ.isLeft)(r)?"left(".concat(t.show(r.left),")"):"right(".concat(n.show(r.right),")")}}},WJ.getShow=Ur,Ui=function(t,n){return{equals:function(r,i){return r===i||((0,WJ.isLeft)(r)?(0,WJ.isLeft)(i)&&t.equals(r.left,i.left):(0,WJ.isRight)(i)&&n.equals(r.right,i.right))}}},WJ.getEq=Ui,Uo=function(t){return{concat:function(n,r){return(0,WJ.isLeft)(r)?n:(0,WJ.isLeft)(n)?r:(0,WJ.right)(t.concat(n.right,r.right))}}},WJ.getSemigroup=Uo,Ua=function(t){var n=(0,WJ.left)(t.empty);return{URI:WJ.URI,_E:void 0,compact:function(t){return(0,WJ.isLeft)(t)?t:"None"===t.right._tag?n:(0,WJ.right)(t.right.value)},separate:function(t){return(0,WJ.isLeft)(t)?(0,D1.separated)(t,t):(0,WJ.isLeft)(t.right)?(0,D1.separated)((0,WJ.right)(t.right.left),n):(0,D1.separated)(n,(0,WJ.right)(t.right.right))}}},WJ.getCompactable=Ua,Uu=function(t){var n=(0,WJ.left)(t.empty),r=(0,WJ.getCompactable)(t),i=r.compact,o=r.separate,a=function(t,r){return(0,WJ.isLeft)(t)||r(t.right)?t:n},u=function(t,r){return(0,WJ.isLeft)(t)?(0,D1.separated)(t,t):r(t.right)?(0,D1.separated)(n,(0,WJ.right)(t.right)):(0,D1.separated)((0,WJ.right)(t.right),n)};return{URI:WJ.URI,_E:void 0,map:W1,compact:i,separate:o,filter:a,filterMap:function(t,r){if((0,WJ.isLeft)(t))return t;var i=r(t.right);return"None"===i._tag?n:(0,WJ.right)(i.value)},partition:u,partitionMap:function(t,r){if((0,WJ.isLeft)(t))return(0,D1.separated)(t,t);var i=r(t.right);return(0,WJ.isLeft)(i)?(0,D1.separated)((0,WJ.right)(i.left),n):(0,D1.separated)(n,(0,WJ.right)(i.right))}}},WJ.getFilterable=Uu,Us=function(t){var n=(0,WJ.getFilterable)(t),r=(0,WJ.getCompactable)(t);return{URI:WJ.URI,_E:void 0,map:W1,compact:n.compact,separate:n.separate,filter:n.filter,filterMap:n.filterMap,partition:n.partition,partitionMap:n.partitionMap,traverse:W9,sequence:WJ.sequence,reduce:W4,foldMap:W5,reduceRight:W6,wither:(0,D2.witherDefault)(WJ.Traversable,r),wilt:(0,D2.wiltDefault)(WJ.Traversable,r)}},WJ.getWitherable=Us,Uc=function(t){return{URI:WJ.URI,_E:void 0,map:W1,ap:function(n,r){return(0,WJ.isLeft)(n)?(0,WJ.isLeft)(r)?(0,WJ.left)(t.concat(n.left,r.left)):n:(0,WJ.isLeft)(r)?r:(0,WJ.right)(n.right(r.right))},of:WJ.of}},WJ.getApplicativeValidation=Uc,Ul=function(t){return{URI:WJ.URI,_E:void 0,map:W1,alt:function(n,r){if((0,WJ.isRight)(n))return n;var i=r();return(0,WJ.isLeft)(i)?(0,WJ.left)(t.concat(n.left,i.left)):i}}},WJ.getAltValidation=Ul,Uf=function(t){return function(n){return(0,WJ.isLeft)(n)?n:(0,WJ.right)(t(n.right))}},WJ.map=Uf,WJ.Functor={URI:WJ.URI,map:W1},WJ.of=WJ.right,WJ.Pointed={URI:WJ.URI,of:WJ.of},Ud=function(t){return function(n){return(0,WJ.isLeft)(n)?n:(0,WJ.isLeft)(t)?t:(0,WJ.right)(n.right(t.right))}},WJ.apW=Ud,WJ.ap=WJ.apW,WJ.Apply={URI:WJ.URI,map:W1,ap:W2},WJ.Applicative={URI:WJ.URI,map:W1,ap:W2,of:WJ.of},Up=function(t){return function(n){return(0,WJ.isLeft)(n)?n:t(n.right)}},WJ.chainW=Up,WJ.chain=WJ.chainW,WJ.Chain={URI:WJ.URI,map:W1,ap:W2,chain:W3},WJ.Monad={URI:WJ.URI,map:W1,ap:W2,of:WJ.of,chain:W3},Uh=function(t,n){return function(r){return(0,WJ.isLeft)(r)?t:n(t,r.right)}},WJ.reduce=Uh,Um=function(t){return function(n){return function(r){return(0,WJ.isLeft)(r)?t.empty:n(r.right)}}},WJ.foldMap=Um,Ug=function(t,n){return function(r){return(0,WJ.isLeft)(r)?t:n(r.right,t)}},WJ.reduceRight=Ug,WJ.Foldable={URI:WJ.URI,reduce:W4,foldMap:W5,reduceRight:W6},Uy=function(t){return function(n){return function(r){return(0,WJ.isLeft)(r)?t.of((0,WJ.left)(r.left)):t.map(n(r.right),WJ.right)}}},WJ.traverse=Uy,Uv=function(t){return function(n){return(0,WJ.isLeft)(n)?t.of((0,WJ.left)(n.left)):t.map(n.right,WJ.right)}},WJ.sequence=Uv,WJ.Traversable={URI:WJ.URI,map:W1,reduce:W4,foldMap:W5,reduceRight:W6,traverse:W9,sequence:WJ.sequence},Ub=function(t,n){return function(r){return(0,WJ.isLeft)(r)?(0,WJ.left)(t(r.left)):(0,WJ.right)(n(r.right))}},WJ.bimap=Ub,Ux=function(t){return function(n){return(0,WJ.isLeft)(n)?(0,WJ.left)(t(n.left)):n}},WJ.mapLeft=Ux,WJ.Bifunctor={URI:WJ.URI,bimap:W8,mapLeft:W7},U_=function(t){return function(n){return(0,WJ.isLeft)(n)?t():n}},WJ.altW=U_,WJ.alt=WJ.altW,WJ.Alt={URI:WJ.URI,map:W1,alt:Ue},US=function(t){return function(n){return(0,WJ.isLeft)(n)?n:(0,WJ.right)(t(n))}},WJ.extend=US,WJ.Extend={URI:WJ.URI,map:W1,extend:Ut},WJ.ChainRec={URI:WJ.URI,map:W1,ap:W2,chain:W3,chainRec:Un},WJ.throwError=WJ.left,WJ.MonadThrow={URI:WJ.URI,map:W1,ap:W2,of:WJ.of,chain:W3,throwError:WJ.throwError},WJ.FromEither={URI:WJ.URI,fromEither:Dc.identity},WJ.fromPredicate=(0,DF.fromPredicate)(WJ.FromEither),WJ.fromOption=(0,DF.fromOption)(WJ.FromEither),WJ.isLeft=W0.isLeft,WJ.isRight=W0.isRight,UT=function(t,n){return function(r){return(0,WJ.isLeft)(r)?t(r.left):n(r.right)}},WJ.matchW=UT,WJ.foldW=WJ.matchW,WJ.match=WJ.matchW,WJ.fold=WJ.match,Uw=function(t){return function(n){return(0,WJ.isLeft)(n)?t(n.left):n.right}},WJ.getOrElseW=Uw,WJ.getOrElse=WJ.getOrElseW,WJ.flap=(0,DA.flap)(WJ.Functor),WJ.apFirst=(0,Ds.apFirst)(WJ.Apply),WJ.apFirstW=WJ.apFirst,WJ.apSecond=(0,Ds.apSecond)(WJ.Apply),WJ.apSecondW=WJ.apSecond,WJ.chainFirst=(0,DN.chainFirst)(WJ.Chain),WJ.chainFirstW=WJ.chainFirst,WJ.flattenW=(0,WJ.chainW)(Dc.identity),WJ.flatten=WJ.flattenW,WJ.duplicate=(0,WJ.extend)(Dc.identity),WJ.fromOptionK=(0,DF.fromOptionK)(WJ.FromEither),WJ.chainOptionK=(0,DF.chainOptionK)(WJ.FromEither,WJ.Chain),WJ.filterOrElse=(0,DF.filterOrElse)(WJ.FromEither,WJ.Chain),WJ.filterOrElseW=WJ.filterOrElse,UO=function(t){return(0,WJ.isLeft)(t)?(0,WJ.right)(t.left):(0,WJ.left)(t.right)},WJ.swap=UO,Uk=function(t){return function(n){return(0,WJ.isLeft)(n)?t(n.left):n}},WJ.orElseW=Uk,WJ.orElse=WJ.orElseW,UI=function(t){return function(n){return null==n?(0,WJ.left)(t):(0,WJ.right)(n)}},WJ.fromNullable=UI,UM=function(t,n){try{return(0,WJ.right)(t())}catch(r){return(0,WJ.left)(n(r))}},WJ.tryCatch=UM,UC=function(t,n){return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return(0,WJ.tryCatch)(function(){return t.apply(void 0,r)},n)}},WJ.tryCatchK=UC,UR=function(t){var n=(0,WJ.fromNullable)(t);return function(t){return(0,Dc.flow)(t,n)}},WJ.fromNullableK=UR,UE=function(t){var n=(0,WJ.fromNullableK)(t);return function(t){return(0,WJ.chain)(n(t))}},WJ.chainNullableK=UE,WJ.toUnion=(0,WJ.foldW)(Dc.identity,Dc.identity),WJ.toError=function(t){return t instanceof Error?t:Error(String(t))},WJ.elem=function t(n){return function(r,i){if(void 0===i){var o=t(n);return function(t){return o(r,t)}}return!(0,WJ.isLeft)(i)&&n.equals(r,i.right)}},UA=function(t){return function(n){return!(0,WJ.isLeft)(n)&&t(n.right)}},WJ.exists=UA,WJ.Do=(0,WJ.of)(W0.emptyRecord),WJ.bindTo=(0,DA.bindTo)(WJ.Functor),WJ.bind=(0,DN.bind)(WJ.Chain),WJ.bindW=WJ.bind,WJ.apS=(0,Ds.apS)(WJ.Apply),WJ.apSW=WJ.apS,WJ.ApT=(0,WJ.of)(W0.emptyReadonlyArray),Uj=function(t){return function(n){var r=t(0,W0.head(n));if((0,WJ.isLeft)(r))return r;for(var i=[r.right],o=1;o<n.length;o++){var a=t(o,n[o]);if((0,WJ.isLeft)(a))return a;i.push(a.right)}return(0,WJ.right)(i)}},WJ.traverseReadonlyNonEmptyArrayWithIndex=Uj,UN=function(t){var n=(0,WJ.traverseReadonlyNonEmptyArrayWithIndex)(t);return function(t){return W0.isNonEmpty(t)?n(t):WJ.ApT}},WJ.traverseReadonlyArrayWithIndex=UN,WJ.traverseArrayWithIndex=WJ.traverseReadonlyArrayWithIndex,UP=function(t){return(0,WJ.traverseReadonlyArrayWithIndex)(function(n,r){return t(r)})},WJ.traverseArray=UP,WJ.sequenceArray=(0,WJ.traverseArray)(Dc.identity),WJ.parseJSON=function(t,n){return(0,WJ.tryCatch)(function(){return JSON.parse(t)},n)},UL=function(t,n){return(0,WJ.tryCatch)(function(){var n=JSON.stringify(t);if("string"!=typeof n)throw Error("Converting unsupported structure to JSON");return n},n)},WJ.stringifyJSON=UL,WJ.either={URI:WJ.URI,map:W1,of:WJ.of,ap:W2,chain:W3,reduce:W4,foldMap:W5,reduceRight:W6,traverse:W9,sequence:WJ.sequence,bimap:W8,mapLeft:W7,alt:Ue,extend:Ut,chainRec:Un,throwError:WJ.throwError},WJ.getApplySemigroup=(0,Ds.getApplySemigroup)(WJ.Apply),WJ.getApplyMonoid=(0,Du.getApplicativeMonoid)(WJ.Applicative),UF=function(t,n){return(0,Ds.getApplySemigroup)((0,WJ.getApplicativeValidation)(t))(n)},WJ.getValidationSemigroup=UF,UD=function(t,n){return(0,Du.getApplicativeMonoid)((0,WJ.getApplicativeValidation)(t))(n)},WJ.getValidationMonoid=UD,WJ.getValidation=function(t){var n=(0,WJ.getApplicativeValidation)(t).ap,r=(0,WJ.getAltValidation)(t).alt;return{URI:WJ.URI,_E:void 0,map:W1,of:WJ.of,chain:W3,bimap:W8,mapLeft:W7,reduce:W4,foldMap:W5,reduceRight:W6,extend:Ut,traverse:W9,sequence:WJ.sequence,chainRec:Un,throwError:WJ.throwError,ap:n,alt:r}};var D9=globalThis&&globalThis.__extends||(UW=function(t,n){return(UW=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])})(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}UW(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}),D8=globalThis&&globalThis.__assign||function(){return(D8=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t}).apply(this,arguments)},D7=globalThis&&globalThis.__spreadArray||function(t,n,r){if(r||2===arguments.length)for(var i,o=0,a=n.length;o<a;o++)!i&&o in n||(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return t.concat(i||Array.prototype.slice.call(n))},We=function(t,n,r){return e_([{value:t,context:n,message:r}])},Wt=function(){function t(t,n,r,i){this.name=t,this.is=n,this.validate=r,this.encode=i,this.decode=this.decode.bind(this)}return t.prototype.pipe=function(n,r){var i=this;return void 0===r&&(r="pipe(".concat(this.name,", ").concat(n.name,")")),new t(r,n.is,function(t,r){var o=i.validate(t,r);return ml(o)?o:n.validate(o.right,r)},this.encode===Wn&&n.encode===Wn?Wn:function(t){return i.encode(n.encode(t))})},t.prototype.asDecoder=function(){return this},t.prototype.asEncoder=function(){return this},t.prototype.decode=function(t){return this.validate(t,[{key:"",type:this,actual:t}])},t}(),Wn=function(t){return t};function Wr(t){return t.displayName||t.name||"<function".concat(t.length,">")}function Wi(t,n,r,i){for(var o=t.length,a=Array(o+1),u=0;u<o;u++)a[u]=t[u];return a[o]={key:n,type:r,actual:i},a}function Wo(t,n){for(var r=n.length,i=0;i<r;i++)t.push(n[i])}var Wa=Object.prototype.hasOwnProperty;function Wu(t){return Object.keys(t).map(function(n){return"".concat(n,": ").concat(t[n].name)}).join(", ")}function Ws(t){for(var n=0;n<t.length;n++)if(t[n].encode!==Wn)return!1;return!0}function Wc(t){return"{ ".concat(Wu(t)," }")}function Wl(t){return"Partial<".concat(t,">")}function Wf(t){if(Wb(t)){var n,r,i=t.value;if(WN.is(i))return(n={})[i]=null,n}else{if(r=t,"KeyofType"===r._tag)return t.keys;if(W_(t)){var o=t.types.map(function(t){return Wf(t)});return o.some(WM.is)?void 0:Object.assign.apply(Object,D7([{}],o,!1))}}}function Wd(t){return"("+t.map(function(t){return t.name}).join(" | ")+")"}function Wp(t,n){for(var r=!0,i=!0,o=!WV.is(t),a=0;a<n.length;a++){var u=n[a];u!==t&&(r=!1),WV.is(u)&&(i=!1)}if(r)return t;if(i)return n[n.length-1];for(var s={},c=0;c<n.length;c++){var u=n[c];for(var l in u)(!Wa.call(s,l)||o||u[l]!==t[l])&&(s[l]=u[l])}return s}function Wh(t,n){for(var r=Object.getOwnPropertyNames(t),i=!1,o={},a=0;a<r.length;a++){var u=r[a];Wa.call(n,u)?o[u]=t[u]:i=!0}return i?o:t}function Wm(t){return t.length>0}var Wg={};function Wy(t,n){for(var r=[],i=0;i<t.length;i++){var o=t[i];-1!==n.indexOf(o)&&r.push(o)}return r}function Wv(t){return"AnyType"===t._tag}function Wb(t){return"LiteralType"===t._tag}function Wx(t){return"InterfaceType"===t._tag}function W_(t){return"UnionType"===t._tag}var WS=[];function WT(t){if(-1!==WS.indexOf(t))return Wg;if(Wx(t)||"StrictType"===(n=t)._tag){var n,r,i,o,a,u=Wg;for(var s in t.props){var c=t.props[s];Wb(c)&&(u===Wg&&(u={}),u[s]=[c.value])}return u}if("ExactType"===t._tag||"RefinementType"===t._tag)return WT(t.type);if("IntersectionType"===t._tag)return t.types.reduce(function(t,n){return function(t,n){if(t===Wg)return n;if(n===Wg)return t;var r=Object.assign({},t);for(var i in n)if(Wa.call(t,i)){var o=Wy(t[i],n[i]);if(Wm(o))r[i]=o;else{r=Wg;break}}else r[i]=n[i];return r}(t,WT(n))},Wg);if(W_(t))return t.types.slice(1).reduce(function(t,n){return function(t,n){if(t===Wg||n===Wg)return Wg;var r=Wg;for(var i in t)Wa.call(n,i)&&0===Wy(t[i],n[i]).length&&(r===Wg&&(r={}),r[i]=t[i].concat(n[i]));return r}(t,WT(n))},WT(t.types[0]));if("RecursiveType"===t._tag){WS.push(t);var l=WT(t.type);return WS.pop(),l}return Wg}function Ww(t){var n=WT(t[0]),r=Object.keys(n),i=t.length;e:for(var o=0;o<r.length;o++){var a=function(r){for(var o=n[r].slice(),a=[n[r]],u=1;u<i;u++){var s=WT(t[u])[r];if(void 0===s||s.some(function(t){return -1!==o.indexOf(t)}))return"continue-keys";o.push.apply(o,s),a.push(s)}return{value:[r,a]}}(r[o]);if("object"==typeof a)return a.value;if("continue-keys"===a)continue e}}var WO=function(t){function n(){var n=t.call(this,"null",function(t){return null===t},function(t,r){return n.is(t)?eS(t):We(t,r)},Wn)||this;return n._tag="NullType",n}return D9(n,t),n}(Wt),Wk=new WO,WI=function(t){function n(){var n=t.call(this,"undefined",function(t){return void 0===t},function(t,r){return n.is(t)?eS(t):We(t,r)},Wn)||this;return n._tag="UndefinedType",n}return D9(n,t),n}(Wt),WM=new WI,WC=function(t){function n(){var n=t.call(this,"void",WM.is,WM.validate,Wn)||this;return n._tag="VoidType",n}return D9(n,t),n}(Wt),WR=new WC,WE=function(t){function n(){var n=t.call(this,"unknown",function(t){return!0},eS,Wn)||this;return n._tag="UnknownType",n}return D9(n,t),n}(Wt),WA=new WE,Wj=function(t){function n(){var n=t.call(this,"string",function(t){return"string"==typeof t},function(t,r){return n.is(t)?eS(t):We(t,r)},Wn)||this;return n._tag="StringType",n}return D9(n,t),n}(Wt),WN=new Wj,WP=function(t){function n(){var n=t.call(this,"number",function(t){return"number"==typeof t},function(t,r){return n.is(t)?eS(t):We(t,r)},Wn)||this;return n._tag="NumberType",n}return D9(n,t),n}(Wt),WL=new WP,WF=function(t){function n(){var n=t.call(this,"bigint",function(t){return"bigint"==typeof t},function(t,r){return n.is(t)?eS(t):We(t,r)},Wn)||this;return n._tag="BigIntType",n}return D9(n,t),n}(Wt),WD=new WF,WW=function(t){function n(){var n=t.call(this,"boolean",function(t){return"boolean"==typeof t},function(t,r){return n.is(t)?eS(t):We(t,r)},Wn)||this;return n._tag="BooleanType",n}return D9(n,t),n}(Wt),WU=new WW,Wz=function(t){function n(){var n=t.call(this,"UnknownArray",Array.isArray,function(t,r){return n.is(t)?eS(t):We(t,r)},Wn)||this;return n._tag="AnyArrayType",n}return D9(n,t),n}(Wt),WB=new Wz,Wq=function(t){function n(){var n=t.call(this,"UnknownRecord",function(t){var n=Object.prototype.toString.call(t);return"[object Object]"===n||"[object Window]"===n},function(t,r){return n.is(t)?eS(t):We(t,r)},Wn)||this;return n._tag="AnyDictionaryType",n}return D9(n,t),n}(Wt),WV=new Wq,W$=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.value=a,u._tag="LiteralType",u}return D9(n,t),n}(Wt);function WK(t,n){void 0===n&&(n=JSON.stringify(t));var r=function(n){return n===t};return new W$(n,r,function(n,i){return r(n)?eS(t):We(n,i)},Wn,t)}var WH=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.keys=a,u._tag="KeyofType",u}return D9(n,t),n}(Wt),WZ=function(t){function n(n,r,i,o,a,u){var s=t.call(this,n,r,i,o)||this;return s.type=a,s.predicate=u,s._tag="RefinementType",s}return D9(n,t),n}(Wt);function WG(t,n,r){return zl(t,n,r)}var WJ,WY,WQ,WX,W0,W1,W2,W3,W4,W5,W6,W9,W8,W7,Ue,Ut,Un,Ur,Ui,Uo,Ua,Uu,Us,Uc,Ul,Uf,Ud,Up,Uh,Um,Ug,Uy,Uv,Ub,Ux,U_,US,UT,Uw,UO,Uk,UI,UM,UC,UR,UE,UA,Uj,UN,UP,UL,UF,UD,UW,UU,Uz,UB=zl(WL,Uz=function(t){return Number.isInteger(t)},"Int"),Uq=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.runDefinition=a,u._tag="RecursiveType",u}return D9(n,t),n}(Wt);function UV(t,n){var r,i=function(){return r||((r=n(o)).name=t),r},o=new Uq(t,function(t){return i().is(t)},function(t,n){return i().validate(t,n)},function(t){return i().encode(t)},i);return o}Object.defineProperty(Uq.prototype,"type",{get:function(){return this.runDefinition()},enumerable:!0,configurable:!0});var U$=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.type=a,u._tag="ArrayType",u}return D9(n,t),n}(Wt);function UK(t,n){return void 0===n&&(n="Array<".concat(t.name,">")),new U$(n,function(n){return WB.is(n)&&n.every(t.is)},function(n,r){var i=WB.validate(n,r);if(ml(i))return i;for(var o=i.right,a=o.length,u=o,s=[],c=0;c<a;c++){var l=o[c],f=t.validate(l,Wi(r,String(c),t,l));if(ml(f))Wo(s,f.left);else{var d=f.right;d!==l&&(u===o&&(u=o.slice()),u[c]=d)}}return s.length>0?e_(s):eS(u)},t.encode===Wn?Wn:function(n){return n.map(t.encode)},t)}var UH=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.props=a,u._tag="InterfaceType",u}return D9(n,t),n}(Wt);function UZ(t,n){void 0===n&&(n=Wc(t));var r=Object.keys(t),i=r.map(function(n){return t[n]}),o=r.length;return new UH(n,function(t){if(WV.is(t)){for(var n=0;n<o;n++){var a=r[n],u=t[a];if(void 0===u&&!Wa.call(t,a)||!i[n].is(u))return!1}return!0}return!1},function(t,n){var a=WV.validate(t,n);if(ml(a))return a;for(var u=a.right,s=u,c=[],l=0;l<o;l++){var f=r[l],d=s[f],p=i[l],h=p.validate(d,Wi(n,f,p,d));if(ml(h))Wo(c,h.left);else{var m=h.right;m===d&&(void 0!==m||Wa.call(s,f))||(s===u&&(s=D8({},u)),s[f]=m)}}return c.length>0?e_(c):eS(s)},Ws(i)?Wn:function(t){for(var n=D8({},t),a=0;a<o;a++){var u=r[a],s=i[a].encode;s!==Wn&&(n[u]=s(t[u]))}return n},t)}var UG=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.props=a,u._tag="PartialType",u}return D9(n,t),n}(Wt),UJ=function(t){function n(n,r,i,o,a,u){var s=t.call(this,n,r,i,o)||this;return s.domain=a,s.codomain=u,s._tag="DictionaryType",s}return D9(n,t),n}(Wt);function UY(t,n,r){var i,o,a,u,s,c,l,f,d=Wf(t);return d?(i=Object.keys(d),void 0===(u=r)&&(u="{ [K in ".concat(t.name,"]: ").concat(n.name," }")),s=i.length,new UJ(u,function(t){return WV.is(t)&&i.every(function(r){return n.is(t[r])})},function(t,r){var o=WV.validate(t,r);if(ml(o))return o;for(var a=o.right,u={},c=[],l=!1,f=0;f<s;f++){var d=i[f],p=a[d],h=n.validate(p,Wi(r,d,n,p));if(ml(h))Wo(c,h.left);else{var m=h.right;l=l||m!==p,u[d]=m}}return c.length>0?e_(c):eS(l||Object.keys(a).length!==s?u:a)},n.encode===Wn?Wn:function(t){for(var r={},o=0;o<s;o++){var a=i[o];r[a]=n.encode(t[a])}return r},t,n)):(c=t,void 0===(f=r)&&(f="{ [K in ".concat(c.name,"]: ").concat(n.name," }")),new UJ(f,function(t){return WV.is(t)?Object.keys(t).every(function(r){return c.is(r)&&n.is(t[r])}):Wv(n)&&Array.isArray(t)},function(t,r){if(WV.is(t)){for(var i={},o=[],a=Object.keys(t),u=a.length,s=!1,l=0;l<u;l++){var f=a[l],d=t[f],p=c.validate(f,Wi(r,f,c,f));if(ml(p))Wo(o,p.left);else{var h=p.right;s=s||h!==f,f=h;var m=n.validate(d,Wi(r,f,n,d));if(ml(m))Wo(o,m.left);else{var g=m.right;s=s||g!==d,i[f]=g}}}return o.length>0?e_(o):eS(s?i:t)}return Wv(n)&&Array.isArray(t)?eS(t):We(t,r)},c.encode===Wn&&n.encode===Wn?Wn:function(t){for(var r={},i=Object.keys(t),o=i.length,a=0;a<o;a++){var u=i[a];r[String(c.encode(u))]=n.encode(t[u])}return r},c,n))}var UQ=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.types=a,u._tag="UnionType",u}return D9(n,t),n}(Wt);function UX(t,n){void 0===n&&(n=Wd(t));var r=Ww(t);if(void 0===r||!(t.length>0))return new UQ(n,function(n){return t.some(function(t){return t.is(n)})},function(n,r){for(var i=[],o=0;o<t.length;o++){var a=t[o],u=a.validate(n,Wi(r,String(o),a,n));if(!ml(u))return eS(u.right);Wo(i,u.left)}return e_(i)},Ws(t)?Wn:function(r){for(var i=0;i<t.length;i++){var o=t[i];if(o.is(r))return o.encode(r)}throw Error("no codec found to encode value in union type ".concat(n))},t);var i=r[0],o=r[1],a=o.length,u=function(t){for(var n=0;n<a;n++)if(-1!==o[n].indexOf(t))return n};return new ze(n,function(n){if(WV.is(n)){var r=u(n[i]);return void 0!==r&&t[r].is(n)}return!1},function(n,r){var o=WV.validate(n,r);if(ml(o))return o;var a=o.right,s=u(a[i]);if(void 0===s)return We(n,r);var c=t[s];return c.validate(a,Wi(r,String(s),c,a))},Ws(t)?Wn:function(r){var o=u(r[i]);if(void 0===o)throw Error("no codec found to encode value in union codec ".concat(n));return t[o].encode(r)},t,i)}var U0=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.types=a,u._tag="IntersectionType",u}return D9(n,t),n}(Wt),U1=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.types=a,u._tag="TupleType",u}return D9(n,t),n}(Wt),U2=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.type=a,u._tag="ReadonlyType",u}return D9(n,t),n}(Wt),U3=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.type=a,u._tag="ReadonlyArrayType",u}return D9(n,t),n}(Wt);function U4(t,n){void 0===n&&(n="ReadonlyArray<".concat(t.name,">"));var r=UK(t);return new U3(n,r.is,r.validate,r.encode,t)}var U5=function(t,n){return U9(UZ(t),n)},U6=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.type=a,u._tag="ExactType",u}return D9(n,t),n}(Wt);function U9(t,n){void 0===n&&(n=Wx(i=t)?"{| ".concat(Wu(i.props)," |}"):(r=i,"PartialType"===r._tag)?Wl("{| ".concat(Wu(i.props)," |}")):"Exact<".concat(i.name,">"));var r,i,o=function t(n){switch(n._tag){case"RefinementType":case"ReadonlyType":return t(n.type);case"InterfaceType":case"StrictType":case"PartialType":return n.props;case"IntersectionType":return n.types.reduce(function(n,r){return Object.assign(n,t(r))},{})}}(t);return new U6(n,t.is,function(n,r){var i=WV.validate(n,r);if(ml(i))return i;var a=t.validate(n,r);return ml(a)?a:eS(Wh(a.right,o))},function(n){return t.encode(Wh(n,o))},t)}var U8=function(t){function n(){var n=t.call(this,"Function",function(t){return"function"==typeof t},function(t,r){return n.is(t)?eS(t):We(t,r)},Wn)||this;return n._tag="FunctionType",n}return D9(n,t),n}(Wt),U7=new U8,ze=function(t){function n(n,r,i,o,a,u){var s=t.call(this,n,r,i,o,a)||this;return s.tag=u,s}return D9(n,t),n}(UQ),zt=function(t,n,r){void 0===r&&(r=Wd(n));var i=UX(n,r);return i instanceof ze?i:(console.warn("[io-ts] Cannot build a tagged union for ".concat(r,", returning a de-optimized union")),new ze(r,i.is,i.validate,i.encode,n,t))},zn=function(t,n){return{value:t,context:n}},zr=function(t){return[{key:"",type:t}]},zi=function(t){function n(){var n=t.call(this,"never",function(t){return!1},function(t,n){return We(t,n)},function(){throw Error("cannot encode never")})||this;return n._tag="NeverType",n}return D9(n,t),n}(Wt),zo=new zi,za=function(t){function n(){var n=t.call(this,"any",function(t){return!0},eS,Wn)||this;return n._tag="AnyType",n}return D9(n,t),n}(Wt),zu=new za,zs=function(t){function n(){var n=t.call(this,"object",function(t){return null!==t&&"object"==typeof t},function(t,r){return n.is(t)?eS(t):We(t,r)},Wn)||this;return n._tag="ObjectType",n}return D9(n,t),n}(Wt),zc=new zs;function zl(t,n,r){return void 0===r&&(r="(".concat(t.name," | ").concat(Wr(n),")")),new WZ(r,function(r){return t.is(r)&&n(r)},function(r,i){var o=t.validate(r,i);if(ml(o))return o;var a=o.right;return n(a)?eS(a):We(a,i)},t.encode,t,n)}var zf=zl(WL,Number.isInteger,"Integer"),zd=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.props=a,u._tag="StrictType",u}return D9(n,t),n}(Wt);function zp(t){return t}let zh=Object.freeze(Object.defineProperty({__proto__:null,AnyArrayType:Wz,AnyDictionaryType:Wq,AnyType:za,Array:WB,ArrayType:U$,BigIntType:WF,BooleanType:WW,Dictionary:WV,DictionaryType:UJ,ExactType:U6,Function:U7,FunctionType:U8,Int:UB,Integer:zf,InterfaceType:UH,IntersectionType:U0,KeyofType:WH,LiteralType:W$,NeverType:zi,NullType:WO,NumberType:WP,ObjectType:zs,PartialType:UG,ReadonlyArrayType:U3,ReadonlyType:U2,RecursiveType:Uq,RefinementType:WZ,StrictType:zd,StringType:Wj,TaggedUnionType:ze,TupleType:U1,Type:Wt,UndefinedType:WI,UnionType:UQ,UnknownArray:WB,UnknownRecord:WV,UnknownType:WE,VoidType:WC,alias:function(t){return function(){return t}},any:zu,appendContext:Wi,array:UK,bigint:WD,boolean:WU,brand:WG,clean:zp,dictionary:UY,emptyTags:Wg,exact:U9,failure:We,failures:e_,getContextEntry:function(t,n){return{key:t,type:n}},getDefaultContext:zr,getDomainKeys:Wf,getFunctionName:Wr,getIndex:Ww,getTags:WT,getValidationError:zn,identity:Wn,interface:UZ,intersection:function(t,n){void 0===n&&(n="(".concat(t.map(function(t){return t.name}).join(" & "),")"));var r=t.length;return new U0(n,function(n){return t.every(function(t){return t.is(n)})},0===t.length?eS:function(n,i){for(var o=[],a=[],u=0;u<r;u++){var s=t[u],c=s.validate(n,Wi(i,String(u),s,n));ml(c)?Wo(a,c.left):o.push(c.right)}return a.length>0?e_(a):eS(Wp(n,o))},0===t.length?Wn:function(n){return Wp(n,t.map(function(t){return t.encode(n)}))},t)},keyof:function(t,n){void 0===n&&(n=Object.keys(t).map(function(t){return JSON.stringify(t)}).join(" | "));var r=function(n){return WN.is(n)&&Wa.call(t,n)};return new WH(n,r,function(t,n){return r(t)?eS(t):We(t,n)},Wn,t)},literal:WK,mergeAll:Wp,never:zo,null:Wk,nullType:Wk,number:WL,object:zc,partial:function(t,n){void 0===n&&(n=Wl(Wc(t)));var r=Object.keys(t),i=r.map(function(n){return t[n]}),o=r.length;return new UG(n,function(n){if(WV.is(n)){for(var i=0;i<o;i++){var a=r[i],u=n[a];if(void 0!==u&&!t[a].is(u))return!1}return!0}return!1},function(n,i){var a=WV.validate(n,i);if(ml(a))return a;for(var u=a.right,s=u,c=[],l=0;l<o;l++){var f=r[l],d=s[f],p=t[f],h=p.validate(d,Wi(i,f,p,d));if(ml(h))void 0!==d&&Wo(c,h.left);else{var m=h.right;m!==d&&(s===u&&(s=D8({},u)),s[f]=m)}}return c.length>0?e_(c):eS(s)},Ws(i)?Wn:function(t){for(var n=D8({},t),a=0;a<o;a++){var u=r[a],s=t[u];void 0!==s&&(n[u]=i[a].encode(s))}return n},t)},readonly:function(t,n){return void 0===n&&(n="Readonly<".concat(t.name,">")),new U2(n,t.is,t.validate,t.encode,t)},readonlyArray:U4,record:UY,recursion:UV,refinement:zl,strict:U5,string:WN,success:eS,taggedUnion:zt,tuple:function(t,n){void 0===n&&(n="[".concat(t.map(function(t){return t.name}).join(", "),"]"));var r=t.length;return new U1(n,function(n){return WB.is(n)&&n.length===r&&t.every(function(t,r){return t.is(n[r])})},function(n,i){var o=WB.validate(n,i);if(ml(o))return o;for(var a=o.right,u=a.length>r?a.slice(0,r):a,s=[],c=0;c<r;c++){var l=a[c],f=t[c],d=f.validate(l,Wi(i,String(c),f,l));if(ml(d))Wo(s,d.left);else{var p=d.right;p!==l&&(u===a&&(u=a.slice()),u[c]=p)}}return s.length>0?e_(s):eS(u)},Ws(t)?Wn:function(n){return t.map(function(t,r){return t.encode(n[r])})},t)},type:UZ,undefined:WM,union:UX,unknown:WA,void:WR,voidType:WR},Symbol.toStringTag,{value:"Module"})),zm=k(zh);var zg={},zy={},zv={};let zb=k(Y);function zx(t,n,r){return void 0===r&&(r=t.name),new Wt(r,t.is,t.validate,function(r){return n(t.encode(r))})}let z_=Object.freeze(Object.defineProperty({__proto__:null,mapOutput:zx},Symbol.toStringTag,{value:"Module"})),zS=k(z_);Object.defineProperty(zv,"__esModule",{value:!0}),zv.addType=zv.isEmpty=zv.objectToMap=zv.grouped=zv.formatDate=zv.formatDateTime=zv.filterDouble=zv.refineType=zv.nullable=void 0;let zT=oN,zw=(0,zT.__importStar)(zm);zv.nullable=function(t){return zw.union([t,zw.null,zw.undefined])},zv.refineType=function(t,n,r){return new zw.Type(n,t.is,(n,i)=>(0,zb.pipe)(t.validate(n,i),Do.either.chain(t=>r(t)?zw.success(t):zw.failure(n,i))),t.encode)},zv.filterDouble=function(t){if(""===t)return null;let n=Number(t);return Number.isNaN(n)?null:n},zv.formatDateTime=function(t){return t.toISOString().replace(/\.\d{3}Z$/,"+0000")},zv.formatDate=function(t){return t.toISOString().replace(/T.*/,"")},zv.grouped=function(t,n){return t.reduce((t,r,i)=>(i%n==0?t.push([r]):t[Math.floor(i/n)].push(r),t),[])},zv.objectToMap=function(t){return new Map(Object.entries(t))},zv.isEmpty=function(t){for(let n in t)return!1;return!0},zv.addType=function(t,n){return(0,zS.mapOutput)(t,t=>({...t,__TYPE__:n}))},Object.defineProperty(zy,"__esModule",{value:!0}),zy.WidgetKey=void 0;let zO=oN,zk=(0,zO.__importStar)(zm),zI=RegExp("^[^<>]+$");zy.WidgetKey=(0,zv.refineType)(zk.string,"WidgetKey",t=>0===t.length||zI.test(t)),Object.defineProperty(zM=zg,"__esModule",{value:!0}),(0,oN.__exportStar)(zy,zM);var zM,zC,zR,zE,zA={},zj={},zN={};function zP(){if(zE)return zN;zE=1,Object.defineProperty(zN,"__esModule",{value:!0}),zN.hasContentType=zN.hasFieldContentType=void 0;let t=KT();function n(t){return"object"==typeof t&&null!==t&&"__TYPE__"in t}return zN.hasFieldContentType=function(r){return n(r)&&r.__TYPE__===t.FieldContentType&&(null==r?void 0:r.type)!==void 0&&"string"==typeof r.type&&(0,Da.isRight)(t.FieldType.decode(r.type))},zN.hasContentType=n,zN}function zL(){return qx||(qx=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.EmptyContent=t.EmptyLegacy=t.isEmptyContent=t.EmptyContentType=void 0;let n=oN,r=(0,n.__importStar)(zm),i=zP();t.EmptyContentType="EmptyContent";let o=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.EmptyContentType;t.isEmptyContent=o;let a=r.union([r.null,r.type({value:r.null})]),u=n=>new r.Type("EmptyLegacy",t.isEmptyContent,r=>(0,Dc.pipe)(a.decode(r),Do.either.map(()=>({type:n,__TYPE__:t.EmptyContentType}))),()=>null);t.EmptyLegacy=u,t.EmptyContent=r.strict({type:r.string,__TYPE__:r.literal(t.EmptyContentType)})}(zj)),zj}var zF={},zD={},zW={},zU={},zz={},zB={};let zq=k(mK);Object.defineProperty(zB,"__esModule",{value:!0});let zV=oN,z$=(0,zV.__importStar)(zm);zB.default=new z$.Type("dateFromString",t=>t instanceof Date,(t,n)=>(0,zb.pipe)(z$.string.validate(t,n),(0,zq.chain)(r=>{let i=new Date(r);return isNaN(i.getTime())?z$.failure(t,n):z$.success(i)})),t=>t.toISOString());var zK={};Object.defineProperty(zK,"__esModule",{value:!0});let zH=oN,zZ=(0,zH.__importStar)(zm);zK.default=new zZ.Type("dateFromStringOrNumber",t=>t instanceof Date,(t,n)=>(0,zb.pipe)(zZ.union([zZ.number,zZ.string]).validate(t,n),(0,zq.chain)(r=>{let i=new Date(r);return isNaN(i.getTime())?zZ.failure(t,n):zZ.success(i)})),t=>t);var zG={};Object.defineProperty(zG,"__esModule",{value:!0});let zJ=oN,zY=(0,zJ.__importStar)(zm);zG.default=new zY.Type("dateFromTsMs",t=>t instanceof Date,(t,n)=>(0,zb.pipe)(zY.number.validate(t,n),(0,zq.chain)(r=>{let i=new Date(r);return isNaN(i.getTime())?zY.failure(t,n):zY.success(i)})),t=>t.getTime());var zQ={};Object.defineProperty(zQ,"__esModule",{value:!0});let zX=oN,z0=(0,zX.__importStar)(zm);zQ.default=new z0.Type("IntFromNumber",z0.Int.is,(t,n)=>(0,zb.pipe)(z0.number.validate(t,n),(0,zq.chain)(t=>z0.Int.is(t)?z0.success(t):z0.success(Math.round(t)))),z0.Int.encode);var z1={};Object.defineProperty(z1,"__esModule",{value:!0});let z2=oN,z3=(0,z2.__importStar)(zm),z4=/^([0-9]+)px$/;z1.default=new z3.Type("IntFromPixels",z3.Int.is,(t,n)=>(0,zb.pipe)(z3.string.validate(t,n),(0,zq.chain)(r=>{try{let i=r.match(z4);if(!i)return z3.failure(t,n);let o=parseInt(i[1]);return z3.success(o)}catch{return z3.failure(t,n)}})),String);var z5={};Object.defineProperty(z5,"__esModule",{value:!0});let z6=oN,z9=(0,z6.__importStar)(zm);z5.default=(0,zv.refineType)(z9.string,"nonEmptyString",t=>t.trim().length>0);var z8={},z7={};Object.defineProperty(z7,"__esModule",{value:!0});let Be=oN,Bt=(0,Be.__importStar)(zm);z7.default=(0,zv.nullable)(Bt.string),Object.defineProperty(z8,"__esModule",{value:!0});let Bn=oN,Br=(0,Bn.__importDefault)(z7);z8.default=new zm.Type("nonEmptyStringOrNull",t=>"string"==typeof t||null===t,(t,n)=>(0,zb.pipe)(Br.default.validate(t,n),(0,zq.chain)(t=>"string"==typeof t&&t.length>0?(0,zm.success)(t):(0,zm.success)(null))),t=>t);var Bi={};Object.defineProperty(Bi,"__esModule",{value:!0});let Bo=oN,Ba=(0,Bo.__importStar)(zm);Bi.default=(0,zv.nullable)(Ba.number);var Bu={};Object.defineProperty(Bu,"__esModule",{value:!0});let Bs=oN,Bc=(0,Bs.__importStar)(zm);Bu.default=new Bc.Type("StringFromInt",Bc.string.is,(t,n)=>(0,zb.pipe)(Bc.boolean.validate(t,n),(0,zq.chain)(t=>Bc.success(t.toString()))),t=>t);var Bl={};Object.defineProperty(Bl,"__esModule",{value:!0});let Bf=oN,Bd=(0,Bf.__importStar)(zm);Bl.default=new Bd.Type("StringFromInt",Bd.string.is,(t,n)=>(0,zb.pipe)(Bd.number.validate(t,n),(0,zq.chain)(t=>Bd.success(t.toString()))),t=>t),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.StringOrNull=t.StringFromNumber=t.StringFromBoolean=t.NumberOrNull=t.NonEmptyStringOrNull=t.NonEmptyString=t.IntFromPixels=t.IntFromNumber=t.Function=t.DateFromTsMs=t.DateFromStringOrNumber=t.DateFromString=void 0;let n=oN;Object.defineProperty(t,"DateFromString",{enumerable:!0,get:function(){return(0,n.__importDefault)(zB).default}}),Object.defineProperty(t,"DateFromStringOrNumber",{enumerable:!0,get:function(){return(0,n.__importDefault)(zK).default}}),Object.defineProperty(t,"DateFromTsMs",{enumerable:!0,get:function(){return(0,n.__importDefault)(zG).default}}),t.Function=(0,n.__importStar)(zv),Object.defineProperty(t,"IntFromNumber",{enumerable:!0,get:function(){return(0,n.__importDefault)(zQ).default}}),Object.defineProperty(t,"IntFromPixels",{enumerable:!0,get:function(){return(0,n.__importDefault)(z1).default}}),Object.defineProperty(t,"NonEmptyString",{enumerable:!0,get:function(){return(0,n.__importDefault)(z5).default}}),Object.defineProperty(t,"NonEmptyStringOrNull",{enumerable:!0,get:function(){return(0,n.__importDefault)(z8).default}}),Object.defineProperty(t,"NumberOrNull",{enumerable:!0,get:function(){return(0,n.__importDefault)(Bi).default}}),Object.defineProperty(t,"StringFromBoolean",{enumerable:!0,get:function(){return(0,n.__importDefault)(Bu).default}}),Object.defineProperty(t,"StringFromNumber",{enumerable:!0,get:function(){return(0,n.__importDefault)(Bl).default}}),Object.defineProperty(t,"StringOrNull",{enumerable:!0,get:function(){return(0,n.__importDefault)(z7).default}})}(zz);var Bp={},Bh={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanField=t.BooleanConfig=t.BooleanFieldType=void 0;let n=(0,oN.__importStar)(zm);t.BooleanFieldType="Boolean",t.BooleanConfig=n.exact(n.partial({label:zz.StringOrNull,default_value:n.boolean,placeholder_true:n.string,placeholder_false:n.string})),t.BooleanField=n.exact(n.intersection([n.type({type:n.literal(t.BooleanFieldType)}),n.partial({config:t.BooleanConfig})]))}(Bh);var Bm={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Color=t.ColorConfig=t.ColorFieldType=void 0;let n=(0,oN.__importStar)(zm);t.ColorFieldType="Color",t.ColorConfig=n.exact(n.partial({label:zz.StringOrNull,placeholder:n.string})),t.Color=n.exact(n.intersection([n.type({type:n.literal(t.ColorFieldType)}),n.partial({fieldset:zz.StringOrNull,config:t.ColorConfig})]))}(Bm);var Bg={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Date=t.DateConfig=t.DateFieldType=void 0;let n=(0,oN.__importStar)(zm);t.DateFieldType="Date",t.DateConfig=n.exact(n.partial({label:zz.StringOrNull,placeholder:n.string,default:n.string})),t.Date=n.exact(n.intersection([n.type({type:n.literal(t.DateFieldType)}),n.partial({fieldset:zz.StringOrNull,config:t.DateConfig})]))}(Bg);var By={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Embed=t.EmbedConfig=t.EmbedFieldType=void 0;let n=(0,oN.__importStar)(zm);t.EmbedFieldType="Embed",t.EmbedConfig=n.exact(n.partial({label:zz.StringOrNull,placeholder:n.string,useAsTitle:n.boolean})),t.Embed=n.exact(n.intersection([n.type({type:n.literal(t.EmbedFieldType)}),n.partial({fieldset:zz.StringOrNull,config:t.EmbedConfig})]))}(By);var Bv={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.GeoPoint=t.GeoPointConfig=t.GeoPointFieldType=void 0;let n=(0,oN.__importStar)(zm);t.GeoPointFieldType="GeoPoint",t.GeoPointConfig=n.exact(n.partial({label:zz.StringOrNull})),t.GeoPoint=n.exact(n.intersection([n.type({type:n.literal(t.GeoPointFieldType)}),n.partial({fieldset:zz.StringOrNull,config:t.GeoPointConfig})]))}(Bv);var Bb={},Bx={},B_={},BS={},BT={};Object.defineProperty(BT,"__esModule",{value:!0}),BT.pipe=BT.pipeable=void 0,BT.pipeable=function(t){var n,r,i,o,a,u,s,c,l,f,d,p,h,m,g,y={};if("function"==typeof t.map){var v=function(n){return function(r){return t.map(r,n)}};y.map=v}if("function"==typeof t.contramap){var b=function(n){return function(r){return t.contramap(r,n)}};y.contramap=b}if("function"==typeof t.mapWithIndex){var x=function(n){return function(r){return t.mapWithIndex(r,n)}};y.mapWithIndex=x}if("function"==typeof t.ap){var _=function(n){return function(r){return t.ap(r,n)}},S=function(n){return function(r){return t.ap(t.map(r,function(t){return function(){return t}}),n)}};y.ap=_,y.apFirst=S,y.apSecond=function(n){return function(r){return t.ap(t.map(r,function(){return function(t){return t}}),n)}}}if("function"==typeof t.chain){var T=function(n){return function(r){return t.chain(r,n)}},w=function(n){return function(r){return t.chain(r,function(r){return t.map(n(r),function(){return r})})}},O=function(n){return t.chain(n,Dc.identity)};y.chain=T,y.chainFirst=w,y.flatten=O}if("function"==typeof t.bimap){var k=function(n,r){return function(i){return t.bimap(i,n,r)}},I=function(n){return function(r){return t.mapLeft(r,n)}};y.bimap=k,y.mapLeft=I}if("function"==typeof t.extend){var M=function(n){return function(r){return t.extend(r,n)}},C=function(n){return t.extend(n,Dc.identity)};y.extend=M,y.duplicate=C}if("function"==typeof t.reduce){var R=function(n,r){return function(i){return t.reduce(i,n,r)}},E=function(n){var r=t.foldMap(n);return function(t){return function(n){return r(n,t)}}},A=function(n,r){return function(i){return t.reduceRight(i,n,r)}};y.reduce=R,y.foldMap=E,y.reduceRight=A}if("function"==typeof t.reduceWithIndex){var j=function(n,r){return function(i){return t.reduceWithIndex(i,n,r)}},N=function(n){var r=t.foldMapWithIndex(n);return function(t){return function(n){return r(n,t)}}},P=function(n,r){return function(i){return t.reduceRightWithIndex(i,n,r)}};y.reduceWithIndex=j,y.foldMapWithIndex=N,y.reduceRightWithIndex=P}if("function"==typeof t.alt){var L=function(n){return function(r){return t.alt(r,n)}};y.alt=L}if("function"==typeof t.compact&&(y.compact=t.compact,y.separate=t.separate),"function"==typeof t.filter){var F=function(n){return function(r){return t.filter(r,n)}},D=function(n){return function(r){return t.filterMap(r,n)}},W=function(n){return function(r){return t.partition(r,n)}},U=function(n){return function(r){return t.partitionMap(r,n)}};y.filter=F,y.filterMap=D,y.partition=W,y.partitionMap=U}if("function"==typeof t.filterWithIndex){var z=function(n){return function(r){return t.filterWithIndex(r,n)}},B=function(n){return function(r){return t.filterMapWithIndex(r,n)}},q=function(n){return function(r){return t.partitionWithIndex(r,n)}},V=function(n){return function(r){return t.partitionMapWithIndex(r,n)}};y.filterWithIndex=z,y.filterMapWithIndex=B,y.partitionWithIndex=q,y.partitionMapWithIndex=V}if("function"==typeof t.promap){var $=function(n,r){return function(i){return t.promap(i,n,r)}};y.promap=$}if("function"==typeof t.compose){var K=function(n){return function(r){return t.compose(r,n)}};y.compose=K}if("function"==typeof t.throwError){var H=function(n){return function(r){return"None"===r._tag?t.throwError(n()):t.of(r.value)}},Z=function(n){return"Left"===n._tag?t.throwError(n.left):t.of(n.right)},G=function(n,r){return function(i){return n(i)?t.of(i):t.throwError(r(i))}},J=function(n,r){return function(i){return t.chain(i,function(i){return n(i)?t.of(i):t.throwError(r(i))})}};y.fromOption=H,y.fromEither=Z,y.fromPredicate=G,y.filterOrElse=J}return y},BT.pipe=Dc.pipe;var Bw=O&&O.__createBinding||(Object.create?function(t,n,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return n[r]}})}:function(t,n,r,i){void 0===i&&(i=r),t[i]=n[r]}),BO=O&&O.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),Bk=O&&O.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&Bw(n,t,r);return BO(n,t),n};Object.defineProperty(BS,"__esModule",{value:!0}),BS.NumberFromString=void 0;var BI=Bk(zm);BS.NumberFromString=new BI.Type("NumberFromString",BI.number.is,function(t,n){return BT.pipe(BI.string.validate(t,n),Da.chain(function(r){var i=+r;return isNaN(i)||""===r.trim()?BI.failure(t,n):BI.success(i)}))},String);var BM=O&&O.__createBinding||(Object.create?function(t,n,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return n[r]}})}:function(t,n,r,i){void 0===i&&(i=r),t[i]=n[r]}),BC=O&&O.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),BR=O&&O.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&BM(n,t,r);return BC(n,t),n};Object.defineProperty(B_,"__esModule",{value:!0}),B_.IntFromString=void 0;var BE=BR(zm);B_.IntFromString=new BE.Type("IntFromString",BE.Int.is,function(t,n){return BT.pipe(BS.NumberFromString.validate(t,n),Da.chain(function(r){return BE.Int.is(r)?BE.success(r):BE.failure(t,n)}))},BS.NumberFromString.encode),Object.defineProperty(Bx,"__esModule",{value:!0});let BA=oN,Bj=(0,BA.__importStar)(zm),BN=new Bj.Type("SideConstraints",t=>!t||"number"==typeof t,(t,n)=>Da.either.chain(Bj.union([Bj.literal("auto"),Bj.literal(""),Bj.Int,B_.IntFromString,zz.IntFromNumber,zz.IntFromPixels,Bj.null]).validate(t,n),t=>"auto"===t||""===t?Bj.success(null):Bj.success(t)),t=>t),BP=Bj.partial({width:BN,height:BN});Bx.default=BP,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Image=t.ImageConfig=t.Thumbnail=t.ImageFieldType=void 0;let n=oN,r=(0,n.__importStar)(zm),i=(0,n.__importDefault)(Bx);t.ImageFieldType="Image",t.Thumbnail=r.exact(r.intersection([r.type({name:r.string}),i.default])),t.ImageConfig=r.exact(r.partial({label:zz.StringOrNull,placeholder:r.string,constraint:i.default,thumbnails:r.readonlyArray(t.Thumbnail)})),t.Image=r.exact(r.intersection([r.type({type:r.literal(t.ImageFieldType)}),r.partial({fieldset:zz.StringOrNull,config:t.ImageConfig})]))}(Bb);var BL={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.IntegrationField=t.IntegrationFieldConfig=t.IntegrationFieldType=void 0;let n=(0,oN.__importStar)(zm);t.IntegrationFieldType="IntegrationFields",t.IntegrationFieldConfig=n.exact(n.partial({label:zz.StringOrNull,placeholder:n.string,catalog:n.string})),t.IntegrationField=n.exact(n.intersection([n.type({type:n.literal(t.IntegrationFieldType)}),n.partial({fieldset:zz.StringOrNull,config:t.IntegrationFieldConfig})]))}(BL);var BF={},BD={},BW={},BU={};Object.defineProperty(BU,"__esModule",{value:!0}),BU.clone=void 0,BU.clone=function(t){var n=Object.create(Object.getPrototypeOf(t));return Object.assign(n,t),n};var Bz=O&&O.__createBinding||(Object.create?function(t,n,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return n[r]}})}:function(t,n,r,i){void 0===i&&(i=r),t[i]=n[r]}),BB=O&&O.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),Bq=O&&O.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&Bz(n,t,r);return BB(n,t),n};Object.defineProperty(BW,"__esModule",{value:!0}),BW.withValidate=void 0;var BV=Bq(zm);BW.withValidate=function(t,n,r){void 0===r&&(r=t.name);var i=BU.clone(t);return i.validate=n,i.decode=function(t){return n(t,BV.getDefaultContext(i))},i.name=r,i};var B$=O&&O.__createBinding||(Object.create?function(t,n,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return n[r]}})}:function(t,n,r,i){void 0===i&&(i=r),t[i]=n[r]}),BK=O&&O.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),BH=O&&O.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&B$(n,t,r);return BK(n,t),n};Object.defineProperty(BD,"__esModule",{value:!0}),BD.withFallback=void 0;var BZ=BH(zm);BD.withFallback=function(t,n,r){return void 0===r&&(r="withFallback("+t.name+")"),BW.withValidate(t,function(r,i){return Da.orElse(function(){return BZ.success(n)})(t.validate(r,i))},r)},function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Link=t.LinkConfig=t.LinkFieldType=void 0;let n=oN,r=(0,n.__importStar)(zm),i=t=>{if(t instanceof Array&&t.reduce((t,n)=>t&&"string"==typeof n,!0))return r.success(t)},o=t=>{if("string"==typeof t)return r.success([t])},a=new r.Type("MasksArrayString",t=>t instanceof Array,(t,n)=>Da.either.chain(r.union([r.array(r.string),r.string]).validate(t,n),a=>i(a)||o(a)||r.failure(t,n)),t=>t);t.LinkFieldType="Link",t.LinkConfig=r.exact(r.partial({label:zz.StringOrNull,useAsTitle:r.boolean,placeholder:r.string,select:(0,BD.withFallback)(r.union([r.literal("media"),r.literal("document"),r.literal("web"),r.null]),null),customtypes:r.readonlyArray(r.string),masks:a,tags:a,allowTargetBlank:r.boolean})),t.Link=r.exact(r.intersection([r.type({type:r.literal(t.LinkFieldType)}),r.partial({fieldset:zz.StringOrNull,config:t.LinkConfig})]))}(BF);var BG={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Number=t.NumberConfig=t.NumberFieldType=void 0;let n=(0,oN.__importStar)(zm);t.NumberFieldType="Number",t.NumberConfig=n.exact(n.partial({label:zz.StringOrNull,placeholder:n.string,min:n.union([n.number,BS.NumberFromString]),max:n.union([n.number,BS.NumberFromString]),step:n.union([n.number,BS.NumberFromString])})),t.Number=n.exact(n.intersection([n.type({type:n.literal(t.NumberFieldType)}),n.partial({fieldset:zz.StringOrNull,config:t.NumberConfig})]))}(BG);var BJ={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Range=t.RangeConfig=t.RangeFieldType=void 0;let n=(0,oN.__importStar)(zm);t.RangeFieldType="Range",t.RangeConfig=n.exact(n.partial({label:zz.StringOrNull,placeholder:n.string,min:n.union([n.number,BS.NumberFromString]),max:n.union([n.number,BS.NumberFromString]),step:n.union([n.number,BS.NumberFromString])})),t.Range=n.exact(n.intersection([n.type({type:n.literal(t.RangeFieldType)}),n.partial({fieldset:zz.StringOrNull,config:t.RangeConfig})]))}(BJ);var BY={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RichText=t.RichTextConfig=t.RichTextNodeTypeCodec=t.RichTextNodeType=t.DEFAULT_OPTION=t.RichTextFieldType=void 0;let n=oN,r=(0,n.__importStar)(zm),i=(0,n.__importDefault)(Bx);t.RichTextFieldType="StructuredText",t.DEFAULT_OPTION="paragraph",t.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"},t.RichTextNodeTypeCodec=r.keyof({[t.RichTextNodeType.heading1]:null,[t.RichTextNodeType.heading2]:null,[t.RichTextNodeType.heading3]:null,[t.RichTextNodeType.heading4]:null,[t.RichTextNodeType.heading5]:null,[t.RichTextNodeType.heading6]:null,[t.RichTextNodeType.paragraph]:null,[t.RichTextNodeType.strong]:null,[t.RichTextNodeType.em]:null,[t.RichTextNodeType.preformatted]:null,[t.RichTextNodeType.hyperlink]:null,[t.RichTextNodeType.image]:null,[t.RichTextNodeType.embed]:null,[t.RichTextNodeType.list]:null,[t.RichTextNodeType.orderedList]:null,[t.RichTextNodeType.rtl]:null});let o=new r.Type("RichTextOptions",t=>"string"==typeof t,n=>(0,Dc.pipe)(r.union([r.string,r.null]).decode(n),Do.either.map(n=>{if(!n)return t.DEFAULT_OPTION;let r=n.split(",").map(t=>t.trim()).filter(n=>(0,Da.getOrElseW)(()=>{})(t.RichTextNodeTypeCodec.decode(n)));return r.length?r.join(","):t.DEFAULT_OPTION})),t=>t),a=t=>{if(!t)return r.success([])},u=t=>{if(t instanceof Object){if(!Object.entries(t).length)return r.success([]);if(t[""])return r.success(t[""].map(t=>t.name));let n=Object.entries(t).reduce((t,[,n])=>t.concat(n.map(t=>t.name)),[]).filter(Boolean);return r.success(n)}},s=t=>{if(t instanceof Array&&t.reduce((t,n)=>t&&"string"==typeof n,!0))return r.success(t)},c=t=>{if("string"==typeof t)return r.success([t])},l=new r.Type("RichTextLabels",t=>t instanceof Array,(t,n)=>{let i=r.record(r.string,r.readonlyArray(r.record(r.literal("name"),r.string))),o=r.readonlyArray(r.string);return(0,Dc.pipe)(r.union([i,o,r.string,r.null]).decode(t),Do.either.chain(i=>a(i)||s(i)||u(i)||c(i)||r.failure(t,n)))},t=>t);t.RichTextConfig=r.exact(r.partial({label:zz.StringOrNull,placeholder:r.string,useAsTitle:r.boolean,single:o,multi:o,imageConstraint:i.default,labels:l,allowTargetBlank:r.boolean})),t.RichText=r.exact(r.intersection([r.type({type:r.literal(t.RichTextFieldType)}),r.partial({fieldset:zz.StringOrNull,config:t.RichTextConfig})]))}(BY);var BQ={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Select=t.SelectConfig=t.SelectFieldType=void 0;let n=(0,oN.__importStar)(zm);t.SelectFieldType="Select",t.SelectConfig=n.exact(n.partial({label:zz.StringOrNull,placeholder:n.string,default_value:n.string,options:n.readonlyArray(n.union([n.string,zz.StringFromNumber,zz.StringFromBoolean]))})),t.Select=n.exact(n.intersection([n.type({type:n.literal(t.SelectFieldType)}),n.partial({fieldset:zz.StringOrNull,config:t.SelectConfig})]))}(BQ);var BX={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Separator=t.SeparatorConfig=t.SeparatorFieldType=void 0;let n=(0,oN.__importStar)(zm);t.SeparatorFieldType="Separator",t.SeparatorConfig=n.exact(n.partial({label:zz.StringOrNull})),t.Separator=n.exact(n.intersection([n.type({type:n.literal(t.SeparatorFieldType)}),n.partial({config:t.SeparatorConfig})]))}(BX);var B0={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Text=t.TextConfig=t.TextFieldType=void 0;let n=(0,oN.__importStar)(zm);t.TextFieldType="Text",t.TextConfig=n.exact(n.partial({label:zz.StringOrNull,useAsTitle:n.boolean,placeholder:n.string})),t.Text=n.exact(n.intersection([n.type({type:n.literal(t.TextFieldType)}),n.partial({fieldset:zz.StringOrNull,config:t.TextConfig})]))}(B0);var B1={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Timestamp=t.TimestampConfig=t.TimestampFieldType=void 0;let n=(0,oN.__importStar)(zm);t.TimestampFieldType="Timestamp",t.TimestampConfig=n.exact(n.partial({label:zz.StringOrNull,placeholder:n.string,default:n.string})),t.Timestamp=n.exact(n.intersection([n.type({type:n.literal(t.TimestampFieldType)}),n.partial({fieldset:zz.StringOrNull,config:t.TimestampConfig})]))}(B1),Object.defineProperty(Bp,"__esModule",{value:!0}),Bp.NestableWidget=void 0;let B2=oN,B3=(0,B2.__importStar)(zm);Bp.NestableWidget=B3.union([Bm.Color,Bh.BooleanField,By.Embed,Bv.GeoPoint,Bg.Date,BG.Number,BJ.Range,BY.RichText,BQ.Select,BX.Separator,B0.Text,B1.Timestamp,BF.Link,Bb.Image,BL.IntegrationField]),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Group=t.GroupConfig=t.GroupFieldType=void 0;let n=(0,oN.__importStar)(zm);t.GroupFieldType="Group",t.GroupConfig=n.exact(n.partial({label:zz.StringOrNull,repeat:n.boolean,fields:n.record(zg.WidgetKey,Bp.NestableWidget)})),t.Group=n.exact(n.intersection([n.type({type:n.literal(t.GroupFieldType)}),n.partial({fieldset:zz.StringOrNull,icon:n.string,description:n.string,config:t.GroupConfig})]))}(zU);var B4={};!function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=oN;(0,n.__exportStar)(Bh,t),(0,n.__exportStar)(Bm,t),(0,n.__exportStar)(Bg,t),(0,n.__exportStar)(By,t),(0,n.__exportStar)(Bv,t),(0,n.__exportStar)(Bb,t),(0,n.__exportStar)(BL,t),(0,n.__exportStar)(BF,t),(0,n.__exportStar)(Bp,t),(0,n.__exportStar)(BG,t),(0,n.__exportStar)(BJ,t),(0,n.__exportStar)(BY,t),(0,n.__exportStar)(BQ,t),(0,n.__exportStar)(BX,t),(0,n.__exportStar)(B0,t),(0,n.__exportStar)(B1,t)}(B4);var B5,B6,B9={};B5=B9,B6=O&&O.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},Object.defineProperty(B5,"__esModule",{value:!0}),B5.ImageConstraint=void 0,Object.defineProperty(B5,"ImageConstraint",{enumerable:!0,get:function(){return B6(Bx).default}});var B8={},B7={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CompositeSlice=t.CompositeSliceConfig=t.CompositeSliceType=void 0;let n=(0,oN.__importStar)(zm);t.CompositeSliceType="Slice",t.CompositeSliceConfig=n.exact(n.partial({label:zz.StringOrNull})),t.CompositeSlice=n.exact(n.intersection([n.type({type:n.literal(t.CompositeSliceType)}),n.partial({fieldset:zz.StringOrNull,description:n.string,icon:n.string,display:n.string,"non-repeat":n.record(zg.WidgetKey,Bp.NestableWidget),repeat:n.record(zg.WidgetKey,Bp.NestableWidget),config:t.CompositeSliceConfig})]))}(B7);var qe={};Object.defineProperty(qe,"__esModule",{value:!0}),qe.LegacySlice=void 0;let qt=oN,qn=(0,qt.__importStar)(zm);qe.LegacySlice=qn.union([Bp.NestableWidget,zU.Group]);var qr={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SharedSlice=t.SharedSliceType=t.Variation=void 0;let n=(0,oN.__importStar)(zm);t.Variation=n.exact(n.intersection([n.type({id:n.string,name:n.string,description:n.string,imageUrl:(0,BD.withFallback)(n.string,"https://images.prismic.io/slice-machine/621a5ec4-0387-4bc5-9860-2dd46cbc07cd_default_ss.png?auto=compress,format"),docURL:n.string,version:n.string}),n.partial({display:n.string,primary:n.record(zg.WidgetKey,Bp.NestableWidget),items:n.record(zg.WidgetKey,Bp.NestableWidget)})])),t.SharedSliceType="SharedSlice",t.SharedSlice=n.exact(n.intersection([n.type({id:n.string,type:n.literal(t.SharedSliceType),name:n.string,variations:n.readonlyArray(t.Variation)}),n.partial({description:n.string})]))}(qr);var qi={};Object.defineProperty(qi,"__esModule",{value:!0}),qi.SharedSliceRef=void 0;let qo=oN,qa=(0,qo.__importStar)(zm);qi.SharedSliceRef=qa.exact(qa.type({type:qa.literal(qr.SharedSliceType)}));var qu={};Object.defineProperty(qu,"__esModule",{value:!0});var qs={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Slices=t.DynamicSlices=t.StaticSlices=t.slicesReader=t.DynamicSlicesConfig=t.StaticSlicesConfig=t.slicesConfigReader=t.SlicesLabels=t.SlicesFieldType=t.LegacySlicesFieldType=void 0;let n=(0,oN.__importStar)(zm);function r(r){return n.exact(n.partial({label:zz.StringOrNull,labels:t.SlicesLabels,choices:n.record(zg.WidgetKey,n.union([qe.LegacySlice,B7.CompositeSlice,r]))}))}t.LegacySlicesFieldType="Choice",t.SlicesFieldType="Slices",t.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]),t.slicesConfigReader=r,t.StaticSlicesConfig=r(qr.SharedSlice),t.DynamicSlicesConfig=r(qi.SharedSliceRef);let i={toStatic(t,n){let r=Object.entries(t.choices||{}).reduce((t,[r,i])=>{if("SharedSlice"!==i.type)return{...t,[r]:i};{let o=n.get(r);return o?{...t,[r]:o}:t}},{});return{...t,choices:r}}};function o(r){return n.exact(n.intersection([n.type({type:n.keyof({[t.SlicesFieldType]:null,[t.LegacySlicesFieldType]:null})}),n.partial({fieldset:zz.StringOrNull,config:r})]))}t.slicesReader=o,t.StaticSlices=o(t.StaticSlicesConfig),t.DynamicSlices=o(t.DynamicSlicesConfig),t.Slices={toStatic:(t,n)=>t.config?{...t,config:i.toStatic(t.config,n)}:t}}(qs);var qc={};Object.defineProperty(qc,"__esModule",{value:!0}),qc.SlicesTypes=void 0;let ql=oN,qf=(0,ql.__importStar)(zm);qc.SlicesTypes=qf.keyof({[B7.CompositeSliceType]:null,[qr.SharedSliceType]:null}),function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=oN;(0,n.__exportStar)(B7,t),(0,n.__exportStar)(qe,t),(0,n.__exportStar)(qr,t),(0,n.__exportStar)(qi,t),(0,n.__exportStar)(qu,t),(0,n.__exportStar)(qs,t),(0,n.__exportStar)(qc,t)}(B8);var qd={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.UID=t.UIDConfig=t.UIDFieldType=void 0;let n=(0,oN.__importStar)(zm);t.UIDFieldType="UID",t.UIDConfig=n.exact(n.partial({label:zz.StringOrNull,useAsTitle:n.boolean,placeholder:n.string})),t.UID=n.exact(n.intersection([n.type({type:n.literal(t.UIDFieldType)}),n.partial({fieldset:zz.StringOrNull,config:t.UIDConfig})]))}(qd);var qp={};Object.defineProperty(qp,"__esModule",{value:!0}),qp.Widgets=qp.FieldType=qp.DynamicWidget=qp.StaticWidget=qp.widgetReader=void 0;let qh=oN,qm=(0,qh.__importStar)(zm);function qg(t){return qm.union([qd.UID,Bp.NestableWidget,zU.Group,t])}qp.widgetReader=qg,qp.StaticWidget=qg(qs.StaticSlices),qp.DynamicWidget=qg(qs.DynamicSlices),qp.FieldType=qm.keyof({[B4.ColorFieldType]:null,[B4.BooleanFieldType]:null,[B4.NumberFieldType]:null,[B4.EmbedFieldType]:null,[B4.GeoPointFieldType]:null,[B4.DateFieldType]:null,[B4.RangeFieldType]:null,[B4.RichTextFieldType]:null,[B4.SelectFieldType]:null,[B4.SeparatorFieldType]:null,[B4.TextFieldType]:null,[B4.TimestampFieldType]:null,[B4.LinkFieldType]:null,[B4.ImageFieldType]:null,[B4.IntegrationFieldType]:null,[qd.UIDFieldType]:null,[zU.GroupFieldType]:null,[qs.SlicesFieldType]:null,[qs.LegacySlicesFieldType]:null}),qp.Widgets={toStatic(t,n){switch(t.type){case"Choice":case"Slices":return qs.Slices.toStatic(t,n);default:return t}}},function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=oN;(0,n.__exportStar)(zU,t),(0,n.__exportStar)(B4,t),(0,n.__exportStar)(B9,t),(0,n.__exportStar)(B8,t),(0,n.__exportStar)(qd,t),(0,n.__exportStar)(qp,t)}(zW),Object.defineProperty(zD,"__esModule",{value:!0}),zD.defaultCtx=zD.getFieldCtx=zD.LegacyContentCtx=zD.FieldOrSliceType=void 0;let qy=oN,qv=(0,qy.__importStar)(zm);zD.FieldOrSliceType=qv.union([zW.FieldType,zW.SlicesTypes]);class qb{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;let i=Array.of(this.fieldPath,[this.fieldKey]).flat().join(".");this.prefixedKey=i,this.keyOfType=`${i}_TYPE`,this.fieldType=this.allTypes.get(this.prefixedKey)}}zD.LegacyContentCtx=qb,zD.getFieldCtx=function(t,n,r){return new qb(t,[...n.fieldPath,n.fieldKey,...r||[]],n.allTypes)},zD.defaultCtx=function(t,n=new Map){return new qb(t,[],n)};var qx,q_,qS={},qT={};function qw(){return q_||(q_=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanContent=t.BooleanLegacy=t.isBooleanContent=t.BooleanContentType=void 0;let n=oN,r=(0,n.__importStar)(zm),i=zP();t.BooleanContentType="BooleanContent";let o=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.BooleanContentType;t.isBooleanContent=o;let a=n=>new r.Type("BooleanLegacy",t.isBooleanContent,n=>(0,Dc.pipe)(r.boolean.decode(n),Do.either.map(n=>t.BooleanContent.encode({value:n,__TYPE__:t.BooleanContentType}))),t=>({content:t.value,types:{[n.keyOfType]:"Boolean"}}));t.BooleanLegacy=a,t.BooleanContent=r.strict({__TYPE__:r.literal(t.BooleanContentType),value:r.boolean})}(qT)),qT}var qO,qk={};function qI(){return qO||(qO=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.EmbedContent=t.EmbedLegacy=t.EmbedContentLegacy=t.isEmbedContent=t.EmbedContentType=void 0;let n=oN,r=(0,n.__importStar)(zm),i=zP();t.EmbedContentType="EmbedContent";let o=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.EmbedContentType;t.isEmbedContent=o,t.EmbedContentLegacy=r.exact(r.intersection([r.type({embed_url:r.string,type:r.string}),r.partial({version:r.union([r.string,r.number,r.null]),title:zz.StringOrNull,author_name:zz.StringOrNull,author_url:zz.StringOrNull,provider_name:zz.StringOrNull,provider_url:zz.StringOrNull,cache_age:r.union([r.string,r.number,r.null]),thumbnail_url:zz.StringOrNull,thumbnail_width:zz.NumberOrNull,thumbnail_height:zz.NumberOrNull,html:zz.StringOrNull})]));let a=n=>new r.Type("EmbedLegacy",t.isEmbedContent,n=>(0,Dc.pipe)(t.EmbedContentLegacy.decode(n),Do.either.map(r=>({...r,all:n,__TYPE__:t.EmbedContentType}))),t=>({content:t.all,types:{[n.keyOfType]:"Embed"}}));t.EmbedLegacy=a,t.EmbedContent=r.intersection([t.EmbedContentLegacy,r.strict({__TYPE__:r.literal(t.EmbedContentType),all:r.unknown})])}(qk)),qk}var qM={},qC={},qR={};Object.defineProperty(qR,"__esModule",{value:!0});let qE=oN,qA=(0,qE.__importStar)(zm);qR.default=new qA.Type("TrimmedString",qA.string.is,(t,n)=>(0,zb.pipe)(qA.string.validate(t,n),(0,zq.chain)(t=>qA.success(function(t){let n=0;for(;n<t.length&&t[n]<=" ";)n++;let r=t.length;for(;n<r&&t[r-1]<=" ";)r--;return t.substring(n,r)}(t)))),t=>t);var qj={};function qN(){return qP||(qP=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ColorContent=t.ColorLegacy=t.isColorContent=void 0;let n=oN,r=(0,n.__importStar)(zm),i=(0,n.__importDefault)(qR),o=zP(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===qj.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Color"===t.type;t.isColorContent=a;let u=n=>new r.Type("ColorLegacy",t.isColorContent,n=>(0,Dc.pipe)(i.default.decode(n),Do.either.map(n=>t.ColorContent.encode({value:n,type:zW.ColorFieldType,__TYPE__:qj.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:zW.ColorFieldType}}));t.ColorLegacy=u,t.ColorContent=r.strict({type:r.literal(zW.ColorFieldType),value:i.default,__TYPE__:r.literal(qj.FieldContentType)})}(qC)),qC}Object.defineProperty(qj,"__esModule",{value:!0}),qj.FieldContentType=void 0,qj.FieldContentType="FieldContent";var qP,qL,qF={};function qD(){return qL||(qL=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DateContent=t.DateLegacy=t.isDateContent=void 0;let n=oN,r=(0,n.__importStar)(zm),i=(0,n.__importDefault)(qR),o=zP(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===qj.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Date"===t.type;t.isDateContent=a;let u=n=>new r.Type("DateLegacy",t.isDateContent,n=>(0,Dc.pipe)(i.default.decode(n),Do.either.map(n=>t.DateContent.encode({value:n,type:zW.DateFieldType,__TYPE__:qj.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:zW.DateFieldType}}));t.DateLegacy=u,t.DateContent=r.strict({type:r.literal(zW.DateFieldType),value:i.default,__TYPE__:r.literal(qj.FieldContentType)})}(qF)),qF}var qW,qU={};function qz(){return qW||(qW=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.NumberContent=t.NumberLegacy=t.isNumberContent=void 0;let n=oN,r=(0,n.__importStar)(zm),i=(0,n.__importDefault)(qR),o=zP(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===qj.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Number"===t.type;t.isNumberContent=a;let u=n=>new r.Type("NumberLegacy",t.isNumberContent,n=>(0,Dc.pipe)(i.default.decode(n),Do.either.map(n=>t.NumberContent.encode({value:n,type:zW.NumberFieldType,__TYPE__:qj.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:zW.NumberFieldType}}));t.NumberLegacy=u,t.NumberContent=r.strict({type:r.literal(zW.NumberFieldType),value:i.default,__TYPE__:r.literal(qj.FieldContentType)})}(qU)),qU}var qB,qq={};function qV(){return qB||(qB=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RangeContent=t.RangeLegacy=t.isRangeContent=void 0;let n=oN,r=(0,n.__importStar)(zm),i=(0,n.__importDefault)(qR),o=zP(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===qj.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Range"===t.type;t.isRangeContent=a;let u=n=>new r.Type("RangeLegacy",t.isRangeContent,n=>(0,Dc.pipe)(i.default.decode(n),Do.either.map(n=>t.RangeContent.encode({value:n,type:zW.RangeFieldType,__TYPE__:qj.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:zW.RangeFieldType}}));t.RangeLegacy=u,t.RangeContent=r.strict({type:r.literal(zW.RangeFieldType),value:i.default,__TYPE__:r.literal(qj.FieldContentType)})}(qq)),qq}var q$,qK={};function qH(){return q$||(q$=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SelectContent=t.SelectLegacy=t.isSelectContent=void 0;let n=oN,r=(0,n.__importStar)(zm),i=(0,n.__importDefault)(qR),o=zP(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===qj.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Select"===t.type;t.isSelectContent=a;let u=n=>new r.Type("SelectLegacy",t.isSelectContent,n=>(0,Dc.pipe)(i.default.decode(n),Do.either.map(n=>t.SelectContent.encode({value:n,type:zW.SelectFieldType,__TYPE__:qj.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:zW.SelectFieldType}}));t.SelectLegacy=u,t.SelectContent=r.strict({type:r.literal(zW.SelectFieldType),value:i.default,__TYPE__:r.literal(qj.FieldContentType)})}(qK)),qK}var qZ,qG={};function qJ(){return qZ||(qZ=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TextContent=t.TextLegacy=t.isTextContent=void 0;let n=oN,r=(0,n.__importStar)(zm),i=(0,n.__importDefault)(qR),o=zP(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===qj.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Text"===t.type;t.isTextContent=a;let u=n=>new r.Type("TextLegacy",t.isTextContent,n=>(0,Dc.pipe)(i.default.decode(n),Do.either.map(n=>t.TextContent.encode({value:n,type:zW.TextFieldType,__TYPE__:qj.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:zW.TextFieldType}}));t.TextLegacy=u,t.TextContent=r.strict({type:r.literal(zW.TextFieldType),value:i.default,__TYPE__:r.literal(qj.FieldContentType)})}(qG)),qG}var qY,qQ={};function qX(){return qY||(qY=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TimestampContent=t.TimestampLegacy=t.isTimestampContent=void 0;let n=oN,r=(0,n.__importStar)(zm),i=(0,n.__importDefault)(qR),o=zP(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===qj.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Timestamp"===t.type;t.isTimestampContent=a;let u=n=>new r.Type("TimestampLegacy",t.isTimestampContent,n=>(0,Dc.pipe)(i.default.decode(n),Do.either.map(n=>t.TimestampContent.encode({value:n,type:zW.TimestampFieldType,__TYPE__:qj.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:zW.TimestampFieldType}}));t.TimestampLegacy=u,t.TimestampContent=r.strict({type:r.literal(zW.TimestampFieldType),value:i.default,__TYPE__:r.literal(qj.FieldContentType)})}(qQ)),qQ}function q0(){return q1||(q1=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.FieldContent=t.FieldType=void 0;let n=oN,r=(0,n.__importStar)(zm),i=qN(),o=qD(),a=qz(),u=qV(),s=qH(),c=qJ(),l=qX();t.FieldType=r.keyof({Text:null,Date:null,Timestamp:null,Color:null,Number:null,Range:null,Select:null}),t.FieldContent=r.union([o.DateContent,i.ColorContent,a.NumberContent,u.RangeContent,s.SelectContent,c.TextContent,l.TimestampContent]),(0,n.__exportStar)(qN(),t),(0,n.__exportStar)(qj,t),(0,n.__exportStar)(qD(),t),(0,n.__exportStar)(qz(),t),(0,n.__exportStar)(qV(),t),(0,n.__exportStar)(qH(),t),(0,n.__exportStar)(qJ(),t),(0,n.__exportStar)(qX(),t)}(qM)),qM}var q1,q2,q3={};function q4(){return q2||(q2=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.GeoPointContent=t.GeoPointLegacy=t.isGeoPointContent=t.GeoPointContentType=void 0;let n=oN,r=(0,n.__importStar)(zm),i=zP();t.GeoPointContentType="GeoPointContent";let o=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.GeoPointContentType;t.isGeoPointContent=o;let a=r.strict({position:r.strict({lat:r.number,lng:r.number})}),u=n=>new r.Type("GeoPointLegacy",t.isGeoPointContent,n=>(0,zb.pipe)(a.decode(n),Do.either.map(n=>t.GeoPointContent.encode({...n,__TYPE__:t.GeoPointContentType}))),t=>({content:{position:t.position},types:{[n.keyOfType]:"GeoPoint"}}));t.GeoPointLegacy=u,t.GeoPointContent=r.intersection([a,r.strict({__TYPE__:r.literal(t.GeoPointContentType)})])}(q3)),q3}var q5={},q6={};function q9(){return q8||(q8=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ImageContent=t.ImageLegacy=t.ImageContentView=t.isImageContent=t.ImageContentType=void 0;let n=oN,r=(0,n.__importStar)(zm),i=zP();t.ImageContentType="ImageContent";let o=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.ImageContentType;t.isImageContent=o;let a=r.exact(r.type({id:r.string,url:r.string,width:r.number,height:r.number}));t.ImageContentView=r.exact(r.intersection([r.type({origin:a,width:r.number,height:r.number,edit:r.type({zoom:r.number,crop:r.type({x:r.number,y:r.number}),background:r.string})}),r.partial({url:r.string,credits:zz.NonEmptyStringOrNull,alt:zz.NonEmptyStringOrNull,provider:zz.StringOrNull})]));let u=r.intersection([t.ImageContentView,r.partial({thumbnails:r.record(r.string,t.ImageContentView)})]),s=n=>new r.Type("ImageLegacy",t.isImageContent,n=>(0,Dc.pipe)(u.decode(n),Do.either.map(n=>t.ImageContent.encode({...n,__TYPE__:t.ImageContentType}))),t=>({content:(0,q6.withOptionals)({edit:t.edit,height:t.height,origin:t.origin,width:t.width},[["alt",t.alt],["credits",t.credits],["provider",t.provider],["thumbnails",t.thumbnails],["url",t.url]]),types:{[n.keyOfType]:"Image"}}));t.ImageLegacy=s,t.ImageContent=r.intersection([u,r.strict({__TYPE__:r.literal(t.ImageContentType)})])}(q5)),q5}Object.defineProperty(q6,"__esModule",{value:!0}),q6.withOptionals=q6.isNotEmpty=q6.zipObjects=void 0,q6.zipObjects=function(t,n){return[...new Set(Object.keys(t||{}).concat(Object.keys(n||{})))].reduce((r,i)=>{let o=null==t?void 0:t[i],a=null==n?void 0:n[i];return{...r,[i]:{left:o,right:a}}},{})},q6.isNotEmpty=function(t){return Boolean(Object.keys(t).length)},q6.withOptionals=function(t,n){return{...t,...n.reduce((t,[n,r])=>r?{...t,[n]:r}:t,{})}};var q8,q7,Ve={};function Vt(){return q7||(q7=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.IntegrationFieldContent=t.IntegrationFieldLegacy=t.isIntegrationFieldContent=t.IntegrationFieldContentType=void 0;let n=oN,r=(0,n.__importStar)(zm),i=zP();t.IntegrationFieldContentType="IntegrationFieldsContent";let o=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.IntegrationFieldContentType;t.isIntegrationFieldContent=o;let a=n=>new r.Type("IntegrationFieldLegacy",t.isIntegrationFieldContent,n=>(0,Dc.pipe)(r.string.decode(n),Do.either.map(n=>t.IntegrationFieldContent.encode({value:n,__TYPE__:t.IntegrationFieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:"IntegrationFields"}}));t.IntegrationFieldLegacy=a,t.IntegrationFieldContent=r.strict({__TYPE__:r.literal(t.IntegrationFieldContentType),value:r.string})}(Ve)),Ve}var Vn,Vr,Vi,Vo={},Va=zl(WN,Vr=function(t){return t.length>0},"NonEmptyString");function Vu(t,n){void 0===n&&(n="NonEmptyArray<"+t.name+">");var r=UK(t);return new Wt(n,function(t){return r.is(t)&&oQ(t)},function(t,n){return Z(r.validate(t,n),h4(function(r){var i=o7(r);return pA(i)?We(t,n):eS(i.value)}))},function(t){return r.encode(t)})}function Vs(t,n,r){void 0===r&&(r="Set<"+t.name+">");var i=UK(t),o=E3(n),a=EJ(n);return new Wt(r,function(n){return n instanceof Set&&Rt(t.is)(n)},function(t,n){return Z(i.validate(t,n),h4(function(r){var i=a(r);return i.size!==r.length?We(t,n):eS(i)}))},function(t){return i.encode(o(t))})}function Vc(t,n){return new Wt(t,n,function(t,r){return n(t)?eS(t):We(t,r)},Wn)}var Vl=Vc("Date",function(t){return t instanceof Date}),Vf=globalThis&&globalThis.__spreadArray||function(t,n,r){if(r||2===arguments.length)for(var i,o=0,a=n.length;o<a;o++)!i&&o in n||(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return t.concat(i||Array.prototype.slice.call(n))},Vd=function(t,n){return{get:t,reverseGet:n}},Vp=function(t){return Vy(t.get,q(t.reverseGet,D))},Vh=function(t){return VM(q(t.get,ev),t.reverseGet)},Vm=function(t){return Vj(q(t.get,ev),q(t.reverseGet,D))},Vg=function(t){return VW(function(n){return function(r){return function(i){return n.map(r(t.get(i)),function(n){return t.reverseGet(n)})}}})},Vy=function(t,n){return{get:t,set:n}},Vv=function(t){return Vj(q(t.get,ev),t.set)},Vb=function(t){return VW(function(n){return function(r){return function(i){return n.map(r(t.get(i)),function(n){return t.set(n)(i)})}}})},Vx=function(t){return function(n){return Vy(function(r){return t.get(n.get(r))},function(r){return function(i){return n.set(t.set(r)(n.get(i)))(i)}})}},V_=function(t){return function(n){return VM(q(n.getOption,pn(t.getOption)),q(t.reverseGet,n.reverseGet))}},VS=function(t){return function(n){return VF(VC(t))(Vv(n))}},VT=function(){return Vy(F,D)},Vw=function(t){return function(n){return Vy(function(r){return n.get(r)[t]},function(r){return function(i){var o,a=n.get(i);return r===a[t]?i:n.set(Object.assign({},a,((o={})[t]=r,o)))(i)}})}},VO=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return function(n){return Vy(function(r){for(var i=n.get(r),o={},a=0;a<t.length;a++){var u=t[a];o[u]=i[u]}return o},function(r){return function(i){for(var o=n.get(i),a=0;a<t.length;a++){var u=t[a];if(r[u]!==o[u])return n.set(Object.assign({},o,r))(i)}return i}})}},Vk=function(t){return function(n){return Vy(function(r){return n.get(r)[t]},function(r){return function(i){var o=n.get(i);if(r===o[t])return i;var a=o.slice();return a[t]=r,n.set(a)(i)}})}},VI=function(t){return function(n){var r;return Z(n,Vx(({at:r=function(t){return Vy(function(n){return rV(t,n)},pj(function(){return rU(t)},function(n){return rD(t,n)}))}}).at(t)))}},VM=function(t,n){return{getOption:t,reverseGet:n}},VC=function(t){return Vj(t.getOption,function(n){return VE(n)(t)})},VR=function(t){return VW(function(n){return function(r){return function(i){return Z(t.getOption(i),pj(function(){return n.of(i)},function(o){return n.map(r(o),function(n){return VE(n)(t)(i)})}))}}})},VE=function(t){var n;return n=function(){return t},function(t){var r,i,o=(r=t,function(t){return Z(r.getOption(t),d6(function(i){var o=n(i);return o===i?t:r.reverseGet(o)}))});return function(t){return Z(o(t),pN(function(){return t}))}}},VA=function(t){return VM(dW(t),F)},Vj=function(t,n){return{getOption:t,set:n}},VN=function(t){return VW(function(n){return function(r){return function(i){return Z(t.getOption(i),pj(function(){return n.of(i)},function(o){return n.map(r(o),function(n){return t.set(n)(i)})}))}}})},VP=function(t){return function(n){return function(r){return Z(n.getOption(r),d6(function(i){var o=t(i);return o===i?r:n.set(o)(r)}))}}},VL=function(t){return function(n){var r=VP(t)(n);return function(t){return Z(r(t),pN(function(){return t}))}}},VF=function(t){return function(n){return Vj(q(n.getOption,pn(t.getOption)),function(r){return VL(t.set(r))(n)})}},VD=function(t,n,r){if(r[t]===n)return r;var i=Vf([r[0]],r.slice(1),!0);return i[t]=n,i},VW=function(t){return{modifyF:t}};function VU(t){return function(n){return VW(function(r){return function(i){return n.modifyF(r)(t.modifyF(r)(i))}})}}var Vz={URI:"Identity",map:function(t,n){return n(t)},of:F,ap:function(t,n){return t(n)}},VB=function(t){return{index:t}},Vq=q(Vp,Vx),VV=function(t){return q(Vv,VF(t))},V$=function(t){return q(Vb,VU(t))},VK=function(t){return function(n){return function(r){var i=n.get(r),o=t(i);return i===o?r:n.set(o)(r)}}},VH=function(t){return VS(VM(pq,F))(t)},VZ=function(t){var n;return q(Vv,function(n){return Z(n,VF(VB(function(t){return Vj(function(n){return u$(t,n)},function(n){return function(r){return Z(u$(t,r),pj(function(){return r},function(){return cq(t,n,r)}))}})}).index(t)))})},VG=function(t){var n;return q(Vv,function(n){return Z(n,VF(VB(function(t){return Vj(function(n){return u$(t,n)},function(n){return function(r){return Z(u$(t,r),pj(function(){return r},function(){return VD(t,n,r)}))}})}).index(t)))})},VJ=function(t){var n;return q(Vv,function(n){return Z(n,VF(VB(function(t){return Vj(function(n){return rV(t,n)},function(n){return function(r){return r[t]===n||pA(rV(t,r))?r:rD(t,n)(r)}})}).index(t)))})},VY=VS(VM(F,ev)),VQ=VS(VM(dz,eS)),VX=VS(VM(function(t){return ml(t)?ev(t.left):ey},e_)),V0=function(t,n){return function(r){return V1(r,t,n)}},V1=function(t,n,r){return Vy(q(t.get,n),q(r,t.set))},V2="monocle-ts/Lens",V3={URI:V2,compose:function(t,n){return Vx(t)(n)}},V4={URI:V2,compose:V3.compose,id:VT};let V5=Object.freeze(Object.defineProperty({__proto__:null,Category:V4,Invariant:{URI:V2,imap:V1},Semigroupoid:V3,URI:V2,asOptional:Vv,asTraversal:Vb,atKey:VI,component:Vk,compose:Vx,composeIso:Vq,composeLens:Vx,composeOptional:VV,composePrism:VS,composeTraversal:V$,filter:function(t){return VS(VA(t))},findFirst:function(t){var n;return VV(Vj(u2(t),function(n){return function(r){return Z(u1(t)(r),pj(function(){return r},function(t){return cq(t,n,r)}))}}))},findFirstNonEmpty:function(t){var n;return VV(Vj(u2(t),function(n){return function(r){return Z(u1(t)(r),pj(function(){return r},function(t){return VD(t,n,r)}))}}))},fromNullable:VH,id:VT,imap:V0,index:VZ,indexNonEmpty:VG,key:VJ,left:VX,lens:Vy,modify:VK,modifyF:function(t){return function(n){return function(r){return function(i){return Z(r.get(i),n,function(n){return t.map(n,function(t){return r.set(t)(i)})})}}}},prop:Vw,props:VO,right:VQ,some:VY,traverse:function(t){var n,r;return q(Vb,VU(VW(function(n){var r,i="Identity"===n.URI?t.map:t.traverse(n);return function(t){return function(n){return i(n,t)}}})))}},Symbol.toStringTag,{value:"Module"}));var V6=function(t){return function(n){return n.modifyF(Vz)(t)}},V9=function(t){return new $r(t.get,t.reverseGet)},V8=function(t){return new $i(t.get,t.set)},V7=function(t){return new $o(t.getOption,t.reverseGet)},$e=function(t){return new $u(t.getOption,t.set)},$t=function(t){return new $s(t.modifyF)},$n=function(t,n,r){var i;return r===t[n]?t:Object.assign({},t,((i={})[n]=r,i))},$r=function(){function t(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 t.prototype.reverse=function(){var t;return V9(Vd(this.reverseGet,this.get))},t.prototype.modify=function(t){var n,r;return r=this,function(n){return r.reverseGet(t(r.get(n)))}},t.prototype.asLens=function(){return V8(Vp(this))},t.prototype.asPrism=function(){return V7(Vh(this))},t.prototype.asOptional=function(){return $e(Vm(this))},t.prototype.asTraversal=function(){return $t(Vg(this))},t.prototype.asFold=function(){var t=this;return new $l(function(){return function(n){return function(r){return n(t.get(r))}}})},t.prototype.asGetter=function(){var t=this;return new $c(function(n){return t.get(n)})},t.prototype.asSetter=function(){var t=this;return new $f(function(n){return t.modify(n)})},t.prototype.compose=function(t){var n,r;return V9((r=this,Vd(q(r.get,t.get),q(t.reverseGet,r.reverseGet))))},t.prototype.composeIso=function(t){return this.compose(t)},t.prototype.composeLens=function(t){return V8(Z(this,Vp,Vx(t)))},t.prototype.composePrism=function(t){return V7(Z(this,Vh,V_(t)))},t.prototype.composeOptional=function(t){return $e(Z(this,Vm,VF(t)))},t.prototype.composeTraversal=function(t){return $t(Z(this,Vg,VU(t)))},t.prototype.composeFold=function(t){return this.asFold().compose(t)},t.prototype.composeGetter=function(t){return this.asGetter().compose(t)},t.prototype.composeSetter=function(t){return this.asSetter().compose(t)},t}(),$i=function(){function t(t,n){this.get=t,this.set=n,this._tag="Lens"}return t.fromPath=function(){var n=t.fromProp();return function(t){var r=n(t[0]);return t.slice(1).reduce(function(t,r){return t.compose(n(r))},r)}},t.fromProp=function(){return function(t){return V8(Z(VT(),Vw(t)))}},t.fromProps=function(){return function(t){return V8(Z(VT(),VO.apply(V5,t)))}},t.fromNullableProp=function(){return function(n,r){return new t(function(t){var i=pq(t[n]);return pA(i)?r:i.value},function(t){return function(r){return $n(r,n,t)}})}},t.prototype.modify=function(t){return VK(t)(this)},t.prototype.asOptional=function(){return $e(Vv(this))},t.prototype.asTraversal=function(){return $t(Vb(this))},t.prototype.asSetter=function(){var t=this;return new $f(function(n){return t.modify(n)})},t.prototype.asGetter=function(){var t=this;return new $c(function(n){return t.get(n)})},t.prototype.asFold=function(){var t=this;return new $l(function(){return function(n){return function(r){return n(t.get(r))}}})},t.prototype.compose=function(t){return V8(Vx(t)(this))},t.prototype.composeLens=function(t){return this.compose(t)},t.prototype.composeGetter=function(t){return this.asGetter().compose(t)},t.prototype.composeFold=function(t){return this.asFold().compose(t)},t.prototype.composeOptional=function(t){return $e(Z(this,Vv,VF(t)))},t.prototype.composeTraversal=function(t){return $t(Z(this,Vb,VU(t)))},t.prototype.composeSetter=function(t){return this.asSetter().compose(t)},t.prototype.composeIso=function(t){return V8(Z(this,Vx(Z(t,Vp))))},t.prototype.composePrism=function(t){return $e(VS(t)(this))},t}(),$o=function(){function t(t,n){this.getOption=t,this.reverseGet=n,this._tag="Prism"}return t.fromPredicate=function(t){return V7(VA(t))},t.some=function(){return $a},t.prototype.modify=function(t){var n=this;return function(r){var i=n.modifyOption(t)(r);return pA(i)?r:i.value}},t.prototype.modifyOption=function(t){var n=this;return function(r){return p6.map(n.getOption(r),function(i){var o=t(i);return o===i?r:n.reverseGet(o)})}},t.prototype.set=function(t){return this.modify(function(){return t})},t.prototype.asOptional=function(){return $e(VC(this))},t.prototype.asTraversal=function(){return $t(VR(this))},t.prototype.asSetter=function(){var t=this;return new $f(function(n){return t.modify(n)})},t.prototype.asFold=function(){var t=this;return new $l(function(n){return function(r){return function(i){var o=t.getOption(i);return pA(o)?n.empty:r(o.value)}}})},t.prototype.compose=function(t){return V7(V_(t)(this))},t.prototype.composePrism=function(t){return this.compose(t)},t.prototype.composeOptional=function(t){return $e(Z(this,VC,VF(t)))},t.prototype.composeTraversal=function(t){return $t(Z(this,VR,VU(t)))},t.prototype.composeFold=function(t){return this.asFold().compose(t)},t.prototype.composeSetter=function(t){return this.asSetter().compose(t)},t.prototype.composeIso=function(t){return V7(Z(this,V_(Z(t,Vh))))},t.prototype.composeLens=function(t){var n;return $e((n=t,function(t){return VF(Vv(n))(VC(t))})(this))},t.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},t}(),$a=new $o(F,ev),$u=function(){function t(t,n){this.getOption=t,this.set=n,this._tag="Optional"}return t.fromPath=function(){var n=t.fromNullableProp();return function(t){var r=n(t[0]);return t.slice(1).reduce(function(t,r){return t.compose(n(r))},r)}},t.fromNullableProp=function(){return function(n){return new t(function(t){return pq(t[n])},function(t){return function(r){return null==r[n]?r:$n(r,n,t)}})}},t.fromOptionProp=function(){var t=$i.fromProp();return function(n){return t(n).composePrism($a)}},t.prototype.modify=function(t){return VL(t)(this)},t.prototype.modifyOption=function(t){return VP(t)(this)},t.prototype.asTraversal=function(){return $t(VN(this))},t.prototype.asFold=function(){var t=this;return new $l(function(n){return function(r){return function(i){var o=t.getOption(i);return pA(o)?n.empty:r(o.value)}}})},t.prototype.asSetter=function(){var t=this;return new $f(function(n){return t.modify(n)})},t.prototype.compose=function(t){return $e(VF(t)(this))},t.prototype.composeOptional=function(t){return this.compose(t)},t.prototype.composeTraversal=function(t){return $t(Z(this,VN,VU(t)))},t.prototype.composeFold=function(t){return this.asFold().compose(t)},t.prototype.composeSetter=function(t){return this.asSetter().compose(t)},t.prototype.composeLens=function(t){return $e(Z(this,VF(Z(t,Vv))))},t.prototype.composePrism=function(t){return $e(Z(this,VF(Z(t,VC))))},t.prototype.composeIso=function(t){return $e(Z(this,VF(Z(t,Vm))))},t.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},t}(),$s=function(){function t(t){this.modifyF=t,this._tag="Traversal"}return t.prototype.modify=function(t){return V6(t)(this)},t.prototype.set=function(t){var n;return V6(function(){return t})(this)},t.prototype.filter=function(t){var n;return $t(VU(VR(VA(t)))(this))},t.prototype.asFold=function(){var t=this;return new $l(function(n){return function(r){return t.modifyF(hf(n))(function(t){return F(r(t))})}})},t.prototype.asSetter=function(){var t=this;return new $f(function(n){return t.modify(n)})},t.prototype.compose=function(t){return $t(VU(t)(this))},t.prototype.composeTraversal=function(t){return this.compose(t)},t.prototype.composeFold=function(t){return this.asFold().compose(t)},t.prototype.composeSetter=function(t){return this.asSetter().compose(t)},t.prototype.composeOptional=function(t){return this.compose(t.asTraversal())},t.prototype.composeLens=function(t){return $t(Z(this,VU(Z(t,Vb))))},t.prototype.composePrism=function(t){return $t(Z(this,VU(Z(t,VR))))},t.prototype.composeIso=function(t){return $t(Z(this,VU(Z(t,Vg))))},t.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},t}(),$c=function(){function t(t){this.get=t,this._tag="Getter"}return t.prototype.asFold=function(){var t=this;return new $l(function(){return function(n){return function(r){return n(t.get(r))}}})},t.prototype.compose=function(n){var r=this;return new t(function(t){return n.get(r.get(t))})},t.prototype.composeGetter=function(t){return this.compose(t)},t.prototype.composeFold=function(t){return this.asFold().compose(t)},t.prototype.composeLens=function(t){return this.compose(t.asGetter())},t.prototype.composeIso=function(t){return this.compose(t.asGetter())},t.prototype.composeTraversal=function(t){return this.asFold().compose(t.asFold())},t.prototype.composeOptional=function(t){return this.asFold().compose(t.asFold())},t.prototype.composePrism=function(t){return this.asFold().compose(t.asFold())},t}(),$l=function(){function t(t){this.foldMap=t,this._tag="Fold",this.getAll=t(fC())(am),this.exist=t(TU),this.all=t(TW),this.foldMapFirst=t(p7())}return t.prototype.compose=function(n){var r=this;return new t(function(t){return function(i){return r.foldMap(t)(n.foldMap(t)(i))}})},t.prototype.composeFold=function(t){return this.compose(t)},t.prototype.composeGetter=function(t){return this.compose(t.asFold())},t.prototype.composeTraversal=function(t){return this.compose(t.asFold())},t.prototype.composeOptional=function(t){return this.compose(t.asFold())},t.prototype.composeLens=function(t){return this.compose(t.asFold())},t.prototype.composePrism=function(t){return this.compose(t.asFold())},t.prototype.composeIso=function(t){return this.compose(t.asFold())},t.prototype.find=function(t){return this.foldMapFirst(dW(t))},t.prototype.headOption=function(t){return this.find(function(){return!0})(t)},t}(),$f=function(){function t(t){this.modify=t,this._tag="Setter"}return t.prototype.set=function(t){return this.modify(D(t))},t.prototype.compose=function(n){var r=this;return new t(function(t){return r.modify(n.modify(t))})},t.prototype.composeSetter=function(t){return this.compose(t)},t.prototype.composeTraversal=function(t){return this.compose(t.asSetter())},t.prototype.composeOptional=function(t){return this.compose(t.asSetter())},t.prototype.composeLens=function(t){return this.compose(t.asSetter())},t.prototype.composePrism=function(t){return this.compose(t.asSetter())},t.prototype.composeIso=function(t){return this.compose(t.asSetter())},t}(),$d=new $r(F,F),$p=U5({_tag:WK("None")}),$h=WK("Some");function $m(t,n){return void 0===n&&(n="Option<"+t.name+">"),UX([$p,U5({_tag:$h,value:t},"Some<"+t.name+">")],n)}var $g=new Wt("DateFromISOString",function(t){return t instanceof Date},function(t,n){return Z(WN.validate(t,n),h4(function(r){var i=new Date(r);return isNaN(i.getTime())?We(t,n):eS(i)}))},function(t){return t.toISOString()});function $y(t){var n=Object.create(Object.getPrototypeOf(t));return Object.assign(n,t),n}var $v=new Wt("DateFromNumber",function(t){return t instanceof Date},function(t,n){return Z(WL.validate(t,n),h4(function(r){var i=new Date(r);return isNaN(i.getTime())?We(t,n):eS(i)}))},function(t){return t.getTime()});function $b(t,n,r){void 0===r&&(r=t.name);var i=$y(t);return i.validate=n,i.decode=function(t){return n(t,zr(i))},i.name=r,i}var $x,$_,$S,$T=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,$w=zl(WN,$_=function(t){return $T.test(t)},"UUID"),$O=new Wt("BooleanFromString",WU.is,function(t,n){return Z(WN.validate(t,n),h4(function(r){return"true"===r?eS(!0):"false"===r?eS(!1):We(t,n)}))},String);function $k(t){switch(t._tag){case"InterfaceType":return t.props;case"ExactType":return $k(t.type)}}var $I=$i.fromProp(),$M=Vc("RegExp",function(t){return"[object RegExp]"===Object.prototype.toString.call(t)}),$C=new Wt("DateFromUnixTime",function(t){return t instanceof Date},function(t,n){return Z(UB.validate(t,n),h4(function(r){var i=new Date(1e3*r);return isNaN(i.getTime())?We(t,n):eS(i)}))},function(t){return Math.floor(t.getTime()/1e3)}),$R=new Wt("NumberFromString",WL.is,function(t,n){return Z(WN.validate(t,n),h4(function(r){var i=+r;return isNaN(i)||""===r.trim()?We(t,n):eS(i)}))},String),$E=new Wt("IntFromString",UB.is,function(t,n){return Z($R.validate(t,n),h4(function(r){return UB.is(r)?eS(r):We(t,n)}))},$R.encode),$A=UV("JsonArray",function(){return U4($N)}),$j=UV("JsonRecord",function(){return UY(WN,$N)}),$N=UX([WU,WL,WN,Wk,$A,$j],"Json"),$P=new Wt("JsonFromString",$N.is,function(t,n){try{return eS(JSON.parse(t))}catch{return We(t,n)}},function(t){return JSON.stringify(t)}),$L=WK("Left"),$F=WK("Right"),$D=new Wt("BigIntFromString",function(t){return"bigint"==typeof t},function(t,n){return Z(WN.validate(t,n),h4(function(r){if(!Va.is(r.trim()))return We(t,n);try{return eS(BigInt(r))}catch{return We(t,n)}}))},String),$W=new Wt("BooleanFromNumber",WU.is,function(t,n){return Z(WL.validate(t,n),hJ(function(t){return 0!==t}))},Number);let $U=Object.freeze(Object.defineProperty({__proto__:null,BigIntFromString:$D,BooleanFromNumber:$W,BooleanFromString:$O,DateFromISOString:$g,DateFromNumber:$v,DateFromUnixTime:$C,IntFromString:$E,Json:$N,JsonArray:$A,JsonFromString:$P,JsonRecord:$j,NonEmptyString:Va,NumberFromString:$R,UUID:$w,clone:$y,date:Vl,either:function(t,n,r){return void 0===r&&(r="Either<"+t.name+", "+n.name+">"),UX([U5({_tag:$L,left:t},"Left<"+t.name+">"),U5({_tag:$F,right:n},"Right<"+t.name+">")],r)},fromNewtype:function(t,n){return void 0===n&&(n="fromNewtype("+t.name+")"),new Wt(n,function(n){return t.is(n)},function(n,r){return Z(t.validate(n,r),hJ($d.wrap))},function(n){return t.encode($d.unwrap(n))})},fromNullable:function(t,n,r){return void 0===r&&(r="fromNullable("+t.name+")"),$b(t,function(r,i){return null==r?eS(n):t.validate(r,i)},r)},fromRefinement:Vc,getLenses:function(t){var n={};for(var r in $k(t))n[r]=$I(r);return n},mapOutput:zx,nonEmptyArray:Vu,option:$m,optionFromNullable:function(t,n){return void 0===n&&(n="Option<"+t.name+">"),new Wt(n,$m(t).is,function(n,r){return null==n?eS(ey):Z(t.validate(n,r),hJ(ev))},function(n){return pZ(Z(n,d6(t.encode)))})},readonlyNonEmptyArray:function(t,n){return void 0===n&&(n="ReadonlyNonEmptyArray<"+t.name+">"),Vu(t,n)},readonlySetFromArray:function(t,n,r){return void 0===r&&(r="ReadonlySet<"+t.name+">"),Vs(t,n,r)},regexp:$M,setFromArray:Vs,withEncode:function(t,n,r){return void 0===r&&(r=t.name),new Wt(r,t.is,t.validate,n)},withFallback:function(t,n,r){return void 0===r&&(r="withFallback("+t.name+")"),$b(t,function(r,i){return mw(function(){return eS(n)})(t.validate(r,i))},r)},withMessage:function(t,n){return $b(t,function(r,i){return mr(function(){return[{value:r,context:i,message:n(r,i),actual:r}]})(t.validate(r,i))})},withValidate:$b},Symbol.toStringTag,{value:"Module"})),$z=k($U);function $B(){return $q||($q=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.LinkContent=t.Link=t.LinkContentLegacy=t.LinkLegacy=t.isLinkContent=t.LinkContentType=t.ExternalLinkContent=t.ExternalLinkType=t.DocumentLinkContent=t.DocumentLinkType=t.FileLinkContent=t.FileLinkType=t.ImageLinkContent=t.ImageLinkType=void 0;let n=oN,r=(0,n.__importStar)(zm),i=zP();t.ImageLinkType="ImageLink";let o=r.exact(r.intersection([r.type({id:r.string,url:r.string,height:r.string,width:r.string,size:r.string,name:r.string,kind:r.string}),r.partial({date:zz.StringOrNull})])),a=new r.Type("ImageLink",n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.ImageLinkType,n=>(0,Dc.pipe)(o.decode(n),Do.either.map(n=>t.ImageLinkContent.encode({...n,__TYPE__:t.ImageLinkType}))),t=>o.encode(t));t.ImageLinkContent=r.intersection([r.strict({__TYPE__:r.literal(t.ImageLinkType)}),o]),t.FileLinkType="FileLink";let u=r.exact(r.intersection([r.type({id:r.string,url:r.string,name:r.string,kind:r.string,size:(0,$z.withFallback)(r.string,"0")}),r.partial({date:(0,zv.nullable)(r.string)})])),s=new r.Type("FileLink",n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.FileLinkType,n=>(0,Dc.pipe)(u.decode(n),Do.either.map(n=>t.FileLinkContent.encode({...n,__TYPE__:t.FileLinkType}))),t=>u.encode(t));t.FileLinkContent=r.intersection([u,r.exact(r.intersection([r.type({__TYPE__:r.literal(t.FileLinkType)}),r.partial({size:(0,$z.withFallback)(r.string,"0")})]))]),t.DocumentLinkType="DocumentLink";let c=r.strict({id:zz.NonEmptyString}),l=new r.Type("DocumentLink",n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.DocumentLinkType,n=>(0,Dc.pipe)(c.decode(n),Do.either.map(n=>t.DocumentLinkContent.encode({...n,__TYPE__:t.DocumentLinkType}))),t=>c.encode(t));t.DocumentLinkContent=r.intersection([r.strict({__TYPE__:r.literal(t.DocumentLinkType)}),c]),t.ExternalLinkType="ExternalLink";let f=r.exact(r.intersection([r.type({url:r.string}),r.partial({kind:r.literal("web"),target:zz.StringOrNull,preview:(0,zv.nullable)(r.partial({title:r.string}))})])),d=new r.Type("ExternalLink",n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.ExternalLinkType,n=>(0,Dc.pipe)(f.decode(n),Do.either.map(n=>t.ExternalLinkContent.encode({...n,__TYPE__:t.ExternalLinkType}))),t=>f.encode(t));t.ExternalLinkContent=r.intersection([r.strict({__TYPE__:r.literal(t.ExternalLinkType)}),f]),t.LinkContentType="LinkContent";let p=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.LinkContentType;t.isLinkContent=p,t.LinkLegacy=r.union([a,s,l,d]);let h=n=>new r.Type("LinkLegacy",t.isLinkContent,n=>(0,Dc.pipe)(t.LinkLegacy.decode(n),Do.either.map(n=>t.LinkContent.encode({value:n,__TYPE__:t.LinkContentType}))),r=>({content:t.LinkLegacy.encode(r.value),types:{[n.keyOfType]:"Link"}}));t.LinkContentLegacy=h,t.Link=r.union([t.ImageLinkContent,t.FileLinkContent,t.DocumentLinkContent,t.ExternalLinkContent]),t.LinkContent=r.strict({__TYPE__:r.literal(t.LinkContentType),value:t.Link})}(Vo)),Vo}var $q,$V,$$={},$K={},$H={};function $Z(){return $V||($V=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Block=t.BlockLegacy=t.TextBlock=t.checkEmbedBlock=t.EmbedBlock=t.checkImageBlock=t.ImageBlock=t.ValidatedMetas=t.Span=t.Meta=void 0;let n=oN,r=(0,n.__importStar)(zm),i=qI(),o=q9(),a=$B();t.Meta=r.exact(r.intersection([r.partial({data:r.unknown}),r.type({start:r.number,end:r.number,type:r.union([B4.RichTextNodeTypeCodec,r.literal("label")])})])),t.Span=t.Meta;let u=n=>new r.Type("ValidatedMetas",n=>Array.isArray(n)&&n.every(t.Meta.is),(i,o)=>{if(!Array.isArray(i))return r.failure(i,o);{let a=i.reduce((r,i)=>{let o=t.Meta.decode(i);if((0,Da.isRight)(o)){let a=o.right;if(a.data&&"hyperlink"===a.type){let u=n.decode(a.data);return(0,Da.isLeft)(u)?r:[...r,{...a,data:u.right}]}if("hyperlink"!==a.type)return[...r,a]}return r},[]).sort((t,n)=>t.start-n.start);return r.success(a)}},r=>r.reduce((r,i)=>{if("hyperlink"===i.type&&i.data){let o=n.decode(i.data);return(0,Da.isLeft)(o)?r:[...r,{...i,data:n.encode(o.right)}]}return[...r,t.Meta.encode(i)]},[]));t.ValidatedMetas=u;let s=t=>r.exact(r.intersection([r.type({type:r.literal(B4.RichTextNodeType.image),data:r.intersection([o.ImageContentView,r.partial({linkTo:(0,zv.nullable)(t)})])}),r.partial({label:zz.StringOrNull,direction:zz.StringOrNull})]));t.ImageBlock=s(a.Link);let c=s(a.LinkLegacy);t.checkImageBlock=function(t){return t.type===B4.RichTextNodeType.image};let l=r.exact(r.intersection([r.type({type:r.literal(B4.RichTextNodeType.embed),data:r.unknown}),r.partial({label:zz.StringOrNull,direction:zz.StringOrNull})])),f=new r.Type("EmbedBlockLegacy",t=>"embed"===t.type,n=>(0,Dc.pipe)(l.decode(n),Do.either.chain(t=>Do.either.map(n=>[t,n])(i.EmbedContentLegacy.decode(t.data))),Do.either.map(([n,r])=>t.EmbedBlock.encode({...n,data:{...r,__TYPE__:i.EmbedContentType,all:n.data}}))),t=>({...l.encode(t),data:i.EmbedContentLegacy.encode(t.data)}));t.EmbedBlock=r.exact(r.intersection([r.type({type:r.literal(B4.RichTextNodeType.embed),data:i.EmbedContent}),r.partial({label:zz.StringOrNull,direction:zz.StringOrNull})])),t.checkEmbedBlock=function(t){return t.type===B4.RichTextNodeType.embed};let d=n=>r.exact(r.intersection([r.type({type:(0,zv.refineType)(B4.RichTextNodeTypeCodec,`string which isn't ${B4.RichTextNodeType.image} ${B4.RichTextNodeType.embed}`,t=>t!==B4.RichTextNodeType.image&&t!==B4.RichTextNodeType.embed),content:r.intersection([r.type({text:r.string}),r.partial({spans:(0,t.ValidatedMetas)(n)})])}),r.partial({label:r.string,direction:r.string})]));t.TextBlock=d(a.Link);let p=d(a.LinkLegacy),h=r.union([f,c,p]);t.BlockLegacy=new r.Type("BlockLegacy",t=>f.is(t)||c.is(t)||p.is(t),t=>h.decode(t),n=>t.ImageBlock.is(n)?c.encode(n):t.EmbedBlock.is(n)?f.encode(n):p.encode(n)),t.Block=r.union([t.ImageBlock,t.EmbedBlock,t.TextBlock])}($H)),$H}function $G(){return $J||($J=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RichTextLegacy=t.RichTextContent=t.isRichTextContent=t.RichTextContentType=void 0;let n=oN,r=(0,n.__importStar)(zm),i=zP(),o=$Z();t.RichTextContentType="StructuredTextContent";let a=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.RichTextContentType;t.isRichTextContent=a;let u=r.array(o.BlockLegacy);t.RichTextContent=r.strict({__TYPE__:r.literal(t.RichTextContentType),value:r.array(o.Block)}),(0,n.__exportStar)($Z(),t);let s=n=>new r.Type("RichTextLegacy",t.isRichTextContent,n=>(0,Dc.pipe)(u.decode(n),Do.either.map(n=>({value:n,__TYPE__:t.RichTextContentType}))),t=>({content:u.encode(t.value),types:{[n.keyOfType]:"StructuredText"}}));t.RichTextLegacy=s}($K)),$K}var $J,$Y,$Q={};function $X(){return $Y||($Y=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SeparatorContent=t.SeparatorLegacy=t.isSeparatorContent=t.SeparatorContentType=void 0;let n=(0,oN.__importStar)(zm),r=zP();t.SeparatorContentType="SeparatorContent";let i=n=>(0,r.hasContentType)(n)&&n.__TYPE__===t.SeparatorContentType;t.isSeparatorContent=i;let o=r=>new n.Type("SeparatorLegacy",t.isSeparatorContent,()=>n.success(t.SeparatorContent.encode({__TYPE__:t.SeparatorContentType})),()=>({content:{},types:{[r.keyOfType]:"Separator"}}));t.SeparatorLegacy=o,t.SeparatorContent=n.strict({__TYPE__:n.literal(t.SeparatorContentType)})}($Q)),$Q}function $0(){return $3||($3=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=oN;(0,n.__exportStar)(qw(),t),(0,n.__exportStar)(qI(),t),(0,n.__exportStar)(q0(),t),(0,n.__exportStar)(q4(),t),(0,n.__exportStar)(q9(),t),(0,n.__exportStar)(Vt(),t),(0,n.__exportStar)($B(),t),(0,n.__exportStar)(function(){if($2)return $$;$2=1,Object.defineProperty($$,"__esModule",{value:!0}),$$.NestableLegacy=$$.isNestableContent=$$.NestableContent=void 0;let t=oN,n=(0,t.__importStar)(zm),r=zL(),i=qw(),o=qI(),a=q0(),u=q4(),s=q9(),c=Vt(),l=$B(),f=$G(),d=$X();$$.NestableContent=n.union([r.EmptyContent,i.BooleanContent,o.EmbedContent,a.TextContent,a.TimestampContent,a.SelectContent,a.RangeContent,a.NumberContent,a.DateContent,a.ColorContent,u.GeoPointContent,s.ImageContent,c.IntegrationFieldContent,l.LinkContent,f.RichTextContent,d.SeparatorContent]);let p=t=>(0,a.isTextContent)(t)||(0,a.isColorContent)(t)||(0,a.isDateContent)(t)||(0,a.isTimestampContent)(t)||(0,a.isNumberContent)(t)||(0,a.isRangeContent)(t)||(0,a.isSelectContent)(t)||(0,u.isGeoPointContent)(t)||(0,f.isRichTextContent)(t)||(0,i.isBooleanContent)(t)||(0,o.isEmbedContent)(t)||(0,s.isImageContent)(t)||(0,c.isIntegrationFieldContent)(t)||(0,l.isLinkContent)(t)||(0,d.isSeparatorContent)(t)||(0,r.isEmptyContent)(t);$$.isNestableContent=p;let h=t=>({decode(n){if(!t.fieldType)return;let p=(0,r.EmptyLegacy)(t.fieldType).decode(n);if((0,Da.isRight)(p))return p;let h=(()=>{switch(t.fieldType){case"Text":return(0,a.TextLegacy)(t);case"Color":return(0,a.ColorLegacy)(t);case"Date":return(0,a.DateLegacy)(t);case"Timestamp":return(0,a.TimestampLegacy)(t);case"Number":return(0,a.NumberLegacy)(t);case"Range":return(0,a.RangeLegacy)(t);case"Select":return(0,a.SelectLegacy)(t);case"GeoPoint":return(0,u.GeoPointLegacy)(t);case"StructuredText":return(0,f.RichTextLegacy)(t);case"Boolean":return(0,i.BooleanLegacy)(t);case"Embed":return(0,o.EmbedLegacy)(t);case"Image":return(0,s.ImageLegacy)(t);case"IntegrationFields":return(0,c.IntegrationFieldLegacy)(t);case"Link":return(0,l.LinkContentLegacy)(t);case"Separator":return(0,d.SeparatorLegacy)(t);default:return}})();if(h)return h.decode(n)},encode(n){switch(n.__TYPE__){case qj.FieldContentType:return"Text"===n.type?(0,a.TextLegacy)(t).encode(n):"Color"===n.type?(0,a.ColorLegacy)(t).encode(n):"Range"===n.type?(0,a.RangeLegacy)(t).encode(n):"Date"===n.type?(0,a.DateLegacy)(t).encode(n):"Number"===n.type?(0,a.NumberLegacy)(t).encode(n):"Timestamp"===n.type?(0,a.TimestampLegacy)(t).encode(n):"Select"===n.type?(0,a.SelectLegacy)(t).encode(n):void 0;case u.GeoPointContentType:return(0,u.GeoPointLegacy)(t).encode(n);case f.RichTextContentType:return(0,f.RichTextLegacy)(t).encode(n);case o.EmbedContentType:return(0,o.EmbedLegacy)(t).encode(n);case i.BooleanContentType:return(0,i.BooleanLegacy)(t).encode(n);case s.ImageContentType:return(0,s.ImageLegacy)(t).encode(n);case c.IntegrationFieldContentType:return(0,c.IntegrationFieldLegacy)(t).encode(n);case l.LinkContentType:return(0,l.LinkContentLegacy)(t).encode(n);case d.SeparatorContentType:return(0,d.SeparatorLegacy)(t).encode(n);default:return}}});return $$.NestableLegacy=h,$$}(),t),(0,n.__exportStar)($G(),t),(0,n.__exportStar)($X(),t)}(qS)),qS}function $1(){return $4||($4=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.GroupContent=t.isGroupContent=t.GroupContentType=t.GroupLegacy=t.GroupItemLegacy=t.GroupItemContent=t.GroupItemContentType=void 0;let n=oN,r=(0,n.__importStar)(zm),i=zP(),o=$0();t.GroupItemContentType="GroupItemContent",t.GroupItemContent=r.strict({__TYPE__:r.literal(t.GroupItemContentType),value:r.array(r.tuple([r.string,o.NestableContent]))});let a=r.record(r.string,r.unknown),u=n=>new r.Type("GroupItemLegacy",n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.GroupItemContentType,r=>(0,Dc.pipe)(a.decode(r),Do.either.map(r=>({value:Object.entries(r).reduce((t,[r,i])=>{let a=(0,zD.getFieldCtx)(r,n),u=(0,o.NestableLegacy)(a).decode(i);return!u||(0,Da.isLeft)(u)?t:[...t,[r,u.right]]},[]),__TYPE__:t.GroupItemContentType}))),t=>t.value.reduce((t,[r,i])=>{let a=(0,zD.getFieldCtx)(r,n),u=(0,o.NestableLegacy)(a).encode(i);return u?{content:{...t.content,[r]:u.content},types:{...t.types,...u.types}}:t},{content:{},types:{}}));t.GroupItemLegacy=u;let s=n=>{let i=r.array(r.union([r.null,(0,t.GroupItemLegacy)(n)])),o=r.array((0,t.GroupItemLegacy)(n));return new r.Type("GroupLegacy",t.isGroupContent,n=>(0,Dc.pipe)(i.decode(n),Do.either.map(n=>({value:n.map(n=>null===n?{__TYPE__:t.GroupItemContentType,value:[]}:n),__TYPE__:t.GroupContentType}))),t=>{let r=o.encode(t.value);return{content:r.map(t=>t.content),types:r.reduce((t,n)=>({...t,...n.types}),{[n.keyOfType]:"Group"})}})};t.GroupLegacy=s,t.GroupContentType="GroupContentType";let c=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.GroupContentType;t.isGroupContent=c,t.GroupContent=r.strict({__TYPE__:r.literal(t.GroupContentType),value:r.array(t.GroupItemContent)})}(zF)),zF}var $2,$3,$4,$5,$6={},$9={},$8={},$7={};function Ke(){if($5)return $7;$5=1,Object.defineProperty($7,"__esModule",{value:!0}),$7.RepeatableWidgets=$7.RepeatableWidgetsLegacy=void 0;let t=(0,oN.__importStar)(zm),n=$1(),r=$0(),i=r=>t.array((0,n.GroupItemLegacy)(r));$7.RepeatableWidgetsLegacy=i;let o=t.tuple([t.string,r.NestableContent]),a=t.strict({__TYPE__:t.literal(n.GroupItemContentType),value:t.array(o)});return t.array(o),$7.RepeatableWidgets=t.array(a),$7}function Kt(){return Kn||(Kn=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CompositeSliceContent=t.CompositeSliceLegacy=t.isCompositeSliceContent=t.CompositeSliceContentType=void 0;let n=oN,r=(0,n.__importStar)(zm),i=zP(),o=$0(),a=Ke();t.CompositeSliceContentType="CompositeSliceContent";let u=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.CompositeSliceContentType;t.isCompositeSliceContent=u;let s=r.exact(r.partial({repeat:r.array(r.unknown),"non-repeat":r.UnknownRecord})),c=n=>new r.Type("CompositeSliceLegacy",t.isCompositeSliceContent,r=>(0,Dc.pipe)(s.decode(r),Do.either.map(r=>{let i=(()=>{let t=(0,zD.getFieldCtx)("repeat",n),i=(0,a.RepeatableWidgetsLegacy)(t).decode(r.repeat);if(!(!i||(0,Da.isLeft)(i)))return i.right})()||[];return{nonRepeat:Object.entries(r["non-repeat"]||{}).reduce((t,[r,i])=>{let a=(0,zD.getFieldCtx)(r,n,["non-repeat"]);if(!a)return t;let u=(0,o.NestableLegacy)(a).decode(i);return!u||(0,Da.isLeft)(u)?t:{...t,[r]:u.right}},{}),repeat:i,__TYPE__:t.CompositeSliceContentType}})),t=>{let r=Object.entries(t.nonRepeat).reduce((t,[r,i])=>{let a=(0,zD.getFieldCtx)(r,n,["non-repeat"]),u=(0,o.NestableLegacy)(a).encode(i);return u?{content:{...t.content,[r]:u.content},types:{...t.types,...u.types}}:t},{content:{},types:{}}),i=(()=>{let r=(0,zD.getFieldCtx)("repeat",n);return(0,a.RepeatableWidgetsLegacy)(r).encode(t.repeat)})()||[];return{content:{"non-repeat":r.content,repeat:i.map(t=>t.content)},types:{[n.keyOfType]:"Slice",...r.types,...i.reduce((t,n)=>({...t,...n.types}),{})}}});t.CompositeSliceLegacy=c,t.CompositeSliceContent=r.strict({__TYPE__:r.literal(t.CompositeSliceContentType),nonRepeat:r.record(r.string,o.NestableContent),repeat:a.RepeatableWidgets})}($8)),$8}var Kn,Kr,Ki={};function Ko(){return Kr||(Kr=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SharedSliceContent=t.SharedSliceLegacy=t.isSharedSliceContent=t.SharedSliceContentType=void 0;let n=oN,r=(0,n.__importStar)(zm),i=zP(),o=$0(),a=Ke();t.SharedSliceContentType="SharedSliceContent";let u=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.SharedSliceContentType;t.isSharedSliceContent=u;let s=r.exact(r.type({variation:r.string,items:(0,$z.withFallback)(r.array(r.unknown),[]),primary:(0,$z.withFallback)(r.UnknownRecord,{})})),c=n=>new r.Type("SharedSliceLegacy",t.isSharedSliceContent,r=>(0,Dc.pipe)(s.decode(r),Do.either.map(r=>{let i=(()=>{let t=(0,zD.getFieldCtx)("items",n,["variations",r.variation]),i=(0,a.RepeatableWidgetsLegacy)(t).decode(r.items);if(!(!i||(0,Da.isLeft)(i)))return i.right})()||[],u=Object.entries(r.primary).reduce((t,[i,a])=>{let u=(0,zD.getFieldCtx)(i,n,["variations",r.variation,"primary"]),s=(0,o.NestableLegacy)(u).decode(a);return!s||(0,Da.isLeft)(s)?t:{...t,[i]:s.right}},{});return{variation:r.variation,primary:u,items:i,__TYPE__:t.SharedSliceContentType}})),t=>{let r=Object.entries(t.primary).reduce((r,[i,a])=>{let u=(0,zD.getFieldCtx)(i,n,["variations",t.variation,"primary"]),s=(0,o.NestableLegacy)(u).encode(a);return s?{content:{...r.content,[i]:s.content},types:{...r.types,...s.types}}:r},{content:{},types:{}}),i=(()=>{let r=(0,zD.getFieldCtx)("items",n,["variations",t.variation]);return(0,a.RepeatableWidgetsLegacy)(r).encode(t.items)})()||[];return{content:{primary:r.content,items:i.map(t=>t.content),variation:t.variation},types:{[n.keyOfType]:"SharedSlice",...r.types,...i.reduce((t,n)=>({...t,...n.types}),{})}}});t.SharedSliceLegacy=c,t.SharedSliceContent=r.strict({__TYPE__:r.literal(t.SharedSliceContentType),variation:r.string,primary:r.record(r.string,o.NestableContent),items:a.RepeatableWidgets})}(Ki)),Ki}var Ka,Ku={};function Ks(){if(Ka)return Ku;Ka=1,Object.defineProperty(Ku,"__esModule",{value:!0}),Ku.SimpleSliceLegacy=Ku.isSimpleSliceContent=Ku.SimpleSliceContent=void 0;let t=(0,oN.__importStar)(zm),n=$1(),r=$0();Ku.SimpleSliceContent=t.union([r.NestableContent,n.GroupContent]);let i=t=>(0,r.isNestableContent)(t)||(0,n.isGroupContent)(t);Ku.isSimpleSliceContent=i;let o=t=>({decode:"Group"===t.fieldType?(0,n.GroupLegacy)(t).decode.bind(null):(0,r.NestableLegacy)(t).decode.bind(null),encode:i=>"GroupContentType"===i.__TYPE__?(0,n.GroupLegacy)(t).encode(i):(0,r.NestableLegacy)(t).encode(i)});return Ku.SimpleSliceLegacy=o,Ku}function Kc(){return Kl||(Kl=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SliceContent=t.SliceLegacy=void 0;let n=oN,r=(0,n.__importStar)(zm),i=Kt(),o=Ko(),a=Ks(),u=t=>({decode:n=>(()=>{switch(t.fieldType){case"Slice":return(0,i.CompositeSliceLegacy)(t);case"SharedSlice":return(0,o.SharedSliceLegacy)(t);default:return(0,a.SimpleSliceLegacy)(t)}})().decode(n),encode(n){switch(n.__TYPE__){case"SharedSliceContent":return(0,o.SharedSliceLegacy)(t).encode(n);case"CompositeSliceContent":return(0,i.CompositeSliceLegacy)(t).encode(n);default:return(0,a.SimpleSliceLegacy)(t).encode(n)}}});t.SliceLegacy=u,t.SliceContent=r.union([i.CompositeSliceContent,o.SharedSliceContent,a.SimpleSliceContent]),(0,n.__exportStar)(Kt(),t),(0,n.__exportStar)(Ko(),t),(0,n.__exportStar)(Ks(),t)}($9)),$9}var Kl,Kf,Kd={};function Kp(){if(Kf)return Kd;Kf=1,Object.defineProperty(Kd,"__esModule",{value:!0}),Kd.SlicesItemLegacy=Kd.SliceItemContent=void 0;let t=oN,n=(0,t.__importStar)(zm),r=Kc(),i=Kt(),o=Ko(),a=Ks();Kd.SliceItemContent=n.type({key:n.string,name:n.string,maybeLabel:n.union([n.string,n.undefined]),widget:r.SliceContent});let u=n.exact(n.intersection([n.type({key:n.string,value:n.unknown}),n.partial({label:(0,zv.nullable)(n.string)})])),s=t=>new n.Type("SlicesItemLegacy",t=>((0,o.isSharedSliceContent)(t.widget),(0,i.isCompositeSliceContent)(t.widget),(0,a.isSimpleSliceContent)(t.widget)),(i,o)=>(0,Dc.pipe)(u.decode(i),Do.either.chain(a=>{var u;let s=a.key.indexOf("$"),c=a.key.substring(0,s>0?s:void 0),l=(0,zD.getFieldCtx)(c,t),f=(0,r.SliceLegacy)(l).decode(a.value);return!f||(0,Da.isLeft)(f)?n.failure(i,o):n.success({key:a.key,name:c,maybeLabel:null!==(u=a.label)&&void 0!==u?u:void 0,widget:f.right})})),n=>{let i=(0,zD.getFieldCtx)(n.name,t),o=(0,r.SliceLegacy)(i).encode(n.widget);return{content:{key:n.key,label:n.maybeLabel,value:(null==o?void 0:o.content)||{}},types:(null==o?void 0:o.types)||{}}});return Kd.SlicesItemLegacy=s,Kd}var Kh,Km={};function Kg(){return Ky||(Ky=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=oN;(0,n.__exportStar)(Kc(),t),(0,n.__exportStar)(Kp(),t),(0,n.__exportStar)((Kh||(Kh=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SlicesContent=t.SlicesLegacy=t.isSlicesContent=t.SlicesContentType=void 0;let n=oN,r=(0,n.__importStar)(zm),i=zP(),o=Kp();t.SlicesContentType="SliceContentType";let a=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.SlicesContentType;t.isSlicesContent=a;let u=n=>{let i=r.array((0,o.SlicesItemLegacy)(n));return new r.Type("SlicesLegacy",t.isSlicesContent,n=>(0,Dc.pipe)(i.decode(n),Do.either.map(n=>({__TYPE__:t.SlicesContentType,value:n}))),t=>{let r=i.encode(t.value);return{content:r.map(t=>t.content),types:r.reduce((t,n)=>({...t,...n.types}),{[n.keyOfType]:"Slices"})}})};t.SlicesLegacy=u,t.SlicesContent=r.type({__TYPE__:r.literal(t.SlicesContentType),value:r.array(o.SliceItemContent)})}(Km)),Km),t)}($6)),$6}var Ky,Kv,Kb={};function Kx(){return Kv||(Kv=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.UIDContent=t.UIDLegacy=t.isUIDContent=t.UIDContentType=void 0;let n=oN,r=(0,n.__importStar)(zm),i=zP();t.UIDContentType="UIDContent";let o=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.UIDContentType;t.isUIDContent=o;let a=n=>new r.Type("UIDLegacy",t.isUIDContent,n=>(0,Dc.pipe)(r.string.decode(n),Do.either.map(n=>t.UIDContent.encode({value:n,__TYPE__:t.UIDContentType}))),t=>({content:t.value,types:{[n.keyOfType]:"UID"}}));t.UIDLegacy=a,t.UIDContent=r.type({__TYPE__:r.literal(t.UIDContentType),value:r.string})}(Kb)),Kb}var K_,KS={};function KT(){return i||(i=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=oN;(0,n.__exportStar)(zL(),t),(0,n.__exportStar)($1(),t),(0,n.__exportStar)($0(),t),(0,n.__exportStar)(Kg(),t),(0,n.__exportStar)(Kx(),t),(0,n.__exportStar)(function(){if(K_)return KS;K_=1,Object.defineProperty(KS,"__esModule",{value:!0}),KS.WidgetLegacy=KS.isWidgetContent=KS.WidgetContent=void 0;let t=(0,oN.__importStar)(zm),n=$1(),r=$0(),i=Kg(),o=Kx();KS.WidgetContent=t.union([n.GroupContent,r.NestableContent,o.UIDContent,i.SlicesContent]);let a=t=>(0,n.isGroupContent)(t)||(0,r.isNestableContent)(t)||(0,o.isUIDContent)(t)||(0,i.isSlicesContent)(t);KS.isWidgetContent=a;let u=t=>({decode(a){if(!t.fieldType)return;let u=(()=>{switch(t.fieldType){case"UID":return(0,o.UIDLegacy)(t);case"Group":return(0,n.GroupLegacy)(t);case"Choice":case"Slices":return(0,i.SlicesLegacy)(t);default:return(0,r.NestableLegacy)(t)}})();if(u)return u.decode(a)},encode(a){switch(a.__TYPE__){case o.UIDContentType:return(0,o.UIDLegacy)(t).encode(a);case n.GroupContentType:return(0,n.GroupLegacy)(t).encode(a);case i.SlicesContentType:return(0,i.SlicesLegacy)(t).encode(a);default:return(0,r.NestableLegacy)(t).encode(a)}}});return KS.WidgetLegacy=u,KS}(),t)}(zA)),zA}Object.defineProperty(oP,"__esModule",{value:!0}),oP.DocumentLegacy=oP.Document=void 0;let Kw=oN,KO=(0,Kw.__importStar)(zm),Kk=KT();oP.Document=KO.record(zg.WidgetKey,Kk.WidgetContent);let KI=KO.record(zg.WidgetKey,KO.unknown),KM=t=>new KO.Type("Document",t=>!!t&&"object"==typeof t,n=>(0,Dc.pipe)(KI.decode(n),Do.either.map(n=>Object.entries(n).reduce((n,[r,i])=>{let o=(0,zD.defaultCtx)(r,t),a=(0,Kk.WidgetLegacy)(o).decode(i);return!a||(0,Da.isLeft)(a)?n:{...n,[r]:a.right}},{}))),n=>Object.entries(n).reduce((n,[r,i])=>{let o=(0,zD.defaultCtx)(r,t),a=(0,Kk.WidgetLegacy)(o).encode(i);return a?{content:{...n.content,[r]:a.content},types:{...n.types,...a.types}}:n},{content:{},types:{}}));function KC(t){let n=Object.entries(t),{types:r,widgets:i}=n.reduce((t,[n,r])=>{if(n.endsWith("_TYPE")){let i=zD.FieldOrSliceType.decode(r);if((0,Da.isRight)(i))return{...t,types:t.types.set(n.substring(0,n.length-5),i.right)}}return n.endsWith("_POSITION")||n.endsWith("_TYPE")?t:{...t,widgets:{...t.widgets,[n]:r}}},{types:new Map,widgets:{}}),o=t.slugs_INTERNAL||[],a=t.uid;return{widgets:i,types:r,uid:a,slugs:o}}function KR(t){var n;return(null==(n=t.config)?void 0:n.label)??("Boolean"===t.type||"Separator"===t.type?void 0:t.fieldset)??t.type}function KE(t,n){var r,i,o;return"Boolean"===t.type?(n?null==(r=t.config)?void 0:r.placeholder_true:null==(i=t.config)?void 0:i.placeholder_false)??"...":(null==(o=t.config)?void 0:o.placeholder)??"..."}function KA(t){var n;let{content:r,field:i,id:o,onContentChange:a,readOnly:u}=t,s=(null==r?void 0:r.value)??(null==(n=i.config)?void 0:n.default_value)??!1;return M.jsxs(l.gN,{children:[M.jsx(l.fw,{name:"toggleOff"}),M.jsx(l.Qy,{htmlFor:o,children:KR(i)}),M.jsxs(l.JO,{children:[M.jsx(l.xu,{padding:4,alignItems:"center",children:M.jsx(l.xv,{children:KE(i,s)})}),M.jsx(l.rs,{checked:s,id:o,onCheckedChange(t){var n;u||a((n=t,{__TYPE__:"BooleanContent",value:n}))}})]})]})}function Kj(t){let{id:n,field:r,content:i,onContentChange:o}=t;return M.jsxs(l.gN,{children:[M.jsx(l.fw,{name:"colorLens"}),M.jsx(l.Qy,{id:n,children:KR(r)}),M.jsx(l.JO,{children:M.jsx(l.xu,{padding:{left:4},alignItems:"center",children:M.jsx(l.TC,{onValueChange(t){var n;return o((n=t,void 0===n?void 0:{__TYPE__:"FieldContent",type:"Color",value:n}))},value:null==i?void 0:i.value,"aria-labelledby":n,placeholder:KE(r)})})})]})}function KN(t){let{id:n,readOnly:r,field:i,content:o,onContentChange:a}=t;return M.jsxs(l.gN,{children:[M.jsx(l.fw,{name:"dateRange"}),M.jsx(l.Qy,{id:n,children:KR(i)}),M.jsx(l.JO,{children:M.jsx(l.xu,{padding:{left:4,right:12},width:"100%",flexDirection:"column",justifyContent:"center",children:M.jsx(l.Wr,{mode:"date","aria-labelledby":n,readOnly:r,value:null==o?void 0:o.value,onValueChange(t){var n;return a((n=t,void 0===n?void 0:{__TYPE__:"FieldContent",type:"Date",value:n}))}})})})]})}oP.DocumentLegacy={_codec:KM,extractMetadata:KC,parse:function(t){let n=(0,Dc.pipe)(KO.record(zg.WidgetKey,KO.unknown).decode(t),Do.either.chain(t=>{let{types:n,widgets:r}=KC(t);return KM(n).decode(r)}));return(0,Da.isLeft)(n)?void 0:n.right},encode:function(t){let n=KM().encode(t);return{...n.content,...n.types}}},function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=oN;(0,n.__exportStar)(oP,t),(0,n.__exportStar)(KT(),t),(0,n.__exportStar)(zD,t)}(oj),(er$=o||(o={})).assertEqual=t=>t,er$.assertIs=function(t){},er$.assertNever=function(t){throw Error()},er$.arrayToEnum=t=>{let n={};for(let r of t)n[r]=r;return n},er$.getValidEnumValues=t=>{let n=er$.objectKeys(t).filter(n=>"number"!=typeof t[t[n]]),r={};for(let i of n)r[i]=t[i];return er$.objectValues(r)},er$.objectValues=t=>er$.objectKeys(t).map(function(n){return t[n]}),er$.objectKeys="function"==typeof Object.keys?t=>Object.keys(t):t=>{let n=[];for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&n.push(r);return n},er$.find=(t,n)=>{for(let r of t)if(n(r))return r},er$.isInteger="function"==typeof Number.isInteger?t=>Number.isInteger(t):t=>"number"==typeof t&&isFinite(t)&&Math.floor(t)===t,er$.joinValues=function(t,n=" | "){return t.map(t=>"string"==typeof t?`'${t}'`:t).join(n)},er$.jsonStringifyReplacer=(t,n)=>"bigint"==typeof n?n.toString():n,(erK=a||(a={})).mergeShapes=(t,n)=>({...t,...n});let KP=o.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),KL=t=>{switch(typeof t){case"undefined":return KP.undefined;case"string":return KP.string;case"number":return isNaN(t)?KP.nan:KP.number;case"boolean":return KP.boolean;case"function":return KP.function;case"bigint":return KP.bigint;case"symbol":return KP.symbol;case"object":return Array.isArray(t)?KP.array:null===t?KP.null:t.then&&"function"==typeof t.then&&t.catch&&"function"==typeof t.catch?KP.promise:"u">typeof Map&&t instanceof Map?KP.map:"u">typeof Set&&t instanceof Set?KP.set:"u">typeof Date&&t instanceof Date?KP.date:KP.object;default:return KP.unknown}},KF=o.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"]),KD=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class KW extends Error{constructor(t){super(),this.issues=[],this.addIssue=t=>{this.issues=[...this.issues,t]},this.addIssues=(t=[])=>{this.issues=[...this.issues,...t]};let 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){let n=t||function(t){return t.message},r={_errors:[]},i=t=>{for(let o of t.issues)if("invalid_union"===o.code)o.unionErrors.map(i);else if("invalid_return_type"===o.code)i(o.returnTypeError);else if("invalid_arguments"===o.code)i(o.argumentsError);else if(0===o.path.length)r._errors.push(n(o));else{let a=r,u=0;for(;u<o.path.length;){let s=o.path[u];u===o.path.length-1?(a[s]=a[s]||{_errors:[]},a[s]._errors.push(n(o))):a[s]=a[s]||{_errors:[]},a=a[s],u++}}};return i(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,o.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(t=t=>t.message){let n={},r=[];for(let 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()}}KW.create=t=>new KW(t);let KU=(t,n)=>{let r;switch(t.code){case KF.invalid_type:r=t.received===KP.undefined?"Required":`Expected ${t.expected}, received ${t.received}`;break;case KF.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,o.jsonStringifyReplacer)}`;break;case KF.unrecognized_keys:r=`Unrecognized key(s) in object: ${o.joinValues(t.keys,", ")}`;break;case KF.invalid_union:r="Invalid input";break;case KF.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${o.joinValues(t.options)}`;break;case KF.invalid_enum_value:r=`Invalid enum value. Expected ${o.joinValues(t.options)}, received '${t.received}'`;break;case KF.invalid_arguments:r="Invalid function arguments";break;case KF.invalid_return_type:r="Invalid function return type";break;case KF.invalid_date:r="Invalid date";break;case KF.invalid_string:"object"==typeof t.validation?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,"number"==typeof t.validation.position&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:o.assertNever(t.validation):r="regex"!==t.validation?`Invalid ${t.validation}`:"Invalid";break;case KF.too_small:r="array"===t.type?`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:"string"===t.type?`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:"number"===t.type?`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:"date"===t.type?`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:"Invalid input";break;case KF.too_big:r="array"===t.type?`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:"string"===t.type?`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:"number"===t.type?`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:"bigint"===t.type?`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:"date"===t.type?`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:"Invalid input";break;case KF.custom:r="Invalid input";break;case KF.invalid_intersection_types:r="Intersection results could not be merged";break;case KF.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case KF.not_finite:r="Number must be finite";break;default:r=n.defaultError,o.assertNever(t)}return{message:r}},Kz=KU;function KB(t){Kz=t}function Kq(){return Kz}let KV=t=>{let{data:n,path:r,errorMaps:i,issueData:o}=t,a=[...r,...o.path||[]],u={...o,path:a},s="",c=i.filter(t=>!!t).slice().reverse();for(let l of c)s=l(u,{data:n,defaultError:s}).message;return{...o,path:a,message:o.message||s}};function K$(t,n){let r=KV({issueData:n,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Kz,KU].filter(t=>!!t)});t.common.issues.push(r)}class KK{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(t,n){let r=[];for(let i of n){if("aborted"===i.status)return KH;"dirty"===i.status&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){let r=[];for(let i of n)r.push({key:await i.key,value:await i.value});return KK.mergeObjectSync(t,r)}static mergeObjectSync(t,n){let r={};for(let i of n){let{key:o,value:a}=i;if("aborted"===o.status||"aborted"===a.status)return KH;"dirty"===o.status&&t.dirty(),"dirty"===a.status&&t.dirty(),("u">typeof a.value||i.alwaysSet)&&(r[o.value]=a.value)}return{status:t.value,value:r}}}let KH=Object.freeze({status:"aborted"}),KZ=t=>({status:"dirty",value:t}),KG=t=>({status:"valid",value:t}),KJ=t=>"aborted"===t.status,KY=t=>"dirty"===t.status,KQ=t=>"valid"===t.status,KX=t=>"u">typeof Promise&&t instanceof Promise;(erH=u||(u={})).errToObj=t=>"string"==typeof t?{message:t}:t||{},erH.toString=t=>"string"==typeof t?t:null==t?void 0:t.message;class K0{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}}let K1=(t,n)=>{if(KQ(n))return{success:!0,data:n.value};if(!t.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new KW(t.common.issues);return this._error=r,this._error}}};function K2(t){if(!t)return{};let{errorMap:n,invalid_type_error:r,required_error:i,description:o}=t;if(n&&(r||i))throw Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return n?{errorMap:n,description:o}:{errorMap:(t,n)=>"invalid_type"!==t.code?{message:n.defaultError}:typeof n.data>"u"?{message:i??n.defaultError}:{message:r??n.defaultError},description:o}}class K3{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 KL(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:KL(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new KK,ctx:{common:t.parent.common,data:t.data,parsedType:KL(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(KX(n))throw Error("Synchronous parse encountered promise.");return n}_parseAsync(t){let n=this._parse(t);return Promise.resolve(n)}parse(t,n){let r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;let i={common:{issues:[],async:null!==(r=null==n?void 0:n.async)&&void 0!==r&&r,contextualErrorMap:null==n?void 0:n.errorMap},path:(null==n?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:KL(t)},o=this._parseSync({data:t,path:i.path,parent:i});return K1(i,o)}async parseAsync(t,n){let r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){let r={common:{issues:[],contextualErrorMap:null==n?void 0:n.errorMap,async:!0},path:(null==n?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:KL(t)},i=this._parse({data:t,path:r.path,parent:r}),o=await (KX(i)?i:Promise.resolve(i));return K1(r,o)}refine(t,n){let r=t=>"string"==typeof n||typeof n>"u"?{message:n}:"function"==typeof n?n(t):n;return this._refinement((n,i)=>{let o=t(n),a=()=>i.addIssue({code:KF.custom,...r(n)});return"u">typeof Promise&&o instanceof Promise?o.then(t=>!!t||(a(),!1)):!!o||(a(),!1)})}refinement(t,n){return this._refinement((r,i)=>!!t(r)||(i.addIssue("function"==typeof n?n(r,i):n),!1))}_refinement(t){return new HN({schema:this,typeName:s.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return HP.create(this,this._def)}nullable(){return HL.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Hy.create(this,this._def)}promise(){return Hj.create(this,this._def)}or(t){return Hb.create([this,t],this._def)}and(t){return HS.create(this,t,this._def)}transform(t){return new HN({...K2(this._def),schema:this,typeName:s.ZodEffects,effect:{type:"transform",transform:t}})}default(t){return new HF({...K2(this._def),innerType:this,defaultValue:"function"==typeof t?t:()=>t,typeName:s.ZodDefault})}brand(){return new Hz({typeName:s.ZodBranded,type:this,...K2(this._def)})}catch(t){return new HD({...K2(this._def),innerType:this,catchValue:"function"==typeof t?t:()=>t,typeName:s.ZodCatch})}describe(t){let n=this.constructor;return new n({...this._def,description:t})}pipe(t){return HB.create(this,t)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}let K4=/^c[^\s-]{8,}$/i,K5=/^[a-z][a-z0-9]*$/,K6=/[0-9A-HJKMNP-TV-Z]{26}/,K9=/^([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,K8=/^(([^<>()[\]\\.,;:\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,})+))$/,K7=/^(\p{Extended_Pictographic}|\p{Emoji_Component})+$/u,He=/^(((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}))$/,Ht=/^(([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})))$/,Hn=t=>t.precision?t.offset?RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):0===t.precision?t.offset?RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function Hr(t,n){return!!(("v4"===n||!n)&&He.test(t)||("v6"===n||!n)&&Ht.test(t))}class Hi extends K3{constructor(){super(...arguments),this._regex=(t,n,r)=>this.refinement(n=>t.test(n),{validation:n,code:KF.invalid_string,...u.errToObj(r)}),this.nonempty=t=>this.min(1,u.errToObj(t)),this.trim=()=>new Hi({...this._def,checks:[...this._def.checks,{kind:"trim"}]}),this.toLowerCase=()=>new Hi({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]}),this.toUpperCase=()=>new Hi({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==KP.string){let n=this._getOrReturnCtx(t);return K$(n,{code:KF.invalid_type,expected:KP.string,received:n.parsedType}),KH}let r=new KK,i;for(let a of this._def.checks)if("min"===a.kind)t.data.length<a.value&&(K$(i=this._getOrReturnCtx(t,i),{code:KF.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if("max"===a.kind)t.data.length>a.value&&(K$(i=this._getOrReturnCtx(t,i),{code:KF.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if("length"===a.kind){let u=t.data.length>a.value,s=t.data.length<a.value;(u||s)&&(i=this._getOrReturnCtx(t,i),u?K$(i,{code:KF.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):s&&K$(i,{code:KF.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),r.dirty())}else if("email"===a.kind)K8.test(t.data)||(K$(i=this._getOrReturnCtx(t,i),{validation:"email",code:KF.invalid_string,message:a.message}),r.dirty());else if("emoji"===a.kind)K7.test(t.data)||(K$(i=this._getOrReturnCtx(t,i),{validation:"emoji",code:KF.invalid_string,message:a.message}),r.dirty());else if("uuid"===a.kind)K9.test(t.data)||(K$(i=this._getOrReturnCtx(t,i),{validation:"uuid",code:KF.invalid_string,message:a.message}),r.dirty());else if("cuid"===a.kind)K4.test(t.data)||(K$(i=this._getOrReturnCtx(t,i),{validation:"cuid",code:KF.invalid_string,message:a.message}),r.dirty());else if("cuid2"===a.kind)K5.test(t.data)||(K$(i=this._getOrReturnCtx(t,i),{validation:"cuid2",code:KF.invalid_string,message:a.message}),r.dirty());else if("ulid"===a.kind)K6.test(t.data)||(K$(i=this._getOrReturnCtx(t,i),{validation:"ulid",code:KF.invalid_string,message:a.message}),r.dirty());else if("url"===a.kind)try{new URL(t.data)}catch{K$(i=this._getOrReturnCtx(t,i),{validation:"url",code:KF.invalid_string,message:a.message}),r.dirty()}else"regex"===a.kind?(a.regex.lastIndex=0,a.regex.test(t.data)||(K$(i=this._getOrReturnCtx(t,i),{validation:"regex",code:KF.invalid_string,message:a.message}),r.dirty())):"trim"===a.kind?t.data=t.data.trim():"includes"===a.kind?t.data.includes(a.value,a.position)||(K$(i=this._getOrReturnCtx(t,i),{code:KF.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),r.dirty()):"toLowerCase"===a.kind?t.data=t.data.toLowerCase():"toUpperCase"===a.kind?t.data=t.data.toUpperCase():"startsWith"===a.kind?t.data.startsWith(a.value)||(K$(i=this._getOrReturnCtx(t,i),{code:KF.invalid_string,validation:{startsWith:a.value},message:a.message}),r.dirty()):"endsWith"===a.kind?t.data.endsWith(a.value)||(K$(i=this._getOrReturnCtx(t,i),{code:KF.invalid_string,validation:{endsWith:a.value},message:a.message}),r.dirty()):"datetime"===a.kind?Hn(a).test(t.data)||(K$(i=this._getOrReturnCtx(t,i),{code:KF.invalid_string,validation:"datetime",message:a.message}),r.dirty()):"ip"===a.kind?Hr(t.data,a.version)||(K$(i=this._getOrReturnCtx(t,i),{validation:"ip",code:KF.invalid_string,message:a.message}),r.dirty()):o.assertNever(a);return{status:r.value,value:t.data}}_addCheck(t){return new Hi({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...u.errToObj(t)})}url(t){return this._addCheck({kind:"url",...u.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...u.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...u.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...u.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...u.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...u.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...u.errToObj(t)})}datetime(t){var n;return"string"==typeof t?this._addCheck({kind:"datetime",precision:null,offset:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(null==t?void 0:t.precision)>"u"?null:null==t?void 0:t.precision,offset:null!==(n=null==t?void 0:t.offset)&&void 0!==n&&n,...u.errToObj(null==t?void 0:t.message)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...u.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:null==n?void 0:n.position,...u.errToObj(null==n?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...u.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...u.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...u.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...u.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...u.errToObj(n)})}get isDatetime(){return!!this._def.checks.find(t=>"datetime"===t.kind)}get isEmail(){return!!this._def.checks.find(t=>"email"===t.kind)}get isURL(){return!!this._def.checks.find(t=>"url"===t.kind)}get isEmoji(){return!!this._def.checks.find(t=>"emoji"===t.kind)}get isUUID(){return!!this._def.checks.find(t=>"uuid"===t.kind)}get isCUID(){return!!this._def.checks.find(t=>"cuid"===t.kind)}get isCUID2(){return!!this._def.checks.find(t=>"cuid2"===t.kind)}get isULID(){return!!this._def.checks.find(t=>"ulid"===t.kind)}get isIP(){return!!this._def.checks.find(t=>"ip"===t.kind)}get minLength(){let t=null;for(let n of this._def.checks)"min"===n.kind&&(null===t||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(let n of this._def.checks)"max"===n.kind&&(null===t||n.value<t)&&(t=n.value);return t}}function Ho(t,n){let r=(t.toString().split(".")[1]||"").length,i=(n.toString().split(".")[1]||"").length,o=r>i?r:i,a=parseInt(t.toFixed(o).replace(".","")),u=parseInt(n.toFixed(o).replace(".",""));return a%u/Math.pow(10,o)}Hi.create=t=>{var n;return new Hi({checks:[],typeName:s.ZodString,coerce:null!==(n=null==t?void 0:t.coerce)&&void 0!==n&&n,...K2(t)})};class Ha extends K3{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)!==KP.number){let n=this._getOrReturnCtx(t);return K$(n,{code:KF.invalid_type,expected:KP.number,received:n.parsedType}),KH}let r,i=new KK;for(let a of this._def.checks)"int"===a.kind?o.isInteger(t.data)||(K$(r=this._getOrReturnCtx(t,r),{code:KF.invalid_type,expected:"integer",received:"float",message:a.message}),i.dirty()):"min"===a.kind?(a.inclusive?t.data<a.value:t.data<=a.value)&&(K$(r=this._getOrReturnCtx(t,r),{code:KF.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):"max"===a.kind?(a.inclusive?t.data>a.value:t.data>=a.value)&&(K$(r=this._getOrReturnCtx(t,r),{code:KF.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):"multipleOf"===a.kind?0!==Ho(t.data,a.value)&&(K$(r=this._getOrReturnCtx(t,r),{code:KF.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):"finite"===a.kind?Number.isFinite(t.data)||(K$(r=this._getOrReturnCtx(t,r),{code:KF.not_finite,message:a.message}),i.dirty()):o.assertNever(a);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,u.toString(n))}gt(t,n){return this.setLimit("min",t,!1,u.toString(n))}lte(t,n){return this.setLimit("max",t,!0,u.toString(n))}lt(t,n){return this.setLimit("max",t,!1,u.toString(n))}setLimit(t,n,r,i){return new Ha({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:u.toString(i)}]})}_addCheck(t){return new Ha({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:u.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:u.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:u.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:u.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:u.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:u.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:u.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:u.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:u.toString(t)})}get minValue(){let t=null;for(let n of this._def.checks)"min"===n.kind&&(null===t||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)"max"===n.kind&&(null===t||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>"int"===t.kind||"multipleOf"===t.kind&&o.isInteger(t.value))}get isFinite(){let t=null,n=null;for(let r of this._def.checks){if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;"min"===r.kind?(null===n||r.value>n)&&(n=r.value):"max"===r.kind&&(null===t||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}Ha.create=t=>new Ha({checks:[],typeName:s.ZodNumber,coerce:(null==t?void 0:t.coerce)||!1,...K2(t)});class Hu extends K3{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)!==KP.bigint){let n=this._getOrReturnCtx(t);return K$(n,{code:KF.invalid_type,expected:KP.bigint,received:n.parsedType}),KH}let r,i=new KK;for(let a of this._def.checks)"min"===a.kind?(a.inclusive?t.data<a.value:t.data<=a.value)&&(K$(r=this._getOrReturnCtx(t,r),{code:KF.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):"max"===a.kind?(a.inclusive?t.data>a.value:t.data>=a.value)&&(K$(r=this._getOrReturnCtx(t,r),{code:KF.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):"multipleOf"===a.kind?t.data%a.value!==BigInt(0)&&(K$(r=this._getOrReturnCtx(t,r),{code:KF.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):o.assertNever(a);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,u.toString(n))}gt(t,n){return this.setLimit("min",t,!1,u.toString(n))}lte(t,n){return this.setLimit("max",t,!0,u.toString(n))}lt(t,n){return this.setLimit("max",t,!1,u.toString(n))}setLimit(t,n,r,i){return new Hu({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:u.toString(i)}]})}_addCheck(t){return new Hu({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:u.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:u.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:u.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:u.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:u.toString(n)})}get minValue(){let t=null;for(let n of this._def.checks)"min"===n.kind&&(null===t||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)"max"===n.kind&&(null===t||n.value<t)&&(t=n.value);return t}}Hu.create=t=>{var n;return new Hu({checks:[],typeName:s.ZodBigInt,coerce:null!==(n=null==t?void 0:t.coerce)&&void 0!==n&&n,...K2(t)})};class Hs extends K3{_parse(t){if(this._def.coerce&&(t.data=Boolean(t.data)),this._getType(t)!==KP.boolean){let n=this._getOrReturnCtx(t);return K$(n,{code:KF.invalid_type,expected:KP.boolean,received:n.parsedType}),KH}return KG(t.data)}}Hs.create=t=>new Hs({typeName:s.ZodBoolean,coerce:(null==t?void 0:t.coerce)||!1,...K2(t)});class Hc extends K3{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==KP.date){let n=this._getOrReturnCtx(t);return K$(n,{code:KF.invalid_type,expected:KP.date,received:n.parsedType}),KH}if(isNaN(t.data.getTime())){let r=this._getOrReturnCtx(t);return K$(r,{code:KF.invalid_date}),KH}let i=new KK,a;for(let u of this._def.checks)"min"===u.kind?t.data.getTime()<u.value&&(K$(a=this._getOrReturnCtx(t,a),{code:KF.too_small,message:u.message,inclusive:!0,exact:!1,minimum:u.value,type:"date"}),i.dirty()):"max"===u.kind?t.data.getTime()>u.value&&(K$(a=this._getOrReturnCtx(t,a),{code:KF.too_big,message:u.message,inclusive:!0,exact:!1,maximum:u.value,type:"date"}),i.dirty()):o.assertNever(u);return{status:i.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Hc({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:u.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:u.toString(n)})}get minDate(){let t=null;for(let n of this._def.checks)"min"===n.kind&&(null===t||n.value>t)&&(t=n.value);return null!=t?new Date(t):null}get maxDate(){let t=null;for(let n of this._def.checks)"max"===n.kind&&(null===t||n.value<t)&&(t=n.value);return null!=t?new Date(t):null}}Hc.create=t=>new Hc({checks:[],coerce:(null==t?void 0:t.coerce)||!1,typeName:s.ZodDate,...K2(t)});class Hl extends K3{_parse(t){if(this._getType(t)!==KP.symbol){let n=this._getOrReturnCtx(t);return K$(n,{code:KF.invalid_type,expected:KP.symbol,received:n.parsedType}),KH}return KG(t.data)}}Hl.create=t=>new Hl({typeName:s.ZodSymbol,...K2(t)});class Hf extends K3{_parse(t){if(this._getType(t)!==KP.undefined){let n=this._getOrReturnCtx(t);return K$(n,{code:KF.invalid_type,expected:KP.undefined,received:n.parsedType}),KH}return KG(t.data)}}Hf.create=t=>new Hf({typeName:s.ZodUndefined,...K2(t)});class Hd extends K3{_parse(t){if(this._getType(t)!==KP.null){let n=this._getOrReturnCtx(t);return K$(n,{code:KF.invalid_type,expected:KP.null,received:n.parsedType}),KH}return KG(t.data)}}Hd.create=t=>new Hd({typeName:s.ZodNull,...K2(t)});class Hp extends K3{constructor(){super(...arguments),this._any=!0}_parse(t){return KG(t.data)}}Hp.create=t=>new Hp({typeName:s.ZodAny,...K2(t)});class Hh extends K3{constructor(){super(...arguments),this._unknown=!0}_parse(t){return KG(t.data)}}Hh.create=t=>new Hh({typeName:s.ZodUnknown,...K2(t)});class Hm extends K3{_parse(t){let n=this._getOrReturnCtx(t);return K$(n,{code:KF.invalid_type,expected:KP.never,received:n.parsedType}),KH}}Hm.create=t=>new Hm({typeName:s.ZodNever,...K2(t)});class Hg extends K3{_parse(t){if(this._getType(t)!==KP.undefined){let n=this._getOrReturnCtx(t);return K$(n,{code:KF.invalid_type,expected:KP.void,received:n.parsedType}),KH}return KG(t.data)}}Hg.create=t=>new Hg({typeName:s.ZodVoid,...K2(t)});class Hy extends K3{_parse(t){let{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==KP.array)return K$(n,{code:KF.invalid_type,expected:KP.array,received:n.parsedType}),KH;if(null!==i.exactLength){let o=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(o||a)&&(K$(n,{code:o?KF.too_big:KF.too_small,minimum:a?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(null!==i.minLength&&n.data.length<i.minLength.value&&(K$(n,{code:KF.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),null!==i.maxLength&&n.data.length>i.maxLength.value&&(K$(n,{code:KF.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((t,r)=>i.type._parseAsync(new K0(n,t,n.path,r)))).then(t=>KK.mergeArray(r,t));let u=[...n.data].map((t,r)=>i.type._parseSync(new K0(n,t,n.path,r)));return KK.mergeArray(r,u)}get element(){return this._def.type}min(t,n){return new Hy({...this._def,minLength:{value:t,message:u.toString(n)}})}max(t,n){return new Hy({...this._def,maxLength:{value:t,message:u.toString(n)}})}length(t,n){return new Hy({...this._def,exactLength:{value:t,message:u.toString(n)}})}nonempty(t){return this.min(1,t)}}Hy.create=(t,n)=>new Hy({type:t,minLength:null,maxLength:null,exactLength:null,typeName:s.ZodArray,...K2(n)});class Hv extends K3{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;let t=this._def.shape(),n=o.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==KP.object){let n=this._getOrReturnCtx(t);return K$(n,{code:KF.invalid_type,expected:KP.object,received:n.parsedType}),KH}let{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),u=[];if(!(this._def.catchall instanceof Hm&&"strip"===this._def.unknownKeys))for(let s in i.data)a.includes(s)||u.push(s);let c=[];for(let l of a){let f=o[l],d=i.data[l];c.push({key:{status:"valid",value:l},value:f._parse(new K0(i,d,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof Hm){let p=this._def.unknownKeys;if("passthrough"===p)for(let h of u)c.push({key:{status:"valid",value:h},value:{status:"valid",value:i.data[h]}});else if("strict"===p)u.length>0&&(K$(i,{code:KF.unrecognized_keys,keys:u}),r.dirty());else if("strip"!==p)throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let m=this._def.catchall;for(let g of u){let y=i.data[g];c.push({key:{status:"valid",value:g},value:m._parse(new K0(i,y,i.path,g)),alwaysSet:g in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let t=[];for(let n of c){let r=await n.key;t.push({key:r,value:await n.value,alwaysSet:n.alwaysSet})}return t}).then(t=>KK.mergeObjectSync(r,t)):KK.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(t){return u.errToObj,new Hv({...this._def,unknownKeys:"strict",...void 0!==t?{errorMap:(n,r)=>{var i,o,a,s;let c=null!==(a=null===(o=(i=this._def).errorMap)||void 0===o?void 0:o.call(i,n,r).message)&&void 0!==a?a:r.defaultError;return"unrecognized_keys"===n.code?{message:null!==(s=u.errToObj(t).message)&&void 0!==s?s:c}:{message:c}}}:{}})}strip(){return new Hv({...this._def,unknownKeys:"strip"})}passthrough(){return new Hv({...this._def,unknownKeys:"passthrough"})}extend(t){return new Hv({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Hv({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:s.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Hv({...this._def,catchall:t})}pick(t){let n={};return o.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new Hv({...this._def,shape:()=>n})}omit(t){let n={};return o.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new Hv({...this._def,shape:()=>n})}deepPartial(){return function t(n){if(!(n instanceof Hv))return n instanceof Hy?new Hy({...n._def,type:t(n.element)}):n instanceof HP?HP.create(t(n.unwrap())):n instanceof HL?HL.create(t(n.unwrap())):n instanceof HT?HT.create(n.items.map(n=>t(n))):n;{let r={};for(let i in n.shape){let o=n.shape[i];r[i]=HP.create(t(o))}return new Hv({...n._def,shape:()=>r})}}(this)}partial(t){let n={};return o.objectKeys(this.shape).forEach(r=>{let i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new Hv({...this._def,shape:()=>n})}required(t){let n={};return o.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof HP;)i=i._def.innerType;n[r]=i}}),new Hv({...this._def,shape:()=>n})}keyof(){return HR(o.objectKeys(this.shape))}}Hv.create=(t,n)=>new Hv({shape:()=>t,unknownKeys:"strip",catchall:Hm.create(),typeName:s.ZodObject,...K2(n)}),Hv.strictCreate=(t,n)=>new Hv({shape:()=>t,unknownKeys:"strict",catchall:Hm.create(),typeName:s.ZodObject,...K2(n)}),Hv.lazycreate=(t,n)=>new Hv({shape:t,unknownKeys:"strip",catchall:Hm.create(),typeName:s.ZodObject,...K2(n)});class Hb extends K3{_parse(t){let{ctx:n}=this._processInputParams(t),r=this._def.options;if(n.common.async)return Promise.all(r.map(async t=>{let r={...n,common:{...n.common,issues:[]},parent:null};return{result:await t._parseAsync({data:n.data,path:n.path,parent:r}),ctx:r}})).then(function(t){for(let r of t)if("valid"===r.result.status)return r.result;for(let i of t)if("dirty"===i.result.status)return n.common.issues.push(...i.ctx.common.issues),i.result;let o=t.map(t=>new KW(t.ctx.common.issues));return K$(n,{code:KF.invalid_union,unionErrors:o}),KH});{let i,o=[];for(let a of r){let u={...n,common:{...n.common,issues:[]},parent:null},s=a._parseSync({data:n.data,path:n.path,parent:u});if("valid"===s.status)return s;"dirty"!==s.status||i||(i={result:s,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;let c=o.map(t=>new KW(t));return K$(n,{code:KF.invalid_union,unionErrors:c}),KH}}get options(){return this._def.options}}Hb.create=(t,n)=>new Hb({options:t,typeName:s.ZodUnion,...K2(n)});let Hx=t=>t instanceof HM?Hx(t.schema):t instanceof HN?Hx(t.innerType()):t instanceof HC?[t.value]:t instanceof HE?t.options:t instanceof HA?Object.keys(t.enum):t instanceof HF?Hx(t._def.innerType):t instanceof Hf?[void 0]:t instanceof Hd?[null]:null;class H_ extends K3{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==KP.object)return K$(n,{code:KF.invalid_type,expected:KP.object,received:n.parsedType}),KH;let 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}):(K$(n,{code:KF.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),KH)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let o of n){let a=Hx(o.shape[t]);if(!a)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let u of a){if(i.has(u))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(u)}`);i.set(u,o)}}return new H_({typeName:s.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...K2(r)})}}class HS extends K3{_parse(t){let{status:n,ctx:r}=this._processInputParams(t),i=(t,i)=>{if(KJ(t)||KJ(i))return KH;let a=function t(n,r){let i=KL(n),a=KL(r);if(n===r)return{valid:!0,data:n};if(i===KP.object&&a===KP.object){let u=o.objectKeys(r),s=o.objectKeys(n).filter(t=>-1!==u.indexOf(t)),c={...n,...r};for(let l of s){let f=t(n[l],r[l]);if(!f.valid)return{valid:!1};c[l]=f.data}return{valid:!0,data:c}}if(i!==KP.array||a!==KP.array)return i===KP.date&&a===KP.date&&+n==+r?{valid:!0,data:n}:{valid:!1};{if(n.length!==r.length)return{valid:!1};let d=[];for(let p=0;p<n.length;p++){let h=n[p],m=r[p],g=t(h,m);if(!g.valid)return{valid:!1};d.push(g.data)}return{valid:!0,data:d}}}(t.value,i.value);return a.valid?((KY(t)||KY(i))&&n.dirty(),{status:n.value,value:a.data}):(K$(r,{code:KF.invalid_intersection_types}),KH)};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(([t,n])=>i(t,n)):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}))}}HS.create=(t,n,r)=>new HS({left:t,right:n,typeName:s.ZodIntersection,...K2(r)});class HT extends K3{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==KP.array)return K$(r,{code:KF.invalid_type,expected:KP.array,received:r.parsedType}),KH;if(r.data.length<this._def.items.length)return K$(r,{code:KF.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),KH;!this._def.rest&&r.data.length>this._def.items.length&&(K$(r,{code:KF.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let i=[...r.data].map((t,n)=>{let i=this._def.items[n]||this._def.rest;return i?i._parse(new K0(r,t,r.path,n)):null}).filter(t=>!!t);return r.common.async?Promise.all(i).then(t=>KK.mergeArray(n,t)):KK.mergeArray(n,i)}get items(){return this._def.items}rest(t){return new HT({...this._def,rest:t})}}HT.create=(t,n)=>{if(!Array.isArray(t))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new HT({items:t,typeName:s.ZodTuple,rest:null,...K2(n)})};class Hw extends K3{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==KP.object)return K$(r,{code:KF.invalid_type,expected:KP.object,received:r.parsedType}),KH;let i=[],o=this._def.keyType,a=this._def.valueType;for(let u in r.data)i.push({key:o._parse(new K0(r,u,r.path,u)),value:a._parse(new K0(r,r.data[u],r.path,u))});return r.common.async?KK.mergeObjectAsync(n,i):KK.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return new Hw(n instanceof K3?{keyType:t,valueType:n,typeName:s.ZodRecord,...K2(r)}:{keyType:Hi.create(),valueType:t,typeName:s.ZodRecord,...K2(n)})}}class HO extends K3{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==KP.map)return K$(r,{code:KF.invalid_type,expected:KP.map,received:r.parsedType}),KH;let i=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([t,n],a)=>({key:i._parse(new K0(r,t,r.path,[a,"key"])),value:o._parse(new K0(r,n,r.path,[a,"value"]))}));if(r.common.async){let u=new Map;return Promise.resolve().then(async()=>{for(let t of a){let r=await t.key,i=await t.value;if("aborted"===r.status||"aborted"===i.status)return KH;("dirty"===r.status||"dirty"===i.status)&&n.dirty(),u.set(r.value,i.value)}return{status:n.value,value:u}})}{let s=new Map;for(let c of a){let l=c.key,f=c.value;if("aborted"===l.status||"aborted"===f.status)return KH;("dirty"===l.status||"dirty"===f.status)&&n.dirty(),s.set(l.value,f.value)}return{status:n.value,value:s}}}}HO.create=(t,n,r)=>new HO({valueType:n,keyType:t,typeName:s.ZodMap,...K2(r)});class Hk extends K3{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==KP.set)return K$(r,{code:KF.invalid_type,expected:KP.set,received:r.parsedType}),KH;let i=this._def;null!==i.minSize&&r.data.size<i.minSize.value&&(K$(r,{code:KF.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),null!==i.maxSize&&r.data.size>i.maxSize.value&&(K$(r,{code:KF.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());let o=this._def.valueType;function a(t){let r=new Set;for(let i of t){if("aborted"===i.status)return KH;"dirty"===i.status&&n.dirty(),r.add(i.value)}return{status:n.value,value:r}}let u=[...r.data.values()].map((t,n)=>o._parse(new K0(r,t,r.path,n)));return r.common.async?Promise.all(u).then(t=>a(t)):a(u)}min(t,n){return new Hk({...this._def,minSize:{value:t,message:u.toString(n)}})}max(t,n){return new Hk({...this._def,maxSize:{value:t,message:u.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}Hk.create=(t,n)=>new Hk({valueType:t,minSize:null,maxSize:null,typeName:s.ZodSet,...K2(n)});class HI extends K3{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==KP.function)return K$(n,{code:KF.invalid_type,expected:KP.function,received:n.parsedType}),KH;function r(t,r){return KV({data:t,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Kz,KU].filter(t=>!!t),issueData:{code:KF.invalid_arguments,argumentsError:r}})}function i(t,r){return KV({data:t,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Kz,KU].filter(t=>!!t),issueData:{code:KF.invalid_return_type,returnTypeError:r}})}let o={errorMap:n.common.contextualErrorMap},a=n.data;return this._def.returns instanceof Hj?KG(async(...t)=>{let n=new KW([]),u=await this._def.args.parseAsync(t,o).catch(i=>{throw n.addIssue(r(t,i)),n}),s=await a(...u);return await this._def.returns._def.type.parseAsync(s,o).catch(t=>{throw n.addIssue(i(s,t)),n})}):KG((...t)=>{let n=this._def.args.safeParse(t,o);if(!n.success)throw new KW([r(t,n.error)]);let u=a(...n.data),s=this._def.returns.safeParse(u,o);if(!s.success)throw new KW([i(u,s.error)]);return s.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new HI({...this._def,args:HT.create(t).rest(Hh.create())})}returns(t){return new HI({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new HI({args:t||HT.create([]).rest(Hh.create()),returns:n||Hh.create(),typeName:s.ZodFunction,...K2(r)})}}class HM extends K3{get schema(){return this._def.getter()}_parse(t){let{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}HM.create=(t,n)=>new HM({getter:t,typeName:s.ZodLazy,...K2(n)});class HC extends K3{_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return K$(n,{received:n.data,code:KF.invalid_literal,expected:this._def.value}),KH}return{status:"valid",value:t.data}}get value(){return this._def.value}}function HR(t,n){return new HE({values:t,typeName:s.ZodEnum,...K2(n)})}HC.create=(t,n)=>new HC({value:t,typeName:s.ZodLiteral,...K2(n)});class HE extends K3{_parse(t){if("string"!=typeof t.data){let n=this._getOrReturnCtx(t),r=this._def.values;return K$(n,{expected:o.joinValues(r),received:n.parsedType,code:KF.invalid_type}),KH}if(-1===this._def.values.indexOf(t.data)){let i=this._getOrReturnCtx(t),a=this._def.values;return K$(i,{received:i.data,code:KF.invalid_enum_value,options:a}),KH}return KG(t.data)}get options(){return this._def.values}get enum(){let t={};for(let n of this._def.values)t[n]=n;return t}get Values(){let t={};for(let n of this._def.values)t[n]=n;return t}get Enum(){let t={};for(let n of this._def.values)t[n]=n;return t}extract(t){return HE.create(t)}exclude(t){return HE.create(this.options.filter(n=>!t.includes(n)))}}HE.create=HR;class HA extends K3{_parse(t){let n=o.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==KP.string&&r.parsedType!==KP.number){let i=o.objectValues(n);return K$(r,{expected:o.joinValues(i),received:r.parsedType,code:KF.invalid_type}),KH}if(-1===n.indexOf(t.data)){let a=o.objectValues(n);return K$(r,{received:r.data,code:KF.invalid_enum_value,options:a}),KH}return KG(t.data)}get enum(){return this._def.values}}HA.create=(t,n)=>new HA({values:t,typeName:s.ZodNativeEnum,...K2(n)});class Hj extends K3{unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==KP.promise&&!1===n.common.async)return K$(n,{code:KF.invalid_type,expected:KP.promise,received:n.parsedType}),KH;let r=n.parsedType===KP.promise?n.data:Promise.resolve(n.data);return KG(r.then(t=>this._def.type.parseAsync(t,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Hj.create=(t,n)=>new Hj({type:t,typeName:s.ZodPromise,...K2(n)});class HN extends K3{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===s.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null;if("preprocess"===i.type){let a=i.transform(r.data);return r.common.async?Promise.resolve(a).then(t=>this._def.schema._parseAsync({data:t,path:r.path,parent:r})):this._def.schema._parseSync({data:a,path:r.path,parent:r})}let u={addIssue(t){K$(r,t),t.fatal?n.abort():n.dirty()},get path(){return r.path}};if(u.addIssue=u.addIssue.bind(u),"refinement"===i.type){let s=t=>{let n=i.refinement(t,u);if(r.common.async)return Promise.resolve(n);if(n instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return t};if(!1!==r.common.async)return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(t=>"aborted"===t.status?KH:("dirty"===t.status&&n.dirty(),s(t.value).then(()=>({status:n.value,value:t.value}))));{let c=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===c.status?KH:("dirty"===c.status&&n.dirty(),s(c.value),{status:n.value,value:c.value})}}if("transform"===i.type){if(!1!==r.common.async)return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(t=>KQ(t)?Promise.resolve(i.transform(t.value,u)).then(t=>({status:n.value,value:t})):t);{let l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!KQ(l))return l;let f=i.transform(l.value,u);if(f instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:f}}}o.assertNever(i)}}HN.create=(t,n,r)=>new HN({schema:t,typeName:s.ZodEffects,effect:n,...K2(r)}),HN.createWithPreprocess=(t,n,r)=>new HN({schema:n,effect:{type:"preprocess",transform:t},typeName:s.ZodEffects,...K2(r)});class HP extends K3{_parse(t){return this._getType(t)===KP.undefined?KG(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}HP.create=(t,n)=>new HP({innerType:t,typeName:s.ZodOptional,...K2(n)});class HL extends K3{_parse(t){return this._getType(t)===KP.null?KG(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}HL.create=(t,n)=>new HL({innerType:t,typeName:s.ZodNullable,...K2(n)});class HF extends K3{_parse(t){let{ctx:n}=this._processInputParams(t),r=n.data;return n.parsedType===KP.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}HF.create=(t,n)=>new HF({innerType:t,typeName:s.ZodDefault,defaultValue:"function"==typeof n.default?n.default:()=>n.default,...K2(n)});class HD extends K3{_parse(t){let{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 KX(i)?i.then(t=>({status:"valid",value:"valid"===t.status?t.value:this._def.catchValue({get error(){return new KW(r.common.issues)},input:r.data})})):{status:"valid",value:"valid"===i.status?i.value:this._def.catchValue({get error(){return new KW(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}HD.create=(t,n)=>new HD({innerType:t,typeName:s.ZodCatch,catchValue:"function"==typeof n.catch?n.catch:()=>n.catch,...K2(n)});class HW extends K3{_parse(t){if(this._getType(t)!==KP.nan){let n=this._getOrReturnCtx(t);return K$(n,{code:KF.invalid_type,expected:KP.nan,received:n.parsedType}),KH}return{status:"valid",value:t.data}}}HW.create=t=>new HW({typeName:s.ZodNaN,...K2(t)});let HU=Symbol("zod_brand");class Hz extends K3{_parse(t){let{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 HB extends K3{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{let t=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===t.status?KH:"dirty"===t.status?(n.dirty(),KZ(t.value)):this._def.out._parseAsync({data:t.value,path:r.path,parent:r})})();{let i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===i.status?KH:"dirty"===i.status?(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 HB({in:t,out:n,typeName:s.ZodPipeline})}}let Hq=(t,n={},r)=>t?Hp.create().superRefine((i,o)=>{var a,u;if(!t(i)){let s="function"==typeof n?n(i):"string"==typeof n?{message:n}:n,c=null===(u=null!==(a=s.fatal)&&void 0!==a?a:r)||void 0===u||u;o.addIssue({code:"custom",..."string"==typeof s?{message:s}:s,fatal:c})}}):Hp.create(),HV={object:Hv.lazycreate};(erZ=s||(s={})).ZodString="ZodString",erZ.ZodNumber="ZodNumber",erZ.ZodNaN="ZodNaN",erZ.ZodBigInt="ZodBigInt",erZ.ZodBoolean="ZodBoolean",erZ.ZodDate="ZodDate",erZ.ZodSymbol="ZodSymbol",erZ.ZodUndefined="ZodUndefined",erZ.ZodNull="ZodNull",erZ.ZodAny="ZodAny",erZ.ZodUnknown="ZodUnknown",erZ.ZodNever="ZodNever",erZ.ZodVoid="ZodVoid",erZ.ZodArray="ZodArray",erZ.ZodObject="ZodObject",erZ.ZodUnion="ZodUnion",erZ.ZodDiscriminatedUnion="ZodDiscriminatedUnion",erZ.ZodIntersection="ZodIntersection",erZ.ZodTuple="ZodTuple",erZ.ZodRecord="ZodRecord",erZ.ZodMap="ZodMap",erZ.ZodSet="ZodSet",erZ.ZodFunction="ZodFunction",erZ.ZodLazy="ZodLazy",erZ.ZodLiteral="ZodLiteral",erZ.ZodEnum="ZodEnum",erZ.ZodEffects="ZodEffects",erZ.ZodNativeEnum="ZodNativeEnum",erZ.ZodOptional="ZodOptional",erZ.ZodNullable="ZodNullable",erZ.ZodDefault="ZodDefault",erZ.ZodCatch="ZodCatch",erZ.ZodPromise="ZodPromise",erZ.ZodBranded="ZodBranded",erZ.ZodPipeline="ZodPipeline";let H$=(t,n={message:`Input not instance of ${t.name}`})=>Hq(n=>n instanceof t,n),HK=Hi.create,HH=Ha.create,HZ=HW.create,HG=Hu.create,HJ=Hs.create,HY=Hc.create,HQ=Hl.create,HX=Hf.create,H0=Hd.create,H1=Hp.create,H2=Hh.create,H3=Hm.create,H4=Hg.create,H5=Hy.create,H6=Hv.create,H9=Hv.strictCreate,H8=Hb.create,H7=H_.create,Ze=HS.create,Zt=HT.create,Zn=Hw.create,Zr=HO.create,Zi=Hk.create,Zo=HI.create,Za=HM.create,Zu=HC.create,Zs=HE.create,Zc=HA.create,Zl=Hj.create,Zf=HN.create,Zd=HP.create,Zp=HL.create,Zh=HN.createWithPreprocess,Zm=HB.create,Zg=()=>HK().optional(),Zy=()=>HH().optional(),Zv=()=>HJ().optional();var Zb=Object.freeze({__proto__:null,defaultErrorMap:KU,setErrorMap:KB,getErrorMap:Kq,makeIssue:KV,EMPTY_PATH:[],addIssueToContext:K$,ParseStatus:KK,INVALID:KH,DIRTY:KZ,OK:KG,isAborted:KJ,isDirty:KY,isValid:KQ,isAsync:KX,get util(){return o},get objectUtil(){return a},ZodParsedType:KP,getParsedType:KL,ZodType:K3,ZodString:Hi,ZodNumber:Ha,ZodBigInt:Hu,ZodBoolean:Hs,ZodDate:Hc,ZodSymbol:Hl,ZodUndefined:Hf,ZodNull:Hd,ZodAny:Hp,ZodUnknown:Hh,ZodNever:Hm,ZodVoid:Hg,ZodArray:Hy,ZodObject:Hv,ZodUnion:Hb,ZodDiscriminatedUnion:H_,ZodIntersection:HS,ZodTuple:HT,ZodRecord:Hw,ZodMap:HO,ZodSet:Hk,ZodFunction:HI,ZodLazy:HM,ZodLiteral:HC,ZodEnum:HE,ZodNativeEnum:HA,ZodPromise:Hj,ZodEffects:HN,ZodTransformer:HN,ZodOptional:HP,ZodNullable:HL,ZodDefault:HF,ZodCatch:HD,ZodNaN:HW,BRAND:HU,ZodBranded:Hz,ZodPipeline:HB,custom:Hq,Schema:K3,ZodSchema:K3,late:HV,get ZodFirstPartyTypeKind(){return s},coerce:{string:t=>Hi.create({...t,coerce:!0}),number:t=>Ha.create({...t,coerce:!0}),boolean:t=>Hs.create({...t,coerce:!0}),bigint:t=>Hu.create({...t,coerce:!0}),date:t=>Hc.create({...t,coerce:!0})},any:H1,array:H5,bigint:HG,boolean:HJ,date:HY,discriminatedUnion:H7,effect:Zf,enum:Zs,function:Zo,instanceof:H$,intersection:Ze,lazy:Za,literal:Zu,map:Zr,nan:HZ,nativeEnum:Zc,never:H3,null:H0,nullable:Zp,number:HH,object:H6,oboolean:Zv,onumber:Zy,optional:Zd,ostring:Zg,pipeline:Zm,preprocess:Zh,promise:Zl,record:Zn,set:Zi,strictObject:H9,string:HK,symbol:HQ,transformer:Zf,tuple:Zt,undefined:HX,union:H8,unknown:H2,void:H4,NEVER:KH,ZodIssueCode:KF,quotelessJson:KD,ZodError:KW});function Zx(t){let{debouncedUrl:n,content:r,onContentChange:i,selected:o}=t,a=(0,c.useRef)(null),[u,s]=(0,c.useState)(!1);return(0,f.pQ)(n,()=>{var t;u&&(s(!1),null==(t=a.current)||t.reset())}),n===(null==r?void 0:r.embed_url)?M.jsx(ZS,{content:r}):M.jsx(l.SV,{ref:a,renderError:Z_,onError:function(){s(!0),i(void 0)},children:M.jsx(c.Suspense,{fallback:r&&M.jsx(ZS,{content:r}),children:M.jsx(ZT,{url:n,selected:o,onContentChange:i})})})}function Z_(){return M.jsx(l.yO,{title:"There is no embed data available."})}function ZS(t){let{content:n,selected:r}=t;return M.jsx(l.fu,{...function(t){let n="";switch(t.type){case"video":n=t.title??"";break;case"photo":n="View this post"+(t.provider_name?` on ${t.provider_name}`:"");break;default:n="Open"+(t.provider_name?` on ${t.provider_name}`:"")}return{url:t.embed_url,thumbnail:{url:t.thumbnail_url??"",aspectRatio:"video"===t.type?"16:9":"1:1"},provider:t.provider_name??"",author:t.author_name??"",subtitle:n}}(n),selected:r})}function ZT(t){let{url:n,onContentChange:r,selected:i}=t,o=function(t){let{url:n,onContentChange:r}=t,{embedsUrl:i}=i7(),o=(0,h.QT)(Zw,[n,i]),a=(0,f.R9)(r);return(0,c.useEffect)(()=>{let t=setTimeout(()=>a(o));return()=>{clearTimeout(t)}},[o,a]),o}({url:n,onContentChange:r});return M.jsx(ZS,{content:o,selected:i})}function Zw(t,n){var r;let i=new URL(n);return i.search=new URLSearchParams({url:t}).toString(),(0,p.WY)(i.toString(),{okType:(r=t,Zb.object({type:Zb.string(),version:Zb.string().or(Zb.number()).nullish(),title:Zb.string().nullish(),author_name:Zb.string().nullish(),author_url:Zb.string().nullish(),provider_name:Zb.string().nullish(),provider_url:Zb.string().nullish(),cache_age:Zb.string().or(Zb.number()).nullish(),thumbnail_url:Zb.string().nullish(),thumbnail_width:Zb.number().nullish(),thumbnail_height:Zb.number().nullish(),html:Zb.string().nullish()}).passthrough().transform(t=>{let n={embed_url:r};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 ZO(t){let{id:n,readOnly:r,field:i,content:o,onContentChange:a}=t,[u,s]=(0,c.useState)((null==o?void 0:o.embed_url)??"");function d(t){s(t),(0,g.j)(t)||a(void 0)}let[p,h]=(0,c.useState)(u),m=(0,c.useCallback)(t=>(0,c.startTransition)(()=>h(t)),[]);return(0,f.Nr)(u,300,m),M.jsxs(l.gN,{footer:(0,g.j)(u)&&M.jsx(l.mS,{children:M.jsx(Zx,{debouncedUrl:p,content:o,onContentChange:a})}),children:[M.jsx(l.fw,{name:"cloud"}),M.jsx(l.Qy,{htmlFor:n,children:KR(i)}),M.jsx(l.JO,{children:M.jsx(l.oi,{id:n,readOnly:r,placeholder:KE(i),value:u,onValueChange:d,variant:(0,g.j)(u)?"link":"normal",endAdornment:M.jsx(l.zx,{startIcon:"close",variant:"secondary",size:"small",disabled:!u,onClick:()=>d("")})})})]})}function Zk(t){return!(t.lat>85||t.lat<-85||t.lng>180||t.lng<-180)}function ZI(t){let n=t.match(/^.*@(-?\d+.\d+),(-?\d+.\d+).*$/);if(!n)return;let r=parseFloat(n[1]??""),i=parseFloat(n[2]??"");if(isNaN(r)||isNaN(i))return;let o={lat:r,lng:i};if(Zk(o))return o}function ZM(t){return t?`${t.lat}, ${t.lng}`:""}function ZC(t){let n=t.match(/\(?([\d|.|-]*)[\s+]*,[\s]*([\d|.|-]*)\)?/);if(!n)return ZI(t);let r=parseFloat(n[1]??""),i=parseFloat(n[2]??"");if(isNaN(r)||isNaN(i))return ZI(t);let o={lat:r,lng:i};return Zk(o)?o:ZI(t)}function ZR(t){let{field:n,id:r,readOnly:i,...o}=t,{onValueChange:a,displayedValue:u,onBlur:s,clearValue:f,isValidCoordinates:d}=function(t){let{content:n,onContentChange:r}=t,i=ZM(null==n?void 0:n.position),[o,a]=(0,c.useState)(i),u=Boolean(ZC(o));return{displayedValue:o,isValidCoordinates:u,onValueChange:a,onBlur:function(){let t=ZC(o);if(!t)return a(""),r(void 0);let{lat:n,lng:i}=t;a(ZM({lat:n,lng:i})),r({__TYPE__:"GeoPointContent",position:{lat:n,lng:i}})},clearValue:function(){a(""),r(void 0)}}}(o);return M.jsxs(l.gN,{children:[M.jsx(l.fw,{name:"place"}),M.jsx(l.Qy,{htmlFor:r,children:KR(n)}),M.jsx(l.JO,{children:M.jsx(l.oi,{id:r,onValueChange:a,placeholder:"...",readOnly:i,value:u,onBlur:s,variant:d?"link":"normal",endAdornment:M.jsx(l.zx,{startIcon:"close",variant:"secondary",size:"small",disabled:!u,onClick:f})})})]})}let ZE="__MAIN_THUMBNAIL__";function ZA(t,n,r){let i=t.name===ZE?void 0:t.name,o;return[i,(o=n?(0,d.$)(r)?[r.width,r.height]:(0,d.$)(t.width)||(0,d.$)(t.height)?[t.width??void 0,t.height??void 0]:[n.origin.width,n.origin.height]:void 0)?`${o[0]??"auto"}x${o[1]??"auto"}px`:void 0]}function Zj(t,n){let{width:r,height:i}=n??{};return r&&i?[r,i]:r?[r,Math.round(t.height*(r/t.width))]:i?[Math.round(t.width*(i/t.height)),i]:[t.width,t.height]}function ZN(t,n,r,i,o){let a=new URL(t);if(o){let{x:u,y:s,width:c,height:l}=n;a.searchParams.set("rect",[u,s,c,l].join(",")),a.searchParams.set("w",r.toString()),a.searchParams.set("h",i.toString())}return a.toString()}function ZP(t){let n=new URL(t);return n.searchParams.delete("q"),n.searchParams.set("w","800"),n.searchParams.set("h","800"),n.searchParams.set("auto","compress,format"),n.searchParams.set("fit","max"),n.toString()}function ZL(t){let n=new URL(t);return n.searchParams.delete("q"),n.searchParams.delete("fm"),n.searchParams.set("w","300"),n.searchParams.set("auto","compress,format"),n.toString()}function ZF(t){return null!=t&&t.url?ZP(t.url):void 0}let ZD=H6({id:HK(),kind:HK(),extension:HK(),filename:HK(),width:HH().optional(),height:HH().optional(),last_modified:HH(),url:HK(),alt:HK().optional()}),ZW=H6({total:HH(),cursor:HK().optional(),items:H5(ZD)});function ZU(t,n,r,i){let o=new URLSearchParams({assetType:"image",limit:"30",...i&&{cursor:i}});return(0,p.WY)(`${t}?${o.toString()}`,{headers:{repository:n},credentials:(0,p.xb)(r),okType:ZW})}function Zz(t){let{onFilesSelected:n}=t,[r,i]=(0,c.useTransition)(),[o,a]=(0,c.useState)(!1);return(0,f.Nr)(r,100,()=>a(r)),M.jsx(l.SV,{renderError:ZH,children:M.jsx(c.Suspense,{children:M.jsxs(l.Zz,{onFilesSelected:n,overlay:M.jsx(ZV,{}),children:[M.jsx(ZB,{...t,startTransition:i}),M.jsx(l.xu,{position:"relative",width:"100%",justifyContent:"center",children:M.jsx(l.FN,{anchor:M.jsx(l.xu,{position:"fixed",bottom:72}),loadingIndicator:!0,open:o,title:"Loading media ...",seconds:1})})]})})})}function ZB(t){let{uploadingFiles:n,onFilesSelected:r,onSuccessFiles:i,onFailedFiles:o,onTryAgain:a,onMediaSelected:u,startTransition:s}=t,{media:f,limit:d,onHasReachedBottom:p,response:m,updateMedia:g}=function(){let t=i7(),[n,r]=(0,c.useState)(),[i,o]=(0,c.useState)([]),[a,u]=(0,c.useState)(i);t.mediaLibrary||ot("mediaLibrary");let{assetsUrl:s,repository:l}=t,f=(0,h.QT)(ZU,[s,l,t.env,n]);return a!==f.items&&(u(f.items),o(t=>[...t,...f.items])),{media:i,limit:30,onHasReachedBottom:function(){0!==f.total&&r(f.cursor)},response:f,updateMedia:function(r){let a=[...r,...i];o([]),(0,h.VA)(ZU,[s,l,t.env,n],{total:a.length,items:a,cursor:void 0})}}}();return(0,c.useEffect)(()=>{let t=n.filter(t=>"success"===t.status).map(t=>t.response),r=n.filter(t=>"failed"===t.status);t.length>0&&(g(t),i()),r.length>0&&o(r)},[o,i,g,n]),0===f.length?M.jsx(Zq,{onFilesSelected:r}):M.jsxs(Z$,{onScrollToBottom(){m.total===d&&s(p)},children:[M.jsx(l.xu,{flexDirection:"column",gap:6,children:n.map((t,n)=>M.jsx(l.tK,{file:t.file,failed:"failed"===t.status,onTryAgain:()=>a(t)},`${t.file.name}${n}`))}),M.jsx(l.Rk,{items:f,getItemInfo:ZK,children:t=>M.jsx(c.Suspense,{fallback:M.jsx(l.Od,{width:"100%",height:"100%"}),children:M.jsx(l.P0,{url:ZL(t.url),onClick:()=>u({...t,width:t.width??2e3,height:t.height??2e3})})})})]})}function Zq(t){let{onFilesSelected:n}=t;return M.jsx(l.xu,{justifyContent:"center",flexDirection:"column",height:"100%",padding:24,children:M.jsx(l.xu,{justifyContent:"center",flexDirection:"column",height:"100%",backgroundColor:"grey2",borderRadius:4,padding:{inline:80},children:M.jsxs(l.R$,{children:[M.jsx(l.av,{name:"cloudUpload",lineColor:"purple10",backgroundColor:"purple12"}),M.jsx(l._T,{size:"big",children:"Drop files here or"}),M.jsx(l.nf,{children:M.jsxs(l.xv,{color:"grey11",align:"center",variant:"normal",children:["Explore our documentation to find out the"," ",M.jsx(l.hh,{underline:!0,color:"grey11",href:" https://prismic.io/docs/guides/manage-images#maximum-file-size",children:"maximum size"})," ","and"," ",M.jsx(l.hh,{underline:!0,color:"grey11",href:" https://prismic.io/docs/guides/manage-images#supported-media",children:"supported image formats"})," ","for uploads in the media library."]})}),M.jsx(l.Qj,{children:M.jsx(l.ZD,{title:"Upload Media",onFilesSelected:n})})]})})})}function ZV(){return M.jsx(l.xu,{justifyContent:"center",flexDirection:"column",height:"100%",children:M.jsxs(l.R$,{children:[M.jsx(l.av,{name:"cloudUpload",lineColor:"purple10",backgroundColor:"purple12"}),M.jsx(l._T,{size:"big",children:"Drop files here"}),M.jsx(l.nf,{children:"Drop your files to upload them instantly to your media library"})]})})}function Z$(t){let{children:n,onScrollToBottom:r}=t;return M.jsx(l.xr,{style:{height:"100%",paddingInline:l.TV.space[24],paddingBlock:l.TV.space[16],gap:l.TV.space[16]},onScrollToBottom:r,children:n})}function ZK(t){return{key:t.id,aspectRatio:(t.width??2e3)/(t.height??2e3)}}function ZH(){return M.jsx(l.xu,{height:"100%",flexDirection:"column",alignItems:"center",justifyContent:"center",children:M.jsx(l.Iq,{title:"Request failed",description:"An error occurred while searching for your image.",errorImageSrc:l.Os})})}h.Fs.registerFetcherConfig(ZU,{cacheCapacity:100,revalidationStrategy:{type:"never"}});let ZZ,ZG=new Uint8Array(16);function ZJ(){if(!ZZ&&!(ZZ="u">typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ZZ(ZG)}let ZY=[];for(let ZQ=0;ZQ<256;++ZQ)ZY.push((ZQ+256).toString(16).slice(1));let ZX="u">typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Z0={randomUUID:ZX},Z1=H6({id:HK(),width:HH(),height:HH(),urls:H6({full:HK(),small:HK().transform(ZL)})}),Z2=H6({results:H5(Z1)}).transform(t=>t.results);function Z3(t,n){let r=new URLSearchParams({page:"1",per_page:"30",query:n});return(0,p.WY)(`${t}/search/photos?${r.toString()}`,{okType:Z2})}h.Fs.registerFetcherConfig(Z3,{cacheCapacity:5,revalidationStrategy:{type:"never"}});let Z4=t=>{let{onMediaSelected:n}=t,[r,i]=(0,c.useState)(""),[o,a]=(0,c.useState)(r),[u,s]=(0,c.useTransition)(),d=(0,c.useCallback)(t=>s(()=>a(t)),[]);return(0,f.Nr)(r,200,d),M.jsxs(M.Fragment,{children:[M.jsx(l.xu,{padding:{inline:24,top:16},flexDirection:"column",children:M.jsx(l.Mj,{value:r,placeholder:"Search on Unsplash.com",onValueChange:i})}),M.jsx(Z6,{children:M.jsx(l.SV,{renderError:Z8,children:M.jsx(c.Suspense,{fallback:M.jsx(l.DW,{}),children:M.jsx(Z5,{term:o,isUpdating:u,onMediaSelected:n})})})})]})},Z5=t=>{var n,r,i;let{term:o,isUpdating:a,onMediaSelected:u}=t,s=i7(),c=(n=s.unsplashUrl,(0,h.QT)(Z3,[n,o||"fruit"])),f=(i=a,{opacity:i?.4:1,transitionProperty:i?"opacity":"none",transitionDuration:l.TV.transitionDuration[300],transitionTimingFunction:l.TV.transitionTimingFunction.easeInOut});return c.length?M.jsx(l.Rk,{items:c,getItemInfo:Z9,style:f,children:t=>M.jsx(l.P0,{url:t.urls.small,onClick:()=>u({id:t.id,url:t.urls.full,width:t.width,height:t.height})})}):M.jsxs(l.R$,{style:{marginTop:"auto",marginBottom:"auto",...f},children:[M.jsx(l.u2,{children:M.jsx("img",{src:l.Os,alt:"No results"})}),M.jsx(l._T,{size:"big",children:"Oh no ..."}),M.jsx(l.nf,{children:"The search returned no result."})]})},Z6=({children:t})=>M.jsx(l.xr,{style:{height:"100%",paddingInline:l.TV.space[24],paddingTop:l.TV.space[4]},children:t});function Z9(t){return{key:t.id,aspectRatio:t.width/t.height}}function Z8(){return M.jsx(l.xu,{height:"100%",flexDirection:"column",alignItems:"center",justifyContent:"center",children:M.jsx(l.Iq,{title:"Request failed",description:"An error occurred while searching for your image.",errorImageSrc:l.Os})})}function Z7(t){let{trigger:n,onMediaSelected:r}=t,i=i7(),{onFilesSelected:o,uploadingFiles:a,onSuccessFiles:u,onFailedFiles:s,onTryAgain:f}=function(){let[t,n]=(0,c.useState)([]),r=i7();function i(t){if(!r.mediaLibrary)return;let{assetsUrl:i,repository:o,env:a}=r;t.forEach(t=>(function(t){let{file:n,url:r,repository:i,env:o}=t,a=new FormData;return a.append(n.name,n),(0,p.WY)(r,{headers:{repository:i,"Content-Type":"multipart/form-data"},method:"POST",body:a,credentials:(0,p.xb)(o),okType:ZD})})({file:t.file,url:i??"",repository:o??"",env:a}).then(r=>{n(n=>n.map(n=>n.id===t.id?{...n,status:"success",response:r}:n))}).catch(()=>{n(n=>n.map(n=>n.id===t.id?{...n,status:"failed"}:n))}))}let{onFailedFiles:o,onTryAgain:a}=function(t){let{setUploadingFiles:n,tryPostMedia:r}=t,i=(0,c.useRef)();return{onTryAgain:function(t){clearTimeout(i.current),n(n=>n.map(n=>n.id===t.id?{...t,status:"loading"}:n)),r([t])},onFailedFiles:function(t){let r=()=>n(n=>n.filter(n=>!t.includes(n)));i.current=window.setTimeout(r,3e3)}}}({setUploadingFiles:n,tryPostMedia:i});return{onFilesSelected:function(t){let r=t.map(t=>({id:function(t,n,r){if(Z0.randomUUID&&!n&&!t)return Z0.randomUUID();t=t||{};let i=t.random||(t.rng||ZJ)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,n){r=r||0;for(let o=0;o<16;++o)n[r+o]=i[o];return n}return function(t,n=0){return(ZY[t[n+0]]+ZY[t[n+1]]+ZY[t[n+2]]+ZY[t[n+3]]+"-"+ZY[t[n+4]]+ZY[t[n+5]]+"-"+ZY[t[n+6]]+ZY[t[n+7]]+"-"+ZY[t[n+8]]+ZY[t[n+9]]+"-"+ZY[t[n+10]]+ZY[t[n+11]]+ZY[t[n+12]]+ZY[t[n+13]]+ZY[t[n+14]]+ZY[t[n+15]]).toLowerCase()}(i)}(),file:t,status:"loading"}));n(t=>[...t,...r]),i(r)},uploadingFiles:t,onSuccessFiles:function(){n(t=>t.filter(t=>"success"!==t.status))},onFailedFiles:o,onTryAgain:a}}(),[d,h]=(0,c.useState)(!1),[m,g]=(0,c.useState)(i.mediaLibrary?"media":"unsplash"),y=t=>{if("media"!==t&&"unsplash"!==t)throw Error(`Invalid option ${t}.`);g(t)};return M.jsxs(l.Vq,{trigger:n,open:d,onOpenChange:h,children:[M.jsx(l.fK,{icon:"folder",title:"Add an image"}),M.jsxs(l.Zp,{value:m,onValueChange:y,children:[i.mediaLibrary&&M.jsx(l.T9,{value:"media",title:"Media library",subtitle:"From Prismic",icon:"photo"}),M.jsx(l.T9,{value:"unsplash",title:"Unsplash",subtitle:"Source of free images",icon:"unsplash"}),i.mediaLibrary&&M.jsx(l.xu,{flexDirection:"column",justifyContent:"end",flexGrow:1,animation:{name:"fadeIn"},children:M.jsx(l.ZD,{startIcon:"cloudUpload",title:"Upload media",onFilesSelected:o})})]}),M.jsx(l.cZ,{children:M.jsx(Ge,{option:m,uploadingFiles:a,onSuccessFiles:u,onFailedFiles:s,onFilesSelected:o,onTryAgain:f,onMediaSelected(t){h(!1),null==r||r(t)}})})]})}function Ge(t){let{option:n,onMediaSelected:r,...i}=t,o=i7();switch(n){case"media":return o.mediaLibrary?M.jsx(Zz,{onMediaSelected:r,...i}):null;case"unsplash":return M.jsx(Z4,{onMediaSelected:r})}}function Gt(t){let{onMediaSelected:n,readOnly:r,isUpdating:i}=t;return M.jsx(l.aY,{children:M.jsx(l.Zb,{color:"grey3",variant:"outlined",children:M.jsx(l.aY,{children:M.jsx(l.xu,{padding:{block:48},flexDirection:"column",children:M.jsxs(l.R$,{children:[M.jsx(l.av,{name:"cloudUpload"}),M.jsx(l._T,{children:i?"Preparing your image...":"You haven't selected an image"}),!r&&M.jsx(l.Qj,{children:M.jsx(Z7,{trigger:M.jsx(l.zx,{disabled:i,children:"Select image"}),onMediaSelected:n})})]})})})})})}function Gn(t){let{id:n,readOnly:r,altText:i,onValueChange:o,selected:a}=t;return M.jsxs(l.gN,{labelPosition:"side",selected:a,children:[M.jsx(l.Qy,{htmlFor:n,children:"Alt text"}),M.jsx(l.JO,{children:M.jsx(l.oi,{id:n,onValueChange:o,placeholder:"Short description for the visually impaired",readOnly:r,value:i})})]})}let Gr=({contentView:t,constraints:n,croppedImage:r})=>{let[i,o]=Zj(t.origin,n),a=ZN(t.origin.url,r,i,o,!0);return{...t,width:i,height:o,url:a,edit:{...t.edit,zoom:r.zoom,crop:{x:r.x,y:r.y}}}},Gi=({field:t,content:n,thumbnail:r,croppedImage:i})=>{var o,a,u,s;if(r===ZE){let c=Gr({contentView:n,constraints:null==(o=null==t?void 0:t.config)?void 0:o.constraint,croppedImage:i});return c.url===n.url?n:{...n,...c}}let l=null==(u=null==(a=null==t?void 0:t.config)?void 0:a.thumbnails)?void 0:u.find(t=>t.name===r),f=null==(s=n.thumbnails)?void 0:s[r];if(!l||!f)return n;let d=Gr({contentView:f,constraints:l,croppedImage:i});return d.url===f.url?n:{...n,thumbnails:{...n.thumbnails,[r]:d}}},Go=({initialSize:t,constraints:n})=>{let r=null!=n&&n.width&&null!=n&&n.height?n.width/n.height:t.width/t.height,[i,o]=t.width<t.height?[t.width,Math.round(t.width/r)]:[Math.round(t.height*r),t.height],a=Math.max(i/t.width,o/t.height,1);return{width:Math.round(i/a),height:Math.round(o/a)}},Ga=({contentView:t,constraints:n})=>{let r=Go({initialSize:t.origin,constraints:n}),i=t.edit.zoom??1,o=Math.round(r.width/i),a=Math.round(r.height/i);return{...t.edit.crop,width:o,height:a,zoom:i}},Gu={x:0,y:0,width:0,height:0,zoom:1},Gs=({selectedImage:{thumbnail:t,contentView:n}})=>t.width&&t.height?t.width/t.height:n?n.origin.width/n.origin.height:1,Gc=({trigger:t,initialImages:n,initialOption:r,onClose:i})=>{var o;let[a,u]=(0,c.useState)({}),[s,f]=(0,c.useState)({}),[d,p]=(0,c.useState)(!1),[h,m]=(0,c.useState)(!1),[g,y]=(0,c.useState)(r),v=n[g],b=t=>{if(!v)return;let n=v.thumbnail.name,r=a[n]??Gu;u({...a,[n]:{...r,zoom:t}})},x=t=>{if(!v)return;let n=v.thumbnail.name,r=a[n]??Gu;u({...a,[n]:{...r,...t}})},_=t=>{if(!v)return;let n=v.thumbnail.name,r=s[n];f({...s,[n]:{...r,crop:t}})},S=t=>{if(!v)return;let n=v.thumbnail.name,r=s[n]??{};f({...s,[n]:{...r,aspectRatio:t}})},T=a[(null==v?void 0:v.thumbnail.name)??""],w=d?T??((null==v?void 0:v.contentView)&&Ga({contentView:v.contentView,constraints:v.thumbnail})):void 0,O=s[(null==v?void 0:v.thumbnail.name)??""];return M.jsxs(l.Vq,{trigger:t,onAnimationEnd:()=>m(!0),open:d,onOpenChange(t){t?(y(r),u({}),f({})):(m(!1),i({option:g,croppedImages:a})),p(t)},children:[M.jsx(l.fK,{icon:"photo",title:"Image editor"}),M.jsx(l.Zp,{value:String(g),onValueChange:t=>y(Number(t)),children:n.map((t,n)=>M.jsx(l.T9,{value:String(n),icon:"photo",title:t.labels[0]??"Main",subtitle:t.labels[1]??""},t.thumbnail.name))}),v&&M.jsx(l.cZ,{children:h&&M.jsx(l.tP,{image:(null==(o=v.contentView)?void 0:o.origin.url)??"",crop:(null==O?void 0:O.crop)??{x:0,y:0},onCropChange:_,zoom:(null==T?void 0:T.zoom)??1,onZoomChange:b,aspectRatio:Gs({selectedImage:v,cropper:O}),onAspectRatioChange:S,initialCroppedArea:w,onCropAreaChange:x},v.thumbnail.name)})]})};function Gl(t){var n,r;let{content:i,selected:o,fieldLabel:a,readOnly:u,imageLabel:s,onMediaSelected:c,initialImages:f,initialOption:d=0,onCropperDialogClose:p,onClear:h,children:m}=t,g=(null==(r=null==(n=null==i?void 0:i.url)?void 0:n.split("?")[0])?void 0:r.slice(-4))===".svg",y=null!=i&&i.url&&!u?"visible":"hidden";return M.jsxs(l.Zb,{color:o?"indigo2":"grey2",variant:o?"selected":"dashed",children:[M.jsxs(l.Ol,{children:[M.jsxs(l.wP,{children:[a,0!==s.length&&M.jsx(l.xv,{color:"grey11",component:"span",noSelect:!0,children:` • ${s.join(" • ")}`})]}),M.jsxs(l.Pf,{style:{visibility:y},children:[M.jsx(Gc,{trigger:M.jsx(l.zx,{startIcon:"crop",disabled:g,children:"Crop & Resize"}),initialImages:f,initialOption:d,onClose:p}),M.jsx(Z7,{trigger:M.jsx(l.zx,{startIcon:"imageSearch",children:"Replace"}),onMediaSelected:c}),M.jsx(l.zx,{onClick:h,startIcon:"delete",children:"Clear"})]})]}),m]})}function Gf(t,n){let{width:r,height:i,rect:o}=function(t,n){let[r,i]=Zj(t,n),o=Math.max(r/t.width,i/t.height),a=Math.round((t.width-r/o)/2),u=Math.round((t.height-i/o)/2);return{width:r,height:i,rect:{x:a,y:u,width:Math.round(r/o),height:Math.round(i/o)}}}(t,n),a=Boolean((null==n?void 0:n.width)||(null==n?void 0:n.height));return{url:ZN(t.url,o,r,i,a),alt:t.alt,origin:{id:t.id,url:t.url,width:t.width,height:t.height},width:r,height:i,edit:{background:"transparent",zoom:1,crop:{x:o.x,y:o.y}}}}function Gd(t){let{content:n,field:r,id:i,onContentChange:o,readOnly:a}=t,{onCropperDialogClose:u,onPageChange:s,onMediaSelected:l,isUpdating:f,page:p,thumbnail:h,allThumbnails:g,allContentViews:y,contentView:v,onClear:b}=function(t){var n;let{content:r,onContentChange:i,field:o}=t,[a,u]=(0,c.useState)(0),[s,l]=(0,c.useTransition)(),f=(n=o,(0,c.useMemo)(()=>{var t,r,i;return[{...null==(r=n.config)?void 0:r.constraint,name:ZE}].concat((null==(i=n.config)?void 0:i.thumbnails)??[])},[n])),d=f[a],p=r?function(t,n){var r,i;let{__TYPE__:o,thumbnails:a,...u}=n,s=null==(i=null==(r=t.config)?void 0:r.thumbnails)?void 0:i.map(({name:t})=>null==a?void 0:a[t]);return[u,...s??[]]}(o,r):void 0,h=null==p?void 0:p[a];return{onCropperDialogClose:function({option:t,croppedImages:n}){if(u(t),!r)return;let a=Object.entries(n).reduce((t,[n,r])=>Gi({field:o,content:t,thumbnail:n,croppedImage:r}),r);a!==r&&l(()=>i(a))},onPageChange:function(t){l(()=>u(t))},onMediaSelected:function(t){if(!d)return;let n=function(t,n,r,i){var o,a,u,s,c,l;if(!r){let f=null==(o=n.config)?void 0:o.thumbnails,d=f&&Object.fromEntries(f.map(t=>[t.name,Gf(i,t)]));return{__TYPE__:"ImageContent",...Gf(i,null==(a=n.config)?void 0:a.constraint),thumbnails:d}}if(t===ZE){let p=Gf(i,null==(u=n.config)?void 0:u.constraint);return p.url===r.url?r:{...r,...p}}let h=null==(c=null==(s=n.config)?void 0:s.thumbnails)?void 0:c.find(n=>n.name===t);if(!h)return r;let g=null==(l=r.thumbnails)?void 0:l[t],y=Gf(i,h);return y.url===(null==g?void 0:g.url)?r:{...r,thumbnails:(0,m.Q8)(r.thumbnails??{},(n,r)=>r===t?y:n)}}(d.name,o,r,t);n!==r&&l(()=>i(n))},isUpdating:s,page:a,thumbnail:d,allThumbnails:f,allContentViews:p,contentView:h,onClear:function(){null==u||u(0),i(void 0)}}}({field:r,content:n,onContentChange:o}),x=KR(r),_=g.map((t,r)=>{let i=null==y?void 0:y[r];return{thumbnail:t,contentView:i,labels:ZA(t,n,i)}}),S=h?ZA(h,n,v).filter(d.$):[];return M.jsx(Gl,{content:n,fieldLabel:x,imageLabel:S,initialOption:p,initialImages:_,readOnly:a,onMediaSelected:l,onCropperDialogClose:u,onClear:b,children:M.jsx(c.Suspense,{fallback:M.jsx("div",{style:{height:466}}),children:h&&n&&y?M.jsx(Gp,{allContentViews:y,content:n,contentView:v,id:i,onContentChange:o,onPageChange:s,page:p,readOnly:a,thumbnailName:h.name,isUpdating:f}):M.jsx(Gt,{onMediaSelected:l,readOnly:a,isUpdating:f})})})}function Gp(t){let{allContentViews:n,content:r,contentView:i,id:o,onContentChange:a,onPageChange:u,page:s,readOnly:c,thumbnailName:f,isUpdating:d}=t;return M.jsxs(l.aY,{children:[M.jsx(l.lr,{getItemSource:ZF,items:n,onPageChange:u,page:s,style:{height:400},children:t=>(null==t?void 0:t.url)&&M.jsx(l.d$,{src:ZP(t.url),alt:t.alt??void 0,isUpdating:d},`${f}_${t.url}`)}),M.jsx(Gn,{id:o,readOnly:c||!i,altText:(null==i?void 0:i.alt)??"",onValueChange(t){i&&a(function(t,n,r,i){let o=0===i.length?void 0:i;return t===ZE?{...n,alt:o}:{...n,thumbnails:{...n.thumbnails,[t]:{...r,alt:o}}}}(f,r,i,t))}})]})}function Gh(t){let{content:n,field:r,id:i,onContentChange:o,readOnly:a}=t;return M.jsxs(l.gN,{children:[M.jsx(l.fw,{name:"notes"}),M.jsx(l.Qy,{htmlFor:i,children:KR(r)}),M.jsx(l.JO,{children:M.jsx(l.Kx,{id:i,placeholder:KE(r),readOnly:a,value:(null==n?void 0:n.value)??"",onChange(t){var n;o((n=t,0===n.length?void 0:{__TYPE__:"FieldContent",type:"Text",value:n}))}})})]})}let Gm={unclassified:["unclassified","published"],archived:["unclassified","published"],release:["release","published"],published:["published"]};function Gg(t,n,r,i){return(0,y.W7)(t,n,r,i,30)}function Gy(){let t=i7();t.searchDocuments||ot("searchDocuments");let{coreApiUrl:n,env:r}=t,i=(0,h.QT)(y.Ag,[`${n}/repository`,r]);return new Set(i.languages.map(t=>({id:t.id,label:t.name})))}function Gv(){let t=i7();t.searchDocuments||ot("searchDocuments");let{coreApiUrl:n,env:r}=t,i=(0,h.QT)(G_,[n,r]);return new Set(i.results.map(t=>({id:t,label:t})))}function Gb(){let t=i7();t.searchDocuments||ot("searchDocuments");let{customTypesApiUrl:n,env:r,repository:i}=t,o=(0,h.QT)(GT,[n,r,i??""]);return new Set(o)}h.Fs.registerFetcherConfig(Gg,{cacheCapacity:500,revalidationStrategy:{type:"never"}});let Gx=H6({results:H5(HK())});function G_(t,n){return(0,p.WY)(`${t}/repository/tags`,{credentials:(0,p.xb)(n),okType:Gx})}let GS=H5(H6({id:HK(),label:HK()}));function GT(t,n,r){return(0,p.WY)(`${t}/customtypes`,{headers:{repository:r},credentials:(0,p.xb)(n),okType:GS})}function Gw(t){return t?(0,v.UI)(t,t=>({id:t,label:t})):new Set}function GO(t){let{filteredLocales:n,setFilteredLocales:r,filteredTags:i,setFilteredTags:o,filteredCustomTypes:a,setFilteredCustomTypes:u,fixedTags:s,fixedCustomTypes:f}=t;return M.jsxs(M.Fragment,{children:[M.jsx(l.SV,{children:M.jsx(c.Suspense,{fallback:M.jsx(Gk,{selectedValues:n,onSelectedValuesChange:r,label:"Locale",icon:"public",fetchFilters:Gy,multiple:!1}),children:M.jsx(GM,{selectedValues:n,onSelectedValuesChange:r})})}),M.jsx(Gk,{selectedValues:i,fixedSelectedValues:Gw(s),onSelectedValuesChange:o,label:"Tags",icon:"label",fetchFilters:Gv}),M.jsx(Gk,{selectedValues:a,fixedSelectedValues:Gw(f),onSelectedValuesChange:u,label:"Type",icon:"description",fetchFilters:Gb})]})}function Gk(t){let[n,r]=(0,c.useState)(!1),i=(0,c.useContext)(h.U9);return M.jsx(l.SV,{renderError:()=>M.jsx(l.R0,{mode:"error",onErrorRetry:null==i?void 0:i.reset,open:n,setOpen:r,values:new Set,...t}),children:M.jsx(c.Suspense,{fallback:M.jsx(l.R0,{mode:"loading",open:n,setOpen:r,values:new Set,...t}),children:M.jsx(GI,{open:n,setOpen:r,...t})})})}function GI(t){let{open:n,setOpen:r,onSelectedValuesChange:i,fixedSelectedValues:o,selectedValues:a,label:u,icon:s,fetchFilters:c,multiple:f}=t,d=c();return M.jsx(l.R0,{open:n,setOpen:r,label:u,icon:s,selectedValues:a,values:new Set(d),fixedSelectedValues:o,onSelectedValuesChange:i,multiple:f})}function GM(t){let{selectedValues:n,onSelectedValuesChange:r}=t,[i,o]=(0,c.useState)((0,v.Ps)(n)),a=(0,v.sE)(Gy(),t=>{var r;return t.id===(null==(r=(0,v.Ps)(n))?void 0:r.id)});return(null==a?void 0:a.label)!==(null==i?void 0:i.label)&&o(a),M.jsx(Gk,{selectedValues:new Set(i?[i]:[]),onSelectedValuesChange:function(t){r(t),o((0,v.Ps)(t))},label:"Locale",icon:"public",fetchFilters:Gy,multiple:!1})}function GC(t){let{onSelectDocument:n,fixedCustomTypes:r,fixedTags:i,...o}=t,a=i7(),{searchTerm:u,setSearchTerm:s,debouncedSearchTerm:d,filteredTags:p,setFilteredTags:h,filteredCustomTypes:m,setFilteredCustomTypes:g,filteredLocales:y,setFilteredLocales:b,typesFilter:x,tagsFilter:_}=function(t,n){let r=i7(),[i,o]=(0,c.useState)(""),[a,u]=(0,c.useState)("");(0,f.Nr)(i,300,()=>u(i));let[s,l]=(0,c.useState)(new Set),[d,p]=(0,c.useState)(new Set),[h,m]=(0,c.useState)(function(){return r.searchDocuments&&r.localeId?new Set([{id:r.localeId,label:r.localeId}]):new Set}),g=(0,v.G0)(d,Gw(t)),y=(0,v.G0)(s,Gw(n));return{searchTerm:i,setSearchTerm:o,debouncedSearchTerm:a,filteredTags:s,setFilteredTags:l,filteredCustomTypes:d,setFilteredCustomTypes:p,filteredLocales:h,setFilteredLocales:m,typesFilter:g,tagsFilter:y}}(r,i),[S,T]=(0,c.useTransition)(),[w,O]=(0,c.useState)(!1);return(0,f.Nr)(S,100,()=>O(S)),M.jsx(l.Vq,{size:{height:727,width:656},hasClose:!1,...o,children:M.jsx(l.cZ,{children:M.jsxs(l.xu,{flexDirection:"column",height:"100%",children:[M.jsxs(l.xu,{padding:{top:16,inline:16},flexDirection:"column",gap:12,children:[M.jsx(l.yt,{value:u,onValueChange:s,placeholder:"Search a page",icon:"search"}),M.jsx(GO,{filteredTags:p,setFilteredTags:h,filteredCustomTypes:m,setFilteredCustomTypes:g,filteredLocales:y,setFilteredLocales:b,fixedTags:i,fixedCustomTypes:r}),M.jsx(l.xv,{variant:"smallBold",color:"grey11",children:"Link to a document"})]}),a.searchDocuments?M.jsx(l.SV,{renderError:GE,children:M.jsx(c.Suspense,{children:M.jsx(GA,{searchTerm:d,tagsFilter:_,typesFilter:x,localesFilter:y,startTransition:T,onSelectDocument:n})})}):M.jsx(Gj,{message:"Slice Machine does not yet support mock data for linked documents in the simulator."}),M.jsx(GR,{debouncedIsLoading:w})]})})})}function GR(t){return M.jsx(l.FN,{anchor:M.jsx(l.xu,{position:"relative",width:"100%",justifyContent:"center",bottom:72}),loadingIndicator:!0,open:t.debouncedIsLoading,title:"Loading more results ...",seconds:1})}function GE(){return M.jsx(l.xu,{height:"100%",flexDirection:"column",alignItems:"center",justifyContent:"center",children:M.jsx(l.Iq,{title:"Request failed",description:"An error occurred while fetching documents.",errorImageSrc:l.Os})})}function GA(t){let{searchTerm:n,tagsFilter:r,typesFilter:i,localesFilter:o,startTransition:a,onSelectDocument:u}=t,{documents:s,onHasReachedBottom:f}=function(t){var n,r;let{searchTerm:i,tagsFilter:o,typesFilter:a,localesFilter:u}=t,s=i7();s.searchDocuments||ot("searchDocuments");let{coreApiUrl:l,env:f,status:d}=s,[p,m]=(0,c.useState)(""),[g,b]=(0,c.useState)([]),[x,_]=(0,c.useState)(""),S=new URLSearchParams((0,y.fW)([{name:"tags",values:[...(0,v.UI)(o,t=>t.id)]},{name:"customTypes",values:[...(0,v.UI)(a,t=>t.id)]},{name:"language",values:[...(0,v.UI)(u,t=>t.id)]},{name:"status",values:Gm[d]},{name:"term",values:[i]}])).toString(),T=(0,h.QT)(Gg,[l,S===x?p:"",f,S]);return S!==x?(_(S),m(""),b(T.results)):T.results.length>0&&(null==(n=g.at(-1))?void 0:n.id)!==(null==(r=T.results.at(-1))?void 0:r.id)&&b(t=>t.concat(T.results)),{documents:g,onHasReachedBottom:function(){T.cursor&&m(T.cursor)},response:T}}({searchTerm:n,tagsFilter:r,localesFilter:o,typesFilter:i});return M.jsx(l.xr,{onScrollToBottom:()=>a(f),style:{height:"100%",gap:l.TV.space[16],paddingTop:l.TV.space[10],paddingBottom:l.TV.space[16],paddingInline:l.TV.space[16]},children:M.jsxs(l.xu,{flexDirection:"column",gap:12,children:[0===s.length&&M.jsx(Gj,{}),s.map(t=>{var n,r,i,o,a,s,c;let f=`/pages/${t.id}?version=${(null==(n=t.versions[0])?void 0:n.version_id)??""}`??0;return M.jsx(l.z4,{documentType:(null==(r=t.versions[0])?void 0:r.custom_type_label)??"",documentURL:f,description:null==(i=t.versions[0])?void 0:i.preview_summary,tags:(null==(o=t.versions[0])?void 0:o.tags)??[],title:t.title,previewImageUrl:null==(a=t.versions[0])?void 0:a.preview_image,onSelect:()=>u(t.id),status:null==(s=t.versions[0])?void 0:s.status},`${t.id}-${(null==(c=t.versions[0])?void 0:c.status)??""}`)})]})})}function Gj(t){let{message:n="There are no versions matching this request"}=t;return M.jsxs(l.xu,{justifyContent:"center",flexDirection:"column",alignItems:"center",gap:16,children:[M.jsx(l.xu,{height:56,width:56,backgroundColor:"purple12",alignItems:"center",justifyContent:"center",borderRadius:"100%",children:M.jsx(l.I5,{name:"close",size:"large",color:"purple10"})}),M.jsx(l.xu,{maxWidth:204,children:M.jsx(l.xv,{color:"grey11",align:"center",children:n})})]})}function GN(t){let{hasLink:n,onUnlink:r,selectEnabled:i,selectedType:o,onValueChange:a,openInNewTab:u=!0,setOpenInNewTab:s}=t;return M.jsxs(M.Fragment,{children:[s&&"web"===o&&M.jsx(l.zx,{startIcon:u?"checkBox":"checkBoxOutlinedBlank",variant:"secondary",size:"small",onClick:()=>s(!u),children:"Open in new tab"}),M.jsxs(l.Ph,{value:o,variant:"secondary",size:"small",startIcon:function(t){if(t)switch(t){case"document":return"description";case"web":return"public";case"media":return"image"}}(o),disabled:!i,onValueChange:a,placeholder:"Choose link type",children:[M.jsx(l.Ql,{value:"web",icon:"public",children:"Link to web page"}),M.jsx(l.Ql,{value:"document",icon:"description",children:"Link to Prismic page"})]}),M.jsx(l.zx,{startIcon:"close",variant:"secondary",size:"small",disabled:!n,onClick:r})]})}let GP={DocumentLink:"document",ExternalLink:"web",FileLink:"media",ImageLink:"media"},GL={document:"DocumentLink",web:"ExternalLink",media:"FileLink"},GF=H6({id:HK(),title:HK()});function GD(t,n,r){return(0,p.WY)(`${t}/documents/${r}`,{credentials:(0,p.xb)(n),okType:GF})}function GW(t){var n,r;let{content:i,field:o,id:a,onContentChange:u,readOnly:s}=t,[d,p]=(0,c.useState)(!1),[h,m]=(0,c.useState)(!1),[y,v]=(0,c.useState)(!1),{contentType:b,isUnsupportedField:x,fieldValue:_,errorBoundaryRef:S,onDocumentSelected:T,onError:w,...O}=function(t){var n,r;let{field:i,content:o,onContentChange:a}=t,u=o?"DocumentLink"===o.value.__TYPE__?o.value.id:"ExternalLink"===o.value.__TYPE__?o.value.url:o.value.name:"",[s,l]=(0,c.useState)(()=>{var t,n;return null!=(t=i.config)&&t.select?GL[null==(n=i.config)?void 0:n.select]:null==o?void 0:o.value.__TYPE__}),[d,p]=(0,c.useState)(()=>(null==o?void 0:o.value.__TYPE__)==="ExternalLink"?o.value.target:""),[h,m]=(0,c.useState)(!1),g=(0,c.useRef)(null);(0,f.pQ)(u,function(){var t;h&&(m(!1),null==(t=g.current)||t.reset())});let y=s?GP[s]:void 0,v=(null==o?void 0:o.value.__TYPE__)&&["FileLink","ImageLink"].includes(null==o?void 0:o.value.__TYPE__),b=(null==(n=i.config)?void 0:n.select)&&"media"===i.config.select;function x(t){if(!t)return a(void 0);switch(s){case"ExternalLink":return a({__TYPE__:"LinkContent",value:{__TYPE__:"ExternalLink",url:t,target:d}});case"DocumentLink":return a({__TYPE__:"LinkContent",value:{__TYPE__:"DocumentLink",id:t}});default:return a(void 0)}}function _(t){x(t)}return{contentType:s,selectType:y,isUnsupportedField:b||v,fieldValue:u,onValueChange:x,onTypeChange:function(t){l(GL[t]),x("")},placeholder:KE(i),isTypeSelectEnabled:!(null!=(r=i.config)&&r.select),onDocumentSelected:_,onError:function(){m(!0)},errorBoundaryRef:g,isTargetNewTab:"_blank"===d,updateWebLinkTarget:function(t){let n=t?"_blank":null;p(n),a({__TYPE__:"LinkContent",value:{__TYPE__:"ExternalLink",url:u,target:n}})}}}({content:i,field:o,onContentChange:u});if(x)return M.jsx(GB,{id:a,field:o,content:i});let k=(0,g.j)(_),I=(d||h)&&Boolean(k),C={id:a,contentType:b,onBlur:()=>p(!1),onFocus(){p(!0),"DocumentLink"===b&&v(!0)},readOnly:s||!b,textType:k?"link":"normal",value:_,...O};return M.jsxs(M.Fragment,{children:[M.jsx(l.J2,{onMouseOverChange:m,open:I,align:"start",sideOffset:-3,openDelay:100,closeDelay:200,focusOnEnter:!1,anchor:M.jsxs(l.gN,{onMouseOverChange:p,children:[M.jsx(l.fw,{name:"link"}),M.jsx(l.Qy,{htmlFor:a,children:KR(o)}),M.jsx(l.JO,{children:"DocumentLink"===b&&""!==_?M.jsx(c.Suspense,{fallback:M.jsx(GU,{...C,value:"..."}),children:M.jsx(l.SV,{ref:S,onError:w,renderError(){var t;return t=C,M.jsx(GU,{...t,textType:"link"})},children:M.jsx(Gz,{...C,documentId:_,openDocumentListModal:()=>v(!0)})})}):M.jsx(GU,{...C})})]}),children:k&&M.jsx(l.oZ,{url:k,title:(0,g.S)(k)??"",subTitle:k.toString()})}),M.jsx(GC,{open:y,onOpenChange:v,onSelectDocument(t){v(!1),T(t)},fixedCustomTypes:new Set(null==(n=o.config)?void 0:n.customtypes),fixedTags:new Set(null==(r=o.config)?void 0:r.tags)})]})}function GU(t){let{id:n,onValueChange:r,placeholder:i,readOnly:o,value:a,textType:u,onFocus:s,onBlur:c,contentType:f,isTypeSelectEnabled:d,selectType:p,onTypeChange:h,isTargetNewTab:m,updateWebLinkTarget:g}=t;return M.jsx(l.oi,{id:n,onValueChange:r,placeholder:i,readOnly:o||"DocumentLink"===f,value:a,variant:u,onFocus:s,onBlur:c,cursor:"DocumentLink"===f?"pointer":"text",endAdornment:M.jsx(GN,{hasLink:Boolean(a),onUnlink:()=>r(""),selectEnabled:d,selectedType:p,onValueChange:h,openInNewTab:m,setOpenInNewTab:g})})}function Gz(t){let{id:n,documentId:r,openDocumentListModal:i,onValueChange:o,isTypeSelectEnabled:a,selectType:u,onTypeChange:s}=t,c=function(t){let n=i7();n.searchDocuments||ot("searchDocuments");let{coreApiUrl:r,env:i}=n;return(0,h.QT)(GD,[r,i,t]).title}(r);return M.jsx(l.oi,{id:n,readOnly:!0,value:c,variant:"link",onFocus:i,cursor:"pointer",endAdornment:M.jsx(GN,{hasLink:!0,onUnlink:()=>o(""),selectEnabled:a,selectedType:u,onValueChange:s})})}function GB({id:t,field:n,content:r}){let[i,o]=(0,c.useState)(!1),[a,u]=(0,c.useState)(!1);(0,f.Nr)(i,300,()=>u(i));let s=(null==r?void 0:r.value.__TYPE__)==="DocumentLink"?null==r?void 0:r.value.id:null==r?void 0:r.value.url;return M.jsxs(l.gN,{onMouseOverChange:o,children:[M.jsx(l.u,{title:"Coming soon",content:"This feature is currently in development and will be available soon. Stay tuned for updates!",side:"bottom",open:a,children:M.jsx(Gq,{})}),M.jsx(l.fw,{disabled:!0,name:"link"}),M.jsx(l.Qy,{htmlFor:t,children:KR(n)}),M.jsx(l.JO,{disabled:!0,children:M.jsx(l.Kx,{id:t,onChange(){},placeholder:KE(n),readOnly:!0,value:s})})]})}let Gq=(0,c.forwardRef)(function(t,n){return M.jsx("div",{ref:n,style:{width:50,position:"absolute",top:40,left:30}})}),GV=({content:t,field:n,id:r,onContentChange:i,readOnly:o})=>{var a,u;let s=Number(null==t?void 0:t.value),c=Number.isFinite(s)?s:void 0;return M.jsxs(l.gN,{children:[M.jsx(l.fw,{name:"pin"}),M.jsx(l.Qy,{htmlFor:r,children:KR(n)}),M.jsx(l.JO,{children:M.jsx(l.Y2,{id:r,value:c,min:null==(a=n.config)?void 0:a.min,max:null==(u=n.config)?void 0:u.max,placeholder:KE(n),readOnly:o,onValueChange(t){var n;return i((n=t,void 0===n?void 0:{__TYPE__:"FieldContent",type:"Number",value:String(n)}))}})})]})};function G$(t){this.content=t}G$.prototype={constructor:G$,find:function(t){for(var n=0;n<this.content.length;n+=2)if(this.content[n]===t)return n;return -1},get:function(t){var n=this.find(t);return -1==n?void 0:this.content[n+1]},update:function(t,n,r){var i=r&&r!=t?this.remove(r):this,o=i.find(t),a=i.content.slice();return -1==o?a.push(r||t,n):(a[o+1]=n,r&&(a[o]=r)),new G$(a)},remove:function(t){var n=this.find(t);if(-1==n)return this;var r=this.content.slice();return r.splice(n,2),new G$(r)},addToStart:function(t,n){return new G$([t,n].concat(this.remove(t).content))},addToEnd:function(t,n){var r=this.remove(t).content.slice();return r.push(t,n),new G$(r)},addBefore:function(t,n,r){var i=this.remove(n),o=i.content.slice(),a=i.find(t);return o.splice(-1==a?o.length:a,0,n,r),new G$(o)},forEach:function(t){for(var n=0;n<this.content.length;n+=2)t(this.content[n],this.content[n+1])},prepend:function(t){return(t=G$.from(t)).size?new G$(t.content.concat(this.subtract(t).content)):this},append:function(t){return(t=G$.from(t)).size?new G$(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var n=this;t=G$.from(t);for(var r=0;r<t.content.length;r+=2)n=n.remove(t.content[r]);return n},toObject:function(){var t={};return this.forEach(function(n,r){t[n]=r}),t},get size(){return this.content.length>>1}},G$.from=function(t){if(t instanceof G$)return t;var n=[];if(t)for(var r in t)n.push(r,t[r]);return new G$(n)};class GK{constructor(t,n){if(this.content=t,this.size=n||0,null==n)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&&!1!==r(s,i+u,o||null,a)&&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+="function"==typeof i?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 GK(i,this.size+t.size)}cut(t,n=this.size){if(0==t&&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=u.isText?u.cut(Math.max(0,t-a),Math.min(u.text.length,n-a)):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 GK(r,i)}cutByIndex(t,n){return t==n?GK.empty:0==t&&n==this.content.length?this:new GK(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 GK(i,o)}addToStart(t){return new GK([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new GK(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 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 function t(n,r,i){for(let o=0;;o++){if(o==n.childCount||o==r.childCount)return n.childCount==r.childCount?null:i;let a=n.child(o),u=r.child(o);if(a==u){i+=a.nodeSize;continue}if(!a.sameMarkup(u))return i;if(a.isText&&a.text!=u.text){for(let s=0;a.text[s]==u.text[s];s++)i++;return i}if(a.content.size||u.content.size){let c=t(a.content,u.content,i+1);if(null!=c)return c}i+=a.nodeSize}}(this,t,n)}findDiffEnd(t,n=this.size,r=t.size){return function t(n,r,i,o){for(let a=n.childCount,u=r.childCount;;){if(0==a||0==u)return a==u?null:{a:i,b:o};let s=n.child(--a),c=r.child(--u),l=s.nodeSize;if(s==c){i-=l,o-=l;continue}if(!s.sameMarkup(c))return{a:i,b:o};if(s.isText&&s.text!=c.text){let f=0,d=Math.min(s.text.length,c.text.length);for(;f<d&&s.text[s.text.length-f-1]==c.text[c.text.length-f-1];)f++,i--,o--;return{a:i,b:o}}if(s.content.size||c.content.size){let p=t(s.content,c.content,i-1,o-1);if(p)return p}i-=l,o-=l}}(this,t,n,r)}findIndex(t,n=-1){if(0==t)return GZ(0,t);if(t==this.size)return GZ(this.content.length,t);if(t>this.size||t<0)throw RangeError(`Position ${t} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=i+this.child(r).nodeSize;if(o>=t)return o==t||n>0?GZ(r+1,o):GZ(r,i);i=o}}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 GK.empty;if(!Array.isArray(n))throw RangeError("Invalid input for Fragment.fromJSON");return new GK(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return GK.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 GK(n||t,r)}static from(t){if(!t)return GK.empty;if(t instanceof GK)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new GK([t],t.nodeSize);throw RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}GK.empty=new GK([],0);let GH={index:0,offset:0};function GZ(t,n){return GH.index=t,GH.offset=n,GH}function GG(t,n){if(t===n)return!0;if(!(t&&"object"==typeof t)||!(n&&"object"==typeof n))return!1;let r=Array.isArray(t);if(Array.isArray(n)!=r)return!1;if(r){if(t.length!=n.length)return!1;for(let i=0;i<t.length;i++)if(!GG(t[i],n[i]))return!1}else{for(let o in t)if(!(o in n)||!GG(t[o],n[o]))return!1;for(let a in n)if(!(a in t))return!1}return!0}let GJ=class t{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&&GG(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 RangeError("Invalid input for Mark.fromJSON");let r=t.marks[n.type];if(!r)throw 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(n){if(!n||Array.isArray(n)&&0==n.length)return t.none;if(n instanceof t)return[n];let r=n.slice();return r.sort((t,n)=>t.type.rank-n.type.rank),r}};GJ.none=[];class GY extends Error{}class GQ{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=function t(n,r,i,o){let{index:a,offset:u}=n.findIndex(r),s=n.maybeChild(a);if(u==r||s.isText)return o&&!o.canReplace(a,a,i)?null:n.cut(0,r).append(i).append(n.cut(r));let c=t(s.content,r-u-1,i);return c&&n.replaceChild(a,s.copy(c))}(this.content,t+this.openStart,n);return r&&new GQ(r,this.openStart,this.openEnd)}removeBetween(t,n){return new GQ(function t(n,r,i){let{index:o,offset:a}=n.findIndex(r),u=n.maybeChild(o),{index:s,offset:c}=n.findIndex(i);if(a==r||u.isText){if(c!=i&&!n.child(s).isText)throw RangeError("Removing non-flat range");return n.cut(0,r).append(n.cut(i))}if(o!=s)throw RangeError("Removing non-flat range");return n.replaceChild(o,u.copy(t(u.content,r-a-1,i-a-1)))}(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 GQ.empty;let r=n.openStart||0,i=n.openEnd||0;if("number"!=typeof r||"number"!=typeof i)throw RangeError("Invalid input for Slice.fromJSON");return new GQ(GK.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 a=t.lastChild;a&&!a.isLeaf&&(n||!a.type.spec.isolating);a=a.lastChild)i++;return new GQ(t,r,i)}}function GX(t,n){if(!n.type.compatibleContent(t.type))throw new GY("Cannot join "+n.type.name+" onto "+t.type.name)}function G0(t,n,r){let i=t.node(r);return GX(i,n.node(r)),i}function G1(t,n){let r=n.length-1;r>=0&&t.isText&&t.sameMarkup(n[r])?n[r]=t.withText(n[r].text+t.text):n.push(t)}function G2(t,n,r,i){let o=(n||t).node(r),a=0,u=n?n.index(r):o.childCount;t&&(a=t.index(r),t.depth>r?a++:t.textOffset&&(G1(t.nodeAfter,i),a++));for(let s=a;s<u;s++)G1(o.child(s),i);n&&n.depth==r&&n.textOffset&&G1(n.nodeBefore,i)}function G3(t,n){return t.type.checkContent(n),t.copy(n)}function G4(t,n,r){let i=[];return G2(null,t,r,i),t.depth>r&&G1(G3(G0(t,n,r+1),G4(t,n,r+1)),i),G2(n,null,r,i),new GK(i)}GQ.empty=new GQ(GK.empty,0,0);class G5{constructor(t,n,r){this.pos=t,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(t){return null==t?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[3*this.resolveDepth(t)]}index(t){return this.path[3*this.resolveDepth(t)+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)}start(t){return 0==(t=this.resolveDepth(t))?0:this.path[3*t-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(!(t=this.resolveDepth(t)))throw RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]}after(t){if(!(t=this.resolveDepth(t)))throw RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].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):0==t?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let r=this.path[3*n],i=0==n?0:this.path[3*n-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(0==t.content.size)return GJ.none;if(this.textOffset)return t.child(n).marks;let r=t.maybeChild(n-1),i=t.maybeChild(n);if(!r){let o=r;r=i,i=o}let a=r.marks;for(var u=0;u<a.length;u++)!1!==a[u].type.spec.inclusive||i&&a[u].isInSet(i.marks)||(a=a[u--].removeFromSet(a));return a}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++)!1!==r[o].type.spec.inclusive||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 G7(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 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)).isText)break;o=c-1,i+=s+1}return new G5(n,r,o)}static resolveCached(t,n){for(let r=0;r<G6.length;r++){let i=G6[r];if(i.pos==n&&i.doc==t)return i}let o=G6[G9]=G5.resolve(t,n);return G9=(G9+1)%G8,o}}let G6=[],G9=0,G8=12;class G7{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)}}let Je=Object.create(null),Jt=class t{constructor(t,n,r,i=GJ.none){this.type=t,this.attrs=n,this.marks=i,this.content=r||GK.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&&GG(this.attrs,n||t.defaultAttrs||Je)&&GJ.sameSet(this.marks,r||GJ.none)}copy(n=null){return n==this.content?this:new t(this.type,this.attrs,n,this.marks)}mark(n){return n==this.marks?this:new t(this.type,this.attrs,this.content,n)}cut(t,n=this.content.size){return 0==t&&n==this.content.size?this:this.copy(this.content.cut(t,n))}slice(t,n=this.content.size,r=!1){if(t==n)return GQ.empty;let i=this.resolve(t),o=this.resolve(n),a=r?0:i.sharedDepth(n),u=i.start(a),s=i.node(a).content.cut(i.pos-u,o.pos-u);return new GQ(s,i.depth-a,o.depth-a)}replace(t,n,r){return function(t,n,r){if(r.openStart>t.depth)throw new GY("Inserted content deeper than insertion position");if(t.depth-r.openStart!=n.depth-r.openEnd)throw new GY("Inconsistent open depths");return function t(n,r,i,o){let a=n.index(o),u=n.node(o);if(a==r.index(o)&&o<n.depth-i.openStart){let s=t(n,r,i,o+1);return u.copy(u.content.replaceChild(a,s))}if(!i.content.size)return G3(u,G4(n,r,o));if(i.openStart||i.openEnd||n.depth!=o||r.depth!=o){let{start:c,end:l}=function(t,n){let r=n.depth-t.openStart,i=n.node(r).copy(t.content);for(let o=r-1;o>=0;o--)i=n.node(o).copy(GK.from(i));return{start:i.resolveNoCache(t.openStart+r),end:i.resolveNoCache(i.content.size-t.openEnd-r)}}(i,n);return G3(u,function t(n,r,i,o,a){let u=n.depth>a&&G0(n,r,a+1),s=o.depth>a&&G0(i,o,a+1),c=[];return G2(null,n,a,c),u&&s&&r.index(a)==i.index(a)?(GX(u,s),G1(G3(u,t(n,r,i,o,a+1)),c)):(u&&G1(G3(u,G4(n,r,a+1)),c),G2(r,i,a,c),s&&G1(G3(s,G4(i,o,a+1)),c)),G2(o,null,a,c),new GK(c)}(n,c,l,r,o))}{let f=n.parent,d=f.content;return G3(f,d.cut(0,n.parentOffset).append(i.content).append(d.cut(r.parentOffset)))}}(t,n,r,0)}(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)))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(0==t)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 G5.resolveCached(this,t)}resolveNoCache(t){return G5.resolve(this,t)}rangeHasMark(t,n,r){let i=!1;return n>t&&this.nodesBetween(t,n,t=>(r.isInSet(t.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()+")"),Jr(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,r=GK.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}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=GJ.none;for(let n=0;n<this.marks.length;n++)t=this.marks[n].addToSet(t);if(!GJ.sameSet(t,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.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(t=>t.toJSON())),t}static fromJSON(t,n){if(!n)throw RangeError("Invalid input for Node.fromJSON");let r=null;if(n.marks){if(!Array.isArray(n.marks))throw RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(t.markFromJSON)}if("text"==n.type){if("string"!=typeof n.text)throw RangeError("Invalid text node in JSON");return t.text(n.text,r)}let i=GK.fromJSON(t,n.content);return t.nodeType(n.type).create(n.attrs,i,r)}};Jt.prototype.text=void 0;class Jn extends Jt{constructor(t,n,r,i){if(super(t,n,null,i),!r)throw RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Jr(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 Jn(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new Jn(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return 0==t&&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 Jr(t,n){for(let r=t.length-1;r>=0;r--)n=t[r].type.name+"("+n+")";return n}class Ji{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){var r;let i=new Jo(t,n);if(null==i.next)return Ji.empty;let o=Ja(i);i.next&&i.err("Unexpected trailing text");let a,u=(r=function(t){let n=[[]];return o(a(t,0),r()),n;function r(){return n.push([])-1}function i(t,r,i){let o={term:i,to:r};return n[t].push(o),o}function o(t,n){t.forEach(t=>t.to=n)}function a(t,n){if("choice"==t.type)return t.exprs.reduce((t,r)=>t.concat(a(r,n)),[]);if("seq"==t.type)for(let u=0;;u++){let s=a(t.exprs[u],n);if(u==t.exprs.length-1)return s;o(s,n=r())}else if("star"==t.type){let c=r();return i(n,c),o(a(t.expr,c),c),[i(c)]}else if("plus"==t.type){let l=r();return o(a(t.expr,n),l),o(a(t.expr,l),l),[i(l)]}else{if("opt"==t.type)return[i(n)].concat(a(t.expr,n));if("range"==t.type){let f=n;for(let d=0;d<t.min;d++){let p=r();o(a(t.expr,f),p),f=p}if(-1==t.max)o(a(t.expr,f),f);else for(let h=t.min;h<t.max;h++){let m=r();i(f,m),o(a(t.expr,f),m),f=m}return[i(f)]}if("name"==t.type)return[i(n,void 0,t.value)];throw Error("Unknown expr type")}}}(o),a=Object.create(null),function t(n){let i=[];n.forEach(t=>{r[t].forEach(({term:t,to:n})=>{if(!t)return;let o;for(let a=0;a<i.length;a++)i[a][0]==t&&(o=i[a][1]);Jp(r,n).forEach(n=>{o||i.push([t,o=[]]),-1==o.indexOf(n)&&o.push(n)})})});let o=a[n.join(",")]=new Ji(n.indexOf(r.length-1)>-1);for(let u=0;u<i.length;u++){let s=i[u][1].sort(Jd);o.next.push({type:i[u][0],next:a[s.join(",")]||t(s)})}return o}(Jp(r,0)));return function(t,n){for(let r=0,i=[t];r<i.length;r++){let o=i[r],a=!o.validEnd,u=[];for(let s=0;s<o.next.length;s++){let{type:c,next:l}=o.next[s];u.push(c.name),a&&!(c.isText||c.hasRequiredAttrs())&&(a=!1),-1==i.indexOf(l)&&i.push(l)}a&&n.err("Only non-generatable nodes ("+u.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(u,i),u}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 0!=this.next.length&&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];return function o(a,u){let s=a.matchFragment(t,r);if(s&&(!n||s.validEnd))return GK.from(u.map(t=>t.createAndFill()));for(let c=0;c<a.next.length;c++){let{type:l,next:f}=a.next[c];if(!(l.isText||l.hasRequiredAttrs())&&-1==i.indexOf(f)){i.push(f);let d=o(f,u.concat(l));if(d)return d}}return null}(this,[])}findWrapping(t){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==t)return this.wrapCache[n+1];let r=this.computeWrapping(t);return this.wrapCache.push(t,r),r}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 s=0;s<o.next.length;s++){let{type:c,next:l}=o.next[s];c.isLeaf||c.hasRequiredAttrs()||c.name in n||i.type&&!l.validEnd||(r.push({match:c.contentMatch,type:c,via:i}),n[c.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];return function n(r){t.push(r);for(let i=0;i<r.next.length;i++)-1==t.indexOf(r.next[i].next)&&n(r.next[i].next)}(this),t.map((n,r)=>{let i=r+(n.validEnd?"*":" ")+" ";for(let o=0;o<n.next.length;o++)i+=(o?", ":"")+n.next[o].type.name+"->"+t.indexOf(n.next[o].next);return i}).join(`
3
+ `)}}Ji.empty=new Ji(!0);class Jo{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 SyntaxError(t+" (in content expression '"+this.string+"')")}}function Ja(t){let n=[];do n.push(Ju(t));while(t.eat("|"));return 1==n.length?n[0]:{type:"choice",exprs:n}}function Ju(t){let n=[];do n.push(Js(t));while(t.next&&")"!=t.next&&"|"!=t.next);return 1==n.length?n[0]:{type:"seq",exprs:n}}function Js(t){let n=Jf(t);for(;;)if(t.eat("+"))n={type:"plus",expr:n};else if(t.eat("*"))n={type:"star",expr:n};else if(t.eat("?"))n={type:"opt",expr:n};else if(t.eat("{"))n=Jl(t,n);else break;return n}function Jc(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let n=Number(t.next);return t.pos++,n}function Jl(t,n){let r=Jc(t),i=r;return t.eat(",")&&(i="}"!=t.next?Jc(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:r,max:i,expr:n}}function Jf(t){if(t.eat("(")){let n=Ja(t);return t.eat(")")||t.err("Missing closing paren"),n}if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let r=(function(t,n){let r=t.nodeTypes,i=r[n];if(i)return[i];let o=[];for(let a in r){let u=r[a];u.groups.indexOf(n)>-1&&o.push(u)}return 0==o.length&&t.err("No node type or group '"+n+"' found"),o})(t,t.next).map(n=>(null==t.inline?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,1==r.length?r[0]:{type:"choice",exprs:r}}}function Jd(t,n){return n-t}function Jp(t,n){let r=[];return function n(i){let o=t[i];if(1==o.length&&!o[0].term)return n(o[0].to);r.push(i);for(let a=0;a<o.length;a++){let{term:u,to:s}=o[a];u||-1!=r.indexOf(s)||n(s)}}(n),r.sort(Jd)}function Jh(t){let n=Object.create(null);for(let r in t){let i=t[r];if(!i.hasDefault)return null;n[r]=i.default}return n}function Jm(t,n){let r=Object.create(null);for(let i in t){let o=n&&n[i];if(void 0===o){let a=t[i];if(a.hasDefault)o=a.default;else throw RangeError("No value supplied for attribute "+i)}r[i]=o}return r}function Jg(t){let n=Object.create(null);if(t)for(let r in t)n[r]=new Jv(t[r]);return n}let Jy=class t{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=Jg(r.attrs),this.defaultAttrs=Jh(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||"text"==t),this.isText="text"==t}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Ji.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:Jm(this.attrs,t)}create(t=null,n,r){if(this.isText)throw Error("NodeType.create can't construct text nodes");return new Jt(this,this.computeAttrs(t),GK.from(n),GJ.setFrom(r))}createChecked(t=null,n,r){return n=GK.from(n),this.checkContent(n),new Jt(this,this.computeAttrs(t),n,GJ.setFrom(r))}createAndFill(t=null,n,r){if(t=this.computeAttrs(t),(n=GK.from(n)).size){let i=this.contentMatch.fillBefore(n);if(!i)return null;n=i.append(n)}let o=this.contentMatch.matchFragment(n),a=o&&o.fillBefore(GK.empty,!0);return a?new Jt(this,t,n.append(a),GJ.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 RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}allowsMarkType(t){return null==this.markSet||this.markSet.indexOf(t)>-1}allowsMarks(t){if(null==this.markSet)return!0;for(let n=0;n<t.length;n++)if(!this.allowsMarkType(t[n].type))return!1;return!0}allowedMarks(t){if(null==this.markSet)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:GJ.none:t}static compile(n,r){let i=Object.create(null);n.forEach((n,o)=>i[n]=new t(n,r,o));let o=r.spec.topNode||"doc";if(!i[o])throw RangeError("Schema is missing its top node type ('"+o+"')");if(!i.text)throw RangeError("Every schema needs a 'text' type");for(let a in i.text.attrs)throw RangeError("The text node type should not have attributes");return i}};class Jv{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class Jb{constructor(t,n,r,i){this.name=t,this.rank=n,this.schema=r,this.spec=i,this.attrs=Jg(i.attrs),this.excluded=null;let o=Jh(this.attrs);this.instance=o?new GJ(this,o):null}create(t=null){return!t&&this.instance?this.instance:new GJ(this,Jm(this.attrs,t))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,o)=>r[t]=new Jb(t,i++,n,o)),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 Jx{constructor(t){this.cached=Object.create(null);let n=this.spec={};for(let r in t)n[r]=t[r];n.nodes=G$.from(t.nodes),n.marks=G$.from(t.marks||{}),this.nodes=Jy.compile(this.spec.nodes,this),this.marks=Jb.compile(this.spec.marks,this);let i=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw RangeError(o+" can not be both a node and a mark");let a=this.nodes[o],u=a.spec.content||"",s=a.spec.marks;a.contentMatch=i[u]||(i[u]=Ji.parse(u,this.nodes)),a.inlineContent=a.contentMatch.inlineContent,a.markSet="_"==s?null:s?J_(this,s.split(" ")):""!=s&&a.inlineContent?null:[]}for(let c in this.marks){let l=this.marks[c],f=l.spec.excludes;l.excluded=null==f?[l]:""==f?[]:J_(this,f.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("string"==typeof t)t=this.nodeType(t);else if(t instanceof Jy){if(t.schema!=this)throw RangeError("Node type from different schema used ("+t.name+")")}else throw RangeError("Invalid node type: "+t);return t.createChecked(n,r,i)}text(t,n){let r=this.nodes.text;return new Jn(r,r.defaultAttrs,t,GJ.setFrom(n))}mark(t,n){return"string"==typeof t&&(t=this.marks[t]),t.create(n)}nodeFromJSON(t){return Jt.fromJSON(this,t)}markFromJSON(t){return GJ.fromJSON(this,t)}nodeType(t){let n=this.nodes[t];if(!n)throw RangeError("Unknown node type: "+t);return n}}function J_(t,n){let r=[];for(let i=0;i<n.length;i++){let o=n[i],a=t.marks[o],u=a;if(a)r.push(a);else for(let s in t.marks){let c=t.marks[s];("_"==o||c.spec.group&&c.spec.group.split(" ").indexOf(o)>-1)&&r.push(u=c)}if(!u)throw SyntaxError("Unknown mark type: '"+n[i]+"'")}return r}class JS{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[],n.forEach(t=>{t.tag?this.tags.push(t):t.style&&this.styles.push(t)}),this.normalizeLists=!this.tags.some(n=>{if(!/^(ul|ol)\b/.test(n.tag)||!n.node)return!1;let r=t.nodes[n.node];return r.contentMatch.matchType(r)})}parse(t,n={}){let r=new JM(this,n,!1);return r.addAll(t,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new JM(this,n,!0);return r.addAll(t,n.from,n.to),GQ.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(JC(t,o.tag)&&(void 0===o.namespace||t.namespaceURI==o.namespace)&&(!o.context||n.matchesContext(o.context))){if(o.getAttrs){let a=o.getAttrs(t);if(!1===a)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(!(0!=u.indexOf(t)||a.context&&!r.matchesContext(a.context)||u.length>t.length&&(61!=u.charCodeAt(t.length)||u.slice(t.length+1)!=n))){if(a.getAttrs){let s=a.getAttrs(n);if(!1===s)continue;a.attrs=s||void 0}return a}}}static schemaRules(t){let n=[];function r(t){let r=null==t.priority?50:t.priority,i=0;for(;i<n.length;i++){let o=n[i];if((null==o.priority?50:o.priority)<r)break}n.splice(i,0,t)}for(let i in t.marks){let o=t.marks[i].spec.parseDOM;o&&o.forEach(t=>{r(t=JR(t)),t.mark||t.ignore||t.clearMark||(t.mark=i)})}for(let a in t.nodes){let u=t.nodes[a].spec.parseDOM;u&&u.forEach(t=>{r(t=JR(t)),t.node||t.ignore||t.mark||(t.node=a)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new JS(t,JS.schemaRules(t)))}}let JT={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},Jw={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},JO={ol:!0,ul:!0};function Jk(t,n,r){return null!=n?(n?1:0)|("full"===n?2:0):t&&"pre"==t.whitespace?3:-5&r}class JI{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=GJ.none,this.stashMarks=[],this.match=a||(4&u?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(GK.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(!(1&this.options)){let n=this.content[this.content.length-1],r;n&&n.isText&&(r=/[ \t\r\n\u000c]+$/.exec(n.text))&&(n.text.length==r[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-r[0].length)))}let i=GK.from(this.content);return!t&&this.match&&(i=i.append(this.match.fillBefore(GK.empty,!0))),this.type?this.type.create(this.attrs,i,this.marks):i}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):JE(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&&!JT.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class JM{constructor(t,n,r){this.parser=t,this.options=n,this.isOpen=r,this.open=0;let i=n.topNode,o,a=Jk(null,n.preserveWhitespace,0)|(r?4:0);o=i?new JI(i.type,i.attrs,GJ.none,GJ.none,!0,n.topMatch||i.type.contentMatch,a):r?new JI(null,null,GJ.none,GJ.none,!0,null,a):new JI(t.schema.topNodeType,null,GJ.none,GJ.none,!0,null,a),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t){if(3==t.nodeType)this.addTextNode(t);else if(1==t.nodeType){let n=t.getAttribute("style");if(n){let r=this.readStyles(function(t){let n=/\s*([\w-]+)\s*:\s*([^;]+)/g,r,i=[];for(;r=n.exec(t);)i.push(r[1],r[2].trim());return i}(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 s=0;s<i.length;s++)this.addPendingMark(i[s]);this.addElement(t);for(let c=0;c<i.length;c++)this.removePendingMark(i[c],a);for(let l=0;l<o.length;l++)this.addPendingMark(o[l])}else this.addElement(t)}}addTextNode(t){let n=t.nodeValue,r=this.top;if(2&r.options||r.inlineContext(t)||/[^ \t\r\n\u000c]/.test(n)){if(1&r.options)n=2&r.options?n.replace(/\r\n?/g,`
4
+ `):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&&"BR"==o.nodeName||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;JO.hasOwnProperty(r)&&this.parser.normalizeLists&&function(t){for(let n=t.firstChild,r=null;n;n=n.nextSibling){let i=1==n.nodeType?n.nodeName.toLowerCase():null;i&&JO.hasOwnProperty(i)&&r?(r.appendChild(n),n=r):"li"==i?r=n:i&&(r=null)}}(t);let o=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(i=this.parser.matchTag(t,this,n));if(o?o.ignore:Jw.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(JT.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,!1===o.consuming?i:void 0)}leafFallback(t){"BR"==t.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(`
5
+ `))}ignoreFallback(t){"BR"!=t.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))}readStyles(t){let n=GJ.none,r=GJ.none;e:for(let i=0;i<t.length;i+=2)for(let o;;){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(t=>{a.clearMark(t)&&(r=t.addToSet(r))}):n=this.parser.schema.marks[a.mark].create(a.attrs).addToSet(n),!1===a.consuming)o=a;else break}return[n,r]}addElementByRule(t,n,r){let i,o,a;n.node?(o=this.parser.schema.nodes[n.node]).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(t=>this.insertNode(t));else{let s=t;"string"==typeof n.contentElement?s=t.querySelector(n.contentElement):"function"==typeof n.contentElement?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=null==r?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 u=0;u<n.length;u++)this.enterInner(n[u],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 r=this.top;r.applyPending(t.type),r.match&&(r.match=r.match.matchType(t.type));let i=r.activeMarks;for(let o=0;o<t.marks.length;o++)(!r.type||r.type.allowsMarkType(t.marks[o].type))&&(i=t.marks[o].addToSet(i));return r.content.push(t.mark(i)),!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=Jk(t,i,o.options);4&o.options&&0==o.content.length&&(a|=4),this.nodes.push(new JI(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++)null==this.find[n].pos&&1==t.nodeType&&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++)null==this.find[i].pos&&1==t.nodeType&&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=(t,u)=>{for(;t>=0;t--){let s=n[t];if(""==s){if(t==n.length-1||0==t)continue;for(;u>=o;u--)if(a(t-1,u))return!0;return!1}{let c=u>0||0==u&&i?this.nodes[u].type:r&&u>=o?r.node(u-o).type:null;if(!c||c.name!=s&&-1==c.groups.indexOf(s))return!1;u--}}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 i in this.parser.schema.nodes){let o=this.parser.schema.nodes[i];if(o.isTextblock&&o.defaultAttrs)return o}}addPendingMark(t){let n=function(t,n){for(let r=0;r<n.length;r++)if(t.eq(n[r]))return n[r]}(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 o=i.popFromStashMark(t);o&&i.type&&i.type.allowsMarkType(o.type)&&(i.activeMarks=o.addToSet(i.activeMarks))}if(i==n)break}}}function JC(t,n){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,n)}function JR(t){let n={};for(let r in t)n[r]=t[r];return n}function JE(t,n){let r=n.schema.nodes;for(let i in r){let o=r[i];if(!o.allowsMarkType(t))continue;let a=[],u=t=>{a.push(t);for(let r=0;r<t.edgeCount;r++){let{type:i,next:o}=t.edge(r);if(i==n||0>a.indexOf(o)&&u(o))return!0}};if(u(o.contentMatch))return!0}}class JA{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},r){r||(r=JN(n).createDocumentFragment());let i=r,o=[];return t.forEach(t=>{if(o.length||t.marks.length){let r=0,a=0;for(;r<o.length&&a<t.marks.length;){let u=t.marks[a];if(!this.marks[u.type.name]){a++;continue}if(!u.eq(o[r][0])||!1===u.type.spec.spanning)break;r++,a++}for(;r<o.length;)i=o.pop()[1];for(;a<t.marks.length;){let s=t.marks[a++],c=this.serializeMark(s,t.isInline,n);c&&(o.push([s,i]),i.appendChild(c.dom),i=c.contentDOM||c.dom)}}i.appendChild(this.serializeNodeInner(t,n))}),r}serializeNodeInner(t,n){let{dom:r,contentDOM:i}=JA.renderSpec(JN(n),this.nodes[t.type.name](t));if(i){if(t.isLeaf)throw 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&&JA.renderSpec(JN(r),i(t,n))}static renderSpec(t,n,r=null){if("string"==typeof n)return{dom:t.createTextNode(n)};if(null!=n.nodeType)return{dom:n};if(n.dom&&null!=n.dom.nodeType)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&&"object"==typeof s&&null==s.nodeType&&!Array.isArray(s)){for(let l in c=2,s)if(null!=s[l]){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 d=c;d<n.length;d++){let p=n[d];if(0===p){if(d<n.length-1||d>c)throw RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u}}{let{dom:h,contentDOM:m}=JA.renderSpec(t,p,r);if(u.appendChild(h),m){if(a)throw RangeError("Multiple content holes");a=m}}}return{dom:u,contentDOM:a}}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new JA(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=Jj(t.nodes);return n.text||(n.text=t=>t.text),n}static marksFromSchema(t){return Jj(t.marks)}}function Jj(t){let n={};for(let r in t){let i=t[r].spec.toDOM;i&&(n[r]=i)}return n}function JN(t){return t.document||window.document}function JP(t,n){return t+65536*n}function JL(t){return 65535&t}class JF{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class JD{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&JD.empty)return JD.empty}recover(t){var n;let r=0,i=JL(t);if(!this.inverted)for(let o=0;o<i;o++)r+=this.ranges[3*o+2]-this.ranges[3*o+1];return this.ranges[3*i]+r+(t-(65535&t))/65536}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:JP(u/3,t-s),m=t==s?2:t==f?1:4;return(n<0?t!=s:t!=f)&&(m|=8),new JF(p,m,h)}i+=l-c}return r?t+i:new JF(t+i,0,null)}touches(t,n){let r=0,i=JL(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];if(t<=s+c&&u==3*i)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 JD(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return 0==t?JD.empty:new JD(t<0?[0,-t,0]:[0,0,t])}}JD.empty=new JD([]);class JW{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 JW(this.maps,this.mirror,t,n)}copy(){return new JW(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(t,n){this.to=this.maps.push(t),null!=n&&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],null!=i&&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(),null!=i&&i>n?r-i-1:void 0)}}invert(){let t=new JW;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].mapResult(t,n);if(null!=a.recover){let u=this.getMirror(o);if(null!=u&&u>o&&u<this.to){o=u,t=this.maps[u].recover(a.recover);continue}}i|=a.delInfo,t=a.pos}return r?t:new JF(t,i,null)}}let JU=Object.create(null);class Jz{getMap(){return JD.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw RangeError("Invalid input for Step.fromJSON");let r=JU[n.stepType];if(!r)throw RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in JU)throw RangeError("Duplicate use of step JSON ID "+t);return JU[t]=n,n.prototype.jsonID=t,n}}class JB{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new JB(t,null)}static fail(t){return new JB(null,t)}static fromReplace(t,n,r,i){try{return JB.ok(t.replace(n,r,i))}catch(o){if(o instanceof GY)return JB.fail(o.message);throw o}}}function Jq(t,n,r){let i=[];for(let o=0;o<t.childCount;o++){let a=t.child(o);a.content.size&&(a=a.copy(Jq(a.content,n,a))),a.isInline&&(a=n(a,r,o)),i.push(a)}return GK.fromArray(i)}class JV extends Jz{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 GQ(Jq(n.content,(t,n)=>t.isAtom&&n.type.allowsMarkType(this.mark.type)?t.mark(this.mark.addToSet(t.marks)):t,i),n.openStart,n.openEnd);return JB.fromReplace(t,this.from,this.to,o)}invert(){return new J$(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 JV(n.pos,r.pos,this.mark)}merge(t){return t instanceof JV&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new JV(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("number"!=typeof n.from||"number"!=typeof n.to)throw RangeError("Invalid input for AddMarkStep.fromJSON");return new JV(n.from,n.to,t.markFromJSON(n.mark))}}Jz.jsonID("addMark",JV);class J$ extends Jz{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 GQ(Jq(n.content,t=>t.mark(this.mark.removeFromSet(t.marks)),t),n.openStart,n.openEnd);return JB.fromReplace(t,this.from,this.to,r)}invert(){return new JV(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 J$(n.pos,r.pos,this.mark)}merge(t){return t instanceof J$&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new J$(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("number"!=typeof n.from||"number"!=typeof n.to)throw RangeError("Invalid input for RemoveMarkStep.fromJSON");return new J$(n.from,n.to,t.markFromJSON(n.mark))}}Jz.jsonID("removeMark",J$);class JK extends Jz{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return JB.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return JB.fromReplace(t,this.pos,this.pos+1,new GQ(GK.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 JK(this.pos,n.marks[i]);return new JK(this.pos,this.mark)}}return new JH(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new JK(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if("number"!=typeof n.pos)throw RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new JK(n.pos,t.markFromJSON(n.mark))}}Jz.jsonID("addNodeMark",JK);class JH extends Jz{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return JB.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return JB.fromReplace(t,this.pos,this.pos+1,new GQ(GK.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return n&&this.mark.isInSet(n.marks)?new JK(this.pos,this.mark):this}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new JH(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if("number"!=typeof n.pos)throw RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new JH(n.pos,t.markFromJSON(n.mark))}}Jz.jsonID("removeNodeMark",JH);class JZ extends Jz{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&JJ(t,this.from,this.to)?JB.fail("Structure replace would overwrite content"):JB.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new JD([this.from,this.to-this.from,this.slice.size])}invert(t){return new JZ(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 JZ(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof JZ)||t.structure||this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openEnd||t.slice.openStart){if(t.to!=this.from||this.slice.openStart||t.slice.openEnd)return null;{let n=this.slice.size+t.slice.size==0?GQ.empty:new GQ(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new JZ(t.from,this.to,n,this.structure)}}{let r=this.slice.size+t.slice.size==0?GQ.empty:new GQ(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new JZ(this.from,this.to+(t.to-t.from),r,this.structure)}}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("number"!=typeof n.from||"number"!=typeof n.to)throw RangeError("Invalid input for ReplaceStep.fromJSON");return new JZ(n.from,n.to,GQ.fromJSON(t,n.slice),!!n.structure)}}Jz.jsonID("replace",JZ);class JG extends Jz{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&&(JJ(t,this.from,this.gapFrom)||JJ(t,this.gapTo,this.to)))return JB.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return JB.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?JB.fromReplace(t,this.from,this.to,r):JB.fail("Content does not fit in gap")}getMap(){return new JD([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 JG(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 JG(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("number"!=typeof n.from||"number"!=typeof n.to||"number"!=typeof n.gapFrom||"number"!=typeof n.gapTo||"number"!=typeof n.insert)throw RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new JG(n.from,n.to,n.gapFrom,n.gapTo,GQ.fromJSON(t,n.slice),n.insert,!!n.structure)}}function JJ(t,n,r){let i=t.resolve(n),o=r-n,a=i.depth;for(;o>0&&a>0&&i.indexAfter(a)==i.node(a).childCount;)a--,o--;if(o>0){let u=i.node(a).maybeChild(i.indexAfter(a));for(;o>0;){if(!u||u.isLeaf)return!0;u=u.firstChild,o--}}return!1}function JY(t,n,r){return(0==n||t.canReplace(n,t.childCount))&&(r==t.childCount||t.canReplace(0,r))}function JQ(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let i=t.$from.node(r),o=t.$from.index(r),a=t.$to.indexAfter(r);if(r<t.depth&&i.canReplace(o,a,n))return r;if(0==r||i.type.spec.isolating||!JY(i,o,a))break}return null}function JX(t,n,r=null,i=t){let o=function(t,n){let{parent:r,startIndex:i,endIndex:o}=t,a=r.contentMatchAt(i).findWrapping(n);if(!a)return null;let u=a.length?a[0]:n;return r.canReplaceWith(i,o,u)?a:null}(t,n),a=o&&function(t,n){let{parent:r,startIndex:i,endIndex:o}=t,a=r.child(i),u=n.contentMatch.findWrapping(a.type);if(!u)return null;let s=(u.length?u[u.length-1]:n).contentMatch;for(let c=i;s&&c<o;c++)s=s.matchType(r.child(c).type);return s&&s.validEnd?u:null}(i,n);return a?o.map(J0).concat({type:n,attrs:r}).concat(a.map(J0)):null}function J0(t){return{type:t,attrs:null}}function J1(t,n,r=1,i){let o=t.resolve(n),a=o.depth-r,u=i&&i[i.length-1]||o.parent;if(a<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!u.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let s=o.depth-1,c=r-2;s>a;s--,c--){let l=o.node(s),f=o.index(s);if(l.type.spec.isolating)return!1;let d=l.content.cutByIndex(f,l.childCount),p=i&&i[c+1];p&&(d=d.replaceChild(0,p.type.create(p.attrs)));let h=i&&i[c]||l;if(!l.canReplace(f+1,l.childCount)||!h.type.validContent(d))return!1}let m=o.indexAfter(a),g=i&&i[0];return o.node(a).canReplaceWith(m,m,g?g.type:o.node(a+1).type)}function J2(t,n){let r=t.resolve(n),i=r.index();return J3(r.nodeBefore,r.nodeAfter)&&r.parent.canReplace(i,i+1)}function J3(t,n){return!!(t&&n&&!t.isLeaf&&t.canAppend(n))}function J4(t,n,r=-1){let i=t.resolve(n);for(let o=i.depth;;o--){let a,u,s=i.index(o);if(o==i.depth?(a=i.nodeBefore,u=i.nodeAfter):r>0?(a=i.node(o+1),s++,u=i.node(o).maybeChild(s)):(a=i.node(o).maybeChild(s-1),u=i.node(o+1)),a&&!a.isTextblock&&J3(a,u)&&i.node(o).canReplace(s,s+1))return n;if(0==o)break;n=r<0?i.before(o):i.after(o)}}function J5(t,n,r=n,i=GQ.empty){if(n==r&&!i.size)return null;let o=t.resolve(n),a=t.resolve(r);return J6(o,a,i)?new JZ(n,r,i):new J9(o,a,i).fit()}function J6(t,n,r){return!r.openStart&&!r.openEnd&&t.start()==n.start()&&t.parent.canReplace(t.index(),n.index(),r.content)}Jz.jsonID("replaceAround",JG);class J9{constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=GK.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 a=t.depth;a>0;a--)this.placed=GK.from(t.node(a).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}let n=this.mustMoveInline(),r=this.placed.size-this.depth-this.$from.depth,i=this.$from,o=this.close(n<0?this.$to:i.doc.resolve(n));if(!o)return null;let a=this.placed,u=i.depth,s=o.depth;for(;u&&s&&1==a.childCount;)a=a.firstChild.content,u--,s--;let c=new GQ(a,u,s);return n>-1?new JG(i.pos,n,this.$to.pos,this.$to.end(),c,r):c.size||i.pos!=this.$to.pos?new JZ(i.pos,o.pos,c):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 a=1;a<=2;a++)for(let u=1==a?t:this.unplaced.openStart;u>=0;u--){let s,c=null,l=(u?(c=Ye(this.unplaced.content,u-1).firstChild).content:this.unplaced.content).firstChild;for(let f=this.depth;f>=0;f--){let{type:d,match:p}=this.frontier[f],h,m=null;if(1==a&&(l?p.matchType(l.type)||(m=p.fillBefore(GK.from(l),!1)):c&&d.compatibleContent(c.type)))return{sliceDepth:u,frontierDepth:f,parent:c,inject:m};if(2==a&&l&&(h=p.findWrapping(l.type)))return{sliceDepth:u,frontierDepth:f,parent:c,wrap:h};if(c&&p.matchType(c.type))break}}}openMore(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=Ye(t,n);return!!i.childCount&&!i.firstChild.isLeaf&&(this.unplaced=new GQ(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=Ye(t,n);if(i.childCount<=1&&n>0){let o=t.size-n<=n+i.size;this.unplaced=new GQ(J8(t,n-1,1),n-1,o?n-1:r)}else this.unplaced=new GQ(J8(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 a=0;a<o.length;a++)this.openFrontierNode(o[a]);let u=this.unplaced,s=r?r.content:u.content,c=u.openStart-t,l=0,f=[],{match:d,type:p}=this.frontier[n];if(i){for(let h=0;h<i.childCount;h++)f.push(i.child(h));d=d.matchFragment(i)}let m=s.size+t-(u.content.size-u.openEnd);for(;l<s.childCount;){let g=s.child(l),y=d.matchType(g.type);if(!y)break;(++l>1||0==c||g.content.size)&&(d=y,f.push(Yt(g.mark(p.allowedMarks(g.marks)),1==l?c:0,l==s.childCount?m:-1)))}let v=l==s.childCount;v||(m=-1),this.placed=J7(this.placed,n,GK.from(f)),this.frontier[n].match=d,v&&m<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let b=0,x=s;b<m;b++){let _=x.lastChild;this.frontier.push({type:_.type,match:_.contentMatchAt(_.childCount)}),x=_.content}this.unplaced=v?0==t?GQ.empty:new GQ(J8(u.content,t-1,1),t-1,m<0?u.openEnd:t-1):new GQ(J8(u.content,t,l),u.openStart,u.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return -1;let t=this.frontier[this.depth],n;if(!t.type.isTextblock||!Yn(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=Yn(t,n,i,r,o);if(a){for(let u=n-1;u>=0;u--){let{match:s,type:c}=this.frontier[u],l=Yn(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=J7(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=J7(this.placed,this.depth,GK.from(t.create(n,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(GK.empty,!0);t.childCount&&(this.placed=J7(this.placed,this.frontier.length,t))}}function J8(t,n,r){return 0==n?t.cutByIndex(r,t.childCount):t.replaceChild(0,t.firstChild.copy(J8(t.firstChild.content,n-1,r)))}function J7(t,n,r){return 0==n?t.append(r):t.replaceChild(t.childCount-1,t.lastChild.copy(J7(t.lastChild.content,n-1,r)))}function Ye(t,n){for(let r=0;r<n;r++)t=t.firstChild.content;return t}function Yt(t,n,r){if(n<=0)return t;let i=t.content;return n>1&&(i=i.replaceChild(0,Yt(i.firstChild,n-1,1==i.childCount?r-1:0))),n>0&&(i=t.type.contentMatch.fillBefore(i).append(i),r<=0&&(i=i.append(t.type.contentMatch.matchFragment(i).fillBefore(GK.empty,!0)))),t.copy(i)}function Yn(t,n,r,i,o){let a=t.node(n),u=o?t.indexAfter(n):t.index(n);if(u==a.childCount&&!r.compatibleContent(a.type))return null;let s=i.fillBefore(a.content,!0,u);return s&&!function(t,n,r){for(let i=r;i<n.childCount;i++)if(!t.allowsMarks(n.child(i).marks))return!0;return!1}(r,a.content,u)?s:null}function Yr(t){return t.spec.defining||t.spec.definingForContent}function Yi(t,n,r,i,o){if(n<r){let a=t.firstChild;t=t.replaceChild(0,a.copy(Yi(a.content,n+1,r,i,a)))}if(n>i){let u=o.contentMatchAt(0),s=u.fillBefore(t).append(t);t=s.append(u.matchFragment(s).fillBefore(GK.empty,!0))}return t}function Yo(t,n){let r=[],i=Math.min(t.depth,n.depth);for(let o=i;o>=0;o--){let a=t.start(o);if(a<t.pos-(t.depth-o)||n.end(o)>n.pos+(n.depth-o)||t.node(o).type.spec.isolating||n.node(o).type.spec.isolating)break;(a==n.start(o)||o==t.depth&&o==n.depth&&t.parent.inlineContent&&n.parent.inlineContent&&o&&n.start(o-1)==a-1)&&r.push(o)}return r}class Ya extends Jz{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 JB.fail("No node at attribute step's position");let r=Object.create(null);for(let i in n.attrs)r[i]=n.attrs[i];r[this.attr]=this.value;let o=n.type.create(r,null,n.marks);return JB.fromReplace(t,this.pos,this.pos+1,new GQ(GK.from(o),0,n.isLeaf?0:1))}getMap(){return JD.empty}invert(t){return new Ya(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 Ya(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if("number"!=typeof n.pos||"string"!=typeof n.attr)throw RangeError("Invalid input for AttrStep.fromJSON");return new Ya(n.pos,n.attr,n.value)}}Jz.jsonID("attr",Ya);let Yu=class extends Error{};(Yu=function t(n){let r=Error.call(this,n);return r.__proto__=t.prototype,r}).prototype=Object.create(Error.prototype),Yu.prototype.constructor=Yu,Yu.prototype.name="TransformError";class Ys{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new JW}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new Yu(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=GQ.empty){let i=J5(this.doc,t,n,r);return i&&this.step(i),this}replaceWith(t,n,r){return this.replace(t,n,new GQ(GK.from(r),0,0))}delete(t,n){return this.replace(t,n,GQ.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,r){return function(t,n,r,i){if(!i.size)return t.deleteRange(n,r);let o=t.doc.resolve(n),a=t.doc.resolve(r);if(J6(o,a,i))return t.step(new JZ(n,r,i));let u=Yo(o,t.doc.resolve(r));0==u[u.length-1]&&u.pop();let s=-(o.depth+1);u.unshift(s);for(let c=o.depth,l=o.pos-1;c>0;c--,l--){let f=o.node(c).type.spec;if(f.defining||f.definingAsContext||f.isolating)break;u.indexOf(c)>-1?s=c:o.before(c)==l&&u.splice(1,0,-c)}let d=u.indexOf(s),p=[],h=i.openStart;for(let m=i.content,g=0;;g++){let y=m.firstChild;if(p.push(y),g==i.openStart)break;m=y.content}for(let v=h-1;v>=0;v--){let b=p[v].type,x=Yr(b);if(x&&o.node(d).type!=b)h=v;else if(x||!b.isTextblock)break}for(let _=i.openStart;_>=0;_--){let S=(_+h+1)%(i.openStart+1),T=p[S];if(T)for(let w=0;w<u.length;w++){let O=u[(w+d)%u.length],k=!0;O<0&&(k=!1,O=-O);let I=o.node(O-1),M=o.index(O-1);if(I.canReplaceWith(M,M,T.type,T.marks))return t.replace(o.before(O),k?a.after(O):r,new GQ(Yi(i.content,0,i.openStart,S),S,i.openEnd))}}let C=t.steps.length;for(let R=u.length-1;R>=0&&(t.replace(n,r,i),!(t.steps.length>C));R--){let E=u[R];E<0||(n=o.before(E),r=a.after(E))}}(this,t,n,r),this}replaceRangeWith(t,n,r){return function(t,n,r,i){if(!i.isInline&&n==r&&t.doc.resolve(n).parent.content.size){let o=function(t,n,r){let i=t.resolve(n);if(i.parent.canReplaceWith(i.index(),i.index(),r))return n;if(0==i.parentOffset)for(let o=i.depth-1;o>=0;o--){let a=i.index(o);if(i.node(o).canReplaceWith(a,a,r))return i.before(o+1);if(a>0)return null}if(i.parentOffset==i.parent.content.size)for(let u=i.depth-1;u>=0;u--){let s=i.indexAfter(u);if(i.node(u).canReplaceWith(s,s,r))return i.after(u+1);if(s<i.node(u).childCount)break}return null}(t.doc,n,i.type);null!=o&&(n=r=o)}t.replaceRange(n,r,new GQ(GK.from(i),0,0))}(this,t,n,r),this}deleteRange(t,n){return function(t,n,r){let i=t.doc.resolve(n),o=t.doc.resolve(r),a=Yo(i,o);for(let u=0;u<a.length;u++){let s=a[u],c=u==a.length-1;if(c&&0==s||i.node(s).type.contentMatch.validEnd)return t.delete(i.start(s),o.end(s));if(s>0&&(c||i.node(s-1).canReplace(i.index(s-1),o.indexAfter(s-1))))return t.delete(i.before(s),o.after(s))}for(let l=1;l<=i.depth&&l<=o.depth;l++)if(n-i.start(l)==i.depth-l&&r>i.end(l)&&o.end(l)-r!=o.depth-l)return t.delete(i.before(l),r);t.delete(n,r)}(this,t,n),this}lift(t,n){return function(t,n,r){let{$from:i,$to:o,depth:a}=n,u=i.before(a+1),s=o.after(a+1),c=u,l=s,f=GK.empty,d=0;for(let p=a,h=!1;p>r;p--)h||i.index(p)>0?(h=!0,f=GK.from(i.node(p).copy(f)),d++):c--;let m=GK.empty,g=0;for(let y=a,v=!1;y>r;y--)v||o.after(y+1)<o.end(y)?(v=!0,m=GK.from(o.node(y).copy(m)),g++):l++;t.step(new JG(c,l,u,s,new GQ(f.append(m),d,g),f.size-d,!0))}(this,t,n),this}join(t,n=1){return function(t,n,r){let i=new JZ(n-r,n+r,GQ.empty,!0);t.step(i)}(this,t,n),this}wrap(t,n){return function(t,n,r){let i=GK.empty;for(let o=r.length-1;o>=0;o--){if(i.size){let a=r[o].type.contentMatch.matchFragment(i);if(!a||!a.validEnd)throw RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=GK.from(r[o].type.create(r[o].attrs,i))}let u=n.start,s=n.end;t.step(new JG(u,s,u,s,new GQ(i,0,0),r.length,!0))}(this,t,n),this}setBlockType(t,n=t,r,i=null){return function(t,n,r,i,o){if(!i.isTextblock)throw RangeError("Type given to setBlockType should be a textblock");let a=t.steps.length;t.doc.nodesBetween(n,r,(n,r)=>{var u,s,c;let l,f;if(n.isTextblock&&!n.hasMarkup(i,o)&&(u=t.doc,s=t.mapping.slice(a).map(r),c=i,l=u.resolve(s),f=l.index(),l.parent.canReplaceWith(f,f+1,c))){t.clearIncompatible(t.mapping.slice(a).map(r,1),i);let d=t.mapping.slice(a),p=d.map(r,1),h=d.map(r+n.nodeSize,1);return t.step(new JG(p,h,p+1,h-1,new GQ(GK.from(i.create(o,null,n.marks)),0,0),1,!0)),!1}})}(this,t,n,r,i),this}setNodeMarkup(t,n,r=null,i){return function(t,n,r,i,o){let a=t.doc.nodeAt(n);if(!a)throw RangeError("No node at given position");r||(r=a.type);let u=r.create(i,null,o||a.marks);if(a.isLeaf)return t.replaceWith(n,n+a.nodeSize,u);if(!r.validContent(a.content))throw RangeError("Invalid content for node type "+r.name);t.step(new JG(n,n+a.nodeSize,n+1,n+a.nodeSize-1,new GQ(GK.from(u),0,0),1,!0))}(this,t,n,r,i),this}setNodeAttribute(t,n,r){return this.step(new Ya(t,n,r)),this}addNodeMark(t,n){return this.step(new JK(t,n)),this}removeNodeMark(t,n){if(!(n instanceof GJ)){let r=this.doc.nodeAt(t);if(!r)throw RangeError("No node at position "+t);if(!(n=n.isInSet(r.marks)))return this}return this.step(new JH(t,n)),this}split(t,n=1,r){return function(t,n,r=1,i){let o=t.doc.resolve(n),a=GK.empty,u=GK.empty;for(let s=o.depth,c=o.depth-r,l=r-1;s>c;s--,l--){a=GK.from(o.node(s).copy(a));let f=i&&i[l];u=GK.from(f?f.type.create(f.attrs,u):o.node(s).copy(u))}t.step(new JZ(n,n,new GQ(a.append(u),r,r),!0))}(this,t,n,r),this}addMark(t,n,r){var i,o,a,u;let s,c,l,f;return i=this,s=[],c=[],i.doc.nodesBetween(t,n,(i,o,a)=>{if(!i.isInline)return;let u=i.marks;if(!r.isInSet(u)&&a.type.allowsMarkType(r.type)){let d=Math.max(o,t),p=Math.min(o+i.nodeSize,n),h=r.addToSet(u);for(let m=0;m<u.length;m++)u[m].isInSet(h)||(l&&l.to==d&&l.mark.eq(u[m])?l.to=p:s.push(l=new J$(d,p,u[m])));f&&f.to==d?f.to=p:c.push(f=new JV(d,p,r))}}),s.forEach(t=>i.step(t)),c.forEach(t=>i.step(t)),this}removeMark(t,n,r){var i,o,a,u;let s,c;return i=this,s=[],c=0,i.doc.nodesBetween(t,n,(i,o)=>{if(!i.isInline)return;c++;let a=null;if(r instanceof Jb){let u=i.marks,l;for(;l=r.isInSet(u);)(a||(a=[])).push(l),u=l.removeFromSet(u)}else r?r.isInSet(i.marks)&&(a=[r]):a=i.marks;if(a&&a.length){let f=Math.min(o+i.nodeSize,n);for(let d=0;d<a.length;d++){let p=a[d],h;for(let m=0;m<s.length;m++){let g=s[m];g.step==c-1&&p.eq(s[m].style)&&(h=g)}h?(h.to=f,h.step=c):s.push({style:p,from:Math.max(o,t),to:f,step:c})}}}),s.forEach(t=>i.step(new J$(t.from,t.to,t.style))),this}clearIncompatible(t,n,r){return function(t,n,r,i=r.contentMatch){let o=t.doc.nodeAt(n),a=[],u=n+1;for(let s=0;s<o.childCount;s++){let c=o.child(s),l=u+c.nodeSize,f=i.matchType(c.type);if(f){i=f;for(let d=0;d<c.marks.length;d++)r.allowsMarkType(c.marks[d].type)||t.step(new J$(u,l,c.marks[d]))}else a.push(new JZ(u,l,GQ.empty));u=l}if(!i.validEnd){let p=i.fillBefore(GK.empty,!0);t.replace(u,u,new GQ(p,0,0))}for(let h=a.length-1;h>=0;h--)t.step(a[h])}(this,t,n,r),this}}let Yc=Object.create(null);class Yl{constructor(t,n,r){this.$anchor=t,this.$head=n,this.ranges=r||[new Yf(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=GQ.empty){let r=n.content.lastChild,i=null;for(let o=0;o<n.openEnd;o++)i=r,r=r.lastChild;let a=t.steps.length,u=this.ranges;for(let s=0;s<u.length;s++){let{$from:c,$to:l}=u[s],f=t.mapping.slice(a);t.replaceRange(f.map(c.pos),f.map(l.pos),s?GQ.empty:n),0==s&&Y_(t,a,(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),Y_(t,r,n.isInline?-1:1))}}static findFrom(t,n,r=!1){let i=t.parent.inlineContent?new Yh(t):Yx(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?Yx(t.node(0),t.node(o),t.before(o+1),t.index(o),n,r):Yx(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 Yv(t.node(0))}static atStart(t){return Yx(t,t,0,0,1)||new Yv(t)}static atEnd(t){return Yx(t,t,t.content.size,t.childCount,-1)||new Yv(t)}static fromJSON(t,n){if(!n||!n.type)throw RangeError("Invalid input for Selection.fromJSON");let r=Yc[n.type];if(!r)throw RangeError(`No selection type ${n.type} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in Yc)throw RangeError("Duplicate use of selection JSON ID "+t);return Yc[t]=n,n.prototype.jsonID=t,n}getBookmark(){return Yh.between(this.$anchor,this.$head).getBookmark()}}Yl.prototype.visible=!0;class Yf{constructor(t,n){this.$from=t,this.$to=n}}let Yd=!1;function Yp(t){Yd||t.parent.inlineContent||(Yd=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Yh extends Yl{constructor(t,n=t){Yp(t),Yp(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 Yl.near(r);let i=t.resolve(n.map(this.anchor));return new Yh(i.parent.inlineContent?i:r,r)}replace(t,n=GQ.empty){if(super.replace(t,n),n==GQ.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof Yh&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Ym(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if("number"!=typeof n.anchor||"number"!=typeof n.head)throw RangeError("Invalid input for TextSelection.fromJSON");return new Yh(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=Yl.findFrom(n,r,!0)||Yl.findFrom(n,-r,!0);if(!o)return Yl.near(n,r);n=o.$head}return t.parent.inlineContent||(0==i?t=n:(t=(Yl.findFrom(t,-r,!0)||Yl.findFrom(t,r,!0)).$anchor).pos<n.pos!=i<0&&(t=n)),new Yh(t,n)}}Yl.jsonID("text",Yh);class Ym{constructor(t,n){this.anchor=t,this.head=n}map(t){return new Ym(t.map(this.anchor),t.map(this.head))}resolve(t){return Yh.between(t.resolve(this.anchor),t.resolve(this.head))}}class Yg extends Yl{constructor(t){let n=t.nodeAfter;super(t,t.node(0).resolve(t.pos+n.nodeSize)),this.node=n}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),o=t.resolve(i);return r?Yl.near(o):new Yg(o)}content(){return new GQ(GK.from(this.node),0,0)}eq(t){return t instanceof Yg&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Yy(this.anchor)}static fromJSON(t,n){if("number"!=typeof n.anchor)throw RangeError("Invalid input for NodeSelection.fromJSON");return new Yg(t.resolve(n.anchor))}static create(t,n){return new Yg(t.resolve(n))}static isSelectable(t){return!t.isText&&!1!==t.type.spec.selectable}}Yg.prototype.visible=!1,Yl.jsonID("node",Yg);class Yy{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new Ym(r,r):new Yy(r)}resolve(t){let n=t.resolve(this.anchor),r=n.nodeAfter;return r&&Yg.isSelectable(r)?new Yg(n):Yl.near(n)}}class Yv extends Yl{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,n=GQ.empty){if(n==GQ.empty){t.delete(0,t.doc.content.size);let r=Yl.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(t){return new Yv(t)}map(t){return new Yv(t)}eq(t){return t instanceof Yv}getBookmark(){return Yb}}Yl.jsonID("all",Yv);let Yb={map(){return this},resolve:t=>new Yv(t)};function Yx(t,n,r,i,o,a=!1){if(n.inlineContent)return Yh.create(t,r);for(let u=i-(o>0?0:1);o>0?u<n.childCount:u>=0;u+=o){let s=n.child(u);if(s.isAtom){if(!a&&Yg.isSelectable(s))return Yg.create(t,r-(o<0?s.nodeSize:0))}else{let c=Yx(t,s,r+o,o<0?s.childCount:0,o,a);if(c)return c}r+=s.nodeSize*o}return null}function Y_(t,n,r){let i=t.steps.length-1;if(i<n)return;let o=t.steps[i];if(!(o instanceof JZ||o instanceof JG))return;let a;t.mapping.maps[i].forEach((t,n,r,i)=>{null==a&&(a=i)}),t.setSelection(Yl.near(t.doc.resolve(a),r))}class YS extends Ys{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 RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=(1|this.updated)&-3,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=2,this}ensureMarks(t){return GJ.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(2&this.updated)>0}addStep(t,n){super.addStep(t,n),this.updated=-3&this.updated,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)||GJ.none))),r.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,n,r){let i=this.doc.type.schema;if(null==n)return t?this.replaceSelectionWith(i.text(t),!0):this.deleteSelection();{if(null==r&&(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(Yl.near(this.selection.$to)),this}}setMeta(t,n){return this.meta["string"==typeof t?t:t.key]=n,this}getMeta(t){return this.meta["string"==typeof t?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function YT(t,n){return n&&t?t.bind(n):t}class Yw{constructor(t,n,r){this.name=t,this.init=YT(n.init,r),this.apply=YT(n.apply,r)}}let YO=[new Yw("doc",{init:t=>t.doc||t.schema.topNodeType.createAndFill(),apply:t=>t.doc}),new Yw("selection",{init:(t,n)=>t.selection||Yl.atStart(n.doc),apply:t=>t.selection}),new Yw("storedMarks",{init:t=>t.storedMarks||null,apply:(t,n,r,i)=>i.selection.$cursor?t.storedMarks:null}),new Yw("scrollToSelection",{init:()=>0,apply:(t,n)=>t.scrolledIntoView?n+1:n})];class Yk{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=YO.slice(),n&&n.forEach(t=>{if(this.pluginsByKey[t.key])throw RangeError("Adding different instances of a keyed plugin ("+t.key+")");this.plugins.push(t),this.pluginsByKey[t.key]=t,t.spec.state&&this.fields.push(new Yw(t.key,t.spec.state,t))})}}class YI{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 RangeError("Applying a mismatched transaction");let n=new YI(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 YS(this)}static create(t){let n=new Yk(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new YI(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 Yk(this.schema,t.plugins),r=n.fields,i=new YI(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(t=>t.toJSON())),t&&"object"==typeof t)for(let r in t){if("doc"==r||"selection"==r)throw 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 RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw RangeError("Required config field 'schema' missing");let i=new Yk(t.schema,t.plugins),o=new YI(i);return i.fields.forEach(i=>{if("doc"==i.name)o.doc=Jt.fromJSON(t.schema,n.doc);else if("selection"==i.name)o.selection=Yl.fromJSON(o.doc,n.selection);else if("storedMarks"==i.name)n.storedMarks&&(o.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let a in r){let u=r[a],s=u.spec.state;if(u.key==i.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){o[i.name]=s.fromJSON.call(u,t,n[a],o);return}}o[i.name]=i.init(t,o)}}),o}}class YM{constructor(t){this.spec=t,this.props={},t.props&&function t(n,r,i){for(let o in n){let a=n[o];a instanceof Function?a=a.bind(r):"handleDOMEvents"==o&&(a=t(a,r,{})),i[o]=a}return i}(t.props,this,this.props),this.key=t.key?t.key.key:YR("plugin")}getState(t){return t[this.key]}}let YC=Object.create(null);function YR(t){return t in YC?t+"$"+ ++YC[t]:(YC[t]=0,t+"$")}class YE{constructor(t="key"){this.key=YR(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}let YA=function(t){for(var n=0;;n++)if(!(t=t.previousSibling))return n},Yj=function(t){let n=t.assignedSlot||t.parentNode;return n&&11==n.nodeType?n.host:n},YN=null,YP=function(t,n,r){let i=YN||(YN=document.createRange());return i.setEnd(t,r??t.nodeValue.length),i.setStart(t,n||0),i},YL=function(t,n,r,i){return r&&(YD(t,n,r,i,-1)||YD(t,n,r,i,1))},YF=/^(img|br|input|textarea|hr)$/i;function YD(t,n,r,i,o){for(;;){if(t==r&&n==i)return!0;if(n==(o<0?0:YW(t))){let a=t.parentNode;if(!a||1!=a.nodeType||YU(t)||YF.test(t.nodeName)||"false"==t.contentEditable)return!1;n=YA(t)+(o<0?0:1),t=a}else{if(1!=t.nodeType||"false"==(t=t.childNodes[n+(o<0?-1:0)]).contentEditable)return!1;n=o<0?YW(t):0}}}function YW(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function YU(t){let n;for(let r=t;r&&!(n=r.pmViewDesc);r=r.parentNode);return n&&n.node&&n.node.isBlock&&(n.dom==t||n.contentDOM==t)}let Yz=function(t){return t.focusNode&&YL(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function YB(t,n){let r=document.createEvent("Event");return r.initEvent("keydown",!0,!0),r.keyCode=t,r.key=r.code=n,r}function Yq(t,n,r){if(t.caretPositionFromPoint)try{let i=t.caretPositionFromPoint(n,r);if(i)return{node:i.offsetNode,offset:i.offset}}catch{}if(t.caretRangeFromPoint){let o=t.caretRangeFromPoint(n,r);if(o)return{node:o.startContainer,offset:o.startOffset}}}let YV="u">typeof navigator?navigator:null,Y$="u">typeof document?document:null,YK=YV&&YV.userAgent||"",YH=/Edge\/(\d+)/.exec(YK),YZ=/MSIE \d/.exec(YK),YG=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(YK),YJ=!!(YZ||YG||YH),YY=YZ?document.documentMode:YG?+YG[1]:YH?+YH[1]:0,YQ=!YJ&&/gecko\/(\d+)/i.test(YK);YQ&&(/Firefox\/(\d+)/.exec(YK)||[0,0])[1];let YX=!YJ&&/Chrome\/(\d+)/.exec(YK),Y0=!!YX,Y1=YX?+YX[1]:0,Y2=!YJ&&!!YV&&/Apple Computer/.test(YV.vendor),Y3=Y2&&(/Mobile\/\w+/.test(YK)||!!YV&&YV.maxTouchPoints>2),Y4=Y3||!!YV&&/Mac/.test(YV.platform),Y5=!!YV&&/Win/.test(YV.platform),Y6=/Android \d/.test(YK),Y9=!!Y$&&"webkitFontSmoothing"in Y$.documentElement.style,Y8=Y9?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Y7(t){return{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Qe(t,n){return"number"==typeof t?t:t[n]}function Qt(t){let n=t.getBoundingClientRect(),r=n.width/t.offsetWidth||1,i=n.height/t.offsetHeight||1;return{left:n.left,right:n.left+t.clientWidth*r,top:n.top,bottom:n.top+t.clientHeight*i}}function Qn(t,n,r){let i=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,a=t.dom.ownerDocument;for(let u=r||t.dom;u;u=Yj(u)){if(1!=u.nodeType)continue;let s=u,c=s==a.body,l=c?Y7(a):Qt(s),f=0,d=0;if(n.top<l.top+Qe(i,"top")?d=-(l.top-n.top+Qe(o,"top")):n.bottom>l.bottom-Qe(i,"bottom")&&(d=n.bottom-l.bottom+Qe(o,"bottom")),n.left<l.left+Qe(i,"left")?f=-(l.left-n.left+Qe(o,"left")):n.right>l.right-Qe(i,"right")&&(f=n.right-l.right+Qe(o,"right")),f||d){if(c)a.defaultView.scrollBy(f,d);else{let p=s.scrollLeft,h=s.scrollTop;d&&(s.scrollTop+=d),f&&(s.scrollLeft+=f);let m=s.scrollLeft-p,g=s.scrollTop-h;n={left:n.left-m,top:n.top-g,right:n.right-m,bottom:n.bottom-g}}}if(c)break}}function Qr(t){let n=[],r=t.ownerDocument;for(let i=t;i&&(n.push({dom:i,top:i.scrollTop,left:i.scrollLeft}),t!=r);i=Yj(i));return n}function Qi(t,n){for(let r=0;r<t.length;r++){let{dom:i,top:o,left:a}=t[r];i.scrollTop!=o+n&&(i.scrollTop=o+n),i.scrollLeft!=a&&(i.scrollLeft=a)}}let Qo=null;function Qa(t,n){return t.left>=n.left-1&&t.left<=n.right+1&&t.top>=n.top-1&&t.top<=n.bottom+1}function Qu(t){return t.top<t.bottom||t.left<t.right}function Qs(t,n){let r=t.getClientRects();if(r.length){let i=r[n<0?0:r.length-1];if(Qu(i))return i}return Array.prototype.find.call(r,Qu)||t.getBoundingClientRect()}let Qc=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Ql(t,n,r){let{node:i,offset:o,atom:a}=t.docView.domFromPos(n,r<0?-1:1),u=Y9||YQ;if(3==i.nodeType){if(u&&(Qc.test(i.nodeValue)||(r<0?!o:o==i.nodeValue.length))){let s=Qs(YP(i,o,o),r);if(YQ&&o&&/\s/.test(i.nodeValue[o-1])&&o<i.nodeValue.length){let c=Qs(YP(i,o-1,o-1),-1);if(c.top==s.top){let l=Qs(YP(i,o,o+1),-1);if(l.top!=s.top)return Qf(l,l.left<c.left)}}return s}{let f=o,d=o,p=r<0?1:-1;return r<0&&!o?(d++,p=-1):r>=0&&o==i.nodeValue.length?(f--,p=1):r<0?f--:d++,Qf(Qs(YP(i,f,d),p),p<0)}}if(!t.state.doc.resolve(n-(a||0)).parent.inlineContent){if(null==a&&o&&(r<0||o==YW(i))){let h=i.childNodes[o-1];if(1==h.nodeType)return Qd(h.getBoundingClientRect(),!1)}if(null==a&&o<YW(i)){let m=i.childNodes[o];if(1==m.nodeType)return Qd(m.getBoundingClientRect(),!0)}return Qd(i.getBoundingClientRect(),r>=0)}if(null==a&&o&&(r<0||o==YW(i))){let g=i.childNodes[o-1],y=3==g.nodeType?YP(g,YW(g)-(u?0:1)):1!=g.nodeType||"BR"==g.nodeName&&g.nextSibling?null:g;if(y)return Qf(Qs(y,1),!1)}if(null==a&&o<YW(i)){let v=i.childNodes[o];for(;v.pmViewDesc&&v.pmViewDesc.ignoreForCoords;)v=v.nextSibling;let b=v?3==v.nodeType?YP(v,0,u?0:1):1==v.nodeType?v:null:null;if(b)return Qf(Qs(b,-1),!0)}return Qf(Qs(3==i.nodeType?YP(i):i,-r),r>=0)}function Qf(t,n){if(0==t.width)return t;let r=n?t.left:t.right;return{top:t.top,bottom:t.bottom,left:r,right:r}}function Qd(t,n){if(0==t.height)return t;let r=n?t.top:t.bottom;return{top:r,bottom:r,left:t.left,right:t.right}}function Qp(t,n,r){let i=t.state,o=t.root.activeElement;i!=n&&t.updateState(n),o!=t.dom&&t.focus();try{return r()}finally{i!=n&&t.updateState(i),o!=t.dom&&o&&o.focus()}}let Qh=/[\u0590-\u08ac]/,Qm=null,Qg=null,Qy=!1;class Qv{constructor(t,n,r,i){this.parent=t,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=0,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(1==t.nodeType?t:t.parentNode)){if(r<0){let i,o;if(t==this.contentDOM)i=t.childNodes[n-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;i=t.previousSibling}for(;i&&!((o=i.pmViewDesc)&&o.parent==this);)i=i.previousSibling;return i?this.posBeforeChild(o)+o.size:this.posAtStart}{let a,u;if(t==this.contentDOM)a=t.childNodes[n];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;a=t.nextSibling}for(;a&&!((u=a.pmViewDesc)&&u.parent==this);)a=a.nextSibling;return a?this.posBeforeChild(u):this.posAtEnd}}let s;if(t==this.dom&&this.contentDOM)s=n>YA(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))s=2&t.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==n)for(let c=t;;c=c.parentNode){if(c==this.dom){s=!1;break}if(c.previousSibling)break}if(null==s&&n==t.childNodes.length)for(let l=t;;l=l.parentNode){if(l==this.dom){s=!0;break}if(l.nextSibling)break}}return s??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)||(1==a.nodeType?a.contains(1==t.nodeType?t:t.parentNode):a==t))return o;r=!1}}}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 QO){i=t-o;break}o=u}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let s;r&&!(s=this.children[r-1]).size&&s instanceof Qb&&s.side>=0;r--);if(n<=0){let c,l=!0;for(;!(!(c=r?this.children[r-1]:null)||c.dom.parentNode==this.contentDOM);r--,l=!1);return c&&n&&l&&!c.border&&!c.domAtom?c.domFromPos(c.size,n):{node:this.contentDOM,offset:c?YA(c.dom)+1:0}}{let f,d=!0;for(;!(!(f=r<this.children.length?this.children[r]:null)||f.dom.parentNode==this.contentDOM);r++,d=!1);return f&&d&&!f.border&&!f.domAtom?f.domFromPos(0,n):{node:this.contentDOM,offset:f?YA(f.dom):this.contentDOM.childNodes.length}}}parseRange(t,n,r=0){if(0==this.children.length)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(-1==i&&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=YA(d.dom)+1;break}t-=d.size}-1==i&&(i=0)}if(i>-1&&(c>n||u==this.children.length-1)){n=c;for(let p=u+1;p<this.children.length;p++){let h=this.children[p];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(-1)){o=YA(h.dom);break}n+=h.size}-1==o&&(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 0==n.size||n.emptyChildAt(t)}domAfterPos(t){let{node:n,offset:r}=this.domFromPos(t,0);if(1!=n.nodeType||r==n.childNodes.length)throw 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 u=0,s=0;u<this.children.length;u++){let c=this.children[u],l=s+c.size;if(o>s&&a<l)return c.setSelection(t-s-c.border,n-s-c.border,r,i);s=l}let f=this.domFromPos(t,t?-1:1),d=n==t?f:this.domFromPos(n,n?-1:1),p=r.getSelection(),h=!1;if((YQ||Y2)&&t==n){let{node:m,offset:g}=f;if(3==m.nodeType){if((h=!!(g&&m.nodeValue[g-1]==`
6
+ `))&&g==m.nodeValue.length)for(let y=m,v;y;y=y.parentNode){if(v=y.nextSibling){"BR"==v.nodeName&&(f=d={node:v.parentNode,offset:YA(v)+1});break}let b=y.pmViewDesc;if(b&&b.node&&b.node.isBlock)break}}else{let x=m.childNodes[g-1];h=x&&("BR"==x.nodeName||"false"==x.contentEditable)}}if(YQ&&p.focusNode&&p.focusNode!=d.node&&1==p.focusNode.nodeType){let _=p.focusNode.childNodes[p.focusOffset];_&&"false"==_.contentEditable&&(i=!0)}if(!(i||h&&Y2)&&YL(f.node,f.offset,p.anchorNode,p.anchorOffset)&&YL(d.node,d.offset,p.focusNode,p.focusOffset))return;let S=!1;if((p.extend||t==n)&&!h){p.collapse(f.node,f.offset);try{t!=n&&p.extend(d.node,d.offset),S=!0}catch{}}if(!S){if(t>n){let T=f;f=d,d=T}let w=document.createRange();w.setEnd(d.node,d.offset),w.setStart(f.node,f.offset),p.removeAllRanges(),p.addRange(w)}}ignoreMutation(t){return!this.contentDOM&&"selection"!=t.type}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?2:1,t==u&&n==s&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=3:o.markDirty(t-u,n-u);return}o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?3:2}r=a}this.dirty=2}markParentsDirty(){let t=1;for(let n=this.parent;n;n=n.parent,t++){let r=1==t?2:1;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class Qb extends Qv{constructor(t,n,r,i){let o,a=n.type.toDOM;if("function"==typeof a&&(a=a(r,()=>o?o.parent?o.parent.posBeforeChild(o):void 0:i)),!n.type.spec.raw){if(1!=a.nodeType){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 0==this.dirty&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let n=this.widget.spec.stopEvent;return!!n&&n(t)}ignoreMutation(t){return"selection"!=t.type||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 Qx extends Qv{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"characterData"===t.type&&t.target.nodeValue==t.oldValue}}class Q_ extends Qv{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=JA.renderSpec(document,n.type.spec.toDOM(n,r))),new Q_(t,n,a.dom,a.contentDOM||a.dom)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM||void 0}}matchesMark(t){return 3!=this.dirty&&this.mark.eq(t)}markDirty(t,n){if(super.markDirty(t,n),0!=this.dirty){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=0}}slice(t,n,r){let i=Q_.create(this.parent,this.mark,!0,r),o=this.children,a=this.size;n<a&&(o=QF(o,n,a,r)),t>0&&(o=QF(o,0,t,r));for(let u=0;u<o.length;u++)o[u].parent=i;return i.children=o,i}}class QS extends Qv{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,()=>s?s.parent?s.parent.posBeforeChild(s):void 0:a,r,i),l=c&&c.dom,f=c&&c.contentDOM;if(n.isText){if(l){if(3!=l.nodeType)throw RangeError("Text must be rendered as a DOM text node")}else l=document.createTextNode(n.text)}else l||({dom:l,contentDOM:f}=JA.renderSpec(document,n.type.spec.toDOM(n)));f||n.isText||"BR"==l.nodeName||(l.hasAttribute("contenteditable")||(l.contentEditable="false"),n.type.spec.draggable&&(l.draggable=!0));let d=l;return l=QA(l,r,n),c?s=new Qk(t,n,r,i,l,f||null,d,c,o,a+1):n.isText?new Qw(t,n,r,i,l,d,o):new QS(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("pre"==this.node.type.whitespace&&(t.preserveWhitespace="full"),this.contentDOM){if(this.contentLost){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=()=>GK.empty)}else t.contentElement=this.contentDOM}else t.getContent=()=>this.node.content;return t}matchesNode(t,n,r){return 0==this.dirty&&t.eq(this.node)&&Qj(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 QP(this,a&&a.node,t);(function(t,n,r,i){let o=n.locals(t),a=0;if(0==o.length){for(let u=0;u<t.childCount;u++){let s=t.child(u);i(s,o,n.forChild(a,s),u),a+=s.nodeSize}return}let c=0,l=[],f=null;for(let d=0;;){if(c<o.length&&o[c].to==a){let p=o[c++],h;for(;c<o.length&&o[c].to==a;)(h||(h=[p])).push(o[c++]);if(h){h.sort(QL);for(let m=0;m<h.length;m++)r(h[m],d,!!f)}else r(p,d,!!f)}let g,y;if(f)y=-1,g=f,f=null;else if(d<t.childCount)y=d,g=t.child(d++);else break;for(let v=0;v<l.length;v++)l[v].to<=a&&l.splice(v--,1);for(;c<o.length&&o[c].from<=a&&o[c].to>a;)l.push(o[c++]);let b=a+g.nodeSize;if(g.isText){let x=b;c<o.length&&o[c].from<x&&(x=o[c].from);for(let _=0;_<l.length;_++)l[_].to<x&&(x=l[_].to);x<b&&(f=g.cut(x-a),g=g.cut(0,x-a),b=x,y=-1)}let S=g.isInline&&!g.isLeaf?l.filter(t=>!t.inline):l.slice();i(g,S,n.forChild(a,g),y),a=b}})(this.node,this.innerDeco,(n,o,a)=>{n.spec.marks?s.syncToMarks(n.spec.marks,r,t):n.type.side>=0&&!a&&s.syncToMarks(o==this.node.childCount?GJ.none:this.node.child(o).marks,r,t),s.placeWidget(n,t,i)},(n,a,c,l)=>{s.syncToMarks(n.marks,r,t);let f;s.findNodeMatch(n,a,c,l)||u&&t.state.selection.from>i&&t.state.selection.to<i+n.nodeSize&&(f=s.findIndexWithChild(o.node))>-1&&s.updateNodeAt(n,a,c,f,t)||s.updateNextNode(n,a,c,t,l,i)||s.addNode(n,a,c,t,i),i+=n.nodeSize}),s.syncToMarks([],r,t),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||2==this.dirty)&&(a&&this.protectLocalComposition(t,a),function t(n,r,i){let o=n.firstChild,a=!1;for(let u=0;u<r.length;u++){let s=r[u],c=s.dom;if(c.parentNode==n){for(;c!=o;)o=QN(o),a=!0;o=o.nextSibling}else a=!0,n.insertBefore(c,o);if(s instanceof Q_){let l=o?o.previousSibling:n.lastChild;t(s.contentDOM,s.children,i),o=l?l.nextSibling:n.firstChild}}for(;o;)o=QN(o),a=!0;a&&i.trackWrites==n&&(i.trackWrites=null)}(this.contentDOM,this.children,t),Y3&&function(t){if("UL"==t.nodeName||"OL"==t.nodeName){let n=t.style.cssText;t.style.cssText=n+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=n}}(this.dom))}localCompositionInfo(t,n){let{from:r,to:i}=t.state.selection;if(!(t.state.selection instanceof Yh)||r<n||i>n+this.node.content.size)return null;let o=t.domSelectionRange(),a=function(t,n){for(;;){if(3==t.nodeType)return t;if(1==t.nodeType&&n>0){if(t.childNodes.length>n&&3==t.childNodes[n].nodeType)return t.childNodes[n];n=YW(t=t.childNodes[n-1])}else{if(1!=t.nodeType||!(n<t.childNodes.length))return null;t=t.childNodes[n],n=0}}}(o.focusNode,o.focusOffset);if(!a||!this.dom.contains(a.parentNode))return null;if(!this.node.inlineContent)return{node:a,pos:-1,text:""};{let u=a.nodeValue,s=function(t,n,r,i){for(let o=0,a=0;o<t.childCount&&a<=i;){let u=t.child(o++);if(a+=u.nodeSize,!u.isText)continue;let s=u.text;for(;o<t.childCount;){let c=t.child(o++);if(a+=c.nodeSize,!c.isText)break;s+=c.text}if(a>=r){let l=a<i?s.lastIndexOf(n,i-a-1):-1;if(l>=0&&l+n.length+a>=r)return a+l;if(r==i&&s.length>=i+n.length-a&&s.slice(i-a,i-a+n.length)==n)return i}}return -1}(this.node.content,u,r-n,i-n);return s<0?null:{node:a,pos:s,text:u}}}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 Qx(this,o,n,i);t.input.compositionNodes.push(a),this.children=QF(this.children,r,r+i.length,t,a)}update(t,n,r,i){return!!(3!=this.dirty&&t.sameMarkup(this.node))&&(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=0}updateOuterDeco(t){if(Qj(t,this.outerDeco))return;let n=1!=this.nodeDOM.nodeType,r=this.dom;this.dom=QR(this.dom,this.nodeDOM,QC(this.outerDeco,this.node,n),QC(t,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function QT(t,n,r,i,o){QA(i,n,t);let a=new QS(void 0,t,n,r,i,i,i,o,0);return a.contentDOM&&a.updateChildren(o,0),a}class Qw extends QS{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!!(3!=this.dirty&&(0==this.dirty||this.inParent())&&t.sameMarkup(this.node))&&(this.updateOuterDeco(n),(0!=this.dirty||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=0,!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"characterData"!=t.type&&"selection"!=t.type}slice(t,n,r){let i=this.node.cut(t,n),o=document.createTextNode(i.text);return new Qw(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(t,n){super.markDirty(t,n),this.dom!=this.nodeDOM&&(0==t||n==this.nodeDOM.nodeValue.length)&&(this.dirty=3)}get domAtom(){return!1}}class QO extends Qv{parseRule(){return{ignore:!0}}matchesHack(t){return 0==this.dirty&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class Qk extends QS{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(3==this.dirty)return!1;if(!this.spec.update)return(!!this.contentDOM||!!t.isLeaf)&&super.update(t,n,r,i);{let o=this.spec.update(t,n,r);return o&&this.updateInner(t,n,r,i),o}}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)}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}let QI=function(t){t&&(this.nodeName=t)};QI.prototype=Object.create(null);let QM=[new QI];function QC(t,n,r){if(0==t.length)return QM;let i=r?QM[0]:new QI,o=[i];for(let a=0;a<t.length;a++){let u=t[a].type.attrs;if(u)for(let s in u.nodeName&&o.push(i=new QI(u.nodeName)),u){let c=u[s];null!=c&&(r&&1==o.length&&o.push(i=new QI(n.isInline?"span":"div")),"class"==s?i.class=(i.class?i.class+" ":"")+c:"style"==s?i.style=(i.style?i.style+";":"")+c:"nodeName"!=s&&(i[s]=c))}}return o}function QR(t,n,r,i){if(r==QM&&i==QM)return n;let o=n;for(let a=0;a<i.length;a++){let u=i[a],s=r[a];if(a){let c;s&&s.nodeName==u.nodeName&&o!=t&&(c=o.parentNode)&&c.nodeName.toLowerCase()==u.nodeName||((c=document.createElement(u.nodeName)).pmIsDeco=!0,c.appendChild(o),s=QM[0]),o=c}QE(o,s||QM[0],u)}return o}function QE(t,n,r){for(let i in n)"class"==i||"style"==i||"nodeName"==i||i in r||t.removeAttribute(i);for(let o in r)"class"!=o&&"style"!=o&&"nodeName"!=o&&r[o]!=n[o]&&t.setAttribute(o,r[o]);if(n.class!=r.class){let a=n.class?n.class.split(" ").filter(Boolean):[],u=r.class?r.class.split(" ").filter(Boolean):[];for(let s=0;s<a.length;s++)-1==u.indexOf(a[s])&&t.classList.remove(a[s]);for(let c=0;c<u.length;c++)-1==a.indexOf(u[c])&&t.classList.add(u[c]);0==t.classList.length&&t.removeAttribute("class")}if(n.style!=r.style){if(n.style){let l=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,f;for(;f=l.exec(n.style);)t.style.removeProperty(f[1])}r.style&&(t.style.cssText+=r.style)}}function QA(t,n,r){return QR(t,t,QM,QC(n,r,1!=t.nodeType))}function Qj(t,n){if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].type.eq(n[r].type))return!1;return!0}function QN(t){let n=t.nextSibling;return t.parentNode.removeChild(t),n}class QP{constructor(t,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=function(t,n){let r=n,i=r.children.length,o=t.childCount,a=new Map,u=[];e:for(;o>0;){let s;for(;;)if(i){let c=r.children[i-1];if(c instanceof Q_)r=c,i=c.children.length;else{s=c,i--;break}}else{if(r==n)break e;i=r.parent.children.indexOf(r),r=r.parent}let l=s.node;if(l){if(l!=t.child(o-1))break;--o,a.set(s,o),u.push(s)}}return{index:o,matched:a,matches:u.reverse()}}(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])&&!1!==t[i].type.spec.spanning;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=0,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 l=Q_.create(this.top,t[o],n,r);this.top.children.splice(this.index,0,l),this.top=l,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)&&(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(t,n,r,i,o){let a=this.top.children[i];return 3==a.dirty&&a.dom==a.contentDOM&&(a.dirty=2),!!a.update(t,n,r,o)&&(this.destroyBetween(this.index,i),this.index++,!0)}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 QS){let c=this.preMatch.matched.get(s);if(null!=c&&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&&3!=s.dirty&&Qj(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=2,f.updateChildren(i,a+1),f.dirty=0,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=QS.create(this.top,n,r,i,o,a);if(!u.contentDOM)return null;for(let s of(u.children=t.children,t.children=[],t.destroy(),u.children))s.parent=u;return u}addNode(t,n,r,i,o){let a=QS.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 Qb(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 Q_;)t=(n=t).children[n.children.length-1];(!t||!(t instanceof Qw)||/\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(t.node.text))&&((Y2||Y0)&&t&&"false"==t.dom.contentEditable&&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);"IMG"==t&&(r.className="ProseMirror-separator",r.alt=""),"BR"==t&&(r.className="ProseMirror-trailingBreak");let i=new QO(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||1==t.nodeType&&t.contains(this.lock.parentNode))}}function QL(t,n){return t.type.side-n.type.side}function QF(t,n,r,i,o){let a=[];for(let u=0,s=0;u<t.length;u++){let c=t[u],l=s+=c.size;s>=r||l<=n?a.push(c):(s<n&&a.push(c.slice(0,n-s,i)),o&&(a.push(o),o=void 0),l>r&&a.push(c.slice(r-s,c.size,i)))}return a}function QD(t,n=null){let r=t.domSelectionRange(),i=t.state.doc;if(!r.focusNode)return null;let o=t.docView.nearestDesc(r.focusNode),a=o&&0==o.size,u=t.docView.posFromDOM(r.focusNode,r.focusOffset,1);if(u<0)return null;let s=i.resolve(u),c,l;if(Yz(r)){for(c=s;o&&!o.node;)o=o.parent;let f=o.node;if(o&&f.isAtom&&Yg.isSelectable(f)&&o.parent&&!(f.isInline&&function(t,n,r){for(let i=0==n,o=n==YW(t);i||o;){if(t==r)return!0;let a=YA(t);if(!(t=t.parentNode))return!1;i=i&&0==a,o=o&&a==YW(t)}}(r.focusNode,r.focusOffset,o.dom))){let d=o.posBefore;l=new Yg(u==d?s:i.resolve(d))}}else{let p=t.docView.posFromDOM(r.anchorNode,r.anchorOffset,1);if(p<0)return null;c=i.resolve(p)}if(!l){let h="pointer"==n||t.state.selection.head<s.pos&&!a?1:-1;l=QH(t,c,s,h)}return l}function QW(t){return t.editable?t.hasFocus():QG(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function QU(t,n=!1){let r=t.state.selection;if(Q$(t,r),QW(t)){var i,o;if(!n&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&Y0){let a=t.domSelectionRange(),u=t.domObserver.currentSelection;if(a.anchorNode&&u.anchorNode&&YL(a.anchorNode,a.anchorOffset,u.anchorNode,u.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper){let s,c,l,f;i=t,s=i.domSelection(),c=document.createRange(),l=i.cursorWrapper.dom,f="IMG"==l.nodeName,f?c.setEnd(l.parentNode,YA(l)+1):c.setEnd(l,0),c.collapse(!1),s.removeAllRanges(),s.addRange(c),!f&&!i.state.selection.visible&&YJ&&YY<=11&&(l.disabled=!0,l.disabled=!1)}else{let{anchor:d,head:p}=r,h,m,g,y,v,b;!Qz||r instanceof Yh||(r.$from.parent.inlineContent||(h=QB(t,r.from)),r.empty||r.$from.parent.inlineContent||(m=QB(t,r.to))),t.docView.setSelection(d,p,t.root,n),Qz&&(h&&QV(h),m&&QV(m)),r.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&(o=t,g=o.dom.ownerDocument,g.removeEventListener("selectionchange",o.input.hideSelectionGuard),y=o.domSelectionRange(),v=y.anchorNode,b=y.anchorOffset,g.addEventListener("selectionchange",o.input.hideSelectionGuard=()=>{(y.anchorNode!=v||y.anchorOffset!=b)&&(g.removeEventListener("selectionchange",o.input.hideSelectionGuard),setTimeout(()=>{(!QW(o)||o.state.selection.visible)&&o.dom.classList.remove("ProseMirror-hideselection")},20))})))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}let Qz=Y2||Y0&&Y1<63;function QB(t,n){let{node:r,offset:i}=t.docView.domFromPos(n,0),o=i<r.childNodes.length?r.childNodes[i]:null,a=i?r.childNodes[i-1]:null;if(Y2&&o&&"false"==o.contentEditable)return Qq(o);if((!o||"false"==o.contentEditable)&&(!a||"false"==a.contentEditable)){if(o)return Qq(o);if(a)return Qq(a)}}function Qq(t){return t.contentEditable="true",Y2&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function QV(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function Q$(t,n){if(n instanceof Yg){let r=t.docView.descAt(n.from);r!=t.lastSelectedViewDesc&&(QK(t),r&&r.selectNode(),t.lastSelectedViewDesc=r)}else QK(t)}function QK(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function QH(t,n,r,i){return t.someProp("createSelectionBetween",i=>i(t,n,r))||Yh.between(n,r,i)}function QZ(t){return(!t.editable||!!t.hasFocus())&&QG(t)}function QG(t){let n=t.domSelectionRange();if(!n.anchorNode)return!1;try{return t.dom.contains(3==n.anchorNode.nodeType?n.anchorNode.parentNode:n.anchorNode)&&(t.editable||t.dom.contains(3==n.focusNode.nodeType?n.focusNode.parentNode:n.focusNode))}catch{return!1}}function QJ(t,n){let{$anchor:r,$head:i}=t.selection,o=n>0?r.max(i):r.min(i),a=o.parent.inlineContent?o.depth?t.doc.resolve(n>0?o.after():o.before()):null:o;return a&&Yl.findFrom(a,n)}function QY(t,n){return t.dispatch(t.state.tr.setSelection(n).scrollIntoView()),!0}function QQ(t,n,r){let i=t.state.selection;if(i instanceof Yh){if(!i.empty||r.indexOf("s")>-1)return!1;if(t.endOfTextblock(n>0?"forward":"backward")){let o=QJ(t.state,n);return!!o&&o instanceof Yg&&QY(t,o)}if(!(Y4&&r.indexOf("m")>-1)){let a=i.$head,u=a.textOffset?null:n<0?a.nodeBefore:a.nodeAfter,s;if(!u||u.isText)return!1;let c=n<0?a.pos-u.nodeSize:a.pos;return!!(u.isAtom||(s=t.docView.descAt(c))&&!s.contentDOM)&&(Yg.isSelectable(u)?QY(t,new Yg(n<0?t.state.doc.resolve(a.pos-u.nodeSize):a)):!!Y9&&QY(t,new Yh(t.state.doc.resolve(n<0?c:c+u.nodeSize))))}}else{if(i instanceof Yg&&i.node.isInline)return QY(t,new Yh(n>0?i.$to:i.$from));{let l=QJ(t.state,n);return!!l&&QY(t,l)}}}function QX(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Q0(t){let n=t.pmViewDesc;return n&&0==n.size&&(t.nextSibling||"BR"!=t.nodeName)}function Q1(t,n){return n<0?function(t){let n=t.domSelectionRange(),r=n.focusNode,i=n.focusOffset;if(!r)return;let o,a,u=!1;for(YQ&&1==r.nodeType&&i<QX(r)&&Q0(r.childNodes[i])&&(u=!0);;)if(i>0){if(1!=r.nodeType)break;{let s=r.childNodes[i-1];if(Q0(s))o=r,a=--i;else if(3==s.nodeType)i=(r=s).nodeValue.length;else break}}else{if(Q3(r))break;{let c=r.previousSibling;for(;c&&Q0(c);)o=r.parentNode,a=YA(c),c=c.previousSibling;if(c)i=QX(r=c);else{if((r=r.parentNode)==t.dom)break;i=0}}}u?Q4(t,r,i):o&&Q4(t,o,a)}(t):Q2(t)}function Q2(t){let n=t.domSelectionRange(),r=n.focusNode,i=n.focusOffset;if(!r)return;let o=QX(r),a,u;for(;;)if(i<o){if(1!=r.nodeType)break;if(Q0(r.childNodes[i]))a=r,u=++i;else break}else{if(Q3(r))break;{let s=r.nextSibling;for(;s&&Q0(s);)a=s.parentNode,u=YA(s)+1,s=s.nextSibling;if(s)i=0,o=QX(r=s);else{if((r=r.parentNode)==t.dom)break;i=o=0}}}a&&Q4(t,a,u)}function Q3(t){let n=t.pmViewDesc;return n&&n.node&&n.node.isBlock}function Q4(t,n,r){let i=t.domSelection();if(Yz(i)){let o=document.createRange();o.setEnd(n,r),o.setStart(n,r),i.removeAllRanges(),i.addRange(o)}else i.extend&&i.extend(n,r);t.domObserver.setCurSelection();let{state:a}=t;setTimeout(()=>{t.state==a&&QU(t)},50)}function Q5(t,n){let r=t.state.doc.resolve(n);if(!(Y0||Y5)&&r.parent.inlineContent){let i=t.coordsAtPos(n);if(n>r.start()){let o=t.coordsAtPos(n-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(n<r.end()){let u=t.coordsAtPos(n+1),s=(u.top+u.bottom)/2;if(s>i.top&&s<i.bottom&&Math.abs(u.left-i.left)>1)return u.left>i.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(t.dom).direction?"rtl":"ltr"}function Q6(t,n,r){let i=t.state.selection;if(i instanceof Yh&&!i.empty||r.indexOf("s")>-1||Y4&&r.indexOf("m")>-1)return!1;let{$from:o,$to:a}=i;if(!o.parent.inlineContent||t.endOfTextblock(n<0?"up":"down")){let u=QJ(t.state,n);if(u&&u instanceof Yg)return QY(t,u)}if(!o.parent.inlineContent){let s=n<0?o:a,c=i instanceof Yv?Yl.near(s,n):Yl.findFrom(s,n);return!!c&&QY(t,c)}return!1}function Q9(t,n){if(!(t.state.selection instanceof Yh))return!0;let{$head:r,$anchor:i,empty:o}=t.state.selection;if(!r.sameParent(i))return!0;if(!o)return!1;if(t.endOfTextblock(n>0?"forward":"backward"))return!0;let a=!r.textOffset&&(n<0?r.nodeBefore:r.nodeAfter);if(a&&!a.isText){let u=t.state.tr;return n<0?u.delete(r.pos-a.nodeSize,r.pos):u.delete(r.pos,r.pos+a.nodeSize),t.dispatch(u),!0}return!1}function Q8(t,n,r){t.domObserver.stop(),n.contentEditable=r,t.domObserver.start()}function Q7(t,n){t.someProp("transformCopied",r=>{n=r(n,t)});let r=[],{content:i,openStart:o,openEnd:a}=n;for(;o>1&&a>1&&1==i.childCount&&1==i.firstChild.childCount;){o--,a--;let u=i.firstChild;r.push(u.type.name,u.attrs!=u.type.defaultAttrs?u.attrs:null),i=u.content}let s=t.someProp("clipboardSerializer")||JA.fromSchema(t.state.schema),c=Xc(),l=c.createElement("div");l.appendChild(s.serializeFragment(i,{document:c}));let f=l.firstChild,d,p=0;for(;f&&1==f.nodeType&&(d=Xu[f.nodeName.toLowerCase()]);){for(let h=d.length-1;h>=0;h--){let m=c.createElement(d[h]);for(;l.firstChild;)m.appendChild(l.firstChild);l.appendChild(m),p++}f=l.firstChild}return f&&1==f.nodeType&&f.setAttribute("data-pm-slice",`${o} ${a}${p?` -${p}`:""} ${JSON.stringify(r)}`),{dom:l,text:t.someProp("clipboardTextSerializer",r=>r(n,t))||n.content.textBetween(0,n.content.size,`
7
+
8
+ `)}}function Xe(t,n,r,i,o){let a=o.parent.type.spec.code,u,s;if(!r&&!n)return null;let c=n&&(i||a||!r);if(c){if(t.someProp("transformPastedText",r=>{n=r(n,a||i,t)}),a)return n?new GQ(GK.from(t.state.schema.text(n.replace(/\r\n?/g,`
9
+ `))),0,0):GQ.empty;let l=t.someProp("clipboardTextParser",r=>r(n,o,i,t));if(l)s=l;else{let f=o.marks(),{schema:d}=t.state,p=JA.fromSchema(d);u=document.createElement("div"),n.split(/(?:\r\n?|\n)+/).forEach(t=>{let n=u.appendChild(document.createElement("p"));t&&n.appendChild(p.serializeNode(d.text(t,f)))})}}else t.someProp("transformPastedHTML",n=>{r=n(r,t)}),u=function(t){let n=/^(\s*<meta [^>]*>)*/.exec(t);n&&(t=t.slice(n[0].length));let r=Xc().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(t),o;if((o=i&&Xu[i[1].toLowerCase()])&&(t=o.map(t=>"<"+t+">").join("")+t+o.map(t=>"</"+t+">").reverse().join("")),r.innerHTML=t,o)for(let a=0;a<o.length;a++)r=r.querySelector(o[a])||r;return r}(r),Y9&&function(t){let n=t.querySelectorAll(Y0?"span:not([class]):not([style])":"span.Apple-converted-space");for(let r=0;r<n.length;r++){let i=n[r];1==i.childNodes.length&&"\xa0"==i.textContent&&i.parentNode&&i.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),i)}}(u);let h=u&&u.querySelector("[data-pm-slice]"),m=h&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(h.getAttribute("data-pm-slice")||"");if(m&&m[3])for(let g=+m[3];g>0;g--){let y=u.firstChild;for(;y&&1!=y.nodeType;)y=y.nextSibling;if(!y)break;u=y}if(s||(s=(t.someProp("clipboardParser")||t.someProp("domParser")||JS.fromSchema(t.state.schema)).parseSlice(u,{preserveWhitespace:!!(c||m),context:o,ruleFromNode:t=>"BR"!=t.nodeName||t.nextSibling||!t.parentNode||Xt.test(t.parentNode.nodeName)?null:{ignore:!0}})),m)s=function(t,n){if(!t.size)return t;let r=t.content.firstChild.type.schema,i;try{i=JSON.parse(n)}catch{return t}let{content:o,openStart:a,openEnd:u}=t;for(let s=i.length-2;s>=0;s-=2){let c=r.nodes[i[s]];if(!c||c.hasRequiredAttrs())break;o=GK.from(c.create(i[s+1],o)),a++,u++}return new GQ(o,a,u)}(Xa(s,+m[1],+m[2]),m[4]);else if((s=GQ.maxOpen(function(t,n){if(t.childCount<2)return t;for(let r=n.depth;r>=0;r--){let i=n.node(r).contentMatchAt(n.index(r)),o,a=[];if(t.forEach(t=>{if(!a)return;let n=i.findWrapping(t.type),r;if(!n)return a=null;if(r=a.length&&o.length&&Xr(n,o,t,a[a.length-1],0))a[a.length-1]=r;else{a.length&&(a[a.length-1]=Xi(a[a.length-1],o.length));let u=Xn(t,n);a.push(u),i=i.matchType(u.type),o=n}}),a)return GK.from(a)}return t}(s.content,o),!0)).openStart||s.openEnd){let v=0,b=0;for(let x=s.content.firstChild;v<s.openStart&&!x.type.spec.isolating;v++,x=x.firstChild);for(let _=s.content.lastChild;b<s.openEnd&&!_.type.spec.isolating;b++,_=_.lastChild);s=Xa(s,v,b)}return t.someProp("transformPasted",n=>{s=n(s,t)}),s}let Xt=/^(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 Xn(t,n,r=0){for(let i=n.length-1;i>=r;i--)t=n[i].create(null,GK.from(t));return t}function Xr(t,n,r,i,o){if(o<t.length&&o<n.length&&t[o]==n[o]){let a=Xr(t,n,r,i.lastChild,o+1);if(a)return i.copy(i.content.replaceChild(i.childCount-1,a));if(i.contentMatchAt(i.childCount).matchType(o==t.length-1?r.type:t[o+1]))return i.copy(i.content.append(GK.from(Xn(r,t,o+1))))}}function Xi(t,n){if(0==n)return t;let r=t.content.replaceChild(t.childCount-1,Xi(t.lastChild,n-1)),i=t.contentMatchAt(t.childCount).fillBefore(GK.empty,!0);return t.copy(r.append(i))}function Xo(t,n,r,i,o,a){let u=n<0?t.firstChild:t.lastChild,s=u.content;return t.childCount>1&&(a=0),o<i-1&&(s=Xo(s,n,r,i,o+1,a)),o>=r&&(s=n<0?u.contentMatchAt(0).fillBefore(s,a<=o).append(s):s.append(u.contentMatchAt(u.childCount).fillBefore(GK.empty,!0))),t.replaceChild(n<0?0:t.childCount-1,u.copy(s))}function Xa(t,n,r){return n<t.openStart&&(t=new GQ(Xo(t.content,-1,n,t.openStart,0,t.openEnd),n,t.openEnd)),r<t.openEnd&&(t=new GQ(Xo(t.content,1,r,t.openEnd,0,0),t.openStart,r)),t}let Xu={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},Xs=null;function Xc(){return Xs||(Xs=document.implementation.createHTMLDocument("title"))}let Xl={},Xf={},Xd={touchstart:!0,touchmove:!0};class Xp{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 Xh(t,n){t.input.lastSelectionOrigin=n,t.input.lastSelectionTime=Date.now()}function Xm(t){t.someProp("handleDOMEvents",n=>{for(let r in n)t.input.eventHandlers[r]||t.dom.addEventListener(r,t.input.eventHandlers[r]=n=>Xg(t,n))})}function Xg(t,n){return t.someProp("handleDOMEvents",r=>{let i=r[n.type];return!!i&&(i(t,n)||n.defaultPrevented)})}function Xy(t,n){if(!n.bubbles)return!0;if(n.defaultPrevented)return!1;for(let r=n.target;r!=t.dom;r=r.parentNode)if(!r||11==r.nodeType||r.pmViewDesc&&r.pmViewDesc.stopEvent(n))return!1;return!0}function Xv(t){return{left:t.clientX,top:t.clientY}}function Xb(t,n,r,i,o){if(-1==i)return!1;let a=t.state.doc.resolve(i);for(let u=a.depth+1;u>0;u--)if(t.someProp(n,n=>u>a.depth?n(t,r,a.nodeAfter,a.before(u),o,!0):n(t,r,a.node(u),a.before(u),o,!1)))return!0;return!1}function Xx(t,n,r){t.focused||t.focus();let i=t.state.tr.setSelection(n);"pointer"==r&&i.setMeta("pointer",!0),t.dispatch(i)}function X_(t,n,r,i){return Xb(t,"handleDoubleClickOn",n,r,i)||t.someProp("handleDoubleClick",r=>r(t,n,i))}function XS(t,n,r,i){return Xb(t,"handleTripleClickOn",n,r,i)||t.someProp("handleTripleClick",r=>r(t,n,i))||function(t,n,r){if(0!=r.button)return!1;let i=t.state.doc;if(-1==n)return!!i.inlineContent&&(Xx(t,Yh.create(i,0,i.content.size),"pointer"),!0);let o=i.resolve(n);for(let a=o.depth+1;a>0;a--){let u=a>o.depth?o.nodeAfter:o.node(a),s=o.before(a);if(u.inlineContent)Xx(t,Yh.create(i,s+1,s+1+u.content.size),"pointer");else{if(!Yg.isSelectable(u))continue;Xx(t,Yg.create(i,s),"pointer")}return!0}}(t,r,i)}Xf.keydown=(t,n)=>{if(t.input.shiftKey=16==n.keyCode||n.shiftKey,!XO(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Y6&&Y0&&13==n.keyCode))){if(229!=n.keyCode&&t.domObserver.forceFlush(),!Y3||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)t.someProp("handleKeyDown",r=>r(t,n))||function(t,n){var r;let i,o=n.keyCode,a=(i="",n.ctrlKey&&(i+="c"),n.metaKey&&(i+="m"),n.altKey&&(i+="a"),n.shiftKey&&(i+="s"),i);if(8==o||Y4&&72==o&&"c"==a)return Q9(t,-1)||Q1(t,-1);if(46==o&&!n.shiftKey||Y4&&68==o&&"c"==a)return Q9(t,1)||Q1(t,1);if(13==o||27==o)return!0;if(37==o||Y4&&66==o&&"c"==a){let u=37==o?"ltr"==Q5(t,t.state.selection.from)?-1:1:-1;return QQ(t,u,a)||Q1(t,u)}if(39==o||Y4&&70==o&&"c"==a){let s=39==o?"ltr"==Q5(t,t.state.selection.from)?1:-1:1;return QQ(t,s,a)||Q1(t,s)}return 38==o||Y4&&80==o&&"c"==a?Q6(t,-1,a)||Q1(t,-1):40==o||Y4&&78==o&&"c"==a?function(t){if(!Y2||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:n,focusOffset:r}=t.domSelectionRange();if(n&&1==n.nodeType&&0==r&&n.firstChild&&"false"==n.firstChild.contentEditable){let i=n.firstChild;Q8(t,i,"true"),setTimeout(()=>Q8(t,i,"false"),20)}return!1}(t)||Q6(t,1,a)||Q2(t):a==(Y4?"m":"c")&&(66==o||73==o||89==o||90==o)}(t,n)?n.preventDefault():Xh(t,"key");else{let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",n=>n(t,YB(13,"Enter"))),t.input.lastIOSEnter=0)},200)}}},Xf.keyup=(t,n)=>{16==n.keyCode&&(t.input.shiftKey=!1)},Xf.keypress=(t,n)=>{if(XO(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Y4&&n.metaKey)return;if(t.someProp("handleKeyPress",r=>r(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof Yh)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode);/[\r\n]/.test(i)||t.someProp("handleTextInput",n=>n(t,r.$from.pos,r.$to.pos,i))||t.dispatch(t.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}};let XT=Y4?"metaKey":"ctrlKey";Xl.mousedown=(t,n)=>{var r,i,o;t.input.shiftKey=n.shiftKey;let a=XC(t),u=Date.now(),s="singleClick",c,l;u-t.input.lastClick.time<500&&(c=(o=t.input.lastClick).x-n.clientX,c*c+(l=o.y-n.clientY)*l<100)&&!n[XT]&&("singleClick"==t.input.lastClick.type?s="doubleClick":"doubleClick"==t.input.lastClick.type&&(s="tripleClick")),t.input.lastClick={time:u,x:n.clientX,y:n.clientY,type:s};let f=t.posAtCoords(Xv(n));f&&("singleClick"==s?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new Xw(t,f,n,!!a)):("doubleClick"==s?X_:XS)(t,f.pos,f.inside,n)?n.preventDefault():Xh(t,"pointer"))};class Xw{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[XT],this.allowDefault=r.shiftKey;let o,a;if(n.inside>-1)o=t.state.doc.nodeAt(n.inside),a=n.inside;else{let u=t.state.doc.resolve(n.pos);o=u.parent,a=u.depth?u.before():0}let s=i?null:r.target,c=s?t.docView.nearestDesc(s,!0):null;this.target=c?c.dom:null;let{selection:l}=t.state;(0==r.button&&o.type.spec.draggable&&!1!==o.type.spec.selectable||l instanceof Yg&&l.from<=a&&l.to>a)&&(this.mightDrag={node:o,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&YQ&&!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)),Xh(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(()=>QU(this.view)),this.view.input.mouseDown=null}up(t){var n,r,i,o,a;if(this.done(),!this.view.dom.contains(t.target))return;let u=this.pos;this.view.state.doc!=this.startDoc&&(u=this.view.posAtCoords(Xv(t))),this.updateAllowDefault(t),this.allowDefault||!u?Xh(this.view,"pointer"):(n=this.view,r=u.pos,i=u.inside,a=this.selectNode,Xb(n,"handleClickOn",r,i,t)||n.someProp("handleClick",i=>i(n,r,t))||(a?function(t,n){if(-1==n)return!1;let r=t.state.selection,i,o;r instanceof Yg&&(i=r.node);let a=t.state.doc.resolve(n);for(let u=a.depth+1;u>0;u--){let s=u>a.depth?a.nodeAfter:a.node(u);if(Yg.isSelectable(s)){o=i&&r.$from.depth>0&&u>=r.$from.depth&&a.before(r.$from.depth+1)==r.$from.pos?a.before(r.$from.depth):a.before(u);break}}return null!=o&&(Xx(t,Yg.create(t.state.doc,o),"pointer"),!0)}(n,i):function(t,n){if(-1==n)return!1;let r=t.state.doc.resolve(n),i=r.nodeAfter;return!!(i&&i.isAtom&&Yg.isSelectable(i))&&(Xx(t,new Yg(r),"pointer"),!0)}(n,i)))?t.preventDefault():0==t.button&&(this.flushed||Y2&&this.mightDrag&&!this.mightDrag.node.isAtom||Y0&&!this.view.state.selection.visible&&2>=Math.min(Math.abs(u.pos-this.view.state.selection.from),Math.abs(u.pos-this.view.state.selection.to)))?(Xx(this.view,Yl.near(this.view.state.doc.resolve(u.pos)),"pointer"),t.preventDefault()):Xh(this.view,"pointer")}move(t){this.updateAllowDefault(t),Xh(this.view,"pointer"),0==t.buttons&&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)}}function XO(t,n){return!!t.composing||!!(Y2&&500>Math.abs(n.timeStamp-t.input.compositionEndedAt))&&(t.input.compositionEndedAt=-2e8,!0)}Xl.touchstart=t=>{t.input.lastTouch=Date.now(),XC(t),Xh(t,"pointer")},Xl.touchmove=t=>{t.input.lastTouch=Date.now(),Xh(t,"pointer")},Xl.contextmenu=t=>{var n;return XC(t)};let Xk=Y6?5e3:-1;function XI(t,n){clearTimeout(t.input.composingTimeout),n>-1&&(t.input.composingTimeout=setTimeout(()=>XC(t),n))}function XM(t){let n;for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=(n=document.createEvent("Event"),n.initEvent("event",!0,!0),n.timeStamp));t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function XC(t,n=!1){if(!(Y6&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),XM(t),n||t.docView&&t.docView.dirty){let r=QD(t);return r&&!r.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(r)):t.updateState(t.state),!0}return!1}}Xf.compositionstart=Xf.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:n}=t,r=n.selection.$from;if(n.selection.empty&&(n.storedMarks||!r.textOffset&&r.parentOffset&&r.nodeBefore.marks.some(t=>!1===t.type.spec.inclusive)))t.markCursor=t.state.storedMarks||r.marks(),XC(t,!0),t.markCursor=null;else if(XC(t),YQ&&n.selection.empty&&r.parentOffset&&!r.textOffset&&r.nodeBefore.marks.length){let i=t.domSelectionRange();for(let o=i.focusNode,a=i.focusOffset;o&&1==o.nodeType&&0!=a;){let u=a<0?o.lastChild:o.childNodes[a-1];if(!u)break;if(3==u.nodeType){t.domSelection().collapse(u,u.nodeValue.length);break}o=u,a=-1}}t.input.composing=!0}XI(t,Xk)},Xf.compositionend=(t,n)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=n.timeStamp,t.input.compositionID++,XI(t,20))};let XR=YJ&&YY<15||Y3&&Y8<604;function XE(t,n,r,i,o){var a;let u=Xe(t,n,r,i,t.state.selection.$from);if(t.someProp("handlePaste",n=>n(t,o,u||GQ.empty)))return!0;if(!u)return!1;let s=0==u.openStart&&0==u.openEnd&&1==u.content.childCount?u.content.firstChild:null,c=s?t.state.tr.replaceSelectionWith(s,i):t.state.tr.replaceSelection(u);return t.dispatch(c.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}Xl.copy=Xf.cut=(t,n)=>{let r=t.state.selection,i="cut"==n.type;if(r.empty)return;let o=XR?null:n.clipboardData,{dom:a,text:u}=Q7(t,r.content());o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",u)):function(t,n){if(!t.dom.parentNode)return;let r=t.dom.parentNode.appendChild(document.createElement("div"));r.appendChild(n),r.style.cssText="position: fixed; left: -10000px; top: 10px";let i=getSelection(),o=document.createRange();o.selectNodeContents(n),t.dom.blur(),i.removeAllRanges(),i.addRange(o),setTimeout(()=>{r.parentNode&&r.parentNode.removeChild(r),t.focus()},50)}(t,a),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},Xf.paste=(t,n)=>{if(t.composing&&!Y6)return;let r=XR?null:n.clipboardData,i=t.input.shiftKey&&45!=t.input.lastKeyCode;r&&XE(t,r.getData("text/plain"),r.getData("text/html"),i,n)?n.preventDefault():function(t,n){if(!t.dom.parentNode)return;let r=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,i=t.dom.parentNode.appendChild(document.createElement(r?"textarea":"div"));r||(i.contentEditable="true"),i.style.cssText="position: fixed; left: -10000px; top: 10px",i.focus();let o=t.input.shiftKey&&45!=t.input.lastKeyCode;setTimeout(()=>{t.focus(),i.parentNode&&i.parentNode.removeChild(i),r?XE(t,i.value,null,o,n):XE(t,i.textContent,i.innerHTML,o,n)},50)}(t,n)};class XA{constructor(t,n){this.slice=t,this.move=n}}let Xj=Y4?"altKey":"ctrlKey";for(let XN in Xl.dragstart=(t,n)=>{let r=n,i=t.input.mouseDown;if(i&&i.done(),!r.dataTransfer)return;let o=t.state.selection,a=o.empty?null:t.posAtCoords(Xv(r));if(!(a&&a.pos>=o.from&&a.pos<=(o instanceof Yg?o.to-1:o.to))){if(i&&i.mightDrag)t.dispatch(t.state.tr.setSelection(Yg.create(t.state.doc,i.mightDrag.pos)));else if(r.target&&1==r.target.nodeType){let u=t.docView.nearestDesc(r.target,!0);u&&u.node.type.spec.draggable&&u!=t.docView&&t.dispatch(t.state.tr.setSelection(Yg.create(t.state.doc,u.posBefore)))}}let s=t.state.selection.content(),{dom:c,text:l}=Q7(t,s);r.dataTransfer.clearData(),r.dataTransfer.setData(XR?"Text":"text/html",c.innerHTML),r.dataTransfer.effectAllowed="copyMove",XR||r.dataTransfer.setData("text/plain",l),t.dragging=new XA(s,!r[Xj])},Xl.dragend=t=>{let n=t.dragging;window.setTimeout(()=>{t.dragging==n&&(t.dragging=null)},50)},Xf.dragover=Xf.dragenter=(t,n)=>n.preventDefault(),Xf.drop=(t,n)=>{let r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(Xv(n));if(!i)return;let o=t.state.doc.resolve(i.pos),a=r&&r.slice;a?t.someProp("transformPasted",n=>{a=n(a,t)}):a=Xe(t,n.dataTransfer.getData(XR?"Text":"text/plain"),XR?null:n.dataTransfer.getData("text/html"),!1,o);let u=!!(r&&!n[Xj]);if(t.someProp("handleDrop",r=>r(t,n,a||GQ.empty,u))){n.preventDefault();return}if(!a)return;n.preventDefault();let s=a?function(t,n,r){let i=t.resolve(n);if(!r.content.size)return n;let o=r.content;for(let a=0;a<r.openStart;a++)o=o.firstChild.content;for(let u=1;u<=(0==r.openStart&&r.size?2:1);u++)for(let s=i.depth;s>=0;s--){let c=s==i.depth?0:i.pos<=(i.start(s+1)+i.end(s+1))/2?-1:1,l=i.index(s)+(c>0?1:0),f=i.node(s),d=!1;if(1==u)d=f.canReplace(l,l,o);else{let p=f.contentMatchAt(l).findWrapping(o.firstChild.type);d=p&&f.canReplaceWith(l,l,p[0])}if(d)return 0==c?i.pos:c<0?i.before(s+1):i.after(s+1)}return null}(t.state.doc,o.pos,a):o.pos;null==s&&(s=o.pos);let c=t.state.tr;u&&c.deleteSelection();let l=c.mapping.map(s),f=0==a.openStart&&0==a.openEnd&&1==a.content.childCount,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&&Yg.isSelectable(a.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new Yg(p));else{let h=c.mapping.map(s);c.mapping.maps[c.mapping.maps.length-1].forEach((t,n,r,i)=>h=i),c.setSelection(QH(t,p,c.doc.resolve(h)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))},Xl.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&QU(t)},20))},Xl.blur=(t,n)=>{t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)},Xl.beforeinput=(t,n)=>{if(Y0&&Y6&&"deleteContentBackward"==n.inputType){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",n=>n(t,YB(8,"Backspace")))))return;let{$cursor:n}=t.state.selection;n&&n.pos>0&&t.dispatch(t.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}},Xf)Xl[XN]=Xf[XN];function XP(t,n){if(t==n)return!0;for(let r in t)if(t[r]!==n[r])return!1;for(let i in n)if(!(i in t))return!1;return!0}class XL{constructor(t,n){this.toDOM=t,this.spec=n||Xz,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 XW(o-r,o-r,this)}valid(){return!0}eq(t){return this==t||t instanceof XL&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&XP(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class XF{constructor(t,n){this.attrs=t,this.spec=n||Xz}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 XW(o,a,this)}valid(t,n){return n.from<n.to}eq(t){return this==t||t instanceof XF&&XP(this.attrs,t.attrs)&&XP(this.spec,t.spec)}static is(t){return t.type instanceof XF}destroy(){}}let XD=class t{constructor(t,n){this.attrs=t,this.spec=n||Xz}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 XW(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(n){return this==n||n instanceof t&&XP(this.attrs,n.attrs)&&XP(this.spec,n.spec)}destroy(){}};class XW{constructor(t,n,r){this.from=t,this.to=n,this.type=r}copy(t,n){return new XW(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 XW(t,t,new XL(n,r))}static inline(t,n,r,i){return new XW(t,n,new XF(r,i))}static node(t,n,r,i){return new XW(t,n,new XD(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof XF}}let XU=[],Xz={};class XB{constructor(t,n){this.local=t.length?t:XU,this.children=n.length?n:XU}static create(t,n){return n.length?XZ(n,t,0,Xz):Xq}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 s=0;s<this.children.length;s+=3)if(this.children[s]<n&&this.children[s+1]>t){let c=this.children[s]+1;this.children[s+2].findInner(t-c,n-c,r,i+c,o)}}map(t,n,r){return this==Xq||0==t.maps.length?this:this.mapInner(t,n,0,0,r||Xz)}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?function(t,n,r,i,o,a,u){let s=t.slice();for(let c=0,l=a;c<r.maps.length;c++){let f=0;r.maps[c].forEach((t,n,r,i)=>{let a=i-r-(n-t);for(let u=0;u<s.length;u+=3){let c=s[u+1];if(c<0||t>c+l-f)continue;let d=s[u]+l-f;n>=d?s[u+1]=t<=d?-2:-1:r>=o&&a&&(s[u]+=a,s[u+1]+=a)}f+=a}),l=r.maps[c].map(l,-1)}let d=!1;for(let p=0;p<s.length;p+=3)if(s[p+1]<0){if(-2==s[p+1]){d=!0,s[p+1]=-1;continue}let h=r.map(t[p]+a),m=h-o;if(m<0||m>=i.content.size){d=!0;continue}let g=r.map(t[p+1]+a,-1)-o,{index:y,offset:v}=i.content.findIndex(m),b=i.maybeChild(y);if(b&&v==m&&v+b.nodeSize==g){let x=s[p+2].mapInner(r,b,h+1,t[p]+a+1,u);x!=Xq?(s[p]=m,s[p+1]=g,s[p+2]=x):(s[p+1]=-2,d=!0)}else d=!0}if(d){let _=function(t,n,r,i,o,a,u){function s(t,n){for(let a=0;a<t.local.length;a++){let c=t.local[a].map(i,o,n);c?r.push(c):u.onRemove&&u.onRemove(t.local[a].spec)}for(let l=0;l<t.children.length;l+=3)s(t.children[l+2],t.children[l]+n+1)}for(let c=0;c<t.length;c+=3)-1==t[c+1]&&s(t[c+2],n[c]+a+1);return r}(s,t,n,r,o,a,u),S=XZ(_,i,0,u);n=S.local;for(let T=0;T<s.length;T+=3)s[T+1]<0&&(s.splice(T,3),T-=3);for(let w=0,O=0;w<S.children.length;w+=3){let k=S.children[w];for(;O<s.length&&s[O]<k;)O+=3;s.splice(O,0,S.children[w],S.children[w+1],S.children[w+2])}}return new XB(n.sort(XG),s)}(this.children,a||[],t,n,r,i,o):a?new XB(a.sort(XG),XU):Xq}add(t,n){return n.length?this==Xq?XB.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,o=0;t.forEach((t,a)=>{let u=a+r,s;if(s=XK(n,t,u)){for(i||(i=this.children.slice());o<i.length&&i[o]<a;)o+=3;i[o]==a?i[o+2]=i[o+2].addInner(t,s,u+1):i.splice(o,0,a,a+t.nodeSize,XZ(s,t,u+1,Xz)),o+=3}});let a=X$(o?XH(n):n,-r);for(let u=0;u<a.length;u++)a[u].type.valid(t,a[u])||a.splice(u--,1);return new XB(a.length?this.local.concat(a).sort(XG):this.local,i||this.children)}remove(t){return 0==t.length||this==Xq?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 c=0,l;c<t.length;c++)(l=t[c])&&l.from>u&&l.to<s&&(t[c]=null,(a||(a=[])).push(l));if(!a)continue;r==this.children&&(r=this.children.slice());let f=r[o+2].removeInner(a,u+1);f!=Xq?r[o+2]=f:(r.splice(o,3),o-=3)}if(i.length){for(let d=0,p;d<t.length;d++)if(p=t[d])for(let h=0;h<i.length;h++)i[h].eq(p,n)&&(i==this.local&&(i=this.local.slice()),i.splice(h--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new XB(i,r):Xq}forChild(t,n){if(this==Xq)return this;if(n.isLeaf)return XB.empty;let r,i;for(let o=0;o<this.children.length;o+=3)if(this.children[o]>=t){this.children[o]==t&&(r=this.children[o+2]);break}let a=t+1,u=a+n.content.size;for(let s=0;s<this.local.length;s++){let c=this.local[s];if(c.from<u&&c.to>a&&c.type instanceof XF){let l=Math.max(a,c.from)-a,f=Math.min(u,c.to)-a;l<f&&(i||(i=[])).push(c.copy(l,f))}}if(i){let d=new XB(i.sort(XG),XU);return r?new XV([d,r]):d}return r||Xq}eq(t){if(this==t)return!0;if(!(t instanceof XB)||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 r=0;r<this.children.length;r+=3)if(this.children[r]!=t.children[r]||this.children[r+1]!=t.children[r+1]||!this.children[r+2].eq(t.children[r+2]))return!1;return!0}locals(t){return XJ(this.localsInner(t))}localsInner(t){if(this==Xq)return XU;if(t.inlineContent||!this.local.some(XF.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof XF||n.push(this.local[r]);return n}}XB.empty=new XB([],[]),XB.removeOverlap=XJ;let Xq=XB.empty;class XV{constructor(t){this.members=t}map(t,n){let r=this.members.map(r=>r.map(t,n,Xz));return XV.from(r)}forChild(t,n){if(n.isLeaf)return XB.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(t,n);o!=Xq&&(o instanceof XV?r=r.concat(o.members):r.push(o))}return XV.from(r)}eq(t){if(!(t instanceof XV)||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){r&&(n=n.slice(),r=!1);for(let a=0;a<o.length;a++)n.push(o[a])}else n=o}}return n?XJ(r?n:n.sort(XG)):XU}static from(t){switch(t.length){case 0:return Xq;case 1:return t[0];default:return new XV(t.every(t=>t instanceof XB)?t:t.reduce((t,n)=>t.concat(n instanceof XB?n:n.members),[]))}}}function X$(t,n){if(!n||!t.length)return t;let r=[];for(let i=0;i<t.length;i++){let o=t[i];r.push(new XW(o.from+n,o.to+n,o.type))}return r}function XK(t,n,r){if(n.isLeaf)return null;let i=r+n.nodeSize,o=null;for(let a=0,u;a<t.length;a++)(u=t[a])&&u.from>r&&u.to<i&&((o||(o=[])).push(u),t[a]=null);return o}function XH(t){let n=[];for(let r=0;r<t.length;r++)null!=t[r]&&n.push(t[r]);return n}function XZ(t,n,r,i){let o=[],a=!1;n.forEach((n,u)=>{let s=XK(t,n,u+r);if(s){a=!0;let c=XZ(s,n,r+u+1,i);c!=Xq&&o.push(u,u+n.nodeSize,c)}});let u=X$(a?XH(t):t,-r).sort(XG);for(let s=0;s<u.length;s++)u[s].type.valid(n,u[s])||(i.onRemove&&i.onRemove(u[s].spec),u.splice(s--,1));return u.length||o.length?new XB(u,o):Xq}function XG(t,n){return t.from-n.from||t.to-n.to}function XJ(t){let n=t;for(let r=0;r<n.length-1;r++){let i=n[r];if(i.from!=i.to)for(let o=r+1;o<n.length;o++){let a=n[o];if(a.from==i.from){a.to!=i.to&&(n==t&&(n=t.slice()),n[o]=a.copy(a.from,i.to),XY(n,o+1,a.copy(i.to,a.to)));continue}a.from<i.to&&(n==t&&(n=t.slice()),n[r]=i.copy(i.from,a.from),XY(n,o,i.copy(a.from,i.to)));break}}return n}function XY(t,n,r){for(;n<t.length&&XG(r,t[n])>0;)n++;t.splice(n,0,r)}function XQ(t){let n=[];return t.someProp("decorations",r=>{let i=r(t.state);i&&i!=Xq&&n.push(i)}),t.cursorWrapper&&n.push(XB.create(t.state.doc,[t.cursorWrapper.deco])),XV.from(n)}let XX={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},X0=YJ&&YY<=11;class X1{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 X2{constructor(t,n){this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new X1,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let n=0;n<t.length;n++)this.queue.push(t[n]);YJ&&YY<=11&&t.some(t=>"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length)?this.flushSoon():this.flush()}),X0&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.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,XX)),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(QZ(this.view)){if(this.suppressingSelectionUpdates)return QU(this.view);if(YJ&&YY<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&YL(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 i=t.focusNode;i;i=Yj(i))n.add(i);for(let o=t.anchorNode;o;o=Yj(o))if(n.has(o)){r=o;break}let a=r&&this.view.docView.nearestDesc(r);if(a&&a.ignoreMutation({type:"selection",target:3==r.nodeType?r.parentNode:r}))return this.setCurSelection(),!0}flush(){var t;let{view:n}=this;if(!n.docView||this.flushingSoon>-1)return;let r=this.observer?this.observer.takeRecords():[];this.queue.length&&(r=this.queue.concat(r),this.queue.length=0);let i=n.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(i)&&QZ(n)&&!this.ignoreSelectionChange(i),a=-1,u=-1,s=!1,c=[];if(n.editable)for(let l=0;l<r.length;l++){let f=this.registerMutation(r[l],c);f&&(a=a<0?f.from:Math.min(f.from,a),u=u<0?f.to:Math.max(f.to,u),f.typeOver&&(s=!0))}if(YQ&&c.length>1){let d=c.filter(t=>"BR"==t.nodeName);if(2==d.length){let p=d[0],h=d[1];p.parentNode&&p.parentNode.parentNode==h.parentNode?h.remove():p.remove()}}let m=null;a<0&&o&&n.input.lastFocus>Date.now()-200&&Math.max(n.input.lastTouch,n.input.lastClick.time)<Date.now()-300&&Yz(i)&&(m=QD(n))&&m.eq(Yl.near(n.state.doc.resolve(0),1))?(n.input.lastFocus=0,QU(n),this.currentSelection.set(i),n.scrollToSelection()):(a>-1||o)&&(a>-1&&(n.docView.markDirty(a,u),t=n,X3.has(t)||(X3.set(t,null),-1===["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace))||(t.requiresGeckoHackNode=YQ,X4||(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."),X4=!0))),this.handleDOMChange(a,u,s,c),n.docView&&n.docView.dirty?n.updateState(n.state):this.currentSelection.eq(i)||QU(n),this.currentSelection.set(i))}registerMutation(t,n){if(n.indexOf(t.target)>-1)return null;let r=this.view.docView.nearestDesc(t.target);if("attributes"==t.type&&(r==this.view.docView||"contenteditable"==t.attributeName||"style"==t.attributeName&&!t.oldValue&&!t.target.getAttribute("style"))||!r||r.ignoreMutation(t))return null;if("childList"!=t.type)return"attributes"==t.type?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:{from:r.posAtStart,to:r.posAtEnd,typeOver:t.target.nodeValue==t.oldValue};{for(let i=0;i<t.addedNodes.length;i++)n.push(t.addedNodes[i]);if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(t.target))return{from:r.posBefore,to:r.posAfter};let o=t.previousSibling,a=t.nextSibling;if(YJ&&YY<=11&&t.addedNodes.length)for(let u=0;u<t.addedNodes.length;u++){let{previousSibling:s,nextSibling:c}=t.addedNodes[u];(!s||0>Array.prototype.indexOf.call(t.addedNodes,s))&&(o=s),(!c||0>Array.prototype.indexOf.call(t.addedNodes,c))&&(a=c)}let l=o&&o.parentNode==t.target?YA(o)+1:0,f=r.localPosFromDOM(t.target,l,-1),d=a&&a.parentNode==t.target?YA(a):t.target.childNodes.length,p=r.localPosFromDOM(t.target,d,1);return{from:f,to:p}}}}let X3=new WeakMap,X4=!1;function X5(t){let n=t.pmViewDesc;if(n)return n.parseRule();if("BR"==t.nodeName&&t.parentNode){if(Y2&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let r=document.createElement("div");return r.appendChild(document.createElement("li")),{skip:r}}if(t.parentNode.lastChild==t||Y2&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if("IMG"==t.nodeName&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}let X6=/^(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 X9(t,n,r){return Math.max(r.anchor,r.head)>n.content.size?null:QH(t,n.resolve(r.anchor),n.resolve(r.head))}function X8(t,n,r){let i=t.depth,o=n?t.end():t.pos;for(;i>0&&(n||t.indexAfter(i)==t.node(i).childCount);)i--,o++,n=!1;if(r){let a=t.node(i).maybeChild(t.indexAfter(i));for(;a&&!a.isLeaf;)a=a.firstChild,o++}return o}class X7{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 Xp,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(eei),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):"function"==typeof t?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=een(this),eet(this),this.nodeViews=eer(this),this.docView=QT(this.state.doc,eee(this),XQ(this),this.dom,this),this.domObserver=new X2(this,(t,n,r,i)=>(function(t,n,r,i,o){if(n<0){let a=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,u=QD(t,a);if(u&&!t.state.selection.eq(u)){if(Y0&&Y6&&13===t.input.lastKeyCode&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",n=>n(t,YB(13,"Enter"))))return;let s=t.state.tr.setSelection(u);"pointer"==a?s.setMeta("pointer",!0):"key"==a&&s.scrollIntoView(),t.composing&&s.setMeta("composition",t.input.compositionID),t.dispatch(s)}return}let c=t.state.doc.resolve(n),l=c.sharedDepth(r);n=c.before(l+1),r=t.state.doc.resolve(r).after(l+1);let f=t.state.selection,d=function(t,n,r){let{node:i,fromOffset:o,toOffset:a,from:u,to:s}=t.docView.parseRange(n,r),c=t.domSelectionRange(),l,f=c.anchorNode;if(f&&t.dom.contains(1==f.nodeType?f:f.parentNode)&&(l=[{node:f,offset:c.anchorOffset}],Yz(c)||l.push({node:c.focusNode,offset:c.focusOffset})),Y0&&8===t.input.lastKeyCode)for(let d=a;d>o;d--){let p=i.childNodes[d-1],h=p.pmViewDesc;if("BR"==p.nodeName&&!h){a=d;break}if(!h||h.size)break}let m=t.state.doc,g=t.someProp("domParser")||JS.fromSchema(t.state.schema),y=m.resolve(u),v=null,b=g.parse(i,{topNode:y.parent,topMatch:y.parent.contentMatchAt(y.index()),topOpen:!0,from:o,to:a,preserveWhitespace:"pre"!=y.parent.type.whitespace||"full",findPositions:l,ruleFromNode:X5,context:y});if(l&&null!=l[0].pos){let x=l[0].pos,_=l[1]&&l[1].pos;null==_&&(_=x),v={anchor:x+u,head:_+u}}return{doc:b,sel:v,from:u,to:s}}(t,n,r),p=t.state.doc,h=p.slice(d.from,d.to),m,g;8===t.input.lastKeyCode&&Date.now()-100<t.input.lastKeyCodeTime?(m=t.state.selection.to,g="end"):(m=t.state.selection.from,g="start"),t.input.lastKeyCode=null;let y=function(t,n,r,i,o){let a=t.findDiffStart(n,r);if(null==a)return null;let{a:u,b:s}=t.findDiffEnd(n,r+t.size,r+n.size);if("end"==o){let c=Math.max(0,a-Math.min(u,s));i-=u+c-a}if(u<a&&t.size<n.size){let l=i<=a&&i>=u?a-i:0;a-=l,s=a+(s-u),u=a}else if(s<a){let f=i<=a&&i>=s?a-i:0;a-=f,u=a+(u-s),s=a}return{start:a,endA:u,endB:s}}(h.content,d.doc.content,d.from,m,g);if((Y3&&t.input.lastIOSEnter>Date.now()-225||Y6)&&o.some(t=>1==t.nodeType&&!X6.test(t.nodeName))&&(!y||y.endA>=y.endB)&&t.someProp("handleKeyDown",n=>n(t,YB(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!y){if(i&&f instanceof Yh&&!f.empty&&f.$head.sameParent(f.$anchor)&&!t.composing&&!(d.sel&&d.sel.anchor!=d.sel.head))y={start:f.from,endA:f.to,endB:f.to};else{if(d.sel){let v=X9(t,t.state.doc,d.sel);if(v&&!v.eq(t.state.selection)){let b=t.state.tr.setSelection(v);t.composing&&b.setMeta("composition",t.input.compositionID),t.dispatch(b)}}return}}if(Y0&&t.cursorWrapper&&d.sel&&d.sel.anchor==t.cursorWrapper.deco.from&&d.sel.head==d.sel.anchor){let x=y.endB-y.start;d.sel={anchor:d.sel.anchor+x,head:d.sel.anchor+x}}t.input.domChangeCount++,t.state.selection.from<t.state.selection.to&&y.start==y.endB&&t.state.selection instanceof Yh&&(y.start>t.state.selection.from&&y.start<=t.state.selection.from+2&&t.state.selection.from>=d.from?y.start=t.state.selection.from:y.endA<t.state.selection.to&&y.endA>=t.state.selection.to-2&&t.state.selection.to<=d.to&&(y.endB+=t.state.selection.to-y.endA,y.endA=t.state.selection.to)),YJ&&YY<=11&&y.endB==y.start+1&&y.endA==y.start&&y.start>d.from&&" \xa0"==d.doc.textBetween(y.start-d.from-1,y.start-d.from+1)&&(y.start--,y.endA--,y.endB--);let _=d.doc.resolveNoCache(y.start-d.from),S=d.doc.resolveNoCache(y.endB-d.from),T=p.resolve(y.start),w=_.sameParent(S)&&_.parent.inlineContent&&T.end()>=y.endA,O;if((Y3&&t.input.lastIOSEnter>Date.now()-225&&(!w||o.some(t=>"DIV"==t.nodeName||"P"==t.nodeName))||!w&&_.pos<d.doc.content.size&&!_.sameParent(S)&&(O=Yl.findFrom(d.doc.resolve(_.pos+1),1,!0))&&O.head==S.pos)&&t.someProp("handleKeyDown",n=>n(t,YB(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>y.start&&function(t,n,r,i,o){if(!i.parent.isTextblock||r-n<=o.pos-i.pos||X8(i,!0,!1)<o.pos)return!1;let a=t.resolve(n);if(a.parentOffset<a.parent.content.size||!a.parent.isTextblock)return!1;let u=t.resolve(X8(a,!0,!0));return!(!u.parent.isTextblock||u.pos>r||X8(u,!0,!1)<r)&&i.parent.content.cut(i.parentOffset).eq(u.parent.content)}(p,y.start,y.endA,_,S)&&t.someProp("handleKeyDown",n=>n(t,YB(8,"Backspace")))){Y6&&Y0&&t.domObserver.suppressSelectionUpdates();return}Y0&&Y6&&y.endB==y.start&&(t.input.lastAndroidDelete=Date.now()),Y6&&!w&&_.start()!=S.start()&&0==S.parentOffset&&_.depth==S.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==y.endA&&(y.endB-=2,S=d.doc.resolveNoCache(y.endB-d.from),setTimeout(()=>{t.someProp("handleKeyDown",function(n){return n(t,YB(13,"Enter"))})},20));let k=y.start,I=y.endA,M,C,R;if(w){if(_.pos==S.pos)YJ&&YY<=11&&0==_.parentOffset&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>QU(t),20)),M=t.state.tr.delete(k,I),C=p.resolve(y.start).marksAcross(p.resolve(y.endA));else if(y.endA==y.endB&&(R=function(t,n){let r=t.firstChild.marks,i=n.firstChild.marks,o=r,a=i,u,s,c;for(let l=0;l<i.length;l++)o=i[l].removeFromSet(o);for(let f=0;f<r.length;f++)a=r[f].removeFromSet(a);if(1==o.length&&0==a.length)s=o[0],u="add",c=t=>t.mark(s.addToSet(t.marks));else{if(0!=o.length||1!=a.length)return null;s=a[0],u="remove",c=t=>t.mark(s.removeFromSet(t.marks))}let d=[];for(let p=0;p<n.childCount;p++)d.push(c(n.child(p)));if(GK.from(d).eq(t))return{mark:s,type:u}}(_.parent.content.cut(_.parentOffset,S.parentOffset),T.parent.content.cut(T.parentOffset,y.endA-T.start()))))M=t.state.tr,"add"==R.type?M.addMark(k,I,R.mark):M.removeMark(k,I,R.mark);else if(_.parent.child(_.index()).isText&&_.index()==S.index()-(S.textOffset?0:1)){let E=_.parent.textBetween(_.parentOffset,S.parentOffset);if(t.someProp("handleTextInput",n=>n(t,k,I,E)))return;M=t.state.tr.insertText(E,k,I)}}if(M||(M=t.state.tr.replace(k,I,d.doc.slice(y.start-d.from,y.endB-d.from))),d.sel){let A=X9(t,M.doc,d.sel);A&&!(Y0&&Y6&&t.composing&&A.empty&&(y.start!=y.endB||t.input.lastAndroidDelete<Date.now()-100)&&(A.head==k||A.head==M.mapping.map(I)-1)||YJ&&A.empty&&A.head==k)&&M.setSelection(A)}C&&M.ensureMarks(C),t.composing&&M.setMeta("composition",t.input.compositionID),t.dispatch(M.scrollIntoView())})(this,t,n,r,i)),this.domObserver.start(),function(t){for(let n in Xl){let r=Xl[n];t.dom.addEventListener(n,t.input.eventHandlers[n]=n=>{!Xy(t,n)||Xg(t,n)||!t.editable&&n.type in Xf||r(t,n)},Xd[n]?{passive:!0}:void 0)}Y2&&t.dom.addEventListener("input",()=>null),Xm(t)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;for(let n in this._props={},t)this._props[n]=t[n];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&Xm(this);let n=this._props;this._props=t,t.plugins&&(t.plugins.forEach(eei),this.directPlugins=t.plugins),this.updateStateInner(t.state,n)}setProps(t){let n={};for(let r in this._props)n[r]=this._props[r];for(let i in n.state=this.state,t)n[i]=t[i];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&&(XM(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 u=eer(this);(function(t,n){let r=0,i=0;for(let o in t){if(t[o]!=n[o])return!0;r++}for(let a in n)i++;return r!=i})(u,this.nodeViews)&&(this.nodeViews=u,i=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&Xm(this),this.editable=een(this),eet(this);let s=XQ(this),c=eee(this),l=r.plugins==t.plugins||r.doc.eq(t.doc)?t.scrollToSelection>r.scrollToSelection?"to selection":"preserve":"reset",f=i||!this.docView.matchesNode(t.doc,c,s);(f||!t.selection.eq(r.selection))&&(o=!0);let d="preserve"==l&&o&&null==this.dom.style.overflowAnchor&&function(t){let n=t.dom.getBoundingClientRect(),r=Math.max(0,n.top),i,o;for(let a=(n.left+n.right)/2,u=r+1;u<Math.min(innerHeight,n.bottom);u+=5){let s=t.root.elementFromPoint(a,u);if(!s||s==t.dom||!t.dom.contains(s))continue;let c=s.getBoundingClientRect();if(c.top>=r-20){i=s,o=c.top;break}}return{refDOM:i,refTop:o,stack:Qr(t.dom)}}(this);if(o){var p,h,m;this.domObserver.stop();let g,y=f&&(YJ||Y0)&&!this.composing&&!r.selection.empty&&!t.selection.empty&&(h=r.selection,m=t.selection,g=Math.min(h.$anchor.sharedDepth(h.head),m.$anchor.sharedDepth(m.head)),h.$anchor.start(g)!=m.$anchor.start(g));if(f){let v=Y0?this.trackWrites=this.domSelectionRange().focusNode:null;(i||!this.docView.update(t.doc,c,s,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=QT(t.doc,c,s,this.dom,this)),v&&!this.trackWrites&&(y=!0)}let b,x;y||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&(b=this.docView.domFromPos(this.state.selection.anchor,0),x=this.domSelectionRange(),YL(b.node,b.offset,x.anchorNode,x.anchorOffset)))?QU(this,y):(Q$(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),"reset"==l?this.dom.scrollTop=0:"to selection"==l?this.scrollToSelection():d&&function({refDOM:t,refTop:n,stack:r}){let i=t?t.getBoundingClientRect().top:0;Qi(r,0==i?0:i-n)}(d)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",t=>t(this))){if(this.state.selection instanceof Yg){let n=this.docView.domAfterPos(this.state.selection.from);1==n.nodeType&&Qn(this,n.getBoundingClientRect(),t)}else Qn(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)for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,t)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let i=0;i<this.directPlugins.length;i++){let o=this.directPlugins[i];o.spec.view&&this.pluginViews.push(o.spec.view(this))}for(let a=0;a<this.state.plugins.length;a++){let u=this.state.plugins[a];u.spec.view&&this.pluginViews.push(u.spec.view(this))}}}someProp(t,n){let r=this._props&&this._props[t],i;if(null!=r&&(i=n?n(r):r))return i;for(let o=0;o<this.directPlugins.length;o++){let a=this.directPlugins[o].props[t];if(null!=a&&(i=n?n(a):a))return i}let u=this.state.plugins;if(u)for(let s=0;s<u.length;s++){let c=u[s].props[t];if(null!=c&&(i=n?n(c):c))return i}}hasFocus(){if(YJ){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("false"==t.contentEditable)return!1;t=t.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(t){if(t.setActive)return t.setActive();if(Qo)return t.focus(Qo);let n=Qr(t);t.focus(null==Qo?{get preventScroll(){return Qo={preventScroll:!0},!0}}:void 0),Qo||(Qo=!1,Qi(n,0))}(this.dom),QU(this),this.domObserver.start()}get root(){let t=this._root;if(null==t){for(let n=this.dom.parentNode;n;n=n.parentNode)if(9==n.nodeType||11==n.nodeType&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return t||document}posAtCoords(t){return function(t,n){var r,i;let o=t.dom.ownerDocument,a,u=0,s=Yq(o,n.left,n.top);s&&({node:a,offset:u}=s);let c=(t.root.elementFromPoint?t.root:o).elementFromPoint(n.left,n.top),l;if(!c||!t.dom.contains(1!=c.nodeType?c.parentNode:c)){let f=t.dom.getBoundingClientRect();if(!Qa(n,f)||!(c=function t(n,r,i){let o=n.childNodes.length;if(o&&i.top<i.bottom)for(let a=Math.max(0,Math.min(o-1,Math.floor(o*(r.top-i.top)/(i.bottom-i.top))-2)),u=a;;){let s=n.childNodes[u];if(1==s.nodeType){let c=s.getClientRects();for(let l=0;l<c.length;l++){let f=c[l];if(Qa(r,f))return t(s,r,f)}}if((u=(u+1)%o)==a)break}return n}(t.dom,n,f)))return null}if(Y2)for(let d=c;a&&d;d=Yj(d))d.draggable&&(a=void 0);let p;if(c=(p=(r=c).parentNode)&&/^li$/i.test(p.nodeName)&&n.left<r.getBoundingClientRect().left?p:r,a){if(YQ&&1==a.nodeType&&(u=Math.min(u,a.childNodes.length))<a.childNodes.length){let h=a.childNodes[u],m;"IMG"==h.nodeName&&(m=h.getBoundingClientRect()).right<=n.left&&m.bottom>n.top&&u++}a==t.dom&&u==a.childNodes.length-1&&1==a.lastChild.nodeType&&n.top>a.lastChild.getBoundingClientRect().bottom?l=t.state.doc.content.size:(0==u||1!=a.nodeType||"BR"!=a.childNodes[u-1].nodeName)&&(l=function(t,n,r,i){let o=-1;for(let a=n,u=!1;a!=t.dom;){let s=t.docView.nearestDesc(a,!0);if(!s)return null;if(1==s.dom.nodeType&&(s.node.isBlock&&s.parent&&!u||!s.contentDOM)){let c=s.dom.getBoundingClientRect();if(s.node.isBlock&&s.parent&&!u&&(u=!0,c.left>i.left||c.top>i.top?o=s.posBefore:(c.right<i.left||c.bottom<i.top)&&(o=s.posAfter)),!s.contentDOM&&o<0)return(s.node.isBlock?i.top<(c.top+c.bottom)/2:i.left<(c.left+c.right)/2)?s.posBefore:s.posAfter}a=s.dom.parentNode}return o>-1?o:t.docView.posFromDOM(n,r,-1)}(t,a,u,n))}null==l&&(l=function(t,n,r){let{node:i,offset:o}=function t(n,r){let i,o=2e8,a,u=0,s=r.top,c=r.top,l,f;for(let d=n.firstChild,p=0;d;d=d.nextSibling,p++){let h;if(1==d.nodeType)h=d.getClientRects();else{if(3!=d.nodeType)continue;h=YP(d).getClientRects()}for(let m=0;m<h.length;m++){let g=h[m];if(g.top<=s&&g.bottom>=c){s=Math.max(g.bottom,s),c=Math.min(g.top,c);let y=g.left>r.left?g.left-r.left:g.right<r.left?r.left-g.right:0;if(y<o){i=d,o=y,a=y&&3==i.nodeType?{left:g.right<r.left?g.right:g.left,top:r.top}:r,1==d.nodeType&&y&&(u=p+(r.left>=(g.left+g.right)/2?1:0));continue}}else g.top>r.top&&!l&&g.left<=r.left&&g.right>=r.left&&(l=d,f={left:Math.max(g.left,Math.min(g.right,r.left)),top:g.top});!i&&(r.left>=g.right&&r.top>=g.top||r.left>=g.left&&r.top>=g.bottom)&&(u=p+1)}}return!i&&l&&(i=l,a=f,o=0),i&&3==i.nodeType?function(t,n){let r=t.nodeValue.length,i=document.createRange();for(let o=0;o<r;o++){i.setEnd(t,o+1),i.setStart(t,o);let a=Qs(i,1);if(a.top!=a.bottom&&Qa(n,a))return{node:t,offset:o+(n.left>=(a.left+a.right)/2?1:0)}}return{node:t,offset:0}}(i,a):!i||o&&1==i.nodeType?{node:n,offset:u}:t(i,a)}(n,r),a=-1;if(1==i.nodeType&&!i.firstChild){let u=i.getBoundingClientRect();a=u.left!=u.right&&r.left>(u.left+u.right)/2?1:-1}return t.docView.posFromDOM(i,o,a)}(t,c,n));let g=t.docView.nearestDesc(c,!0);return{pos:l,inside:g?g.posAtStart-g.border:-1}}(this,t)}coordsAtPos(t,n=1){return Ql(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(null==i)throw RangeError("DOM position not inside the editor");return i}endOfTextblock(t,n){var r,i,o,a,u,s;let c,l;return Qm==(i=n||this.state)&&Qg==t?Qy:(Qm=i,Qg=t,Qy="up"==t||"down"==t?(a=this,c=i.selection,l="up"==t?c.$from:c.$to,Qp(a,i,()=>{let{node:n}=a.docView.domFromPos(l.pos,"up"==t?-1:1);for(;;){let r=a.docView.nearestDesc(n,!0);if(!r)break;if(r.node.isBlock){n=r.contentDOM||r.dom;break}n=r.dom.parentNode}let i=Ql(a,l.pos,1);for(let o=n.firstChild;o;o=o.nextSibling){let u;if(1==o.nodeType)u=o.getClientRects();else{if(3!=o.nodeType)continue;u=YP(o,0,o.nodeValue.length).getClientRects()}for(let s=0;s<u.length;s++){let c=u[s];if(c.bottom>c.top+1&&("up"==t?i.top-c.top>(c.bottom-i.top)*2:c.bottom-i.bottom>(i.bottom-c.top)*2))return!1}}return!0})):function(t,n,r){let{$head:i}=n.selection;if(!i.parent.isTextblock)return!1;let o=i.parentOffset,a=o==i.parent.content.size,u=t.domSelection();return Qh.test(i.parent.textContent)&&u.modify?Qp(t,n,()=>{let{focusNode:n,focusOffset:o,anchorNode:a,anchorOffset:s}=t.domSelectionRange(),c=u.caretBidiLevel;u.modify("move",r,"character");let l=i.depth?t.docView.domAfterPos(i.before()):t.dom,{focusNode:f,focusOffset:d}=t.domSelectionRange(),p=f&&!l.contains(1==f.nodeType?f:f.parentNode)||n==f&&o==d;try{u.collapse(a,s),n&&(n!=a||o!=s)&&u.extend&&u.extend(n,o)}catch{}return null!=c&&(u.caretBidiLevel=c),p}):"left"==r||"backward"==r?!o:a}(this,i,t))}pasteHTML(t,n){return XE(this,"",t,!1,n||new ClipboardEvent("paste"))}pasteText(t,n){return XE(this,t,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(function(t){for(let n in t.domObserver.stop(),t.input.eventHandlers)t.dom.removeEventListener(n,t.input.eventHandlers[n]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],XQ(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return null==this.docView}dispatchEvent(t){var n,r;Xg(this,t)||!Xl[t.type]||!this.editable&&t.type in Xf||Xl[t.type](this,t)}dispatch(t){let n=this._props.dispatchTransaction;n?n.call(this,t):this.updateState(this.state.apply(t))}domSelectionRange(){return Y2&&11===this.root.nodeType&&function(t){let n=t.activeElement;for(;n&&n.shadowRoot;)n=n.shadowRoot.activeElement;return n}(this.dom.ownerDocument)==this.dom?function(t){let n;function r(t){t.preventDefault(),t.stopImmediatePropagation(),n=t.getTargetRanges()[0]}t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0);let i=n.startContainer,o=n.startOffset,a=n.endContainer,u=n.endOffset,s=t.domAtPos(t.state.selection.anchor);return YL(s.node,s.offset,a,u)&&([i,o,a,u]=[a,u,i,o]),{anchorNode:i,anchorOffset:o,focusNode:a,focusOffset:u}}(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function eee(t){let n=Object.create(null);return n.class="ProseMirror",n.contenteditable=String(t.editable),t.someProp("attributes",r=>{if("function"==typeof r&&(r=r(t.state)),r)for(let i in r)"class"==i?n.class+=" "+r[i]:"style"==i?n.style=(n.style?n.style+";":"")+r[i]:n[i]||"contenteditable"==i||"nodeName"==i||(n[i]=String(r[i]))}),n.translate||(n.translate="no"),[XW.node(0,t.state.doc.content.size,n)]}function eet(t){if(t.markCursor){let n=document.createElement("img");n.className="ProseMirror-separator",n.setAttribute("mark-placeholder","true"),n.setAttribute("alt",""),t.cursorWrapper={dom:n,deco:XW.widget(t.state.selection.head,n,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function een(t){return!t.someProp("editable",n=>!1===n(t.state))}function eer(t){let n=Object.create(null);function r(t){for(let r in t)Object.prototype.hasOwnProperty.call(n,r)||(n[r]=t[r])}return t.someProp("nodeViews",r),t.someProp("markViews",r),n}function eei(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw RangeError("Plugins passed directly to the view must not have a state component")}for(var eeo={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:"'"},eea={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},eeu="u">typeof navigator&&/Mac/.test(navigator.platform),ees="u">typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),eec=0;eec<10;eec++)eeo[48+eec]=eeo[96+eec]=String(eec);for(var eec=1;eec<=24;eec++)eeo[eec+111]="F"+eec;for(var eec=65;eec<=90;eec++)eeo[eec]=String.fromCharCode(eec+32),eea[eec]=String.fromCharCode(eec);for(var eel in eeo)eea.hasOwnProperty(eel)||(eea[eel]=eeo[eel]);let eef="u">typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function eed(t){let n=t.split(/-(?!$)/),r=n[n.length-1];"Space"==r&&(r=" ");let i,o,a,u;for(let s=0;s<n.length-1;s++){let c=n[s];if(/^(cmd|meta|m)$/i.test(c))u=!0;else if(/^a(lt)?$/i.test(c))i=!0;else if(/^(c|ctrl|control)$/i.test(c))o=!0;else if(/^s(hift)?$/i.test(c))a=!0;else if(/^mod$/i.test(c))eef?u=!0:o=!0;else throw Error("Unrecognized modifier name: "+c)}return i&&(r="Alt-"+r),o&&(r="Ctrl-"+r),u&&(r="Meta-"+r),a&&(r="Shift-"+r),r}function eep(t,n,r=!0){return n.altKey&&(t="Alt-"+t),n.ctrlKey&&(t="Ctrl-"+t),n.metaKey&&(t="Meta-"+t),r&&n.shiftKey&&(t="Shift-"+t),t}let eeh=(t,n)=>!t.selection.empty&&(n&&n(t.tr.deleteSelection().scrollIntoView()),!0),eem=(t,n,r)=>{let i=function(t,n){let{$cursor:r}=t.selection;return r&&(n?n.endOfTextblock("backward",t):!(r.parentOffset>0))?r:null}(t,r);if(!i)return!1;let o=eev(i);if(!o){let a=i.blockRange(),u=a&&JQ(a);return null!=u&&(n&&n(t.tr.lift(a,u).scrollIntoView()),!0)}let s=o.nodeBefore;if(!s.type.spec.isolating&&eeE(t,o,n))return!0;if(0==i.parent.content.size&&(eeg(s,"end")||Yg.isSelectable(s))){let c=J5(t.doc,i.before(),i.after(),GQ.empty);if(c&&c.slice.size<c.to-c.from){if(n){let l=t.tr.step(c);l.setSelection(eeg(s,"end")?Yl.findFrom(l.doc.resolve(l.mapping.map(o.pos,-1)),-1):Yg.create(l.doc,o.pos-s.nodeSize)),n(l.scrollIntoView())}return!0}}return!!s.isAtom&&o.depth==i.depth-1&&(n&&n(t.tr.delete(o.pos-s.nodeSize,o.pos).scrollIntoView()),!0)};function eeg(t,n,r=!1){for(let i=t;i;i="start"==n?i.firstChild:i.lastChild){if(i.isTextblock)return!0;if(r&&1!=i.childCount)break}return!1}let eey=(t,n,r)=>{let{$head:i,empty:o}=t.selection,a=i;if(!o)return!1;if(i.parent.isTextblock){if(r?!r.endOfTextblock("backward",t):i.parentOffset>0)return!1;a=eev(i)}let u=a&&a.nodeBefore;return!!(u&&Yg.isSelectable(u))&&(n&&n(t.tr.setSelection(Yg.create(t.doc,a.pos-u.nodeSize)).scrollIntoView()),!0)};function eev(t){if(!t.parent.type.spec.isolating)for(let n=t.depth-1;n>=0;n--){if(t.index(n)>0)return t.doc.resolve(t.before(n+1));if(t.node(n).type.spec.isolating)break}return null}let eeb=(t,n,r)=>{let i=function(t,n){let{$cursor:r}=t.selection;return r&&(n?n.endOfTextblock("forward",t):!(r.parentOffset<r.parent.content.size))?r:null}(t,r);if(!i)return!1;let o=ee_(i);if(!o)return!1;let a=o.nodeAfter;if(eeE(t,o,n))return!0;if(0==i.parent.content.size&&(eeg(a,"start")||Yg.isSelectable(a))){let u=J5(t.doc,i.before(),i.after(),GQ.empty);if(u&&u.slice.size<u.to-u.from){if(n){let s=t.tr.step(u);s.setSelection(eeg(a,"start")?Yl.findFrom(s.doc.resolve(s.mapping.map(o.pos)),1):Yg.create(s.doc,s.mapping.map(o.pos))),n(s.scrollIntoView())}return!0}}return!!a.isAtom&&o.depth==i.depth-1&&(n&&n(t.tr.delete(o.pos,o.pos+a.nodeSize).scrollIntoView()),!0)},eex=(t,n,r)=>{let{$head:i,empty:o}=t.selection,a=i;if(!o)return!1;if(i.parent.isTextblock){if(r?!r.endOfTextblock("forward",t):i.parentOffset<i.parent.content.size)return!1;a=ee_(i)}let u=a&&a.nodeAfter;return!!(u&&Yg.isSelectable(u))&&(n&&n(t.tr.setSelection(Yg.create(t.doc,a.pos)).scrollIntoView()),!0)};function ee_(t){if(!t.parent.type.spec.isolating)for(let n=t.depth-1;n>=0;n--){let r=t.node(n);if(t.index(n)+1<r.childCount)return t.doc.resolve(t.after(n+1));if(r.type.spec.isolating)break}return null}let eeS=(t,n)=>{let r=t.selection,i=r instanceof Yg,o;if(i){if(r.node.isTextblock||!J2(t.doc,r.from))return!1;o=r.from}else if(null==(o=J4(t.doc,r.from,-1)))return!1;if(n){let a=t.tr.join(o);i&&a.setSelection(Yg.create(a.doc,o-t.doc.resolve(o).nodeBefore.nodeSize)),n(a.scrollIntoView())}return!0},eeT=(t,n)=>{let r=t.selection,i;if(r instanceof Yg){if(r.node.isTextblock||!J2(t.doc,r.to))return!1;i=r.to}else if(null==(i=J4(t.doc,r.to,1)))return!1;return n&&n(t.tr.join(i).scrollIntoView()),!0},eew=(t,n)=>{let{$from:r,$to:i}=t.selection,o=r.blockRange(i),a=o&&JQ(o);return null!=a&&(n&&n(t.tr.lift(o,a).scrollIntoView()),!0)},eeO=(t,n)=>{let{$head:r,$anchor:i}=t.selection;return!!(r.parent.type.spec.code&&r.sameParent(i))&&(n&&n(t.tr.insertText(`
10
+ `).scrollIntoView()),!0)};function eek(t){for(let n=0;n<t.edgeCount;n++){let{type:r}=t.edge(n);if(r.isTextblock&&!r.hasRequiredAttrs())return r}return null}let eeI=(t,n)=>{let{$head:r,$anchor:i}=t.selection;if(!r.parent.type.spec.code||!r.sameParent(i))return!1;let o=r.node(-1),a=r.indexAfter(-1),u=eek(o.contentMatchAt(a));if(!u||!o.canReplaceWith(a,a,u))return!1;if(n){let s=r.after(),c=t.tr.replaceWith(s,s,u.createAndFill());c.setSelection(Yl.near(c.doc.resolve(s),1)),n(c.scrollIntoView())}return!0},eeM=(t,n)=>{let r=t.selection,{$from:i,$to:o}=r;if(r instanceof Yv||i.parent.inlineContent||o.parent.inlineContent)return!1;let a=eek(o.parent.contentMatchAt(o.indexAfter()));if(!a||!a.isTextblock)return!1;if(n){let u=(!i.parentOffset&&o.index()<o.parent.childCount?i:o).pos,s=t.tr.insert(u,a.createAndFill());s.setSelection(Yh.create(s.doc,u+1)),n(s.scrollIntoView())}return!0},eeC=(t,n)=>{let{$cursor:r}=t.selection;if(!r||r.parent.content.size)return!1;if(r.depth>1&&r.after()!=r.end(-1)){let i=r.before();if(J1(t.doc,i))return n&&n(t.tr.split(i).scrollIntoView()),!0}let o=r.blockRange(),a=o&&JQ(o);return null!=a&&(n&&n(t.tr.lift(o,a).scrollIntoView()),!0)},eeR=(t,n)=>{let{$from:r,to:i}=t.selection,o,a=r.sharedDepth(i);return 0!=a&&(o=r.before(a),n&&n(t.tr.setSelection(Yg.create(t.doc,o))),!0)};function eeE(t,n,r){var i,o,a;let u=n.nodeBefore,s=n.nodeAfter,c,l;if(u.type.spec.isolating||s.type.spec.isolating)return!1;let f,d,p;if(f=n.nodeBefore,d=n.nodeAfter,p=n.index(),f&&d&&f.type.compatibleContent(d.type)&&(!f.content.size&&n.parent.canReplace(p-1,p)?(r&&r(t.tr.delete(n.pos-f.nodeSize,n.pos).scrollIntoView()),!0):!!(n.parent.canReplace(p,p+1)&&(d.isTextblock||J2(t.doc,n.pos)))&&(r&&r(t.tr.clearIncompatible(n.pos,f.type,f.contentMatchAt(f.childCount)).join(n.pos).scrollIntoView()),!0)))return!0;let h=n.parent.canReplace(n.index(),n.index()+1);if(h&&(c=(l=u.contentMatchAt(u.childCount)).findWrapping(s.type))&&l.matchType(c[0]||s.type).validEnd){if(r){let m=n.pos+s.nodeSize,g=GK.empty;for(let y=c.length-1;y>=0;y--)g=GK.from(c[y].create(null,g));g=GK.from(u.copy(g));let v=t.tr.step(new JG(n.pos-1,m,n.pos,m,new GQ(g,1,0),c.length,!0)),b=m+2*c.length;J2(v.doc,b)&&v.join(b),r(v.scrollIntoView())}return!0}let x=Yl.findFrom(n,1),_=x&&x.$from.blockRange(x.$to),S=_&&JQ(_);if(null!=S&&S>=n.depth)return r&&r(t.tr.lift(_,S).scrollIntoView()),!0;if(h&&eeg(s,"start",!0)&&eeg(u,"end")){let T=u,w=[];for(;w.push(T),!T.isTextblock;)T=T.lastChild;let O=s,k=1;for(;!O.isTextblock;O=O.firstChild)k++;if(T.canReplace(T.childCount,T.childCount,O.content)){if(r){let I=GK.empty;for(let M=w.length-1;M>=0;M--)I=GK.from(w[M].copy(I));let C=t.tr.step(new JG(n.pos-w.length,n.pos+s.nodeSize,n.pos+k,n.pos+s.nodeSize-k,new GQ(I,w.length,0),0,!0));r(C.scrollIntoView())}return!0}}return!1}function eeA(t){return function(n,r){let i=n.selection,o=t<0?i.$from:i.$to,a=o.depth;for(;o.node(a).isInline;){if(!a)return!1;a--}return!!o.node(a).isTextblock&&(r&&r(n.tr.setSelection(Yh.create(n.doc,t<0?o.start(a):o.end(a)))),!0)}}let eej=eeA(-1),eeN=eeA(1);function eeP(t,n=null){return function(r,i){let o=!1;for(let a=0;a<r.selection.ranges.length&&!o;a++){let{$from:{pos:u},$to:{pos:s}}=r.selection.ranges[a];r.doc.nodesBetween(u,s,(i,a)=>{if(o)return!1;if(!(!i.isTextblock||i.hasMarkup(t,n))){if(i.type==t)o=!0;else{let u=r.doc.resolve(a),s=u.index();o=u.parent.canReplaceWith(s,s+1,t)}}})}if(!o)return!1;if(i){let c=r.tr;for(let l=0;l<r.selection.ranges.length;l++){let{$from:{pos:f},$to:{pos:d}}=r.selection.ranges[l];c.setBlockType(f,d,t,n)}i(c.scrollIntoView())}return!0}}function eeL(t){let{state:n,transaction:r}=t,{selection:i}=r,{doc:o}=r,{storedMarks:a}=r;return{...n,apply:n.apply.bind(n),applyTransaction:n.applyTransaction.bind(n),filterTransaction:n.filterTransaction,plugins:n.plugins,schema:n.schema,reconfigure:n.reconfigure.bind(n),toJSON:n.toJSON.bind(n),get storedMarks(){return a},get selection(){return i},get doc(){return o},get tr(){return i=r.selection,o=r.doc,a=r.storedMarks,r}}}"u">typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"u">typeof os&&os.platform&&os.platform();class eeF{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(){let{rawCommands:t,editor:n,state:r}=this,{view:i}=n,{tr:o}=r,a=this.buildProps(o);return Object.fromEntries(Object.entries(t).map(([t,n])=>[t,(...t)=>{let r=n(...t)(a);return o.getMeta("preventDispatch")||this.hasCustomState||i.dispatch(o),r}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,n=!0){let{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(t=>!0===t)),f={...Object.fromEntries(Object.entries(r).map(([t,r])=>[t,(...t)=>{let i=this.buildProps(c,n),o=r(...t)(i);return u.push(o),f}])),run:l};return f}createCan(t){let{rawCommands:n,state:r}=this,i=t||r.tr,o=this.buildProps(i,!1);return{...Object.fromEntries(Object.entries(n).map(([t,n])=>[t,(...t)=>n(...t)({...o,dispatch:void 0})])),chain:()=>this.createChain(i,!1)}}buildProps(t,n=!0){let{rawCommands:r,editor:i,state:o}=this,{view:a}=i;o.storedMarks&&t.setStoredMarks(o.storedMarks);let u={tr:t,editor:i,view:a,state:eeL({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(([t,n])=>[t,(...t)=>n(...t)(u)]))}};return u}}class eeD{constructor(){this.callbacks={}}on(t,n){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(n),this}emit(t,...n){let r=this.callbacks[t];return r&&r.forEach(t=>t.apply(this,n)),this}off(t,n){let r=this.callbacks[t];return r&&(n?this.callbacks[t]=r.filter(t=>t!==n):delete this.callbacks[t]),this}removeAllListeners(){this.callbacks={}}}function eeW(t,n,r){return void 0===t.config[n]&&t.parent?eeW(t.parent,n,r):"function"==typeof t.config[n]?t.config[n].bind({...r,parent:t.parent?eeW(t.parent,n,r):null}):t.config[n]}function eeU(t){let n=t.filter(t=>"extension"===t.type),r=t.filter(t=>"node"===t.type),i=t.filter(t=>"mark"===t.type);return{baseExtensions:n,nodeExtensions:r,markExtensions:i}}function eez(t){let n=[],{nodeExtensions:r,markExtensions:i}=eeU(t),o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(t=>{let r={name:t.name,options:t.options,storage:t.storage},i=eeW(t,"addGlobalAttributes",r);i&&i().forEach(t=>{t.types.forEach(r=>{Object.entries(t.attributes).forEach(([t,i])=>{n.push({type:r,name:t,attribute:{...o,...i}})})})})}),[...r,...i].forEach(t=>{let r={name:t.name,options:t.options,storage:t.storage},i=eeW(t,"addAttributes",r);if(!i)return;let a=i();Object.entries(a).forEach(([r,i])=>{let a={...o,...i};"function"==typeof(null==a?void 0:a.default)&&(a.default=a.default()),null!=a&&a.isRequired&&(null==a?void 0:a.default)===void 0&&delete a.default,n.push({type:t.name,name:r,attribute:a})})}),n}function eeB(t,n){if("string"==typeof t){if(!n.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return n.nodes[t]}return t}function eeq(...t){return t.filter(t=>!!t).reduce((t,n)=>{let r={...t};return Object.entries(n).forEach(([t,n])=>{if(!r[t]){r[t]=n;return}"class"===t?r[t]=[r[t],n].join(" "):"style"===t?r[t]=[r[t],n].join("; "):r[t]=n}),r},{})}function eeV(t,n){return n.filter(t=>t.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((t,n)=>eeq(t,n),{})}function ee$(t){return"function"==typeof t}function eeK(t,n,...r){return ee$(t)?n?t.bind(n)(...r):t(...r):t}function eeH(t,n){return t.style?t:{...t,getAttrs(r){let i=t.getAttrs?t.getAttrs(r):t.attrs;if(!1===i)return!1;let o=n.reduce((t,n)=>{var i;let o=n.attribute.parseHTML?n.attribute.parseHTML(r):"string"!=typeof(i=r.getAttribute(n.name))?i:i.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(i):"true"===i||"false"!==i&&i;return null==o?t:{...t,[n.name]:o}},{});return{...i,...o}}}}function eeZ(t){return Object.fromEntries(Object.entries(t).filter(([t,n])=>!("attrs"===t&&function(t={}){return 0===Object.keys(t).length&&t.constructor===Object}(n))&&null!=n))}function eeG(t,n){var r;let i=eez(t),{nodeExtensions:o,markExtensions:a}=eeU(t),u=null===(r=o.find(t=>eeW(t,"topNode")))||void 0===r?void 0:r.name,s=Object.fromEntries(o.map(r=>{let o=i.filter(t=>t.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:n},u=t.reduce((t,n)=>{let i=eeW(n,"extendNodeSchema",a);return{...t,...i?i(r):{}}},{}),s=eeZ({...u,content:eeK(eeW(r,"content",a)),marks:eeK(eeW(r,"marks",a)),group:eeK(eeW(r,"group",a)),inline:eeK(eeW(r,"inline",a)),atom:eeK(eeW(r,"atom",a)),selectable:eeK(eeW(r,"selectable",a)),draggable:eeK(eeW(r,"draggable",a)),code:eeK(eeW(r,"code",a)),defining:eeK(eeW(r,"defining",a)),isolating:eeK(eeW(r,"isolating",a)),attrs:Object.fromEntries(o.map(t=>{var n;return[t.name,{default:null===(n=null==t?void 0:t.attribute)||void 0===n?void 0:n.default}]}))}),c=eeK(eeW(r,"parseHTML",a));c&&(s.parseDOM=c.map(t=>eeH(t,o)));let l=eeW(r,"renderHTML",a);l&&(s.toDOM=t=>l({node:t,HTMLAttributes:eeV(t,o)}));let f=eeW(r,"renderText",a);return f&&(s.toText=f),[r.name,s]})),c=Object.fromEntries(a.map(r=>{let o=i.filter(t=>t.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:n},u=t.reduce((t,n)=>{let i=eeW(n,"extendMarkSchema",a);return{...t,...i?i(r):{}}},{}),s=eeZ({...u,inclusive:eeK(eeW(r,"inclusive",a)),excludes:eeK(eeW(r,"excludes",a)),group:eeK(eeW(r,"group",a)),spanning:eeK(eeW(r,"spanning",a)),code:eeK(eeW(r,"code",a)),attrs:Object.fromEntries(o.map(t=>{var n;return[t.name,{default:null===(n=null==t?void 0:t.attribute)||void 0===n?void 0:n.default}]}))}),c=eeK(eeW(r,"parseHTML",a));c&&(s.parseDOM=c.map(t=>eeH(t,o)));let l=eeW(r,"renderHTML",a);return l&&(s.toDOM=t=>l({mark:t,HTMLAttributes:eeV(t,o)})),[r.name,s]}));return new Jx({topNode:u,nodes:s,marks:c})}function eeJ(t,n){return n.nodes[t]||n.marks[t]||null}function eeY(t,n){return Array.isArray(n)?n.some(n=>("string"==typeof n?n:n.name)===t.name):n}let eeQ=(t,n=500)=>{let r="",i=t.parentOffset;return t.parent.nodesBetween(Math.max(0,i-n),i,(t,n,o,a)=>{var u,s;let c=(null===(s=(u=t.type.spec).toText)||void 0===s?void 0:s.call(u,{node:t,pos:n,parent:o,index:a}))||t.textContent||"%leaf%";r+=c.slice(0,Math.max(0,i-n))}),r};function eeX(t){return"[object RegExp]"===Object.prototype.toString.call(t)}class ee0{constructor(t){this.find=t.find,this.handler=t.handler}}let ee1=(t,n)=>{if(eeX(n))return n.exec(t);let r=n(t);if(!r)return null;let i=[r.text];return i.index=r.index,i.input=t,i.data=r.data,r.replaceWith&&(r.text.includes(r.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),i.push(r.replaceWith)),i};function ee2(t){var n;let{editor:r,from:i,to:o,text:a,rules:u,plugin:s}=t,{view:c}=r;if(c.composing)return!1;let l=c.state.doc.resolve(i);if(l.parent.type.spec.code||!(null===(n=l.nodeBefore||l.nodeAfter)||void 0===n)&&n.marks.find(t=>t.type.spec.code))return!1;let f=!1,d=eeQ(l)+a;return u.forEach(t=>{if(f)return;let n=ee1(d,t.find);if(!n)return;let u=c.state.tr,l=eeL({state:c.state,transaction:u}),p={from:i-(n[0].length-a.length),to:o},{commands:h,chain:m,can:g}=new eeF({editor:r,state:l});null!==t.handler({state:l,range:p,match:n,commands:h,chain:m,can:g})&&u.steps.length&&(u.setMeta(s,{transform:u,from:i,to:o,text:a}),c.dispatch(u),f=!0)}),f}class ee3{constructor(t){this.find=t.find,this.handler=t.handler}}let ee4=(t,n)=>{if(eeX(n))return[...t.matchAll(n)];let r=n(t);return r?r.map(n=>{let r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),r.push(n.replaceWith)),r}):[]};class ee5{constructor(t,n){this.splittableMarks=[],this.editor=n,this.extensions=ee5.resolve(t),this.schema=eeG(this.extensions,n),this.extensions.forEach(t=>{var n;this.editor.extensionStorage[t.name]=t.storage;let r={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:eeJ(t.name,this.schema)};"mark"===t.type&&(!(null!==(n=eeK(eeW(t,"keepOnSplit",r)))&&void 0!==n)||n)&&this.splittableMarks.push(t.name);let i=eeW(t,"onBeforeCreate",r);i&&this.editor.on("beforeCreate",i);let o=eeW(t,"onCreate",r);o&&this.editor.on("create",o);let a=eeW(t,"onUpdate",r);a&&this.editor.on("update",a);let u=eeW(t,"onSelectionUpdate",r);u&&this.editor.on("selectionUpdate",u);let s=eeW(t,"onTransaction",r);s&&this.editor.on("transaction",s);let c=eeW(t,"onFocus",r);c&&this.editor.on("focus",c);let l=eeW(t,"onBlur",r);l&&this.editor.on("blur",l);let f=eeW(t,"onDestroy",r);f&&this.editor.on("destroy",f)})}static resolve(t){let n=ee5.sort(ee5.flatten(t)),r=function(t){let n=t.filter((n,r)=>t.indexOf(n)!==r);return[...new Set(n)]}(n.map(t=>t.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(t=>`'${t}'`).join(", ")}]. This can lead to issues.`),n}static flatten(t){return t.map(t=>{let n={name:t.name,options:t.options,storage:t.storage},r=eeW(t,"addExtensions",n);return r?[t,...this.flatten(r())]:t}).flat(10)}static sort(t){return t.sort((t,n)=>{let r=eeW(t,"priority")||100,i=eeW(n,"priority")||100;return r>i?-1:r<i?1:0})}get commands(){return this.extensions.reduce((t,n)=>{let r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:eeJ(n.name,this.schema)},i=eeW(n,"addCommands",r);return i?{...t,...i()}:t},{})}get plugins(){let{editor:t}=this,n=ee5.sort([...this.extensions].reverse()),r=[],i=[],o=n.map(n=>{var o,a;let u={name:n.name,options:n.options,storage:n.storage,editor:t,type:eeJ(n.name,this.schema)},s=[],c=eeW(n,"addKeyboardShortcuts",u),l={};if("mark"===n.type&&n.config.exitable&&(l.ArrowRight=()=>enR.handleExit({editor:t,mark:n})),c){let f=Object.fromEntries(Object.entries(c()).map(([n,r])=>[n,()=>r({editor:t})]));l={...l,...f}}let d,p=(o=l,new YM({props:{handleKeyDown:(a=o,d=function(t){let n=Object.create(null);for(let r in t)n[eed(r)]=t[r];return n}(a),function(t,n){var r,i;let o=("Esc"==(i=!(eeu&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||ees&&n.shiftKey&&n.key&&1==n.key.length||"Unidentified"==n.key)&&n.key||(n.shiftKey?eea:eeo)[n.keyCode]||n.key||"Unidentified")&&(i="Escape"),"Del"==i&&(i="Delete"),"Left"==i&&(i="ArrowLeft"),"Up"==i&&(i="ArrowUp"),"Right"==i&&(i="ArrowRight"),"Down"==i&&(i="ArrowDown"),i),a,u=d[eep(o,n)];if(u&&u(t.state,t.dispatch,t))return!0;if(1==o.length&&" "!=o){if(n.shiftKey){let s=d[eep(o,n,!1)];if(s&&s(t.state,t.dispatch,t))return!0}if((n.shiftKey||n.altKey||n.metaKey||o.charCodeAt(0)>127)&&(a=eeo[n.keyCode])&&a!=o){let c=d[eep(a,n)];if(c&&c(t.state,t.dispatch,t))return!0}}return!1})}}));s.push(p);let h=eeW(n,"addInputRules",u);eeY(n,t.options.enableInputRules)&&h&&r.push(...h());let m=eeW(n,"addPasteRules",u);eeY(n,t.options.enablePasteRules)&&m&&i.push(...m());let g=eeW(n,"addProseMirrorPlugins",u);if(g){let y=g();s.push(...y)}return s}).flat();return[function(t){let{editor:n,rules:r}=t,i=new YM({state:{init:()=>null,apply(t,n){let r=t.getMeta(i);return r||(t.selectionSet||t.docChanged?null:n)}},props:{handleTextInput:(t,o,a,u)=>ee2({editor:n,from:o,to:a,text:u,rules:r,plugin:i}),handleDOMEvents:{compositionend:t=>(setTimeout(()=>{let{$cursor:o}=t.state.selection;o&&ee2({editor:n,from:o.pos,to:o.pos,text:"",rules:r,plugin:i})}),!1)},handleKeyDown(t,o){if("Enter"!==o.key)return!1;let{$cursor:a}=t.state.selection;return!!a&&ee2({editor:n,from:a.pos,to:a.pos,text:`
11
+ `,rules:r,plugin:i})}},isInputRules:!0});return i}({editor:t,rules:r}),...function(t){let{editor:n,rules:r}=t,i=null,o=!1,a=!1;return r.map(t=>new YM({view(t){let n=n=>{var r;i=!(null===(r=t.dom.parentElement)||void 0===r)&&r.contains(n.target)?t.dom.parentElement:null};return window.addEventListener("dragstart",n),{destroy(){window.removeEventListener("dragstart",n)}}},props:{handleDOMEvents:{drop:t=>(a=i===t.dom.parentElement,!1),paste(t,n){var r;let i=null===(r=n.clipboardData)||void 0===r?void 0:r.getData("text/html");return o=!!(null!=i&&i.includes("data-pm-slice")),!1}}},appendTransaction(r,i,u){var s;let c=r[0],l="paste"===c.getMeta("uiEvent")&&!o,f="drop"===c.getMeta("uiEvent")&&!a;if(!l&&!f)return;let d=i.doc.content.findDiffStart(u.doc.content),p=i.doc.content.findDiffEnd(u.doc.content);if("number"!=typeof d||!p||d===p.b)return;let h=u.tr,m=eeL({state:u,transaction:h});if(!(!function(t){let{editor:n,state:r,from:i,to:o,rule:a}=t,{commands:u,chain:s,can:c}=new eeF({editor:n,state:r}),l=[];return r.doc.nodesBetween(i,o,(t,n)=>{if(!t.isTextblock||t.type.spec.code)return;let f=Math.max(i,n),d=Math.min(o,n+t.content.size),p=t.textBetween(f-n,d-n,void 0,"");ee4(p,a.find).forEach(t=>{if(void 0===t.index)return;let n=f+t.index+1,i=n+t[0].length,o={from:r.tr.mapping.map(n),to:r.tr.mapping.map(i)},d=a.handler({state:r,range:o,match:t,commands:u,chain:s,can:c});l.push(d)})}),l.every(t=>null!==t)}({editor:n,state:m,from:Math.max(d-1,0),to:p.b-1,rule:t})||!h.steps.length))return h}}))}({editor:t,rules:i}),...o]}get attributes(){return eez(this.extensions)}get nodeViews(){let{editor:t}=this,{nodeExtensions:n}=eeU(this.extensions);return Object.fromEntries(n.filter(t=>!!eeW(t,"addNodeView")).map(n=>{let r=this.attributes.filter(t=>t.type===n.name),i={name:n.name,options:n.options,storage:n.storage,editor:t,type:eeB(n.name,this.schema)},o=eeW(n,"addNodeView",i);if(!o)return[];let a=(i,a,u,s)=>{let c=eeV(i,r);return o()({editor:t,node:i,getPos:u,decorations:s,HTMLAttributes:c,extension:n})};return[n.name,a]}))}}function ee6(t){var n;return"Object"===Object.prototype.toString.call(t).slice(8,-1)&&t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function ee9(t,n){let r={...t};return ee6(t)&&ee6(n)&&Object.keys(n).forEach(i=>{ee6(n[i])&&i in t?r[i]=ee9(t[i],n[i]):Object.assign(r,{[i]:n[i]})}),r}class ee8{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=eeK(eeW(this,"addOptions",{name:this.name}))),this.storage=eeK(eeW(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new ee8(t)}configure(t={}){let n=this.extend();return n.options=ee9(this.options,t),n.storage=eeK(eeW(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){let n=new ee8(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=eeK(eeW(n,"addOptions",{name:n.name})),n.storage=eeK(eeW(n,"addStorage",{name:n.name,options:n.options})),n}}function ee7(t,n,r){let{from:i,to:o}=n,{blockSeparator:a=`
12
+
13
+ `,textSerializers:u={}}=r||{},s="",c=!0;return t.nodesBetween(i,o,(t,r,l,f)=>{var d;let p=null==u?void 0:u[t.type.name];p?(t.isBlock&&!c&&(s+=a,c=!0),l&&(s+=p({node:t,pos:r,parent:l,index:f,range:n}))):t.isText?(s+=null===(d=null==t?void 0:t.text)||void 0===d?void 0:d.slice(Math.max(i,r)-r,o-r),c=!1):t.isBlock&&!c&&(s+=a,c=!0)}),s}function ete(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}let ett=ee8.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new YM({key:new YE("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{let{editor:t}=this,{state:n,schema:r}=t,{doc:i,selection:o}=n,{ranges:a}=o,u=Math.min(...a.map(t=>t.$from.pos)),s=Math.max(...a.map(t=>t.$to.pos)),c=ete(r);return ee7(i,{from:u,to:s},{textSerializers:c})}}})]}}),etn=()=>({editor:t,view:n})=>(requestAnimationFrame(()=>{var r;t.isDestroyed||(n.dom.blur(),null===(r=null==window?void 0:window.getSelection())||void 0===r||r.removeAllRanges())}),!0),etr=(t=!1)=>({commands:n})=>n.setContent("",t),eti=()=>({state:t,tr:n,dispatch:r})=>{let{selection:i}=n,{ranges:o}=i;return r&&o.forEach(({$from:r,$to:i})=>{t.doc.nodesBetween(r.pos,i.pos,(t,r)=>{if(t.type.isText)return;let{doc:i,mapping:o}=n,a=i.resolve(o.map(r)),u=i.resolve(o.map(r+t.nodeSize)),s=a.blockRange(u);if(!s)return;let c=JQ(s);if(t.type.isTextblock){let{defaultType:l}=a.parent.contentMatchAt(a.index());n.setNodeMarkup(s.start,l)}(c||0===c)&&n.lift(s,c)})}),!0},eto=t=>n=>t(n),eta=()=>({state:t,dispatch:n})=>eeM(t,n),etu=()=>({tr:t,dispatch:n})=>{let{selection:r}=t,i=r.$anchor.node();if(i.content.size>0)return!1;let o=t.selection.$anchor;for(let a=o.depth;a>0;a-=1)if(o.node(a).type===i.type){if(n){let u=o.before(a),s=o.after(a);t.delete(u,s).scrollIntoView()}return!0}return!1},ets=t=>({tr:n,state:r,dispatch:i})=>{let o=eeB(t,r.schema),a=n.selection.$anchor;for(let u=a.depth;u>0;u-=1)if(a.node(u).type===o){if(i){let s=a.before(u),c=a.after(u);n.delete(s,c).scrollIntoView()}return!0}return!1},etc=t=>({tr:n,dispatch:r})=>{let{from:i,to:o}=t;return r&&n.delete(i,o),!0},etl=()=>({state:t,dispatch:n})=>eeh(t,n),etf=()=>({commands:t})=>t.keyboardShortcut("Enter"),etd=()=>({state:t,dispatch:n})=>eeI(t,n);function etp(t,n,r={strict:!0}){let i=Object.keys(n);return!i.length||i.every(i=>r.strict?n[i]===t[i]:eeX(n[i])?n[i].test(t[i]):n[i]===t[i])}function eth(t,n,r={}){return t.find(t=>t.type===n&&etp(t.attrs,r))}function etm(t,n,r={}){return!!eth(t,n,r)}function etg(t,n,r={}){if(!t||!n)return;let i=t.parent.childAfter(t.parentOffset);if(t.parentOffset===i.offset&&0!==i.offset&&(i=t.parent.childBefore(t.parentOffset)),!i.node)return;let o=eth([...i.node.marks],n,r);if(!o)return;let a=i.index,u=t.start()+i.offset,s=a+1,c=u+i.node.nodeSize;for(eth([...i.node.marks],n,r);a>0&&o.isInSet(t.parent.child(a-1).marks);)a-=1,u-=t.parent.child(a).nodeSize;for(;s<t.parent.childCount&&etm([...t.parent.child(s).marks],n,r);)c+=t.parent.child(s).nodeSize,s+=1;return{from:u,to:c}}function ety(t,n){if("string"==typeof t){if(!n.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return n.marks[t]}return t}let etv=(t,n={})=>({tr:r,state:i,dispatch:o})=>{let a=ety(t,i.schema),{doc:u,selection:s}=r,{$from:c,from:l,to:f}=s;if(o){let d=etg(c,a,n);if(d&&d.from<=l&&d.to>=f){let p=Yh.create(u,d.from,d.to);r.setSelection(p)}}return!0},etb=t=>n=>{let r="function"==typeof t?t(n):t;for(let i=0;i<r.length;i+=1)if(r[i](n))return!0;return!1};function etx(t){return t instanceof Yh}function et_(t=0,n=0,r=0){return Math.min(Math.max(t,n),r)}function etS(t,n=null){if(!n)return null;let r=Yl.atStart(t),i=Yl.atEnd(t);if("start"===n||!0===n)return r;if("end"===n)return i;let o=r.from,a=i.to;return"all"===n?Yh.create(t,et_(0,o,a),et_(t.content.size,o,a)):Yh.create(t,et_(n,o,a),et_(n,o,a))}function etT(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}let etw=(t=null,n={})=>({editor:r,view:i,tr:o,dispatch:a})=>{n={scrollIntoView:!0,...n};let u=()=>{etT()&&i.dom.focus(),requestAnimationFrame(()=>{r.isDestroyed||(i.focus(),null!=n&&n.scrollIntoView&&r.commands.scrollIntoView())})};if(i.hasFocus()&&null===t||!1===t)return!0;if(a&&null===t&&!etx(r.state.selection))return u(),!0;let s=etS(o.doc,t)||r.state.selection,c=r.state.selection.eq(s);return a&&(c||o.setSelection(s),c&&o.storedMarks&&o.setStoredMarks(o.storedMarks),u()),!0},etO=(t,n)=>r=>t.every((t,i)=>n(t,{...r,index:i})),etk=(t,n)=>({tr:r,commands:i})=>i.insertContentAt({from:r.selection.from,to:r.selection.to},t,n);function etI(t){let n=`<body>${t}</body>`;return new window.DOMParser().parseFromString(n,"text/html").body}function etM(t,n,r){if(r={slice:!0,parseOptions:{},...r},"object"==typeof t&&null!==t)try{return Array.isArray(t)&&t.length>0?GK.fromArray(t.map(t=>n.nodeFromJSON(t))):n.nodeFromJSON(t)}catch(i){return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",i),etM("",n,r)}if("string"==typeof t){let o=JS.fromSchema(n);return r.slice?o.parseSlice(etI(t),r.parseOptions).content:o.parse(etI(t),r.parseOptions)}return etM("",n,r)}let etC=t=>t.toString().startsWith("<"),etR=(t,n,r)=>({tr:i,dispatch:o,editor:a})=>{if(o){r={parseOptions:{},updateSelection:!0,...r};let u=etM(n,a.schema,{parseOptions:{preserveWhitespace:"full",...r.parseOptions}});if("<>"===u.toString())return!0;let{from:s,to:c}="number"==typeof t?{from:t,to:t}:t,l=!0,f=!0;if((etC(u)?u:[u]).forEach(t=>{t.check(),l=!!l&&t.isText&&0===t.marks.length,f=!!f&&t.isBlock}),s===c&&f){let{parent:d}=i.doc.resolve(s);!d.isTextblock||d.type.spec.code||d.childCount||(s-=1,c+=1)}l?Array.isArray(n)?i.insertText(n.map(t=>t.text||"").join(""),s,c):"object"==typeof n&&n&&n.text?i.insertText(n.text,s,c):i.insertText(n,s,c):i.replaceWith(s,c,u),r.updateSelection&&function(t,n,r){let i=t.steps.length-1;if(i<n)return;let o=t.steps[i];if(!(o instanceof JZ||o instanceof JG))return;let a=t.mapping.maps[i],u=0;a.forEach((t,n,r,i)=>{0===u&&(u=i)}),t.setSelection(Yl.near(t.doc.resolve(u),-1))}(i,i.steps.length-1,-1)}return!0},etE=()=>({state:t,dispatch:n})=>eeS(t,n),etA=()=>({state:t,dispatch:n})=>eeT(t,n),etj=()=>({state:t,dispatch:n})=>eem(t,n),etN=()=>({state:t,dispatch:n})=>eeb(t,n);function etP(){return"u">typeof navigator&&/Mac/.test(navigator.platform)}let etL=t=>({editor:n,view:r,tr:i,dispatch:o})=>{let a=(function(t){let n=t.split(/-(?!$)/),r=n[n.length-1];"Space"===r&&(r=" ");let i,o,a,u;for(let s=0;s<n.length-1;s+=1){let c=n[s];if(/^(cmd|meta|m)$/i.test(c))u=!0;else if(/^a(lt)?$/i.test(c))i=!0;else if(/^(c|ctrl|control)$/i.test(c))o=!0;else if(/^s(hift)?$/i.test(c))a=!0;else if(/^mod$/i.test(c))etT()||etP()?u=!0:o=!0;else throw Error(`Unrecognized modifier name: ${c}`)}return i&&(r=`Alt-${r}`),o&&(r=`Ctrl-${r}`),u&&(r=`Meta-${r}`),a&&(r=`Shift-${r}`),r})(t).split(/-(?!$)/),u=a.find(t=>!["Alt","Ctrl","Meta","Shift"].includes(t)),s=new KeyboardEvent("keydown",{key:"Space"===u?" ":u,altKey:a.includes("Alt"),ctrlKey:a.includes("Ctrl"),metaKey:a.includes("Meta"),shiftKey:a.includes("Shift"),bubbles:!0,cancelable:!0}),c=n.captureTransaction(()=>{r.someProp("handleKeyDown",t=>t(r,s))});return null==c||c.steps.forEach(t=>{let n=t.map(i.mapping);n&&o&&i.maybeStep(n)}),!0};function etF(t,n,r={}){let{from:i,to:o,empty:a}=t.selection,u=n?eeB(n,t.schema):null,s=[];t.doc.nodesBetween(i,o,(t,n)=>{if(t.isText)return;let r=Math.min(o,n+t.nodeSize);s.push({node:t,from:Math.max(i,n),to:r})});let c=s.filter(t=>!u||u.name===t.node.type.name).filter(t=>etp(t.node.attrs,r,{strict:!1}));return a?!!c.length:c.reduce((t,n)=>t+n.to-n.from,0)>=o-i}let etD=(t,n={})=>({state:r,dispatch:i})=>{let o=eeB(t,r.schema);return!!etF(r,o,n)&&eew(r,i)},etW=()=>({state:t,dispatch:n})=>eeC(t,n),etU=t=>({state:n,dispatch:r})=>{var i;let o=eeB(t,n.schema);return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==o);return!!a&&(!n||(r.node(a.depth-1).type==o?function(t,n,r,i){let o=t.tr,a=i.end,u=i.$to.end(i.depth);a<u&&(o.step(new JG(a-1,u,a,u,new GQ(GK.from(r.create(null,i.parent.copy())),1,0),1,!0)),i=new G7(o.doc.resolve(i.$from.pos),o.doc.resolve(u),i.depth));let s=JQ(i);if(null==s)return!1;o.lift(i,s);let c=o.mapping.map(a,-1)-1;return J2(o.doc,c)&&o.join(c),n(o.scrollIntoView()),!0}(t,n,o,a):function(t,n,r){let i=t.tr,o=r.parent;for(let a=r.end,u=r.endIndex-1,s=r.startIndex;u>s;u--)a-=o.child(u).nodeSize,i.delete(a-1,a+1);let c=i.doc.resolve(r.start),l=c.nodeAfter;if(i.mapping.map(r.end)!=r.start+c.nodeAfter.nodeSize)return!1;let f=0==r.startIndex,d=r.endIndex==o.childCount,p=c.node(-1),h=c.index(-1);if(!p.canReplace(h+(f?0:1),h+1,l.content.append(d?GK.empty:GK.from(o))))return!1;let m=c.pos,g=m+l.nodeSize;return i.step(new JG(m-(f?1:0),g+(d?1:0),m+1,g-1,new GQ((f?GK.empty:GK.from(o.copy(GK.empty))).append(d?GK.empty:GK.from(o.copy(GK.empty))),f?0:1,d?0:1),f?0:1)),n(i.scrollIntoView()),!0}(t,n,a)))}(n,r)},etz=()=>({state:t,dispatch:n})=>eeO(t,n);function etB(t,n){return n.nodes[t]?"node":n.marks[t]?"mark":null}function etq(t,n){let r="string"==typeof n?[n]:n;return Object.keys(t).reduce((n,i)=>(r.includes(i)||(n[i]=t[i]),n),{})}let etV=(t,n)=>({tr:r,state:i,dispatch:o})=>{let a=null,u=null,s=etB("string"==typeof t?t:t.name,i.schema);return!!s&&("node"===s&&(a=eeB(t,i.schema)),"mark"===s&&(u=ety(t,i.schema)),o&&r.selection.ranges.forEach(t=>{i.doc.nodesBetween(t.$from.pos,t.$to.pos,(t,i)=>{a&&a===t.type&&r.setNodeMarkup(i,void 0,etq(t.attrs,n)),u&&t.marks.length&&t.marks.forEach(o=>{u===o.type&&r.addMark(i,i+t.nodeSize,u.create(etq(o.attrs,n)))})})}),!0)},et$=()=>({tr:t,dispatch:n})=>(n&&t.scrollIntoView(),!0),etK=()=>({tr:t,commands:n})=>n.setTextSelection({from:0,to:t.doc.content.size}),etH=()=>({state:t,dispatch:n})=>eey(t,n),etZ=()=>({state:t,dispatch:n})=>eex(t,n),etG=()=>({state:t,dispatch:n})=>eeR(t,n),etJ=()=>({state:t,dispatch:n})=>eeN(t,n),etY=()=>({state:t,dispatch:n})=>eej(t,n);function etQ(t,n,r={}){return etM(t,n,{slice:!1,parseOptions:r})}let etX=(t,n=!1,r={})=>({tr:i,editor:o,dispatch:a})=>{let{doc:u}=i,s=etQ(t,o.schema,r);return a&&i.replaceWith(0,u.content.size,s).setMeta("preventUpdate",!n),!0};function et0(t){return n=>(function(t,n){for(let r=t.depth;r>0;r-=1){let i=t.node(r);if(n(i))return{pos:r>0?t.before(r):0,start:t.start(r),depth:r,node:i}}})(n.$from,t)}function et1(t,n){let r=ety(n,t.schema),{from:i,to:o,empty:a}=t.selection,u=[];a?(t.storedMarks&&u.push(...t.storedMarks),u.push(...t.selection.$head.marks())):t.doc.nodesBetween(i,o,t=>{u.push(...t.marks)});let s=u.find(t=>t.type.name===r.name);return s?{...s.attrs}:{}}function et2(t,n){let r=etB("string"==typeof n?n:n.name,t.schema);return"node"===r?function(t,n){let r=eeB(n,t.schema),{from:i,to:o}=t.selection,a=[];t.doc.nodesBetween(i,o,t=>{a.push(t)});let u=a.reverse().find(t=>t.type.name===r.name);return u?{...u.attrs}:{}}(t,n):"mark"===r?et1(t,n):{}}function et3(t,n,r){let i=[];return t===n?r.resolve(t).marks().forEach(n=>{let o=r.resolve(t-1),a=etg(o,n.type);a&&i.push({mark:n,...a})}):r.nodesBetween(t,n,(t,n)=>{i.push(...t.marks.map(r=>({from:n,to:n+t.nodeSize,mark:r})))}),i}function et4(t,n,r){return Object.fromEntries(Object.entries(r).filter(([r])=>{let i=t.find(t=>t.type===n&&t.name===r);return!!i&&i.attribute.keepOnSplit}))}function et5(t,n,r={}){let{empty:i,ranges:o}=t.selection,a=n?ety(n,t.schema):null;if(i)return!!(t.storedMarks||t.selection.$from.marks()).filter(t=>!a||a.name===t.type.name).find(t=>etp(t.attrs,r,{strict:!1}));let u=0,s=[];if(o.forEach(({$from:n,$to:r})=>{let i=n.pos,o=r.pos;t.doc.nodesBetween(i,o,(t,n)=>{if(!t.isText&&!t.marks.length)return;let r=Math.max(i,n),a=Math.min(o,n+t.nodeSize);u+=a-r,s.push(...t.marks.map(t=>({mark:t,from:r,to:a})))})}),0===u)return!1;let c=s.filter(t=>!a||a.name===t.mark.type.name).filter(t=>etp(t.mark.attrs,r,{strict:!1})).reduce((t,n)=>t+n.to-n.from,0),l=s.filter(t=>!a||t.mark.type!==a&&t.mark.type.excludes(a)).reduce((t,n)=>t+n.to-n.from,0);return(c>0?c+l:c)>=u}function et6(t,n){let{nodeExtensions:r}=eeU(n),i=r.find(n=>n.name===t);if(!i)return!1;let o={name:i.name,options:i.options,storage:i.storage},a=eeK(eeW(i,"group",o));return"string"==typeof a&&a.split(" ").includes("list")}let et9=(t,n={})=>({tr:r,state:i,dispatch:o})=>{let{selection:a}=r,{empty:u,ranges:s}=a,c=ety(t,i.schema);if(o){if(u){let l=et1(i,c);r.addStoredMark(c.create({...l,...n}))}else s.forEach(t=>{let o=t.$from.pos,a=t.$to.pos;i.doc.nodesBetween(o,a,(t,i)=>{let u=Math.max(i,o),s=Math.min(i+t.nodeSize,a);t.marks.find(t=>t.type===c)?t.marks.forEach(t=>{c===t.type&&r.addMark(u,s,c.create({...t.attrs,...n}))}):r.addMark(u,s,c.create(n))})})}return function(t,n,r){var i;let{selection:o}=n,a=null;if(etx(o)&&(a=o.$cursor),a){let u=null!==(i=t.storedMarks)&&void 0!==i?i:a.marks();return!!r.isInSet(u)||!u.some(t=>t.type.excludes(r))}let{ranges:s}=o;return s.some(({$from:n,$to:i})=>{let o=0===n.depth&&t.doc.inlineContent&&t.doc.type.allowsMarkType(r);return t.doc.nodesBetween(n.pos,i.pos,(t,n,i)=>{if(o)return!1;if(t.isInline){let a=!i||i.type.allowsMarkType(r),u=!!r.isInSet(t.marks)||!t.marks.some(t=>t.type.excludes(r));o=a&&u}return!o}),o})}(i,r,c)},et8=(t,n)=>({tr:r})=>(r.setMeta(t,n),!0),et7=(t,n={})=>({state:r,dispatch:i,chain:o})=>{let a=eeB(t,r.schema);return a.isTextblock?o().command(({commands:t})=>!!eeP(a,n)(r)||t.clearNodes()).command(({state:t})=>eeP(a,n)(t,i)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},ene=t=>({tr:n,dispatch:r})=>{if(r){let{doc:i}=n,o=et_(t,0,i.content.size),a=Yg.create(i,o);n.setSelection(a)}return!0},ent=t=>({tr:n,dispatch:r})=>{if(r){let{doc:i}=n,{from:o,to:a}="number"==typeof t?{from:t,to:t}:t,u=Yh.atStart(i).from,s=Yh.atEnd(i).to,c=et_(o,u,s),l=et_(a,u,s),f=Yh.create(i,c,l);n.setSelection(f)}return!0},enn=t=>({state:n,dispatch:r})=>{var i;let o=eeB(t,n.schema);return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==o);if(!a)return!1;let u=a.startIndex;if(0==u)return!1;let s=a.parent,c=s.child(u-1);if(c.type!=o)return!1;if(n){let l=c.lastChild&&c.lastChild.type==s.type,f=GK.from(l?o.create():null),d=new GQ(GK.from(o.create(null,GK.from(s.type.create(null,f)))),l?3:1,0),p=a.start,h=a.end;n(t.tr.step(new JG(p-(l?3:1),h,p,h,d,1,!0)).scrollIntoView())}return!0}(n,r)};function enr(t,n){let r=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(r){let i=r.filter(t=>null==n?void 0:n.includes(t.type.name));t.tr.ensureMarks(i)}}let eni=({keepMarks:t=!0}={})=>({tr:n,state:r,dispatch:i,editor:o})=>{let{selection:a,doc:u}=n,{$from:s,$to:c}=a,l=o.extensionManager.attributes,f=et4(l,s.node().type.name,s.node().attrs);if(a instanceof Yg&&a.node.isBlock)return!!(s.parentOffset&&J1(u,s.pos))&&(i&&(t&&enr(r,o.extensionManager.splittableMarks),n.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;if(i){let d=c.parentOffset===c.parent.content.size;a instanceof Yh&&n.deleteSelection();let p=0===s.depth?void 0:function(t){for(let n=0;n<t.edgeCount;n+=1){let{type:r}=t.edge(n);if(r.isTextblock&&!r.hasRequiredAttrs())return r}return null}(s.node(-1).contentMatchAt(s.indexAfter(-1))),h=d&&p?[{type:p,attrs:f}]:void 0,m=J1(n.doc,n.mapping.map(s.pos),1,h);if(!h&&!m&&J1(n.doc,n.mapping.map(s.pos),1,p?[{type:p}]:void 0)&&(m=!0,h=p?[{type:p,attrs:f}]:void 0),m&&(n.split(n.mapping.map(s.pos),1,h),p&&!d&&!s.parentOffset&&s.parent.type!==p)){let g=n.mapping.map(s.before()),y=n.doc.resolve(g);s.node(-1).canReplaceWith(y.index(),y.index()+1,p)&&n.setNodeMarkup(n.mapping.map(s.before()),p)}t&&enr(r,o.extensionManager.splittableMarks),n.scrollIntoView()}return!0},eno=t=>({tr:n,state:r,dispatch:i,editor:o})=>{var a;let u=eeB(t,r.schema),{$from:s,$to:c}=r.selection,l=r.selection.node;if(l&&l.isBlock||s.depth<2||!s.sameParent(c))return!1;let f=s.node(-1);if(f.type!==u)return!1;let d=o.extensionManager.attributes;if(0===s.parent.content.size&&s.node(-1).childCount===s.indexAfter(-1)){if(2===s.depth||s.node(-3).type!==u||s.index(-2)!==s.node(-2).childCount-1)return!1;if(i){let p=GK.empty,h=s.index(-1)?1:s.index(-2)?2:3;for(let m=s.depth-h;m>=s.depth-3;m-=1)p=GK.from(s.node(m).copy(p));let g=s.indexAfter(-1)<s.node(-2).childCount?1:s.indexAfter(-2)<s.node(-3).childCount?2:3,y=et4(d,s.node().type.name,s.node().attrs),v=(null===(a=u.contentMatch.defaultType)||void 0===a?void 0:a.createAndFill(y))||void 0;p=p.append(GK.from(u.createAndFill(null,v)||void 0));let b=s.before(s.depth-(h-1));n.replace(b,s.after(-g),new GQ(p,4-h,0));let x=-1;n.doc.nodesBetween(b,n.doc.content.size,(t,n)=>{if(x>-1)return!1;t.isTextblock&&0===t.content.size&&(x=n+1)}),x>-1&&n.setSelection(Yh.near(n.doc.resolve(x))),n.scrollIntoView()}return!0}let _=c.pos===s.end()?f.contentMatchAt(0).defaultType:null,S=et4(d,f.type.name,f.attrs),T=et4(d,s.node().type.name,s.node().attrs);if(n.delete(s.pos,c.pos),!J1(n.doc,s.pos,2))return!1;if(i){let{selection:w,storedMarks:O}=r,{splittableMarks:k}=o.extensionManager,I=O||w.$to.parentOffset&&w.$from.marks();if(n.split(s.pos,2,_?[{type:u,attrs:S},{type:_,attrs:T}]:[{type:u,attrs:S}]).scrollIntoView(),!I||!i)return!0;let M=I.filter(t=>k.includes(t.type.name));n.ensureMarks(M)}return!0},ena=(t,n)=>{let r=et0(t=>t.type===n)(t.selection);if(!r)return!0;let i=t.doc.resolve(Math.max(0,r.pos-1)).before(r.depth);if(void 0===i)return!0;let o=t.doc.nodeAt(i);return r.node.type===(null==o?void 0:o.type)&&J2(t.doc,r.pos)&&t.join(r.pos),!0},enu=(t,n)=>{let r=et0(t=>t.type===n)(t.selection);if(!r)return!0;let i=t.doc.resolve(r.start).after(r.depth);if(void 0===i)return!0;let o=t.doc.nodeAt(i);return r.node.type===(null==o?void 0:o.type)&&J2(t.doc,i)&&t.join(i),!0},ens=(t,n,r,i={})=>({editor:o,tr:a,state:u,dispatch:s,chain:c,commands:l,can:f})=>{let{extensions:d,splittableMarks:p}=o.extensionManager,h=eeB(t,u.schema),m=eeB(n,u.schema),{selection:g,storedMarks:y}=u,{$from:v,$to:b}=g,x=v.blockRange(b),_=y||g.$to.parentOffset&&g.$from.marks();if(!x)return!1;let S=et0(t=>et6(t.type.name,d))(g);if(x.depth>=1&&S&&x.depth-S.depth<=1){if(S.node.type===h)return l.liftListItem(m);if(et6(S.node.type.name,d)&&h.validContent(S.node.content)&&s)return c().command(()=>(a.setNodeMarkup(S.pos,h),!0)).command(()=>ena(a,h)).command(()=>enu(a,h)).run()}return r&&_&&s?c().command(()=>{let t=f().wrapInList(h,i),n=_.filter(t=>p.includes(t.type.name));return a.ensureMarks(n),!!t||l.clearNodes()}).wrapInList(h,i).command(()=>ena(a,h)).command(()=>enu(a,h)).run():c().command(()=>!!f().wrapInList(h,i)||l.clearNodes()).wrapInList(h,i).command(()=>ena(a,h)).command(()=>enu(a,h)).run()},enc=(t,n={},r={})=>({state:i,commands:o})=>{let{extendEmptyMarkRange:a=!1}=r,u=ety(t,i.schema);return et5(i,u,n)?o.unsetMark(u,{extendEmptyMarkRange:a}):o.setMark(u,n)},enl=(t,n,r={})=>({state:i,commands:o})=>{let a=eeB(t,i.schema),u=eeB(n,i.schema);return etF(i,a,r)?o.setNode(u):o.setNode(a,r)},enf=(t,n={})=>({state:r,commands:i})=>{let o=eeB(t,r.schema);return etF(r,o,n)?i.lift(o):i.wrapIn(o,n)},end=()=>({state:t,dispatch:n})=>{let r=t.plugins;for(let i=0;i<r.length;i+=1){let o=r[i],a;if(o.spec.isInputRules&&(a=o.getState(t))){if(n){let u=t.tr,s=a.transform;for(let c=s.steps.length-1;c>=0;c-=1)u.step(s.steps[c].invert(s.docs[c]));if(a.text){let l=u.doc.resolve(a.from).marks();u.replaceWith(a.from,a.to,t.schema.text(a.text,l))}else u.delete(a.from,a.to)}return!0}}return!1},enp=()=>({tr:t,dispatch:n})=>{let{selection:r}=t,{empty:i,ranges:o}=r;return i||n&&o.forEach(n=>{t.removeMark(n.$from.pos,n.$to.pos)}),!0},enh=(t,n={})=>({tr:r,state:i,dispatch:o})=>{var a;let{extendEmptyMarkRange:u=!1}=n,{selection:s}=r,c=ety(t,i.schema),{$from:l,empty:f,ranges:d}=s;if(!o)return!0;if(f&&u){let{from:p,to:h}=s,m=null===(a=l.marks().find(t=>t.type===c))||void 0===a?void 0:a.attrs,g=etg(l,c,m);g&&(p=g.from,h=g.to),r.removeMark(p,h,c)}else d.forEach(t=>{r.removeMark(t.$from.pos,t.$to.pos,c)});return r.removeStoredMark(c),!0},enm=(t,n={})=>({tr:r,state:i,dispatch:o})=>{let a=null,u=null,s=etB("string"==typeof t?t:t.name,i.schema);return!!s&&("node"===s&&(a=eeB(t,i.schema)),"mark"===s&&(u=ety(t,i.schema)),o&&r.selection.ranges.forEach(t=>{let o=t.$from.pos,s=t.$to.pos;i.doc.nodesBetween(o,s,(t,i)=>{a&&a===t.type&&r.setNodeMarkup(i,void 0,{...t.attrs,...n}),u&&t.marks.length&&t.marks.forEach(a=>{if(u===a.type){let c=Math.min(i+t.nodeSize,s);r.addMark(Math.max(i,o),c,u.create({...a.attrs,...n}))}})})}),!0)},eng=(t,n={})=>({state:r,dispatch:i})=>{let o=eeB(t,r.schema);return(function(t,n=null){return function(r,i){let{$from:o,$to:a}=r.selection,u=o.blockRange(a),s=u&&JX(u,t,n);return!!s&&(i&&i(r.tr.wrap(u,s).scrollIntoView()),!0)}})(o,n)(r,i)},eny=(t,n={})=>({state:r,dispatch:i})=>{let o=eeB(t,r.schema);return(function(t,n=null){return function(r,i){let{$from:o,$to:a}=r.selection,u=o.blockRange(a),s=!1,c=u;if(!u)return!1;if(u.depth>=2&&o.node(u.depth-1).type.compatibleContent(t)&&0==u.startIndex){if(0==o.index(u.depth-1))return!1;let l=r.doc.resolve(u.start-2);c=new G7(l,l,u.depth),u.endIndex<u.parent.childCount&&(u=new G7(o,r.doc.resolve(a.end(u.depth)),u.depth)),s=!0}let f=JX(c,t,n,u);return!!f&&(i&&i((function(t,n,r,i,o){let a=GK.empty;for(let u=r.length-1;u>=0;u--)a=GK.from(r[u].type.create(r[u].attrs,a));t.step(new JG(n.start-(i?2:0),n.end,n.start,n.end,new GQ(a,0,0),r.length,!0));let s=0;for(let c=0;c<r.length;c++)r[c].type==o&&(s=c+1);let l=r.length-s,f=n.start+r.length-(i?2:0),d=n.parent;for(let p=n.startIndex,h=n.endIndex,m=!0;p<h;p++,m=!1)!m&&J1(t.doc,f,l)&&(t.split(f,l),f+=2*l),f+=d.child(p).nodeSize;return t})(r.tr,u,f,s,t).scrollIntoView()),!0)}})(o,n)(r,i)};var env=Object.freeze({__proto__:null,blur:etn,clearContent:etr,clearNodes:eti,command:eto,createParagraphNear:eta,deleteCurrentNode:etu,deleteNode:ets,deleteRange:etc,deleteSelection:etl,enter:etf,exitCode:etd,extendMarkRange:etv,first:etb,focus:etw,forEach:etO,insertContent:etk,insertContentAt:etR,joinUp:etE,joinDown:etA,joinBackward:etj,joinForward:etN,keyboardShortcut:etL,lift:etD,liftEmptyBlock:etW,liftListItem:etU,newlineInCode:etz,resetAttributes:etV,scrollIntoView:et$,selectAll:etK,selectNodeBackward:etH,selectNodeForward:etZ,selectParentNode:etG,selectTextblockEnd:etJ,selectTextblockStart:etY,setContent:etX,setMark:et9,setMeta:et8,setNode:et7,setNodeSelection:ene,setTextSelection:ent,sinkListItem:enn,splitBlock:eni,splitListItem:eno,toggleList:ens,toggleMark:enc,toggleNode:enl,toggleWrap:enf,undoInputRule:end,unsetAllMarks:enp,unsetMark:enh,updateAttributes:enm,wrapIn:eng,wrapInList:eny});let enb=ee8.create({name:"commands",addCommands:()=>({...env})}),enx=ee8.create({name:"editable",addProseMirrorPlugins(){return[new YM({key:new YE("editable"),props:{editable:()=>this.editor.options.editable}})]}}),en_=ee8.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:t}=this;return[new YM({key:new YE("focusEvents"),props:{handleDOMEvents:{focus(n,r){t.isFocused=!0;let i=t.state.tr.setMeta("focus",{event:r}).setMeta("addToHistory",!1);return n.dispatch(i),!1},blur(n,r){t.isFocused=!1;let i=t.state.tr.setMeta("blur",{event:r}).setMeta("addToHistory",!1);return n.dispatch(i),!1}}}})]}}),enS=ee8.create({name:"keymap",addKeyboardShortcuts(){let t=()=>this.editor.commands.first(({commands:t})=>[()=>t.undoInputRule(),()=>t.command(({tr:n})=>{let{selection:r,doc:i}=n,{empty:o,$anchor:a}=r,{pos:u,parent:s}=a,c=Yl.atStart(i).from===u;return!!o&&!!c&&!!s.type.isTextblock&&!s.textContent.length&&t.clearNodes()}),()=>t.deleteSelection(),()=>t.joinBackward(),()=>t.selectNodeBackward()]),n=()=>this.editor.commands.first(({commands:t})=>[()=>t.deleteSelection(),()=>t.deleteCurrentNode(),()=>t.joinForward(),()=>t.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:t})=>[()=>t.newlineInCode(),()=>t.createParagraphNear(),()=>t.liftEmptyBlock(),()=>t.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:n,"Mod-Delete":n,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":n,"Ctrl-Alt-Backspace":n,"Alt-Delete":n,"Alt-d":n,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return etT()||etP()?o:i},addProseMirrorPlugins(){return[new YM({key:new YE("clearDocument"),appendTransaction:(t,n,r)=>{if(!(t.some(t=>t.docChanged)&&!n.doc.eq(r.doc)))return;let{empty:i,from:o,to:a}=n.selection,u=Yl.atStart(n.doc).from,s=Yl.atEnd(n.doc).to;if(i||!(o===u&&a===s)||0!==r.doc.textBetween(0,r.doc.content.size," "," ").length)return;let c=r.tr,l=eeL({state:r,transaction:c}),{commands:f}=new eeF({editor:this.editor,state:l});if(f.clearNodes(),c.steps.length)return c}})]}}),enT=ee8.create({name:"tabindex",addProseMirrorPlugins(){return[new YM({key:new YE("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var enw=Object.freeze({__proto__:null,ClipboardTextSerializer:ett,Commands:enb,Editable:enx,FocusEvents:en_,Keymap:enS,Tabindex:enT});let enO=`.ProseMirror {
14
14
  position: relative;
15
15
  }
16
16
 
@@ -84,18 +84,18 @@ img.ProseMirror-separator {
84
84
 
85
85
  .tippy-box[data-animation=fade][data-state=hidden] {
86
86
  opacity: 0
87
- }`,en_=class extends eej{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=function(t,n){let r=document.querySelector("style[data-tiptap-style]");if(null!==r)return r;let i=document.createElement("style");return n&&i.setAttribute("nonce",n),i.setAttribute("data-tiptap-style",""),i.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(i),i}(enx,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){let r=eeU(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;let n="string"==typeof t?`${t}$`:t.key,r=this.state.reconfigure({plugins:this.state.plugins.filter(t=>!t.key.startsWith(n))});this.view.updateState(r)}createExtensionManager(){let t=[...this.options.enableCoreExtensions?Object.values(enb):[],...this.options.extensions].filter(t=>["extension","node","mark"].includes(null==t?void 0:t.type));this.extensionManager=new ee0(t,this)}createCommandManager(){this.commandManager=new eeA({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){let t=etH(this.options.content,this.schema,this.options.parseOptions),n=ety(t,this.options.autofocus);this.view=new X4(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:YS.create({doc:t,selection:n||void 0})});let r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),this.createNodeViews();let i=this.view.dom;i.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;let 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(t=>{var n;return null===(n=this.capturedTransaction)||void 0===n?void 0:n.step(t)});return}let 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});let 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 etY(this.state,t)}isActive(t,n){return function(t,n,r={}){if(!n)return etA(t,null,r)||et0(t,null,r);let i=etF(n,t.schema);return"node"===i?etA(t,n,r):"mark"===i&&et0(t,n,r)}(this.state,"string"==typeof t?t:null,"string"==typeof t?n:t)}getJSON(){return this.state.doc.toJSON()}getHTML(){return function(t,n){let r=JI.fromSchema(n).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(r),i.innerHTML}(this.state.doc.content,this.schema)}getText(t){let{blockSeparator:n=`
87
+ }`,enk=class extends eeD{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=function(t,n){let r=document.querySelector("style[data-tiptap-style]");if(null!==r)return r;let i=document.createElement("style");return n&&i.setAttribute("nonce",n),i.setAttribute("data-tiptap-style",""),i.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(i),i}(enO,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){let r=ee$(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;let n="string"==typeof t?`${t}$`:t.key,r=this.state.reconfigure({plugins:this.state.plugins.filter(t=>!t.key.startsWith(n))});this.view.updateState(r)}createExtensionManager(){let t=[...this.options.enableCoreExtensions?Object.values(enw):[],...this.options.extensions].filter(t=>["extension","node","mark"].includes(null==t?void 0:t.type));this.extensionManager=new ee5(t,this)}createCommandManager(){this.commandManager=new eeF({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){let t=etQ(this.options.content,this.schema,this.options.parseOptions),n=etS(t,this.options.autofocus);this.view=new X7(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:YI.create({doc:t,selection:n||void 0})});let r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),this.createNodeViews();let i=this.view.dom;i.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;let 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(t=>{var n;return null===(n=this.capturedTransaction)||void 0===n?void 0:n.step(t)});return}let 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});let 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 et2(this.state,t)}isActive(t,n){return function(t,n,r={}){if(!n)return etF(t,null,r)||et5(t,null,r);let i=etB(n,t.schema);return"node"===i?etF(t,n,r):"mark"===i&&et5(t,n,r)}(this.state,"string"==typeof t?t:null,"string"==typeof t?n:t)}getJSON(){return this.state.doc.toJSON()}getHTML(){return function(t,n){let r=JA.fromSchema(n).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(r),i.innerHTML}(this.state.doc.content,this.schema)}getText(t){let{blockSeparator:n=`
88
88
 
89
- `,textSerializers:r={}}=t||{};return function(t,n){let r={from:0,to:t.content.size};return ee4(t,r,n)}(this.state.doc,{blockSeparator:n,textSerializers:{...ee5(this.schema),...r}})}get isEmpty(){return function(t){var n;let r=null===(n=t.type.createAndFill())||void 0===n?void 0:n.toJSON(),i=t.toJSON();return JSON.stringify(r)===JSON.stringify(i)}(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!(!(null===(t=this.view)||void 0===t)&&t.docView)}};function enS(t){return new eeG({find:t.find,handler({state:n,range:r,match:i}){let o=eez(t.getAttributes,void 0,i);if(!1===o||null===o)return null;let{tr:a}=n,u=i[i.length-1],s=i[0],c=r.to;if(u){let l=s.search(/\S/),f=r.from+s.indexOf(u),d=f+u.length;if(etQ(r.from,r.to,n.doc).filter(n=>n.mark.type.excluded.find(r=>r===t.type&&r!==n.mark.type)).filter(t=>t.to>f).length)return null;d<r.to&&a.delete(d,r.to),f>r.from&&a.delete(r.from+l,f),c=r.from+l+u.length,a.addMark(r.from+l,c,t.type.create(o||{})),a.removeStoredMark(t.type)}}})}function enT(t){return new eeG({find:t.find,handler({state:n,range:r,match:i}){let o=n.doc.resolve(r.from),a=eez(t.getAttributes,void 0,i)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),t.type))return null;n.tr.delete(r.from,r.to).setBlockType(r.from,r.from,t.type,a)}})}function enw(t){return new eeG({find:t.find,handler({state:n,range:r,match:i,chain:o}){let a=eez(t.getAttributes,void 0,i)||{},u=n.tr.delete(r.from,r.to),s=u.doc.resolve(r.from).blockRange(),c=s&&JZ(s,t.type,a);if(!c)return null;if(u.wrap(s,c),t.keepMarks&&t.editor){let{selection:l,storedMarks:f}=n,{splittableMarks:d}=t.editor.extensionManager,p=f||l.$to.parentOffset&&l.$from.marks();if(p){let h=p.filter(t=>d.includes(t.type.name));u.ensureMarks(h)}}if(t.keepAttributes){let m="bulletList"===t.type.name||"orderedList"===t.type.name?"listItem":"taskList";o().updateAttributes(m,a).run()}let g=u.doc.resolve(r.from-1).nodeBefore;g&&g.type===t.type&&JY(u.doc,r.from-1)&&(!t.joinPredicate||t.joinPredicate(i,g))&&u.join(r.from-1)}})}let enO=class t{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=eez(eeN(this,"addOptions",{name:this.name}))),this.storage=eez(eeN(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(n={}){return new t(n)}configure(t={}){let n=this.extend();return n.options=ee2(this.options,t),n.storage=eez(eeN(n,"addStorage",{name:n.name,options:n.options})),n}extend(n={}){let r=new t(n);return r.parent=this,this.child=r,r.name=n.name?n.name:r.parent.name,n.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${r.name}".`),r.options=eez(eeN(r,"addOptions",{name:r.name})),r.storage=eez(eeN(r,"addStorage",{name:r.name,options:r.options})),r}static handleExit({editor:t,mark:n}){let{tr:r}=t.state,i=t.state.selection.$from;if(i.pos===i.end()){let o=i.marks();if(!o.find(t=>(null==t?void 0:t.type.name)===n.name))return!1;let a=o.find(t=>(null==t?void 0:t.type.name)===n.name);return a&&r.removeStoredMark(a),r.insertText(" ",i.pos),t.view.dispatch(r),!0}return!1}};class enk{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=eez(eeN(this,"addOptions",{name:this.name}))),this.storage=eez(eeN(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new enk(t)}configure(t={}){let n=this.extend();return n.options=ee2(this.options,t),n.storage=eez(eeN(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){let n=new enk(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=eez(eeN(n,"addOptions",{name:n.name})),n.storage=eez(eeN(n,"addStorage",{name:n.name,options:n.options})),n}}class enI{constructor(t,n,r){this.isDragging=!1,this.component=t,this.editor=n.editor,this.options={stopEvent:null,ignoreMutation:null,...r},this.extension=n.extension,this.node=n.node,this.decorations=n.decorations,this.getPos=n.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(t){var n,r,i,o,a,u,s;let{view:c}=this.editor,l=t.target,f=3===l.nodeType?null===(n=l.parentElement)||void 0===n?void 0:n.closest("[data-drag-handle]"):l.closest("[data-drag-handle]");if(!this.dom||!(null===(r=this.contentDOM)||void 0===r)&&r.contains(l)||!f)return;let d=0,p=0;if(this.dom!==f){let h=this.dom.getBoundingClientRect(),m=f.getBoundingClientRect(),g=null!==(i=t.offsetX)&&void 0!==i?i:null===(o=t.nativeEvent)||void 0===o?void 0:o.offsetX,y=null!==(a=t.offsetY)&&void 0!==a?a:null===(u=t.nativeEvent)||void 0===u?void 0:u.offsetY;d=m.x-h.x+g,p=m.y-h.y+y}null===(s=t.dataTransfer)||void 0===s||s.setDragImage(this.dom,d,p);let v=Yf.create(c.state.doc,this.getPos()),b=c.state.tr.setSelection(v);c.dispatch(b)}stopEvent(t){var n;if(!this.dom)return!1;if("function"==typeof this.options.stopEvent)return this.options.stopEvent({event:t});let r=t.target;if(!(this.dom.contains(r)&&!(!(null===(n=this.contentDOM)||void 0===n)&&n.contains(r))))return!1;let i=t.type.startsWith("drag"),o="drop"===t.type;if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(r.tagName)||r.isContentEditable)&&!o&&!i)return!0;let{isEditable:a}=this.editor,{isDragging:u}=this,s=!!this.node.type.spec.draggable,c=Yf.isSelectable(this.node),l="copy"===t.type,f="paste"===t.type,d="cut"===t.type,p="mousedown"===t.type;if(!s&&c&&i&&t.preventDefault(),s&&i&&!u)return t.preventDefault(),!1;if(s&&a&&!u&&p){let h=r.closest("[data-drag-handle]");h&&(this.dom===h||this.dom.contains(h))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(u||o||l||f||d||p&&c)}ignoreMutation(t){return!this.dom||!this.contentDOM||("function"==typeof this.options.ignoreMutation?this.options.ignoreMutation({mutation:t}):!!this.node.isLeaf||!!this.node.isAtom||!("selection"===t.type||this.dom.contains(t.target)&&"childList"===t.type&&etv()&&this.editor.isFocused&&[...Array.from(t.addedNodes),...Array.from(t.removedNodes)].every(t=>t.isContentEditable))&&(this.contentDOM===t.target&&"attributes"===t.type||!this.contentDOM.contains(t.target)))}updateAttributes(t){this.editor.commands.command(({tr:n})=>{let r=this.getPos();return n.setNodeMarkup(r,void 0,{...this.node.attrs,...t}),!0})}deleteNode(){let t=this.getPos(),n=t+this.node.nodeSize;this.editor.commands.deleteRange({from:t,to:n})}}function enM(t){return new eeQ({find:t.find,handler({state:n,range:r,match:i}){let o=eez(t.getAttributes,void 0,i);if(!1===o||null===o)return null;let{tr:a}=n,u=i[i.length-1],s=i[0],c=r.to;if(u){let l=s.search(/\S/),f=r.from+s.indexOf(u),d=f+u.length;if(etQ(r.from,r.to,n.doc).filter(n=>n.mark.type.excluded.find(r=>r===t.type&&r!==n.mark.type)).filter(t=>t.to>f).length)return null;d<r.to&&a.delete(d,r.to),f>r.from&&a.delete(r.from+l,f),c=r.from+l+u.length,a.addMark(r.from+l,c,t.type.create(o||{})),a.removeStoredMark(t.type)}}})}var enC=function(){};enC.prototype.append=function(t){return t.length?(t=enC.from(t),!this.length&&t||t.length<200&&this.leafAppend(t)||this.length<200&&t.leafPrepend(this)||this.appendInner(t)):this},enC.prototype.prepend=function(t){return t.length?enC.from(t).append(this):this},enC.prototype.appendInner=function(t){return new enE(this,t)},enC.prototype.slice=function(t,n){return void 0===t&&(t=0),void 0===n&&(n=this.length),t>=n?enC.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))},enC.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},enC.prototype.forEach=function(t,n,r){void 0===n&&(n=0),void 0===r&&(r=this.length),n<=r?this.forEachInner(t,n,r,0):this.forEachInvertedInner(t,n,r,0)},enC.prototype.map=function(t,n,r){void 0===n&&(n=0),void 0===r&&(r=this.length);var i=[];return this.forEach(function(n,r){return i.push(t(n,r))},n,r),i},enC.from=function(t){return t instanceof enC?t:t&&t.length?new enR(t):enC.empty};var enR=function(t){function n(n){t.call(this),this.values=n}t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n;var r={length:{configurable:!0},depth:{configurable:!0}};return n.prototype.flatten=function(){return this.values},n.prototype.sliceInner=function(t,r){return 0==t&&r==this.length?this:new n(this.values.slice(t,r))},n.prototype.getInner=function(t){return this.values[t]},n.prototype.forEachInner=function(t,n,r,i){for(var o=n;o<r;o++)if(!1===t(this.values[o],i+o))return!1},n.prototype.forEachInvertedInner=function(t,n,r,i){for(var o=n-1;o>=r;o--)if(!1===t(this.values[o],i+o))return!1},n.prototype.leafAppend=function(t){if(this.length+t.length<=200)return new n(this.values.concat(t.flatten()))},n.prototype.leafPrepend=function(t){if(this.length+t.length<=200)return new n(t.flatten().concat(this.values))},r.length.get=function(){return this.values.length},r.depth.get=function(){return 0},Object.defineProperties(n.prototype,r),n}(enC);enC.empty=new enR([]);var enE=function(t){function n(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},n.prototype.getInner=function(t){return t<this.left.length?this.left.get(t):this.right.get(t-this.left.length)},n.prototype.forEachInner=function(t,n,r,i){var o=this.left.length;if(n<o&&!1===this.left.forEachInner(t,n,Math.min(r,o),i)||r>o&&!1===this.right.forEachInner(t,Math.max(n-o,0),Math.min(this.length,r)-o,i+o))return!1},n.prototype.forEachInvertedInner=function(t,n,r,i){var o=this.left.length;if(n>o&&!1===this.right.forEachInvertedInner(t,n-o,Math.max(r,o)-o,i+o)||r<o&&!1===this.left.forEachInvertedInner(t,Math.min(n,o),r,i))return!1},n.prototype.sliceInner=function(t,n){if(0==t&&n==this.length)return this;var r=this.left.length;return n<=r?this.left.slice(t,n):t>=r?this.right.slice(t-r,n-r):this.left.slice(t,r).append(this.right.slice(0,n-r))},n.prototype.leafAppend=function(t){var r=this.right.leafAppend(t);if(r)return new n(this.left,r)},n.prototype.leafPrepend=function(t){var r=this.left.leafPrepend(t);if(r)return new n(r,this.right)},n.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new n(this.left,new n(this.right,t)):new n(this,t)},n}(enC);class enA{constructor(t,n){this.items=t,this.eventCount=n}popEvent(t,n){if(0==this.eventCount)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(o=(i=this.remapping(r,this.items.length)).maps.length);let a=t.tr,u,s,c=[],l=[];return this.items.forEach((t,n)=>{if(!t.step){i||(o=(i=this.remapping(r,n+1)).maps.length),o--,l.push(t);return}if(i){l.push(new enj(t.map));let f=t.step.map(i.slice(o)),d;f&&a.maybeStep(f).doc&&(d=a.mapping.maps[a.mapping.maps.length-1],c.push(new enj(d,void 0,void 0,c.length+l.length))),o--,d&&i.appendMap(d,o)}else a.maybeStep(t.step);if(t.selection)return u=i?t.selection.map(i.slice(o)):t.selection,s=new enA(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){var o,a;let u=[],s=this.eventCount,c=this.items,l=!i&&c.length?c.get(c.length-1):null;for(let f=0;f<t.steps.length;f++){let d=t.steps[f].invert(t.docs[f]),p=new enj(t.mapping.maps[f],d,n),h;(h=l&&l.merge(p))&&(p=h,f?u.pop():c=c.slice(0,c.length-1)),u.push(p),n&&(s++,n=void 0),i||(l=p)}let m=s-r.depth,g;return m>enP&&(o=c,a=m,c=(o.forEach((t,n)=>{if(t.selection&&0==a--)return g=n,!1}),o.slice(g)),s-=m),new enA(c.append(u),s)}remapping(t,n){let r=new JN;return this.items.forEach((n,i)=>{let o=null!=n.mirrorOffset&&i-n.mirrorOffset>=t?r.maps.length-n.mirrorOffset:void 0;r.appendMap(n.map,o)},t,n),r}addMaps(t){return 0==this.eventCount?this:new enA(this.items.append(t.map(t=>new enj(t))),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(t=>{t.selection&&u--},i);let s=n;this.items.forEach(n=>{let i=o.getMirror(--s);if(null==i)return;a=Math.min(a,i);let c=o.maps[i];if(n.step){let l=t.steps[i].invert(t.docs[i]),f=n.selection&&n.selection.map(o.slice(s+1,i));f&&u++,r.push(new enj(c,l,f))}else r.push(new enj(c))},i);let c=[];for(let l=n;l<a;l++)c.push(new enj(o.maps[l]));let f=this.items.slice(0,i).append(c).append(r),d=new enA(f,u);return d.emptyItemCount()>500&&(d=d.compress(this.items.length-r.length)),d}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 enj(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 enA(enC.from(i.reverse()),o)}}enA.empty=new enA(enC.empty,0);class enj{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 enj(n.getMap().invert(),n,this.selection)}}}class enN{constructor(t,n,r,i,o){this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}let enP=20;function enL(t){let n=[];return t.forEach((t,r,i,o)=>n.push(i,o)),n}function enF(t,n){if(!t)return null;let r=[];for(let i=0;i<t.length;i+=2){let o=n.map(t[i],1),a=n.map(t[i+1],-1);o<=a&&r.push(o,a)}return r}function enD(t,n,r,i){let o=enz(n),a=enB.get(n).spec.config,u=(i?t.undone:t.done).popEvent(n,o);if(!u)return;let s=u.selection.resolve(u.transform.doc),c=(i?t.done:t.undone).addTransform(u.transform,n.selection.getBookmark(),a,o),l=new enN(i?c:u.remaining,i?u.remaining:c,null,0,-1);r(u.transform.setSelection(s).setMeta(enB,{redo:i,historyState:l}).scrollIntoView())}let enW=!1,enU=null;function enz(t){let n=t.plugins;if(enU!=n){enW=!1,enU=n;for(let r=0;r<n.length;r++)if(n[r].spec.historyPreserveItems){enW=!0;break}}return enW}let enB=new Yk("history"),enq=new Yk("closeHistory"),enV=(t,n)=>{let r=enB.getState(t);return!!r&&0!=r.done.eventCount&&(n&&enD(r,t,n,!1),!0)},en$=(t,n)=>{let r=enB.getState(t);return!!r&&0!=r.undone.eventCount&&(n&&enD(r,t,n,!0),!0)},enK=ee3.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:t,dispatch:n})=>enV(t,n),redo:()=>({state:t,dispatch:n})=>en$(t,n)}),addProseMirrorPlugins(){return[function(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new YT({key:enB,state:{init:()=>new enN(enA.empty,enA.empty,null,0,-1),apply:(n,r,i)=>(function(t,n,r,i){let o=r.getMeta(enB),a;if(o)return o.historyState;r.getMeta(enq)&&(t=new enN(t.done,t.undone,null,0,-1));let u=r.getMeta("appendedTransaction");if(0==r.steps.length)return t;if(u&&u.getMeta(enB))return u.getMeta(enB).redo?new enN(t.done.addTransform(r,void 0,i,enz(n)),t.undone,enL(r.mapping.maps[r.steps.length-1]),t.prevTime,t.prevComposition):new enN(t.done,t.undone.addTransform(r,void 0,i,enz(n)),null,t.prevTime,t.prevComposition);if(!1===r.getMeta("addToHistory")||u&&!1===u.getMeta("addToHistory"))return(a=r.getMeta("rebased"))?new enN(t.done.rebased(r,a),t.undone.rebased(r,a),enF(t.prevRanges,r.mapping),t.prevTime,t.prevComposition):new enN(t.done.addMaps(r.mapping.maps),t.undone.addMaps(r.mapping.maps),enF(t.prevRanges,r.mapping),t.prevTime,t.prevComposition);{let s=r.getMeta("composition"),c=0==t.prevTime||!u&&t.prevComposition!=s&&(t.prevTime<(r.time||0)-i.newGroupDelay||!function(t,n){if(!n)return!1;if(!t.docChanged)return!0;let r=!1;return t.mapping.maps[0].forEach((t,i)=>{for(let o=0;o<n.length;o+=2)t<=n[o+1]&&i>=n[o]&&(r=!0)}),r}(r,t.prevRanges)),l=u?enF(t.prevRanges,r.mapping):enL(r.mapping.maps[r.steps.length-1]);return new enN(t.done.addTransform(r,c?n.selection.getBookmark():void 0,i,enz(n)),enA.empty,l,r.time,s??t.prevComposition)}})(r,i,n,t)},config:t,props:{handleDOMEvents:{beforeinput(t,n){let r=n.inputType,i="historyUndo"==r?enV:"historyRedo"==r?en$:null;return!!i&&(n.preventDefault(),i(t.state,t.dispatch))}}}})}(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 enH="bottom",enZ="right",enG="left",enJ="auto",enY=["top",enH,enZ,enG],enQ="start",enX="viewport",en0="popper",en1=enY.reduce(function(t,n){return t.concat([n+"-"+enQ,n+"-end"])},[]),en2=[].concat(enY,[enJ]).reduce(function(t,n){return t.concat([n,n+"-"+enQ,n+"-end"])},[]),en3=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function en4(t){return t?(t.nodeName||"").toLowerCase():null}function en5(t){if(null==t)return window;if("[object Window]"!==t.toString()){var n=t.ownerDocument;return n&&n.defaultView||window}return t}function en6(t){var n=en5(t).Element;return t instanceof n||t instanceof Element}function en9(t){var n=en5(t).HTMLElement;return t instanceof n||t instanceof HTMLElement}function en8(t){if(typeof ShadowRoot>"u")return!1;var n=en5(t).ShadowRoot;return t instanceof n||t instanceof ShadowRoot}let en7={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var n=t.state;Object.keys(n.elements).forEach(function(t){var r=n.styles[t]||{},i=n.attributes[t]||{},o=n.elements[t];en9(o)&&en4(o)&&(Object.assign(o.style,r),Object.keys(i).forEach(function(t){var n=i[t];!1===n?o.removeAttribute(t):o.setAttribute(t,!0===n?"":n)}))})},effect:function(t){var n=t.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow),function(){Object.keys(n.elements).forEach(function(t){var i=n.elements[t],o=n.attributes[t]||{},a=Object.keys(n.styles.hasOwnProperty(t)?n.styles[t]:r[t]).reduce(function(t,n){return t[n]="",t},{});en9(i)&&en4(i)&&(Object.assign(i.style,a),Object.keys(o).forEach(function(t){i.removeAttribute(t)}))})}},requires:["computeStyles"]};function ere(t){return t.split("-")[0]}var ert=Math.max,ern=Math.min,err=Math.round;function eri(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function ero(){return!/^((?!chrome|android).)*safari/i.test(eri())}function era(t,n,r){void 0===n&&(n=!1),void 0===r&&(r=!1);var i=t.getBoundingClientRect(),o=1,a=1;n&&en9(t)&&(o=t.offsetWidth>0&&err(i.width)/t.offsetWidth||1,a=t.offsetHeight>0&&err(i.height)/t.offsetHeight||1);var u=(en6(t)?en5(t):window).visualViewport,s=!ero()&&r,c=(i.left+(s&&u?u.offsetLeft:0))/o,l=(i.top+(s&&u?u.offsetTop:0))/a,f=i.width/o,d=i.height/a;return{width:f,height:d,top:l,right:c+f,bottom:l+d,left:c,x:c,y:l}}function eru(t){var n=era(t),r=t.offsetWidth,i=t.offsetHeight;return 1>=Math.abs(n.width-r)&&(r=n.width),1>=Math.abs(n.height-i)&&(i=n.height),{x:t.offsetLeft,y:t.offsetTop,width:r,height:i}}function ers(t,n){var r=n.getRootNode&&n.getRootNode();if(t.contains(n))return!0;if(r&&en8(r)){var i=n;do{if(i&&t.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function erc(t){return en5(t).getComputedStyle(t)}function erl(t){return["table","td","th"].indexOf(en4(t))>=0}function erf(t){return((en6(t)?t.ownerDocument:t.document)||window.document).documentElement}function erd(t){return"html"===en4(t)?t:t.assignedSlot||t.parentNode||(en8(t)?t.host:null)||erf(t)}function erp(t){return en9(t)&&"fixed"!==erc(t).position?t.offsetParent:null}function erh(t){for(var n=en5(t),r=erp(t);r&&erl(r)&&"static"===erc(r).position;)r=erp(r);return r&&("html"===en4(r)||"body"===en4(r)&&"static"===erc(r).position)?n:r||function(t){var n=/firefox/i.test(eri());if(/Trident/i.test(eri())&&en9(t)&&"fixed"===erc(t).position)return null;var r=erd(t);for(en8(r)&&(r=r.host);en9(r)&&0>["html","body"].indexOf(en4(r));){var i=erc(r);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||n&&"filter"===i.willChange||n&&i.filter&&"none"!==i.filter)return r;r=r.parentNode}return null}(t)||n}function erm(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function erg(t,n,r){return ert(t,ern(n,r))}function ery(){return{top:0,right:0,bottom:0,left:0}}function erv(t){return Object.assign({},ery(),t)}function erb(t,n){return n.reduce(function(n,r){return n[r]=t,n},{})}function erx(t){return t.split("-")[1]}var er_={top:"auto",right:"auto",bottom:"auto",left:"auto"};function erS(t){var n,r,i=t.popper,o=t.popperRect,a=t.placement,u=t.variation,s=t.offsets,c=t.position,l=t.gpuAcceleration,f=t.adaptive,d=t.roundOffsets,p=t.isFixed,h=s.x,m=void 0===h?0:h,g=s.y,y=void 0===g?0:g,v="function"==typeof d?d({x:m,y:y}):{x:m,y:y};m=v.x,y=v.y;var b=s.hasOwnProperty("x"),x=s.hasOwnProperty("y"),_=enG,S="top",T=window;if(f){var w=erh(i),O="clientHeight",k="clientWidth";w===en5(i)&&(w=erf(i),"static"!==erc(w).position&&"absolute"===c&&(O="scrollHeight",k="scrollWidth")),("top"===a||(a===enG||a===enZ)&&"end"===u)&&(S=enH,y-=(p&&w===T&&T.visualViewport?T.visualViewport.height:w[O])-o.height,y*=l?1:-1),(a===enG||("top"===a||a===enH)&&"end"===u)&&(_=enZ,m-=(p&&w===T&&T.visualViewport?T.visualViewport.width:w[k])-o.width,m*=l?1:-1)}var I,M,C,R,E,A=Object.assign({position:c},f&&er_),j=!0===d?(I={x:m,y:y},M=en5(i),C=I.x,R=I.y,{x:err(C*(E=M.devicePixelRatio||1))/E||0,y:err(R*E)/E||0}):{x:m,y:y};return(m=j.x,y=j.y,l)?Object.assign({},A,((n={})[S]=x?"0":"",n[_]=b?"0":"",n.transform=1>=(T.devicePixelRatio||1)?"translate("+m+"px, "+y+"px)":"translate3d("+m+"px, "+y+"px, 0)",n)):Object.assign({},A,((r={})[S]=x?y+"px":"",r[_]=b?m+"px":"",r.transform="",r))}var erT={passive:!0},erw={left:"right",right:"left",bottom:"top",top:"bottom"};function erO(t){return t.replace(/left|right|bottom|top/g,function(t){return erw[t]})}var erk={start:"end",end:"start"};function erI(t){return t.replace(/start|end/g,function(t){return erk[t]})}function erM(t){var n,r=en5(t);return{scrollLeft:r.pageXOffset,scrollTop:r.pageYOffset}}function erC(t){return era(erf(t)).left+erM(t).scrollLeft}function erR(t){var n=erc(t),r=n.overflow,i=n.overflowX,o=n.overflowY;return/auto|scroll|overlay|hidden/.test(r+o+i)}function erE(t,n){void 0===n&&(n=[]);var r,i=function t(n){return["html","body","#document"].indexOf(en4(n))>=0?n.ownerDocument.body:en9(n)&&erR(n)?n:t(erd(n))}(t),o=i===(null==(r=t.ownerDocument)?void 0:r.body),a=en5(i),u=o?[a].concat(a.visualViewport||[],erR(i)?i:[]):i,s=n.concat(u);return o?s:s.concat(erE(erd(u)))}function erA(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function erj(t,n,r){var i,o,a,u,s,c,l,f,d,p,h,m;return n===enX?erA(function(t,n){var r=en5(t),i=erf(t),o=r.visualViewport,a=i.clientWidth,u=i.clientHeight,s=0,c=0;if(o){a=o.width,u=o.height;var l=ero();(l||!l&&"fixed"===n)&&(s=o.offsetLeft,c=o.offsetTop)}return{width:a,height:u,x:s+erC(t),y:c}}(t,r)):en6(n)?((a=era(n,!1,"fixed"===r)).top=a.top+n.clientTop,a.left=a.left+n.clientLeft,a.bottom=a.top+n.clientHeight,a.right=a.left+n.clientWidth,a.width=n.clientWidth,a.height=n.clientHeight,a.x=a.left,a.y=a.top,a):erA((u=erf(t),c=erf(u),l=erM(u),f=null==(s=u.ownerDocument)?void 0:s.body,d=ert(c.scrollWidth,c.clientWidth,f?f.scrollWidth:0,f?f.clientWidth:0),p=ert(c.scrollHeight,c.clientHeight,f?f.scrollHeight:0,f?f.clientHeight:0),h=-l.scrollLeft+erC(u),m=-l.scrollTop,"rtl"===erc(f||c).direction&&(h+=ert(c.clientWidth,f?f.clientWidth:0)-d),{width:d,height:p,x:h,y:m}))}function erN(t){var n,r=t.reference,i=t.element,o=t.placement,a=o?ere(o):null,u=o?erx(o):null,s=r.x+r.width/2-i.width/2,c=r.y+r.height/2-i.height/2;switch(a){case"top":n={x:s,y:r.y-i.height};break;case enH:n={x:s,y:r.y+r.height};break;case enZ:n={x:r.x+r.width,y:c};break;case enG:n={x:r.x-i.width,y:c};break;default:n={x:r.x,y:r.y}}var l=a?erm(a):null;if(null!=l){var f="y"===l?"height":"width";switch(u){case enQ:n[l]=n[l]-(r[f]/2-i[f]/2);break;case"end":n[l]=n[l]+(r[f]/2-i[f]/2)}}return n}function erP(t,n){void 0===n&&(n={});var r,i,o,a,u,s,c,l,f,d,p=n,h=p.placement,m=void 0===h?t.placement:h,g=p.strategy,y=void 0===g?t.strategy:g,v=p.boundary,b=p.rootBoundary,x=p.elementContext,_=void 0===x?en0:x,S=p.altBoundary,T=p.padding,w=void 0===T?0:T,O=erv("number"!=typeof w?w:erb(w,enY)),k=t.rects.popper,I=t.elements[void 0!==S&&S?_===en0?"reference":en0:_],M=(r=en6(I)?I:I.contextElement||erf(t.elements.popper),f=(l=[].concat("clippingParents"===(i=void 0===v?"clippingParents":v)?(s=erE(erd(r)),c=["absolute","fixed"].indexOf(erc(r).position)>=0&&en9(r)?erh(r):r,en6(c)?s.filter(function(t){return en6(t)&&ers(t,c)&&"body"!==en4(t)}):[]):[].concat(i),[void 0===b?enX:b]))[0],(d=l.reduce(function(t,n){var i=erj(r,n,y);return t.top=ert(i.top,t.top),t.right=ern(i.right,t.right),t.bottom=ern(i.bottom,t.bottom),t.left=ert(i.left,t.left),t},erj(r,f,y))).width=d.right-d.left,d.height=d.bottom-d.top,d.x=d.left,d.y=d.top,d),C=era(t.elements.reference),R=erN({reference:C,element:k,strategy:"absolute",placement:m}),E=erA(Object.assign({},k,R)),A=_===en0?E:C,j={top:M.top-A.top+O.top,bottom:A.bottom-M.bottom+O.bottom,left:M.left-A.left+O.left,right:A.right-M.right+O.right},N=t.modifiersData.offset;if(_===en0&&N){var P=N[m];Object.keys(j).forEach(function(t){var n=[enZ,enH].indexOf(t)>=0?1:-1,r=["top",enH].indexOf(t)>=0?"y":"x";j[t]+=P[r]*n})}return j}function erL(t,n,r){return void 0===r&&(r={x:0,y:0}),{top:t.top-n.height-r.y,right:t.right-n.width+r.x,bottom:t.bottom-n.height+r.y,left:t.left-n.width-r.x}}function erF(t){return["top",enZ,enH,enG].some(function(n){return t[n]>=0})}var erD={placement:"bottom",modifiers:[],strategy:"absolute"};function erW(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return!n.some(function(t){return!(t&&"function"==typeof t.getBoundingClientRect)})}var erU,erz,erB,erq,erV,er$,erK,erH,erZ,erG,erJ=(erV={defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var n=t.state,r=t.instance,i=t.options,o=i.scroll,a=void 0===o||o,u=i.resize,s=void 0===u||u,c=en5(n.elements.popper),l=[].concat(n.scrollParents.reference,n.scrollParents.popper);return a&&l.forEach(function(t){t.addEventListener("scroll",r.update,erT)}),s&&c.addEventListener("resize",r.update,erT),function(){a&&l.forEach(function(t){t.removeEventListener("scroll",r.update,erT)}),s&&c.removeEventListener("resize",r.update,erT)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var n=t.state,r=t.name;n.modifiersData[r]=erN({reference:n.rects.reference,element:n.rects.popper,strategy:"absolute",placement:n.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var n=t.state,r=t.options,i=r.gpuAcceleration,o=r.adaptive,a=r.roundOffsets,u=void 0===a||a,s={placement:ere(n.placement),variation:erx(n.placement),popper:n.elements.popper,popperRect:n.rects.popper,gpuAcceleration:void 0===i||i,isFixed:"fixed"===n.options.strategy};null!=n.modifiersData.popperOffsets&&(n.styles.popper=Object.assign({},n.styles.popper,erS(Object.assign({},s,{offsets:n.modifiersData.popperOffsets,position:n.options.strategy,adaptive:void 0===o||o,roundOffsets:u})))),null!=n.modifiersData.arrow&&(n.styles.arrow=Object.assign({},n.styles.arrow,erS(Object.assign({},s,{offsets:n.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-placement":n.placement})},data:{}},en7,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var n=t.state,r=t.options,i=t.name,o=r.offset,a=void 0===o?[0,0]:o,u=en2.reduce(function(t,r){var i,o,u,s,c,l,f,d;return t[r]=(o=n.rects,c=[enG,"top"].indexOf(s=ere(r))>=0?-1:1,f=(l="function"==typeof a?a(Object.assign({},o,{placement:r})):a)[0],d=l[1],f=f||0,d=(d||0)*c,[enG,enZ].indexOf(s)>=0?{x:d,y:f}:{x:f,y:d}),t},{}),s=u[n.placement],c=s.x,l=s.y;null!=n.modifiersData.popperOffsets&&(n.modifiersData.popperOffsets.x+=c,n.modifiersData.popperOffsets.y+=l),n.modifiersData[i]=u}},{name:"flip",enabled:!0,phase:"main",fn:function(t){var n=t.state,r=t.options,i=t.name;if(!n.modifiersData[i]._skip){for(var o=r.mainAxis,a=void 0===o||o,u=r.altAxis,s=void 0===u||u,c=r.fallbackPlacements,l=r.padding,f=r.boundary,d=r.rootBoundary,p=r.altBoundary,h=r.flipVariations,m=void 0===h||h,g=r.allowedAutoPlacements,y=n.options.placement,v=ere(y),b=c||(v!==y&&m?function(t){if(ere(t)===enJ)return[];var n=erO(t);return[erI(t),n,erI(n)]}(y):[erO(y)]),x=[y].concat(b).reduce(function(t,r){var i,o,a,u,s,c,p,h,y,v,b,x,_,S;return t.concat(ere(r)===enJ?(o={placement:r,boundary:f,rootBoundary:d,padding:l,flipVariations:m,allowedAutoPlacements:g},u=(a=o).placement,s=a.boundary,c=a.rootBoundary,p=a.padding,h=a.flipVariations,v=void 0===(y=a.allowedAutoPlacements)?en2:y,0===(_=(x=(b=erx(u))?h?en1:en1.filter(function(t){return erx(t)===b}):enY).filter(function(t){return v.indexOf(t)>=0})).length&&(_=x),Object.keys(S=_.reduce(function(t,r){return t[r]=erP(n,{placement:r,boundary:s,rootBoundary:c,padding:p})[ere(r)],t},{})).sort(function(t,n){return S[t]-S[n]})):r)},[]),_=n.rects.reference,S=n.rects.popper,T=new Map,w=!0,O=x[0],k=0;k<x.length;k++){var I=x[k],M=ere(I),C=erx(I)===enQ,R=["top",enH].indexOf(M)>=0,E=R?"width":"height",A=erP(n,{placement:I,boundary:f,rootBoundary:d,altBoundary:p,padding:l}),j=R?C?enZ:enG:C?enH:"top";_[E]>S[E]&&(j=erO(j));var N=erO(j),P=[];if(a&&P.push(A[M]<=0),s&&P.push(A[j]<=0,A[N]<=0),P.every(function(t){return t})){O=I,w=!1;break}T.set(I,P)}if(w)for(var L=m?3:1,F=function(t){var n=x.find(function(n){var r=T.get(n);if(r)return r.slice(0,t).every(function(t){return t})});if(n)return O=n,"break"},D=L;D>0&&"break"!==F(D);D--);n.placement!==O&&(n.modifiersData[i]._skip=!0,n.placement=O,n.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var n,r=t.state,i=t.options,o=t.name,a=i.mainAxis,u=i.altAxis,s=i.boundary,c=i.rootBoundary,l=i.altBoundary,f=i.padding,d=i.tether,p=void 0===d||d,h=i.tetherOffset,m=void 0===h?0:h,g=erP(r,{boundary:s,rootBoundary:c,padding:f,altBoundary:l}),y=ere(r.placement),v=erx(r.placement),b=!v,x=erm(y),_="x"===x?"y":"x",S=r.modifiersData.popperOffsets,T=r.rects.reference,w=r.rects.popper,O="function"==typeof m?m(Object.assign({},r.rects,{placement:r.placement})):m,k="number"==typeof O?{mainAxis:O,altAxis:O}:Object.assign({mainAxis:0,altAxis:0},O),I=r.modifiersData.offset?r.modifiersData.offset[r.placement]:null,M={x:0,y:0};if(S){if(void 0===a||a){var C,R="y"===x?"top":enG,E="y"===x?enH:enZ,A="y"===x?"height":"width",j=S[x],N=j+g[R],P=j-g[E],L=p?-w[A]/2:0,F=v===enQ?T[A]:w[A],D=v===enQ?-w[A]:-T[A],W=r.elements.arrow,U=p&&W?eru(W):{width:0,height:0},z=r.modifiersData["arrow#persistent"]?r.modifiersData["arrow#persistent"].padding:ery(),B=z[R],q=z[E],V=erg(0,T[A],U[A]),$=b?T[A]/2-L-V-B-k.mainAxis:F-V-B-k.mainAxis,K=b?-T[A]/2+L+V+q+k.mainAxis:D+V+q+k.mainAxis,H=r.elements.arrow&&erh(r.elements.arrow),Z=H?"y"===x?H.clientTop||0:H.clientLeft||0:0,G=null!=(C=null==I?void 0:I[x])?C:0,J=erg(p?ern(N,j+$-G-Z):N,j,p?ert(P,j+K-G):P);S[x]=J,M[x]=J-j}if(void 0!==u&&u){var Y,Q,X,ee,et,en=S[_],er="y"===_?"height":"width",ei=en+g["x"===x?"top":enG],eo=en-g["x"===x?enH:enZ],ea=-1!==["top",enG].indexOf(y),eu=null!=(et=null==I?void 0:I[_])?et:0,es=ea?ei:en-T[er]-w[er]-eu+k.altAxis,ec=ea?en+T[er]+w[er]-eu-k.altAxis:eo,el=p&&ea?(ee=erg(es,en,ec))>ec?ec:ee:erg(p?es:ei,en,p?ec:eo);S[_]=el,M[_]=el-en}r.modifiersData[o]=M}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(t){var n,r=t.state,i=t.name,o=t.options,a=r.elements.arrow,u=r.modifiersData.popperOffsets,s=ere(r.placement),c=erm(s),l=[enG,enZ].indexOf(s)>=0?"height":"width";if(!(!a||!u)){var f,d,p=erv("number"!=typeof(f="function"==typeof(f=o.padding)?f(Object.assign({},r.rects,{placement:r.placement})):f)?f:erb(f,enY)),h=eru(a),m=r.rects.reference[l]+r.rects.reference[c]-u[c]-r.rects.popper[l],g=u[c]-r.rects.reference[c],y=erh(a),v=y?"y"===c?y.clientHeight||0:y.clientWidth||0:0,b=p["y"===c?"top":enG],x=v-h[l]-p["y"===c?enH:enZ],_=v/2-h[l]/2+(m/2-g/2),S=erg(b,_,x);r.modifiersData[i]=((n={})[c]=S,n.centerOffset=S-_,n)}},effect:function(t){var n=t.state,r=t.options.element,i=void 0===r?"[data-popper-arrow]":r;null==i||("string"!=typeof i||(i=n.elements.popper.querySelector(i)))&&ers(n.elements.popper,i)&&(n.elements.arrow=i)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var n=t.state,r=t.name,i=n.rects.reference,o=n.rects.popper,a=n.modifiersData.preventOverflow,u=erP(n,{elementContext:"reference"}),s=erP(n,{altBoundary:!0}),c=erL(u,i),l=erL(s,o,a),f=erF(c),d=erF(l);n.modifiersData[r]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:f,hasPopperEscaped:d},n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":d})}}]},erH=void 0===(erK=(er$=erV).defaultModifiers)?[]:erK,erG=void 0===(erZ=er$.defaultOptions)?erD:erZ,function(t,n,r){void 0===r&&(r=erG);var i,o,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},erD,erG),modifiersData:{},elements:{reference:t,popper:n},attributes:{},styles:{}},u=[],s=!1,c={state:a,setOptions:function(r){var i,o,s,f,d,p,h,m,g="function"==typeof r?r(a.options):r;l(),a.options=Object.assign({},erG,a.options,g),a.scrollParents={reference:en6(t)?erE(t):t.contextElement?erE(t.contextElement):[],popper:erE(n)};var y=(s=Object.keys(o=(i=[].concat(erH,a.options.modifiers)).reduce(function(t,n){var r=t[n.name];return t[n.name]=r?Object.assign({},r,n,{options:Object.assign({},r.options,n.options),data:Object.assign({},r.data,n.data)}):n,t},{})).map(function(t){return o[t]}),d=new Map,p=new Set,h=[],s.forEach(function(t){d.set(t.name,t)}),s.forEach(function(t){p.has(t.name)||function t(n){p.add(n.name),[].concat(n.requires||[],n.requiresIfExists||[]).forEach(function(n){if(!p.has(n)){var r=d.get(n);r&&t(r)}}),h.push(n)}(t)}),en3.reduce(function(t,n){return t.concat(h.filter(function(t){return t.phase===n}))},[]));return a.orderedModifiers=y.filter(function(t){return t.enabled}),a.orderedModifiers.forEach(function(t){var n=t.name,r=t.options,i=t.effect;if("function"==typeof i){var o=i({state:a,name:n,instance:c,options:void 0===r?{}:r}),s=function(){};u.push(o||s)}}),c.update()},forceUpdate:function(){if(!s){var t,n,r,i,o,u,l,f,d,p,h,m,g,y,v,b=a.elements,x=b.reference,_=b.popper;if(erW(x,_)){a.rects={reference:(t=x,n=erh(_),r="fixed"===a.options.strategy,f=en9(n),d=en9(n)&&(u=err((o=(i=n).getBoundingClientRect()).width)/i.offsetWidth||1,l=err(o.height)/i.offsetHeight||1,1!==u||1!==l),p=erf(n),h=era(t,d,r),m={scrollLeft:0,scrollTop:0},g={x:0,y:0},(f||!f&&!r)&&(("body"!==en4(n)||erR(p))&&(m=(y=n)!==en5(y)&&en9(y)?{scrollLeft:(v=y).scrollLeft,scrollTop:v.scrollTop}:erM(y)),en9(n)?(g=era(n,!0),g.x+=n.clientLeft,g.y+=n.clientTop):p&&(g.x=erC(p))),{x:h.left+m.scrollLeft-g.x,y:h.top+m.scrollTop-g.y,width:h.width,height:h.height}),popper:eru(_)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach(function(t){return a.modifiersData[t.name]=Object.assign({},t.data)});for(var S=0;S<a.orderedModifiers.length;S++){if(!0===a.reset){a.reset=!1,S=-1;continue}var T=a.orderedModifiers[S],w=T.fn,O=T.options,k=void 0===O?{}:O,I=T.name;"function"==typeof w&&(a=w({state:a,options:k,name:I,instance:c})||a)}}}},update:function(){return o||(o=new Promise(function(t){Promise.resolve().then(function(){o=void 0,t(new Promise(function(t){c.forceUpdate(),t(a)}))})})),o},destroy:function(){l(),s=!0}};if(!erW(t,n))return c;function l(){u.forEach(function(t){return t()}),u=[]}return c.setOptions(r).then(function(t){!s&&r.onFirstUpdate&&r.onFirstUpdate(t)}),c}),erY="tippy-content",erQ="tippy-arrow",erX="tippy-svg-arrow",er0={passive:!0,capture:!0},er1=function(){return document.body};function er2(t,n,r){return Array.isArray(t)?t[n]??(Array.isArray(r)?r[n]:r):t}function er3(t,n){var r=({}).toString.call(t);return 0===r.indexOf("[object")&&r.indexOf(n+"]")>-1}function er4(t,n){return"function"==typeof t?t.apply(void 0,n):t}function er5(t,n){var r;return 0===n?t:function(i){clearTimeout(r),r=setTimeout(function(){t(i)},n)}}function er6(t){return[].concat(t)}function er9(t,n){-1===t.indexOf(n)&&t.push(n)}function er8(t){return[].slice.call(t)}function er7(t){return Object.keys(t).reduce(function(n,r){return void 0!==t[r]&&(n[r]=t[r]),n},{})}function eie(){return document.createElement("div")}function eit(t){return["Element","Fragment"].some(function(n){return er3(t,n)})}function ein(t,n){t.forEach(function(t){t&&(t.style.transitionDuration=n+"ms")})}function eir(t,n){t.forEach(function(t){t&&t.setAttribute("data-state",n)})}function eii(t,n,r){var i=n+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(n){t[i](n,r)})}function eio(t,n){for(var r,i=n;i;){if(t.contains(i))return!0;i=null==i.getRootNode||null==(r=i.getRootNode())?void 0:r.host}return!1}var eia={isTouch:!1},eiu=0;function eis(){eia.isTouch||(eia.isTouch=!0,window.performance&&document.addEventListener("mousemove",eic))}function eic(){var t=performance.now();t-eiu<20&&(eia.isTouch=!1,document.removeEventListener("mousemove",eic)),eiu=t}function eil(){var t,n=document.activeElement;if(n&&n._tippy&&n._tippy.reference===n){var r=n._tippy;n.blur&&!r.state.isVisible&&n.blur()}}var eif=!!("u">typeof window&&"u">typeof document)&&!!window.msCrypto,eid=Object.assign({appendTo:er1,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},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),eip=Object.keys(eid),eih=function(t){Object.keys(t).forEach(function(n){eid[n]=t[n]})};function eim(t){var n=(t.plugins||[]).reduce(function(n,r){var i,o=r.name,a=r.defaultValue;return o&&(n[o]=void 0!==t[o]?t[o]:null!=(i=eid[o])?i:a),n},{});return Object.assign({},t,n)}function eig(t,n){var r,i,o=Object.assign({},n,{content:er4(n.content,[t])},n.ignoreAttributes?{}:((i=n.plugins)?Object.keys(eim(Object.assign({},eid,{plugins:i}))):eip).reduce(function(n,r){var i=(t.getAttribute("data-tippy-"+r)||"").trim();if(!i)return n;if("content"===r)n[r]=i;else try{n[r]=JSON.parse(i)}catch{n[r]=i}return n},{}));return o.aria=Object.assign({},eid.aria,o.aria),o.aria={expanded:"auto"===o.aria.expanded?n.interactive:o.aria.expanded,content:"auto"===o.aria.content?n.interactive?null:"describedby":o.aria.content},o}var eiy=function(){return"innerHTML"};function eiv(t,n){t[eiy()]=n}function eib(t){var n=eie();return!0===t?n.className=erQ:(n.className=erX,eit(t)?n.appendChild(t):eiv(n,t)),n}function eix(t,n){eit(n.content)?(eiv(t,""),t.appendChild(n.content)):"function"!=typeof n.content&&(n.allowHTML?eiv(t,n.content):t.textContent=n.content)}function ei_(t){var n=t.firstElementChild,r=er8(n.children);return{box:n,content:r.find(function(t){return t.classList.contains(erY)}),arrow:r.find(function(t){return t.classList.contains(erQ)||t.classList.contains(erX)}),backdrop:r.find(function(t){return t.classList.contains("tippy-backdrop")})}}function eiS(t){var n=eie(),r=eie();r.className="tippy-box",r.setAttribute("data-state","hidden"),r.setAttribute("tabindex","-1");var i=eie();function o(r,i){var o=ei_(n),a=o.box,u=o.content,s=o.arrow;i.theme?a.setAttribute("data-theme",i.theme):a.removeAttribute("data-theme"),"string"==typeof i.animation?a.setAttribute("data-animation",i.animation):a.removeAttribute("data-animation"),i.inertia?a.setAttribute("data-inertia",""):a.removeAttribute("data-inertia"),a.style.maxWidth="number"==typeof i.maxWidth?i.maxWidth+"px":i.maxWidth,i.role?a.setAttribute("role",i.role):a.removeAttribute("role"),(r.content!==i.content||r.allowHTML!==i.allowHTML)&&eix(u,t.props),i.arrow?s?r.arrow!==i.arrow&&(a.removeChild(s),a.appendChild(eib(i.arrow))):a.appendChild(eib(i.arrow)):s&&a.removeChild(s)}return i.className=erY,i.setAttribute("data-state","hidden"),eix(i,t.props),n.appendChild(r),r.appendChild(i),o(t.props,t.props),{popper:n,onUpdate:o}}eiS.$$tippy=!0;var eiT=1,eiw=[],eiO=[];function eik(t,n){void 0===n&&(n={});var r,i,o=eid.plugins.concat(n.plugins||[]);document.addEventListener("touchstart",eis,er0),window.addEventListener("blur",eil);var a,u=Object.assign({},n,{plugins:o}),s=(eit(t)?[t]:er3(t,"NodeList")?er8(t):Array.isArray(t)?t:er8(document.querySelectorAll(t))).reduce(function(t,n){var r=n&&function(t,n){var r,i,o,a,u,s,c,l,f=eig(t,Object.assign({},eid,eim(er7(n)))),d=!1,p=!1,h=!1,m=!1,g=[],y=er5(Z,f.interactiveDebounce),v=eiT++,b=(r=f.plugins).filter(function(t,n){return r.indexOf(t)===n}),x={id:v,reference:t,popper:eie(),popperInstance:null,props:f,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:b,clearDelayTimeouts:function(){clearTimeout(i),clearTimeout(o),cancelAnimationFrame(a)},setProps:function(n){if(!x.state.isDestroyed){N("onBeforeUpdate",[x,n]),K();var r=x.props,i=eig(t,Object.assign({},r,er7(n),{ignoreAttributes:!0}));x.props=i,$(),r.interactiveDebounce!==i.interactiveDebounce&&(F(),y=er5(Z,i.interactiveDebounce)),r.triggerTarget&&!i.triggerTarget?er6(r.triggerTarget).forEach(function(t){t.removeAttribute("aria-expanded")}):i.triggerTarget&&t.removeAttribute("aria-expanded"),L(),j(),T&&T(r,i),x.popperInstance&&(Q(),ee().forEach(function(t){requestAnimationFrame(t._tippy.popperInstance.forceUpdate)})),N("onAfterUpdate",[x,n])}},setContent:function(t){x.setProps({content:t})},show:function(){var t=x.state.isVisible,n=x.state.isDestroyed,r=!x.state.isEnabled,i=eia.isTouch&&!x.props.touch,o=er2(x.props.duration,0,eid.duration);if(!(t||n||r||i)&&!C().hasAttribute("disabled")&&(N("onShow",[x],!1),!1!==x.props.onShow(x))){if(x.state.isVisible=!0,M()&&(S.style.visibility="visible"),j(),z(),x.state.isMounted||(S.style.transition="none"),M()){var a,u,s,l,f=E();ein([f.box,f.content],0)}c=function(){var t;if(!(!x.state.isVisible||m)){if(m=!0,S.offsetHeight,S.style.transition=x.props.moveTransition,M()&&x.props.animation){var n,r,i=E(),a=i.box,u=i.content;ein([a,u],o),eir([a,u],"visible")}P(),L(),er9(eiO,x),null==(t=x.popperInstance)||t.forceUpdate(),N("onMount",[x]),x.props.animation&&M()&&q(o,r=function(){x.state.isShown=!0,N("onShown",[x])})}},u=x.props.appendTo,s=C(),(a=x.props.interactive&&u===er1||"parent"===u?s.parentNode:er4(u,[s])).contains(S)||a.appendChild(S),x.state.isMounted=!0,Q()}},hide:function(){var t=!x.state.isVisible,n=x.state.isDestroyed,r=!x.state.isEnabled,i=er2(x.props.duration,1,eid.duration);if(!(t||n||r)&&(N("onHide",[x],!1),!1!==x.props.onHide(x))){if(x.state.isVisible=!1,x.state.isShown=!1,m=!1,d=!1,M()&&(S.style.visibility="hidden"),F(),B(),j(!0),M()){var o,a,u=E(),s=u.box,c=u.content;x.props.animation&&(ein([s,c],i),eir([s,c],"hidden"))}P(),L(),x.props.animation?M()&&(a=x.unmount,q(i,function(){!x.state.isVisible&&S.parentNode&&S.parentNode.contains(S)&&a()})):x.unmount()}},hideWithInteractivity:function(t){R().addEventListener("mousemove",y),er9(eiw,y),y(t)},enable:function(){x.state.isEnabled=!0},disable:function(){x.hide(),x.state.isEnabled=!1},unmount:function(){x.state.isVisible&&x.hide(),x.state.isMounted&&(X(),ee().forEach(function(t){t._tippy.unmount()}),S.parentNode&&S.parentNode.removeChild(S),eiO=eiO.filter(function(t){return t!==x}),x.state.isMounted=!1,N("onHidden",[x]))},destroy:function(){x.state.isDestroyed||(x.clearDelayTimeouts(),x.unmount(),K(),delete t._tippy,x.state.isDestroyed=!0,N("onDestroy",[x]))}};if(!f.render)return x;var _=f.render(x),S=_.popper,T=_.onUpdate;S.setAttribute("data-tippy-root",""),S.id="tippy-"+x.id,x.popper=S,t._tippy=x,S._tippy=x;var w=b.map(function(t){return t.fn(x)}),O=t.hasAttribute("aria-expanded");return $(),L(),j(),N("onCreate",[x]),f.showOnCreate&&et(),S.addEventListener("mouseenter",function(){x.props.interactive&&x.state.isVisible&&x.clearDelayTimeouts()}),S.addEventListener("mouseleave",function(){x.props.interactive&&x.props.trigger.indexOf("mouseenter")>=0&&R().addEventListener("mousemove",y)}),x;function k(){var t=x.props.touch;return Array.isArray(t)?t:[t,0]}function I(){return"hold"===k()[0]}function M(){var t;return!!(null!=(t=x.props.render)&&t.$$tippy)}function C(){return l||t}function R(){var t,n,r,i=C().parentNode;return i&&null!=(r=er6(i)[0])&&null!=(n=r.ownerDocument)&&n.body?r.ownerDocument:document}function E(){return ei_(S)}function A(t){return x.state.isMounted&&!x.state.isVisible||eia.isTouch||u&&"focus"===u.type?0:er2(x.props.delay,t?0:1,eid.delay)}function j(t){void 0===t&&(t=!1),S.style.pointerEvents=x.props.interactive&&!t?"":"none",S.style.zIndex=""+x.props.zIndex}function N(t,n,r){if(void 0===r&&(r=!0),w.forEach(function(r){r[t]&&r[t].apply(r,n)}),r){var i;(i=x.props)[t].apply(i,n)}}function P(){var n=x.props.aria;if(n.content){var r="aria-"+n.content,i=S.id;er6(x.props.triggerTarget||t).forEach(function(t){var n=t.getAttribute(r);if(x.state.isVisible)t.setAttribute(r,n?n+" "+i:i);else{var o=n&&n.replace(i,"").trim();o?t.setAttribute(r,o):t.removeAttribute(r)}})}}function L(){!(O||!x.props.aria.expanded)&&er6(x.props.triggerTarget||t).forEach(function(t){x.props.interactive?t.setAttribute("aria-expanded",x.state.isVisible&&t===C()?"true":"false"):t.removeAttribute("aria-expanded")})}function F(){R().removeEventListener("mousemove",y),eiw=eiw.filter(function(t){return t!==y})}function D(n){if(!(eia.isTouch&&(h||"mousedown"===n.type))){var r=n.composedPath&&n.composedPath()[0]||n.target;if(!(x.props.interactive&&eio(S,r))){if(er6(x.props.triggerTarget||t).some(function(t){return eio(t,r)})){if(eia.isTouch||x.state.isVisible&&x.props.trigger.indexOf("click")>=0)return}else N("onClickOutside",[x,n]);!0===x.props.hideOnClick&&(x.clearDelayTimeouts(),x.hide(),p=!0,setTimeout(function(){p=!1}),x.state.isMounted||B())}}}function W(){h=!0}function U(){h=!1}function z(){var t=R();t.addEventListener("mousedown",D,!0),t.addEventListener("touchend",D,er0),t.addEventListener("touchstart",U,er0),t.addEventListener("touchmove",W,er0)}function B(){var t=R();t.removeEventListener("mousedown",D,!0),t.removeEventListener("touchend",D,er0),t.removeEventListener("touchstart",U,er0),t.removeEventListener("touchmove",W,er0)}function q(t,n){var r=E().box;function i(t){t.target===r&&(eii(r,"remove",i),n())}if(0===t)return n();eii(r,"remove",s),eii(r,"add",i),s=i}function V(n,r,i){void 0===i&&(i=!1),er6(x.props.triggerTarget||t).forEach(function(t){t.addEventListener(n,r,i),g.push({node:t,eventType:n,handler:r,options:i})})}function $(){var t;I()&&(V("touchstart",H,{passive:!0}),V("touchend",G,{passive:!0})),(t=x.props.trigger).split(/\s+/).filter(Boolean).forEach(function(t){if("manual"!==t)switch(V(t,H),t){case"mouseenter":V("mouseleave",G);break;case"focus":V(eif?"focusout":"blur",J);break;case"focusin":V("focusout",J)}})}function K(){g.forEach(function(t){var n=t.node,r=t.eventType,i=t.handler,o=t.options;n.removeEventListener(r,i,o)}),g=[]}function H(t){var n,r=!1;if(!(!x.state.isEnabled||Y(t)||p)){var i,o=(null==(n=u)?void 0:n.type)==="focus";u=t,l=t.currentTarget,L(),!x.state.isVisible&&er3(t,"MouseEvent")&&eiw.forEach(function(n){return n(t)}),"click"===t.type&&(0>x.props.trigger.indexOf("mouseenter")||d)&&!1!==x.props.hideOnClick&&x.state.isVisible?r=!0:et(t),"click"===t.type&&(d=!r),r&&!o&&en(t)}}function Z(t){var n,r,i,o,a=t.target,u=C().contains(a)||S.contains(a);!("mousemove"===t.type&&u)&&(n=ee().concat(S).map(function(t){var n,r=null==(n=t._tippy.popperInstance)?void 0:n.state;return r?{popperRect:t.getBoundingClientRect(),popperState:r,props:f}:null}).filter(Boolean),i=(r=t).clientX,o=r.clientY,n.every(function(t){var n,r=t.popperRect,a=t.popperState,u=t.props.interactiveBorder,s=(n=a.placement).split("-")[0],c=a.modifiersData.offset;if(!c)return!0;var l="bottom"===s?c.top.y:0,f="top"===s?c.bottom.y:0,d="right"===s?c.left.x:0,p="left"===s?c.right.x:0,h=r.top-o+l>u,m=o-r.bottom-f>u,g=r.left-i+d>u,y=i-r.right-p>u;return h||m||g||y})&&(F(),en(t)))}function G(t){if(!(Y(t)||x.props.trigger.indexOf("click")>=0&&d)){if(x.props.interactive){x.hideWithInteractivity(t);return}en(t)}}function J(t){0>x.props.trigger.indexOf("focusin")&&t.target!==C()||x.props.interactive&&t.relatedTarget&&S.contains(t.relatedTarget)||en(t)}function Y(t){return!!eia.isTouch&&I()!==t.type.indexOf("touch")>=0}function Q(){X();var n=x.props,r=n.popperOptions,i=n.placement,o=n.offset,a=n.getReferenceClientRect,u=n.moveTransition,s=M()?ei_(S).arrow:null,l=a?{getBoundingClientRect:a,contextElement:a.contextElement||C()}:t,f=[{name:"offset",options:{offset:o}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!u}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(t){var n=t.state;if(M()){var r=E().box;["placement","reference-hidden","escaped"].forEach(function(t){"placement"===t?r.setAttribute("data-placement",n.placement):n.attributes.popper["data-popper-"+t]?r.setAttribute("data-"+t,""):r.removeAttribute("data-"+t)}),n.attributes.popper={}}}}];M()&&s&&f.push({name:"arrow",options:{element:s,padding:3}}),f.push.apply(f,(null==r?void 0:r.modifiers)||[]),x.popperInstance=erJ(l,S,Object.assign({},r,{placement:i,onFirstUpdate:c,modifiers:f}))}function X(){x.popperInstance&&(x.popperInstance.destroy(),x.popperInstance=null)}function ee(){return er8(S.querySelectorAll("[data-tippy-root]"))}function et(t){x.clearDelayTimeouts(),t&&N("onTrigger",[x,t]),z();var n=A(!0),r=k(),o=r[0],a=r[1];eia.isTouch&&"hold"===o&&a&&(n=a),n?i=setTimeout(function(){x.show()},n):x.show()}function en(t){if(x.clearDelayTimeouts(),N("onUntrigger",[x,t]),!x.state.isVisible){B();return}if(!(x.props.trigger.indexOf("mouseenter")>=0&&x.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(t.type)>=0&&d)){var n=A(!1);n?o=setTimeout(function(){x.state.isVisible&&x.hide()},n):a=requestAnimationFrame(function(){x.hide()})}}}(n,u);return r&&t.push(r),t},[]);return eit(t)?s[0]:s}eik.defaultProps=eid,eik.setDefaultProps=eih,eik.currentInput=eia,Object.assign({},en7,{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)}}),eik.setDefaultProps({render:eiS});class eiI{constructor({editor:t,element:n,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:a}){this.preventHide=!1,this.shouldShow=({view:t,state:n,from:r,to:i})=>{let{doc:o,selection:a}=n,{empty:u}=a,s=!o.textBetween(r,i).length&&etm(n.selection),c=this.element.contains(document.activeElement);return!(!(t.hasFocus()||c)||u||s||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:t})=>{var n;if(this.preventHide){this.preventHide=!1;return}null!=t&&t.relatedTarget&&!(null===(n=this.element.parentNode)||void 0===n)&&n.contains(t.relatedTarget)||this.hide()},this.tippyBlurHandler=t=>{this.blurHandler({event:t})},this.handleDebouncedUpdate=(t,n)=>{let r=!(null!=n&&n.selection.eq(t.state.selection)),i=!(null!=n&&n.doc.eq(t.state.doc));(r||i)&&(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(t,r,i,n)},this.updateDelay))},this.updateHandler=(t,n,r,i)=>{var o,a,u;let{state:s,composing:c}=t,{selection:l}=s;if(c||!n&&!r)return;this.createTooltip();let{ranges:f}=l,d=Math.min(...f.map(t=>t.$from.pos)),p=Math.max(...f.map(t=>t.$to.pos));if(!(null===(o=this.shouldShow)||void 0===o?void 0:o.call(this,{editor:this.editor,view:t,state:s,oldState:i,from:d,to:p}))){this.hide();return}null===(a=this.tippy)||void 0===a||a.setProps({getReferenceClientRect:(null===(u=this.tippyOptions)||void 0===u?void 0:u.getReferenceClientRect)||(()=>{var n;if((n=s.selection)instanceof Yf){let r=t.nodeDOM(d),i=r.dataset.nodeViewWrapper?r:r.querySelector("[data-node-view-wrapper]");if(i&&(r=i.firstChild),r)return r.getBoundingClientRect()}return function(t,n,r){let i=t.state.doc.content.size,o=etg(n,0,i),a=etg(r,0,i),u=t.coordsAtPos(o),s=t.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={top:c,bottom:l,left:f,right:d,width:d-f,height:l-c,x:f,y:c};return{...p,toJSON:()=>p}}(t,d,p)})}),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(){let{element:t}=this.editor.options,n=!!t.parentElement;this.tippy||!n||(this.tippy=eik(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){let{state:r}=t,i=r.selection.$from.pos!==r.selection.$to.pos;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(t,n);return}let o=!(null!=n&&n.selection.eq(t.state.selection)),a=!(null!=n&&n.doc.eq(t.state.doc));this.updateHandler(t,o,a,n)}show(){var t;null===(t=this.tippy)||void 0===t||t.show()}hide(){var t;null===(t=this.tippy)||void 0===t||t.hide()}destroy(){var t,n;!(null===(t=this.tippy)||void 0===t)&&t.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),null===(n=this.tippy)||void 0===n||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)}}let eiM=t=>new YT({key:"string"==typeof t.pluginKey?new Yk(t.pluginKey):t.pluginKey,view:n=>new eiI({view:n,...t})});ee3.create({name:"bubbleMenu",addOptions:()=>({element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}),addProseMirrorPlugins(){return this.options.element?[eiM({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});let eiC=t=>{let[n,r]=(0,c.useState)(null);return(0,c.useEffect)(()=>{if(!n||t.editor.isDestroyed)return;let{pluginKey:r="bubbleMenu",editor:i,tippyOptions:o={},updateDelay:a,shouldShow:u=null}=t,s=eiM({updateDelay:a,editor:i,element:n,pluginKey:r,shouldShow:u,tippyOptions:o});return i.registerPlugin(s),()=>i.unregisterPlugin(r)},[t.editor,n]),c.createElement("div",{ref:r,className:t.className,style:{visibility:"hidden"}},t.children)};class eiR extends en_{constructor(){super(...arguments),this.contentComponent=null}}let eiE=({renderers:t})=>c.createElement(c.Fragment,null,Object.entries(t).map(([t,n])=>v.createPortal(n.reactElement,n.element,t)));class eiA extends c.Component{constructor(t){super(t),this.editorContentRef=c.createRef(),this.initialized=!1,this.state={renderers:{}}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){let{editor:t}=this.props;if(t&&t.options.element){if(t.contentComponent)return;let 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?(0,v.flushSync)(t):t()}setRenderer(t,n){this.maybeFlushSync(()=>{this.setState(({renderers:r})=>({renderers:{...r,[t]:n}}))})}removeRenderer(t){this.maybeFlushSync(()=>{this.setState(({renderers:n})=>{let r={...n};return delete r[t],{renderers:r}})})}componentWillUnmount(){let{editor:t}=this.props;if(!t||(this.initialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),t.contentComponent=null,!t.options.element.firstChild))return;let n=document.createElement("div");n.append(...t.options.element.childNodes),t.setOptions({element:n})}render(){let{editor:t,...n}=this.props;return c.createElement(c.Fragment,null,c.createElement("div",{ref:this.editorContentRef,...n}),c.createElement(eiE,{renderers:this.state.renderers}))}}let eij=c.memo(eiA),eiN=(0,c.createContext)({onDragStart:void 0}),eiP=()=>(0,c.useContext)(eiN),eiL=c.forwardRef((t,n)=>{let{onDragStart:r}=eiP(),i=t.as||"div";return c.createElement(i,{...t,ref:n,"data-node-view-wrapper":"",onDragStart:r,style:{whiteSpace:"normal",...t.style}})});class eiF{constructor(t,{editor:n,props:r={},as:i="div",className:o="",attrs:a}){this.ref=null,this.id=Math.floor(4294967295*Math.random()).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(t=>{this.element.setAttribute(t,a[t])}),this.render()}render(){var t,n,r,i,o;let a=this.component,u=this.props;("function"==typeof a&&a.prototype&&a.prototype.isReactComponent||"object"==typeof a&&(null===(o=a.$$typeof)||void 0===o?void 0:o.toString())==="Symbol(react.forward_ref)")&&(u.ref=t=>{this.ref=t}),this.reactElement=c.createElement(a,{...u}),null===(n=null===(t=this.editor)||void 0===t?void 0:t.contentComponent)||void 0===n||n.setRenderer(this.id,this)}updateProps(t={}){this.props={...this.props,...t},this.render()}destroy(){var t,n;null===(n=null===(t=this.editor)||void 0===t?void 0:t.contentComponent)||void 0===n||n.removeRenderer(this.id)}}class eiD extends enI{mount(){let t={editor:this.editor,node:this.node,decorations:this.decorations,selected:!1,extension:this.extension,getPos:()=>this.getPos(),updateAttributes:(t={})=>this.updateAttributes(t),deleteNode:()=>this.deleteNode()};if(!this.component.displayName){var n;this.component.displayName=(n=this.extension.name).charAt(0).toUpperCase()+n.substring(1)}let r=t=>{let n=this.component,r=this.onDragStart.bind(this),i=t=>{t&&this.contentDOMElement&&t.firstChild!==this.contentDOMElement&&t.appendChild(this.contentDOMElement)};return c.createElement(c.Fragment,null,c.createElement(eiN.Provider,{value:{onDragStart:r,nodeViewContentRef:i}},c.createElement(n,{...t})))};r.displayName="ReactNodeView",this.contentDOMElement=this.node.isLeaf?null:document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement&&(this.contentDOMElement.style.whiteSpace="inherit");let i=this.node.isInline?"span":"div";this.options.as&&(i=this.options.as);let{className:o=""}=this.options;this.renderer=new eiF(r,{editor:this.editor,props:t,as:i,className:`node-${this.node.type.name} ${o}`.trim(),attrs:this.options.attrs})}get dom(){var t;if(this.renderer.element.firstElementChild&&!(!(null===(t=this.renderer.element.firstElementChild)||void 0===t)&&t.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}update(t,n){let r=t=>{this.renderer.updateProps(t)};if(t.type!==this.node.type)return!1;if("function"==typeof this.options.update){let i=this.node,o=this.decorations;return this.node=t,this.decorations=n,this.options.update({oldNode:i,oldDecorations:o,newNode:t,newDecorations:n,updateProps:()=>r({node:t,decorations:n})})}return t===this.node&&this.decorations===n||(this.node=t,this.decorations=n,r({node:t,decorations:n})),!0}selectNode(){this.renderer.updateProps({selected:!0})}deselectNode(){this.renderer.updateProps({selected:!1})}destroy(){this.renderer.destroy(),this.contentDOMElement=null}}function eiW(t,n){return r=>r.editor.contentComponent?new eiD(t,r,n):{}}var eiU={},eiz={},eiB={};Object.defineProperty(eiB,"__esModule",{value:!0}),eiB.Sections=eiB.DynamicSection=eiB.StaticSection=eiB.sectionReader=void 0;let eiq=oN,eiV=(0,eiq.__importStar)(zm);function ei$(t){return eiV.record(zg.WidgetKey,t)}eiB.sectionReader=ei$,eiB.StaticSection=ei$(qp.StaticWidget),eiB.DynamicSection=ei$(qp.DynamicWidget),eiB.Sections={toStatic:(t,n)=>Object.entries(t).reduce((t,[r,i])=>({...t,[r]:qp.Widgets.toStatic(i,n)}),{})},function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.filterMissingSharedSlices=t.collectWidgets=t.validateSlices=t.toStatic=t.flattenWidgets=t.CustomType=t.StaticCustomType=t.CustomTypeFormat=void 0;let n=oN,r=(0,n.__importStar)(zm);t.CustomTypeFormat={page:"page",custom:"custom"};class i extends Error{constructor(t){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=t,this.message=this._formatError(t)}_formatError(t){return`The following slices doesn't exists in your Prismic repository:
89
+ `,textSerializers:r={}}=t||{};return function(t,n){let r={from:0,to:t.content.size};return ee7(t,r,n)}(this.state.doc,{blockSeparator:n,textSerializers:{...ete(this.schema),...r}})}get isEmpty(){return function(t){var n;let r=null===(n=t.type.createAndFill())||void 0===n?void 0:n.toJSON(),i=t.toJSON();return JSON.stringify(r)===JSON.stringify(i)}(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!(!(null===(t=this.view)||void 0===t)&&t.docView)}};function enI(t){return new ee0({find:t.find,handler({state:n,range:r,match:i}){let o=eeK(t.getAttributes,void 0,i);if(!1===o||null===o)return null;let{tr:a}=n,u=i[i.length-1],s=i[0],c=r.to;if(u){let l=s.search(/\S/),f=r.from+s.indexOf(u),d=f+u.length;if(et3(r.from,r.to,n.doc).filter(n=>n.mark.type.excluded.find(r=>r===t.type&&r!==n.mark.type)).filter(t=>t.to>f).length)return null;d<r.to&&a.delete(d,r.to),f>r.from&&a.delete(r.from+l,f),c=r.from+l+u.length,a.addMark(r.from+l,c,t.type.create(o||{})),a.removeStoredMark(t.type)}}})}function enM(t){return new ee0({find:t.find,handler({state:n,range:r,match:i}){let o=n.doc.resolve(r.from),a=eeK(t.getAttributes,void 0,i)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),t.type))return null;n.tr.delete(r.from,r.to).setBlockType(r.from,r.from,t.type,a)}})}function enC(t){return new ee0({find:t.find,handler({state:n,range:r,match:i,chain:o}){let a=eeK(t.getAttributes,void 0,i)||{},u=n.tr.delete(r.from,r.to),s=u.doc.resolve(r.from).blockRange(),c=s&&JX(s,t.type,a);if(!c)return null;if(u.wrap(s,c),t.keepMarks&&t.editor){let{selection:l,storedMarks:f}=n,{splittableMarks:d}=t.editor.extensionManager,p=f||l.$to.parentOffset&&l.$from.marks();if(p){let h=p.filter(t=>d.includes(t.type.name));u.ensureMarks(h)}}if(t.keepAttributes){let m="bulletList"===t.type.name||"orderedList"===t.type.name?"listItem":"taskList";o().updateAttributes(m,a).run()}let g=u.doc.resolve(r.from-1).nodeBefore;g&&g.type===t.type&&J2(u.doc,r.from-1)&&(!t.joinPredicate||t.joinPredicate(i,g))&&u.join(r.from-1)}})}let enR=class t{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=eeK(eeW(this,"addOptions",{name:this.name}))),this.storage=eeK(eeW(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(n={}){return new t(n)}configure(t={}){let n=this.extend();return n.options=ee9(this.options,t),n.storage=eeK(eeW(n,"addStorage",{name:n.name,options:n.options})),n}extend(n={}){let r=new t(n);return r.parent=this,this.child=r,r.name=n.name?n.name:r.parent.name,n.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${r.name}".`),r.options=eeK(eeW(r,"addOptions",{name:r.name})),r.storage=eeK(eeW(r,"addStorage",{name:r.name,options:r.options})),r}static handleExit({editor:t,mark:n}){let{tr:r}=t.state,i=t.state.selection.$from;if(i.pos===i.end()){let o=i.marks();if(!o.find(t=>(null==t?void 0:t.type.name)===n.name))return!1;let a=o.find(t=>(null==t?void 0:t.type.name)===n.name);return a&&r.removeStoredMark(a),r.insertText(" ",i.pos),t.view.dispatch(r),!0}return!1}};class enE{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=eeK(eeW(this,"addOptions",{name:this.name}))),this.storage=eeK(eeW(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new enE(t)}configure(t={}){let n=this.extend();return n.options=ee9(this.options,t),n.storage=eeK(eeW(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){let n=new enE(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=eeK(eeW(n,"addOptions",{name:n.name})),n.storage=eeK(eeW(n,"addStorage",{name:n.name,options:n.options})),n}}class enA{constructor(t,n,r){this.isDragging=!1,this.component=t,this.editor=n.editor,this.options={stopEvent:null,ignoreMutation:null,...r},this.extension=n.extension,this.node=n.node,this.decorations=n.decorations,this.getPos=n.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(t){var n,r,i,o,a,u,s;let{view:c}=this.editor,l=t.target,f=3===l.nodeType?null===(n=l.parentElement)||void 0===n?void 0:n.closest("[data-drag-handle]"):l.closest("[data-drag-handle]");if(!this.dom||!(null===(r=this.contentDOM)||void 0===r)&&r.contains(l)||!f)return;let d=0,p=0;if(this.dom!==f){let h=this.dom.getBoundingClientRect(),m=f.getBoundingClientRect(),g=null!==(i=t.offsetX)&&void 0!==i?i:null===(o=t.nativeEvent)||void 0===o?void 0:o.offsetX,y=null!==(a=t.offsetY)&&void 0!==a?a:null===(u=t.nativeEvent)||void 0===u?void 0:u.offsetY;d=m.x-h.x+g,p=m.y-h.y+y}null===(s=t.dataTransfer)||void 0===s||s.setDragImage(this.dom,d,p);let v=Yg.create(c.state.doc,this.getPos()),b=c.state.tr.setSelection(v);c.dispatch(b)}stopEvent(t){var n;if(!this.dom)return!1;if("function"==typeof this.options.stopEvent)return this.options.stopEvent({event:t});let r=t.target;if(!(this.dom.contains(r)&&!(!(null===(n=this.contentDOM)||void 0===n)&&n.contains(r))))return!1;let i=t.type.startsWith("drag"),o="drop"===t.type;if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(r.tagName)||r.isContentEditable)&&!o&&!i)return!0;let{isEditable:a}=this.editor,{isDragging:u}=this,s=!!this.node.type.spec.draggable,c=Yg.isSelectable(this.node),l="copy"===t.type,f="paste"===t.type,d="cut"===t.type,p="mousedown"===t.type;if(!s&&c&&i&&t.preventDefault(),s&&i&&!u)return t.preventDefault(),!1;if(s&&a&&!u&&p){let h=r.closest("[data-drag-handle]");h&&(this.dom===h||this.dom.contains(h))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(u||o||l||f||d||p&&c)}ignoreMutation(t){return!this.dom||!this.contentDOM||("function"==typeof this.options.ignoreMutation?this.options.ignoreMutation({mutation:t}):!!this.node.isLeaf||!!this.node.isAtom||!("selection"===t.type||this.dom.contains(t.target)&&"childList"===t.type&&etT()&&this.editor.isFocused&&[...Array.from(t.addedNodes),...Array.from(t.removedNodes)].every(t=>t.isContentEditable))&&(this.contentDOM===t.target&&"attributes"===t.type||!this.contentDOM.contains(t.target)))}updateAttributes(t){this.editor.commands.command(({tr:n})=>{let r=this.getPos();return n.setNodeMarkup(r,void 0,{...this.node.attrs,...t}),!0})}deleteNode(){let t=this.getPos(),n=t+this.node.nodeSize;this.editor.commands.deleteRange({from:t,to:n})}}function enj(t){return new ee3({find:t.find,handler({state:n,range:r,match:i}){let o=eeK(t.getAttributes,void 0,i);if(!1===o||null===o)return null;let{tr:a}=n,u=i[i.length-1],s=i[0],c=r.to;if(u){let l=s.search(/\S/),f=r.from+s.indexOf(u),d=f+u.length;if(et3(r.from,r.to,n.doc).filter(n=>n.mark.type.excluded.find(r=>r===t.type&&r!==n.mark.type)).filter(t=>t.to>f).length)return null;d<r.to&&a.delete(d,r.to),f>r.from&&a.delete(r.from+l,f),c=r.from+l+u.length,a.addMark(r.from+l,c,t.type.create(o||{})),a.removeStoredMark(t.type)}}})}var enN=function(){};enN.prototype.append=function(t){return t.length?(t=enN.from(t),!this.length&&t||t.length<200&&this.leafAppend(t)||this.length<200&&t.leafPrepend(this)||this.appendInner(t)):this},enN.prototype.prepend=function(t){return t.length?enN.from(t).append(this):this},enN.prototype.appendInner=function(t){return new enL(this,t)},enN.prototype.slice=function(t,n){return void 0===t&&(t=0),void 0===n&&(n=this.length),t>=n?enN.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))},enN.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},enN.prototype.forEach=function(t,n,r){void 0===n&&(n=0),void 0===r&&(r=this.length),n<=r?this.forEachInner(t,n,r,0):this.forEachInvertedInner(t,n,r,0)},enN.prototype.map=function(t,n,r){void 0===n&&(n=0),void 0===r&&(r=this.length);var i=[];return this.forEach(function(n,r){return i.push(t(n,r))},n,r),i},enN.from=function(t){return t instanceof enN?t:t&&t.length?new enP(t):enN.empty};var enP=function(t){function n(n){t.call(this),this.values=n}t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n;var r={length:{configurable:!0},depth:{configurable:!0}};return n.prototype.flatten=function(){return this.values},n.prototype.sliceInner=function(t,r){return 0==t&&r==this.length?this:new n(this.values.slice(t,r))},n.prototype.getInner=function(t){return this.values[t]},n.prototype.forEachInner=function(t,n,r,i){for(var o=n;o<r;o++)if(!1===t(this.values[o],i+o))return!1},n.prototype.forEachInvertedInner=function(t,n,r,i){for(var o=n-1;o>=r;o--)if(!1===t(this.values[o],i+o))return!1},n.prototype.leafAppend=function(t){if(this.length+t.length<=200)return new n(this.values.concat(t.flatten()))},n.prototype.leafPrepend=function(t){if(this.length+t.length<=200)return new n(t.flatten().concat(this.values))},r.length.get=function(){return this.values.length},r.depth.get=function(){return 0},Object.defineProperties(n.prototype,r),n}(enN);enN.empty=new enP([]);var enL=function(t){function n(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},n.prototype.getInner=function(t){return t<this.left.length?this.left.get(t):this.right.get(t-this.left.length)},n.prototype.forEachInner=function(t,n,r,i){var o=this.left.length;if(n<o&&!1===this.left.forEachInner(t,n,Math.min(r,o),i)||r>o&&!1===this.right.forEachInner(t,Math.max(n-o,0),Math.min(this.length,r)-o,i+o))return!1},n.prototype.forEachInvertedInner=function(t,n,r,i){var o=this.left.length;if(n>o&&!1===this.right.forEachInvertedInner(t,n-o,Math.max(r,o)-o,i+o)||r<o&&!1===this.left.forEachInvertedInner(t,Math.min(n,o),r,i))return!1},n.prototype.sliceInner=function(t,n){if(0==t&&n==this.length)return this;var r=this.left.length;return n<=r?this.left.slice(t,n):t>=r?this.right.slice(t-r,n-r):this.left.slice(t,r).append(this.right.slice(0,n-r))},n.prototype.leafAppend=function(t){var r=this.right.leafAppend(t);if(r)return new n(this.left,r)},n.prototype.leafPrepend=function(t){var r=this.left.leafPrepend(t);if(r)return new n(r,this.right)},n.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new n(this.left,new n(this.right,t)):new n(this,t)},n}(enN);class enF{constructor(t,n){this.items=t,this.eventCount=n}popEvent(t,n){if(0==this.eventCount)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(o=(i=this.remapping(r,this.items.length)).maps.length);let a=t.tr,u,s,c=[],l=[];return this.items.forEach((t,n)=>{if(!t.step){i||(o=(i=this.remapping(r,n+1)).maps.length),o--,l.push(t);return}if(i){l.push(new enD(t.map));let f=t.step.map(i.slice(o)),d;f&&a.maybeStep(f).doc&&(d=a.mapping.maps[a.mapping.maps.length-1],c.push(new enD(d,void 0,void 0,c.length+l.length))),o--,d&&i.appendMap(d,o)}else a.maybeStep(t.step);if(t.selection)return u=i?t.selection.map(i.slice(o)):t.selection,s=new enF(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){var o,a;let u=[],s=this.eventCount,c=this.items,l=!i&&c.length?c.get(c.length-1):null;for(let f=0;f<t.steps.length;f++){let d=t.steps[f].invert(t.docs[f]),p=new enD(t.mapping.maps[f],d,n),h;(h=l&&l.merge(p))&&(p=h,f?u.pop():c=c.slice(0,c.length-1)),u.push(p),n&&(s++,n=void 0),i||(l=p)}let m=s-r.depth,g;return m>enU&&(o=c,a=m,c=(o.forEach((t,n)=>{if(t.selection&&0==a--)return g=n,!1}),o.slice(g)),s-=m),new enF(c.append(u),s)}remapping(t,n){let r=new JW;return this.items.forEach((n,i)=>{let o=null!=n.mirrorOffset&&i-n.mirrorOffset>=t?r.maps.length-n.mirrorOffset:void 0;r.appendMap(n.map,o)},t,n),r}addMaps(t){return 0==this.eventCount?this:new enF(this.items.append(t.map(t=>new enD(t))),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(t=>{t.selection&&u--},i);let s=n;this.items.forEach(n=>{let i=o.getMirror(--s);if(null==i)return;a=Math.min(a,i);let c=o.maps[i];if(n.step){let l=t.steps[i].invert(t.docs[i]),f=n.selection&&n.selection.map(o.slice(s+1,i));f&&u++,r.push(new enD(c,l,f))}else r.push(new enD(c))},i);let c=[];for(let l=n;l<a;l++)c.push(new enD(o.maps[l]));let f=this.items.slice(0,i).append(c).append(r),d=new enF(f,u);return d.emptyItemCount()>500&&(d=d.compress(this.items.length-r.length)),d}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 enD(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 enF(enN.from(i.reverse()),o)}}enF.empty=new enF(enN.empty,0);class enD{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 enD(n.getMap().invert(),n,this.selection)}}}class enW{constructor(t,n,r,i,o){this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}let enU=20;function enz(t){let n=[];return t.forEach((t,r,i,o)=>n.push(i,o)),n}function enB(t,n){if(!t)return null;let r=[];for(let i=0;i<t.length;i+=2){let o=n.map(t[i],1),a=n.map(t[i+1],-1);o<=a&&r.push(o,a)}return r}function enq(t,n,r,i){let o=enK(n),a=enH.get(n).spec.config,u=(i?t.undone:t.done).popEvent(n,o);if(!u)return;let s=u.selection.resolve(u.transform.doc),c=(i?t.done:t.undone).addTransform(u.transform,n.selection.getBookmark(),a,o),l=new enW(i?c:u.remaining,i?u.remaining:c,null,0,-1);r(u.transform.setSelection(s).setMeta(enH,{redo:i,historyState:l}).scrollIntoView())}let enV=!1,en$=null;function enK(t){let n=t.plugins;if(en$!=n){enV=!1,en$=n;for(let r=0;r<n.length;r++)if(n[r].spec.historyPreserveItems){enV=!0;break}}return enV}let enH=new YE("history"),enZ=new YE("closeHistory"),enG=(t,n)=>{let r=enH.getState(t);return!!r&&0!=r.done.eventCount&&(n&&enq(r,t,n,!1),!0)},enJ=(t,n)=>{let r=enH.getState(t);return!!r&&0!=r.undone.eventCount&&(n&&enq(r,t,n,!0),!0)},enY=ee8.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:t,dispatch:n})=>enG(t,n),redo:()=>({state:t,dispatch:n})=>enJ(t,n)}),addProseMirrorPlugins(){return[function(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new YM({key:enH,state:{init:()=>new enW(enF.empty,enF.empty,null,0,-1),apply:(n,r,i)=>(function(t,n,r,i){let o=r.getMeta(enH),a;if(o)return o.historyState;r.getMeta(enZ)&&(t=new enW(t.done,t.undone,null,0,-1));let u=r.getMeta("appendedTransaction");if(0==r.steps.length)return t;if(u&&u.getMeta(enH))return u.getMeta(enH).redo?new enW(t.done.addTransform(r,void 0,i,enK(n)),t.undone,enz(r.mapping.maps[r.steps.length-1]),t.prevTime,t.prevComposition):new enW(t.done,t.undone.addTransform(r,void 0,i,enK(n)),null,t.prevTime,t.prevComposition);if(!1===r.getMeta("addToHistory")||u&&!1===u.getMeta("addToHistory"))return(a=r.getMeta("rebased"))?new enW(t.done.rebased(r,a),t.undone.rebased(r,a),enB(t.prevRanges,r.mapping),t.prevTime,t.prevComposition):new enW(t.done.addMaps(r.mapping.maps),t.undone.addMaps(r.mapping.maps),enB(t.prevRanges,r.mapping),t.prevTime,t.prevComposition);{let s=r.getMeta("composition"),c=0==t.prevTime||!u&&t.prevComposition!=s&&(t.prevTime<(r.time||0)-i.newGroupDelay||!function(t,n){if(!n)return!1;if(!t.docChanged)return!0;let r=!1;return t.mapping.maps[0].forEach((t,i)=>{for(let o=0;o<n.length;o+=2)t<=n[o+1]&&i>=n[o]&&(r=!0)}),r}(r,t.prevRanges)),l=u?enB(t.prevRanges,r.mapping):enz(r.mapping.maps[r.steps.length-1]);return new enW(t.done.addTransform(r,c?n.selection.getBookmark():void 0,i,enK(n)),enF.empty,l,r.time,s??t.prevComposition)}})(r,i,n,t)},config:t,props:{handleDOMEvents:{beforeinput(t,n){let r=n.inputType,i="historyUndo"==r?enG:"historyRedo"==r?enJ:null;return!!i&&(n.preventDefault(),i(t.state,t.dispatch))}}}})}(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 enQ="bottom",enX="right",en0="left",en1="auto",en2=["top",enQ,enX,en0],en3="start",en4="viewport",en5="popper",en6=en2.reduce(function(t,n){return t.concat([n+"-"+en3,n+"-end"])},[]),en9=[].concat(en2,[en1]).reduce(function(t,n){return t.concat([n,n+"-"+en3,n+"-end"])},[]),en8=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function en7(t){return t?(t.nodeName||"").toLowerCase():null}function ere(t){if(null==t)return window;if("[object Window]"!==t.toString()){var n=t.ownerDocument;return n&&n.defaultView||window}return t}function ert(t){var n=ere(t).Element;return t instanceof n||t instanceof Element}function ern(t){var n=ere(t).HTMLElement;return t instanceof n||t instanceof HTMLElement}function err(t){if(typeof ShadowRoot>"u")return!1;var n=ere(t).ShadowRoot;return t instanceof n||t instanceof ShadowRoot}let eri={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var n=t.state;Object.keys(n.elements).forEach(function(t){var r=n.styles[t]||{},i=n.attributes[t]||{},o=n.elements[t];ern(o)&&en7(o)&&(Object.assign(o.style,r),Object.keys(i).forEach(function(t){var n=i[t];!1===n?o.removeAttribute(t):o.setAttribute(t,!0===n?"":n)}))})},effect:function(t){var n=t.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow),function(){Object.keys(n.elements).forEach(function(t){var i=n.elements[t],o=n.attributes[t]||{},a=Object.keys(n.styles.hasOwnProperty(t)?n.styles[t]:r[t]).reduce(function(t,n){return t[n]="",t},{});ern(i)&&en7(i)&&(Object.assign(i.style,a),Object.keys(o).forEach(function(t){i.removeAttribute(t)}))})}},requires:["computeStyles"]};function ero(t){return t.split("-")[0]}var era=Math.max,eru=Math.min,ers=Math.round;function erc(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function erl(){return!/^((?!chrome|android).)*safari/i.test(erc())}function erf(t,n,r){void 0===n&&(n=!1),void 0===r&&(r=!1);var i=t.getBoundingClientRect(),o=1,a=1;n&&ern(t)&&(o=t.offsetWidth>0&&ers(i.width)/t.offsetWidth||1,a=t.offsetHeight>0&&ers(i.height)/t.offsetHeight||1);var u=(ert(t)?ere(t):window).visualViewport,s=!erl()&&r,c=(i.left+(s&&u?u.offsetLeft:0))/o,l=(i.top+(s&&u?u.offsetTop:0))/a,f=i.width/o,d=i.height/a;return{width:f,height:d,top:l,right:c+f,bottom:l+d,left:c,x:c,y:l}}function erd(t){var n=erf(t),r=t.offsetWidth,i=t.offsetHeight;return 1>=Math.abs(n.width-r)&&(r=n.width),1>=Math.abs(n.height-i)&&(i=n.height),{x:t.offsetLeft,y:t.offsetTop,width:r,height:i}}function erp(t,n){var r=n.getRootNode&&n.getRootNode();if(t.contains(n))return!0;if(r&&err(r)){var i=n;do{if(i&&t.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function erh(t){return ere(t).getComputedStyle(t)}function erm(t){return["table","td","th"].indexOf(en7(t))>=0}function erg(t){return((ert(t)?t.ownerDocument:t.document)||window.document).documentElement}function ery(t){return"html"===en7(t)?t:t.assignedSlot||t.parentNode||(err(t)?t.host:null)||erg(t)}function erv(t){return ern(t)&&"fixed"!==erh(t).position?t.offsetParent:null}function erb(t){for(var n=ere(t),r=erv(t);r&&erm(r)&&"static"===erh(r).position;)r=erv(r);return r&&("html"===en7(r)||"body"===en7(r)&&"static"===erh(r).position)?n:r||function(t){var n=/firefox/i.test(erc());if(/Trident/i.test(erc())&&ern(t)&&"fixed"===erh(t).position)return null;var r=ery(t);for(err(r)&&(r=r.host);ern(r)&&0>["html","body"].indexOf(en7(r));){var i=erh(r);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||n&&"filter"===i.willChange||n&&i.filter&&"none"!==i.filter)return r;r=r.parentNode}return null}(t)||n}function erx(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function er_(t,n,r){return era(t,eru(n,r))}function erS(){return{top:0,right:0,bottom:0,left:0}}function erT(t){return Object.assign({},erS(),t)}function erw(t,n){return n.reduce(function(n,r){return n[r]=t,n},{})}function erO(t){return t.split("-")[1]}var erk={top:"auto",right:"auto",bottom:"auto",left:"auto"};function erI(t){var n,r,i=t.popper,o=t.popperRect,a=t.placement,u=t.variation,s=t.offsets,c=t.position,l=t.gpuAcceleration,f=t.adaptive,d=t.roundOffsets,p=t.isFixed,h=s.x,m=void 0===h?0:h,g=s.y,y=void 0===g?0:g,v="function"==typeof d?d({x:m,y:y}):{x:m,y:y};m=v.x,y=v.y;var b=s.hasOwnProperty("x"),x=s.hasOwnProperty("y"),_=en0,S="top",T=window;if(f){var w=erb(i),O="clientHeight",k="clientWidth";w===ere(i)&&(w=erg(i),"static"!==erh(w).position&&"absolute"===c&&(O="scrollHeight",k="scrollWidth")),("top"===a||(a===en0||a===enX)&&"end"===u)&&(S=enQ,y-=(p&&w===T&&T.visualViewport?T.visualViewport.height:w[O])-o.height,y*=l?1:-1),(a===en0||("top"===a||a===enQ)&&"end"===u)&&(_=enX,m-=(p&&w===T&&T.visualViewport?T.visualViewport.width:w[k])-o.width,m*=l?1:-1)}var I,M,C,R,E,A=Object.assign({position:c},f&&erk),j=!0===d?(I={x:m,y:y},M=ere(i),C=I.x,R=I.y,{x:ers(C*(E=M.devicePixelRatio||1))/E||0,y:ers(R*E)/E||0}):{x:m,y:y};return(m=j.x,y=j.y,l)?Object.assign({},A,((n={})[S]=x?"0":"",n[_]=b?"0":"",n.transform=1>=(T.devicePixelRatio||1)?"translate("+m+"px, "+y+"px)":"translate3d("+m+"px, "+y+"px, 0)",n)):Object.assign({},A,((r={})[S]=x?y+"px":"",r[_]=b?m+"px":"",r.transform="",r))}var erM={passive:!0},erC={left:"right",right:"left",bottom:"top",top:"bottom"};function erR(t){return t.replace(/left|right|bottom|top/g,function(t){return erC[t]})}var erE={start:"end",end:"start"};function erA(t){return t.replace(/start|end/g,function(t){return erE[t]})}function erj(t){var n,r=ere(t);return{scrollLeft:r.pageXOffset,scrollTop:r.pageYOffset}}function erN(t){return erf(erg(t)).left+erj(t).scrollLeft}function erP(t){var n=erh(t),r=n.overflow,i=n.overflowX,o=n.overflowY;return/auto|scroll|overlay|hidden/.test(r+o+i)}function erL(t,n){void 0===n&&(n=[]);var r,i=function t(n){return["html","body","#document"].indexOf(en7(n))>=0?n.ownerDocument.body:ern(n)&&erP(n)?n:t(ery(n))}(t),o=i===(null==(r=t.ownerDocument)?void 0:r.body),a=ere(i),u=o?[a].concat(a.visualViewport||[],erP(i)?i:[]):i,s=n.concat(u);return o?s:s.concat(erL(ery(u)))}function erF(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function erD(t,n,r){var i,o,a,u,s,c,l,f,d,p,h,m;return n===en4?erF(function(t,n){var r=ere(t),i=erg(t),o=r.visualViewport,a=i.clientWidth,u=i.clientHeight,s=0,c=0;if(o){a=o.width,u=o.height;var l=erl();(l||!l&&"fixed"===n)&&(s=o.offsetLeft,c=o.offsetTop)}return{width:a,height:u,x:s+erN(t),y:c}}(t,r)):ert(n)?((a=erf(n,!1,"fixed"===r)).top=a.top+n.clientTop,a.left=a.left+n.clientLeft,a.bottom=a.top+n.clientHeight,a.right=a.left+n.clientWidth,a.width=n.clientWidth,a.height=n.clientHeight,a.x=a.left,a.y=a.top,a):erF((u=erg(t),c=erg(u),l=erj(u),f=null==(s=u.ownerDocument)?void 0:s.body,d=era(c.scrollWidth,c.clientWidth,f?f.scrollWidth:0,f?f.clientWidth:0),p=era(c.scrollHeight,c.clientHeight,f?f.scrollHeight:0,f?f.clientHeight:0),h=-l.scrollLeft+erN(u),m=-l.scrollTop,"rtl"===erh(f||c).direction&&(h+=era(c.clientWidth,f?f.clientWidth:0)-d),{width:d,height:p,x:h,y:m}))}function erW(t){var n,r=t.reference,i=t.element,o=t.placement,a=o?ero(o):null,u=o?erO(o):null,s=r.x+r.width/2-i.width/2,c=r.y+r.height/2-i.height/2;switch(a){case"top":n={x:s,y:r.y-i.height};break;case enQ:n={x:s,y:r.y+r.height};break;case enX:n={x:r.x+r.width,y:c};break;case en0:n={x:r.x-i.width,y:c};break;default:n={x:r.x,y:r.y}}var l=a?erx(a):null;if(null!=l){var f="y"===l?"height":"width";switch(u){case en3:n[l]=n[l]-(r[f]/2-i[f]/2);break;case"end":n[l]=n[l]+(r[f]/2-i[f]/2)}}return n}function erU(t,n){void 0===n&&(n={});var r,i,o,a,u,s,c,l,f,d,p=n,h=p.placement,m=void 0===h?t.placement:h,g=p.strategy,y=void 0===g?t.strategy:g,v=p.boundary,b=p.rootBoundary,x=p.elementContext,_=void 0===x?en5:x,S=p.altBoundary,T=p.padding,w=void 0===T?0:T,O=erT("number"!=typeof w?w:erw(w,en2)),k=t.rects.popper,I=t.elements[void 0!==S&&S?_===en5?"reference":en5:_],M=(r=ert(I)?I:I.contextElement||erg(t.elements.popper),f=(l=[].concat("clippingParents"===(i=void 0===v?"clippingParents":v)?(s=erL(ery(r)),c=["absolute","fixed"].indexOf(erh(r).position)>=0&&ern(r)?erb(r):r,ert(c)?s.filter(function(t){return ert(t)&&erp(t,c)&&"body"!==en7(t)}):[]):[].concat(i),[void 0===b?en4:b]))[0],(d=l.reduce(function(t,n){var i=erD(r,n,y);return t.top=era(i.top,t.top),t.right=eru(i.right,t.right),t.bottom=eru(i.bottom,t.bottom),t.left=era(i.left,t.left),t},erD(r,f,y))).width=d.right-d.left,d.height=d.bottom-d.top,d.x=d.left,d.y=d.top,d),C=erf(t.elements.reference),R=erW({reference:C,element:k,strategy:"absolute",placement:m}),E=erF(Object.assign({},k,R)),A=_===en5?E:C,j={top:M.top-A.top+O.top,bottom:A.bottom-M.bottom+O.bottom,left:M.left-A.left+O.left,right:A.right-M.right+O.right},N=t.modifiersData.offset;if(_===en5&&N){var P=N[m];Object.keys(j).forEach(function(t){var n=[enX,enQ].indexOf(t)>=0?1:-1,r=["top",enQ].indexOf(t)>=0?"y":"x";j[t]+=P[r]*n})}return j}function erz(t,n,r){return void 0===r&&(r={x:0,y:0}),{top:t.top-n.height-r.y,right:t.right-n.width+r.x,bottom:t.bottom-n.height+r.y,left:t.left-n.width-r.x}}function erB(t){return["top",enX,enQ,en0].some(function(n){return t[n]>=0})}var erq={placement:"bottom",modifiers:[],strategy:"absolute"};function erV(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return!n.some(function(t){return!(t&&"function"==typeof t.getBoundingClientRect)})}var er$,erK,erH,erZ,erG,erJ,erY,erQ,erX,er0,er1=(erG={defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var n=t.state,r=t.instance,i=t.options,o=i.scroll,a=void 0===o||o,u=i.resize,s=void 0===u||u,c=ere(n.elements.popper),l=[].concat(n.scrollParents.reference,n.scrollParents.popper);return a&&l.forEach(function(t){t.addEventListener("scroll",r.update,erM)}),s&&c.addEventListener("resize",r.update,erM),function(){a&&l.forEach(function(t){t.removeEventListener("scroll",r.update,erM)}),s&&c.removeEventListener("resize",r.update,erM)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var n=t.state,r=t.name;n.modifiersData[r]=erW({reference:n.rects.reference,element:n.rects.popper,strategy:"absolute",placement:n.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var n=t.state,r=t.options,i=r.gpuAcceleration,o=r.adaptive,a=r.roundOffsets,u=void 0===a||a,s={placement:ero(n.placement),variation:erO(n.placement),popper:n.elements.popper,popperRect:n.rects.popper,gpuAcceleration:void 0===i||i,isFixed:"fixed"===n.options.strategy};null!=n.modifiersData.popperOffsets&&(n.styles.popper=Object.assign({},n.styles.popper,erI(Object.assign({},s,{offsets:n.modifiersData.popperOffsets,position:n.options.strategy,adaptive:void 0===o||o,roundOffsets:u})))),null!=n.modifiersData.arrow&&(n.styles.arrow=Object.assign({},n.styles.arrow,erI(Object.assign({},s,{offsets:n.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-placement":n.placement})},data:{}},eri,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var n=t.state,r=t.options,i=t.name,o=r.offset,a=void 0===o?[0,0]:o,u=en9.reduce(function(t,r){var i,o,u,s,c,l,f,d;return t[r]=(o=n.rects,c=[en0,"top"].indexOf(s=ero(r))>=0?-1:1,f=(l="function"==typeof a?a(Object.assign({},o,{placement:r})):a)[0],d=l[1],f=f||0,d=(d||0)*c,[en0,enX].indexOf(s)>=0?{x:d,y:f}:{x:f,y:d}),t},{}),s=u[n.placement],c=s.x,l=s.y;null!=n.modifiersData.popperOffsets&&(n.modifiersData.popperOffsets.x+=c,n.modifiersData.popperOffsets.y+=l),n.modifiersData[i]=u}},{name:"flip",enabled:!0,phase:"main",fn:function(t){var n=t.state,r=t.options,i=t.name;if(!n.modifiersData[i]._skip){for(var o=r.mainAxis,a=void 0===o||o,u=r.altAxis,s=void 0===u||u,c=r.fallbackPlacements,l=r.padding,f=r.boundary,d=r.rootBoundary,p=r.altBoundary,h=r.flipVariations,m=void 0===h||h,g=r.allowedAutoPlacements,y=n.options.placement,v=ero(y),b=c||(v!==y&&m?function(t){if(ero(t)===en1)return[];var n=erR(t);return[erA(t),n,erA(n)]}(y):[erR(y)]),x=[y].concat(b).reduce(function(t,r){var i,o,a,u,s,c,p,h,y,v,b,x,_,S;return t.concat(ero(r)===en1?(o={placement:r,boundary:f,rootBoundary:d,padding:l,flipVariations:m,allowedAutoPlacements:g},u=(a=o).placement,s=a.boundary,c=a.rootBoundary,p=a.padding,h=a.flipVariations,v=void 0===(y=a.allowedAutoPlacements)?en9:y,0===(_=(x=(b=erO(u))?h?en6:en6.filter(function(t){return erO(t)===b}):en2).filter(function(t){return v.indexOf(t)>=0})).length&&(_=x),Object.keys(S=_.reduce(function(t,r){return t[r]=erU(n,{placement:r,boundary:s,rootBoundary:c,padding:p})[ero(r)],t},{})).sort(function(t,n){return S[t]-S[n]})):r)},[]),_=n.rects.reference,S=n.rects.popper,T=new Map,w=!0,O=x[0],k=0;k<x.length;k++){var I=x[k],M=ero(I),C=erO(I)===en3,R=["top",enQ].indexOf(M)>=0,E=R?"width":"height",A=erU(n,{placement:I,boundary:f,rootBoundary:d,altBoundary:p,padding:l}),j=R?C?enX:en0:C?enQ:"top";_[E]>S[E]&&(j=erR(j));var N=erR(j),P=[];if(a&&P.push(A[M]<=0),s&&P.push(A[j]<=0,A[N]<=0),P.every(function(t){return t})){O=I,w=!1;break}T.set(I,P)}if(w)for(var L=m?3:1,F=function(t){var n=x.find(function(n){var r=T.get(n);if(r)return r.slice(0,t).every(function(t){return t})});if(n)return O=n,"break"},D=L;D>0&&"break"!==F(D);D--);n.placement!==O&&(n.modifiersData[i]._skip=!0,n.placement=O,n.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var n,r=t.state,i=t.options,o=t.name,a=i.mainAxis,u=i.altAxis,s=i.boundary,c=i.rootBoundary,l=i.altBoundary,f=i.padding,d=i.tether,p=void 0===d||d,h=i.tetherOffset,m=void 0===h?0:h,g=erU(r,{boundary:s,rootBoundary:c,padding:f,altBoundary:l}),y=ero(r.placement),v=erO(r.placement),b=!v,x=erx(y),_="x"===x?"y":"x",S=r.modifiersData.popperOffsets,T=r.rects.reference,w=r.rects.popper,O="function"==typeof m?m(Object.assign({},r.rects,{placement:r.placement})):m,k="number"==typeof O?{mainAxis:O,altAxis:O}:Object.assign({mainAxis:0,altAxis:0},O),I=r.modifiersData.offset?r.modifiersData.offset[r.placement]:null,M={x:0,y:0};if(S){if(void 0===a||a){var C,R="y"===x?"top":en0,E="y"===x?enQ:enX,A="y"===x?"height":"width",j=S[x],N=j+g[R],P=j-g[E],L=p?-w[A]/2:0,F=v===en3?T[A]:w[A],D=v===en3?-w[A]:-T[A],W=r.elements.arrow,U=p&&W?erd(W):{width:0,height:0},z=r.modifiersData["arrow#persistent"]?r.modifiersData["arrow#persistent"].padding:erS(),B=z[R],q=z[E],V=er_(0,T[A],U[A]),$=b?T[A]/2-L-V-B-k.mainAxis:F-V-B-k.mainAxis,K=b?-T[A]/2+L+V+q+k.mainAxis:D+V+q+k.mainAxis,H=r.elements.arrow&&erb(r.elements.arrow),Z=H?"y"===x?H.clientTop||0:H.clientLeft||0:0,G=null!=(C=null==I?void 0:I[x])?C:0,J=er_(p?eru(N,j+$-G-Z):N,j,p?era(P,j+K-G):P);S[x]=J,M[x]=J-j}if(void 0!==u&&u){var Y,Q,X,ee,et,en=S[_],er="y"===_?"height":"width",ei=en+g["x"===x?"top":en0],eo=en-g["x"===x?enQ:enX],ea=-1!==["top",en0].indexOf(y),eu=null!=(et=null==I?void 0:I[_])?et:0,es=ea?ei:en-T[er]-w[er]-eu+k.altAxis,ec=ea?en+T[er]+w[er]-eu-k.altAxis:eo,el=p&&ea?(ee=er_(es,en,ec))>ec?ec:ee:er_(p?es:ei,en,p?ec:eo);S[_]=el,M[_]=el-en}r.modifiersData[o]=M}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(t){var n,r=t.state,i=t.name,o=t.options,a=r.elements.arrow,u=r.modifiersData.popperOffsets,s=ero(r.placement),c=erx(s),l=[en0,enX].indexOf(s)>=0?"height":"width";if(!(!a||!u)){var f,d,p=erT("number"!=typeof(f="function"==typeof(f=o.padding)?f(Object.assign({},r.rects,{placement:r.placement})):f)?f:erw(f,en2)),h=erd(a),m=r.rects.reference[l]+r.rects.reference[c]-u[c]-r.rects.popper[l],g=u[c]-r.rects.reference[c],y=erb(a),v=y?"y"===c?y.clientHeight||0:y.clientWidth||0:0,b=p["y"===c?"top":en0],x=v-h[l]-p["y"===c?enQ:enX],_=v/2-h[l]/2+(m/2-g/2),S=er_(b,_,x);r.modifiersData[i]=((n={})[c]=S,n.centerOffset=S-_,n)}},effect:function(t){var n=t.state,r=t.options.element,i=void 0===r?"[data-popper-arrow]":r;null==i||("string"!=typeof i||(i=n.elements.popper.querySelector(i)))&&erp(n.elements.popper,i)&&(n.elements.arrow=i)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var n=t.state,r=t.name,i=n.rects.reference,o=n.rects.popper,a=n.modifiersData.preventOverflow,u=erU(n,{elementContext:"reference"}),s=erU(n,{altBoundary:!0}),c=erz(u,i),l=erz(s,o,a),f=erB(c),d=erB(l);n.modifiersData[r]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:f,hasPopperEscaped:d},n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":d})}}]},erQ=void 0===(erY=(erJ=erG).defaultModifiers)?[]:erY,er0=void 0===(erX=erJ.defaultOptions)?erq:erX,function(t,n,r){void 0===r&&(r=er0);var i,o,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},erq,er0),modifiersData:{},elements:{reference:t,popper:n},attributes:{},styles:{}},u=[],s=!1,c={state:a,setOptions:function(r){var i,o,s,f,d,p,h,m,g="function"==typeof r?r(a.options):r;l(),a.options=Object.assign({},er0,a.options,g),a.scrollParents={reference:ert(t)?erL(t):t.contextElement?erL(t.contextElement):[],popper:erL(n)};var y=(s=Object.keys(o=(i=[].concat(erQ,a.options.modifiers)).reduce(function(t,n){var r=t[n.name];return t[n.name]=r?Object.assign({},r,n,{options:Object.assign({},r.options,n.options),data:Object.assign({},r.data,n.data)}):n,t},{})).map(function(t){return o[t]}),d=new Map,p=new Set,h=[],s.forEach(function(t){d.set(t.name,t)}),s.forEach(function(t){p.has(t.name)||function t(n){p.add(n.name),[].concat(n.requires||[],n.requiresIfExists||[]).forEach(function(n){if(!p.has(n)){var r=d.get(n);r&&t(r)}}),h.push(n)}(t)}),en8.reduce(function(t,n){return t.concat(h.filter(function(t){return t.phase===n}))},[]));return a.orderedModifiers=y.filter(function(t){return t.enabled}),a.orderedModifiers.forEach(function(t){var n=t.name,r=t.options,i=t.effect;if("function"==typeof i){var o=i({state:a,name:n,instance:c,options:void 0===r?{}:r}),s=function(){};u.push(o||s)}}),c.update()},forceUpdate:function(){if(!s){var t,n,r,i,o,u,l,f,d,p,h,m,g,y,v,b=a.elements,x=b.reference,_=b.popper;if(erV(x,_)){a.rects={reference:(t=x,n=erb(_),r="fixed"===a.options.strategy,f=ern(n),d=ern(n)&&(u=ers((o=(i=n).getBoundingClientRect()).width)/i.offsetWidth||1,l=ers(o.height)/i.offsetHeight||1,1!==u||1!==l),p=erg(n),h=erf(t,d,r),m={scrollLeft:0,scrollTop:0},g={x:0,y:0},(f||!f&&!r)&&(("body"!==en7(n)||erP(p))&&(m=(y=n)!==ere(y)&&ern(y)?{scrollLeft:(v=y).scrollLeft,scrollTop:v.scrollTop}:erj(y)),ern(n)?(g=erf(n,!0),g.x+=n.clientLeft,g.y+=n.clientTop):p&&(g.x=erN(p))),{x:h.left+m.scrollLeft-g.x,y:h.top+m.scrollTop-g.y,width:h.width,height:h.height}),popper:erd(_)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach(function(t){return a.modifiersData[t.name]=Object.assign({},t.data)});for(var S=0;S<a.orderedModifiers.length;S++){if(!0===a.reset){a.reset=!1,S=-1;continue}var T=a.orderedModifiers[S],w=T.fn,O=T.options,k=void 0===O?{}:O,I=T.name;"function"==typeof w&&(a=w({state:a,options:k,name:I,instance:c})||a)}}}},update:function(){return o||(o=new Promise(function(t){Promise.resolve().then(function(){o=void 0,t(new Promise(function(t){c.forceUpdate(),t(a)}))})})),o},destroy:function(){l(),s=!0}};if(!erV(t,n))return c;function l(){u.forEach(function(t){return t()}),u=[]}return c.setOptions(r).then(function(t){!s&&r.onFirstUpdate&&r.onFirstUpdate(t)}),c}),er2="tippy-content",er3="tippy-arrow",er4="tippy-svg-arrow",er5={passive:!0,capture:!0},er6=function(){return document.body};function er9(t,n,r){return Array.isArray(t)?t[n]??(Array.isArray(r)?r[n]:r):t}function er8(t,n){var r=({}).toString.call(t);return 0===r.indexOf("[object")&&r.indexOf(n+"]")>-1}function er7(t,n){return"function"==typeof t?t.apply(void 0,n):t}function eie(t,n){var r;return 0===n?t:function(i){clearTimeout(r),r=setTimeout(function(){t(i)},n)}}function eit(t){return[].concat(t)}function ein(t,n){-1===t.indexOf(n)&&t.push(n)}function eir(t){return[].slice.call(t)}function eii(t){return Object.keys(t).reduce(function(n,r){return void 0!==t[r]&&(n[r]=t[r]),n},{})}function eio(){return document.createElement("div")}function eia(t){return["Element","Fragment"].some(function(n){return er8(t,n)})}function eiu(t,n){t.forEach(function(t){t&&(t.style.transitionDuration=n+"ms")})}function eis(t,n){t.forEach(function(t){t&&t.setAttribute("data-state",n)})}function eic(t,n,r){var i=n+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(n){t[i](n,r)})}function eil(t,n){for(var r,i=n;i;){if(t.contains(i))return!0;i=null==i.getRootNode||null==(r=i.getRootNode())?void 0:r.host}return!1}var eif={isTouch:!1},eid=0;function eip(){eif.isTouch||(eif.isTouch=!0,window.performance&&document.addEventListener("mousemove",eih))}function eih(){var t=performance.now();t-eid<20&&(eif.isTouch=!1,document.removeEventListener("mousemove",eih)),eid=t}function eim(){var t,n=document.activeElement;if(n&&n._tippy&&n._tippy.reference===n){var r=n._tippy;n.blur&&!r.state.isVisible&&n.blur()}}var eig=!!("u">typeof window&&"u">typeof document)&&!!window.msCrypto,eiy=Object.assign({appendTo:er6,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},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),eiv=Object.keys(eiy),eib=function(t){Object.keys(t).forEach(function(n){eiy[n]=t[n]})};function eix(t){var n=(t.plugins||[]).reduce(function(n,r){var i,o=r.name,a=r.defaultValue;return o&&(n[o]=void 0!==t[o]?t[o]:null!=(i=eiy[o])?i:a),n},{});return Object.assign({},t,n)}function ei_(t,n){var r,i,o=Object.assign({},n,{content:er7(n.content,[t])},n.ignoreAttributes?{}:((i=n.plugins)?Object.keys(eix(Object.assign({},eiy,{plugins:i}))):eiv).reduce(function(n,r){var i=(t.getAttribute("data-tippy-"+r)||"").trim();if(!i)return n;if("content"===r)n[r]=i;else try{n[r]=JSON.parse(i)}catch{n[r]=i}return n},{}));return o.aria=Object.assign({},eiy.aria,o.aria),o.aria={expanded:"auto"===o.aria.expanded?n.interactive:o.aria.expanded,content:"auto"===o.aria.content?n.interactive?null:"describedby":o.aria.content},o}var eiS=function(){return"innerHTML"};function eiT(t,n){t[eiS()]=n}function eiw(t){var n=eio();return!0===t?n.className=er3:(n.className=er4,eia(t)?n.appendChild(t):eiT(n,t)),n}function eiO(t,n){eia(n.content)?(eiT(t,""),t.appendChild(n.content)):"function"!=typeof n.content&&(n.allowHTML?eiT(t,n.content):t.textContent=n.content)}function eik(t){var n=t.firstElementChild,r=eir(n.children);return{box:n,content:r.find(function(t){return t.classList.contains(er2)}),arrow:r.find(function(t){return t.classList.contains(er3)||t.classList.contains(er4)}),backdrop:r.find(function(t){return t.classList.contains("tippy-backdrop")})}}function eiI(t){var n=eio(),r=eio();r.className="tippy-box",r.setAttribute("data-state","hidden"),r.setAttribute("tabindex","-1");var i=eio();function o(r,i){var o=eik(n),a=o.box,u=o.content,s=o.arrow;i.theme?a.setAttribute("data-theme",i.theme):a.removeAttribute("data-theme"),"string"==typeof i.animation?a.setAttribute("data-animation",i.animation):a.removeAttribute("data-animation"),i.inertia?a.setAttribute("data-inertia",""):a.removeAttribute("data-inertia"),a.style.maxWidth="number"==typeof i.maxWidth?i.maxWidth+"px":i.maxWidth,i.role?a.setAttribute("role",i.role):a.removeAttribute("role"),(r.content!==i.content||r.allowHTML!==i.allowHTML)&&eiO(u,t.props),i.arrow?s?r.arrow!==i.arrow&&(a.removeChild(s),a.appendChild(eiw(i.arrow))):a.appendChild(eiw(i.arrow)):s&&a.removeChild(s)}return i.className=er2,i.setAttribute("data-state","hidden"),eiO(i,t.props),n.appendChild(r),r.appendChild(i),o(t.props,t.props),{popper:n,onUpdate:o}}eiI.$$tippy=!0;var eiM=1,eiC=[],eiR=[];function eiE(t,n){void 0===n&&(n={});var r,i,o=eiy.plugins.concat(n.plugins||[]);document.addEventListener("touchstart",eip,er5),window.addEventListener("blur",eim);var a,u=Object.assign({},n,{plugins:o}),s=(eia(t)?[t]:er8(t,"NodeList")?eir(t):Array.isArray(t)?t:eir(document.querySelectorAll(t))).reduce(function(t,n){var r=n&&function(t,n){var r,i,o,a,u,s,c,l,f=ei_(t,Object.assign({},eiy,eix(eii(n)))),d=!1,p=!1,h=!1,m=!1,g=[],y=eie(Z,f.interactiveDebounce),v=eiM++,b=(r=f.plugins).filter(function(t,n){return r.indexOf(t)===n}),x={id:v,reference:t,popper:eio(),popperInstance:null,props:f,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:b,clearDelayTimeouts:function(){clearTimeout(i),clearTimeout(o),cancelAnimationFrame(a)},setProps:function(n){if(!x.state.isDestroyed){N("onBeforeUpdate",[x,n]),K();var r=x.props,i=ei_(t,Object.assign({},r,eii(n),{ignoreAttributes:!0}));x.props=i,$(),r.interactiveDebounce!==i.interactiveDebounce&&(F(),y=eie(Z,i.interactiveDebounce)),r.triggerTarget&&!i.triggerTarget?eit(r.triggerTarget).forEach(function(t){t.removeAttribute("aria-expanded")}):i.triggerTarget&&t.removeAttribute("aria-expanded"),L(),j(),T&&T(r,i),x.popperInstance&&(Q(),ee().forEach(function(t){requestAnimationFrame(t._tippy.popperInstance.forceUpdate)})),N("onAfterUpdate",[x,n])}},setContent:function(t){x.setProps({content:t})},show:function(){var t=x.state.isVisible,n=x.state.isDestroyed,r=!x.state.isEnabled,i=eif.isTouch&&!x.props.touch,o=er9(x.props.duration,0,eiy.duration);if(!(t||n||r||i)&&!C().hasAttribute("disabled")&&(N("onShow",[x],!1),!1!==x.props.onShow(x))){if(x.state.isVisible=!0,M()&&(S.style.visibility="visible"),j(),z(),x.state.isMounted||(S.style.transition="none"),M()){var a,u,s,l,f=E();eiu([f.box,f.content],0)}c=function(){var t;if(!(!x.state.isVisible||m)){if(m=!0,S.offsetHeight,S.style.transition=x.props.moveTransition,M()&&x.props.animation){var n,r,i=E(),a=i.box,u=i.content;eiu([a,u],o),eis([a,u],"visible")}P(),L(),ein(eiR,x),null==(t=x.popperInstance)||t.forceUpdate(),N("onMount",[x]),x.props.animation&&M()&&q(o,r=function(){x.state.isShown=!0,N("onShown",[x])})}},u=x.props.appendTo,s=C(),(a=x.props.interactive&&u===er6||"parent"===u?s.parentNode:er7(u,[s])).contains(S)||a.appendChild(S),x.state.isMounted=!0,Q()}},hide:function(){var t=!x.state.isVisible,n=x.state.isDestroyed,r=!x.state.isEnabled,i=er9(x.props.duration,1,eiy.duration);if(!(t||n||r)&&(N("onHide",[x],!1),!1!==x.props.onHide(x))){if(x.state.isVisible=!1,x.state.isShown=!1,m=!1,d=!1,M()&&(S.style.visibility="hidden"),F(),B(),j(!0),M()){var o,a,u=E(),s=u.box,c=u.content;x.props.animation&&(eiu([s,c],i),eis([s,c],"hidden"))}P(),L(),x.props.animation?M()&&(a=x.unmount,q(i,function(){!x.state.isVisible&&S.parentNode&&S.parentNode.contains(S)&&a()})):x.unmount()}},hideWithInteractivity:function(t){R().addEventListener("mousemove",y),ein(eiC,y),y(t)},enable:function(){x.state.isEnabled=!0},disable:function(){x.hide(),x.state.isEnabled=!1},unmount:function(){x.state.isVisible&&x.hide(),x.state.isMounted&&(X(),ee().forEach(function(t){t._tippy.unmount()}),S.parentNode&&S.parentNode.removeChild(S),eiR=eiR.filter(function(t){return t!==x}),x.state.isMounted=!1,N("onHidden",[x]))},destroy:function(){x.state.isDestroyed||(x.clearDelayTimeouts(),x.unmount(),K(),delete t._tippy,x.state.isDestroyed=!0,N("onDestroy",[x]))}};if(!f.render)return x;var _=f.render(x),S=_.popper,T=_.onUpdate;S.setAttribute("data-tippy-root",""),S.id="tippy-"+x.id,x.popper=S,t._tippy=x,S._tippy=x;var w=b.map(function(t){return t.fn(x)}),O=t.hasAttribute("aria-expanded");return $(),L(),j(),N("onCreate",[x]),f.showOnCreate&&et(),S.addEventListener("mouseenter",function(){x.props.interactive&&x.state.isVisible&&x.clearDelayTimeouts()}),S.addEventListener("mouseleave",function(){x.props.interactive&&x.props.trigger.indexOf("mouseenter")>=0&&R().addEventListener("mousemove",y)}),x;function k(){var t=x.props.touch;return Array.isArray(t)?t:[t,0]}function I(){return"hold"===k()[0]}function M(){var t;return!!(null!=(t=x.props.render)&&t.$$tippy)}function C(){return l||t}function R(){var t,n,r,i=C().parentNode;return i&&null!=(r=eit(i)[0])&&null!=(n=r.ownerDocument)&&n.body?r.ownerDocument:document}function E(){return eik(S)}function A(t){return x.state.isMounted&&!x.state.isVisible||eif.isTouch||u&&"focus"===u.type?0:er9(x.props.delay,t?0:1,eiy.delay)}function j(t){void 0===t&&(t=!1),S.style.pointerEvents=x.props.interactive&&!t?"":"none",S.style.zIndex=""+x.props.zIndex}function N(t,n,r){if(void 0===r&&(r=!0),w.forEach(function(r){r[t]&&r[t].apply(r,n)}),r){var i;(i=x.props)[t].apply(i,n)}}function P(){var n=x.props.aria;if(n.content){var r="aria-"+n.content,i=S.id;eit(x.props.triggerTarget||t).forEach(function(t){var n=t.getAttribute(r);if(x.state.isVisible)t.setAttribute(r,n?n+" "+i:i);else{var o=n&&n.replace(i,"").trim();o?t.setAttribute(r,o):t.removeAttribute(r)}})}}function L(){!(O||!x.props.aria.expanded)&&eit(x.props.triggerTarget||t).forEach(function(t){x.props.interactive?t.setAttribute("aria-expanded",x.state.isVisible&&t===C()?"true":"false"):t.removeAttribute("aria-expanded")})}function F(){R().removeEventListener("mousemove",y),eiC=eiC.filter(function(t){return t!==y})}function D(n){if(!(eif.isTouch&&(h||"mousedown"===n.type))){var r=n.composedPath&&n.composedPath()[0]||n.target;if(!(x.props.interactive&&eil(S,r))){if(eit(x.props.triggerTarget||t).some(function(t){return eil(t,r)})){if(eif.isTouch||x.state.isVisible&&x.props.trigger.indexOf("click")>=0)return}else N("onClickOutside",[x,n]);!0===x.props.hideOnClick&&(x.clearDelayTimeouts(),x.hide(),p=!0,setTimeout(function(){p=!1}),x.state.isMounted||B())}}}function W(){h=!0}function U(){h=!1}function z(){var t=R();t.addEventListener("mousedown",D,!0),t.addEventListener("touchend",D,er5),t.addEventListener("touchstart",U,er5),t.addEventListener("touchmove",W,er5)}function B(){var t=R();t.removeEventListener("mousedown",D,!0),t.removeEventListener("touchend",D,er5),t.removeEventListener("touchstart",U,er5),t.removeEventListener("touchmove",W,er5)}function q(t,n){var r=E().box;function i(t){t.target===r&&(eic(r,"remove",i),n())}if(0===t)return n();eic(r,"remove",s),eic(r,"add",i),s=i}function V(n,r,i){void 0===i&&(i=!1),eit(x.props.triggerTarget||t).forEach(function(t){t.addEventListener(n,r,i),g.push({node:t,eventType:n,handler:r,options:i})})}function $(){var t;I()&&(V("touchstart",H,{passive:!0}),V("touchend",G,{passive:!0})),(t=x.props.trigger).split(/\s+/).filter(Boolean).forEach(function(t){if("manual"!==t)switch(V(t,H),t){case"mouseenter":V("mouseleave",G);break;case"focus":V(eig?"focusout":"blur",J);break;case"focusin":V("focusout",J)}})}function K(){g.forEach(function(t){var n=t.node,r=t.eventType,i=t.handler,o=t.options;n.removeEventListener(r,i,o)}),g=[]}function H(t){var n,r=!1;if(!(!x.state.isEnabled||Y(t)||p)){var i,o=(null==(n=u)?void 0:n.type)==="focus";u=t,l=t.currentTarget,L(),!x.state.isVisible&&er8(t,"MouseEvent")&&eiC.forEach(function(n){return n(t)}),"click"===t.type&&(0>x.props.trigger.indexOf("mouseenter")||d)&&!1!==x.props.hideOnClick&&x.state.isVisible?r=!0:et(t),"click"===t.type&&(d=!r),r&&!o&&en(t)}}function Z(t){var n,r,i,o,a=t.target,u=C().contains(a)||S.contains(a);!("mousemove"===t.type&&u)&&(n=ee().concat(S).map(function(t){var n,r=null==(n=t._tippy.popperInstance)?void 0:n.state;return r?{popperRect:t.getBoundingClientRect(),popperState:r,props:f}:null}).filter(Boolean),i=(r=t).clientX,o=r.clientY,n.every(function(t){var n,r=t.popperRect,a=t.popperState,u=t.props.interactiveBorder,s=(n=a.placement).split("-")[0],c=a.modifiersData.offset;if(!c)return!0;var l="bottom"===s?c.top.y:0,f="top"===s?c.bottom.y:0,d="right"===s?c.left.x:0,p="left"===s?c.right.x:0,h=r.top-o+l>u,m=o-r.bottom-f>u,g=r.left-i+d>u,y=i-r.right-p>u;return h||m||g||y})&&(F(),en(t)))}function G(t){if(!(Y(t)||x.props.trigger.indexOf("click")>=0&&d)){if(x.props.interactive){x.hideWithInteractivity(t);return}en(t)}}function J(t){0>x.props.trigger.indexOf("focusin")&&t.target!==C()||x.props.interactive&&t.relatedTarget&&S.contains(t.relatedTarget)||en(t)}function Y(t){return!!eif.isTouch&&I()!==t.type.indexOf("touch")>=0}function Q(){X();var n=x.props,r=n.popperOptions,i=n.placement,o=n.offset,a=n.getReferenceClientRect,u=n.moveTransition,s=M()?eik(S).arrow:null,l=a?{getBoundingClientRect:a,contextElement:a.contextElement||C()}:t,f=[{name:"offset",options:{offset:o}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!u}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(t){var n=t.state;if(M()){var r=E().box;["placement","reference-hidden","escaped"].forEach(function(t){"placement"===t?r.setAttribute("data-placement",n.placement):n.attributes.popper["data-popper-"+t]?r.setAttribute("data-"+t,""):r.removeAttribute("data-"+t)}),n.attributes.popper={}}}}];M()&&s&&f.push({name:"arrow",options:{element:s,padding:3}}),f.push.apply(f,(null==r?void 0:r.modifiers)||[]),x.popperInstance=er1(l,S,Object.assign({},r,{placement:i,onFirstUpdate:c,modifiers:f}))}function X(){x.popperInstance&&(x.popperInstance.destroy(),x.popperInstance=null)}function ee(){return eir(S.querySelectorAll("[data-tippy-root]"))}function et(t){x.clearDelayTimeouts(),t&&N("onTrigger",[x,t]),z();var n=A(!0),r=k(),o=r[0],a=r[1];eif.isTouch&&"hold"===o&&a&&(n=a),n?i=setTimeout(function(){x.show()},n):x.show()}function en(t){if(x.clearDelayTimeouts(),N("onUntrigger",[x,t]),!x.state.isVisible){B();return}if(!(x.props.trigger.indexOf("mouseenter")>=0&&x.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(t.type)>=0&&d)){var n=A(!1);n?o=setTimeout(function(){x.state.isVisible&&x.hide()},n):a=requestAnimationFrame(function(){x.hide()})}}}(n,u);return r&&t.push(r),t},[]);return eia(t)?s[0]:s}eiE.defaultProps=eiy,eiE.setDefaultProps=eib,eiE.currentInput=eif,Object.assign({},eri,{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)}}),eiE.setDefaultProps({render:eiI});class eiA{constructor({editor:t,element:n,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:a}){this.preventHide=!1,this.shouldShow=({view:t,state:n,from:r,to:i})=>{let{doc:o,selection:a}=n,{empty:u}=a,s=!o.textBetween(r,i).length&&etx(n.selection),c=this.element.contains(document.activeElement);return!(!(t.hasFocus()||c)||u||s||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:t})=>{var n;if(this.preventHide){this.preventHide=!1;return}null!=t&&t.relatedTarget&&!(null===(n=this.element.parentNode)||void 0===n)&&n.contains(t.relatedTarget)||this.hide()},this.tippyBlurHandler=t=>{this.blurHandler({event:t})},this.handleDebouncedUpdate=(t,n)=>{let r=!(null!=n&&n.selection.eq(t.state.selection)),i=!(null!=n&&n.doc.eq(t.state.doc));(r||i)&&(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(t,r,i,n)},this.updateDelay))},this.updateHandler=(t,n,r,i)=>{var o,a,u;let{state:s,composing:c}=t,{selection:l}=s;if(c||!n&&!r)return;this.createTooltip();let{ranges:f}=l,d=Math.min(...f.map(t=>t.$from.pos)),p=Math.max(...f.map(t=>t.$to.pos));if(!(null===(o=this.shouldShow)||void 0===o?void 0:o.call(this,{editor:this.editor,view:t,state:s,oldState:i,from:d,to:p}))){this.hide();return}null===(a=this.tippy)||void 0===a||a.setProps({getReferenceClientRect:(null===(u=this.tippyOptions)||void 0===u?void 0:u.getReferenceClientRect)||(()=>{var n;if((n=s.selection)instanceof Yg){let r=t.nodeDOM(d),i=r.dataset.nodeViewWrapper?r:r.querySelector("[data-node-view-wrapper]");if(i&&(r=i.firstChild),r)return r.getBoundingClientRect()}return function(t,n,r){let i=t.state.doc.content.size,o=et_(n,0,i),a=et_(r,0,i),u=t.coordsAtPos(o),s=t.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={top:c,bottom:l,left:f,right:d,width:d-f,height:l-c,x:f,y:c};return{...p,toJSON:()=>p}}(t,d,p)})}),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(){let{element:t}=this.editor.options,n=!!t.parentElement;this.tippy||!n||(this.tippy=eiE(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){let{state:r}=t,i=r.selection.$from.pos!==r.selection.$to.pos;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(t,n);return}let o=!(null!=n&&n.selection.eq(t.state.selection)),a=!(null!=n&&n.doc.eq(t.state.doc));this.updateHandler(t,o,a,n)}show(){var t;null===(t=this.tippy)||void 0===t||t.show()}hide(){var t;null===(t=this.tippy)||void 0===t||t.hide()}destroy(){var t,n;!(null===(t=this.tippy)||void 0===t)&&t.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),null===(n=this.tippy)||void 0===n||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)}}let eij=t=>new YM({key:"string"==typeof t.pluginKey?new YE(t.pluginKey):t.pluginKey,view:n=>new eiA({view:n,...t})});ee8.create({name:"bubbleMenu",addOptions:()=>({element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}),addProseMirrorPlugins(){return this.options.element?[eij({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});let eiN=t=>{let[n,r]=(0,c.useState)(null);return(0,c.useEffect)(()=>{if(!n||t.editor.isDestroyed)return;let{pluginKey:r="bubbleMenu",editor:i,tippyOptions:o={},updateDelay:a,shouldShow:u=null}=t,s=eij({updateDelay:a,editor:i,element:n,pluginKey:r,shouldShow:u,tippyOptions:o});return i.registerPlugin(s),()=>i.unregisterPlugin(r)},[t.editor,n]),c.createElement("div",{ref:r,className:t.className,style:{visibility:"hidden"}},t.children)};class eiP extends enk{constructor(){super(...arguments),this.contentComponent=null}}let eiL=({renderers:t})=>c.createElement(c.Fragment,null,Object.entries(t).map(([t,n])=>b.createPortal(n.reactElement,n.element,t)));class eiF extends c.Component{constructor(t){super(t),this.editorContentRef=c.createRef(),this.initialized=!1,this.state={renderers:{}}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){let{editor:t}=this.props;if(t&&t.options.element){if(t.contentComponent)return;let 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?(0,b.flushSync)(t):t()}setRenderer(t,n){this.maybeFlushSync(()=>{this.setState(({renderers:r})=>({renderers:{...r,[t]:n}}))})}removeRenderer(t){this.maybeFlushSync(()=>{this.setState(({renderers:n})=>{let r={...n};return delete r[t],{renderers:r}})})}componentWillUnmount(){let{editor:t}=this.props;if(!t||(this.initialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),t.contentComponent=null,!t.options.element.firstChild))return;let n=document.createElement("div");n.append(...t.options.element.childNodes),t.setOptions({element:n})}render(){let{editor:t,...n}=this.props;return c.createElement(c.Fragment,null,c.createElement("div",{ref:this.editorContentRef,...n}),c.createElement(eiL,{renderers:this.state.renderers}))}}let eiD=c.memo(eiF),eiW=(0,c.createContext)({onDragStart:void 0}),eiU=()=>(0,c.useContext)(eiW),eiz=c.forwardRef((t,n)=>{let{onDragStart:r}=eiU(),i=t.as||"div";return c.createElement(i,{...t,ref:n,"data-node-view-wrapper":"",onDragStart:r,style:{whiteSpace:"normal",...t.style}})});class eiB{constructor(t,{editor:n,props:r={},as:i="div",className:o="",attrs:a}){this.ref=null,this.id=Math.floor(4294967295*Math.random()).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(t=>{this.element.setAttribute(t,a[t])}),this.render()}render(){var t,n,r,i,o;let a=this.component,u=this.props;("function"==typeof a&&a.prototype&&a.prototype.isReactComponent||"object"==typeof a&&(null===(o=a.$$typeof)||void 0===o?void 0:o.toString())==="Symbol(react.forward_ref)")&&(u.ref=t=>{this.ref=t}),this.reactElement=c.createElement(a,{...u}),null===(n=null===(t=this.editor)||void 0===t?void 0:t.contentComponent)||void 0===n||n.setRenderer(this.id,this)}updateProps(t={}){this.props={...this.props,...t},this.render()}destroy(){var t,n;null===(n=null===(t=this.editor)||void 0===t?void 0:t.contentComponent)||void 0===n||n.removeRenderer(this.id)}}class eiq extends enA{mount(){let t={editor:this.editor,node:this.node,decorations:this.decorations,selected:!1,extension:this.extension,getPos:()=>this.getPos(),updateAttributes:(t={})=>this.updateAttributes(t),deleteNode:()=>this.deleteNode()};if(!this.component.displayName){var n;this.component.displayName=(n=this.extension.name).charAt(0).toUpperCase()+n.substring(1)}let r=t=>{let n=this.component,r=this.onDragStart.bind(this),i=t=>{t&&this.contentDOMElement&&t.firstChild!==this.contentDOMElement&&t.appendChild(this.contentDOMElement)};return c.createElement(c.Fragment,null,c.createElement(eiW.Provider,{value:{onDragStart:r,nodeViewContentRef:i}},c.createElement(n,{...t})))};r.displayName="ReactNodeView",this.contentDOMElement=this.node.isLeaf?null:document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement&&(this.contentDOMElement.style.whiteSpace="inherit");let i=this.node.isInline?"span":"div";this.options.as&&(i=this.options.as);let{className:o=""}=this.options;this.renderer=new eiB(r,{editor:this.editor,props:t,as:i,className:`node-${this.node.type.name} ${o}`.trim(),attrs:this.options.attrs})}get dom(){var t;if(this.renderer.element.firstElementChild&&!(!(null===(t=this.renderer.element.firstElementChild)||void 0===t)&&t.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}update(t,n){let r=t=>{this.renderer.updateProps(t)};if(t.type!==this.node.type)return!1;if("function"==typeof this.options.update){let i=this.node,o=this.decorations;return this.node=t,this.decorations=n,this.options.update({oldNode:i,oldDecorations:o,newNode:t,newDecorations:n,updateProps:()=>r({node:t,decorations:n})})}return t===this.node&&this.decorations===n||(this.node=t,this.decorations=n,r({node:t,decorations:n})),!0}selectNode(){this.renderer.updateProps({selected:!0})}deselectNode(){this.renderer.updateProps({selected:!1})}destroy(){this.renderer.destroy(),this.contentDOMElement=null}}function eiV(t,n){return r=>r.editor.contentComponent?new eiq(t,r,n):{}}var ei$={},eiK={},eiH={};Object.defineProperty(eiH,"__esModule",{value:!0}),eiH.Sections=eiH.DynamicSection=eiH.StaticSection=eiH.sectionReader=void 0;let eiZ=oN,eiG=(0,eiZ.__importStar)(zm);function eiJ(t){return eiG.record(zg.WidgetKey,t)}eiH.sectionReader=eiJ,eiH.StaticSection=eiJ(qp.StaticWidget),eiH.DynamicSection=eiJ(qp.DynamicWidget),eiH.Sections={toStatic:(t,n)=>Object.entries(t).reduce((t,[r,i])=>({...t,[r]:qp.Widgets.toStatic(i,n)}),{})},function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.filterMissingSharedSlices=t.collectWidgets=t.validateSlices=t.toStatic=t.flattenWidgets=t.CustomType=t.StaticCustomType=t.CustomTypeFormat=void 0;let n=oN,r=(0,n.__importStar)(zm);t.CustomTypeFormat={page:"page",custom:"custom"};class i extends Error{constructor(t){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=t,this.message=this._formatError(t)}_formatError(t){return`The following slices doesn't exists in your Prismic repository:
90
90
  ${t.map(t=>` - ${t}`).join(`
91
91
  `)}
92
- `}}function o(n){return r.exact(r.intersection([r.type({id:r.string,label:zz.StringOrNull,repeatable:(0,BD.withFallback)(r.boolean,!0),json:r.record(r.string,n),status:(0,BD.withFallback)(r.boolean,!0)}),r.partial({hash:r.string,format:(0,BD.withFallback)(r.keyof(t.CustomTypeFormat),"custom")})]))}function a(t){return Object.entries(t.json).reduce((t,[,n])=>{let r=Object.entries(n);return t.concat(r)},[])}function u(t,n){let r=Object.entries(t.json).reduce((t,[r,i])=>{let o=Object.entries(i).reduce((t,[r,i])=>{let o=n(r,i);return o?{...t,[r]:o}:t},{});return{...t,[r]:o}},{});return{...t,json:r}}t.StaticCustomType=o(eiB.StaticSection),t.CustomType=o(eiB.DynamicSection),t.flattenWidgets=a,t.toStatic=function(t,n){let r=Object.entries(t.json).reduce((t,[r,i])=>({...t,[r]:eiB.Sections.toStatic(i,n)}),{});return{...t,json:r}},t.validateSlices=function(t,n){let r=(function(t){var n;let r=a(t).filter(([,t])=>"Slices"===t.type).reduce((t,[,n])=>{let r=Object.entries(n.config&&n.config.choices?n.config.choices:{}).filter(([,t])=>"SharedSlice"===t.type).map(([t])=>t);return t.concat(r)},[]);return function(t){return r.map(t)}})(t)(t=>{if(!n.get(t))return t}).filter(Boolean);return r.length>0?(0,Da.left)(new i(r)):(0,Da.right)(t)},t.collectWidgets=u,t.filterMissingSharedSlices=function(t,n){return u(t,(t,r)=>{if("Slices"===r.type){if(!r.config||!r.config.choices)return r;let i=Object.entries(r.config.choices).reduce((t,[r,i])=>"SharedSlice"!==i.type||n.get(r)?{...t,[r]:i}:t,{}),o={...r.config,choices:i};return{...r,config:o}}return r})}}(eiz);var eiK,eiH,eiZ={},eiG={};Object.defineProperty(eiK=eiG,"__esModule",{value:!0}),eiK.DiffOperation=void 0,(eiH=eiK.DiffOperation||(eiK.DiffOperation={})).Added="added",eiH.Removed="removed",eiH.Updated="updated";var eiJ={},eiY={},eiQ={};Object.defineProperty(eiQ,"__esModule",{value:!0}),eiQ.toRecord=void 0,eiQ.toRecord=function(t,n){return t.reduce((t,r)=>{let i=n(r);return{...t,[i]:r}},{})},Object.defineProperty(eiY,"__esModule",{value:!0}),eiY.Objects=eiY.Arrays=void 0;let eiX=oN;eiY.Arrays=(0,eiX.__importStar)(eiQ),eiY.Objects=(0,eiX.__importStar)(q6);var ei0={};function ei1(t,n){let r=eiY.Objects.zipObjects(t,n),i=Object.entries(r).reduce((t,[n,r])=>{if(JSON.stringify(null==r?void 0:r.left)===JSON.stringify(null==r?void 0:r.right))return t;let i=(()=>{if(!(!(null!=r&&r.left)&&!(null!=r&&r.right)))return null!=r&&r.left&&!r.right?{op:eiG.DiffOperation.Removed}:!(null!=r&&r.left)&&null!=r&&r.right?{op:eiG.DiffOperation.Added,value:r.right}:{op:eiG.DiffOperation.Updated,value:r.right}})();return i?{...t,[n]:i}:t},{});return eiY.Objects.isNotEmpty(i)?i:void 0}Object.defineProperty(ei0,"__esModule",{value:!0}),ei0.VariationComparator=void 0,ei0.VariationComparator={compare(t,n){if(t&&!n)return{op:eiG.DiffOperation.Removed};if(!t&&n)return{op:eiG.DiffOperation.Added,value:n};let r=function(t,n){let r=eiY.Objects.zipObjects(t,n);return Object.entries(r).reduce((t,[n,r])=>"primary"===n||"items"===n||(null==r?void 0:r.left)===(null==r?void 0:r.right)?t:{...t,[n]:null==r?void 0:r.right},{})}(t,n),i=ei1(null==t?void 0:t.primary,null==n?void 0:n.primary),o=ei1(null==t?void 0:t.items,null==n?void 0:n.items),a={...r,...i?{primary:i}:{},...o?{items:o}:{}};if(eiY.Objects.isNotEmpty(a))return{op:eiG.DiffOperation.Updated,value:a}}},Object.defineProperty(eiJ,"__esModule",{value:!0}),eiJ.SliceComparator=void 0,eiJ.SliceComparator={compare(t,n){if(!t&&n)return{op:eiG.DiffOperation.Added,value:n};if(t&&!n)return{op:eiG.DiffOperation.Removed};let r=function(t,n){let r=eiY.Objects.zipObjects(t,n);return Object.entries(r).reduce((t,[n,r])=>"variations"===n||(null==r?void 0:r.left)===(null==r?void 0:r.right)?t:{...t,[n]:null==r?void 0:r.right},{})}(t,n),i=eiY.Objects.zipObjects(t&&eiY.Arrays.toRecord(t.variations,t=>t.id),n&&eiY.Arrays.toRecord(n.variations,t=>t.id)),o=Object.entries(i).reduce((t,[n,r])=>{if(!r)return t;let i=ei0.VariationComparator.compare(r.left,r.right);return i?{...t,[n]:i}:t},{}),a={...r,...eiY.Objects.isNotEmpty(o)?{variations:o}:{}};if(eiY.Objects.isNotEmpty(a))return{op:eiG.DiffOperation.Updated,value:a}}},function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=oN;(0,n.__exportStar)(eiG,t),(0,n.__exportStar)(eiJ,t),(0,n.__exportStar)(ei0,t)}(eiZ),function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=oN;(0,n.__exportStar)(eiz,t),(0,n.__exportStar)(eiZ,t),(0,n.__exportStar)(eiB,t),(0,n.__exportStar)(zW,t)}(eiU);let ei2=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,ei3=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,ei4=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,ei5=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,ei6=enO.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"strong"},{tag:"b",getAttrs:t=>"normal"!==t.style.fontWeight&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}],renderHTML({HTMLAttributes:t}){return["strong",eeD(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[enS({find:ei2,type:this.type}),enS({find:ei4,type:this.type})]},addPasteRules(){return[enM({find:ei3,type:this.type}),enM({find:ei5,type:this.type})]}});var ei9,ei8,ei7=((ei9=ei7||{}).Document="document",ei9.Mark="mark",ei9.Node="node",ei9),eoe=((ei8=eoe||{}).Text="text",ei8.Embed="embed",ei8.Image="image",ei8);class eot{constructor(t,n,r,i){w(this,"extType","mark"),this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i}}class eon{constructor(t,n,r,i,o,a=!1){w(this,"extType","node"),w(this,"nodeType","text"),this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i,this.placeholder=o,this.lockedFormat=a}}function eor(t){return t instanceof eon}class eoi extends eon{constructor(t,n,r,i,o){super(t,"heading",n,i,o),this.levels=r}}class eoo extends eon{constructor(t,n,r,i){super(t,n,r,i)}}function eoa(t){return t instanceof eoo}let eou=ei6.extend({name:"bold"}),eos=new eot([eiU.RichTextNodeType.strong],eou.name,eou,{fromPrismic:t=>function(){var n;return null==(n=t.marks[eou.name])?void 0:n.create()},toPrismic(){}}),eoc=enk.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",eeD(this.options.HTMLAttributes,t),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)}}}),eol=enO.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:t=>!!t.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:t}){return["span",eeD(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:n})=>{let r=etJ(t,this.type);return!!Object.entries(r).some(([,t])=>!!t)||n.unsetMark(this.name)}}}}),eof=/^\s*([-+*])\s$/,eod=enk.create({name:"bulletList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:t}){return["ul",eeD(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:n})=>this.options.keepAttributes?n().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(eoc.name,this.editor.getAttributes(eol.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=enw({find:eof,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=enw({find:eof,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(eol.name),editor:this.editor})),[t]}}),eop=enk.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:t}){return["br",eeD(this.options.HTMLAttributes,t)]},renderText:()=>`
93
- `,addCommands(){return{setHardBreak:()=>({commands:t,chain:n,state:r,editor:i})=>t.first([()=>t.exitCode(),()=>t.command(()=>{let{selection:t,storedMarks:o}=r;if(t.$from.parent.type.spec.isolating)return!1;let{keepMarks:a}=this.options,{splittableMarks:u}=i.extensionManager,s=o||t.$to.parentOffset&&t.$from.marks();return n().insertContent({type:this.name}).command(({tr:t,dispatch:n})=>{if(n&&s&&a){let r=s.filter(t=>u.includes(t.type.name));t.ensureMarks(r)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),eoh={isHardBreak:t=>t.type.name===eop.name,children:{reduce(t,n,r){let i=r;return t.forEach((t,r,o)=>{i=n(i,t,o)}),i},map(t,n){return this.reduce(t,(t,r)=>[...t,n(r)],[])},exists(t,n){return this.reduce(t,(t,r)=>t||n(r),!1)},filter(t,n){return this.reduce(t,(t,r)=>[...t,...n(r)?[r]:[]],[])}},marks:{reduce(t,n,r){let i=r;return t.marks.forEach((t,r)=>{i=n(i,t,r)}),i},map(t,n){return this.reduce(t,(t,r)=>[...t,n(r)],[])},filter(t,n){return this.reduce(t,(t,r)=>[...t,...n(r)?[r]:[]],[])}}};function eom(){return{extensions:ecv(),defaultTextConverter:void 0}}let eog=enk.create({name:"doc",topNode:!0,content:"block+"}),eoy=enk.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",eeD(this.options.HTMLAttributes,t),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)}}}),eov=eoy.extend({name:"listItem",content:"paragraph*",addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name)}}}),eob={component:eov,converter:{fromPrismic:t=>function(n){var r;let i=euv.converter.fromPrismic(t)(n);if(i)return null==(r=t.nodes[eov.name])?void 0:r.create({},i)},toPrismic:(t,n)=>eoh.children.reduce(t,(t,r)=>{let i=euv.converter.toPrismic(r),o=i instanceof Array?i.map(t=>({...t,type:n})):i?[{...i,type:n}]:[];return[...t,...o]},[])},placeholder:"List"},eox="document",eo_=t=>eog.extend({name:eox,content:t?"block+":"block"}),eoS=t=>({fromPrismic(n,r){function i(t){return function(n){return!n&&r&&oj.TextBlock.is(t)?r(t):n}}return function(r){var o;let a=r.value.reduce((r,o)=>{let a=t.find(t=>t.richTextNodeTypes.includes(o.type)),u=(()=>{if(a)switch(a.nodeType){case eoe.Embed:return oj.EmbedBlock.is(o)&&a.converter.fromPrismic(n)(o);case eoe.Text:return oj.TextBlock.is(o)&&a.converter.fromPrismic(n)(o);case eoe.Image:return oj.ImageBlock.is(o)&&a.converter.fromPrismic(n)(o);default:return}})(),s=r.length-1,c=r.slice(0,s),l=uH(c),f=u?Z(l,pj(()=>({merged:!1,node:u}),t=>{var n;return u.type.name===t.type.name&&(u.type.name===euI.name||u.type.name===ecg.name)?{merged:!0,node:(n=[t,u]).slice(1,n.length).reduce((t,n)=>t.copy(t.content.append(n.content)),n[0])}:{merged:!1,node:u}}),({merged:t,node:n})=>({merged:t,node:i(o)(n)})):{merged:!1,node:i(o)()};return f.node?[...f.merged?c:r,f.node]:r},[]);return null==(o=n.nodes[eox])?void 0:o.create({},a)}},toPrismic:n=>({__TYPE__:"StructuredTextContent",value:[...eoh.children.reduce(n,(n,r)=>{let i=Object.values(t).find(t=>r.type.name===t.name),o=null==i?void 0:i.converter.toPrismic(r);return o||console.warn(`Cannot convert node of type '${r.type.name}'.`),o?[...n,...o instanceof Array?o:[o]]:n},[])]})}),eoT=new class{constructor(t,n,r){w(this,"extType","document"),this.name=t,this.component=n,this.converter=r}}(eox,eo_,eoS),eow=eop.extend({name:"hard_break"}),eoO=`
94
- `,eok={fromPrismic:t=>function(n){var r;if(n===eoO)return null==(r=t.nodes[eow.name])?void 0:r.create({})},toPrismic(t){if(t.type.name===eow.name)return eoO}},eoI={isEmptyLine:t=>0===t.length,isFirst:t=>0===t},eoM={name:eow.name,component:eow,converter:eok,splitTextToNodes:function(t,n){return function(r){let i=eok.fromPrismic(t)(eoO);if(!i)return[r(n)];let o=n.split(eoO);return 1===o.length?n.length?[r(n)]:[i]:o.reduce((t,n,o)=>eoI.isFirst(o)?eoI.isEmptyLine(n)?t:[...t,r(n)]:eoI.isEmptyLine(n)?[...t,i]:[...t,i,r(n)],[])}}},eoC=ee3.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){return[new YT({key:new Yk("placeholder"),props:{decorations:({doc:t,selection:n})=>{let r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=n,o=[];if(!r)return null;let a=t.type.createAndFill(),u=(null==a?void 0:a.sameMarkup(t))&&null===a.content.findDiffStart(t.content);return t.descendants((t,n)=>{let r=i>=n&&i<=n+t.nodeSize,a=!t.isLeaf&&!t.childCount;if((r||!this.options.showOnlyCurrent)&&a){let s=[this.options.emptyNodeClass];u&&s.push(this.options.emptyEditorClass);let c=XN.node(n,n+t.nodeSize,{class:s.join(" "),"data-placeholder":"function"==typeof this.options.placeholder?this.options.placeholder({editor:this.editor,node:t,pos:n,hasAnchor:r}):this.options.placeholder});o.push(c)}return this.options.includeChildren}),XF.create(t,o)}}})]}}),eoR=t=>eoC.configure({includeChildren:!0,placeholder:n=>(function({props:t,params:n}){var r;let{editor:i,hasAnchor:o,node:a}=t,{placeholderByNodeType:u,unfocusedPlaceholder:s,nodeExtensions:c}=n,l=!eoh.children.exists(i.state.doc,t=>t===a),f=i.isEditable,d=i.isFocused&&o,p=a.type.name!==euv.name,h=d||p||l,m=c.length>1,g=function(){if(l)return eob.placeholder;let t=u[a.type.name];return"string"==typeof t?t:null==t?void 0:t(a.attrs)}();return s&&!d&&i.isEmpty?s:("Type '/' for commands"===g?f&&h&&m:f&&h)&&g||""})({props:n,params:t}),showOnlyCurrent:!1,showOnlyWhenEditable:!1});function eoE(t){return t.split("-")[1]}function eoA(t){return"y"===t?"height":"width"}function eoj(t){return t.split("-")[0]}function eoN(t){return["top","bottom"].includes(eoj(t))?"x":"y"}function eoP(t,n,r){let{reference:i,floating:o}=t,a=i.x+i.width/2-o.width/2,u=i.y+i.height/2-o.height/2,s=eoN(n),c=eoA(s),l=i[c]/2-o[c]/2,f=eoj(n),d="x"===s,p;switch(f){case"top":p={x:a,y:i.y-o.height};break;case"bottom":p={x:a,y:i.y+i.height};break;case"right":p={x:i.x+i.width,y:u};break;case"left":p={x:i.x-o.width,y:u};break;default:p={x:i.x,y:i.y}}switch(eoE(n)){case"start":p[s]-=l*(r&&d?-1:1);break;case"end":p[s]+=l*(r&&d?-1:1)}return p}let eoL=async(t,n,r)=>{let{placement:i="bottom",strategy:o="absolute",middleware:a=[],platform:u}=r,s=a.filter(Boolean),c=await (null==u.isRTL?void 0:u.isRTL(n)),l=await u.getElementRects({reference:t,floating:n,strategy:o}),{x:f,y:d}=eoP(l,i,c),p=i,h={},m=0;for(let g=0;g<s.length;g++){let{name:y,fn:v}=s[g],{x:b,y:x,data:_,reset:S}=await v({x:f,y:d,initialPlacement:i,placement:p,strategy:o,middlewareData:h,rects:l,platform:u,elements:{reference:t,floating:n}});if(f=b??f,d=x??d,h={...h,[y]:{...h[y],..._}},S&&m<=50){m++,"object"==typeof S&&(S.placement&&(p=S.placement),S.rects&&(l=!0===S.rects?await u.getElementRects({reference:t,floating:n,strategy:o}):S.rects),{x:f,y:d}=eoP(l,p,c)),g=-1;continue}}return{x:f,y:d,placement:p,strategy:o,middlewareData:h}};function eoF(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}async function eoD(t,n){var r,i,o;void 0===n&&(n={});let{x:a,y:u,platform:s,rects:c,elements:l,strategy:f}=t,{boundary:d="clippingAncestors",rootBoundary:p="viewport",elementContext:h="floating",altBoundary:m=!1,padding:g=0}=n,y="number"!=typeof g?{top:0,right:0,bottom:0,left:0,...g}:{top:g,right:g,bottom:g,left:g},v=l[m?"floating"===h?"reference":"floating":h],b=eoF(await s.getClippingRect({element:null==(r=await (null==s.isElement?void 0:s.isElement(v)))||r?v:v.contextElement||await (null==s.getDocumentElement?void 0:s.getDocumentElement(l.floating)),boundary:d,rootBoundary:p,strategy:f})),x="floating"===h?{...c.floating,x:a,y:u}:c.reference,_=await (null==s.getOffsetParent?void 0:s.getOffsetParent(l.floating)),S=await (null==s.isElement?void 0:s.isElement(_))&&await (null==s.getScale?void 0:s.getScale(_))||{x:1,y:1},T=eoF(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({rect:x,offsetParent:_,strategy:f}):x);return{top:(b.top-T.top+y.top)/S.y,bottom:(T.bottom-b.bottom+y.bottom)/S.y,left:(b.left-T.left+y.left)/S.x,right:(T.right-b.right+y.right)/S.x}}let eoW=Math.min,eoU=Math.max;function eoz(t,n,r){return eoU(t,eoW(n,r))}let eoB={left:"right",right:"left",bottom:"top",top:"bottom"};function eoq(t){return t.replace(/left|right|bottom|top/g,t=>eoB[t])}let eoV={start:"end",end:"start"};function eo$(t){return t.replace(/start|end/g,t=>eoV[t])}async function eoK(t,n){let{placement:r,platform:i,elements:o}=t,a=await (null==i.isRTL?void 0:i.isRTL(o.floating)),u=eoj(r),s=eoE(r),c="x"===eoN(r),l=["left","top"].includes(u)?-1:1,f=a&&c?-1:1,d="function"==typeof n?n(t):n,{mainAxis:p,crossAxis:h,alignmentAxis:m}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&"number"==typeof m&&(h="end"===s?-1*m:m),c?{x:h*f,y:p*l}:{x:p*l,y:h*f}}function eoH(t){return"x"===t?"y":"x"}function eoZ(t){var n;return(null==(n=t.ownerDocument)?void 0:n.defaultView)||window}function eoG(t){return eoZ(t).getComputedStyle(t)}let eoJ=Math.min,eoY=Math.max,eoQ=Math.round;function eoX(t){let n=eoG(t),r=parseFloat(n.width),i=parseFloat(n.height),o=t.offsetWidth,a=t.offsetHeight,u=eoQ(r)!==o||eoQ(i)!==a;return u&&(r=o,i=a),{width:r,height:i,fallback:u}}function eo0(t){return eo5(t)?(t.nodeName||"").toLowerCase():""}let eo1;function eo2(){if(eo1)return eo1;let t=navigator.userAgentData;return t&&Array.isArray(t.brands)?eo1=t.brands.map(t=>t.brand+"/"+t.version).join(" "):navigator.userAgent}function eo3(t){return t instanceof eoZ(t).HTMLElement}function eo4(t){return t instanceof eoZ(t).Element}function eo5(t){return t instanceof eoZ(t).Node}function eo6(t){if(typeof ShadowRoot>"u")return!1;let n=eoZ(t).ShadowRoot;return t instanceof n||t instanceof ShadowRoot}function eo9(t){let{overflow:n,overflowX:r,overflowY:i,display:o}=eoG(t);return/auto|scroll|overlay|hidden|clip/.test(n+i+r)&&!["inline","contents"].includes(o)}function eo8(t){return["table","td","th"].includes(eo0(t))}function eo7(t){let n=/firefox/i.test(eo2()),r=eoG(t),i=r.backdropFilter||r.WebkitBackdropFilter;return"none"!==r.transform||"none"!==r.perspective||!!i&&"none"!==i||n&&"filter"===r.willChange||n&&!!r.filter&&"none"!==r.filter||["transform","perspective"].some(t=>r.willChange.includes(t))||["paint","layout","strict","content"].some(t=>{let n=r.contain;return null!=n&&n.includes(t)})}function eae(){return/^((?!chrome|android).)*safari/i.test(eo2())}function eat(t){return["html","body","#document"].includes(eo0(t))}function ean(t){return eo4(t)?t:t.contextElement}let ear={x:1,y:1};function eai(t){let n=ean(t);if(!eo3(n))return ear;let r=n.getBoundingClientRect(),{width:i,height:o,fallback:a}=eoX(n),u=(a?eoQ(r.width):r.width)/i,s=(a?eoQ(r.height):r.height)/o;return u&&Number.isFinite(u)||(u=1),s&&Number.isFinite(s)||(s=1),{x:u,y:s}}function eao(t,n,r,i){var o,a;void 0===n&&(n=!1),void 0===r&&(r=!1);let u=t.getBoundingClientRect(),s=ean(t),c=ear;n&&(i?eo4(i)&&(c=eai(i)):c=eai(t));let l=s?eoZ(s):window,f=eae()&&r,d=(u.left+(f&&(null==(o=l.visualViewport)?void 0:o.offsetLeft)||0))/c.x,p=(u.top+(f&&(null==(a=l.visualViewport)?void 0:a.offsetTop)||0))/c.y,h=u.width/c.x,m=u.height/c.y;if(s){let g=eoZ(s),y=i&&eo4(i)?eoZ(i):i,v=g.frameElement;for(;v&&i&&y!==g;){let b=eai(v),x=v.getBoundingClientRect(),_=getComputedStyle(v);x.x+=(v.clientLeft+parseFloat(_.paddingLeft))*b.x,x.y+=(v.clientTop+parseFloat(_.paddingTop))*b.y,d*=b.x,p*=b.y,h*=b.x,m*=b.y,d+=x.x,p+=x.y,v=eoZ(v).frameElement}}return{width:h,height:m,top:p,right:d+h,bottom:p+m,left:d,x:d,y:p}}function eaa(t){return((eo5(t)?t.ownerDocument:t.document)||window.document).documentElement}function eau(t){return eo4(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function eas(t){return eao(eaa(t)).left+eau(t).scrollLeft}function eac(t){if("html"===eo0(t))return t;let n=t.assignedSlot||t.parentNode||eo6(t)&&t.host||eaa(t);return eo6(n)?n.host:n}function eal(t,n){var r;void 0===n&&(n=[]);let i=function t(n){let r=eac(n);return eat(r)?r.ownerDocument.body:eo3(r)&&eo9(r)?r:t(r)}(t),o=i===(null==(r=t.ownerDocument)?void 0:r.body),a=eoZ(i);return o?n.concat(a,a.visualViewport||[],eo9(i)?i:[]):n.concat(i,eal(i))}function eaf(t,n,r){let i;if("viewport"===n)i=function(t,n){let r=eoZ(t),i=eaa(t),o=r.visualViewport,a=i.clientWidth,u=i.clientHeight,s=0,c=0;if(o){a=o.width,u=o.height;let l=eae();(!l||l&&"fixed"===n)&&(s=o.offsetLeft,c=o.offsetTop)}return{width:a,height:u,x:s,y:c}}(t,r);else if("document"===n)i=function(t){let n=eaa(t),r=eau(t),i=t.ownerDocument.body,o=eoY(n.scrollWidth,n.clientWidth,i.scrollWidth,i.clientWidth),a=eoY(n.scrollHeight,n.clientHeight,i.scrollHeight,i.clientHeight),u=-r.scrollLeft+eas(t),s=-r.scrollTop;return"rtl"===eoG(i).direction&&(u+=eoY(n.clientWidth,i.clientWidth)-o),{width:o,height:a,x:u,y:s}}(eaa(t));else if(eo4(n))i=function(t,n){let r=eao(t,!0,"fixed"===n),i=r.top+t.clientTop,o=r.left+t.clientLeft,a=eo3(t)?eai(t):{x:1,y:1},u=t.clientWidth*a.x,s=t.clientHeight*a.y,c=o*a.x,l=i*a.y;return{width:u,height:s,x:c,y:l}}(n,r);else{let o={...n};if(eae()){var a,u;let s=eoZ(t);o.x-=(null==(a=s.visualViewport)?void 0:a.offsetLeft)||0,o.y-=(null==(u=s.visualViewport)?void 0:u.offsetTop)||0}i=o}return eoF(i)}function ead(t,n){return eo3(t)&&"fixed"!==eoG(t).position?n?n(t):t.offsetParent:null}function eap(t,n){let r=eoZ(t),i=ead(t,n);for(;i&&eo8(i)&&"static"===eoG(i).position;)i=ead(i,n);return i&&("html"===eo0(i)||"body"===eo0(i)&&"static"===eoG(i).position&&!eo7(i))?r:i||function(t){let n=eac(t);for(;eo3(n)&&!eat(n);){if(eo7(n))return n;n=eac(n)}return null}(t)||r}let eah={getClippingRect:function(t){let{element:n,boundary:r,rootBoundary:i,strategy:o}=t,a=[..."clippingAncestors"===r?function(t,n){let r=n.get(t);if(r)return r;let i=eal(t).filter(t=>eo4(t)&&"body"!==eo0(t)),o=null,a="fixed"===eoG(t).position,u=a?eac(t):t;for(;eo4(u)&&!eat(u);){let s=eoG(u),c=eo7(u);"fixed"===s.position?o=null:(a?c||o:!(!c&&"static"===s.position&&o&&["absolute","fixed"].includes(o.position)))?o=s:i=i.filter(t=>t!==u),u=eac(u)}return n.set(t,i),i}(n,this._c):[].concat(r),i],u=a[0],s=a.reduce((t,r)=>{let i=eaf(n,r,o);return t.top=eoY(i.top,t.top),t.right=eoJ(i.right,t.right),t.bottom=eoJ(i.bottom,t.bottom),t.left=eoY(i.left,t.left),t},eaf(n,u,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:n,offsetParent:r,strategy:i}=t,o=eo3(r),a=eaa(r);if(r===a)return n;let u={scrollLeft:0,scrollTop:0},s={x:1,y:1},c={x:0,y:0};if((o||!o&&"fixed"!==i)&&(("body"!==eo0(r)||eo9(a))&&(u=eau(r)),eo3(r))){let l=eao(r);s=eai(r),c.x=l.x+r.clientLeft,c.y=l.y+r.clientTop}return{width:n.width*s.x,height:n.height*s.y,x:n.x*s.x-u.scrollLeft*s.x+c.x,y:n.y*s.y-u.scrollTop*s.y+c.y}},isElement:eo4,getDimensions:function(t){return eo3(t)?eoX(t):t.getBoundingClientRect()},getOffsetParent:eap,getDocumentElement:eaa,getScale:eai,async getElementRects(t){let{reference:n,floating:r,strategy:i}=t,o=this.getOffsetParent||eap,a=this.getDimensions;return{reference:function(t,n,r){let i=eo3(n),o=eaa(n),a=eao(t,!0,"fixed"===r,n),u={scrollLeft:0,scrollTop:0},s={x:0,y:0};if(i||!i&&"fixed"!==r){if(("body"!==eo0(n)||eo9(o))&&(u=eau(n)),eo3(n)){let c=eao(n,!0);s.x=c.x+n.clientLeft,s.y=c.y+n.clientTop}else o&&(s.x=eas(o))}return{x:a.left+u.scrollLeft-s.x,y:a.top+u.scrollTop-s.y,width:a.width,height:a.height}}(n,await o(r),i),floating:{x:0,y:0,...await a(r)}}},getClientRects:t=>Array.from(t.getClientRects()),isRTL:t=>"rtl"===eoG(t).direction};function eam(t,n,r,i){void 0===i&&(i={});let{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:u=!0,animationFrame:s=!1}=i,c=o&&!s,l=c||a?[...eo4(t)?eal(t):t.contextElement?eal(t.contextElement):[],...eal(n)]:[];l.forEach(t=>{c&&t.addEventListener("scroll",r,{passive:!0}),a&&t.addEventListener("resize",r)});let f=null;if(u){let d=!0;f=new ResizeObserver(()=>{d||r(),d=!1}),eo4(t)&&!s&&f.observe(t),eo4(t)||!t.contextElement||s||f.observe(t.contextElement),f.observe(n)}let p,h=s?eao(t):null;return s&&function n(){let i=eao(t);h&&(i.x!==h.x||i.y!==h.y||i.width!==h.width||i.height!==h.height)&&r(),h=i,p=requestAnimationFrame(n)}(),r(),()=>{var t;l.forEach(t=>{c&&t.removeEventListener("scroll",r),a&&t.removeEventListener("resize",r)}),null==(t=f)||t.disconnect(),f=null,s&&cancelAnimationFrame(p)}}let eag=(t,n,r)=>{let i=new Map,o={platform:eah,...r},a={...o.platform,_c:i};return eoL(t,n,{...o,platform:a})};var eay="u">typeof document?c.useLayoutEffect:c.useEffect;function eav(t,n){if(t===n)return!0;if(typeof t!=typeof n)return!1;if("function"==typeof t&&t.toString()===n.toString())return!0;let r,i,o;if(t&&n&&"object"==typeof t){if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(i=r;0!=i--;)if(!eav(t[i],n[i]))return!1;return!0}if((r=(o=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(i=r;0!=i--;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;0!=i--;){let a=o[i];if(!("_owner"===a&&t.$$typeof)&&!eav(t[a],n[a]))return!1}return!0}return t!=t&&n!=n}function eab(t){let n=c.useRef(t);return eay(()=>{n.current=t}),n}var eax="u">typeof document?c.useLayoutEffect:c.useEffect;let ea_=!1,eaS=0,eaT=()=>"floating-ui-"+eaS++,eaw=(zC||(zC=r.t(c,2)))["useId".toString()],eaO=eaw??function(){let[t,n]=c.useState(()=>ea_?eaT():void 0);return eax(()=>{null==t&&n(eaT())},[]),c.useEffect(()=>{ea_||(ea_=!0)},[]),t},eak=c.createContext(null),eaI=c.createContext(null),eaM=()=>{var t,n;return null!=(t=null==(n=c.useContext(eak))?void 0:n.id)?t:null},eaC=()=>c.useContext(eaI);function eaR(t){var n;return null!=(n=null==t?void 0:t.ownerDocument)?n:document}function eaE(t){var n;return null!=(n=eaR(t).defaultView)?n:window}function eaA(t){return!!t&&t instanceof eaE(t).Element}let eaj=(zC||(zC=r.t(c,2)))["useInsertionEffect".toString()];function eaN(t){let n=c.useRef(()=>{});return eaj?eaj(()=>{n.current=t}):n.current=t,c.useCallback(function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return null==n.current?void 0:n.current(...r)},[])}function eaP(t,n,r){let i=new Map;return{..."floating"===r&&{tabIndex:-1},...t,...n.map(t=>t?t[r]:null).concat(t).reduce((t,n)=>(n&&Object.entries(n).forEach(n=>{let[r,o]=n;if(0===r.indexOf("on")){if(i.has(r)||i.set(r,[]),"function"==typeof o){var a;null==(a=i.get(r))||a.push(o),t[r]=function(){for(var t,n=arguments.length,o=Array(n),a=0;a<n;a++)o[a]=arguments[a];null==(t=i.get(r))||t.forEach(t=>t(...o))}}}else t[r]=o}),t),{})}}function eaL(t,n){var r,i;let o=null!=(r=t.filter(t=>{var r;return t.parentId===n&&(null==(r=t.context)?void 0:r.open)}))?r:[],a=o;for(;a.length;)a=null!=(i=t.filter(t=>{var n;return null==(n=a)?void 0:n.some(n=>{var r;return t.parentId===n.id&&(null==(r=t.context)?void 0:r.open)})}))?i:[],o=o.concat(a);return o}function eaF(t){let n=t.activeElement;for(;(null==(r=n)||null==(i=r.shadowRoot)?void 0:i.activeElement)!=null;){var r,i;n=n.shadowRoot.activeElement}return n}function eaD(t){t.preventDefault(),t.stopPropagation()}function eaW(t){let n=(0,c.useRef)();return eax(()=>{n.current=t},[t]),n.current}let eaU=function(t,n){let{open:r}=t,{enabled:i=!0,role:o="dialog"}=void 0===n?{}:n,a=eaO(),u=eaO(),s={id:a,role:o};return i?"tooltip"===o?{reference:{"aria-describedby":r?a:void 0},floating:s}:{reference:{"aria-expanded":r?"true":"false","aria-haspopup":"alertdialog"===o?"dialog":o,"aria-controls":r?a:void 0,..."listbox"===o&&{role:"combobox"},..."menu"===o&&{id:u}},floating:{...s,..."menu"===o&&{"aria-labelledby":u}}}:{}};function eaz(t,n){return null!=n&&("composedPath"in t?t.composedPath().includes(n):null!=t.target&&n.contains(t.target))}let eaB=function(t,n){let{open:r,onOpenChange:i,refs:o,events:a,nodeId:u}=t,{enabled:s=!0,escapeKey:l=!0,outsidePointerDown:f=!0,referencePointerDown:d=!1,ancestorScroll:p=!1,bubbles:h=!0}=void 0===n?{}:n,m=eaC(),g=null!=eaM(),y=c.useRef(!1);return c.useEffect(()=>{if(!r||!s)return;function t(t){"Escape"!==t.key||!h&&m&&eaL(m.nodesRef.current,u).length>0||(a.emit("dismiss",{preventScroll:!1}),i(!1))}function n(t){var n,r;let s=y.current;if(y.current=!1,s)return;let c="composedPath"in t?t.composedPath()[0]:t.target;if(eaA(c)&&o.floating.current){let l=null!=(r=o.floating.current.ownerDocument.defaultView)?r:window,f=c.scrollWidth>c.clientWidth,d=c.scrollHeight>c.clientHeight,p=d&&t.offsetX>c.clientWidth;if(d&&"rtl"===l.getComputedStyle(c).direction&&(p=t.offsetX<=c.offsetWidth-c.clientWidth),p||f&&t.offsetY>c.clientHeight)return}let v=m&&eaL(m.nodesRef.current,u).some(n=>{var r;return eaz(t,null==(r=n.context)?void 0:r.refs.floating.current)});eaz(t,o.floating.current)||eaz(t,o.domReference.current)||v||!h&&m&&eaL(m.nodesRef.current,u).length>0||(a.emit("dismiss",!!g&&{preventScroll:!0}),i(!1))}function c(){i(!1)}let d=eaR(o.floating.current);l&&d.addEventListener("keydown",t),f&&d.addEventListener("pointerdown",n);let v=(p?[...eaA(o.reference.current)?eal(o.reference.current):[],...eaA(o.floating.current)?eal(o.floating.current):[]]:[]).filter(t=>{var n;return t!==(null==(n=d.defaultView)?void 0:n.visualViewport)});return v.forEach(t=>t.addEventListener("scroll",c,{passive:!0})),()=>{l&&d.removeEventListener("keydown",t),f&&d.removeEventListener("pointerdown",n),v.forEach(t=>t.removeEventListener("scroll",c))}},[l,f,a,m,u,r,i,p,s,h,o,g]),s?{reference:{onPointerDown(){d&&(a.emit("dismiss"),i(!1))}},floating:{onPointerDownCapture(){y.current=!0}}}:{}},eaq="ArrowUp",eaV="ArrowDown",ea$="ArrowLeft",eaK="ArrowRight";function eaH(t,n,r){return Math.floor(t/n)!==r}function eaZ(t,n){return n<0||n>=t.current.length}function eaG(t,n){let{startingIndex:r=-1,decrement:i=!1,disabledIndices:o,amount:a=1}=void 0===n?{}:n,u=t.current,s=r;do{var c,l;s+=i?-a:a}while(s>=0&&s<=u.length-1&&(o?o.includes(s):null==u[s]||null!=(c=u[s])&&c.hasAttribute("disabled")||(null==(l=u[s])?void 0:l.getAttribute("aria-disabled"))==="true"));return s}function eaJ(t,n,r){switch(t){case"vertical":return n;case"horizontal":return r;default:return n||r}}function eaY(t,n){return eaJ(n,t===eaq||t===eaV,t===ea$||t===eaK)}function eaQ(t,n,r){return eaJ(n,t===eaV,r?t===ea$:t===eaK)||"Enter"===t||" "==t||""===t}function eaX(t,n){return eaG(t,{disabledIndices:n})}function ea0(t,n){return eaG(t,{decrement:!0,startingIndex:t.current.length,disabledIndices:n})}let ea1=function(t,n){let{open:r,onOpenChange:i,refs:o}=t,{listRef:a,activeIndex:u,onNavigate:s=()=>{},enabled:l=!0,selectedIndex:f=null,allowEscape:d=!1,loop:p=!1,nested:h=!1,rtl:m=!1,virtual:g=!1,focusItemOnOpen:y="auto",focusItemOnHover:v=!0,openOnArrowKeyDown:b=!0,disabledIndices:x,orientation:_="vertical",cols:S=1}=void 0===n?{listRef:{current:[]},activeIndex:null,onNavigate(){}}:n,T=eaM(),w=eaC(),O=eaW(r),k=eaN(s),I=eaN(eaW(s)),M=c.useRef(y),C=c.useRef(f??-1),R=c.useRef(null),E=function(t){let n=(0,c.useRef)(t);return eax(()=>{n.current=t}),n}(x),A=c.useRef(!1),j=c.useRef(-1),[N,P]=c.useState(),L=c.useCallback((t,n)=>{j.current=requestAnimationFrame(()=>{var r,i;g?P(null==(r=t.current[n.current])?void 0:r.id):null==(i=t.current[n.current])||i.focus({preventScroll:!0})})},[g]);function F(t){var n,u,s,c;if(A.current=!0,h&&(n=t.key,eaJ(_,m?n===eaK:n===ea$,n===eaq))){eaD(t),i(!1),(c=o.domReference.current)&&c instanceof eaE(c).HTMLElement&&o.domReference.current.focus();return}let l=C.current,f=eaX(a,x),y=ea0(a,x);if("Home"===t.key&&(C.current=f,k(C.current)),"End"===t.key&&(C.current=y,k(C.current)),S>1){let v=C.current;if(t.key===eaq){if(eaD(t),-1===v)C.current=y;else if(C.current=eaG(a,{startingIndex:v,amount:S,decrement:!0,disabledIndices:x}),p&&(v-S<f||C.current<0)){let b=v%S,T=y%S,w=y-(T-b);T===b?C.current=y:C.current=T>b?w:w-S}eaZ(a,C.current)&&(C.current=v),k(C.current)}if(t.key===eaV&&(eaD(t),-1===v?C.current=f:(C.current=eaG(a,{startingIndex:v,amount:S,disabledIndices:x}),p&&v+S>y&&(C.current=eaG(a,{startingIndex:v%S-S,amount:S,disabledIndices:x}))),eaZ(a,C.current)&&(C.current=v),k(C.current)),"both"===_){let O=Math.floor(v/S);t.key===eaK&&(eaD(t),v%S!=S-1?(C.current=eaG(a,{startingIndex:v,disabledIndices:x}),p&&eaH(C.current,S,O)&&(C.current=eaG(a,{startingIndex:v-v%S-1,disabledIndices:x}))):p&&(C.current=eaG(a,{startingIndex:v-v%S-1,disabledIndices:x})),eaH(C.current,S,O)&&(C.current=v)),t.key===ea$&&(eaD(t),v%S!=0?(C.current=eaG(a,{startingIndex:v,disabledIndices:x,decrement:!0}),p&&eaH(C.current,S,O)&&(C.current=eaG(a,{startingIndex:v+(S-v%S),decrement:!0,disabledIndices:x}))):p&&(C.current=eaG(a,{startingIndex:v+(S-v%S),decrement:!0,disabledIndices:x})),eaH(C.current,S,O)&&(C.current=v)),eaZ(a,C.current)&&(p&&Math.floor(y/S)===O?C.current=t.key===ea$?y:eaG(a,{startingIndex:v-v%S-1,disabledIndices:x}):C.current=v),k(C.current);return}}if(eaY(t.key,_)){if(eaD(t),r&&!g&&eaF(t.currentTarget.ownerDocument)===t.currentTarget){C.current=eaQ(t.key,_,m)?f:y,k(C.current);return}eaQ(t.key,_,m)?p?C.current=l>=y?d&&l!==a.current.length?-1:f:eaG(a,{startingIndex:l,disabledIndices:x}):C.current=Math.min(y,eaG(a,{startingIndex:l,disabledIndices:x})):p?C.current=l<=f?d&&-1!==l?a.current.length:y:eaG(a,{startingIndex:l,decrement:!0,disabledIndices:x}):C.current=Math.max(f,eaG(a,{startingIndex:l,decrement:!0,disabledIndices:x})),eaZ(a,C.current)?k(null):k(C.current)}}return eax(()=>{l&&(!O&&r&&M.current&&null!=f&&k(f),O&&!r&&(cancelAnimationFrame(j.current),C.current=-1,I(null)))},[r,O,f,a,L,l,k,I]),eax(()=>{l&&r&&(null==u?null==f&&(O&&(C.current=-1,L(a,C)),!O&&M.current&&(null!=R.current||!0===M.current&&null==R.current)&&(C.current=null==R.current||eaQ(R.current,_,m)||h?eaX(a,E.current):ea0(a,E.current),k(C.current),L(a,C))):eaZ(a,u)||(C.current=u,L(a,C)))},[r,O,u,f,h,a,k,L,l,d,_,m,g,E]),eax(()=>{if(l&&!r&&O){var t,n;let i=null==w||null==(t=w.nodesRef.current.find(t=>t.id===T))||null==(n=t.context)?void 0:n.refs.floating.current;i&&!i.contains(eaF(eaR(i)))&&i.focus({preventScroll:!0})}},[l,r,O,w,T]),eax(()=>{R.current=null}),l?{reference:{...g&&r&&null!=u&&{"aria-activedescendant":N},onKeyDown(t){if(A.current=!0,g&&r)return F(t);if((0===t.key.indexOf("Arrow")||"Enter"===t.key||" "===t.key||""===t.key)&&(R.current=t.key),h){var n,o,u;n=t.key,eaJ(_,m?n===ea$:n===eaK,n===eaV)&&(eaD(t),r?(C.current=eaX(a,x),k(C.current)):i(!0));return}eaY(t.key,_)&&(null!=f&&(C.current=f),eaD(t),!r&&b?i(!0):F(t),r&&k(C.current))}},floating:{"aria-orientation":"both"===_?void 0:_,...g&&null!=u&&{"aria-activedescendant":N},onKeyDown:F,onPointerMove(){A.current=!1}},item:{onFocus(t){let{currentTarget:n}=t,r=a.current.indexOf(n);-1!==r&&k(r)},onClick(t){let{currentTarget:n}=t;return n.focus({preventScroll:!0})},...v&&{onMouseMove(t){let{currentTarget:n}=t;if(n){let r=a.current.indexOf(n);-1!==r&&k(r)}},onPointerLeave(){if(!A.current&&(C.current=-1,L(a,C),k(null),!g)){var t;null==(t=o.floating.current)||t.focus({preventScroll:!0})}}}}}:{}},ea2=new Yk("suggestion");function ea3(t){var n,r,i="";if("string"==typeof t||"number"==typeof t)i+=t;else if("object"==typeof t){if(Array.isArray(t))for(n=0;n<t.length;n++)t[n]&&(r=ea3(t[n]))&&(i&&(i+=" "),i+=r);else for(n in t)t[n]&&(i&&(i+=" "),i+=n)}return i}function ea4(){for(var t,n,r=0,i="";r<arguments.length;)(t=arguments[r++])&&(n=ea3(t))&&(i&&(i+=" "),i+=n);return i}let ea5=enk.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:t}){return["p",eeD(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),ea6={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"},ea9=()=>(++ea9.i).toString();ea9.i=0;let ea8=t=>{let n=eut(t),r=[];for(let i=0;i<n.length;i++)r.push(eun(n[i]));return{key:ea9(),children:r}},ea7=(t,n=[])=>({key:ea9(),type:t.type,text:"text"in t?t.text:void 0,node:t,children:n}),eue=t=>ea7({type:ea6.span,text:t,spans:[]}),eut=t=>{let n=t.slice(0);for(let r=0;r<n.length;r++){let i=n[r];if(i.type===ea6.listItem||i.type===ea6.oListItem){let o=[i];for(;n[r+1]&&n[r+1].type===i.type;)o.push(n[r+1]),n.splice(r,1);i.type===ea6.listItem?n[r]={type:ea6.list,items:o}:n[r]={type:ea6.oList,items:o}}}return n},eun=t=>{if("text"in t)return ea7(t,eur(t.spans,t));if("items"in t){let n=[];for(let r=0;r<t.items.length;r++)n.push(eun(t.items[r]));return ea7(t,n)}return ea7(t)},eur=(t,n,r)=>{if(!t.length)return[eue(n.text)];let i=t.slice(0);i.sort((t,n)=>t.start-n.start||n.end-t.end);let o=[];for(let a=0;a<i.length;a++){let u=i[a],s=r&&r.start||0,c=u.start-s,l=u.end-s,f=n.text.slice(c,l),d=[];for(let p=a;p<i.length;p++){let h=i[p];h!==u&&h.start>=u.start&&h.end<=u.end&&(d.push(h),i.splice(p,1),p--)}0===a&&c>0&&o.push(eue(n.text.slice(0,c)));let m={...u,text:f};o.push(ea7(m,eur(d,{...n,text:f},u))),l<n.text.length&&o.push(eue(n.text.slice(l,i[a+1]?i[a+1].start-s:void 0)))}return o},eui=(t,n)=>euo(ea8(t).children,n),euo=(t,n)=>{let r=[];for(let i=0;i<t.length;i++){let o=t[i],a=n(o.type,o.node,o.text,euo(o.children,n),o.key);null!=a&&r.push(a)}return r};ea6.listItem,ea6.oListItem,ea6.list,ea6.oList;let eua=enk.create({name:"text",group:"inline"}),euu={groupBy:(t,n)=>t.reduce((t,r)=>{let i=n(r),o=(t.get(i)||[]).concat(r);return t.set(i,o)},new Map),sort:t=>[...t].sort((t,n)=>t.start-n.start),mergeOverlap(t){let n=this.groupBy(t,t=>t.type),r=Array.from(n.entries()).map(([t,n])=>(this.sort(n).reduce((t,n)=>{if(!t.length)return[n];let r=t.length-1,i=t[r];return i.end>=n.start?[...t.slice(0,r),{...i,end:n.end}]:[...t,n]},[]),n)).reduce((t,n)=>[...t,...n],[]);return this.sort(r)}},eus={fromPrismic:t=>n=>{var r;return null==(r=ecy.find(t=>t.richTextNodeTypes[0]===n.type))?void 0:r.converter.fromPrismic(t)(n)},toPrismic(t,n,r){let[i,o]=(()=>{let n=ecy.find(n=>t.type.name===n.name);if(!n)throw Error(`Invalid mark extension '${t.type.name}'.`);return[n.richTextNodeTypes[0],n.converter.toPrismic(t)]})();return{type:i,start:n,end:r,...o?{data:o}:{}}}},euc=eua.extend({name:"text"}),eul={name:euc.name,component:euc,converter:{fromPrismic:t=>function(n,r,i=!1){let o={type:n,text:r.content.text,spans:r.content.spans||[]};return eui([o],function(t,n=!1){return(r,i,o,a)=>{if("span"===r&&o&&o.length)return n?[t.text(o)]:eoM.splitTextToNodes(t,o)(n=>t.text(n));{let u=eus.fromPrismic(t)(i);return u?a.flat().map(t=>t.mark([...t.marks,u].sort((t,n)=>t.type.name.localeCompare(n.type.name)))):a.flat()}}}(t,i))[0]},toPrismic(t,n,r){let i=eoh.children.reduce(t,(t,n)=>{let r=n.type.name===eoM.name?eoM.converter.toPrismic(n):n.textContent,i=r?t.text+r:t.text,o=t.text.length,a=i.length,u=n.marks.length?eoh.marks.map(n,t=>eus.toPrismic(t,o,a)):void 0;return{...t,text:i,spans:u?[...t.spans,...u]:t.spans}},{text:"",spans:[]});return{type:n,content:{text:i.text,spans:[...euu.mergeOverlap(i.spans)].sort((t,n)=>t.type.localeCompare(n.type))},...r}}}};var euf,eud=((euf=eud||{}).LeftToRight="ltr",euf.RightToLeft="rtl",euf);let eup=eiU.RichTextNodeType.rtl,euh=ee3.create({name:"textDirection",addOptions:()=>({supportedExtensionNames:[]}),addGlobalAttributes(){return[{types:this.options.supportedExtensionNames,attributes:{dir:{default:"ltr",parseHTML:t=>t.getAttribute("dir"),renderHTML:t=>({dir:"ltr"===t.dir?"ltr":"rtl"})}}}]},addCommands(){return{setDirection:t=>({commands:n})=>"rtl"===t?n.setRightToLeft():n.setLeftToRight(),toggleDirection:t=>({commands:n})=>n.setDirection("rtl"===t?"ltr":"rtl"),setRightToLeft:()=>({commands:t})=>this.options.supportedExtensionNames.every(n=>t.updateAttributes(n,{dir:"rtl"})),setLeftToRight:()=>({commands:t})=>this.options.supportedExtensionNames.every(n=>t.resetAttributes(n,"dir"))}},addKeyboardShortcuts(){return{"Mod-Shift-r":()=>this.editor.commands.setRightToLeft(),"Mod-Shift-l":()=>this.editor.commands.setLeftToRight()}}}),eum={parseNodeAttrsDirection:t=>"rtl"===t.dir?"rtl":"ltr",fromPrismic(t){let n="rtl"===t.direction?"rtl":"ltr";return{dir:n}},toPrismic(t){return{direction:this.parseNodeAttrsDirection(t.attrs)}}},eug=ea5.extend({name:"paragraph",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:t}){return["p",eeD(this.options.HTMLAttributes,t),0]}}),euy=new eon([eiU.RichTextNodeType.paragraph],eug.name,eug,{fromPrismic:t=>function(n){var r;let i=eul.converter.fromPrismic(t)(eug.name,n);return null==(r=t.nodes[eug.name])?void 0:r.create(eum.fromPrismic(n),i)},toPrismic:t=>eul.converter.toPrismic(t,eiU.RichTextNodeType.paragraph,eum.toPrismic(t))},"Type '/' for commands"),euv=euy,eub=["ArrowDown","ArrowUp","End","Home"],eux=["Enter"],eu_=["Escape",...eub,...eux],euS=ee3.create({name:"slash-commands",addOptions:()=>({nodeTypes:[]}),addProseMirrorPlugins(){let t=ecw(ecb,this.options.nodeTypes);return t.length>1?[function({pluginKey:t=ea2,editor:n,char:r="@",allowSpaces:i=!1,allowedPrefixes:o=[" "],startOfLine:a=!1,decorationTag:u="span",decorationClass:s="suggestion",command:c=()=>null,items:l=()=>[],render:f=()=>({}),allow:d=()=>!0}){let p,h=null==f?void 0:f(),m=new YT({key:t,view(){return{update:async(t,r)=>{var i,o,a,u,s,f,d;let m=null===(i=this.key)||void 0===i?void 0:i.getState(r),g=null===(o=this.key)||void 0===o?void 0:o.getState(t.state),y=m.active&&g.active&&m.range.from!==g.range.from,v=!m.active&&g.active,b=m.active&&!g.active,x=!v&&!b&&m.query!==g.query,_=v||y,S=x&&!y,T=b||y;if(!_&&!S&&!T)return;let w=T&&!_?m:g,O=t.dom.querySelector(`[data-decoration-id="${w.decorationId}"]`);p={editor:n,range:w.range,query:w.query,text:w.text,items:[],command(t){c({editor:n,range:w.range,props:t})},decorationNode:O,clientRect:O?()=>{var r;let{decorationId:i}=null===(r=this.key)||void 0===r?void 0:r.getState(n.state),o=t.dom.querySelector(`[data-decoration-id="${i}"]`);return(null==o?void 0:o.getBoundingClientRect())||null}:null},_&&(null===(a=null==h?void 0:h.onBeforeStart)||void 0===a||a.call(h,p)),S&&(null===(u=null==h?void 0:h.onBeforeUpdate)||void 0===u||u.call(h,p)),(S||_)&&(p.items=await l({editor:n,query:w.query})),T&&(null===(s=null==h?void 0:h.onExit)||void 0===s||s.call(h,p)),S&&(null===(f=null==h?void 0:h.onUpdate)||void 0===f||f.call(h,p)),_&&(null===(d=null==h?void 0:h.onStart)||void 0===d||d.call(h,p))},destroy(){var t;p&&(null===(t=null==h?void 0:h.onExit)||void 0===t||t.call(h,p))}}},state:{init:()=>({active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}),apply(t,u,s,c){let{isEditable:l}=n,{composing:f}=n.view,{selection:p}=t,{empty:h,from:m}=p,g={...u};if(g.composing=f,l&&(h||n.view.composing)){(m<u.range.from||m>u.range.to)&&!f&&!u.composing&&(g.active=!1);let y=function(t){var n,r;let{char:i,allowSpaces:o,allowedPrefixes:a,startOfLine:u,$position:s}=t,c=i.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),l=RegExp(`\\s${c}$`),f=u?"^":"",d=o?RegExp(`${f}${c}.*?(?=\\s${c}|$)`,"gm"):RegExp(`${f}(?:^)?${c}[^\\s${c}]*`,"gm"),p=(null===(n=s.nodeBefore)||void 0===n?void 0:n.isText)&&s.nodeBefore.text;if(!p)return null;let h=s.pos-p.length,m=Array.from(p.matchAll(d)).pop();if(!m||void 0===m.input||void 0===m.index)return null;let g=m.input.slice(Math.max(0,m.index-1),m.index),y=RegExp(`^[${null==a?void 0:a.join("")}\0]?$`).test(g);if(null!==a&&!y)return null;let v=h+m.index,b=v+m[0].length;return o&&l.test(p.slice(b-1,b+1))&&(m[0]+=" ",b+=1),v<s.pos&&b>=s.pos?{range:{from:v,to:b},query:m[0].slice(i.length),text:m[0]}:null}({char:r,allowSpaces:i,allowedPrefixes:o,startOfLine:a,$position:p.$from}),v=`id_${Math.floor(4294967295*Math.random())}`;y&&d({editor:n,state:c,range:y.range})?(g.active=!0,g.decorationId=u.decorationId?u.decorationId:v,g.range=y.range,g.query=y.query,g.text=y.text):g.active=!1}else g.active=!1;return g.active||(g.decorationId=null,g.range={from:0,to:0},g.query=null,g.text=null),g}},props:{handleKeyDown(t,n){var r;let{active:i,range:o}=m.getState(t.state);return i&&(null===(r=null==h?void 0:h.onKeyDown)||void 0===r?void 0:r.call(h,{view:t,event:n,range:o}))||!1},decorations(t){let{active:n,range:r,decorationId:i}=m.getState(t);return n?XF.create(t.doc,[XN.inline(r.from,r.to,{nodeName:u,class:s,"data-decoration-id":i})]):null}}});return m}({allowSpaces:!0,char:"/",editor:this.editor,startOfLine:!0,allow({state:t}){let n=t.selection.$from;return n.parent.type.name===euv.name&&1===n.depth},command({editor:t,props:n,range:r}){n.runCommands(t,{deleteRange:r})},items({query:n}){let r=n.toLocaleLowerCase().trim();return t.filter(t=>{var n,i;return(null==(n=t.shortText)?void 0:n.toLocaleLowerCase().includes(r))||(null==(i=t.text)?void 0:i.toLocaleLowerCase().includes(r))})},render(){let t;return{onStart(n){t=new eiF(euT,{editor:n.editor,props:n}),document.body.appendChild(t.element)},onUpdate(n){null==t||t.updateProps(n)},onKeyDown({event:n}){var r;return eu_.includes(n.key)&&(null==(r=null==t?void 0:t.ref)?void 0:r.handleKeyDown(n))},onExit(){null==t||t.destroy(),null==t||t.element.remove()}}}})]:[]}}),euT=(0,c.forwardRef)(function({command:t,decorationNode:n,editor:r,items:i},o){var a,u,s,d,p;let[h,m]=(0,c.useState)(!0),g=parseFloat(l.TV.space[0]),{context:y,floating:b,reference:x,strategy:_,x:S,y:T}=function(t){let{open:n=!1,onOpenChange:r,whileElementsMounted:i,placement:o,middleware:a,strategy:u,nodeId:s}=void 0===t?{}:t,[l,f]=c.useState(null),d=eaC(),p=c.useRef(null),h=c.useRef({}),m=c.useState(()=>(function(){let t=new Map;return{emit(n,r){var i;null==(i=t.get(n))||i.forEach(t=>t(r))},on(n,r){t.set(n,[...t.get(n)||[],r])},off(n,r){t.set(n,(t.get(n)||[]).filter(t=>t!==r))}}})())[0],g=function(t){void 0===t&&(t={});let{placement:n="bottom",strategy:r="absolute",middleware:i=[],platform:o,whileElementsMounted:a,open:u}=t,[s,l]=c.useState({x:null,y:null,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[f,d]=c.useState(i);eav(f,i)||d(i);let p=c.useRef(null),h=c.useRef(null),m=c.useRef(s),g=eab(a),y=eab(o),[b,x]=c.useState(null),[_,S]=c.useState(null),T=c.useCallback(t=>{p.current!==t&&(p.current=t,x(t))},[]),w=c.useCallback(t=>{h.current!==t&&(h.current=t,S(t))},[]),O=c.useCallback(()=>{if(!p.current||!h.current)return;let t={placement:n,strategy:r,middleware:f};y.current&&(t.platform=y.current),eag(p.current,h.current,t).then(t=>{let n={...t,isPositioned:!0};k.current&&!eav(m.current,n)&&(m.current=n,v.flushSync(()=>{l(n)}))})},[f,n,r,y]);eay(()=>{!1===u&&m.current.isPositioned&&(m.current.isPositioned=!1,l(t=>({...t,isPositioned:!1})))},[u]);let k=c.useRef(!1);eay(()=>(k.current=!0,()=>{k.current=!1}),[]),eay(()=>{if(b&&_){if(g.current)return g.current(b,_,O);O()}},[b,_,O,g]);let I=c.useMemo(()=>({reference:p,floating:h,setReference:T,setFloating:w}),[T,w]),M=c.useMemo(()=>({reference:b,floating:_}),[b,_]);return c.useMemo(()=>({...s,update:O,refs:I,elements:M,reference:T,floating:w}),[s,O,I,M,T,w])}({placement:o,middleware:a,strategy:u,whileElementsMounted:i}),y=eaN(r),b=c.useMemo(()=>({...g.refs,domReference:p}),[g.refs]),x=c.useMemo(()=>({...g,refs:b,dataRef:h,nodeId:s,events:m,open:n,onOpenChange:y,_:{domReference:l}}),[g,s,m,n,y,b,l]);eax(()=>{let t=null==d?void 0:d.nodesRef.current.find(t=>t.id===s);t&&(t.context=x)});let{reference:_}=g,S=c.useCallback(t=>{(eaA(t)||null===t)&&(x.refs.domReference.current=t,f(t)),_(t)},[_,x.refs]);return c.useMemo(()=>({...g,context:x,refs:b,reference:S}),[g,b,x,S])}({middleware:[(void 0===(a=g)&&(a=0),{name:"offset",options:a,async fn(t){let{x:n,y:r}=t,i=await eoK(t,a);return{x:n+i.x,y:r+i.y,data:i}}}),(void 0===u&&(u={}),{name:"flip",options:u,async fn(t){var n,r,i,o;let{placement:a,middlewareData:s,rects:c,initialPlacement:l,platform:f,elements:d}=t,{mainAxis:p=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:v=!0,...b}=u,x=eoj(a),_=eoj(l)===l,S=await (null==f.isRTL?void 0:f.isRTL(d.floating)),T=m||(_||!v?[eoq(l)]:function(t){let n=eoq(t);return[eo$(t),n,eo$(n)]}(l));m||"none"===y||T.push(...function(t,n,r,i){let o=eoE(t),a=function(t,n,r){let i=["left","right"],o=["right","left"];switch(t){case"top":case"bottom":return r?n?o:i:n?i:o;case"left":case"right":return n?["top","bottom"]:["bottom","top"];default:return[]}}(eoj(t),"start"===r,i);return o&&(a=a.map(t=>t+"-"+o),n&&(a=a.concat(a.map(eo$)))),a}(l,v,y,S));let w=await eoD(t,b),O=[],k=(null==(n=s.flip)?void 0:n.overflows)||[];if(p&&O.push(w[x]),h){let{main:I,cross:M}=function(t,n,r){void 0===r&&(r=!1);let i=eoE(t),o=eoN(t),a=eoA(o),u="x"===o?i===(r?"end":"start")?"right":"left":"start"===i?"bottom":"top";return n.reference[a]>n.floating[a]&&(u=eoq(u)),{main:u,cross:eoq(u)}}(a,c,S);O.push(w[I],w[M])}if(k=[...k,{placement:a,overflows:O}],!O.every(t=>t<=0)){let C=((null==(r=s.flip)?void 0:r.index)||0)+1,R=[l,...T][C];if(R)return{data:{index:C,overflows:k},reset:{placement:R}};let E=null==(i=k.filter(t=>t.overflows[0]<=0).sort((t,n)=>t.overflows[1]-n.overflows[1])[0])?void 0:i.placement;if(!E)switch(g){case"bestFit":{let A=null==(o=k.map(t=>[t.placement,t.overflows.filter(t=>t>0).reduce((t,n)=>t+n,0)]).sort((t,n)=>t[1]-n[1])[0])?void 0:o[0];A&&(E=A);break}case"initialPlacement":E=l}if(a!==E)return{reset:{placement:E}}}return{}}}),(d={limiter:(void 0===s&&(s={}),{options:s,fn(t){let{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:u=0,mainAxis:c=!0,crossAxis:l=!0}=s,f={x:n,y:r},d=eoN(i),p=eoH(d),h=f[d],m=f[p],g="function"==typeof u?u(t):u,y="number"==typeof g?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){let v="y"===d?"height":"width",b=o.reference[d]-o.floating[v]+y.mainAxis,x=o.reference[d]+o.reference[v]-y.mainAxis;h<b?h=b:h>x&&(h=x)}if(l){var _,S;let T="y"===d?"width":"height",w=["top","left"].includes(eoj(i)),O=o.reference[p]-o.floating[T]+(w&&(null==(_=a.offset)?void 0:_[p])||0)+(w?0:y.crossAxis),k=o.reference[p]+o.reference[T]+(w?0:(null==(S=a.offset)?void 0:S[p])||0)-(w?y.crossAxis:0);m<O?m=O:m>k&&(m=k)}return{[d]:h,[p]:m}}})},{name:"shift",options:d,async fn(t){let{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:u={fn(t){let{x:n,y:r}=t;return{x:n,y:r}}},...s}=d,c={x:n,y:r},l=await eoD(t,s),f=eoN(eoj(i)),p=eoH(f),h=c[f],m=c[p];if(o){let g=h+l["y"===f?"top":"left"],y=h-l["y"===f?"bottom":"right"];h=eoz(g,h,y)}if(a){let v=m+l["y"===p?"top":"left"],b=m-l["y"===p?"bottom":"right"];m=eoz(v,m,b)}let x=u.fn({...t,[f]:h,[p]:m});return{...x,data:{x:x.x-n,y:x.y-r}}}})],onOpenChange:m,open:h,placement:"top-start",strategy:"fixed",whileElementsMounted:eam});(0,c.useLayoutEffect)(()=>{x(n)},[x,n]),(0,c.useEffect)(()=>{let t,n=()=>{t=window.setTimeout(()=>{m(!0)})},i=()=>{m(!1)};return r.on("focus",n).on("blur",i),()=>{r.off("focus",n).off("blur",i),clearTimeout(t)}},[r]);let[w,O]=(0,c.useState)(0),k=(0,c.useRef)([]);(0,f.pQ)(i,()=>{O(0),k.current=[]});let{getFloatingProps:I,getItemProps:C,getReferenceProps:R}=(p=[eaB(y,{outsidePointerDown:!1}),ea1(y,{activeIndex:w,listRef:k,onNavigate(t){O(n=>t??n)},openOnArrowKeyDown:!1,virtual:!0}),eaU(y,{role:"menu"})],{getReferenceProps:t=>eaP(t,p,"reference"),getFloatingProps:t=>eaP(t,p,"floating"),getItemProps:t=>eaP(t,p,"item")}),E=R().onKeyDown;(0,c.useImperativeHandle)(o,()=>({handleKeyDown(n){if(!h)return!1;if(eub.includes(n.key)&&E(n),eux.includes(n.key)){let r=i[w];void 0!==r&&t(r)}return!0}}),[w,t,i,E,h]);let A=(0,c.useId)();return h?M.jsxs("div",{...I(),className:l._s.content,ref:b,style:{top:parseFloat(l.TV.space[0]),left:parseFloat(l.TV.space[0]),minWidth:256,position:_,transform:null!==S&&null!==T?`translate3d(${Math.round(S)}px, ${Math.round(T)}px, 0)`:"translate3d(0, -200%, 0)"},children:[i.map((n,r)=>(0,c.createElement)(euw,{...C({onClick(){t(n)},onPointerDown(t){t.preventDefault()}}),"data-highlighted":r===w?"":void 0,id:`${A}[${r}]`,key:n.nodeType,ref(t){k.current[r]=t},shortcut:`/${n.shortText??""}`,startIcon:n.icon},n.text)),0===i.length?M.jsx(euw,{...C({onPointerDown(t){t.preventDefault()}}),disabled:!0,id:`${A}[0]`,ref(t){k.current[0]=t},children:"No results"}):null]}):null}),euw=(0,c.forwardRef)(function({children:t,disabled:n,shortcut:r,startIcon:i,...o},a){return M.jsxs("div",{...o,...n?{"aria-disabled":!0,"data-disabled":!0}:{},className:l._s.item,ref:a,role:"menuitem",children:[(0,c.isValidElement)(i)?(0,c.cloneElement)(i,{className:ea4(i.props.className,l._s.itemStartIcon)}):null,M.jsx(l.xv,{className:ea4(l._s.itemText,l._s.itemTextColor.grey),component:"span",children:t}),r?M.jsx(l.xv,{className:l._s.itemShortcut,color:"inherit",component:"span",variant:"inherit",children:r}):null]})}),euO=eod.extend({name:"bulletList",parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:t}){return["ul",eeD(this.options.HTMLAttributes,t),0]}}).configure({itemTypeName:"listItem"}),euk=new eoo([eiU.RichTextNodeType.list],euO.name,euO,{fromPrismic:t=>function(n){var r;let i=eob.converter.fromPrismic(t)(n);if(i)return null==(r=t.nodes[euO.name])?void 0:r.create(eum.fromPrismic(n),i)},toPrismic:t=>eoh.children.map(t,t=>eob.converter.toPrismic(t,eiU.RichTextNodeType.list).filter(d.$)).flat()}),euI=euk,euM=/^```([a-z]+)?[\s\n]$/,euC=/^~~~([a-z]+)?[\s\n]$/,euR=enk.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:t=>{var n;let{languageClassPrefix:r}=this.options,i=[...(null===(n=t.firstElementChild)||void 0===n?void 0:n.classList)||[]].filter(t=>t.startsWith(r)).map(t=>t.replace(r,""))[0];return i||null},rendered:!1}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({node:t,HTMLAttributes:n}){return["pre",eeD(this.options.HTMLAttributes,n),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:n})=>n.setNode(this.name,t),toggleCodeBlock:t=>({commands:n})=>n.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:t,$anchor:n}=this.editor.state.selection,r=1===n.pos;return!!t&&n.parent.type.name===this.name&&(!!r||!n.parent.textContent.length)&&this.editor.commands.clearNodes()},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:n}=t,{selection:r}=n,{$from:i,empty:o}=r;if(!o||i.parent.type!==this.type)return!1;let a=i.parentOffset===i.parent.nodeSize-2,u=i.parent.textContent.endsWith(`
92
+ `}}function o(n){return r.exact(r.intersection([r.type({id:r.string,label:zz.StringOrNull,repeatable:(0,BD.withFallback)(r.boolean,!0),json:r.record(r.string,n),status:(0,BD.withFallback)(r.boolean,!0)}),r.partial({hash:r.string,format:(0,BD.withFallback)(r.keyof(t.CustomTypeFormat),"custom")})]))}function a(t){return Object.entries(t.json).reduce((t,[,n])=>{let r=Object.entries(n);return t.concat(r)},[])}function u(t,n){let r=Object.entries(t.json).reduce((t,[r,i])=>{let o=Object.entries(i).reduce((t,[r,i])=>{let o=n(r,i);return o?{...t,[r]:o}:t},{});return{...t,[r]:o}},{});return{...t,json:r}}t.StaticCustomType=o(eiH.StaticSection),t.CustomType=o(eiH.DynamicSection),t.flattenWidgets=a,t.toStatic=function(t,n){let r=Object.entries(t.json).reduce((t,[r,i])=>({...t,[r]:eiH.Sections.toStatic(i,n)}),{});return{...t,json:r}},t.validateSlices=function(t,n){let r=(function(t){var n;let r=a(t).filter(([,t])=>"Slices"===t.type).reduce((t,[,n])=>{let r=Object.entries(n.config&&n.config.choices?n.config.choices:{}).filter(([,t])=>"SharedSlice"===t.type).map(([t])=>t);return t.concat(r)},[]);return function(t){return r.map(t)}})(t)(t=>{if(!n.get(t))return t}).filter(Boolean);return r.length>0?(0,Da.left)(new i(r)):(0,Da.right)(t)},t.collectWidgets=u,t.filterMissingSharedSlices=function(t,n){return u(t,(t,r)=>{if("Slices"===r.type){if(!r.config||!r.config.choices)return r;let i=Object.entries(r.config.choices).reduce((t,[r,i])=>"SharedSlice"!==i.type||n.get(r)?{...t,[r]:i}:t,{}),o={...r.config,choices:i};return{...r,config:o}}return r})}}(eiK);var eiY,eiQ,eiX={},ei0={};Object.defineProperty(eiY=ei0,"__esModule",{value:!0}),eiY.DiffOperation=void 0,(eiQ=eiY.DiffOperation||(eiY.DiffOperation={})).Added="added",eiQ.Removed="removed",eiQ.Updated="updated";var ei1={},ei2={},ei3={};Object.defineProperty(ei3,"__esModule",{value:!0}),ei3.toRecord=void 0,ei3.toRecord=function(t,n){return t.reduce((t,r)=>{let i=n(r);return{...t,[i]:r}},{})},Object.defineProperty(ei2,"__esModule",{value:!0}),ei2.Objects=ei2.Arrays=void 0;let ei4=oN;ei2.Arrays=(0,ei4.__importStar)(ei3),ei2.Objects=(0,ei4.__importStar)(q6);var ei5={};function ei6(t,n){let r=ei2.Objects.zipObjects(t,n),i=Object.entries(r).reduce((t,[n,r])=>{if(JSON.stringify(null==r?void 0:r.left)===JSON.stringify(null==r?void 0:r.right))return t;let i=(()=>{if(!(!(null!=r&&r.left)&&!(null!=r&&r.right)))return null!=r&&r.left&&!r.right?{op:ei0.DiffOperation.Removed}:!(null!=r&&r.left)&&null!=r&&r.right?{op:ei0.DiffOperation.Added,value:r.right}:{op:ei0.DiffOperation.Updated,value:r.right}})();return i?{...t,[n]:i}:t},{});return ei2.Objects.isNotEmpty(i)?i:void 0}Object.defineProperty(ei5,"__esModule",{value:!0}),ei5.VariationComparator=void 0,ei5.VariationComparator={compare(t,n){if(t&&!n)return{op:ei0.DiffOperation.Removed};if(!t&&n)return{op:ei0.DiffOperation.Added,value:n};let r=function(t,n){let r=ei2.Objects.zipObjects(t,n);return Object.entries(r).reduce((t,[n,r])=>"primary"===n||"items"===n||(null==r?void 0:r.left)===(null==r?void 0:r.right)?t:{...t,[n]:null==r?void 0:r.right},{})}(t,n),i=ei6(null==t?void 0:t.primary,null==n?void 0:n.primary),o=ei6(null==t?void 0:t.items,null==n?void 0:n.items),a={...r,...i?{primary:i}:{},...o?{items:o}:{}};if(ei2.Objects.isNotEmpty(a))return{op:ei0.DiffOperation.Updated,value:a}}},Object.defineProperty(ei1,"__esModule",{value:!0}),ei1.SliceComparator=void 0,ei1.SliceComparator={compare(t,n){if(!t&&n)return{op:ei0.DiffOperation.Added,value:n};if(t&&!n)return{op:ei0.DiffOperation.Removed};let r=function(t,n){let r=ei2.Objects.zipObjects(t,n);return Object.entries(r).reduce((t,[n,r])=>"variations"===n||(null==r?void 0:r.left)===(null==r?void 0:r.right)?t:{...t,[n]:null==r?void 0:r.right},{})}(t,n),i=ei2.Objects.zipObjects(t&&ei2.Arrays.toRecord(t.variations,t=>t.id),n&&ei2.Arrays.toRecord(n.variations,t=>t.id)),o=Object.entries(i).reduce((t,[n,r])=>{if(!r)return t;let i=ei5.VariationComparator.compare(r.left,r.right);return i?{...t,[n]:i}:t},{}),a={...r,...ei2.Objects.isNotEmpty(o)?{variations:o}:{}};if(ei2.Objects.isNotEmpty(a))return{op:ei0.DiffOperation.Updated,value:a}}},function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=oN;(0,n.__exportStar)(ei0,t),(0,n.__exportStar)(ei1,t),(0,n.__exportStar)(ei5,t)}(eiX),function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=oN;(0,n.__exportStar)(eiK,t),(0,n.__exportStar)(eiX,t),(0,n.__exportStar)(eiH,t),(0,n.__exportStar)(zW,t)}(ei$);let ei9=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,ei8=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,ei7=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,eoe=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,eot=enR.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"strong"},{tag:"b",getAttrs:t=>"normal"!==t.style.fontWeight&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}],renderHTML({HTMLAttributes:t}){return["strong",eeq(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[enI({find:ei9,type:this.type}),enI({find:ei7,type:this.type})]},addPasteRules(){return[enj({find:ei8,type:this.type}),enj({find:eoe,type:this.type})]}});var eon,eor,eoi=((eon=eoi||{}).Document="document",eon.Mark="mark",eon.Node="node",eon),eoo=((eor=eoo||{}).Text="text",eor.Embed="embed",eor.Image="image",eor);class eoa{constructor(t,n,r,i){w(this,"extType","mark"),this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i}}class eou{constructor(t,n,r,i,o,a=!1){w(this,"extType","node"),w(this,"nodeType","text"),this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i,this.placeholder=o,this.lockedFormat=a}}function eos(t){return t instanceof eou}class eoc extends eou{constructor(t,n,r,i,o){super(t,"heading",n,i,o),this.levels=r}}class eol extends eou{constructor(t,n,r,i){super(t,n,r,i)}}function eof(t){return t instanceof eol}let eod=eot.extend({name:"bold"}),eop=new eoa([ei$.RichTextNodeType.strong],eod.name,eod,{fromPrismic:t=>function(){var n;return null==(n=t.marks[eod.name])?void 0:n.create()},toPrismic(){}}),eoh=enE.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",eeq(this.options.HTMLAttributes,t),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)}}}),eom=enR.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:t=>!!t.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:t}){return["span",eeq(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:n})=>{let r=et1(t,this.type);return!!Object.entries(r).some(([,t])=>!!t)||n.unsetMark(this.name)}}}}),eog=/^\s*([-+*])\s$/,eoy=enE.create({name:"bulletList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:t}){return["ul",eeq(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:n})=>this.options.keepAttributes?n().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(eoh.name,this.editor.getAttributes(eom.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=enC({find:eog,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=enC({find:eog,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(eom.name),editor:this.editor})),[t]}}),eov=enE.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:t}){return["br",eeq(this.options.HTMLAttributes,t)]},renderText:()=>`
93
+ `,addCommands(){return{setHardBreak:()=>({commands:t,chain:n,state:r,editor:i})=>t.first([()=>t.exitCode(),()=>t.command(()=>{let{selection:t,storedMarks:o}=r;if(t.$from.parent.type.spec.isolating)return!1;let{keepMarks:a}=this.options,{splittableMarks:u}=i.extensionManager,s=o||t.$to.parentOffset&&t.$from.marks();return n().insertContent({type:this.name}).command(({tr:t,dispatch:n})=>{if(n&&s&&a){let r=s.filter(t=>u.includes(t.type.name));t.ensureMarks(r)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),eob={isHardBreak:t=>t.type.name===eov.name,children:{reduce(t,n,r){let i=r;return t.forEach((t,r,o)=>{i=n(i,t,o)}),i},map(t,n){return this.reduce(t,(t,r)=>[...t,n(r)],[])},exists(t,n){return this.reduce(t,(t,r)=>t||n(r),!1)},filter(t,n){return this.reduce(t,(t,r)=>[...t,...n(r)?[r]:[]],[])}},marks:{reduce(t,n,r){let i=r;return t.marks.forEach((t,r)=>{i=n(i,t,r)}),i},map(t,n){return this.reduce(t,(t,r)=>[...t,n(r)],[])},filter(t,n){return this.reduce(t,(t,r)=>[...t,...n(r)?[r]:[]],[])}}};function eox(){return{extensions:ecT(),defaultTextConverter:void 0}}let eo_=enE.create({name:"doc",topNode:!0,content:"block+"}),eoS=enE.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",eeq(this.options.HTMLAttributes,t),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)}}}),eoT=eoS.extend({name:"listItem",content:"paragraph*",addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name)}}}),eow={component:eoT,converter:{fromPrismic:t=>function(n){var r;let i=euT.converter.fromPrismic(t)(n);if(i)return null==(r=t.nodes[eoT.name])?void 0:r.create({},i)},toPrismic:(t,n)=>eob.children.reduce(t,(t,r)=>{let i=euT.converter.toPrismic(r),o=i instanceof Array?i.map(t=>({...t,type:n})):i?[{...i,type:n}]:[];return[...t,...o]},[])},placeholder:"List"},eoO="document",eok=t=>eo_.extend({name:eoO,content:t?"block+":"block"}),eoI=t=>({fromPrismic(n,r){function i(t){return function(n){return!n&&r&&oj.TextBlock.is(t)?r(t):n}}return function(r){var o;let a=r.value.reduce((r,o)=>{let a=t.find(t=>t.richTextNodeTypes.includes(o.type)),u=(()=>{if(a)switch(a.nodeType){case eoo.Embed:return oj.EmbedBlock.is(o)&&a.converter.fromPrismic(n)(o);case eoo.Text:return oj.TextBlock.is(o)&&a.converter.fromPrismic(n)(o);case eoo.Image:return oj.ImageBlock.is(o)&&a.converter.fromPrismic(n)(o);default:return}})(),s=r.length-1,c=r.slice(0,s),l=uH(c),f=u?Z(l,pj(()=>({merged:!1,node:u}),t=>{var n;return u.type.name===t.type.name&&(u.type.name===euA.name||u.type.name===ec_.name)?{merged:!0,node:(n=[t,u]).slice(1,n.length).reduce((t,n)=>t.copy(t.content.append(n.content)),n[0])}:{merged:!1,node:u}}),({merged:t,node:n})=>({merged:t,node:i(o)(n)})):{merged:!1,node:i(o)()};return f.node?[...f.merged?c:r,f.node]:r},[]);return null==(o=n.nodes[eoO])?void 0:o.create({},a)}},toPrismic:n=>({__TYPE__:"StructuredTextContent",value:[...eob.children.reduce(n,(n,r)=>{let i=Object.values(t).find(t=>r.type.name===t.name),o=null==i?void 0:i.converter.toPrismic(r);return o||console.warn(`Cannot convert node of type '${r.type.name}'.`),o?[...n,...o instanceof Array?o:[o]]:n},[])]})}),eoM=new class{constructor(t,n,r){w(this,"extType","document"),this.name=t,this.component=n,this.converter=r}}(eoO,eok,eoI),eoC=eov.extend({name:"hard_break"}),eoR=`
94
+ `,eoE={fromPrismic:t=>function(n){var r;if(n===eoR)return null==(r=t.nodes[eoC.name])?void 0:r.create({})},toPrismic(t){if(t.type.name===eoC.name)return eoR}},eoA={isEmptyLine:t=>0===t.length,isFirst:t=>0===t},eoj={name:eoC.name,component:eoC,converter:eoE,splitTextToNodes:function(t,n){return function(r){let i=eoE.fromPrismic(t)(eoR);if(!i)return[r(n)];let o=n.split(eoR);return 1===o.length?n.length?[r(n)]:[i]:o.reduce((t,n,o)=>eoA.isFirst(o)?eoA.isEmptyLine(n)?t:[...t,r(n)]:eoA.isEmptyLine(n)?[...t,i]:[...t,i,r(n)],[])}}},eoN=ee8.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){return[new YM({key:new YE("placeholder"),props:{decorations:({doc:t,selection:n})=>{let r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=n,o=[];if(!r)return null;let a=t.type.createAndFill(),u=(null==a?void 0:a.sameMarkup(t))&&null===a.content.findDiffStart(t.content);return t.descendants((t,n)=>{let r=i>=n&&i<=n+t.nodeSize,a=!t.isLeaf&&!t.childCount;if((r||!this.options.showOnlyCurrent)&&a){let s=[this.options.emptyNodeClass];u&&s.push(this.options.emptyEditorClass);let c=XW.node(n,n+t.nodeSize,{class:s.join(" "),"data-placeholder":"function"==typeof this.options.placeholder?this.options.placeholder({editor:this.editor,node:t,pos:n,hasAnchor:r}):this.options.placeholder});o.push(c)}return this.options.includeChildren}),XB.create(t,o)}}})]}}),eoP=t=>eoN.configure({includeChildren:!0,placeholder:n=>(function({props:t,params:n}){var r;let{editor:i,hasAnchor:o,node:a}=t,{placeholderByNodeType:u,unfocusedPlaceholder:s,nodeExtensions:c}=n,l=!eob.children.exists(i.state.doc,t=>t===a),f=i.isEditable,d=i.isFocused&&o,p=a.type.name!==euT.name,h=d||p||l,m=c.length>1,g=function(){if(l)return eow.placeholder;let t=u[a.type.name];return"string"==typeof t?t:null==t?void 0:t(a.attrs)}();return s&&!d&&i.isEmpty?s:("Type '/' for commands"===g?f&&h&&m:f&&h)&&g||""})({props:n,params:t}),showOnlyCurrent:!1,showOnlyWhenEditable:!1});function eoL(t){return t.split("-")[1]}function eoF(t){return"y"===t?"height":"width"}function eoD(t){return t.split("-")[0]}function eoW(t){return["top","bottom"].includes(eoD(t))?"x":"y"}function eoU(t,n,r){let{reference:i,floating:o}=t,a=i.x+i.width/2-o.width/2,u=i.y+i.height/2-o.height/2,s=eoW(n),c=eoF(s),l=i[c]/2-o[c]/2,f=eoD(n),d="x"===s,p;switch(f){case"top":p={x:a,y:i.y-o.height};break;case"bottom":p={x:a,y:i.y+i.height};break;case"right":p={x:i.x+i.width,y:u};break;case"left":p={x:i.x-o.width,y:u};break;default:p={x:i.x,y:i.y}}switch(eoL(n)){case"start":p[s]-=l*(r&&d?-1:1);break;case"end":p[s]+=l*(r&&d?-1:1)}return p}let eoz=async(t,n,r)=>{let{placement:i="bottom",strategy:o="absolute",middleware:a=[],platform:u}=r,s=a.filter(Boolean),c=await (null==u.isRTL?void 0:u.isRTL(n)),l=await u.getElementRects({reference:t,floating:n,strategy:o}),{x:f,y:d}=eoU(l,i,c),p=i,h={},m=0;for(let g=0;g<s.length;g++){let{name:y,fn:v}=s[g],{x:b,y:x,data:_,reset:S}=await v({x:f,y:d,initialPlacement:i,placement:p,strategy:o,middlewareData:h,rects:l,platform:u,elements:{reference:t,floating:n}});if(f=b??f,d=x??d,h={...h,[y]:{...h[y],..._}},S&&m<=50){m++,"object"==typeof S&&(S.placement&&(p=S.placement),S.rects&&(l=!0===S.rects?await u.getElementRects({reference:t,floating:n,strategy:o}):S.rects),{x:f,y:d}=eoU(l,p,c)),g=-1;continue}}return{x:f,y:d,placement:p,strategy:o,middlewareData:h}};function eoB(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}async function eoq(t,n){var r,i,o;void 0===n&&(n={});let{x:a,y:u,platform:s,rects:c,elements:l,strategy:f}=t,{boundary:d="clippingAncestors",rootBoundary:p="viewport",elementContext:h="floating",altBoundary:m=!1,padding:g=0}=n,y="number"!=typeof g?{top:0,right:0,bottom:0,left:0,...g}:{top:g,right:g,bottom:g,left:g},v=l[m?"floating"===h?"reference":"floating":h],b=eoB(await s.getClippingRect({element:null==(r=await (null==s.isElement?void 0:s.isElement(v)))||r?v:v.contextElement||await (null==s.getDocumentElement?void 0:s.getDocumentElement(l.floating)),boundary:d,rootBoundary:p,strategy:f})),x="floating"===h?{...c.floating,x:a,y:u}:c.reference,_=await (null==s.getOffsetParent?void 0:s.getOffsetParent(l.floating)),S=await (null==s.isElement?void 0:s.isElement(_))&&await (null==s.getScale?void 0:s.getScale(_))||{x:1,y:1},T=eoB(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({rect:x,offsetParent:_,strategy:f}):x);return{top:(b.top-T.top+y.top)/S.y,bottom:(T.bottom-b.bottom+y.bottom)/S.y,left:(b.left-T.left+y.left)/S.x,right:(T.right-b.right+y.right)/S.x}}let eoV=Math.min,eo$=Math.max;function eoK(t,n,r){return eo$(t,eoV(n,r))}let eoH={left:"right",right:"left",bottom:"top",top:"bottom"};function eoZ(t){return t.replace(/left|right|bottom|top/g,t=>eoH[t])}let eoG={start:"end",end:"start"};function eoJ(t){return t.replace(/start|end/g,t=>eoG[t])}async function eoY(t,n){let{placement:r,platform:i,elements:o}=t,a=await (null==i.isRTL?void 0:i.isRTL(o.floating)),u=eoD(r),s=eoL(r),c="x"===eoW(r),l=["left","top"].includes(u)?-1:1,f=a&&c?-1:1,d="function"==typeof n?n(t):n,{mainAxis:p,crossAxis:h,alignmentAxis:m}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&"number"==typeof m&&(h="end"===s?-1*m:m),c?{x:h*f,y:p*l}:{x:p*l,y:h*f}}function eoQ(t){return"x"===t?"y":"x"}function eoX(t){var n;return(null==(n=t.ownerDocument)?void 0:n.defaultView)||window}function eo0(t){return eoX(t).getComputedStyle(t)}let eo1=Math.min,eo2=Math.max,eo3=Math.round;function eo4(t){let n=eo0(t),r=parseFloat(n.width),i=parseFloat(n.height),o=t.offsetWidth,a=t.offsetHeight,u=eo3(r)!==o||eo3(i)!==a;return u&&(r=o,i=a),{width:r,height:i,fallback:u}}function eo5(t){return eae(t)?(t.nodeName||"").toLowerCase():""}let eo6;function eo9(){if(eo6)return eo6;let t=navigator.userAgentData;return t&&Array.isArray(t.brands)?eo6=t.brands.map(t=>t.brand+"/"+t.version).join(" "):navigator.userAgent}function eo8(t){return t instanceof eoX(t).HTMLElement}function eo7(t){return t instanceof eoX(t).Element}function eae(t){return t instanceof eoX(t).Node}function eat(t){if(typeof ShadowRoot>"u")return!1;let n=eoX(t).ShadowRoot;return t instanceof n||t instanceof ShadowRoot}function ean(t){let{overflow:n,overflowX:r,overflowY:i,display:o}=eo0(t);return/auto|scroll|overlay|hidden|clip/.test(n+i+r)&&!["inline","contents"].includes(o)}function ear(t){return["table","td","th"].includes(eo5(t))}function eai(t){let n=/firefox/i.test(eo9()),r=eo0(t),i=r.backdropFilter||r.WebkitBackdropFilter;return"none"!==r.transform||"none"!==r.perspective||!!i&&"none"!==i||n&&"filter"===r.willChange||n&&!!r.filter&&"none"!==r.filter||["transform","perspective"].some(t=>r.willChange.includes(t))||["paint","layout","strict","content"].some(t=>{let n=r.contain;return null!=n&&n.includes(t)})}function eao(){return/^((?!chrome|android).)*safari/i.test(eo9())}function eaa(t){return["html","body","#document"].includes(eo5(t))}function eau(t){return eo7(t)?t:t.contextElement}let eas={x:1,y:1};function eac(t){let n=eau(t);if(!eo8(n))return eas;let r=n.getBoundingClientRect(),{width:i,height:o,fallback:a}=eo4(n),u=(a?eo3(r.width):r.width)/i,s=(a?eo3(r.height):r.height)/o;return u&&Number.isFinite(u)||(u=1),s&&Number.isFinite(s)||(s=1),{x:u,y:s}}function eal(t,n,r,i){var o,a;void 0===n&&(n=!1),void 0===r&&(r=!1);let u=t.getBoundingClientRect(),s=eau(t),c=eas;n&&(i?eo7(i)&&(c=eac(i)):c=eac(t));let l=s?eoX(s):window,f=eao()&&r,d=(u.left+(f&&(null==(o=l.visualViewport)?void 0:o.offsetLeft)||0))/c.x,p=(u.top+(f&&(null==(a=l.visualViewport)?void 0:a.offsetTop)||0))/c.y,h=u.width/c.x,m=u.height/c.y;if(s){let g=eoX(s),y=i&&eo7(i)?eoX(i):i,v=g.frameElement;for(;v&&i&&y!==g;){let b=eac(v),x=v.getBoundingClientRect(),_=getComputedStyle(v);x.x+=(v.clientLeft+parseFloat(_.paddingLeft))*b.x,x.y+=(v.clientTop+parseFloat(_.paddingTop))*b.y,d*=b.x,p*=b.y,h*=b.x,m*=b.y,d+=x.x,p+=x.y,v=eoX(v).frameElement}}return{width:h,height:m,top:p,right:d+h,bottom:p+m,left:d,x:d,y:p}}function eaf(t){return((eae(t)?t.ownerDocument:t.document)||window.document).documentElement}function ead(t){return eo7(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function eap(t){return eal(eaf(t)).left+ead(t).scrollLeft}function eah(t){if("html"===eo5(t))return t;let n=t.assignedSlot||t.parentNode||eat(t)&&t.host||eaf(t);return eat(n)?n.host:n}function eam(t,n){var r;void 0===n&&(n=[]);let i=function t(n){let r=eah(n);return eaa(r)?r.ownerDocument.body:eo8(r)&&ean(r)?r:t(r)}(t),o=i===(null==(r=t.ownerDocument)?void 0:r.body),a=eoX(i);return o?n.concat(a,a.visualViewport||[],ean(i)?i:[]):n.concat(i,eam(i))}function eag(t,n,r){let i;if("viewport"===n)i=function(t,n){let r=eoX(t),i=eaf(t),o=r.visualViewport,a=i.clientWidth,u=i.clientHeight,s=0,c=0;if(o){a=o.width,u=o.height;let l=eao();(!l||l&&"fixed"===n)&&(s=o.offsetLeft,c=o.offsetTop)}return{width:a,height:u,x:s,y:c}}(t,r);else if("document"===n)i=function(t){let n=eaf(t),r=ead(t),i=t.ownerDocument.body,o=eo2(n.scrollWidth,n.clientWidth,i.scrollWidth,i.clientWidth),a=eo2(n.scrollHeight,n.clientHeight,i.scrollHeight,i.clientHeight),u=-r.scrollLeft+eap(t),s=-r.scrollTop;return"rtl"===eo0(i).direction&&(u+=eo2(n.clientWidth,i.clientWidth)-o),{width:o,height:a,x:u,y:s}}(eaf(t));else if(eo7(n))i=function(t,n){let r=eal(t,!0,"fixed"===n),i=r.top+t.clientTop,o=r.left+t.clientLeft,a=eo8(t)?eac(t):{x:1,y:1},u=t.clientWidth*a.x,s=t.clientHeight*a.y,c=o*a.x,l=i*a.y;return{width:u,height:s,x:c,y:l}}(n,r);else{let o={...n};if(eao()){var a,u;let s=eoX(t);o.x-=(null==(a=s.visualViewport)?void 0:a.offsetLeft)||0,o.y-=(null==(u=s.visualViewport)?void 0:u.offsetTop)||0}i=o}return eoB(i)}function eay(t,n){return eo8(t)&&"fixed"!==eo0(t).position?n?n(t):t.offsetParent:null}function eav(t,n){let r=eoX(t),i=eay(t,n);for(;i&&ear(i)&&"static"===eo0(i).position;)i=eay(i,n);return i&&("html"===eo5(i)||"body"===eo5(i)&&"static"===eo0(i).position&&!eai(i))?r:i||function(t){let n=eah(t);for(;eo8(n)&&!eaa(n);){if(eai(n))return n;n=eah(n)}return null}(t)||r}let eab={getClippingRect:function(t){let{element:n,boundary:r,rootBoundary:i,strategy:o}=t,a=[..."clippingAncestors"===r?function(t,n){let r=n.get(t);if(r)return r;let i=eam(t).filter(t=>eo7(t)&&"body"!==eo5(t)),o=null,a="fixed"===eo0(t).position,u=a?eah(t):t;for(;eo7(u)&&!eaa(u);){let s=eo0(u),c=eai(u);"fixed"===s.position?o=null:(a?c||o:!(!c&&"static"===s.position&&o&&["absolute","fixed"].includes(o.position)))?o=s:i=i.filter(t=>t!==u),u=eah(u)}return n.set(t,i),i}(n,this._c):[].concat(r),i],u=a[0],s=a.reduce((t,r)=>{let i=eag(n,r,o);return t.top=eo2(i.top,t.top),t.right=eo1(i.right,t.right),t.bottom=eo1(i.bottom,t.bottom),t.left=eo2(i.left,t.left),t},eag(n,u,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:n,offsetParent:r,strategy:i}=t,o=eo8(r),a=eaf(r);if(r===a)return n;let u={scrollLeft:0,scrollTop:0},s={x:1,y:1},c={x:0,y:0};if((o||!o&&"fixed"!==i)&&(("body"!==eo5(r)||ean(a))&&(u=ead(r)),eo8(r))){let l=eal(r);s=eac(r),c.x=l.x+r.clientLeft,c.y=l.y+r.clientTop}return{width:n.width*s.x,height:n.height*s.y,x:n.x*s.x-u.scrollLeft*s.x+c.x,y:n.y*s.y-u.scrollTop*s.y+c.y}},isElement:eo7,getDimensions:function(t){return eo8(t)?eo4(t):t.getBoundingClientRect()},getOffsetParent:eav,getDocumentElement:eaf,getScale:eac,async getElementRects(t){let{reference:n,floating:r,strategy:i}=t,o=this.getOffsetParent||eav,a=this.getDimensions;return{reference:function(t,n,r){let i=eo8(n),o=eaf(n),a=eal(t,!0,"fixed"===r,n),u={scrollLeft:0,scrollTop:0},s={x:0,y:0};if(i||!i&&"fixed"!==r){if(("body"!==eo5(n)||ean(o))&&(u=ead(n)),eo8(n)){let c=eal(n,!0);s.x=c.x+n.clientLeft,s.y=c.y+n.clientTop}else o&&(s.x=eap(o))}return{x:a.left+u.scrollLeft-s.x,y:a.top+u.scrollTop-s.y,width:a.width,height:a.height}}(n,await o(r),i),floating:{x:0,y:0,...await a(r)}}},getClientRects:t=>Array.from(t.getClientRects()),isRTL:t=>"rtl"===eo0(t).direction};function eax(t,n,r,i){void 0===i&&(i={});let{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:u=!0,animationFrame:s=!1}=i,c=o&&!s,l=c||a?[...eo7(t)?eam(t):t.contextElement?eam(t.contextElement):[],...eam(n)]:[];l.forEach(t=>{c&&t.addEventListener("scroll",r,{passive:!0}),a&&t.addEventListener("resize",r)});let f=null;if(u){let d=!0;f=new ResizeObserver(()=>{d||r(),d=!1}),eo7(t)&&!s&&f.observe(t),eo7(t)||!t.contextElement||s||f.observe(t.contextElement),f.observe(n)}let p,h=s?eal(t):null;return s&&function n(){let i=eal(t);h&&(i.x!==h.x||i.y!==h.y||i.width!==h.width||i.height!==h.height)&&r(),h=i,p=requestAnimationFrame(n)}(),r(),()=>{var t;l.forEach(t=>{c&&t.removeEventListener("scroll",r),a&&t.removeEventListener("resize",r)}),null==(t=f)||t.disconnect(),f=null,s&&cancelAnimationFrame(p)}}let ea_=(t,n,r)=>{let i=new Map,o={platform:eab,...r},a={...o.platform,_c:i};return eoz(t,n,{...o,platform:a})};var eaS="u">typeof document?c.useLayoutEffect:c.useEffect;function eaT(t,n){if(t===n)return!0;if(typeof t!=typeof n)return!1;if("function"==typeof t&&t.toString()===n.toString())return!0;let r,i,o;if(t&&n&&"object"==typeof t){if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(i=r;0!=i--;)if(!eaT(t[i],n[i]))return!1;return!0}if((r=(o=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(i=r;0!=i--;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;0!=i--;){let a=o[i];if(!("_owner"===a&&t.$$typeof)&&!eaT(t[a],n[a]))return!1}return!0}return t!=t&&n!=n}function eaw(t){let n=c.useRef(t);return eaS(()=>{n.current=t}),n}var eaO="u">typeof document?c.useLayoutEffect:c.useEffect;let eak=!1,eaI=0,eaM=()=>"floating-ui-"+eaI++,eaC=(zC||(zC=r.t(c,2)))["useId".toString()],eaR=eaC??function(){let[t,n]=c.useState(()=>eak?eaM():void 0);return eaO(()=>{null==t&&n(eaM())},[]),c.useEffect(()=>{eak||(eak=!0)},[]),t},eaE=c.createContext(null),eaA=c.createContext(null),eaj=()=>{var t,n;return null!=(t=null==(n=c.useContext(eaE))?void 0:n.id)?t:null},eaN=()=>c.useContext(eaA);function eaP(t){var n;return null!=(n=null==t?void 0:t.ownerDocument)?n:document}function eaL(t){var n;return null!=(n=eaP(t).defaultView)?n:window}function eaF(t){return!!t&&t instanceof eaL(t).Element}let eaD=(zC||(zC=r.t(c,2)))["useInsertionEffect".toString()];function eaW(t){let n=c.useRef(()=>{});return eaD?eaD(()=>{n.current=t}):n.current=t,c.useCallback(function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return null==n.current?void 0:n.current(...r)},[])}function eaU(t,n,r){let i=new Map;return{..."floating"===r&&{tabIndex:-1},...t,...n.map(t=>t?t[r]:null).concat(t).reduce((t,n)=>(n&&Object.entries(n).forEach(n=>{let[r,o]=n;if(0===r.indexOf("on")){if(i.has(r)||i.set(r,[]),"function"==typeof o){var a;null==(a=i.get(r))||a.push(o),t[r]=function(){for(var t,n=arguments.length,o=Array(n),a=0;a<n;a++)o[a]=arguments[a];null==(t=i.get(r))||t.forEach(t=>t(...o))}}}else t[r]=o}),t),{})}}function eaz(t,n){var r,i;let o=null!=(r=t.filter(t=>{var r;return t.parentId===n&&(null==(r=t.context)?void 0:r.open)}))?r:[],a=o;for(;a.length;)a=null!=(i=t.filter(t=>{var n;return null==(n=a)?void 0:n.some(n=>{var r;return t.parentId===n.id&&(null==(r=t.context)?void 0:r.open)})}))?i:[],o=o.concat(a);return o}function eaB(t){let n=t.activeElement;for(;(null==(r=n)||null==(i=r.shadowRoot)?void 0:i.activeElement)!=null;){var r,i;n=n.shadowRoot.activeElement}return n}function eaq(t){t.preventDefault(),t.stopPropagation()}function eaV(t){let n=(0,c.useRef)();return eaO(()=>{n.current=t},[t]),n.current}let ea$=function(t,n){let{open:r}=t,{enabled:i=!0,role:o="dialog"}=void 0===n?{}:n,a=eaR(),u=eaR(),s={id:a,role:o};return i?"tooltip"===o?{reference:{"aria-describedby":r?a:void 0},floating:s}:{reference:{"aria-expanded":r?"true":"false","aria-haspopup":"alertdialog"===o?"dialog":o,"aria-controls":r?a:void 0,..."listbox"===o&&{role:"combobox"},..."menu"===o&&{id:u}},floating:{...s,..."menu"===o&&{"aria-labelledby":u}}}:{}};function eaK(t,n){return null!=n&&("composedPath"in t?t.composedPath().includes(n):null!=t.target&&n.contains(t.target))}let eaH=function(t,n){let{open:r,onOpenChange:i,refs:o,events:a,nodeId:u}=t,{enabled:s=!0,escapeKey:l=!0,outsidePointerDown:f=!0,referencePointerDown:d=!1,ancestorScroll:p=!1,bubbles:h=!0}=void 0===n?{}:n,m=eaN(),g=null!=eaj(),y=c.useRef(!1);return c.useEffect(()=>{if(!r||!s)return;function t(t){"Escape"!==t.key||!h&&m&&eaz(m.nodesRef.current,u).length>0||(a.emit("dismiss",{preventScroll:!1}),i(!1))}function n(t){var n,r;let s=y.current;if(y.current=!1,s)return;let c="composedPath"in t?t.composedPath()[0]:t.target;if(eaF(c)&&o.floating.current){let l=null!=(r=o.floating.current.ownerDocument.defaultView)?r:window,f=c.scrollWidth>c.clientWidth,d=c.scrollHeight>c.clientHeight,p=d&&t.offsetX>c.clientWidth;if(d&&"rtl"===l.getComputedStyle(c).direction&&(p=t.offsetX<=c.offsetWidth-c.clientWidth),p||f&&t.offsetY>c.clientHeight)return}let v=m&&eaz(m.nodesRef.current,u).some(n=>{var r;return eaK(t,null==(r=n.context)?void 0:r.refs.floating.current)});eaK(t,o.floating.current)||eaK(t,o.domReference.current)||v||!h&&m&&eaz(m.nodesRef.current,u).length>0||(a.emit("dismiss",!!g&&{preventScroll:!0}),i(!1))}function c(){i(!1)}let d=eaP(o.floating.current);l&&d.addEventListener("keydown",t),f&&d.addEventListener("pointerdown",n);let v=(p?[...eaF(o.reference.current)?eam(o.reference.current):[],...eaF(o.floating.current)?eam(o.floating.current):[]]:[]).filter(t=>{var n;return t!==(null==(n=d.defaultView)?void 0:n.visualViewport)});return v.forEach(t=>t.addEventListener("scroll",c,{passive:!0})),()=>{l&&d.removeEventListener("keydown",t),f&&d.removeEventListener("pointerdown",n),v.forEach(t=>t.removeEventListener("scroll",c))}},[l,f,a,m,u,r,i,p,s,h,o,g]),s?{reference:{onPointerDown(){d&&(a.emit("dismiss"),i(!1))}},floating:{onPointerDownCapture(){y.current=!0}}}:{}},eaZ="ArrowUp",eaG="ArrowDown",eaJ="ArrowLeft",eaY="ArrowRight";function eaQ(t,n,r){return Math.floor(t/n)!==r}function eaX(t,n){return n<0||n>=t.current.length}function ea0(t,n){let{startingIndex:r=-1,decrement:i=!1,disabledIndices:o,amount:a=1}=void 0===n?{}:n,u=t.current,s=r;do{var c,l;s+=i?-a:a}while(s>=0&&s<=u.length-1&&(o?o.includes(s):null==u[s]||null!=(c=u[s])&&c.hasAttribute("disabled")||(null==(l=u[s])?void 0:l.getAttribute("aria-disabled"))==="true"));return s}function ea1(t,n,r){switch(t){case"vertical":return n;case"horizontal":return r;default:return n||r}}function ea2(t,n){return ea1(n,t===eaZ||t===eaG,t===eaJ||t===eaY)}function ea3(t,n,r){return ea1(n,t===eaG,r?t===eaJ:t===eaY)||"Enter"===t||" "==t||""===t}function ea4(t,n){return ea0(t,{disabledIndices:n})}function ea5(t,n){return ea0(t,{decrement:!0,startingIndex:t.current.length,disabledIndices:n})}let ea6=function(t,n){let{open:r,onOpenChange:i,refs:o}=t,{listRef:a,activeIndex:u,onNavigate:s=()=>{},enabled:l=!0,selectedIndex:f=null,allowEscape:d=!1,loop:p=!1,nested:h=!1,rtl:m=!1,virtual:g=!1,focusItemOnOpen:y="auto",focusItemOnHover:v=!0,openOnArrowKeyDown:b=!0,disabledIndices:x,orientation:_="vertical",cols:S=1}=void 0===n?{listRef:{current:[]},activeIndex:null,onNavigate(){}}:n,T=eaj(),w=eaN(),O=eaV(r),k=eaW(s),I=eaW(eaV(s)),M=c.useRef(y),C=c.useRef(f??-1),R=c.useRef(null),E=function(t){let n=(0,c.useRef)(t);return eaO(()=>{n.current=t}),n}(x),A=c.useRef(!1),j=c.useRef(-1),[N,P]=c.useState(),L=c.useCallback((t,n)=>{j.current=requestAnimationFrame(()=>{var r,i;g?P(null==(r=t.current[n.current])?void 0:r.id):null==(i=t.current[n.current])||i.focus({preventScroll:!0})})},[g]);function F(t){var n,u,s,c;if(A.current=!0,h&&(n=t.key,ea1(_,m?n===eaY:n===eaJ,n===eaZ))){eaq(t),i(!1),(c=o.domReference.current)&&c instanceof eaL(c).HTMLElement&&o.domReference.current.focus();return}let l=C.current,f=ea4(a,x),y=ea5(a,x);if("Home"===t.key&&(C.current=f,k(C.current)),"End"===t.key&&(C.current=y,k(C.current)),S>1){let v=C.current;if(t.key===eaZ){if(eaq(t),-1===v)C.current=y;else if(C.current=ea0(a,{startingIndex:v,amount:S,decrement:!0,disabledIndices:x}),p&&(v-S<f||C.current<0)){let b=v%S,T=y%S,w=y-(T-b);T===b?C.current=y:C.current=T>b?w:w-S}eaX(a,C.current)&&(C.current=v),k(C.current)}if(t.key===eaG&&(eaq(t),-1===v?C.current=f:(C.current=ea0(a,{startingIndex:v,amount:S,disabledIndices:x}),p&&v+S>y&&(C.current=ea0(a,{startingIndex:v%S-S,amount:S,disabledIndices:x}))),eaX(a,C.current)&&(C.current=v),k(C.current)),"both"===_){let O=Math.floor(v/S);t.key===eaY&&(eaq(t),v%S!=S-1?(C.current=ea0(a,{startingIndex:v,disabledIndices:x}),p&&eaQ(C.current,S,O)&&(C.current=ea0(a,{startingIndex:v-v%S-1,disabledIndices:x}))):p&&(C.current=ea0(a,{startingIndex:v-v%S-1,disabledIndices:x})),eaQ(C.current,S,O)&&(C.current=v)),t.key===eaJ&&(eaq(t),v%S!=0?(C.current=ea0(a,{startingIndex:v,disabledIndices:x,decrement:!0}),p&&eaQ(C.current,S,O)&&(C.current=ea0(a,{startingIndex:v+(S-v%S),decrement:!0,disabledIndices:x}))):p&&(C.current=ea0(a,{startingIndex:v+(S-v%S),decrement:!0,disabledIndices:x})),eaQ(C.current,S,O)&&(C.current=v)),eaX(a,C.current)&&(p&&Math.floor(y/S)===O?C.current=t.key===eaJ?y:ea0(a,{startingIndex:v-v%S-1,disabledIndices:x}):C.current=v),k(C.current);return}}if(ea2(t.key,_)){if(eaq(t),r&&!g&&eaB(t.currentTarget.ownerDocument)===t.currentTarget){C.current=ea3(t.key,_,m)?f:y,k(C.current);return}ea3(t.key,_,m)?p?C.current=l>=y?d&&l!==a.current.length?-1:f:ea0(a,{startingIndex:l,disabledIndices:x}):C.current=Math.min(y,ea0(a,{startingIndex:l,disabledIndices:x})):p?C.current=l<=f?d&&-1!==l?a.current.length:y:ea0(a,{startingIndex:l,decrement:!0,disabledIndices:x}):C.current=Math.max(f,ea0(a,{startingIndex:l,decrement:!0,disabledIndices:x})),eaX(a,C.current)?k(null):k(C.current)}}return eaO(()=>{l&&(!O&&r&&M.current&&null!=f&&k(f),O&&!r&&(cancelAnimationFrame(j.current),C.current=-1,I(null)))},[r,O,f,a,L,l,k,I]),eaO(()=>{l&&r&&(null==u?null==f&&(O&&(C.current=-1,L(a,C)),!O&&M.current&&(null!=R.current||!0===M.current&&null==R.current)&&(C.current=null==R.current||ea3(R.current,_,m)||h?ea4(a,E.current):ea5(a,E.current),k(C.current),L(a,C))):eaX(a,u)||(C.current=u,L(a,C)))},[r,O,u,f,h,a,k,L,l,d,_,m,g,E]),eaO(()=>{if(l&&!r&&O){var t,n;let i=null==w||null==(t=w.nodesRef.current.find(t=>t.id===T))||null==(n=t.context)?void 0:n.refs.floating.current;i&&!i.contains(eaB(eaP(i)))&&i.focus({preventScroll:!0})}},[l,r,O,w,T]),eaO(()=>{R.current=null}),l?{reference:{...g&&r&&null!=u&&{"aria-activedescendant":N},onKeyDown(t){if(A.current=!0,g&&r)return F(t);if((0===t.key.indexOf("Arrow")||"Enter"===t.key||" "===t.key||""===t.key)&&(R.current=t.key),h){var n,o,u;n=t.key,ea1(_,m?n===eaJ:n===eaY,n===eaG)&&(eaq(t),r?(C.current=ea4(a,x),k(C.current)):i(!0));return}ea2(t.key,_)&&(null!=f&&(C.current=f),eaq(t),!r&&b?i(!0):F(t),r&&k(C.current))}},floating:{"aria-orientation":"both"===_?void 0:_,...g&&null!=u&&{"aria-activedescendant":N},onKeyDown:F,onPointerMove(){A.current=!1}},item:{onFocus(t){let{currentTarget:n}=t,r=a.current.indexOf(n);-1!==r&&k(r)},onClick(t){let{currentTarget:n}=t;return n.focus({preventScroll:!0})},...v&&{onMouseMove(t){let{currentTarget:n}=t;if(n){let r=a.current.indexOf(n);-1!==r&&k(r)}},onPointerLeave(){if(!A.current&&(C.current=-1,L(a,C),k(null),!g)){var t;null==(t=o.floating.current)||t.focus({preventScroll:!0})}}}}}:{}},ea9=new YE("suggestion");function ea8(t){var n,r,i="";if("string"==typeof t||"number"==typeof t)i+=t;else if("object"==typeof t){if(Array.isArray(t))for(n=0;n<t.length;n++)t[n]&&(r=ea8(t[n]))&&(i&&(i+=" "),i+=r);else for(n in t)t[n]&&(i&&(i+=" "),i+=n)}return i}function ea7(){for(var t,n,r=0,i="";r<arguments.length;)(t=arguments[r++])&&(n=ea8(t))&&(i&&(i+=" "),i+=n);return i}let eue=enE.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:t}){return["p",eeq(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),eut={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"},eun=()=>(++eun.i).toString();eun.i=0;let eur=t=>{let n=eua(t),r=[];for(let i=0;i<n.length;i++)r.push(euu(n[i]));return{key:eun(),children:r}},eui=(t,n=[])=>({key:eun(),type:t.type,text:"text"in t?t.text:void 0,node:t,children:n}),euo=t=>eui({type:eut.span,text:t,spans:[]}),eua=t=>{let n=t.slice(0);for(let r=0;r<n.length;r++){let i=n[r];if(i.type===eut.listItem||i.type===eut.oListItem){let o=[i];for(;n[r+1]&&n[r+1].type===i.type;)o.push(n[r+1]),n.splice(r,1);i.type===eut.listItem?n[r]={type:eut.list,items:o}:n[r]={type:eut.oList,items:o}}}return n},euu=t=>{if("text"in t)return eui(t,eus(t.spans,t));if("items"in t){let n=[];for(let r=0;r<t.items.length;r++)n.push(euu(t.items[r]));return eui(t,n)}return eui(t)},eus=(t,n,r)=>{if(!t.length)return[euo(n.text)];let i=t.slice(0);i.sort((t,n)=>t.start-n.start||n.end-t.end);let o=[];for(let a=0;a<i.length;a++){let u=i[a],s=r&&r.start||0,c=u.start-s,l=u.end-s,f=n.text.slice(c,l),d=[];for(let p=a;p<i.length;p++){let h=i[p];h!==u&&h.start>=u.start&&h.end<=u.end&&(d.push(h),i.splice(p,1),p--)}0===a&&c>0&&o.push(euo(n.text.slice(0,c)));let m={...u,text:f};o.push(eui(m,eus(d,{...n,text:f},u))),l<n.text.length&&o.push(euo(n.text.slice(l,i[a+1]?i[a+1].start-s:void 0)))}return o},euc=(t,n)=>eul(eur(t).children,n),eul=(t,n)=>{let r=[];for(let i=0;i<t.length;i++){let o=t[i],a=n(o.type,o.node,o.text,eul(o.children,n),o.key);null!=a&&r.push(a)}return r};eut.listItem,eut.oListItem,eut.list,eut.oList;let euf=enE.create({name:"text",group:"inline"}),eud={groupBy:(t,n)=>t.reduce((t,r)=>{let i=n(r),o=(t.get(i)||[]).concat(r);return t.set(i,o)},new Map),sort:t=>[...t].sort((t,n)=>t.start-n.start),mergeOverlap(t){let n=this.groupBy(t,t=>t.type),r=Array.from(n.entries()).map(([t,n])=>(this.sort(n).reduce((t,n)=>{if(!t.length)return[n];let r=t.length-1,i=t[r];return i.end>=n.start?[...t.slice(0,r),{...i,end:n.end}]:[...t,n]},[]),n)).reduce((t,n)=>[...t,...n],[]);return this.sort(r)}},eup={fromPrismic:t=>n=>{var r;return null==(r=ecS.find(t=>t.richTextNodeTypes[0]===n.type))?void 0:r.converter.fromPrismic(t)(n)},toPrismic(t,n,r){let[i,o]=(()=>{let n=ecS.find(n=>t.type.name===n.name);if(!n)throw Error(`Invalid mark extension '${t.type.name}'.`);return[n.richTextNodeTypes[0],n.converter.toPrismic(t)]})();return{type:i,start:n,end:r,...o?{data:o}:{}}}},euh=euf.extend({name:"text"}),eum={name:euh.name,component:euh,converter:{fromPrismic:t=>function(n,r,i=!1){let o={type:n,text:r.content.text,spans:r.content.spans||[]};return euc([o],function(t,n=!1){return(r,i,o,a)=>{if("span"===r&&o&&o.length)return n?[t.text(o)]:eoj.splitTextToNodes(t,o)(n=>t.text(n));{let u=eup.fromPrismic(t)(i);return u?a.flat().map(t=>t.mark([...t.marks,u].sort((t,n)=>t.type.name.localeCompare(n.type.name)))):a.flat()}}}(t,i))[0]},toPrismic(t,n,r){let i=eob.children.reduce(t,(t,n)=>{let r=n.type.name===eoj.name?eoj.converter.toPrismic(n):n.textContent,i=r?t.text+r:t.text,o=t.text.length,a=i.length,u=n.marks.length?eob.marks.map(n,t=>eup.toPrismic(t,o,a)):void 0;return{...t,text:i,spans:u?[...t.spans,...u]:t.spans}},{text:"",spans:[]});return{type:n,content:{text:i.text,spans:[...eud.mergeOverlap(i.spans)].sort((t,n)=>t.type.localeCompare(n.type))},...r}}}};var eug,euy=((eug=euy||{}).LeftToRight="ltr",eug.RightToLeft="rtl",eug);let euv=ei$.RichTextNodeType.rtl,eub=ee8.create({name:"textDirection",addOptions:()=>({supportedExtensionNames:[]}),addGlobalAttributes(){return[{types:this.options.supportedExtensionNames,attributes:{dir:{default:"ltr",parseHTML:t=>t.getAttribute("dir"),renderHTML:t=>({dir:"ltr"===t.dir?"ltr":"rtl"})}}}]},addCommands(){return{setDirection:t=>({commands:n})=>"rtl"===t?n.setRightToLeft():n.setLeftToRight(),toggleDirection:t=>({commands:n})=>n.setDirection("rtl"===t?"ltr":"rtl"),setRightToLeft:()=>({commands:t})=>this.options.supportedExtensionNames.every(n=>t.updateAttributes(n,{dir:"rtl"})),setLeftToRight:()=>({commands:t})=>this.options.supportedExtensionNames.every(n=>t.resetAttributes(n,"dir"))}},addKeyboardShortcuts(){return{"Mod-Shift-r":()=>this.editor.commands.setRightToLeft(),"Mod-Shift-l":()=>this.editor.commands.setLeftToRight()}}}),eux={parseNodeAttrsDirection:t=>"rtl"===t.dir?"rtl":"ltr",fromPrismic(t){let n="rtl"===t.direction?"rtl":"ltr";return{dir:n}},toPrismic(t){return{direction:this.parseNodeAttrsDirection(t.attrs)}}},eu_=eue.extend({name:"paragraph",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:t}){return["p",eeq(this.options.HTMLAttributes,t),0]}}),euS=new eou([ei$.RichTextNodeType.paragraph],eu_.name,eu_,{fromPrismic:t=>function(n){var r;let i=eum.converter.fromPrismic(t)(eu_.name,n);return null==(r=t.nodes[eu_.name])?void 0:r.create(eux.fromPrismic(n),i)},toPrismic:t=>eum.converter.toPrismic(t,ei$.RichTextNodeType.paragraph,eux.toPrismic(t))},"Type '/' for commands"),euT=euS,euw=["ArrowDown","ArrowUp","End","Home"],euO=["Enter"],euk=["Escape",...euw,...euO],euI=ee8.create({name:"slash-commands",addOptions:()=>({nodeTypes:[]}),addProseMirrorPlugins(){let t=ecC(ecw,this.options.nodeTypes);return t.length>1?[function({pluginKey:t=ea9,editor:n,char:r="@",allowSpaces:i=!1,allowedPrefixes:o=[" "],startOfLine:a=!1,decorationTag:u="span",decorationClass:s="suggestion",command:c=()=>null,items:l=()=>[],render:f=()=>({}),allow:d=()=>!0}){let p,h=null==f?void 0:f(),m=new YM({key:t,view(){return{update:async(t,r)=>{var i,o,a,u,s,f,d;let m=null===(i=this.key)||void 0===i?void 0:i.getState(r),g=null===(o=this.key)||void 0===o?void 0:o.getState(t.state),y=m.active&&g.active&&m.range.from!==g.range.from,v=!m.active&&g.active,b=m.active&&!g.active,x=!v&&!b&&m.query!==g.query,_=v||y,S=x&&!y,T=b||y;if(!_&&!S&&!T)return;let w=T&&!_?m:g,O=t.dom.querySelector(`[data-decoration-id="${w.decorationId}"]`);p={editor:n,range:w.range,query:w.query,text:w.text,items:[],command(t){c({editor:n,range:w.range,props:t})},decorationNode:O,clientRect:O?()=>{var r;let{decorationId:i}=null===(r=this.key)||void 0===r?void 0:r.getState(n.state),o=t.dom.querySelector(`[data-decoration-id="${i}"]`);return(null==o?void 0:o.getBoundingClientRect())||null}:null},_&&(null===(a=null==h?void 0:h.onBeforeStart)||void 0===a||a.call(h,p)),S&&(null===(u=null==h?void 0:h.onBeforeUpdate)||void 0===u||u.call(h,p)),(S||_)&&(p.items=await l({editor:n,query:w.query})),T&&(null===(s=null==h?void 0:h.onExit)||void 0===s||s.call(h,p)),S&&(null===(f=null==h?void 0:h.onUpdate)||void 0===f||f.call(h,p)),_&&(null===(d=null==h?void 0:h.onStart)||void 0===d||d.call(h,p))},destroy(){var t;p&&(null===(t=null==h?void 0:h.onExit)||void 0===t||t.call(h,p))}}},state:{init:()=>({active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}),apply(t,u,s,c){let{isEditable:l}=n,{composing:f}=n.view,{selection:p}=t,{empty:h,from:m}=p,g={...u};if(g.composing=f,l&&(h||n.view.composing)){(m<u.range.from||m>u.range.to)&&!f&&!u.composing&&(g.active=!1);let y=function(t){var n,r;let{char:i,allowSpaces:o,allowedPrefixes:a,startOfLine:u,$position:s}=t,c=i.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),l=RegExp(`\\s${c}$`),f=u?"^":"",d=o?RegExp(`${f}${c}.*?(?=\\s${c}|$)`,"gm"):RegExp(`${f}(?:^)?${c}[^\\s${c}]*`,"gm"),p=(null===(n=s.nodeBefore)||void 0===n?void 0:n.isText)&&s.nodeBefore.text;if(!p)return null;let h=s.pos-p.length,m=Array.from(p.matchAll(d)).pop();if(!m||void 0===m.input||void 0===m.index)return null;let g=m.input.slice(Math.max(0,m.index-1),m.index),y=RegExp(`^[${null==a?void 0:a.join("")}\0]?$`).test(g);if(null!==a&&!y)return null;let v=h+m.index,b=v+m[0].length;return o&&l.test(p.slice(b-1,b+1))&&(m[0]+=" ",b+=1),v<s.pos&&b>=s.pos?{range:{from:v,to:b},query:m[0].slice(i.length),text:m[0]}:null}({char:r,allowSpaces:i,allowedPrefixes:o,startOfLine:a,$position:p.$from}),v=`id_${Math.floor(4294967295*Math.random())}`;y&&d({editor:n,state:c,range:y.range})?(g.active=!0,g.decorationId=u.decorationId?u.decorationId:v,g.range=y.range,g.query=y.query,g.text=y.text):g.active=!1}else g.active=!1;return g.active||(g.decorationId=null,g.range={from:0,to:0},g.query=null,g.text=null),g}},props:{handleKeyDown(t,n){var r;let{active:i,range:o}=m.getState(t.state);return i&&(null===(r=null==h?void 0:h.onKeyDown)||void 0===r?void 0:r.call(h,{view:t,event:n,range:o}))||!1},decorations(t){let{active:n,range:r,decorationId:i}=m.getState(t);return n?XB.create(t.doc,[XW.inline(r.from,r.to,{nodeName:u,class:s,"data-decoration-id":i})]):null}}});return m}({allowSpaces:!0,char:"/",editor:this.editor,startOfLine:!0,allow({state:t}){let n=t.selection.$from;return n.parent.type.name===euT.name&&1===n.depth},command({editor:t,props:n,range:r}){n.runCommands(t,{deleteRange:r})},items({query:n}){let r=n.toLocaleLowerCase().trim();return t.filter(t=>{var n,i;return(null==(n=t.shortText)?void 0:n.toLocaleLowerCase().includes(r))||(null==(i=t.text)?void 0:i.toLocaleLowerCase().includes(r))})},render(){let t;return{onStart(n){t=new eiB(euM,{editor:n.editor,props:n}),document.body.appendChild(t.element)},onUpdate(n){null==t||t.updateProps(n)},onKeyDown({event:n}){var r;return euk.includes(n.key)&&(null==(r=null==t?void 0:t.ref)?void 0:r.handleKeyDown(n))},onExit(){null==t||t.destroy(),null==t||t.element.remove()}}}})]:[]}}),euM=(0,c.forwardRef)(function({command:t,decorationNode:n,editor:r,items:i},o){var a,u,s,d,p;let[h,m]=(0,c.useState)(!0),g=parseFloat(l.TV.space[0]),{context:y,floating:v,reference:x,strategy:_,x:S,y:T}=function(t){let{open:n=!1,onOpenChange:r,whileElementsMounted:i,placement:o,middleware:a,strategy:u,nodeId:s}=void 0===t?{}:t,[l,f]=c.useState(null),d=eaN(),p=c.useRef(null),h=c.useRef({}),m=c.useState(()=>(function(){let t=new Map;return{emit(n,r){var i;null==(i=t.get(n))||i.forEach(t=>t(r))},on(n,r){t.set(n,[...t.get(n)||[],r])},off(n,r){t.set(n,(t.get(n)||[]).filter(t=>t!==r))}}})())[0],g=function(t){void 0===t&&(t={});let{placement:n="bottom",strategy:r="absolute",middleware:i=[],platform:o,whileElementsMounted:a,open:u}=t,[s,l]=c.useState({x:null,y:null,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[f,d]=c.useState(i);eaT(f,i)||d(i);let p=c.useRef(null),h=c.useRef(null),m=c.useRef(s),g=eaw(a),y=eaw(o),[v,x]=c.useState(null),[_,S]=c.useState(null),T=c.useCallback(t=>{p.current!==t&&(p.current=t,x(t))},[]),w=c.useCallback(t=>{h.current!==t&&(h.current=t,S(t))},[]),O=c.useCallback(()=>{if(!p.current||!h.current)return;let t={placement:n,strategy:r,middleware:f};y.current&&(t.platform=y.current),ea_(p.current,h.current,t).then(t=>{let n={...t,isPositioned:!0};k.current&&!eaT(m.current,n)&&(m.current=n,b.flushSync(()=>{l(n)}))})},[f,n,r,y]);eaS(()=>{!1===u&&m.current.isPositioned&&(m.current.isPositioned=!1,l(t=>({...t,isPositioned:!1})))},[u]);let k=c.useRef(!1);eaS(()=>(k.current=!0,()=>{k.current=!1}),[]),eaS(()=>{if(v&&_){if(g.current)return g.current(v,_,O);O()}},[v,_,O,g]);let I=c.useMemo(()=>({reference:p,floating:h,setReference:T,setFloating:w}),[T,w]),M=c.useMemo(()=>({reference:v,floating:_}),[v,_]);return c.useMemo(()=>({...s,update:O,refs:I,elements:M,reference:T,floating:w}),[s,O,I,M,T,w])}({placement:o,middleware:a,strategy:u,whileElementsMounted:i}),y=eaW(r),v=c.useMemo(()=>({...g.refs,domReference:p}),[g.refs]),x=c.useMemo(()=>({...g,refs:v,dataRef:h,nodeId:s,events:m,open:n,onOpenChange:y,_:{domReference:l}}),[g,s,m,n,y,v,l]);eaO(()=>{let t=null==d?void 0:d.nodesRef.current.find(t=>t.id===s);t&&(t.context=x)});let{reference:_}=g,S=c.useCallback(t=>{(eaF(t)||null===t)&&(x.refs.domReference.current=t,f(t)),_(t)},[_,x.refs]);return c.useMemo(()=>({...g,context:x,refs:v,reference:S}),[g,v,x,S])}({middleware:[(void 0===(a=g)&&(a=0),{name:"offset",options:a,async fn(t){let{x:n,y:r}=t,i=await eoY(t,a);return{x:n+i.x,y:r+i.y,data:i}}}),(void 0===u&&(u={}),{name:"flip",options:u,async fn(t){var n,r,i,o;let{placement:a,middlewareData:s,rects:c,initialPlacement:l,platform:f,elements:d}=t,{mainAxis:p=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:v=!0,...b}=u,x=eoD(a),_=eoD(l)===l,S=await (null==f.isRTL?void 0:f.isRTL(d.floating)),T=m||(_||!v?[eoZ(l)]:function(t){let n=eoZ(t);return[eoJ(t),n,eoJ(n)]}(l));m||"none"===y||T.push(...function(t,n,r,i){let o=eoL(t),a=function(t,n,r){let i=["left","right"],o=["right","left"];switch(t){case"top":case"bottom":return r?n?o:i:n?i:o;case"left":case"right":return n?["top","bottom"]:["bottom","top"];default:return[]}}(eoD(t),"start"===r,i);return o&&(a=a.map(t=>t+"-"+o),n&&(a=a.concat(a.map(eoJ)))),a}(l,v,y,S));let w=await eoq(t,b),O=[],k=(null==(n=s.flip)?void 0:n.overflows)||[];if(p&&O.push(w[x]),h){let{main:I,cross:M}=function(t,n,r){void 0===r&&(r=!1);let i=eoL(t),o=eoW(t),a=eoF(o),u="x"===o?i===(r?"end":"start")?"right":"left":"start"===i?"bottom":"top";return n.reference[a]>n.floating[a]&&(u=eoZ(u)),{main:u,cross:eoZ(u)}}(a,c,S);O.push(w[I],w[M])}if(k=[...k,{placement:a,overflows:O}],!O.every(t=>t<=0)){let C=((null==(r=s.flip)?void 0:r.index)||0)+1,R=[l,...T][C];if(R)return{data:{index:C,overflows:k},reset:{placement:R}};let E=null==(i=k.filter(t=>t.overflows[0]<=0).sort((t,n)=>t.overflows[1]-n.overflows[1])[0])?void 0:i.placement;if(!E)switch(g){case"bestFit":{let A=null==(o=k.map(t=>[t.placement,t.overflows.filter(t=>t>0).reduce((t,n)=>t+n,0)]).sort((t,n)=>t[1]-n[1])[0])?void 0:o[0];A&&(E=A);break}case"initialPlacement":E=l}if(a!==E)return{reset:{placement:E}}}return{}}}),(d={limiter:(void 0===s&&(s={}),{options:s,fn(t){let{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:u=0,mainAxis:c=!0,crossAxis:l=!0}=s,f={x:n,y:r},d=eoW(i),p=eoQ(d),h=f[d],m=f[p],g="function"==typeof u?u(t):u,y="number"==typeof g?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){let v="y"===d?"height":"width",b=o.reference[d]-o.floating[v]+y.mainAxis,x=o.reference[d]+o.reference[v]-y.mainAxis;h<b?h=b:h>x&&(h=x)}if(l){var _,S;let T="y"===d?"width":"height",w=["top","left"].includes(eoD(i)),O=o.reference[p]-o.floating[T]+(w&&(null==(_=a.offset)?void 0:_[p])||0)+(w?0:y.crossAxis),k=o.reference[p]+o.reference[T]+(w?0:(null==(S=a.offset)?void 0:S[p])||0)-(w?y.crossAxis:0);m<O?m=O:m>k&&(m=k)}return{[d]:h,[p]:m}}})},{name:"shift",options:d,async fn(t){let{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:u={fn(t){let{x:n,y:r}=t;return{x:n,y:r}}},...s}=d,c={x:n,y:r},l=await eoq(t,s),f=eoW(eoD(i)),p=eoQ(f),h=c[f],m=c[p];if(o){let g=h+l["y"===f?"top":"left"],y=h-l["y"===f?"bottom":"right"];h=eoK(g,h,y)}if(a){let v=m+l["y"===p?"top":"left"],b=m-l["y"===p?"bottom":"right"];m=eoK(v,m,b)}let x=u.fn({...t,[f]:h,[p]:m});return{...x,data:{x:x.x-n,y:x.y-r}}}})],onOpenChange:m,open:h,placement:"top-start",strategy:"fixed",whileElementsMounted:eax});(0,c.useLayoutEffect)(()=>{x(n)},[x,n]),(0,c.useEffect)(()=>{let t,n=()=>{t=window.setTimeout(()=>{m(!0)})},i=()=>{m(!1)};return r.on("focus",n).on("blur",i),()=>{r.off("focus",n).off("blur",i),clearTimeout(t)}},[r]);let[w,O]=(0,c.useState)(0),k=(0,c.useRef)([]);(0,f.pQ)(i,()=>{O(0),k.current=[]});let{getFloatingProps:I,getItemProps:C,getReferenceProps:R}=(p=[eaH(y,{outsidePointerDown:!1}),ea6(y,{activeIndex:w,listRef:k,onNavigate(t){O(n=>t??n)},openOnArrowKeyDown:!1,virtual:!0}),ea$(y,{role:"menu"})],{getReferenceProps:t=>eaU(t,p,"reference"),getFloatingProps:t=>eaU(t,p,"floating"),getItemProps:t=>eaU(t,p,"item")}),E=R().onKeyDown;(0,c.useImperativeHandle)(o,()=>({handleKeyDown(n){if(!h)return!1;if(euw.includes(n.key)&&E(n),euO.includes(n.key)){let r=i[w];void 0!==r&&t(r)}return!0}}),[w,t,i,E,h]);let A=(0,c.useId)();return h?M.jsxs("div",{...I(),className:l._s.content,ref:v,style:{top:parseFloat(l.TV.space[0]),left:parseFloat(l.TV.space[0]),minWidth:256,position:_,transform:null!==S&&null!==T?`translate3d(${Math.round(S)}px, ${Math.round(T)}px, 0)`:"translate3d(0, -200%, 0)"},children:[i.map((n,r)=>(0,c.createElement)(euC,{...C({onClick(){t(n)},onPointerDown(t){t.preventDefault()}}),"data-highlighted":r===w?"":void 0,id:`${A}[${r}]`,key:n.nodeType,ref(t){k.current[r]=t},shortcut:`/${n.shortText??""}`,startIcon:n.icon},n.text)),0===i.length?M.jsx(euC,{...C({onPointerDown(t){t.preventDefault()}}),disabled:!0,id:`${A}[0]`,ref(t){k.current[0]=t},children:"No results"}):null]}):null}),euC=(0,c.forwardRef)(function({children:t,disabled:n,shortcut:r,startIcon:i,...o},a){return M.jsxs("div",{...o,...n?{"aria-disabled":!0,"data-disabled":!0}:{},className:l._s.item,ref:a,role:"menuitem",children:[(0,c.isValidElement)(i)?(0,c.cloneElement)(i,{className:ea7(i.props.className,l._s.itemStartIcon)}):null,M.jsx(l.xv,{className:ea7(l._s.itemText,l._s.itemTextColor.grey),component:"span",children:t}),r?M.jsx(l.xv,{className:l._s.itemShortcut,color:"inherit",component:"span",variant:"inherit",children:r}):null]})}),euR=eoy.extend({name:"bulletList",parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:t}){return["ul",eeq(this.options.HTMLAttributes,t),0]}}).configure({itemTypeName:"listItem"}),euE=new eol([ei$.RichTextNodeType.list],euR.name,euR,{fromPrismic:t=>function(n){var r;let i=eow.converter.fromPrismic(t)(n);if(i)return null==(r=t.nodes[euR.name])?void 0:r.create(eux.fromPrismic(n),i)},toPrismic:t=>eob.children.map(t,t=>eow.converter.toPrismic(t,ei$.RichTextNodeType.list).filter(d.$)).flat()}),euA=euE,euj=/^```([a-z]+)?[\s\n]$/,euN=/^~~~([a-z]+)?[\s\n]$/,euP=enE.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:t=>{var n;let{languageClassPrefix:r}=this.options,i=[...(null===(n=t.firstElementChild)||void 0===n?void 0:n.classList)||[]].filter(t=>t.startsWith(r)).map(t=>t.replace(r,""))[0];return i||null},rendered:!1}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({node:t,HTMLAttributes:n}){return["pre",eeq(this.options.HTMLAttributes,n),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:n})=>n.setNode(this.name,t),toggleCodeBlock:t=>({commands:n})=>n.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:t,$anchor:n}=this.editor.state.selection,r=1===n.pos;return!!t&&n.parent.type.name===this.name&&(!!r||!n.parent.textContent.length)&&this.editor.commands.clearNodes()},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:n}=t,{selection:r}=n,{$from:i,empty:o}=r;if(!o||i.parent.type!==this.type)return!1;let a=i.parentOffset===i.parent.nodeSize-2,u=i.parent.textContent.endsWith(`
95
95
 
96
- `);return!!a&&!!u&&t.chain().command(({tr:t})=>(t.delete(i.pos-2,i.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;let{state:n}=t,{selection:r,doc:i}=n,{$from:o,empty:a}=r;if(!a||o.parent.type!==this.type||o.parentOffset!==o.parent.nodeSize-2)return!1;let u=o.after();return!(void 0===u||i.nodeAt(u))&&t.commands.exitCode()}}},addInputRules(){return[enT({find:euM,type:this.type,getAttributes:t=>({language:t[1]})}),enT({find:euC,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new YT({key:new Yk("codeBlockVSCodeHandler"),props:{handlePaste:(t,n)=>{if(!n.clipboardData||this.editor.isActive(this.type.name))return!1;let r=n.clipboardData.getData("text/plain"),i=n.clipboardData.getData("vscode-editor-data"),o=i?JSON.parse(i):void 0,a=null==o?void 0:o.mode;if(!r||!a)return!1;let{tr:u}=t.state;return u.replaceSelectionWith(this.type.create({language:a})),u.setSelection(Yc.near(u.doc.resolve(Math.max(0,u.selection.from-2)))),u.insertText(r.replace(/\r\n?/g,`
97
- `)),u.setMeta("paste",!0),t.dispatch(u),!0}}})]}}),euE=euR.extend({name:"preformatted",addAttributes(){return{language:{default:null,parseHTML:t=>{var n;let{languageClassPrefix:r}=this.options,i=[...(null==(n=t.firstElementChild)?void 0:n.classList)||[]].filter(t=>t.startsWith(r)).map(t=>t.replace(r,""))[0];return i||null},renderHTML:t=>t.language?{class:this.options.languageClassPrefix+t.language}:null}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({HTMLAttributes:t}){return["pre",eeD(this.options.HTMLAttributes),["code",t,0]]}}).configure({exitOnTripleEnter:!1}),euA=new eon([eiU.RichTextNodeType.preformatted],euE.name,euE,{fromPrismic:t=>function(n){var r;let i=eul.converter.fromPrismic(t)(euE.name,n,!0);return null==(r=t.nodes[euE.name])?void 0:r.create(eum.fromPrismic(n),i)},toPrismic:t=>eul.converter.toPrismic(t,eiU.RichTextNodeType.preformatted,eum.toPrismic(t))},"",!0);function euj(t){let{editor:n,getPos:r,node:i}=t,[o,a]=(0,c.useState)(!1);return(0,c.useEffect)(()=>{function t(){let{from:t,to:o}=n.state.selection,u=r(),s=r()+i.nodeSize;a(t<=u&&o>=s)}function o(){a(!1)}return n.on("blur",o),n.on("selectionUpdate",t),()=>{n.off("blur",o),n.off("selectionUpdate",t)}},[n,r,i.nodeSize]),{selected:o}}function euN(t){let n=(0,c.useRef)(null),r=(0,c.useRef)(null),{onKeyDown:i,url:o,urlChanged:a,onContentChange:u,debouncedUrl:s}=function(t,n,r){let{node:i}=t,o=i.attrs.content,[a,u]=(0,c.useState)((null==o?void 0:o.embed_url)??""),s=(0,f.R9)(t.updateAttributes);function l(t){s({content:t})}let[d,p]=(0,c.useState)(a),h=(0,c.useCallback)(t=>(0,c.startTransition)(()=>p(t)),[]);(0,f.Nr)(a,300,h);let{onKeyDown:m}=function(t,n,r,i){let{editor:o,getPos:a,node:u}=t,[s,l]=(0,c.useState)(!0);return(0,c.useEffect)(()=>{s&&t.editor.isFocused&&setTimeout(()=>{var t;return null==(t=r.current)?void 0:t.focus()})},[r,s,t.editor.isFocused]),{containerRef:i,inputRef:r,onKeyDown:function(t){let r=a(),i=a()+u.nodeSize;"Enter"===t.code&&(l(!1),o.chain().insertContentAt(i,{type:"paragraph"}).focus(i+1).run()),"Backspace"===t.code&&""===n&&o.chain().deleteRange({from:r,to:i}).focus(i+1).run(),"ArrowUp"===t.code&&(l(!1),o.chain().focus(r-1).run()),"ArrowDown"===t.code&&(l(!1),o.chain().focus(i+1).run())}}}(t,a,n,r);return{inputRef:n,containerRef:r,onKeyDown:m,url:a,urlChanged:function(t){u(t),(0,g.j)(t)||l(void 0)},onContentChange:l,debouncedUrl:d}}(t,n,r),{selected:d}=euj(t);return M.jsx(eiL,{className:"custom-embed",children:M.jsx("div",{contentEditable:"false",suppressContentEditableWarning:!0,children:M.jsxs(l.xu,{flexDirection:"column",children:[M.jsxs(l.xu,{flexGrow:1,alignItems:"center",children:[M.jsx(l.I5,{size:"small",name:"cloud",color:"grey11"}),M.jsx(l.xu,{flexGrow:1,flexDirection:"column",ref:r,children:M.jsx(l.oi,{id:"id",ref:n,value:o,variant:(0,g.j)(o)?"link":"normal",placeholder:"Paste your link here",onValueChange:a,onKeyDown:i})})]}),(0,g.j)(o)&&M.jsx(Zx,{selected:d,debouncedUrl:s,onContentChange:u})]})})})}let euP=enk.create({name:"embed",group:"block",content:"block*",atom:!0,marks:"",addAttributes:()=>({content:{default:void 0}}),addCommands(){return{setEmbed:()=>({tr:t,dispatch:n})=>{let r=this.type.create();return n&&t.replaceSelectionWith(r),!0}}},parseHTML:()=>[{tag:"embed"}],renderHTML:({HTMLAttributes:t})=>["embed",eeD(t)],addNodeView:()=>eiW(euN)}),euL=new class{constructor(t,n,r,i){w(this,"extType","node"),w(this,"nodeType","embed"),this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i}}([eiU.RichTextNodeType.embed],euP.name,euP,{fromPrismic:t=>function(n){var r;return null==(r=t.nodes[euP.name])?void 0:r.create({content:n.data})},toPrismic:t=>void 0===t.attrs.content?{type:"embed",data:{type:"embed",embed_url:"",__TYPE__:"EmbedContent",all:[]}}:{type:"embed",data:{...t.attrs.content}}}),euF=enk.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:n}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,eeD(this.options.HTMLAttributes,n),0]},addCommands(){return{setHeading:t=>({commands:n})=>!!this.options.levels.includes(t.level)&&n.setNode(this.name,t),toggleHeading:t=>({commands:n})=>!!this.options.levels.includes(t.level)&&n.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return this.options.levels.reduce((t,n)=>({...t,[`Mod-Alt-${n}`]:()=>this.editor.commands.toggleHeading({level:n})}),{})},addInputRules(){return this.options.levels.map(t=>enT({find:RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),euD="heading",euW={byLevel(t){switch(t){case 1:return eiU.RichTextNodeType.heading1;case 2:return eiU.RichTextNodeType.heading2;case 3:return eiU.RichTextNodeType.heading3;case 4:return eiU.RichTextNodeType.heading4;case 5:return eiU.RichTextNodeType.heading5;case 6:return eiU.RichTextNodeType.heading6}},default(t){return{fullName:this.byLevel(t),level:t}},fromPrismic(t,n=[1,2,3,4,5,6]){let r=RegExp(`^heading([${n.join(",")}]){1}$`),i=t.match(r);if(!i||!i[1])return;let o=parseInt(i[1]);return{fullName:euW.byLevel(o),level:o}},fromProsemirror(t,n){let r=t.level;if(n.includes(r))return{fullName:euW.byLevel(r),level:r}}},euU=t=>euF.extend({name:euD,addAttributes:()=>({level:{default:t[0]},label:{default:null}}),addOptions:()=>({levels:[...t],HTMLAttributes:{}}),parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`}))},renderHTML({node:t,HTMLAttributes:n}){let r=t.attrs.level,i={...t.attrs.label?{label:t.attrs.label}:{}};return[`h${r}`,eeD(this.options.HTMLAttributes,n,i),0]}}),euz=t=>{let n=t[0];return{fromPrismic:r=>function(i){var o;let a=eul.converter.fromPrismic(r)(euD,i),u=euW.fromPrismic(i.type,t)||euW.default(n);return null==(o=r.nodes[euD])?void 0:o.create({level:u.level,...eum.fromPrismic(i)},a)},toPrismic(r){let{fullName:i}=euW.fromProsemirror(r.attrs,t)||euW.default(n);return eul.converter.toPrismic(r,i,eum.toPrismic(r))}}},euB={name:euD,build(t){let n=function(t){if(!t)return[1,2,3,4,5,6];if(!t.size)return;let n=Array.from(t.values()).reduce((t,n)=>{let r=euW.fromPrismic(n);return r?[...t,r.level]:t},[]).sort((t,n)=>t-n);return Z(t$(n),pN(()=>{}))}(t);if(!n)return;let r=t$(n.map(t=>euW.byLevel(t)));if(!pA(r))return new eoi(r.value,euU(n),n,euz(n),t=>{let r=euW.fromProsemirror(t,n);return r&&`Heading ${r.level}`})}};function euq(t){let{node:n}=t,r=n.attrs.content,{selected:i}=euj(t),o={width:null==r?void 0:r.width,height:null==r?void 0:r.height,name:ZE},{onMediaSelected:a,onCropperDialogClose:u,isUpdating:s,updateContent:f,onClear:d}=function(t){let{content:n,thumbnail:r,imageViewProps:{getPos:i,updateAttributes:o,editor:a,node:u}}=t,[s,l]=(0,c.useTransition)();function f(t){l(()=>o({content:t}))}return{onMediaSelected:function(t){let r=Gf(t),o=i()+u.nodeSize;f({__TYPE__:"ImageContent",...n,...r}),a.chain().focus(o+1).run()},onCropperDialogClose:function({croppedImages:t}){if(!n)return;let i=t[r.name];if(!i)return;let o=Gi({content:n,thumbnail:r.name,croppedImage:i});o!==n&&f(o)},isUpdating:s,updateContent:f,onClear:function(){let t=i(),n=i()+u.nodeSize;a.chain().deleteRange({from:t,to:n}).focus(n).run()}}}({content:r,thumbnail:o,imageViewProps:t}),p=(null==r?void 0:r.width)===0&&(null==r?void 0:r.height)===0,h=r&&!p?[`${r.width}x${r.height}px`]:[],m=(null==r?void 0:r.alt)??"",g={thumbnail:o,contentView:r,labels:ZA(o,r,r)};return M.jsx(eiL,{className:"custom-image",children:M.jsx("div",{contentEditable:"false",suppressContentEditableWarning:!0,children:M.jsx(Gl,{content:r,selected:i,fieldLabel:"Feature image",imageLabel:h,initialImages:[g],readOnly:!1,onMediaSelected:a,onCropperDialogClose:u,onClear:d,children:M.jsx(c.Suspense,{fallback:euV,children:null!=r&&r.url?M.jsxs(l.aY,{children:[M.jsx(l.hM,{children:M.jsx(l.xu,{flexDirection:"column",alignItems:"center",position:"relative",height:400,children:M.jsx(l.xu,{justifyContent:"center",flexDirection:"column",flexGrow:1,maxHeight:"100%",maxWidth:"100%",children:M.jsx(l.kg,{src:ZP(r.url),alt:m,sizing:"contain"})})})}),M.jsx(Gn,{onValueChange(t){f({...r,alt:t})},altText:m,readOnly:!r,selected:i})]}):M.jsx(Gt,{isUpdating:s,readOnly:!1,onMediaSelected:a})})})})})}let euV=M.jsx("div",{style:{height:468}}),eu$=enk.create({name:"image",group:"block",atom:!0,addAttributes:()=>({content:{default:void 0}}),addCommands(){return{setImage:()=>t=>{let{dispatch:n,tr:r}=t,i=this.type.create();return n&&r.replaceSelectionWith(i),!0}}},parseHTML:()=>[{tag:"image"}],renderHTML:({HTMLAttributes:t})=>["image",eeD(t)],addNodeView:()=>eiW(euq)}),euK=new class{constructor(t,n,r,i){w(this,"extType","node"),w(this,"nodeType","image"),this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i}}([eiU.RichTextNodeType.image],eu$.name,eu$,{fromPrismic:t=>function(n){var r;return null==(r=t.nodes[eu$.name])?void 0:r.create({content:n.data})},toPrismic(t){if(void 0!==t.attrs.content)return{type:"image",data:{...t.attrs.content}}}}),euH=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,euZ=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,euG=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,euJ=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,euY=enO.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"em"},{tag:"i",getAttrs:t=>"normal"!==t.style.fontStyle&&null},{style:"font-style=italic"}],renderHTML({HTMLAttributes:t}){return["em",eeD(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[enS({find:euH,type:this.type}),enS({find:euG,type:this.type})]},addPasteRules(){return[enM({find:euZ,type:this.type}),enM({find:euJ,type:this.type})]}}),euQ=euY.extend({name:"em"}),euX=new eot([eiU.RichTextNodeType.em],euQ.name,euQ,{fromPrismic:t=>function(){var n;return null==(n=t.marks[euQ.name])?void 0:n.create()},toPrismic(){}}),eu0=(t,n)=>{for(let r in n)t[r]=n[r];return t},eu1="numeric",eu2="ascii",eu3="alpha",eu4="asciinumeric",eu5="alphanumeric",eu6="domain",eu9="emoji",eu8="whitespace";function eu7(t,n){return t in n||(n[t]=[]),n[t]}function ese(t,n,r){for(let i in n[eu1]&&(n[eu4]=!0,n[eu5]=!0),n[eu2]&&(n[eu4]=!0,n[eu3]=!0),n[eu4]&&(n[eu5]=!0),n[eu3]&&(n[eu5]=!0),n[eu5]&&(n[eu6]=!0),n[eu9]&&(n[eu6]=!0),n){let o=eu7(i,r);0>o.indexOf(t)&&o.push(t)}}function est(t){void 0===t&&(t=null),this.j={},this.jr=[],this.jd=null,this.t=t}est.groups={},est.prototype={accepts(){return!!this.t},go(t){let n=this.j[t];if(n)return n;for(let r=0;r<this.jr.length;r++){let i=this.jr[r][0],o=this.jr[r][1];if(o&&i.test(t))return o}return this.jd},has(t,n){return void 0===n&&(n=!1),n?t in this.j:!!this.go(t)},ta(t,n,r,i){for(let o=0;o<t.length;o++)this.tt(t[o],n,r,i)},tr(t,n,r,i){i=i||est.groups;let o;return n&&n.j?o=n:(o=new est(n),r&&i&&ese(n,r,i)),this.jr.push([t,o]),o},ts(t,n,r,i){let o=this,a=t.length;if(!a)return o;for(let u=0;u<a-1;u++)o=o.tt(t[u]);return o.tt(t[a-1],n,r,i)},tt(t,n,r,i){i=i||est.groups;let o=this;if(n&&n.j)return o.j[t]=n,n;let a,u=o.go(t);if(u?(a=new est,eu0(a.j,u.j),a.jr.push.apply(a.jr,u.jr),a.jd=u.jd,a.t=u.t):a=new est,n){if(i){if(a.t&&"string"==typeof a.t){let s=eu0(function(t,n){let r={};for(let i in n)n[i].indexOf(t)>=0&&(r[i]=!0);return r}(a.t,i),r);ese(n,s,i)}else r&&ese(n,r,i)}a.t=n}return o.j[t]=a,a}};let esn=(t,n,r,i,o)=>t.ta(n,r,i,o),esr=(t,n,r,i,o)=>t.tr(n,r,i,o),esi=(t,n,r,i,o)=>t.ts(n,r,i,o),eso=(t,n,r,i,o)=>t.tt(n,r,i,o),esa="WORD",esu="UWORD",ess="LOCALHOST",esc="UTLD",esl="SCHEME",esf="SLASH_SCHEME",esd="OPENBRACE",esp="OPENBRACKET",esh="OPENANGLEBRACKET",esm="OPENPAREN",esg="CLOSEBRACE",esy="CLOSEBRACKET",esv="CLOSEANGLEBRACKET",esb="CLOSEPAREN",esx="AMPERSAND",es_="APOSTROPHE",esS="ASTERISK",esT="BACKSLASH",esw="BACKTICK",esO="CARET",esk="COLON",esI="COMMA",esM="DOLLAR",esC="EQUALS",esR="EXCLAMATION",esE="HYPHEN",esA="PERCENT",esj="PIPE",esN="PLUS",esP="POUND",esL="QUERY",esF="QUOTE",esD="SEMI",esW="SLASH",esU="TILDE",esz="UNDERSCORE",esB="EMOJI";var esq=Object.freeze({__proto__:null,WORD:esa,UWORD:esu,LOCALHOST:ess,TLD:"TLD",UTLD:esc,SCHEME:esl,SLASH_SCHEME:esf,NUM:"NUM",WS:"WS",NL:"NL",OPENBRACE:esd,OPENBRACKET:esp,OPENANGLEBRACKET:esh,OPENPAREN:esm,CLOSEBRACE:esg,CLOSEBRACKET:esy,CLOSEANGLEBRACKET:esv,CLOSEPAREN:esb,AMPERSAND:esx,APOSTROPHE:es_,ASTERISK:esS,AT:"AT",BACKSLASH:esT,BACKTICK:esw,CARET:esO,COLON:esk,COMMA:esI,DOLLAR:esM,DOT:"DOT",EQUALS:esC,EXCLAMATION:esR,HYPHEN:esE,PERCENT:esA,PIPE:esj,PLUS:esN,POUND:esP,QUERY:esL,QUOTE:esF,SEMI:esD,SLASH:esW,TILDE:esU,UNDERSCORE:esz,EMOJI:esB,SYM:"SYM"});let esV=/[a-z]/,es$=/\p{L}/u,esK=/\p{Emoji}/u,esH=/\d/,esZ=/\s/,esG=`
98
- `,esJ=null,esY=null;function esQ(t,n,r,i,o){let a,u=n.length;for(let s=0;s<u-1;s++){let c=n[s];t.j[c]?a=t.j[c]:((a=new est(i)).jr=o.slice(),t.j[c]=a),t=a}return(a=new est(r)).jr=o.slice(),t.j[n[u-1]]=a,a}function esX(t){let n=[],r=[],i=0;for(;i<t.length;){let o=0;for(;"0123456789".indexOf(t[i+o])>=0;)o++;if(o>0){n.push(r.join(""));for(let a=parseInt(t.substring(i,i+o),10);a>0;a--)r.pop();i+=o}else r.push(t[i]),i++}return n}let es0={defaultProtocol:"http",events:null,format:es2,formatHref:es2,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function es1(t,n){void 0===n&&(n=null);let r=eu0({},es0);t&&(r=eu0(r,t instanceof es1?t.o:t));let i=r.ignoreTags,o=[];for(let a=0;a<i.length;a++)o.push(i[a].toUpperCase());this.o=r,n&&(this.defaultRender=n),this.ignoreTags=o}function es2(t){return t}function es3(t,n){this.t="token",this.v=t,this.tk=n}function es4(t,n){class r extends es3{constructor(n,r){super(n,r),this.t=t}}for(let i in n)r.prototype[i]=n[i];return r.t=t,r}es1.prototype={o:es0,ignoreTags:[],defaultRender:t=>t,check(t){return this.get("validate",t.toString(),t)},get(t,n,r){let i=null!=n,o=this.o[t];return o&&("object"==typeof o?"function"==typeof(o=r.t in o?o[r.t]:es0[t])&&i&&(o=o(n,r)):"function"==typeof o&&i&&(o=o(n,r.t,r)),o)},getObj(t,n,r){let i=this.o[t];return"function"==typeof i&&null!=n&&(i=i(n,r.t,r)),i},render(t){let n=t.render(this);return(this.get("render",null,t)||this.defaultRender)(n,t.t,t)}},es3.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){let n=this.toString(),r=t.get("truncate",n,this),i=t.get("format",n,this);return r&&i.length>r?i.substring(0,r)+"…":i},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t){return void 0===t&&(t=es0.defaultProtocol),{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){let n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),i=t.get("tagName",n,this),o=this.toFormattedString(t),a={},u=t.get("className",n,this),s=t.get("target",n,this),c=t.get("rel",n,this),l=t.getObj("attributes",n,this),f=t.getObj("events",n,this);return a.href=r,u&&(a.class=u),s&&(a.target=s),c&&(a.rel=c),l&&eu0(a,l),{tagName:i,attributes:a,content:o,eventListeners:f}}};let es5=es4("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),es6=es4("text"),es9=es4("nl"),es8=es4("url",{isLink:!0,toHref(t){return void 0===t&&(t=es0.defaultProtocol),this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){let t=this.tk;return t.length>=2&&t[0].t!==ess&&t[1].t===esk}}),es7=t=>new est(t);function ece(t,n,r){let i=r[0].s,o=r[r.length-1].e,a=n.slice(i,o);return new t(a,r)}let ect="u">typeof console&&console&&console.warn||(()=>{}),ecn={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function ecr(t,n){if(void 0===n&&(n=!1),ecn.initialized&&ect(`linkifyjs: already initialized - will not register custom scheme "${t}" until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw Error(`linkifyjs: incorrect scheme format.
96
+ `);return!!a&&!!u&&t.chain().command(({tr:t})=>(t.delete(i.pos-2,i.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;let{state:n}=t,{selection:r,doc:i}=n,{$from:o,empty:a}=r;if(!a||o.parent.type!==this.type||o.parentOffset!==o.parent.nodeSize-2)return!1;let u=o.after();return!(void 0===u||i.nodeAt(u))&&t.commands.exitCode()}}},addInputRules(){return[enM({find:euj,type:this.type,getAttributes:t=>({language:t[1]})}),enM({find:euN,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new YM({key:new YE("codeBlockVSCodeHandler"),props:{handlePaste:(t,n)=>{if(!n.clipboardData||this.editor.isActive(this.type.name))return!1;let r=n.clipboardData.getData("text/plain"),i=n.clipboardData.getData("vscode-editor-data"),o=i?JSON.parse(i):void 0,a=null==o?void 0:o.mode;if(!r||!a)return!1;let{tr:u}=t.state;return u.replaceSelectionWith(this.type.create({language:a})),u.setSelection(Yh.near(u.doc.resolve(Math.max(0,u.selection.from-2)))),u.insertText(r.replace(/\r\n?/g,`
97
+ `)),u.setMeta("paste",!0),t.dispatch(u),!0}}})]}}),euL=euP.extend({name:"preformatted",addAttributes(){return{language:{default:null,parseHTML:t=>{var n;let{languageClassPrefix:r}=this.options,i=[...(null==(n=t.firstElementChild)?void 0:n.classList)||[]].filter(t=>t.startsWith(r)).map(t=>t.replace(r,""))[0];return i||null},renderHTML:t=>t.language?{class:this.options.languageClassPrefix+t.language}:null}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({HTMLAttributes:t}){return["pre",eeq(this.options.HTMLAttributes),["code",t,0]]}}).configure({exitOnTripleEnter:!1}),euF=new eou([ei$.RichTextNodeType.preformatted],euL.name,euL,{fromPrismic:t=>function(n){var r;let i=eum.converter.fromPrismic(t)(euL.name,n,!0);return null==(r=t.nodes[euL.name])?void 0:r.create(eux.fromPrismic(n),i)},toPrismic:t=>eum.converter.toPrismic(t,ei$.RichTextNodeType.preformatted,eux.toPrismic(t))},"",!0);function euD(t){let{editor:n,getPos:r,node:i}=t,[o,a]=(0,c.useState)(!1);return(0,c.useEffect)(()=>{function t(){let{from:t,to:o}=n.state.selection,u=r(),s=r()+i.nodeSize;a(t<=u&&o>=s)}function o(){a(!1)}return n.on("blur",o),n.on("selectionUpdate",t),()=>{n.off("blur",o),n.off("selectionUpdate",t)}},[n,r,i.nodeSize]),{selected:o}}function euW(t){let n=(0,c.useRef)(null),r=(0,c.useRef)(null),{onKeyDown:i,url:o,urlChanged:a,onContentChange:u,debouncedUrl:s}=function(t,n,r){let{node:i}=t,o=i.attrs.content,[a,u]=(0,c.useState)((null==o?void 0:o.embed_url)??""),s=(0,f.R9)(t.updateAttributes);function l(t){s({content:t})}let[d,p]=(0,c.useState)(a),h=(0,c.useCallback)(t=>(0,c.startTransition)(()=>p(t)),[]);(0,f.Nr)(a,300,h);let{onKeyDown:m}=function(t,n,r,i){let{editor:o,getPos:a,node:u}=t,[s,l]=(0,c.useState)(!0);return(0,c.useEffect)(()=>{s&&t.editor.isFocused&&setTimeout(()=>{var t;return null==(t=r.current)?void 0:t.focus()})},[r,s,t.editor.isFocused]),{containerRef:i,inputRef:r,onKeyDown:function(t){let r=a(),i=a()+u.nodeSize;"Enter"===t.code&&(l(!1),o.chain().insertContentAt(i,{type:"paragraph"}).focus(i+1).run()),"Backspace"===t.code&&""===n&&o.chain().deleteRange({from:r,to:i}).focus(i+1).run(),"ArrowUp"===t.code&&(l(!1),o.chain().focus(r-1).run()),"ArrowDown"===t.code&&(l(!1),o.chain().focus(i+1).run())}}}(t,a,n,r);return{inputRef:n,containerRef:r,onKeyDown:m,url:a,urlChanged:function(t){u(t),(0,g.j)(t)||l(void 0)},onContentChange:l,debouncedUrl:d}}(t,n,r),{selected:d}=euD(t);return M.jsx(eiz,{className:"custom-embed",children:M.jsx("div",{contentEditable:"false",suppressContentEditableWarning:!0,children:M.jsxs(l.xu,{flexDirection:"column",children:[M.jsxs(l.xu,{flexGrow:1,alignItems:"center",children:[M.jsx(l.I5,{size:"small",name:"cloud",color:"grey11"}),M.jsx(l.xu,{flexGrow:1,flexDirection:"column",ref:r,children:M.jsx(l.oi,{id:"id",ref:n,value:o,variant:(0,g.j)(o)?"link":"normal",placeholder:"Paste your link here",onValueChange:a,onKeyDown:i})})]}),(0,g.j)(o)&&M.jsx(Zx,{selected:d,debouncedUrl:s,onContentChange:u})]})})})}let euU=enE.create({name:"embed",group:"block",content:"block*",atom:!0,marks:"",addAttributes:()=>({content:{default:void 0}}),addCommands(){return{setEmbed:()=>({tr:t,dispatch:n})=>{let r=this.type.create();return n&&t.replaceSelectionWith(r),!0}}},parseHTML:()=>[{tag:"embed"}],renderHTML:({HTMLAttributes:t})=>["embed",eeq(t)],addNodeView:()=>eiV(euW)}),euz=new class{constructor(t,n,r,i){w(this,"extType","node"),w(this,"nodeType","embed"),this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i}}([ei$.RichTextNodeType.embed],euU.name,euU,{fromPrismic:t=>function(n){var r;return null==(r=t.nodes[euU.name])?void 0:r.create({content:n.data})},toPrismic:t=>void 0===t.attrs.content?{type:"embed",data:{type:"embed",embed_url:"",__TYPE__:"EmbedContent",all:[]}}:{type:"embed",data:{...t.attrs.content}}}),euB=enE.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:n}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,eeq(this.options.HTMLAttributes,n),0]},addCommands(){return{setHeading:t=>({commands:n})=>!!this.options.levels.includes(t.level)&&n.setNode(this.name,t),toggleHeading:t=>({commands:n})=>!!this.options.levels.includes(t.level)&&n.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return this.options.levels.reduce((t,n)=>({...t,[`Mod-Alt-${n}`]:()=>this.editor.commands.toggleHeading({level:n})}),{})},addInputRules(){return this.options.levels.map(t=>enM({find:RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),euq="heading",euV={byLevel(t){switch(t){case 1:return ei$.RichTextNodeType.heading1;case 2:return ei$.RichTextNodeType.heading2;case 3:return ei$.RichTextNodeType.heading3;case 4:return ei$.RichTextNodeType.heading4;case 5:return ei$.RichTextNodeType.heading5;case 6:return ei$.RichTextNodeType.heading6}},default(t){return{fullName:this.byLevel(t),level:t}},fromPrismic(t,n=[1,2,3,4,5,6]){let r=RegExp(`^heading([${n.join(",")}]){1}$`),i=t.match(r);if(!i||!i[1])return;let o=parseInt(i[1]);return{fullName:euV.byLevel(o),level:o}},fromProsemirror(t,n){let r=t.level;if(n.includes(r))return{fullName:euV.byLevel(r),level:r}}},eu$=t=>euB.extend({name:euq,addAttributes:()=>({level:{default:t[0]},label:{default:null}}),addOptions:()=>({levels:[...t],HTMLAttributes:{}}),parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`}))},renderHTML({node:t,HTMLAttributes:n}){let r=t.attrs.level,i={...t.attrs.label?{label:t.attrs.label}:{}};return[`h${r}`,eeq(this.options.HTMLAttributes,n,i),0]}}),euK=t=>{let n=t[0];return{fromPrismic:r=>function(i){var o;let a=eum.converter.fromPrismic(r)(euq,i),u=euV.fromPrismic(i.type,t)||euV.default(n);return null==(o=r.nodes[euq])?void 0:o.create({level:u.level,...eux.fromPrismic(i)},a)},toPrismic(r){let{fullName:i}=euV.fromProsemirror(r.attrs,t)||euV.default(n);return eum.converter.toPrismic(r,i,eux.toPrismic(r))}}},euH={name:euq,build(t){let n=function(t){if(!t)return[1,2,3,4,5,6];if(!t.size)return;let n=Array.from(t.values()).reduce((t,n)=>{let r=euV.fromPrismic(n);return r?[...t,r.level]:t},[]).sort((t,n)=>t-n);return Z(t$(n),pN(()=>{}))}(t);if(!n)return;let r=t$(n.map(t=>euV.byLevel(t)));if(!pA(r))return new eoc(r.value,eu$(n),n,euK(n),t=>{let r=euV.fromProsemirror(t,n);return r&&`Heading ${r.level}`})}};function euZ(t){let{node:n}=t,r=n.attrs.content,{selected:i}=euD(t),o={width:null==r?void 0:r.width,height:null==r?void 0:r.height,name:ZE},{onMediaSelected:a,onCropperDialogClose:u,isUpdating:s,updateContent:f,onClear:d}=function(t){let{content:n,thumbnail:r,imageViewProps:{getPos:i,updateAttributes:o,editor:a,node:u}}=t,[s,l]=(0,c.useTransition)();function f(t){l(()=>o({content:t}))}return{onMediaSelected:function(t){let r=Gf(t),o=i()+u.nodeSize;f({__TYPE__:"ImageContent",...n,...r}),a.chain().focus(o+1).run()},onCropperDialogClose:function({croppedImages:t}){if(!n)return;let i=t[r.name];if(!i)return;let o=Gi({content:n,thumbnail:r.name,croppedImage:i});o!==n&&f(o)},isUpdating:s,updateContent:f,onClear:function(){let t=i(),n=i()+u.nodeSize;a.chain().deleteRange({from:t,to:n}).focus(n).run()}}}({content:r,thumbnail:o,imageViewProps:t}),p=(null==r?void 0:r.width)===0&&(null==r?void 0:r.height)===0,h=r&&!p?[`${r.width}x${r.height}px`]:[],m=(null==r?void 0:r.alt)??"",g={thumbnail:o,contentView:r,labels:ZA(o,r,r)};return M.jsx(eiz,{className:"custom-image",children:M.jsx("div",{contentEditable:"false",suppressContentEditableWarning:!0,children:M.jsx(Gl,{content:r,selected:i,fieldLabel:"Feature image",imageLabel:h,initialImages:[g],readOnly:!1,onMediaSelected:a,onCropperDialogClose:u,onClear:d,children:M.jsx(c.Suspense,{fallback:euG,children:null!=r&&r.url?M.jsxs(l.aY,{children:[M.jsx(l.hM,{children:M.jsx(l.xu,{flexDirection:"column",alignItems:"center",position:"relative",height:400,children:M.jsx(l.xu,{justifyContent:"center",flexDirection:"column",flexGrow:1,maxHeight:"100%",maxWidth:"100%",children:M.jsx(l.kg,{src:ZP(r.url),alt:m,sizing:"contain"})})})}),M.jsx(Gn,{onValueChange(t){f({...r,alt:t})},altText:m,readOnly:!r,selected:i})]}):M.jsx(Gt,{isUpdating:s,readOnly:!1,onMediaSelected:a})})})})})}let euG=M.jsx("div",{style:{height:468}}),euJ=enE.create({name:"image",group:"block",atom:!0,addAttributes:()=>({content:{default:void 0}}),addCommands(){return{setImage:()=>t=>{let{dispatch:n,tr:r}=t,i=this.type.create();return n&&r.replaceSelectionWith(i),!0}}},parseHTML:()=>[{tag:"image"}],renderHTML:({HTMLAttributes:t})=>["image",eeq(t)],addNodeView:()=>eiV(euZ)}),euY=new class{constructor(t,n,r,i){w(this,"extType","node"),w(this,"nodeType","image"),this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i}}([ei$.RichTextNodeType.image],euJ.name,euJ,{fromPrismic:t=>function(n){var r;return null==(r=t.nodes[euJ.name])?void 0:r.create({content:n.data})},toPrismic(t){if(void 0!==t.attrs.content)return{type:"image",data:{...t.attrs.content}}}}),euQ=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,euX=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,eu0=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,eu1=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,eu2=enR.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"em"},{tag:"i",getAttrs:t=>"normal"!==t.style.fontStyle&&null},{style:"font-style=italic"}],renderHTML({HTMLAttributes:t}){return["em",eeq(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[enI({find:euQ,type:this.type}),enI({find:eu0,type:this.type})]},addPasteRules(){return[enj({find:euX,type:this.type}),enj({find:eu1,type:this.type})]}}),eu3=eu2.extend({name:"em"}),eu4=new eoa([ei$.RichTextNodeType.em],eu3.name,eu3,{fromPrismic:t=>function(){var n;return null==(n=t.marks[eu3.name])?void 0:n.create()},toPrismic(){}}),eu5=(t,n)=>{for(let r in n)t[r]=n[r];return t},eu6="numeric",eu9="ascii",eu8="alpha",eu7="asciinumeric",ese="alphanumeric",est="domain",esn="emoji",esr="whitespace";function esi(t,n){return t in n||(n[t]=[]),n[t]}function eso(t,n,r){for(let i in n[eu6]&&(n[eu7]=!0,n[ese]=!0),n[eu9]&&(n[eu7]=!0,n[eu8]=!0),n[eu7]&&(n[ese]=!0),n[eu8]&&(n[ese]=!0),n[ese]&&(n[est]=!0),n[esn]&&(n[est]=!0),n){let o=esi(i,r);0>o.indexOf(t)&&o.push(t)}}function esa(t){void 0===t&&(t=null),this.j={},this.jr=[],this.jd=null,this.t=t}esa.groups={},esa.prototype={accepts(){return!!this.t},go(t){let n=this.j[t];if(n)return n;for(let r=0;r<this.jr.length;r++){let i=this.jr[r][0],o=this.jr[r][1];if(o&&i.test(t))return o}return this.jd},has(t,n){return void 0===n&&(n=!1),n?t in this.j:!!this.go(t)},ta(t,n,r,i){for(let o=0;o<t.length;o++)this.tt(t[o],n,r,i)},tr(t,n,r,i){i=i||esa.groups;let o;return n&&n.j?o=n:(o=new esa(n),r&&i&&eso(n,r,i)),this.jr.push([t,o]),o},ts(t,n,r,i){let o=this,a=t.length;if(!a)return o;for(let u=0;u<a-1;u++)o=o.tt(t[u]);return o.tt(t[a-1],n,r,i)},tt(t,n,r,i){i=i||esa.groups;let o=this;if(n&&n.j)return o.j[t]=n,n;let a,u=o.go(t);if(u?(a=new esa,eu5(a.j,u.j),a.jr.push.apply(a.jr,u.jr),a.jd=u.jd,a.t=u.t):a=new esa,n){if(i){if(a.t&&"string"==typeof a.t){let s=eu5(function(t,n){let r={};for(let i in n)n[i].indexOf(t)>=0&&(r[i]=!0);return r}(a.t,i),r);eso(n,s,i)}else r&&eso(n,r,i)}a.t=n}return o.j[t]=a,a}};let esu=(t,n,r,i,o)=>t.ta(n,r,i,o),ess=(t,n,r,i,o)=>t.tr(n,r,i,o),esc=(t,n,r,i,o)=>t.ts(n,r,i,o),esl=(t,n,r,i,o)=>t.tt(n,r,i,o),esf="WORD",esd="UWORD",esp="LOCALHOST",esh="UTLD",esm="SCHEME",esg="SLASH_SCHEME",esy="OPENBRACE",esv="OPENBRACKET",esb="OPENANGLEBRACKET",esx="OPENPAREN",es_="CLOSEBRACE",esS="CLOSEBRACKET",esT="CLOSEANGLEBRACKET",esw="CLOSEPAREN",esO="AMPERSAND",esk="APOSTROPHE",esI="ASTERISK",esM="BACKSLASH",esC="BACKTICK",esR="CARET",esE="COLON",esA="COMMA",esj="DOLLAR",esN="EQUALS",esP="EXCLAMATION",esL="HYPHEN",esF="PERCENT",esD="PIPE",esW="PLUS",esU="POUND",esz="QUERY",esB="QUOTE",esq="SEMI",esV="SLASH",es$="TILDE",esK="UNDERSCORE",esH="EMOJI";var esZ=Object.freeze({__proto__:null,WORD:esf,UWORD:esd,LOCALHOST:esp,TLD:"TLD",UTLD:esh,SCHEME:esm,SLASH_SCHEME:esg,NUM:"NUM",WS:"WS",NL:"NL",OPENBRACE:esy,OPENBRACKET:esv,OPENANGLEBRACKET:esb,OPENPAREN:esx,CLOSEBRACE:es_,CLOSEBRACKET:esS,CLOSEANGLEBRACKET:esT,CLOSEPAREN:esw,AMPERSAND:esO,APOSTROPHE:esk,ASTERISK:esI,AT:"AT",BACKSLASH:esM,BACKTICK:esC,CARET:esR,COLON:esE,COMMA:esA,DOLLAR:esj,DOT:"DOT",EQUALS:esN,EXCLAMATION:esP,HYPHEN:esL,PERCENT:esF,PIPE:esD,PLUS:esW,POUND:esU,QUERY:esz,QUOTE:esB,SEMI:esq,SLASH:esV,TILDE:es$,UNDERSCORE:esK,EMOJI:esH,SYM:"SYM"});let esG=/[a-z]/,esJ=/\p{L}/u,esY=/\p{Emoji}/u,esQ=/\d/,esX=/\s/,es0=`
98
+ `,es1=null,es2=null;function es3(t,n,r,i,o){let a,u=n.length;for(let s=0;s<u-1;s++){let c=n[s];t.j[c]?a=t.j[c]:((a=new esa(i)).jr=o.slice(),t.j[c]=a),t=a}return(a=new esa(r)).jr=o.slice(),t.j[n[u-1]]=a,a}function es4(t){let n=[],r=[],i=0;for(;i<t.length;){let o=0;for(;"0123456789".indexOf(t[i+o])>=0;)o++;if(o>0){n.push(r.join(""));for(let a=parseInt(t.substring(i,i+o),10);a>0;a--)r.pop();i+=o}else r.push(t[i]),i++}return n}let es5={defaultProtocol:"http",events:null,format:es9,formatHref:es9,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function es6(t,n){void 0===n&&(n=null);let r=eu5({},es5);t&&(r=eu5(r,t instanceof es6?t.o:t));let i=r.ignoreTags,o=[];for(let a=0;a<i.length;a++)o.push(i[a].toUpperCase());this.o=r,n&&(this.defaultRender=n),this.ignoreTags=o}function es9(t){return t}function es8(t,n){this.t="token",this.v=t,this.tk=n}function es7(t,n){class r extends es8{constructor(n,r){super(n,r),this.t=t}}for(let i in n)r.prototype[i]=n[i];return r.t=t,r}es6.prototype={o:es5,ignoreTags:[],defaultRender:t=>t,check(t){return this.get("validate",t.toString(),t)},get(t,n,r){let i=null!=n,o=this.o[t];return o&&("object"==typeof o?"function"==typeof(o=r.t in o?o[r.t]:es5[t])&&i&&(o=o(n,r)):"function"==typeof o&&i&&(o=o(n,r.t,r)),o)},getObj(t,n,r){let i=this.o[t];return"function"==typeof i&&null!=n&&(i=i(n,r.t,r)),i},render(t){let n=t.render(this);return(this.get("render",null,t)||this.defaultRender)(n,t.t,t)}},es8.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){let n=this.toString(),r=t.get("truncate",n,this),i=t.get("format",n,this);return r&&i.length>r?i.substring(0,r)+"…":i},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t){return void 0===t&&(t=es5.defaultProtocol),{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){let n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),i=t.get("tagName",n,this),o=this.toFormattedString(t),a={},u=t.get("className",n,this),s=t.get("target",n,this),c=t.get("rel",n,this),l=t.getObj("attributes",n,this),f=t.getObj("events",n,this);return a.href=r,u&&(a.class=u),s&&(a.target=s),c&&(a.rel=c),l&&eu5(a,l),{tagName:i,attributes:a,content:o,eventListeners:f}}};let ece=es7("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),ect=es7("text"),ecn=es7("nl"),ecr=es7("url",{isLink:!0,toHref(t){return void 0===t&&(t=es5.defaultProtocol),this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){let t=this.tk;return t.length>=2&&t[0].t!==esp&&t[1].t===esE}}),eci=t=>new esa(t);function eco(t,n,r){let i=r[0].s,o=r[r.length-1].e,a=n.slice(i,o);return new t(a,r)}let eca="u">typeof console&&console&&console.warn||(()=>{}),ecu={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function ecs(t,n){if(void 0===n&&(n=!1),ecu.initialized&&eca(`linkifyjs: already initialized - will not register custom scheme "${t}" until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw Error(`linkifyjs: incorrect scheme format.
99
99
  1. Must only contain digits, lowercase ASCII letters or "-"
100
100
  2. Cannot start or end with "-"
101
- 3. "-" cannot repeat`);ecn.customSchemes.push([t,n])}function eci(t){return ecn.initialized||function(){ecn.scanner=function(t){void 0===t&&(t=[]);let n={};est.groups=n;let r=new est;null==esJ&&(esJ=esX("aaa1rp3barth4b0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0faromeo7ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re2s2c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y0eats7k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking0channel11l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t0isalat7u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0at2delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d0network8tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntdoor4ier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5gtv3iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0eles2s3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1nder2le4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster5ia3d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4de2k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0cys3drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7serati6ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic3tual5v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rthwesternmutual14on4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3ssagens7y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cher3ks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w0time7i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ffany5ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0channel7ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5m\xf6gensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lkswagen7vo3te1ing3o2yage5u0elos6wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2")),null==esY&&(esY=esX("ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5تصالات6رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2")),eso(r,"'",es_),eso(r,"{",esd),eso(r,"[",esp),eso(r,"<",esh),eso(r,"(",esm),eso(r,"}",esg),eso(r,"]",esy),eso(r,">",esv),eso(r,")",esb),eso(r,"&",esx),eso(r,"*",esS),eso(r,"@","AT"),eso(r,"`",esw),eso(r,"^",esO),eso(r,":",esk),eso(r,",",esI),eso(r,"$",esM),eso(r,".","DOT"),eso(r,"=",esC),eso(r,"!",esR),eso(r,"-",esE),eso(r,"%",esA),eso(r,"|",esj),eso(r,"+",esN),eso(r,"#",esP),eso(r,"?",esL),eso(r,'"',esF),eso(r,"/",esW),eso(r,";",esD),eso(r,"~",esU),eso(r,"_",esz),eso(r,"\\",esT);let i=esr(r,esH,"NUM",{[eu1]:!0});esr(i,esH,i);let o=esr(r,esV,esa,{[eu2]:!0});esr(o,esV,o);let a=esr(r,es$,esu,{[eu3]:!0});esr(a,esV),esr(a,es$,a);let u=esr(r,esZ,"WS",{[eu8]:!0});eso(r,esG,"NL",{[eu8]:!0}),eso(u,esG),esr(u,esZ,u);let s=esr(r,esK,esB,{[eu9]:!0});esr(s,esK,s),eso(s,"️",s);let c=eso(s,"‍");esr(c,esK,s);let l=[[esV,o]],f=[[esV,null],[es$,a]];for(let d=0;d<esJ.length;d++)esQ(r,esJ[d],"TLD",esa,l);for(let p=0;p<esY.length;p++)esQ(r,esY[p],esc,esu,f);ese("TLD",{tld:!0,ascii:!0},n),ese(esc,{utld:!0,alpha:!0},n),esQ(r,"file",esl,esa,l),esQ(r,"mailto",esl,esa,l),esQ(r,"http",esf,esa,l),esQ(r,"https",esf,esa,l),esQ(r,"ftp",esf,esa,l),esQ(r,"ftps",esf,esa,l),ese(esl,{scheme:!0,ascii:!0},n),ese(esf,{slashscheme:!0,ascii:!0},n),t=t.sort((t,n)=>t[0]>n[0]?1:-1);for(let h=0;h<t.length;h++){let m=t[h][0],g=t[h][1]?{scheme:!0}:{slashscheme:!0};m.indexOf("-")>=0?g[eu6]=!0:esV.test(m)?esH.test(m)?g[eu4]=!0:g[eu2]=!0:g[eu1]=!0,esi(r,m,m,g)}return esi(r,"localhost",ess,{ascii:!0}),r.jd=new est("SYM"),{start:r,tokens:eu0({groups:n},esq)}}(ecn.customSchemes);for(let t=0;t<ecn.tokenQueue.length;t++)ecn.tokenQueue[t][1]({scanner:ecn.scanner});ecn.parser=function(t){let{groups:n}=t,r=n.domain.concat([esx,esS,"AT",esT,esw,esO,esM,esC,esE,"NUM",esA,esj,esN,esP,esW,"SYM",esU,esz]),i=[es_,esv,esg,esy,esb,esk,esI,"DOT",esR,esh,esd,esp,esm,esL,esF,esD],o=[esx,es_,esS,esT,esw,esO,esg,esM,esC,esE,esd,esA,esj,esN,esP,esL,esW,"SYM",esU,esz],a=es7(),u=eso(a,esU);esn(u,o,u),esn(u,n.domain,u);let s=es7(),c=es7(),l=es7();esn(a,n.domain,s),esn(a,n.scheme,c),esn(a,n.slashscheme,l),esn(s,o,u),esn(s,n.domain,s);let f=eso(s,"AT");eso(u,"AT",f),eso(c,"AT",f),eso(l,"AT",f);let d=eso(u,"DOT");esn(d,o,u),esn(d,n.domain,u);let p=es7();esn(f,n.domain,p),esn(p,n.domain,p);let h=eso(p,"DOT");esn(h,n.domain,p);let m=es7(es5);esn(h,n.tld,m),esn(h,n.utld,m),eso(f,ess,m);let g=eso(p,esE);esn(g,n.domain,p),esn(m,n.domain,p),eso(m,"DOT",h),eso(m,esE,g);let y=eso(m,esk);esn(y,n.numeric,es5);let v=eso(s,esE),b=eso(s,"DOT");esn(v,n.domain,s),esn(b,o,u),esn(b,n.domain,s);let x=es7(es8);esn(b,n.tld,x),esn(b,n.utld,x),esn(x,n.domain,s),esn(x,o,u),eso(x,"DOT",b),eso(x,esE,v),eso(x,"AT",f);let _=eso(x,esk),S=es7(es8);esn(_,n.numeric,S);let T=es7(es8),w=es7();esn(T,r,T),esn(T,i,w),esn(w,r,T),esn(w,i,w),eso(x,esW,T),eso(S,esW,T);let O=eso(c,esk),k=eso(l,esk),I=eso(k,esW),M=eso(I,esW);esn(c,n.domain,s),eso(c,"DOT",b),eso(c,esE,v),esn(l,n.domain,s),eso(l,"DOT",b),eso(l,esE,v),esn(O,n.domain,T),eso(O,esW,T),esn(M,n.domain,T),esn(M,r,T),eso(M,esW,T);let C=eso(T,esd),R=eso(T,esp),E=eso(T,esh),A=eso(T,esm);eso(w,esd,C),eso(w,esp,R),eso(w,esh,E),eso(w,esm,A),eso(C,esg,T),eso(R,esy,T),eso(E,esv,T),eso(A,esb,T),eso(C,esg,T);let j=es7(es8),N=es7(es8),P=es7(es8),L=es7(es8);esn(C,r,j),esn(R,r,N),esn(E,r,P),esn(A,r,L);let F=es7(),D=es7(),W=es7(),U=es7();return esn(C,i),esn(R,i),esn(E,i),esn(A,i),esn(j,r,j),esn(N,r,N),esn(P,r,P),esn(L,r,L),esn(j,i,j),esn(N,i,N),esn(P,i,P),esn(L,i,L),esn(F,r,F),esn(D,r,N),esn(W,r,P),esn(U,r,L),esn(F,i,F),esn(D,i,D),esn(W,i,W),esn(U,i,U),eso(N,esy,T),eso(P,esv,T),eso(L,esb,T),eso(j,esg,T),eso(D,esy,T),eso(W,esv,T),eso(U,esb,T),eso(F,esb,T),eso(a,ess,x),eso(a,"NL",es9),{start:a,tokens:esq}}(ecn.scanner.tokens);for(let n=0;n<ecn.pluginQueue.length;n++)ecn.pluginQueue[n][1]({scanner:ecn.scanner,parser:ecn.parser});ecn.initialized=!0}(),function(t,n,r){let i=r.length,o=0,a=[],u=[];for(;o<i;){let s=t,c=null,l=null,f=0,d=null,p=-1;for(;o<i&&!(c=s.go(r[o].t));)u.push(r[o++]);for(;o<i&&(l=c||s.go(r[o].t));)c=null,(s=l).accepts()?(p=0,d=s):p>=0&&p++,o++,f++;if(p<0)(o-=f)<i&&(u.push(r[o]),o++);else{u.length>0&&(a.push(ece(es6,n,u)),u=[]),o-=p,f-=p;let h=d.t,m=r.slice(o-f,o);a.push(ece(h,n,m))}}return u.length>0&&a.push(ece(es6,n,u)),a}(ecn.parser.start,t,function(t,n){let r=function(t){let n=[],r=t.length,i=0;for(;i<r;){let o=t.charCodeAt(i),a,u=o<55296||o>56319||i+1===r||(a=t.charCodeAt(i+1))<56320||a>57343?t[i]:t.slice(i,i+2);n.push(u),i+=u.length}return n}(n.replace(/[A-Z]/g,t=>t.toLowerCase())),i=r.length,o=[],a=0,u=0;for(;u<i;){let s=t,c=null,l=0,f=null,d=-1,p=-1;for(;u<i&&(c=s.go(r[u]));)(s=c).accepts()?(d=0,p=0,f=s):d>=0&&(d+=r[u].length,p++),l+=r[u].length,a+=r[u].length,u++;a-=d,u-=p,l-=d,o.push({t:f.t,v:n.slice(a-l,a),s:a-l,e:a})}return o}(ecn.scanner.start,t))}function eco(t,n,r){if(void 0===n&&(n=null),void 0===r&&(r=null),n&&"object"==typeof n){if(r)throw Error(`linkifyjs: Invalid link type ${n}; must be a string`);r=n,n=null}let i=new es1(r),o=eci(t),a=[];for(let u=0;u<o.length;u++){let s=o[u];s.isLink&&(!n||s.t===n)&&a.push(s.toFormattedObject(i))}return a}function eca(t,n){void 0===n&&(n=null);let r=eci(t);return 1===r.length&&r[0].isLink&&(!n||r[0].t===n)}let ecu=enO.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate(){this.options.protocols.forEach(t=>{if("string"==typeof t){ecr(t);return}ecr(t.scheme,t.optionalSlashes)})},onDestroy(){est.groups={},ecn.scanner=null,ecn.parser=null,ecn.tokenQueue=[],ecn.pluginQueue=[],ecn.customSchemes=[],ecn.initialized=!1},inclusive(){return this.options.autolink},addOptions:()=>({openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:void 0}),addAttributes(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target},class:{default:this.options.HTMLAttributes.class}}},parseHTML:()=>[{tag:'a[href]:not([href *= "javascript:" i])'}],renderHTML({HTMLAttributes:t}){return["a",eeD(this.options.HTMLAttributes,t),0]},addCommands(){return{setLink:t=>({chain:n})=>n().setMark(this.name,t).setMeta("preventAutolink",!0).run(),toggleLink:t=>({chain:n})=>n().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[enM({find:t=>eco(t).filter(t=>!this.options.validate||this.options.validate(t.value)).filter(t=>t.isLink).map(t=>({text:t.value,index:t.start,data:t})),type:this.type,getAttributes(t){var n;return{href:null===(n=t.data)||void 0===n?void 0:n.href}}})]},addProseMirrorPlugins(){var t,n,r;let i=[];return this.options.autolink&&i.push((t={type:this.type,validate:this.options.validate},new YT({key:new Yk("autolink"),appendTransaction(n,r,i){let o=n.some(t=>t.docChanged)&&!r.doc.eq(i.doc),a=n.some(t=>t.getMeta("preventAutolink"));if(!o||a)return;let{tr:u}=i,s=function(t,n){let r=new Yr(t);return n.forEach(t=>{t.steps.forEach(t=>{r.step(t)})}),r}(r.doc,[...n]),{mapping:c}=s;if((function(t){let{mapping:n,steps:r}=t,i=[];return n.maps.forEach((t,o)=>{let a=[];if(t.ranges.length)t.forEach((t,n)=>{a.push({from:t,to:n})});else{let{from:u,to:s}=r[o];if(void 0===u||void 0===s)return;a.push({from:u,to:s})}a.forEach(({from:t,to:r})=>{let a=n.slice(o).map(t,-1),u=n.slice(o).map(r),s=n.invert().map(a,-1),c=n.invert().map(u);i.push({oldRange:{from:s,to:c},newRange:{from:a,to:u}})})}),function(t){let n=function(t,n=JSON.stringify){let r={};return t.filter(t=>{let i=n(t);return!Object.prototype.hasOwnProperty.call(r,i)&&(r[i]=!0)})}(t);return 1===n.length?n:n.filter((t,r)=>!n.filter((t,n)=>n!==r).some(n=>t.oldRange.from>=n.oldRange.from&&t.oldRange.to<=n.oldRange.to&&t.newRange.from>=n.newRange.from&&t.newRange.to<=n.newRange.to))}(i)})(s).forEach(({oldRange:n,newRange:o})=>{etQ(n.from,n.to,r.doc).filter(n=>n.mark.type===t.type).forEach(n=>{let o=c.map(n.from),a=c.map(n.to),s=etQ(o,a,i.doc).filter(n=>n.mark.type===t.type);if(!s.length)return;let l=s[0],f=r.doc.textBetween(n.from,n.to,void 0," "),d=i.doc.textBetween(l.from,l.to,void 0," "),p=eca(f),h=eca(d);p&&!h&&u.removeMark(l.from,l.to,t.type)});let a=function(t,n,r){let i=[];return t.nodesBetween(n.from,n.to,(t,n)=>{r(t)&&i.push({node:t,pos:n})}),i}(i.doc,o,t=>t.isTextblock),s,l;if(a.length>1?(s=a[0],l=i.doc.textBetween(s.pos,s.pos+s.node.nodeSize,void 0," ")):a.length&&i.doc.textBetween(o.from,o.to," "," ").endsWith(" ")&&(s=a[0],l=i.doc.textBetween(s.pos,o.to,void 0," ")),s&&l){let f=l.split(" ").filter(t=>""!==t);if(f.length<=0)return!1;let d=f[f.length-1],p=s.pos+l.lastIndexOf(d);if(!d)return!1;eco(d).filter(t=>t.isLink).filter(n=>!t.validate||t.validate(n.value)).map(t=>({...t,from:p+t.start+1,to:p+t.end+1})).forEach(n=>{u.addMark(n.from,n.to,t.type.create({href:n.href}))})}}),u.steps.length)return u}}))),this.options.openOnClick&&i.push((n={type:this.type},new YT({key:new Yk("handleClickLink"),props:{handleClick(t,r,i){var o,a,u;if(0!==i.button)return!1;let s=etY(t.state,n.type.name),c=null===(o=i.target)||void 0===o?void 0:o.closest("a"),l=null!==(a=null==c?void 0:c.href)&&void 0!==a?a:s.href,f=null!==(u=null==c?void 0:c.target)&&void 0!==u?u:s.target;return!!c&&!!l&&(window.open(l,f),!0)}}}))),this.options.linkOnPaste&&i.push((r={editor:this.editor,type:this.type},new YT({key:new Yk("handlePasteLink"),props:{handlePaste(t,n,i){let{state:o}=t,{selection:a}=o,{empty:u}=a;if(u)return!1;let s="";i.content.forEach(t=>{s+=t.textContent});let c=eco(s).find(t=>t.isLink&&t.value===s);return!!s&&!!c&&(r.editor.commands.setMark(r.type,{href:c.href}),!0)}}}))),i}}),ecs=ecu.extend({name:"hyperlink",addOptions(){var t;return{...null==(t=this.parent)?void 0:t.call(this),openOnClick:!1}}}),ecc=new eot([eiU.RichTextNodeType.hyperlink],ecs.name,ecs,{fromPrismic:t=>function(n){var r;let i={type:ecs.name,url:n.data.url,href:n.data.url,target:n.data.target};return null==(r=t.marks[ecs.name])?void 0:r.create(i)},toPrismic:t=>({url:t.attrs.href,target:t.attrs.target})}),ecl=enk.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",eeD(this.options.HTMLAttributes,t),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)}}}),ecf=enO.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:t=>!!t.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:t}){return["span",eeD(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:n})=>{let r=etJ(t,this.type);return!!Object.entries(r).some(([,t])=>!!t)||n.unsetMark(this.name)}}}}),ecd=/^(\d+)\.\s$/,ecp=enk.create({name:"orderedList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes:()=>({start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:t}){let{start:n,...r}=t;return 1===n?["ol",eeD(this.options.HTMLAttributes,r),0]:["ol",eeD(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:n})=>this.options.keepAttributes?n().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(ecl.name,this.editor.getAttributes(ecf.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=enw({find:ecd,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)&&(t=enw({find:ecd,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(ecf.name)}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1],editor:this.editor})),[t]}}),ech=ecp.extend({name:"orderedList",addAttributes:()=>({start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1}}),renderHTML({HTMLAttributes:t}){let{start:n,...r}=t;return 1===n?["ol",eeD(this.options.HTMLAttributes,r),0]:["ol",eeD(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}}}).configure({itemTypeName:"listItem"}),ecm=new eoo([eiU.RichTextNodeType.orderedList],ech.name,ech,{fromPrismic:t=>function(n){var r;let i=eob.converter.fromPrismic(t)(n);if(i)return null==(r=t.nodes[ech.name])?void 0:r.create(eum.fromPrismic(n),i)},toPrismic:t=>eoh.children.map(t,t=>eob.converter.toPrismic(t,eiU.RichTextNodeType.orderedList).filter(d.$)).flat()}),ecg=ecm,ecy=[eos,euX,ecc];function ecv(t){return[euv,euI,ecg,euB.build(t),euA,euL,euK,...ecy].filter(d.$)}let ecb=[{nodeType:eiU.RichTextNodeType.paragraph,icon:"textFields",isActive:t=>t.isActive(euv.name)&&!t.isActive(euI.name)&&!t.isActive(ecg.name),runCommands:ecS((t,n)=>t.clearNodes().setDirection(ecT(n))),shortText:"par",text:"Paragraph"},{nodeType:eiU.RichTextNodeType.heading1,icon:"looks1",isActive:t=>t.isActive(euB.name,{level:1}),runCommands:ecS((t,n)=>t.setHeading({level:1}).setDirection(ecT(n))),shortText:"h1",text:"Heading 1"},{nodeType:eiU.RichTextNodeType.heading2,icon:"looks2",isActive:t=>t.isActive(euB.name,{level:2}),runCommands:ecS((t,n)=>t.setHeading({level:2}).setDirection(ecT(n))),shortText:"h2",text:"Heading 2"},{nodeType:eiU.RichTextNodeType.heading3,icon:"looks3",isActive:t=>t.isActive(euB.name,{level:3}),runCommands:ecS((t,n)=>t.setHeading({level:3}).setDirection(ecT(n))),shortText:"h3",text:"Heading 3"},{nodeType:eiU.RichTextNodeType.heading4,icon:"looks4",isActive:t=>t.isActive(euB.name,{level:4}),runCommands:ecS((t,n)=>t.setHeading({level:4}).setDirection(ecT(n))),shortText:"h4",text:"Heading 4"},{nodeType:eiU.RichTextNodeType.heading5,icon:"looks5",isActive:t=>t.isActive(euB.name,{level:5}),runCommands:ecS((t,n)=>t.setHeading({level:5}).setDirection(ecT(n))),shortText:"h5",text:"Heading 5"},{nodeType:eiU.RichTextNodeType.heading6,icon:"looks6",isActive:t=>t.isActive(euB.name,{level:6}),runCommands:ecS((t,n)=>t.setHeading({level:6}).setDirection(ecT(n))),shortText:"h6",text:"Heading 6"},{nodeType:eiU.RichTextNodeType.list,icon:"formatListBulleted",isActive:t=>t.isActive(euI.name),runCommands:ecS((t,n)=>t.toggleBulletList().setDirection(ecT(n))),shortText:"bull",text:"Bulleted list"},{nodeType:eiU.RichTextNodeType.orderedList,icon:"formatListNumbered",isActive:t=>t.isActive(ecg.name),runCommands:ecS((t,n)=>t.toggleOrderedList().setDirection(ecT(n))),shortText:"num",text:"Numbered list"},{nodeType:eiU.RichTextNodeType.preformatted,icon:"dataObject",isActive:t=>t.isActive(euA.name),runCommands:ecS((t,n)=>t.setCodeBlock().setDirection(ecT(n))),shortText:"code",text:"Code"},{nodeType:eiU.RichTextNodeType.embed,icon:"cloud",isActive:t=>t.isActive(euL.name),runCommands:ecS(t=>t.setEmbed()),shortText:"emb",text:"Embed"},{nodeType:eiU.RichTextNodeType.image,icon:"image",isActive:t=>t.isActive(euK.name),runCommands:ecS(t=>t.setImage()),shortText:"img",text:"Image"}],ecx=[{nodeType:eiU.RichTextNodeType.strong,icon:"formatBold",isActive:t=>t.isActive(eos.name),runCommands:ecS(t=>t.toggleBold())},{nodeType:eiU.RichTextNodeType.em,icon:"formatItalic",isActive:t=>t.isActive(euX.name),runCommands:ecS(t=>t.toggleItalic())}],ec_=[{nodeType:eiU.RichTextNodeType.rtl,icon:"formatTextDirectionRToL",isActive:t=>t.isActive({dir:eud.RightToLeft}),runCommands:ecS((t,n)=>t.toggleDirection(ecT(n)))}];function ecS(t){return(n,r={})=>{let i=!0===r.can?n.can().chain():n.chain().focus();return void 0!==r.deleteRange&&(i=i.deleteRange(r.deleteRange)),t(i,n).run()}}function ecT(t){let n=t.state.selection.$from.parent.attrs;return eum.parseNodeAttrsDirection(n)}function ecw(t,n){return t.filter(t=>n.includes(t.nodeType))}function ecO(t){let{items:n,editor:r}=t;return 0===n.length?null:M.jsxs(M.Fragment,{children:[M.jsx(l.Jf,{}),n.map(t=>M.jsx(l.r8,{disabled:!t.runCommands(r,{can:!0}),onPressedChange(){t.runCommands(r)},pressed:t.isActive(r),startIcon:t.icon},t.nodeType))]})}function eck(t){let{disabled:n,toggleLink:r,active:i}=function(t){let{editor:n,setDisplayLinkModal:r}=t,i=n.isActive(eiU.RichTextNodeType.hyperlink),o=!ecS(t=>t.setLink({href:""}))(n,{can:!0}),a=n.isActive(eiU.RichTextNodeType.hyperlink);return{disabled:o,toggleLink:function(){i||r(!0),i&&ecS(t=>t.unsetLink())(n)},active:a}}(t);return M.jsxs(M.Fragment,{children:[M.jsx(l.Jf,{}),M.jsx(l.r8,{disabled:n,startIcon:"link",onPressedChange:r,pressed:i},eiU.RichTextNodeType.hyperlink)]})}function ecI(t){let{open:n,setOpen:r,onSetUrl:i,openInNewTab:o,setOpenInNewTab:a}=t,[u,s]=(0,c.useState)(""),f=void 0!==(0,g.j)(u);function d(){i(u),s("")}return M.jsx(l.Vq,{open:n,onOpenChange:function(t){s(""),r(t)},hasClose:!1,size:"small",children:M.jsx(l.cZ,{children:M.jsxs(l.xu,{flexDirection:"column",children:[M.jsx(l.xu,{flexDirection:"column",height:"100%",padding:16,children:M.jsx(l.yt,{value:u,onValueChange:s,placeholder:"Paste URL",icon:"public",onKeyDown:function(t){"Enter"===t.key&&f&&d()}})}),u&&M.jsxs(l.xu,{flexDirection:"column",padding:{block:8},border:{top:!0},children:[M.jsx(l.UN,{onSelect:()=>a(!o),icon:o?"checkBox":"checkBoxOutlinedBlank",textContent:"Open in new tab"}),M.jsx(l.UN,{onSelect:d,icon:"link",textContent:"Link to URL",disabled:!f})]})]})})})}function ecM(t){let{items:n,editor:r}=t;return 0===n.length?null:M.jsxs(M.Fragment,{children:[M.jsx(l.Jf,{}),M.jsx(l.dV,{onValueChange(t){n.forEach(n=>{(n.isActive(r)&&!t.includes(n.nodeType)||!n.isActive(r)&&t.includes(n.nodeType))&&n.runCommands(r)})},type:"multiple",value:n.filter(t=>t.isActive(r)).map(t=>t.nodeType),children:n.map(t=>M.jsx(l.nG,{disabled:!t.runCommands(r,{can:!0}),startIcon:t.icon,value:t.nodeType},t.nodeType))},"mark")]})}function ecC(t){var n;let{items:r,editor:i}=t;return 0===r.length?null:M.jsx(l.vT,{onValueChange(t){var n;null==(n=r.find(n=>n.nodeType===t))||n.runCommands(i)},value:(null==(n=r.find(t=>t.isActive(i)))?void 0:n.nodeType)??"",children:r.map(t=>M.jsx(l.kT,{value:t.nodeType,children:t.text},t.nodeType))},"node")}let ecR={duration:100,hideOnClick:!0,offset:[-48,parseFloat(l.TV.space[8])],placement:"top-start",zIndex:parseFloat(l.TV.zIndex.toolbar)};function ecE(t){let{editor:n,nodeTypes:r}=t,{env:i}=i7(),o=r.includes("hyperlink")&&"prod"!==i,{modalOpen:a,setModalOpen:u,openInNewTab:s,setOpenInNewTab:l,onSetUrl:f}=function(t){let{editor:n}=t,[r,i]=(0,c.useState)(!1),[o,a]=(0,c.useState)(!1);return{modalOpen:r,setModalOpen:i,openInNewTab:o,setOpenInNewTab:a,onSetUrl:function(t){let r=o?"_blank":"_self";ecS(n=>n.setLink({href:t,target:r}))(n),i(!1)}}}({editor:n});return M.jsxs(eiC,{editor:n,tippyOptions:ecR,children:[!a&&M.jsx(ecA,{...t,setWebLinkModalOpen:u}),o&&M.jsx(ecI,{open:a,setOpen:u,onSetUrl:f,openInNewTab:s,setOpenInNewTab:l})]})}function ecA(t){let{editor:n,nodeTypes:r,setWebLinkModalOpen:i}=t,{env:o}=i7(),a=r.includes("hyperlink")&&"prod"!==o,u=ecw(ecb,r),s=ecw(ecx,r),c=ecw(ec_,r),f=u.length+s.length+c.length+Number(a);return 0===f?null:M.jsxs(l.o8,{children:[M.jsx(ecC,{items:u,editor:n}),M.jsx(ecM,{items:s,editor:n}),a&&M.jsx(eck,{editor:n,setDisplayLinkModal:i}),M.jsx(ecO,{items:c,editor:n}),f>1&&M.jsxs(M.Fragment,{children:[M.jsx(l.Jf,{}),M.jsx(l.hA,{onClick(){n.chain().focus().clearNodes().unsetAllMarks().run()},startIcon:"formatClear"},"clear")]})]})}function ecj(t){var n,r;let{content:i,field:o,id:a,readOnly:u}=t,s=(r=o,(0,c.useMemo)(()=>{let{extensions:t,defaultTextConverter:n}=function(t){var n;if(!t||!(null!=t&&t.single)&&!(null!=t&&t.multi))return eom();let r=function(t){let n=(t.single||t.multi||"").split(/\s*,\s*/).map(t=>{let n=eiU.RichTextNodeTypeCodec.decode(t);return"Right"===n._tag?n.right:void 0}).filter(d.$);return new Set(n)}(t);if(!(null!=r&&r.size))return eom();let i=(n=r,ecv(n).filter(t=>(0,b.G)(n,n=>t.richTextNodeTypes.includes(n)))),o=function(t){let n=new Set(t);return(0,b.G)(n,eoa)&&n.add(euv),(0,b.G)(n,eor)||n.add(euv),[...n]}(i);return{extensions:o,defaultTextConverter:function(t){let n=t.find(eor)??euv;return function(t){return r=>n.converter.fromPrismic(t)({...r,type:n.richTextNodeTypes[0]})}}(o)}}(r.config),i=t.filter(ecN),o=t.flatMap(t=>t.richTextNodeTypes),a=t.map(t=>t.component),u=t.filter(ecP).map(t=>t.name),s=[...a,...function(t,n){var r,i;let o=n.map(t=>t.richTextNodeTypes).flat(),a={placeholderByNodeType:Z(n,s0(t=>t.nodeType===eoe.Text),cn({},(t,n)=>({...t,[n.name]:n.placeholder}))),unfocusedPlaceholder:null==(r=t.config)?void 0:r.placeholder,nodeExtensions:n},u=o.includes(eiU.RichTextNodeType.orderedList)||o.includes(eiU.RichTextNodeType.list);return s0(t=>void 0!==t)([eoT.component((null==(i=t.config)?void 0:i.single)===void 0),eul.component,eoM.component,eoR(a),u?eob.component:void 0,euS.configure({nodeTypes:o})])}(r,i),euh.configure({supportedExtensionNames:u}),enK],c=s.map(t=>t.name),l=function(t,n){let r=ee0.resolve(t);return eeV(r,void 0)}(s);return{allComponents:s,extensionNames:c,defaultTextConverter:n,nodeExtensions:i,names:o,schema:l}},[r])),p=i&&eoT.converter(s.nodeExtensions).fromPrismic(s.schema,null==(n=s.defaultTextConverter)?void 0:n.call(s,s.schema))(i),h=(0,f.R9)(t.onContentChange),m=function(t={},n=[]){let{onUpdate:r}=t,[i,o]=(0,c.useState)(),a=(0,c.useRef)(r),u=(0,f.NW)();return(0,c.useEffect)(()=>{i&&r&&(i.off("update",a.current),i.on("update",r),a.current=r)},[r,i]),(0,c.useLayoutEffect)(()=>{let n=!0,r=new eiR(t);return o(r),r.on("transaction",()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{n&&u()})})}),()=>{n=!1}},n),(0,c.useEffect)(()=>()=>null==i?void 0:i.destroy(),[i]),i}({content:null==p?void 0:p.toJSON(),editable:!u,editorProps:{attributes:{class:l.rk,id:a,tabIndex:"0"}},extensions:s.allComponents,injectCSS:!1,onUpdate({editor:t}){if(t.isEmpty)return h(void 0);let n=eoT.converter(s.nodeExtensions).toPrismic(t.state.doc);h(n)}},[s,u]);return M.jsxs(l.gN,{children:[M.jsx(l.Qy,{htmlFor:a,children:KR(o)}),M.jsxs(l.JO,{children:[M.jsx(eij,{editor:m??null,style:{flex:1}}),(null==m?void 0:m.isEditable)&&M.jsx(ecE,{editor:m,nodeTypes:s.names.concat(eup)})]})]})}function ecN(t){return t.extType===ei7.Node}function ecP(t){return!(t.extType!==ei7.Node||t.nodeType!==eoe.Text||t.lockedFormat)}function ecL(t){var n,r,i,o,a;let{content:u,field:s,id:c,onContentChange:f,readOnly:d}=t,p=KE(s),h=(i=s,(null==(o=i.config)?void 0:o.default_value)===void 0||null==(a=i.config.options)?void 0:a[0]),m=(null==u?void 0:u.value)??h;return M.jsxs(l.gN,{children:[M.jsx(l.fw,{name:"arrowDropDownCircle"}),M.jsx(l.Qy,{htmlFor:c,children:KR(s)}),M.jsx(l.JO,{children:M.jsxs(l.Ph,{id:c,size:"large",endIcon:"unfoldMore",variant:"secondary",placeholder:p,value:m,onValueChange(t){var n;d||f((n=t,0===n.length?void 0:{__TYPE__:"FieldContent",type:"Select",value:n}))},children:[void 0===m||void 0!==h?null:M.jsx(l.Ql,{value:"",children:p}),null==(r=null==(n=s.config)?void 0:n.options)?void 0:r.map(t=>M.jsx(l.Ql,{value:t,children:t},t))]})})]},m)}function ecF(t){let{id:n,readOnly:r,field:i,content:o,onContentChange:a}=t;return M.jsxs(l.gN,{children:[M.jsx(l.fw,{name:"event"}),M.jsx(l.Qy,{id:n,children:KR(i)}),M.jsx(l.JO,{children:M.jsx(l.xu,{padding:{left:4,right:12},width:"100%",flexDirection:"column",justifyContent:"center",children:M.jsx(l.Wr,{mode:"date-time","aria-labelledby":n,readOnly:r,value:null==o?void 0:o.value,onValueChange:t=>a(ecD(t))})})})]})}let ecD=t=>void 0===t?void 0:{__TYPE__:"FieldContent",type:"Timestamp",value:t};function ecW(t){let{id:n,readOnly:r,content:i,nestableWidget:o}=t,a=(0,f.R9)(t.onContentChange);return(0,c.useMemo)(()=>{let t={id:n,readOnly:r,onContentChange:a};return"Boolean"===o.type?M.jsx(KA,{...t,field:o,content:oj.isBooleanContent(i)?i:void 0}):"Date"===o.type?M.jsx(KN,{...t,field:o,content:oj.isDateContent(i)?i:void 0}):"Timestamp"===o.type?M.jsx(ecF,{...t,field:o,content:oj.isTimestampContent(i)?i:void 0}):"Image"===o.type?M.jsx(Gd,{...t,field:o,content:oj.isImageContent(i)?i:void 0}):"Link"===o.type?M.jsx(GN,{...t,field:o,content:oj.isLinkContent(i)?i:void 0}):"Number"===o.type?M.jsx(GW,{...t,field:o,content:oj.isNumberContent(i)?i:void 0}):"StructuredText"===o.type?M.jsx(ecj,{...t,field:o,content:oj.isRichTextContent(i)?i:void 0}):"Select"===o.type?M.jsx(ecL,{...t,field:o,content:oj.isSelectContent(i)?i:void 0}):"Text"===o.type?M.jsx(Gh,{...t,field:o,content:oj.isTextContent(i)?i:void 0}):"Embed"===o.type?M.jsx(ZO,{...t,field:o,content:oj.isEmbedContent(i)?i:void 0}):"Color"===o.type?M.jsx(Kj,{...t,field:o,content:oj.isColorContent(i)?i:void 0}):"GeoPoint"===o.type?M.jsx(ZR,{...t,field:o,content:oj.isGeoPointContent(i)?i:void 0}):null},[i,n,o,a,r])}let ecU=({content:t,id:n,nonRepeatableZone:r,onContentChange:i,readOnly:o})=>{let a=(0,c.useMemo)(()=>Object.entries(r),[r]);return M.jsx(M.Fragment,{children:a.map(([r,a])=>{let u=t[r];return M.jsx(ecW,{id:`${n}.${r}`,readOnly:o,nestableWidget:a,content:oj.isNestableContent(u)?u:void 0,onContentChange(n){var o,a,u;i((o=t,a=r,u=n,void 0===u?rU(a)(o):{...o,[a]:u}))}},r)})})};function ecz(t){let{id:n,title:r,content:i,onContentChange:o,readOnly:a,repeatableZone:u}=t,s=(0,c.useMemo)(()=>Object.entries(u),[u]),f=i??[ecB],d=(0,c.useRef)(new Map);function p(t){return d.current.get(t)??"!bugged!"}function h(t){let{index:n,offset:r}=t;o((0,x.pB)(f,n,n+r))}function m(t){let{index:n}=t;o((0,x.$E)(f,n))}return!function(t,n){let r=new Set(n);n.forEach(n=>{t.has(n)||t.set(n,(0,_.d)())}),(0,c.useLayoutEffect)(()=>{for(let[n]of t)r.has(n)||t.delete(n)})}(d.current,f),0===Object.keys(u).length?null:M.jsx(l.ZA,{title:"Repeatable zone"+(r?` • ${r}`:""),addItemButtonTitle:"Add item in group",items:f,getItemKey:p,onAddItem:function(){o(f.concat(ecq()))},children(t,r){let i=new Map(t.value),u=p(t);return M.jsx(l.MN,{index:r,title:"Item",onMove:h,onDelete:m,children:s.map(([s,c])=>{let l=i.get(s),p=oj.isNestableContent(l)?l:void 0;return M.jsx(ecW,{id:`${n}[${u}].${s}`,content:p,nestableWidget:c,onContentChange:n=>(function(t,n,r,i){let a=function(t,n){let[r,i]=n;if(!i){let o=t.value.filter(([t])=>t!==r);return ecq(o)}let a=Array.from(new Map(t.value).set(r,i));return ecq(a)}(t,[r,i]),u=function(t,n){let[r,i]=n;return i?t.map((t,n)=>n===r?i:t):t.filter((t,n)=>n!==r)}(f,[n,a]);(function(t,n,r){let i=t.get(n);void 0!==i&&t.set(r,i)})(d.current,t,a),o(u)})(t,r,s,n),readOnly:a},s)})})}})}let ecB={__TYPE__:"GroupItemContent",value:[]};function ecq(t=[]){return{__TYPE__:"GroupItemContent",value:t}}function ecV(t){var n,r,i,o;let{config:a,content:u,sliceKey:s,selected:f=!1,readOnly:d=!1,sharedSlice:p,onContentChange:h,...m}=t,g=(n=p,r=u.variation,(0,c.useMemo)(()=>n.variations.find(t=>t.id===r),[n,r])),y=(0,c.useId)();if(void 0===g)return null;let v={id:m.id??y,readOnly:d};return M.jsx(i8.Provider,{value:a,children:M.jsxs(l.C3,{id:s,selected:f,children:[M.jsx(l.ax,{children:(i=p,o=g,[i.name,o.name].join(" • "))}),M.jsx(ecU,{...v,nonRepeatableZone:g.primary??{},content:u.primary,onContentChange(t){h({...u,primary:t})}}),M.jsx(ecz,{...v,repeatableZone:g.items??{},content:u.items,onContentChange(t){h({...u,items:t})}})]})})}}}]);
101
+ 3. "-" cannot repeat`);ecu.customSchemes.push([t,n])}function ecc(t){return ecu.initialized||function(){ecu.scanner=function(t){void 0===t&&(t=[]);let n={};esa.groups=n;let r=new esa;null==es1&&(es1=es4("aaa1rp3barth4b0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0faromeo7ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re2s2c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y0eats7k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking0channel11l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t0isalat7u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0at2delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d0network8tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntdoor4ier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5gtv3iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0eles2s3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1nder2le4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster5ia3d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4de2k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0cys3drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7serati6ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic3tual5v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rthwesternmutual14on4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3ssagens7y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cher3ks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w0time7i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ffany5ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0channel7ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5m\xf6gensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lkswagen7vo3te1ing3o2yage5u0elos6wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2")),null==es2&&(es2=es4("ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5تصالات6رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2")),esl(r,"'",esk),esl(r,"{",esy),esl(r,"[",esv),esl(r,"<",esb),esl(r,"(",esx),esl(r,"}",es_),esl(r,"]",esS),esl(r,">",esT),esl(r,")",esw),esl(r,"&",esO),esl(r,"*",esI),esl(r,"@","AT"),esl(r,"`",esC),esl(r,"^",esR),esl(r,":",esE),esl(r,",",esA),esl(r,"$",esj),esl(r,".","DOT"),esl(r,"=",esN),esl(r,"!",esP),esl(r,"-",esL),esl(r,"%",esF),esl(r,"|",esD),esl(r,"+",esW),esl(r,"#",esU),esl(r,"?",esz),esl(r,'"',esB),esl(r,"/",esV),esl(r,";",esq),esl(r,"~",es$),esl(r,"_",esK),esl(r,"\\",esM);let i=ess(r,esQ,"NUM",{[eu6]:!0});ess(i,esQ,i);let o=ess(r,esG,esf,{[eu9]:!0});ess(o,esG,o);let a=ess(r,esJ,esd,{[eu8]:!0});ess(a,esG),ess(a,esJ,a);let u=ess(r,esX,"WS",{[esr]:!0});esl(r,es0,"NL",{[esr]:!0}),esl(u,es0),ess(u,esX,u);let s=ess(r,esY,esH,{[esn]:!0});ess(s,esY,s),esl(s,"️",s);let c=esl(s,"‍");ess(c,esY,s);let l=[[esG,o]],f=[[esG,null],[esJ,a]];for(let d=0;d<es1.length;d++)es3(r,es1[d],"TLD",esf,l);for(let p=0;p<es2.length;p++)es3(r,es2[p],esh,esd,f);eso("TLD",{tld:!0,ascii:!0},n),eso(esh,{utld:!0,alpha:!0},n),es3(r,"file",esm,esf,l),es3(r,"mailto",esm,esf,l),es3(r,"http",esg,esf,l),es3(r,"https",esg,esf,l),es3(r,"ftp",esg,esf,l),es3(r,"ftps",esg,esf,l),eso(esm,{scheme:!0,ascii:!0},n),eso(esg,{slashscheme:!0,ascii:!0},n),t=t.sort((t,n)=>t[0]>n[0]?1:-1);for(let h=0;h<t.length;h++){let m=t[h][0],g=t[h][1]?{scheme:!0}:{slashscheme:!0};m.indexOf("-")>=0?g[est]=!0:esG.test(m)?esQ.test(m)?g[eu7]=!0:g[eu9]=!0:g[eu6]=!0,esc(r,m,m,g)}return esc(r,"localhost",esp,{ascii:!0}),r.jd=new esa("SYM"),{start:r,tokens:eu5({groups:n},esZ)}}(ecu.customSchemes);for(let t=0;t<ecu.tokenQueue.length;t++)ecu.tokenQueue[t][1]({scanner:ecu.scanner});ecu.parser=function(t){let{groups:n}=t,r=n.domain.concat([esO,esI,"AT",esM,esC,esR,esj,esN,esL,"NUM",esF,esD,esW,esU,esV,"SYM",es$,esK]),i=[esk,esT,es_,esS,esw,esE,esA,"DOT",esP,esb,esy,esv,esx,esz,esB,esq],o=[esO,esk,esI,esM,esC,esR,es_,esj,esN,esL,esy,esF,esD,esW,esU,esz,esV,"SYM",es$,esK],a=eci(),u=esl(a,es$);esu(u,o,u),esu(u,n.domain,u);let s=eci(),c=eci(),l=eci();esu(a,n.domain,s),esu(a,n.scheme,c),esu(a,n.slashscheme,l),esu(s,o,u),esu(s,n.domain,s);let f=esl(s,"AT");esl(u,"AT",f),esl(c,"AT",f),esl(l,"AT",f);let d=esl(u,"DOT");esu(d,o,u),esu(d,n.domain,u);let p=eci();esu(f,n.domain,p),esu(p,n.domain,p);let h=esl(p,"DOT");esu(h,n.domain,p);let m=eci(ece);esu(h,n.tld,m),esu(h,n.utld,m),esl(f,esp,m);let g=esl(p,esL);esu(g,n.domain,p),esu(m,n.domain,p),esl(m,"DOT",h),esl(m,esL,g);let y=esl(m,esE);esu(y,n.numeric,ece);let v=esl(s,esL),b=esl(s,"DOT");esu(v,n.domain,s),esu(b,o,u),esu(b,n.domain,s);let x=eci(ecr);esu(b,n.tld,x),esu(b,n.utld,x),esu(x,n.domain,s),esu(x,o,u),esl(x,"DOT",b),esl(x,esL,v),esl(x,"AT",f);let _=esl(x,esE),S=eci(ecr);esu(_,n.numeric,S);let T=eci(ecr),w=eci();esu(T,r,T),esu(T,i,w),esu(w,r,T),esu(w,i,w),esl(x,esV,T),esl(S,esV,T);let O=esl(c,esE),k=esl(l,esE),I=esl(k,esV),M=esl(I,esV);esu(c,n.domain,s),esl(c,"DOT",b),esl(c,esL,v),esu(l,n.domain,s),esl(l,"DOT",b),esl(l,esL,v),esu(O,n.domain,T),esl(O,esV,T),esu(M,n.domain,T),esu(M,r,T),esl(M,esV,T);let C=esl(T,esy),R=esl(T,esv),E=esl(T,esb),A=esl(T,esx);esl(w,esy,C),esl(w,esv,R),esl(w,esb,E),esl(w,esx,A),esl(C,es_,T),esl(R,esS,T),esl(E,esT,T),esl(A,esw,T),esl(C,es_,T);let j=eci(ecr),N=eci(ecr),P=eci(ecr),L=eci(ecr);esu(C,r,j),esu(R,r,N),esu(E,r,P),esu(A,r,L);let F=eci(),D=eci(),W=eci(),U=eci();return esu(C,i),esu(R,i),esu(E,i),esu(A,i),esu(j,r,j),esu(N,r,N),esu(P,r,P),esu(L,r,L),esu(j,i,j),esu(N,i,N),esu(P,i,P),esu(L,i,L),esu(F,r,F),esu(D,r,N),esu(W,r,P),esu(U,r,L),esu(F,i,F),esu(D,i,D),esu(W,i,W),esu(U,i,U),esl(N,esS,T),esl(P,esT,T),esl(L,esw,T),esl(j,es_,T),esl(D,esS,T),esl(W,esT,T),esl(U,esw,T),esl(F,esw,T),esl(a,esp,x),esl(a,"NL",ecn),{start:a,tokens:esZ}}(ecu.scanner.tokens);for(let n=0;n<ecu.pluginQueue.length;n++)ecu.pluginQueue[n][1]({scanner:ecu.scanner,parser:ecu.parser});ecu.initialized=!0}(),function(t,n,r){let i=r.length,o=0,a=[],u=[];for(;o<i;){let s=t,c=null,l=null,f=0,d=null,p=-1;for(;o<i&&!(c=s.go(r[o].t));)u.push(r[o++]);for(;o<i&&(l=c||s.go(r[o].t));)c=null,(s=l).accepts()?(p=0,d=s):p>=0&&p++,o++,f++;if(p<0)(o-=f)<i&&(u.push(r[o]),o++);else{u.length>0&&(a.push(eco(ect,n,u)),u=[]),o-=p,f-=p;let h=d.t,m=r.slice(o-f,o);a.push(eco(h,n,m))}}return u.length>0&&a.push(eco(ect,n,u)),a}(ecu.parser.start,t,function(t,n){let r=function(t){let n=[],r=t.length,i=0;for(;i<r;){let o=t.charCodeAt(i),a,u=o<55296||o>56319||i+1===r||(a=t.charCodeAt(i+1))<56320||a>57343?t[i]:t.slice(i,i+2);n.push(u),i+=u.length}return n}(n.replace(/[A-Z]/g,t=>t.toLowerCase())),i=r.length,o=[],a=0,u=0;for(;u<i;){let s=t,c=null,l=0,f=null,d=-1,p=-1;for(;u<i&&(c=s.go(r[u]));)(s=c).accepts()?(d=0,p=0,f=s):d>=0&&(d+=r[u].length,p++),l+=r[u].length,a+=r[u].length,u++;a-=d,u-=p,l-=d,o.push({t:f.t,v:n.slice(a-l,a),s:a-l,e:a})}return o}(ecu.scanner.start,t))}function ecl(t,n,r){if(void 0===n&&(n=null),void 0===r&&(r=null),n&&"object"==typeof n){if(r)throw Error(`linkifyjs: Invalid link type ${n}; must be a string`);r=n,n=null}let i=new es6(r),o=ecc(t),a=[];for(let u=0;u<o.length;u++){let s=o[u];s.isLink&&(!n||s.t===n)&&a.push(s.toFormattedObject(i))}return a}function ecf(t,n){void 0===n&&(n=null);let r=ecc(t);return 1===r.length&&r[0].isLink&&(!n||r[0].t===n)}let ecd=enR.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate(){this.options.protocols.forEach(t=>{if("string"==typeof t){ecs(t);return}ecs(t.scheme,t.optionalSlashes)})},onDestroy(){esa.groups={},ecu.scanner=null,ecu.parser=null,ecu.tokenQueue=[],ecu.pluginQueue=[],ecu.customSchemes=[],ecu.initialized=!1},inclusive(){return this.options.autolink},addOptions:()=>({openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:void 0}),addAttributes(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target},class:{default:this.options.HTMLAttributes.class}}},parseHTML:()=>[{tag:'a[href]:not([href *= "javascript:" i])'}],renderHTML({HTMLAttributes:t}){return["a",eeq(this.options.HTMLAttributes,t),0]},addCommands(){return{setLink:t=>({chain:n})=>n().setMark(this.name,t).setMeta("preventAutolink",!0).run(),toggleLink:t=>({chain:n})=>n().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[enj({find:t=>ecl(t).filter(t=>!this.options.validate||this.options.validate(t.value)).filter(t=>t.isLink).map(t=>({text:t.value,index:t.start,data:t})),type:this.type,getAttributes(t){var n;return{href:null===(n=t.data)||void 0===n?void 0:n.href}}})]},addProseMirrorPlugins(){var t,n,r;let i=[];return this.options.autolink&&i.push((t={type:this.type,validate:this.options.validate},new YM({key:new YE("autolink"),appendTransaction(n,r,i){let o=n.some(t=>t.docChanged)&&!r.doc.eq(i.doc),a=n.some(t=>t.getMeta("preventAutolink"));if(!o||a)return;let{tr:u}=i,s=function(t,n){let r=new Ys(t);return n.forEach(t=>{t.steps.forEach(t=>{r.step(t)})}),r}(r.doc,[...n]),{mapping:c}=s;if((function(t){let{mapping:n,steps:r}=t,i=[];return n.maps.forEach((t,o)=>{let a=[];if(t.ranges.length)t.forEach((t,n)=>{a.push({from:t,to:n})});else{let{from:u,to:s}=r[o];if(void 0===u||void 0===s)return;a.push({from:u,to:s})}a.forEach(({from:t,to:r})=>{let a=n.slice(o).map(t,-1),u=n.slice(o).map(r),s=n.invert().map(a,-1),c=n.invert().map(u);i.push({oldRange:{from:s,to:c},newRange:{from:a,to:u}})})}),function(t){let n=function(t,n=JSON.stringify){let r={};return t.filter(t=>{let i=n(t);return!Object.prototype.hasOwnProperty.call(r,i)&&(r[i]=!0)})}(t);return 1===n.length?n:n.filter((t,r)=>!n.filter((t,n)=>n!==r).some(n=>t.oldRange.from>=n.oldRange.from&&t.oldRange.to<=n.oldRange.to&&t.newRange.from>=n.newRange.from&&t.newRange.to<=n.newRange.to))}(i)})(s).forEach(({oldRange:n,newRange:o})=>{et3(n.from,n.to,r.doc).filter(n=>n.mark.type===t.type).forEach(n=>{let o=c.map(n.from),a=c.map(n.to),s=et3(o,a,i.doc).filter(n=>n.mark.type===t.type);if(!s.length)return;let l=s[0],f=r.doc.textBetween(n.from,n.to,void 0," "),d=i.doc.textBetween(l.from,l.to,void 0," "),p=ecf(f),h=ecf(d);p&&!h&&u.removeMark(l.from,l.to,t.type)});let a=function(t,n,r){let i=[];return t.nodesBetween(n.from,n.to,(t,n)=>{r(t)&&i.push({node:t,pos:n})}),i}(i.doc,o,t=>t.isTextblock),s,l;if(a.length>1?(s=a[0],l=i.doc.textBetween(s.pos,s.pos+s.node.nodeSize,void 0," ")):a.length&&i.doc.textBetween(o.from,o.to," "," ").endsWith(" ")&&(s=a[0],l=i.doc.textBetween(s.pos,o.to,void 0," ")),s&&l){let f=l.split(" ").filter(t=>""!==t);if(f.length<=0)return!1;let d=f[f.length-1],p=s.pos+l.lastIndexOf(d);if(!d)return!1;ecl(d).filter(t=>t.isLink).filter(n=>!t.validate||t.validate(n.value)).map(t=>({...t,from:p+t.start+1,to:p+t.end+1})).forEach(n=>{u.addMark(n.from,n.to,t.type.create({href:n.href}))})}}),u.steps.length)return u}}))),this.options.openOnClick&&i.push((n={type:this.type},new YM({key:new YE("handleClickLink"),props:{handleClick(t,r,i){var o,a,u;if(0!==i.button)return!1;let s=et2(t.state,n.type.name),c=null===(o=i.target)||void 0===o?void 0:o.closest("a"),l=null!==(a=null==c?void 0:c.href)&&void 0!==a?a:s.href,f=null!==(u=null==c?void 0:c.target)&&void 0!==u?u:s.target;return!!c&&!!l&&(window.open(l,f),!0)}}}))),this.options.linkOnPaste&&i.push((r={editor:this.editor,type:this.type},new YM({key:new YE("handlePasteLink"),props:{handlePaste(t,n,i){let{state:o}=t,{selection:a}=o,{empty:u}=a;if(u)return!1;let s="";i.content.forEach(t=>{s+=t.textContent});let c=ecl(s).find(t=>t.isLink&&t.value===s);return!!s&&!!c&&(r.editor.commands.setMark(r.type,{href:c.href}),!0)}}}))),i}}),ecp=ecd.extend({name:"hyperlink",addOptions(){var t;return{...null==(t=this.parent)?void 0:t.call(this),openOnClick:!1}}}),ech=new eoa([ei$.RichTextNodeType.hyperlink],ecp.name,ecp,{fromPrismic:t=>function(n){var r;let i={type:ecp.name,url:n.data.url,href:n.data.url,target:n.data.target};return null==(r=t.marks[ecp.name])?void 0:r.create(i)},toPrismic:t=>({url:t.attrs.href,target:t.attrs.target})}),ecm=enE.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",eeq(this.options.HTMLAttributes,t),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)}}}),ecg=enR.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:t=>!!t.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:t}){return["span",eeq(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:n})=>{let r=et1(t,this.type);return!!Object.entries(r).some(([,t])=>!!t)||n.unsetMark(this.name)}}}}),ecy=/^(\d+)\.\s$/,ecv=enE.create({name:"orderedList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes:()=>({start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:t}){let{start:n,...r}=t;return 1===n?["ol",eeq(this.options.HTMLAttributes,r),0]:["ol",eeq(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:n})=>this.options.keepAttributes?n().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(ecm.name,this.editor.getAttributes(ecg.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=enC({find:ecy,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)&&(t=enC({find:ecy,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(ecg.name)}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1],editor:this.editor})),[t]}}),ecb=ecv.extend({name:"orderedList",addAttributes:()=>({start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1}}),renderHTML({HTMLAttributes:t}){let{start:n,...r}=t;return 1===n?["ol",eeq(this.options.HTMLAttributes,r),0]:["ol",eeq(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}}}).configure({itemTypeName:"listItem"}),ecx=new eol([ei$.RichTextNodeType.orderedList],ecb.name,ecb,{fromPrismic:t=>function(n){var r;let i=eow.converter.fromPrismic(t)(n);if(i)return null==(r=t.nodes[ecb.name])?void 0:r.create(eux.fromPrismic(n),i)},toPrismic:t=>eob.children.map(t,t=>eow.converter.toPrismic(t,ei$.RichTextNodeType.orderedList).filter(d.$)).flat()}),ec_=ecx,ecS=[eop,eu4,ech];function ecT(t){return[euT,euA,ec_,euH.build(t),euF,euz,euY,...ecS].filter(d.$)}let ecw=[{nodeType:ei$.RichTextNodeType.paragraph,icon:"textFields",isActive:t=>t.isActive(euT.name)&&!t.isActive(euA.name)&&!t.isActive(ec_.name),runCommands:ecI((t,n)=>t.clearNodes().setDirection(ecM(n))),shortText:"par",text:"Paragraph"},{nodeType:ei$.RichTextNodeType.heading1,icon:"looks1",isActive:t=>t.isActive(euH.name,{level:1}),runCommands:ecI((t,n)=>t.setHeading({level:1}).setDirection(ecM(n))),shortText:"h1",text:"Heading 1"},{nodeType:ei$.RichTextNodeType.heading2,icon:"looks2",isActive:t=>t.isActive(euH.name,{level:2}),runCommands:ecI((t,n)=>t.setHeading({level:2}).setDirection(ecM(n))),shortText:"h2",text:"Heading 2"},{nodeType:ei$.RichTextNodeType.heading3,icon:"looks3",isActive:t=>t.isActive(euH.name,{level:3}),runCommands:ecI((t,n)=>t.setHeading({level:3}).setDirection(ecM(n))),shortText:"h3",text:"Heading 3"},{nodeType:ei$.RichTextNodeType.heading4,icon:"looks4",isActive:t=>t.isActive(euH.name,{level:4}),runCommands:ecI((t,n)=>t.setHeading({level:4}).setDirection(ecM(n))),shortText:"h4",text:"Heading 4"},{nodeType:ei$.RichTextNodeType.heading5,icon:"looks5",isActive:t=>t.isActive(euH.name,{level:5}),runCommands:ecI((t,n)=>t.setHeading({level:5}).setDirection(ecM(n))),shortText:"h5",text:"Heading 5"},{nodeType:ei$.RichTextNodeType.heading6,icon:"looks6",isActive:t=>t.isActive(euH.name,{level:6}),runCommands:ecI((t,n)=>t.setHeading({level:6}).setDirection(ecM(n))),shortText:"h6",text:"Heading 6"},{nodeType:ei$.RichTextNodeType.list,icon:"formatListBulleted",isActive:t=>t.isActive(euA.name),runCommands:ecI((t,n)=>t.toggleBulletList().setDirection(ecM(n))),shortText:"bull",text:"Bulleted list"},{nodeType:ei$.RichTextNodeType.orderedList,icon:"formatListNumbered",isActive:t=>t.isActive(ec_.name),runCommands:ecI((t,n)=>t.toggleOrderedList().setDirection(ecM(n))),shortText:"num",text:"Numbered list"},{nodeType:ei$.RichTextNodeType.preformatted,icon:"dataObject",isActive:t=>t.isActive(euF.name),runCommands:ecI((t,n)=>t.setCodeBlock().setDirection(ecM(n))),shortText:"code",text:"Code"},{nodeType:ei$.RichTextNodeType.embed,icon:"cloud",isActive:t=>t.isActive(euz.name),runCommands:ecI(t=>t.setEmbed()),shortText:"emb",text:"Embed"},{nodeType:ei$.RichTextNodeType.image,icon:"image",isActive:t=>t.isActive(euY.name),runCommands:ecI(t=>t.setImage()),shortText:"img",text:"Image"}],ecO=[{nodeType:ei$.RichTextNodeType.strong,icon:"formatBold",isActive:t=>t.isActive(eop.name),runCommands:ecI(t=>t.toggleBold())},{nodeType:ei$.RichTextNodeType.em,icon:"formatItalic",isActive:t=>t.isActive(eu4.name),runCommands:ecI(t=>t.toggleItalic())}],eck=[{nodeType:ei$.RichTextNodeType.rtl,icon:"formatTextDirectionRToL",isActive:t=>t.isActive({dir:euy.RightToLeft}),runCommands:ecI((t,n)=>t.toggleDirection(ecM(n)))}];function ecI(t){return(n,r={})=>{let i=!0===r.can?n.can().chain():n.chain().focus();return void 0!==r.deleteRange&&(i=i.deleteRange(r.deleteRange)),t(i,n).run()}}function ecM(t){let n=t.state.selection.$from.parent.attrs;return eux.parseNodeAttrsDirection(n)}function ecC(t,n){return t.filter(t=>n.includes(t.nodeType))}function ecR(t){let{items:n,editor:r}=t;return 0===n.length?null:M.jsxs(M.Fragment,{children:[M.jsx(l.Jf,{}),n.map(t=>M.jsx(l.r8,{disabled:!t.runCommands(r,{can:!0}),onPressedChange(){t.runCommands(r)},pressed:t.isActive(r),startIcon:t.icon},t.nodeType))]})}function ecE(t){let{bubbleMenuContainerRef:n}=t,{disabled:r,toggleLink:i}=function(t){let{editor:n,setDisplayLinkModal:r}=t;return{disabled:!ecI(t=>t.setLink({href:""}))(n,{can:!0}),toggleLink:function(){r(!0)}}}(t);return M.jsxs(M.Fragment,{children:[M.jsx(l.Jf,{}),M.jsxs(l.yM,{density:"compact",children:[M.jsx(l.hA,{disabled:r,startIcon:"link",onClick:i},ei$.RichTextNodeType.hyperlink),M.jsxs(l.h_,{children:[M.jsx(l.$F,{children:M.jsx(l.hA,{startIcon:"arrowDropDown"})}),M.jsx(l.AW,{align:"end",containerRef:n,children:M.jsx(l.Xi,{startIcon:M.jsx(l.I5,{name:"public"}),onSelect:i,children:"Link to web page"})})]})]})]})}function ecA(t){let{editor:n,onEdit:r}=t,i=function(t){let n=t.getAttributes(ei$.RichTextNodeType.hyperlink);return n.href?n.href:void 0}(n)??"";return M.jsx(l.oZ,{url:i,title:function(t){let n=(0,g.j)(t);if(n)return(0,g.S)(n||"")}(i)??"",subTitle:i.toString(),onEdit:r,onUnlink(){var t;return t=n,void ecI(t=>t.unsetLink())(t)}})}function ecj(t){let{open:n}=t,{url:r,setUrl:i,onOpenChange:o,onKeyDown:a,openInNewTab:u,setOpenInNewTab:s,onSetUrl:f,selectionUrl:d,selectionUrlTitle:p}=function(t){var n;let{editor:r,setOpen:i}=t,[o,a]=(0,c.useState)(""),[u,s]=(0,c.useState)(!1),l=function(t){let n=t.getAttributes(ei$.RichTextNodeType.hyperlink);return n.href?n.href:void 0}(r),f=(n=r,"_blank"===n.getAttributes(ei$.RichTextNodeType.hyperlink).target);(0,c.useEffect)(()=>{a(l??"")},[l]),(0,c.useEffect)(()=>{s(f??!1)},[f]);let d=l?(0,g.j)(l):void 0,p=d?(0,g.S)(d):"";function h(t){let n=u?"_blank":"_self";ecI(r=>r.extendMarkRange(ei$.RichTextNodeType.hyperlink).setLink({href:t,target:n}))(r),i(!1)}return{url:o,setUrl:a,onSetUrl:h,selectionUrl:l,selectionUrlTitle:p,openInNewTab:u,selectionOpenInNewTab:f,setOpenInNewTab:s,onKeyDown:function(t){"Enter"===t.key&&h(o)},onOpenChange:function(t){a(""),s(!1),i(t)}}}(t);return M.jsx(l.Vq,{open:n,onOpenChange:o,hasClose:!1,size:"small",children:M.jsx(l.cZ,{children:M.jsxs(l.xu,{flexDirection:"column",children:[M.jsxs(l.xu,{flexDirection:"column",height:"100%",padding:16,gap:4,children:[M.jsx(l.yt,{value:r,onValueChange:i,placeholder:"Paste URL",icon:"public",onKeyDown:a}),d&&M.jsxs(l.xu,{flexDirection:"column",padding:{top:8},gap:4,children:[M.jsx(l.xv,{variant:"smallBold",color:"grey11",children:"Linked to"}),M.jsxs(l.xu,{backgroundColor:"grey4",borderRadius:6,padding:8,alignItems:"center",gap:8,children:[M.jsx(l.pI,{largeIconName:"public",smallIconName:"link"}),M.jsxs(l.xu,{flexDirection:"column",children:[M.jsx(l.xv,{variant:"bold",color:"grey12",children:p}),M.jsx(l.xv,{color:"grey11",variant:"small",children:"Web page"})]})]})]})]}),r&&M.jsxs(l.xu,{flexDirection:"column",padding:{block:8},border:{top:!0},children:[M.jsx(l.UN,{onSelect:()=>s(!u),icon:u?"checkBox":"checkBoxOutlinedBlank",textContent:"Open in new tab"}),M.jsx(l.UN,{onSelect:()=>f(r),icon:"link",textContent:"Link to URL"})]})]})})})}function ecN(t){let{items:n,editor:r}=t;return 0===n.length?null:M.jsxs(M.Fragment,{children:[M.jsx(l.Jf,{}),M.jsx(l.dV,{onValueChange(t){n.forEach(n=>{(n.isActive(r)&&!t.includes(n.nodeType)||!n.isActive(r)&&t.includes(n.nodeType))&&n.runCommands(r)})},type:"multiple",value:n.filter(t=>t.isActive(r)).map(t=>t.nodeType),children:n.map(t=>M.jsx(l.nG,{disabled:!t.runCommands(r,{can:!0}),startIcon:t.icon,value:t.nodeType},t.nodeType))},"mark")]})}function ecP(t){var n;let{items:r,editor:i}=t;return 0===r.length?null:M.jsx(l.vT,{onValueChange(t){var n;null==(n=r.find(n=>n.nodeType===t))||n.runCommands(i)},value:(null==(n=r.find(t=>t.isActive(i)))?void 0:n.nodeType)??"",children:r.map(t=>M.jsx(l.KG,{value:t.nodeType,children:t.text},t.nodeType))},"node")}let ecL={duration:100,hideOnClick:!0,offset:[-48,parseFloat(l.TV.space[8])],placement:"top-start",zIndex:parseFloat(l.TV.zIndex.toolbar)};function ecF(t){let{editor:n,nodeTypes:r}=t,[i,o]=(0,c.useState)(!1),a=r.includes(ei$.RichTextNodeType.hyperlink),u=!i,{shouldShowBubbleMenu:s,shouldShowLinkPopover:l}=function(t){let{editor:n}=t;return{shouldShowBubbleMenu(t){let{view:r,state:i,from:o,to:a}=t;if(!r.hasFocus())return!1;let{doc:u,selection:s}=i;return!(n.isActive(ei$.RichTextNodeType.preformatted)||s.empty||0===u.textBetween(o,a).length)},shouldShowLinkPopover(t){let{view:n,state:r,from:i,to:o}=t,a=n.state.doc.nodeAt(i),{doc:u,selection:s}=r;return!!s.empty&&!(u.textBetween(i,o).length>0)&&!!(null!=a&&a.marks.some(t=>"hyperlink"===t.type.name))}}}({editor:n}),f=(0,c.useRef)(null);return M.jsxs(M.Fragment,{children:[M.jsx(eiN,{editor:n,tippyOptions:ecL,shouldShow:s,children:M.jsx("div",{ref:f,children:u&&M.jsx(ecD,{...t,bubbleMenuContainerRef:f,setWebLinkModalOpen:o})})}),M.jsx(eiN,{editor:n,tippyOptions:ecL,children:a&&M.jsx(ecj,{open:i,setOpen:o,editor:n})}),M.jsx(eiN,{editor:n,tippyOptions:ecL,shouldShow:l,children:u&&M.jsx(ecA,{editor:n,onEdit:()=>o(!0)})})]})}function ecD(t){let{editor:n,nodeTypes:r,setWebLinkModalOpen:i,bubbleMenuContainerRef:o}=t,a=r.includes("hyperlink"),u=ecC(ecw,r),s=ecC(ecO,r),c=ecC(eck,r),f=u.length+s.length+c.length+Number(a);return 0===f?null:M.jsxs(l.o8,{children:[M.jsx(ecP,{items:u,editor:n}),M.jsx(ecN,{items:s,editor:n}),a&&M.jsx(ecE,{editor:n,bubbleMenuContainerRef:o,setDisplayLinkModal:i}),M.jsx(ecR,{items:c,editor:n}),f>1&&M.jsxs(M.Fragment,{children:[M.jsx(l.Jf,{}),M.jsx(l.hA,{onClick(){n.chain().focus().clearNodes().unsetAllMarks().run()},startIcon:"formatClear"},"clear")]})]})}function ecW(t){var n,r;let{content:i,field:o,id:a,readOnly:u}=t,s=(r=o,(0,c.useMemo)(()=>{let{extensions:t,defaultTextConverter:n}=function(t){var n;if(!t||!(null!=t&&t.single)&&!(null!=t&&t.multi))return eox();let r=function(t){let n=(t.single||t.multi||"").split(/\s*,\s*/).map(t=>{let n=ei$.RichTextNodeTypeCodec.decode(t);return"Right"===n._tag?n.right:void 0}).filter(d.$);return new Set(n)}(t);if(!(null!=r&&r.size))return eox();let i=(n=r,ecT(n).filter(t=>(0,v.G)(n,n=>t.richTextNodeTypes.includes(n)))),o=function(t){let n=new Set(t);return(0,v.G)(n,eof)&&n.add(euT),(0,v.G)(n,eos)||n.add(euT),[...n]}(i);return{extensions:o,defaultTextConverter:function(t){let n=t.find(eos)??euT;return function(t){return r=>n.converter.fromPrismic(t)({...r,type:n.richTextNodeTypes[0]})}}(o)}}(r.config),i=t.filter(ecU),o=t.flatMap(t=>t.richTextNodeTypes),a=t.map(t=>t.component),u=t.filter(ecz).map(t=>t.name),s=[...a,...function(t,n){var r,i;let o=n.map(t=>t.richTextNodeTypes).flat(),a={placeholderByNodeType:Z(n,s0(t=>t.nodeType===eoo.Text),cn({},(t,n)=>({...t,[n.name]:n.placeholder}))),unfocusedPlaceholder:null==(r=t.config)?void 0:r.placeholder,nodeExtensions:n},u=o.includes(ei$.RichTextNodeType.orderedList)||o.includes(ei$.RichTextNodeType.list);return s0(t=>void 0!==t)([eoM.component((null==(i=t.config)?void 0:i.single)===void 0),eum.component,eoj.component,eoP(a),u?eow.component:void 0,euI.configure({nodeTypes:o})])}(r,i),eub.configure({supportedExtensionNames:u}),enY],c=s.map(t=>t.name),l=function(t,n){let r=ee5.resolve(t);return eeG(r,void 0)}(s);return{allComponents:s,extensionNames:c,defaultTextConverter:n,nodeExtensions:i,names:o,schema:l}},[r])),p=i&&eoM.converter(s.nodeExtensions).fromPrismic(s.schema,null==(n=s.defaultTextConverter)?void 0:n.call(s,s.schema))(i),h=(0,f.R9)(t.onContentChange),m=function(t={},n=[]){let{onUpdate:r}=t,[i,o]=(0,c.useState)(),a=(0,c.useRef)(r),u=(0,f.NW)();return(0,c.useEffect)(()=>{i&&r&&(i.off("update",a.current),i.on("update",r),a.current=r)},[r,i]),(0,c.useLayoutEffect)(()=>{let n=!0,r=new eiP(t);return o(r),r.on("transaction",()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{n&&u()})})}),()=>{n=!1}},n),(0,c.useEffect)(()=>()=>null==i?void 0:i.destroy(),[i]),i}({content:null==p?void 0:p.toJSON(),editable:!u,editorProps:{attributes:{class:l.rk,id:a,tabIndex:"0"}},extensions:s.allComponents,injectCSS:!1,onUpdate({editor:t}){if(t.isEmpty)return h(void 0);let n=eoM.converter(s.nodeExtensions).toPrismic(t.state.doc);h(n)}},[s,u]);return M.jsxs(l.gN,{children:[M.jsx(l.Qy,{htmlFor:a,children:KR(o)}),M.jsxs(l.JO,{children:[M.jsx(eiD,{editor:m??null,style:{flex:1}}),(null==m?void 0:m.isEditable)&&M.jsx(ecF,{editor:m,nodeTypes:s.names.concat(euv)})]})]})}function ecU(t){return t.extType===eoi.Node}function ecz(t){return!(t.extType!==eoi.Node||t.nodeType!==eoo.Text||t.lockedFormat)}function ecB(t){var n,r,i,o,a;let{content:u,field:s,id:c,onContentChange:f,readOnly:d}=t,p=KE(s),h=(i=s,(null==(o=i.config)?void 0:o.default_value)===void 0||null==(a=i.config.options)?void 0:a[0]),m=(null==u?void 0:u.value)??h;return M.jsxs(l.gN,{children:[M.jsx(l.fw,{name:"arrowDropDownCircle"}),M.jsx(l.Qy,{htmlFor:c,children:KR(s)}),M.jsx(l.JO,{children:M.jsxs(l.Ph,{id:c,size:"large",endIcon:"unfoldMore",variant:"secondary",placeholder:p,value:m,onValueChange(t){var n;d||f((n=t,0===n.length?void 0:{__TYPE__:"FieldContent",type:"Select",value:n}))},children:[void 0===m||void 0!==h?null:M.jsx(l.Ql,{value:"",children:p}),null==(r=null==(n=s.config)?void 0:n.options)?void 0:r.map(t=>M.jsx(l.Ql,{value:t,children:t},t))]})})]},m)}function ecq(t){let{id:n,readOnly:r,field:i,content:o,onContentChange:a}=t;return M.jsxs(l.gN,{children:[M.jsx(l.fw,{name:"event"}),M.jsx(l.Qy,{id:n,children:KR(i)}),M.jsx(l.JO,{children:M.jsx(l.xu,{padding:{left:4,right:12},width:"100%",flexDirection:"column",justifyContent:"center",children:M.jsx(l.Wr,{mode:"date-time","aria-labelledby":n,readOnly:r,value:null==o?void 0:o.value,onValueChange:t=>a(ecV(t))})})})]})}let ecV=t=>void 0===t?void 0:{__TYPE__:"FieldContent",type:"Timestamp",value:t};function ec$(t){let{id:n,readOnly:r,content:i,nestableWidget:o}=t,a=(0,f.R9)(t.onContentChange);return(0,c.useMemo)(()=>{let t={id:n,readOnly:r,onContentChange:a};return"Boolean"===o.type?M.jsx(KA,{...t,field:o,content:oj.isBooleanContent(i)?i:void 0}):"Date"===o.type?M.jsx(KN,{...t,field:o,content:oj.isDateContent(i)?i:void 0}):"Timestamp"===o.type?M.jsx(ecq,{...t,field:o,content:oj.isTimestampContent(i)?i:void 0}):"Image"===o.type?M.jsx(Gd,{...t,field:o,content:oj.isImageContent(i)?i:void 0}):"Link"===o.type?M.jsx(GW,{...t,field:o,content:oj.isLinkContent(i)?i:void 0}):"Number"===o.type?M.jsx(GV,{...t,field:o,content:oj.isNumberContent(i)?i:void 0}):"StructuredText"===o.type?M.jsx(ecW,{...t,field:o,content:oj.isRichTextContent(i)?i:void 0}):"Select"===o.type?M.jsx(ecB,{...t,field:o,content:oj.isSelectContent(i)?i:void 0}):"Text"===o.type?M.jsx(Gh,{...t,field:o,content:oj.isTextContent(i)?i:void 0}):"Embed"===o.type?M.jsx(ZO,{...t,field:o,content:oj.isEmbedContent(i)?i:void 0}):"Color"===o.type?M.jsx(Kj,{...t,field:o,content:oj.isColorContent(i)?i:void 0}):"GeoPoint"===o.type?M.jsx(ZR,{...t,field:o,content:oj.isGeoPointContent(i)?i:void 0}):null},[i,n,o,a,r])}let ecK=({content:t,id:n,nonRepeatableZone:r,onContentChange:i,readOnly:o})=>{let a=(0,c.useMemo)(()=>Object.entries(r),[r]);return M.jsx(M.Fragment,{children:a.map(([r,a])=>{let u=t[r];return M.jsx(ec$,{id:`${n}.${r}`,readOnly:o,nestableWidget:a,content:oj.isNestableContent(u)?u:void 0,onContentChange(n){var o,a,u;i((o=t,a=r,u=n,void 0===u?rU(a)(o):{...o,[a]:u}))}},r)})})};function ecH(t){let{id:n,title:r,content:i,onContentChange:o,readOnly:a,repeatableZone:u}=t,s=(0,c.useMemo)(()=>Object.entries(u),[u]),f=i??[ecZ],d=(0,c.useRef)(new Map);function p(t){return d.current.get(t)??"!bugged!"}function h(t){let{index:n,offset:r}=t;o((0,x.pB)(f,n,n+r))}function m(t){let{index:n}=t;o((0,x.$E)(f,n))}return!function(t,n){let r=new Set(n);n.forEach(n=>{t.has(n)||t.set(n,(0,_.d)())}),(0,c.useLayoutEffect)(()=>{for(let[n]of t)r.has(n)||t.delete(n)})}(d.current,f),0===Object.keys(u).length?null:M.jsx(l.ZA,{title:"Repeatable zone"+(r?` • ${r}`:""),addItemButtonTitle:"Add item in group",items:f,getItemKey:p,onAddItem:function(){o(f.concat(ecG()))},children(t,r){let i=new Map(t.value),u=p(t);return M.jsx(l.MN,{index:r,title:"Item",onMove:h,onDelete:m,children:s.map(([s,c])=>{let l=i.get(s),p=oj.isNestableContent(l)?l:void 0;return M.jsx(ec$,{id:`${n}[${u}].${s}`,content:p,nestableWidget:c,onContentChange:n=>(function(t,n,r,i){let a=function(t,n){let[r,i]=n;if(!i){let o=t.value.filter(([t])=>t!==r);return ecG(o)}let a=Array.from(new Map(t.value).set(r,i));return ecG(a)}(t,[r,i]),u=function(t,n){let[r,i]=n;return i?t.map((t,n)=>n===r?i:t):t.filter((t,n)=>n!==r)}(f,[n,a]);(function(t,n,r){let i=t.get(n);void 0!==i&&t.set(r,i)})(d.current,t,a),o(u)})(t,r,s,n),readOnly:a},s)})})}})}let ecZ={__TYPE__:"GroupItemContent",value:[]};function ecG(t=[]){return{__TYPE__:"GroupItemContent",value:t}}function ecJ(t){var n,r,i,o;let{config:a,content:u,sliceKey:s,selected:f=!1,readOnly:d=!1,sharedSlice:p,onContentChange:h,...m}=t,g=(n=p,r=u.variation,(0,c.useMemo)(()=>n.variations.find(t=>t.id===r),[n,r])),y=(0,c.useId)();if(void 0===g)return null;let v={id:m.id??y,readOnly:d};return M.jsx(i8.Provider,{value:a,children:M.jsxs(l.C3,{id:s,selected:f,children:[M.jsx(l.ax,{children:(i=p,o=g,[i.name,o.name].join(" • "))}),M.jsx(ecK,{...v,nonRepeatableZone:g.primary??{},content:u.primary,onContentChange(t){h({...u,primary:t})}}),M.jsx(ecH,{...v,repeatableZone:g.items??{},content:u.items,onContentChange(t){h({...u,items:t})}})]})})}}}]);