slice-machine-ui 1.19.2-dev-next-release.6 → 1.19.2-dev-in-app-guide.3
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.
- package/components/Navigation/index.tsx +13 -17
- package/components/ReviewModal/ReviewForm.tsx +2 -2
- package/components/ReviewModal/ReviewModal.tsx +7 -0
- package/out/404.html +1 -1
- package/out/_next/static/chunks/{585-f3dca093db4b3792.js → 125-f0e2eb84ee39757a.js} +1 -3
- package/out/_next/static/chunks/18539003-371d86ea83e7293b.js +97 -0
- package/out/_next/static/chunks/{125-e3857af2068bbedf.js → 474-2393e400314474be.js} +2 -2
- package/out/_next/static/chunks/482-39cef3a713901788.js +1 -0
- package/out/_next/static/chunks/{550-1dafbcec5d50b384.js → 550-e72c08c598051224.js} +1 -1
- package/out/_next/static/chunks/{80-c513d12da6156fb7.js → 80-821a0b5d4ad61185.js} +1 -1
- package/out/_next/static/chunks/840-884e41a48b92e5d3.js +1 -0
- package/out/_next/static/chunks/904-55ff54caf14254dc.js +1 -0
- package/out/_next/static/chunks/958-be627006594efb21.js +1 -0
- package/out/_next/static/chunks/pages/_app-8a946d248c87dd25.js +439 -0
- package/out/_next/static/chunks/pages/{changelog-75b0bf58d1f3045d.js → changelog-fa36b9995c26e1d7.js} +1 -1
- package/out/_next/static/chunks/pages/{changes-9dcb1cdaa8b10560.js → changes-e388be4457a43c3a.js} +1 -1
- package/out/_next/static/chunks/pages/custom-types/{[customTypeId]-aa37e07c96c8f9b5.js → [customTypeId]-3a37eb3373bb8823.js} +1 -1
- package/out/_next/static/chunks/pages/index-d8e3a2c0d712904f.js +1 -0
- package/out/_next/static/chunks/pages/labs-ebce03a4e7a95a4e.js +1 -0
- package/out/_next/static/chunks/pages/page-types/{[pageTypeId]-d445f5cabeb460c0.js → [pageTypeId]-733f3890c0466a05.js} +1 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/{simulator-5e441f8b049cf91b.js → simulator-dda1f32608129e23.js} +1 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/{[variation]-c9b5ff7076d2b19b.js → [variation]-2282320bb9091898.js} +1 -1
- package/out/_next/static/chunks/pages/{slices-247c480530e98426.js → slices-22db04643850c1d8.js} +1 -1
- package/out/_next/static/css/{26b51745402a92af.css → 16b41648cd1de03b.css} +1 -1
- package/out/_next/static/css/{1fbd45881dcf43c4.css → 3e88bd24e38f18d0.css} +1 -1
- package/out/_next/static/css/{f585032018f6024b.css → 51597cd1f01c4889.css} +1 -1
- package/out/_next/static/css/{e4f4acc81f000d9c.css → 6e4843007ff41825.css} +1 -1
- package/out/_next/static/css/{22d69420bda374a7.css → 867d8d7ab4a75762.css} +1 -1
- package/out/_next/static/css/bca8066fd65eed7f.css +1 -0
- package/out/_next/static/iKwyM9kme9G-Y_a_L-e6V/_buildManifest.js +1 -0
- package/out/changelog.html +1 -1
- package/out/changes.html +1 -1
- package/out/custom-types/[customTypeId].html +1 -1
- package/out/custom-types.html +1 -1
- package/out/index.html +1 -1
- package/out/labs.html +1 -1
- package/out/page-types/[pageTypeId].html +1 -1
- package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
- package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
- package/out/slices.html +1 -1
- package/package.json +7 -7
- package/pages/_app.tsx +34 -29
- package/src/components/ContentTabs/ContentTabs.css.ts +1 -1
- package/src/components/Counter/Counter.css.ts +25 -0
- package/src/components/Counter/Counter.stories.tsx +24 -0
- package/src/components/Counter/Counter.tsx +18 -0
- package/src/components/Counter/index.ts +1 -0
- package/src/components/SideNav/SideNav.css.ts +11 -11
- package/src/features/inAppGuide/InAppGuideContext.tsx +49 -0
- package/src/features/inAppGuide/InAppGuideDialog.tsx +112 -0
- package/src/features/inAppGuide/inAppGuideContent.tsx +60 -0
- package/src/features/labs/labsList/LabsListItem.tsx +1 -1
- package/src/hooks/usePersistedState.ts +23 -0
- package/src/hooks/useRepositoryInformation.ts +24 -0
- package/src/icons/FlowerBackgroundIcon.tsx +16 -0
- package/src/icons/HelpIcon.tsx +19 -0
- package/out/_next/static/66j49QzF8CgRcsFMiHqJx/_buildManifest.js +0 -1
- package/out/_next/static/chunks/18539003-1bb05c8aa7db2bc2.js +0 -97
- package/out/_next/static/chunks/482-e6bbd1fcdcdf79ad.js +0 -1
- package/out/_next/static/chunks/840-c317c8ff8de0f202.js +0 -1
- package/out/_next/static/chunks/904-d5dfccdb4d9ab010.js +0 -1
- package/out/_next/static/chunks/958-2b881a5b68ff11ba.js +0 -1
- package/out/_next/static/chunks/pages/_app-8239471ebbdfbc5f.js +0 -428
- package/out/_next/static/chunks/pages/index-5266b7f0ca55025a.js +0 -1
- package/out/_next/static/chunks/pages/labs-2349c21fbac1bd23.js +0 -1
- package/out/_next/static/css/66b3836ab88b0c5c.css +0 -1
- /package/out/_next/static/{66j49QzF8CgRcsFMiHqJx → iKwyM9kme9G-Y_a_L-e6V}/_ssgManifest.js +0 -0
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[851],{71463:function(t,n,r){r.d(n,{kS:function(){return es2}});var i,o,a,u,s,c=r(2784),l=r(71651),f=r(32001),d=r(97867),p=r(19245),h=r(68865),m=r(34736),g=r(55798),y=r(60848),v=r(34234),b=r(28316),x=r(80832),_=r(59131),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,C={},M={get exports(){return C},set exports(e){C=e}},R={};(I=M).exports=function(){if(qg)return R;qg=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))}}}}},j=function(t){return function(){return{concat:function(n,r){return function(i){return t.concat(n(i),r(i))}}}}},A=function(t){var n=j(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 V(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 $(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t}function q(t){return t+1}function K(t){return t-1}function H(t){throw Error("Called `absurd` function which should be uncallable")}function G(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 Z=function(t,n){return n},J=function(){return{concat:function(t,n){return V(t,n)},empty:F}};let Y=Object.freeze(Object.defineProperty({__proto__:null,SK:Z,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:V,getBooleanAlgebra:E,getEndomorphismMonoid:J,getMonoid:A,getRing:P,getSemigroup:j,getSemiring:N,hole:H,identity:F,increment:q,not:function(t){return function(n){return!t(n)}},pipe:G,tuple:$,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 G(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 G(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=[],eC={},eM=Object.prototype.hasOwnProperty,eR=function(t){return eh([t[0]],t.slice(1),!0)},eE=function(t,n){return{left:t,right:n}},ej=function(t,n){return G(t,eP(n))},eA=function(t,n,r){return G(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 G(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:ej,bimap:eA},Functor:eD,URI:eF,bimap:eL,flap:eW,left:eU,map:eN,mapLeft:eP,right:ez,separated:eE},Symbol.toStringTag,{value:"Module"}));function eV(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 e$(t){return function(n){return function(r){return t.ap(t.map(r,function(t){return function(){return t}}),n)}}}function eq(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 eG(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):eG(t,n-1,o)}}var eZ={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 eM.call(eZ,t)||(eZ[t]=eG($,t-1,[])),eZ[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 eG(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:eV,apFirst:e$,apS:eK,apSecond:eq,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)})},e9=function(t){return function(n){return e3(function(r,i){return n.compare(t(r),t(i))})}},e6=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:e6().concat,empty:e3(function(){return 0})}},e7={URI:"Ord",contramap:function(t,n){return G(t,e9(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=G(tl,e9(function(t){return t.valueOf()}));let td=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:e7,URI:"Ord",between:tc,clamp:ts,contramap:e9,equals:tt,equalsDefault:e2,fromCompare:e3,geq:to,getDualOrd:e5,getMonoid:e8,getSemigroup:e6,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)eM.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),tC=function(){return{concat:function(t,n){return Object.assign({},t,n)}}},tM={concat:function(t,n){return t&&n}},tR={concat:function(t,n){return t||n}},tE={concat:function(t,n){return t+n}},tj={concat:function(t,n){return t+n}},tA={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:j,getIntercalateSemigroup:tw,getJoinSemigroup:tx,getLastSemigroup:tk,getMeetSemigroup:tb,getObjectSemigroup:tC,getStructSemigroup:tS,getTupleSemigroup:tT,intercalate:tw,last:tk,max:tx,min:tb,reverse:tp,semigroupAll:tM,semigroupAny:tR,semigroupProduct:tA,semigroupString:tE,semigroupSum:tj,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},tV=function(t){var n=tz(t);return function(t){return function(r){return n(G(r,tX(t)))}}},t$=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 t$(i-r)(n);var o=nn(-i)(n),a=o[0];return G(o[1],tX(a))}},tq=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})},tG=function(t,n){return t<=n?tK(function(n){return t+n})(n-t+1):[t]},tZ=function(t){return[nQ(t),nX(t)]},tJ=function(t){return[n1(t),n0(t)]},tY=function(t){return tq(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);eM.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))}},t9=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},t6=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)?G(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]:[G(n.slice(1,r),tF(nQ(n))),n.slice(r)]}},nr=function(t){return nt(nn(t))},ni=function(t,n){return G(t,nO(n))},no=function(t,n){return G(t,nk(n))},na=function(t,n){return G(t,nx(n))},nu=function(t,n){return G(t,n_(n))},ns=function(t,n){return G(t,nS(n))},nc=function(t,n,r){return G(t,nI(n,r))},nl=function(t){var n=nC(t);return function(t,r){return G(t,n(r))}},nf=function(t,n,r){return G(t,nM(n,r))},nd=function(t){var n=nA(t);return function(t,r){return G(t,n(r))}},np=function(t,n){return G(t,nb(n))},nh=function(t,n,r){return G(t,nR(n,r))},nm=function(t){var n=nE(t);return function(t,r){return G(t,n(r))}},ng=function(t,n,r){return G(t,nj(n,r))},ny=function(t){var n=nP(t);return function(t,r){return G(t,n(r))}},nv=function(t){return function(n){return G(n,tQ(t()))}},nb=nv,nx=function(t){return n_(function(n){return G(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)})},nC=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]))}}},nM=function(t,n){return nj(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]))}}},nj=function(t,n){return function(r){return r.reduceRight(function(t,r,i){return n(i,r,t)},t)}},nA=function(t){var n=nP(t);return function(t){return n(function(n,r){return t(r)})}},nN=function(t){return nP(t)(Z)},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 G(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=tV(t);return{concat:function(t,r){return n(r)(t)}}},nz={URI:nL,map:ni},nB=el(nz),nV={URI:nL,map:ni,ap:na},n$=e$(nV),nq=eq(nV),nK={URI:nL,map:ni,ap:na,chain:nu},nH=eX(nK),nG=eT(eC),nZ=ef(nz),nJ=e0(nK),nY=eK(nV),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))}},n9=function(t){return function(n){return t(n1(n),n0(n))}},n6=function(t){return function(n){return tP([t(nQ(n))],nX(n),!0)}},n8=function(t){return n6(function(){return t})},n7=function(t){return function(n){return G(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 V(t7(t),n)}},rn=function(t){return function(n){return tq(n.filter(function(n,r){return t(r,n)}))}};function rr(t,n){return void 0===n?tF(t):G(n,tF(t))}var ri=function(t,n){return G(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:nV,Chain:nK,Comonad:{URI:nL,map:ni,extend:ns,extract:eO},Do:nG,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:n$,apS:nY,apSecond:nq,append:tD,appendW:tD,bind:nJ,bindTo:nZ,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:nC,foldMapWithIndex:nE,fromArray:tY,fromReadonlyArray:tq,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:n9,max:n3,min:n2,modifyAt:t5,modifyHead:n6,modifyLast:n7,of:eT,prepend:tF,prependAll:t8,prependToAll:t8,prependW:tF,range:tG,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:nM,reduceRightWithIndex:nj,reduceWithIndex:nR,replicate:tH,reverse:t0,rotate:t$,sequence:nN,snoc:ri,sort:t3,sortBy:tB,splitAt:nn,tail:nX,traverse:nA,traverseWithIndex:nP,unappend:tJ,uncons:tZ,union:tV,uniq:tz,unprepend:tZ,unsafeInsertAt:tW,unsafeUpdateAt:tU,unsnoc:tJ,unzip:t6,updateAt:t4,updateHead:n8,updateLast:re,zip:function t(n,r){return void 0===r?function(r){return t(r,n)}:t9(n,r,function(t,n){return[t,n]})},zipWith:t9},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 rC(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 rM=Object.freeze(Object.defineProperty({__proto__:null,filterE:rC,wiltDefault:rk,witherDefault:rI},Symbol.toStringTag,{value:"Module"}));var rR=function(t){return Object.assign({},t)},rE=function(t){return Object.assign({},t)},rj=function(t){return Object.keys(t).length},rA=function(t){for(var n in t)if(eM.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(eM.call(r,t)&&r[t]===n)return r;var i=Object.assign({},r);return i[t]=n,i}},rW=function(t,n){return eM.call(n,t)};function rU(t){return function(n){if(!eM.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 rV(t){return function(n,r){if(void 0===r){var i=rV(t);return function(t){return i(t,n)}}for(var o in n)if(!eM.call(r,o)||!t.equals(n[o],r[o]))return!1;return!0}}function r$(t,n){return void 0===n?function(n){return r$(t,n)}:eM.call(n,t)?ev(n[t]):ey}var rq={};function rK(t){return function(n){var r={};for(var i in n)eM.call(n,i)&&(r[i]=t(i,n[i]));return r}}function rH(t){return rK(function(n,r){return t(r)})}function rG(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(2===t.length)return rG(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 rZ(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 rZ(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(G(i,n(r)),iN)}}},r2=function(t){var n=rX(t);return function(r){return function(i){return t.map(G(i,n(r)),iP)}}};function r3(t){return function(n){var r={},i={};for(var o in n)if(eM.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(eM.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(eM.call(n,i)){var o=t(i,n[i]);eg(o)&&(r[i]=o.value)}return r}}function r9(t){return function(n){var r={},i=!1;for(var o in n)if(eM.call(n,o)){var a=n[o];t(o,a)?r[o]=a:i=!0}return i?r:n}}function r6(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]=eM.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(rA(r))return n;if(rA(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(rA(r)||rA(n))return rq;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(rA(n))return t;if(rA(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 G(t,rH(n))},is=function(t,n){return G(t,rK(n))},ic=function(t){var n=iE(t);return function(t,r,i){return G(t,n(r,i))}},il=function(t){return function(n){var r=ij(t)(n);return function(t,n){return G(t,r(n))}}},id=function(t){var n=iA(t);return function(t,r,i){return G(t,n(r,i))}},ip=function(t,n){return G(t,iI(n))},ih=function(t,n){return G(t,iC(n))},im=function(t,n){return G(t,iM(n))},ig=function(t,n){return G(t,iR(n))},iy=function(t){var n=rG(t);return function(t,r,i){return G(t,n(r,i))}},iv=function(t){var n=rZ(t);return function(t){var r=n(t);return function(t,n){return G(t,r(n))}}},ib=function(t){var n=rJ(t);return function(t,r,i){return G(t,n(r,i))}},ix=function(t,n){return G(t,r3(n))},i_=function(t,n){return G(t,r4(n))},iS=function(t,n){return G(t,r5(n))},iT=function(t,n){return G(t,r9(n))},iw=function(t){var n=ik(t);return function(t){var r=n(t);return function(t,n){return r(t,V(Z,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(rq);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 r9(function(n,r){return t(r)})},iC=function(t){return r5(function(n,r){return t(r)})},iM=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=rG(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 ij(t){if("compare"in t){var n=rZ(t);return function(t){var r=n(t);return function(t){return r(function(n,r){return t(r)})}}}return ij(rl)(t)}function iA(){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 iA(rl).apply(void 0,t)}var iN=function(t){var n={};for(var r in t)if(eM.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(eM.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=rV(t);return Q(function(t,r){return n(t)(r)&&n(r)(t)})}function iW(t){return{concat:function(n,r){if(rA(n))return r;if(rA(r))return n;var i=Object.assign({},n);for(var o in r)eM.call(r,o)&&(i[o]=eM.call(n,o)?t.concat(n[o],r[o]):r[o]);return i},empty:rq}}var iU={URI:iL,map:iu},iz=el(iU),iB=function(t){return{URI:iL,reduce:ic(t),foldMap:il(t),reduceRight:id(t)}},iV=function(t){return{URI:iL,reduce:ic(t),foldMap:il(t),reduceRight:id(t),reduceWithIndex:iy(t),foldMapWithIndex:iv(t),reduceRightWithIndex:ib(t)}},i$={URI:iL,compact:iN,separate:iP},iq=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=iq(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,i$),wilt:rk(n,i$)}},iG=function(t){var n=ii(t);return{concat:function(t,r){return n(r)(t)}}},iZ=function(t){return{concat:iG(t).concat,empty:rq}},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,i$),i3=rk(i0,i$),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 eM.call(void 0===n?this:n,t)}var i9={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 i6=Object.freeze(Object.defineProperty({__proto__:null,Compactable:i$,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:rq,every:ie,filter:iI,filterMap:iC,filterMapWithIndex:r5,filterWithIndex:r9,flap:iz,foldMap:ij,foldMapWithIndex:rZ,fromEntries:r7,fromFoldable:r6,fromFoldableMap:r8,fromRecord:rR,getDifferenceMagma:iY,getEq:iD,getFoldable:iB,getFoldableWithIndex:iV,getIntersectionSemigroup:iJ,getMonoid:iW,getShow:iF,getTraversable:iq,getTraversableWithIndex:iK,getUnionMonoid:iZ,getUnionSemigroup:iG,getWitherable:iH,has:rW,hasOwnProperty:i5,insertAt:rD,intersection:io,isEmpty:rA,isSubrecord:rV,keys:rP,lookup:r$,map:rH,mapWithIndex:rK,modifyAt:rB,partition:iM,partitionMap:iR,partitionMapWithIndex:r3,partitionWithIndex:r4,pop:function(t){var n=rU(t);return function(r){var i=r$(t,r);return em(i)?ey:ev([i.value,n(r)])}},readonlyRecord:i9,reduce:iE,reduceRight:iA,reduceRightWithIndex:rJ,reduceWithIndex:rG,separate:iP,sequence:r0,singleton:rY,size:rj,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,oC,oM,oR,oE,oj,oA={},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)||oj(n,t,r)},oj=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)&&oj(n,t,i);return r(n,t),n},oC=function(t){return t&&t.__esModule?t:{default:t}},oM=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",oj),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",oC),t("__classPrivateFieldGet",oM),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=eV(t,n);return{map:r,of:function(r){return t.of(n.of(r))},ap:function(t,n){return G(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 oV(t){return function(n,r){return function(i){return t.fromEither(n(i)?eS(i):e_(r(i)))}}}function o$(t){var n=oB(t);return function(t){var r=n(t);return function(t){return V(t,r)}}}function oq(t,n){var r=o$(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 V(n,t.fromEither)}}function oH(t,n){var r=oK(t);return function(t){return function(i){return n.chain(i,r(t))}}}function oG(t,n){return V(oK(t),eX(n))}function oZ(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:oG,chainOptionK:oq,filterOrElse:oZ,fromEitherK:oK,fromOption:oB,fromOptionK:o$,fromPredicate:oV},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},o9=function(t){var n=o4(t);return function(t){return function(r){return n(G(r,aa(t)))}}},o6=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 o6(i-r)(n);var o=aS(-i)(n),a=o[0];return G(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);eM.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)?G(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),[]]:[G(n.slice(1,r),o0(ui(n))),n.slice(r)]}},aT=function(t){return a_(aS(t))},aw=function(t,n){return G(t,aq(n))},aO=function(t,n){return G(t,aK(n))},ak=function(t,n){return G(t,aU(n))},aI=function(t,n){return G(t,az(n))},aC=function(t,n){return G(t,aB(n))},aM=function(t,n,r){return G(t,aH(n,r))},aR=function(t){var n=nC(t);return function(t,r){return G(t,n(r))}},aE=function(t,n,r){return G(t,aZ(n,r))},aj=function(t){var n=aY(t);return function(t,r){return G(t,n(r))}},aA=function(t,n){return G(t,aW(n))},aN=function(t,n,r){return G(t,aG(n,r))},aP=function(t){var n=nE(t);return function(t,r){return G(t,n(r))}},aL=function(t,n,r){return G(t,aJ(n,r))},aF=function(t){var n=aX(t);return function(t,r){return G(t,n(r))}},aD=function(t){return function(n){return G(n,ao(t()))}},aW=aD,aU=function(t){return az(function(n){return G(t,aq(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}},aV=aB(F),a$=az(F),aq=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,aG=nR,aZ=nM,aJ=nj,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 G(t,o1(n))}}),n(o,r[o]));return i}}},a0="NonEmptyArray",a1=function(){return{concat:aa}},a2=function(t){var n=o9(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},a9=e$(a5),a6=eq(a5),a8={URI:a0,map:aw,ap:ak,chain:aI},a7=eX(a8),ue=am(eC),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 G(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):G(n,o0(t))}var uy=function(t,n){return G(t,o1(n))};let uv=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:a0,map:aw,alt:aA},Applicative:{URI:a0,map:aw,ap:ak,of:am},Apply:a5,Chain:a8,Comonad:{URI:a0,map:aw,extend:aC,extract:nQ},Do:ue,Foldable:{URI:a0,reduce:aM,foldMap:aR,reduceRight:aE},FoldableWithIndex:{URI:a0,reduce:aM,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:aM,foldMap:aR,reduceRight:aE,traverse:aj,sequence:aQ},TraversableWithIndex:{URI:a0,map:aw,mapWithIndex:aO,reduce:aM,foldMap:aR,reduceRight:aE,traverse:aj,sequence:aQ,reduceWithIndex:aN,foldMapWithIndex:aP,reduceRightWithIndex:aL,traverseWithIndex:aF},URI:a0,alt:aW,altW:aD,ap:aU,apFirst:a9,apS:ur,apSecond:a6,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:aV,extend:aB,extract:nQ,filter:function(t){return um(function(n,r){return t(r)})},filterWithIndex:um,flap:a4,flatten:a$,fold:n4,foldMap:nC,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:aq,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:aC,extract:nQ,reduce:aM,foldMap:aR,reduceRight:aE,traverse:aj,sequence:aQ,reduceWithIndex:aN,foldMapWithIndex:aP,reduceRightWithIndex:aL,traverseWithIndex:aF,alt:aA},of:am,prepend:o0,prependAll:av,prependToAll:av,prependW:o0,range:an,reduce:aH,reduceRight:aZ,reduceRightWithIndex:aJ,reduceWithIndex:aG,replicate:at,reverse:au,rotate:o6,sequence:aQ,snoc:uy,sort:al,sortBy:o5,splitAt:aS,tail:uo,traverse:aY,traverseWithIndex:aX,unappend:ai,uncons:ar,union:o9,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},uC={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 uM=Object.freeze(Object.defineProperty({__proto__:null,Bounded:uS,Eq:ux,Field:uC,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 uj=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))},uA=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(uA(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}},uV=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}},u$=function(t){return t.length};function uq(t,n){return void 0===n?function(n){return uq(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},uG=function(t){return ew(t)?ev(nX(t)):ey},uZ=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||uA(n)?n:t>=n.length?cH:n.slice(t,n.length)}},u0=function(t){return function(n){return t<=0||uA(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}},u9=function(t){return function(n){for(var r=n.length-1;r>=0;r--)if(t(n[r]))return ev(r);return ey}},u6=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(c$(t,n))}},se=function(t,n){return function(r){return tL(t,r)?ey:ev(cV(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=t$(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):uA(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 uA(n)?t:uA(t)?n:n.concat(t)}};function sv(t){var n=tV(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 G(t,sY(n))},sS=function(t,n){return G(t,sQ(n))},sT=function(t,n){return G(t,sG(n))},sw=function(t,n){return G(t,sZ(n))},sO=function(t,n){return G(t,s0(n))},sk=function(t,n){return G(t,s2(n))},sI=function(t,n){return G(t,s4(n))},sC=function(t,n){return G(t,s9(n))},sM=function(t,n){return G(t,s5(n))},sR=function(t,n){return G(t,s6(n))},sE=function(t,n){return G(t,sH(n))},sj=function(t,n,r){return G(t,cn(n,r))},sA=function(t){var n=cr(t);return function(t,r){return G(t,n(r))}},sN=function(t,n,r){return G(t,co(n,r))},sP=function(t,n,r){return G(t,ci(n,r))},sL=function(t){var n=ct(t);return function(t,r){return G(t,n(r))}},sF=function(t,n,r){return G(t,ca(n,r))},sD=function(t,n){return G(t,s1(n))},sW=function(t,n){return G(t,s8(n))},sU=function(t,n){return G(t,s7(n))},sz=function(t){var n=cu(t);return function(t,r){return G(t,n(r))}},sB=function(t){var n=cc(t);return function(t,r){return G(t,n(r))}},sV=function(t,n){return G(t,cP(n))},s$=function(t,n){return G(t,cL(n))},sq=function(){return cH},sK=function(t){return function(n){return n.concat(t())}},sH=sK,sG=function(t){return sZ(function(n){return G(t,sY(n))})},sZ=function(t){return function(n){return G(n,uz(function(n,r){return t(r)}))}},sJ=sZ(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)}},s9=function(t){return s6(function(n,r){return t(r)})},s6=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 sj(n,t.of(sq()),function(n,r){return t.ap(t.map(n,function(t){return function(n){return G(t,tD(n))}}),r)})}},cc=function(t){return function(n){return ci(t.of(sq()),function(r,i,o){return t.ap(t.map(i,function(t){return function(n){return G(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 uA(t)?n:uA(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=e$(ck),cC=eq(ck),cM={URI:cp,map:s_,ap:sT,chain:sw},cR=eX(cM),cE={URI:cp,zero:sq},cj=uR(cE,cO),cA={URI:cp,compact:s3,separate:sX},cN={URI:cp,map:s_,reduce:sj,foldMap:sA,reduceRight:sN,traverse:sz,sequence:cs},cP=function(t){return function(n){for(var r=uj([],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,cA),cD=rk(cN,cA),cW={URI:cp,map:s_,compact:s3,separate:sX,filter:sO,filterMap:sk,partition:sI,partitionMap:sC,reduce:sj,foldMap:sA,reduceRight:sN,traverse:sz,sequence:cs,wither:cF,wilt:cD},cU=rC(cW),cz={URI:cp,fromEither:uF},cB=oK(cz),cV=function(t,n,r){return ew(r)?tU(t,n,r):r},c$=function(t,n){var r=n.slice();return r.splice(t,1),r},cq=function(t){return t.slice()},cK=function(t){return uA(t)?cH:t.slice()},cH=eI;function cG(t){return function(n){return n.every(t)}}var cZ=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(eC),cQ=ef(cT),cX=e0(cM),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:sq},Applicative:{URI:cp,map:s_,ap:sT,of:eT},Apply:ck,Chain:cM,ChainRecBreadthFirst:{URI:cp,map:s_,ap:sT,chain:sw,chainRec:s$},ChainRecDepthFirst:{URI:cp,map:s_,ap:sT,chain:sw,chainRec:sV},Compactable:cA,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:sC},FilterableWithIndex:{URI:cp,map:s_,mapWithIndex:sS,compact:s3,separate:sX,filter:sO,filterMap:sk,partition:sI,partitionMap:sC,partitionMapWithIndex:sR,partitionWithIndex:sM,filterMapWithIndex:sD,filterWithIndex:sW},Foldable:{URI:cp,reduce:sj,foldMap:sA,reduceRight:sN},FoldableWithIndex:{URI:cp,reduce:sj,foldMap:sA,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:sj,foldMap:sA,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:s$,_chainRecDepthFirst:sV,alt:sH,altW:sK,ap:sG,apFirst:cI,apS:c0,apSecond:cC,append:tD,appendW:tD,bind:cX,bindTo:cQ,chain:sZ,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)?G(nQ(o),sZ(function(n){return i(G(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:cG,exists:cZ,extend:s7,filter:s0,filterE:cU,filterMap:s2,filterMapWithIndex:s1,filterWithIndex:s8,findFirst:u2,findFirstMap:u3,findIndex:u1,findLast:u4,findLastIndex:u9,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:cj,head:uK,init:uZ,insertAt:u6,intercalate:cJ,intersection:sb,intersperse:ss,isEmpty:uA,isNonEmpty:ew,isOutOfBound:tL,last:uH,lefts:sr,lookup:uq,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:s9,partitionMapWithIndex:s6,partitionWithIndex:s5,prepend:tF,prependAll:su,prependToAll:su,prependW:tF,range:tG,readonlyArray:{URI:cp,compact:s3,separate:sX,map:s_,ap:sT,of:eT,chain:sw,filter:sO,filterMap:sk,partition:sI,partitionMap:sC,mapWithIndex:sS,partitionMapWithIndex:sR,partitionWithIndex:sM,filterMapWithIndex:sD,filterWithIndex:sW,alt:sE,zero:sq,unfold:cd,reduce:sj,foldMap:sA,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:uV,separate:sX,sequence:cs,size:u$,snoc:ri,some:cZ,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:uG,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:cq,traverse:cu,traverseWithIndex:cc,unfold:cd,union:sv,uniq:sf,unsafeDeleteAt:c$,unsafeInsertAt:tW,unsafeUpdateAt:cV,unzip:sa,updateAt:u8,wilt:cf,wither:cl,zero:sq,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]},c9=function(t){return eb(t)?[]:[t.right]},c6=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=o6(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)}},lC=function(t){var n=o5(t);return function(t){return oQ(t)?n(t):lp(t)}},lM=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):[]}},lj=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return c5(t.apply(void 0,n))}},lA=function(t){return function(n){return c2(n)?lp(t):c2(t)?lp(n):n.concat(t)}};function lN(t){var n=o9(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 G(t,l9(n))},lD=function(t,n){return G(t,fe(n))},lW=function(t,n){return G(t,l6(n))},lU=function(t,n){return G(t,l8(n))},lz=function(t,n){return G(t,fo(n))},lB=function(t,n){return G(t,fn(n))},lV=function(t,n){return G(t,fa(n))},l$=function(t,n){return G(t,fs(n))},lq=function(t,n){return G(t,fu(n))},lK=function(t,n){return G(t,fc(n))},lH=function(t,n){return G(t,ff(n))},lG=function(t,n,r){return G(t,fy(n,r))},lZ=function(t){var n=fm(t);return function(t,r){return G(t,n(r))}},lJ=function(t,n,r){return G(t,fb(n,r))},lY=function(t,n,r){return G(t,fv(n,r))},lQ=function(t){var n=fg(t);return function(t,r){return G(t,n(r))}},lX=function(t,n,r){return G(t,fx(n,r))},l0=function(t,n){return G(t,ft(n))},l1=function(t,n){return G(t,fd(n))},l2=function(t,n){return G(t,fp(n))},l3=function(t){var n=f_(t);return function(t,r){return G(t,n(r))}},l4=function(t){var n=fT(t);return function(t,r){return G(t,n(r))}},l5=function(){return[]},l9=function(t){return function(n){return n.map(function(n){return t(n)})}},l6=function(t){return l8(function(n){return G(t,l9(n))})},l8=function(t){return function(n){return G(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 lG(n,t.of(l5()),function(n,r){return t.ap(t.map(n,function(t){return function(n){return G(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 G(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=fG(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",fC=function(){return{concat:function(t,n){return t.concat(n)}}},fM=function(){return{concat:fC().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:[]}},fj=function(t){var n=lP(t);return{concat:function(t,r){return n(r)(t)}}},fA=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=e$(fF),fW=eq(fF),fU={URI:fI,map:lF,ap:lW,chain:lU},fz=eX(fU),fB={URI:fI,zero:l5},fV=uR(fB,fL),f$={URI:fI,compact:fr,separate:fi},fq={URI:fI,reduce:lG,foldMap:lZ,reduceRight:lJ},fK={URI:fI,map:lF,reduce:lG,foldMap:lZ,reduceRight:lJ,traverse:l3,sequence:fS},fH=rI(fK,f$),fG=rk(fK,f$),fZ={URI:fI,map:lF,compact:fr,separate:fi,filter:lz,filterMap:lB,partition:lV,partitionMap:l$,reduce:lG,foldMap:lZ,reduceRight:lJ,traverse:l3,sequence:fS,wither:fH,wilt:fG},fJ=rC(fZ),fY={URI:fI,fromEither:c9},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(eC),f4=ef(fN),f5=e0(fU),f9=eK(fF);let f6=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:s$},ChainRecDepthFirst:{URI:fI,map:lF,ap:lW,chain:lU,chainRec:sV},Compactable:f$,Do:f3,Extend:{URI:fI,map:lF,extend:l2},Filterable:{URI:fI,map:lF,compact:fr,separate:fi,filter:lz,filterMap:lB,partition:lV,partitionMap:l$},FilterableWithIndex:{URI:fI,map:lF,mapWithIndex:lD,compact:fr,separate:fi,filter:lz,filterMap:lB,partition:lV,partitionMap:l$,partitionMapWithIndex:lK,partitionWithIndex:lq,filterMapWithIndex:l0,filterWithIndex:l1},Foldable:fq,FoldableWithIndex:{URI:fI,reduce:lG,foldMap:lZ,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:lG,foldMap:lZ,reduceRight:lJ,reduceWithIndex:lY,foldMapWithIndex:lQ,reduceRightWithIndex:lX,traverse:l3,sequence:fS,traverseWithIndex:l4},URI:fI,Unfoldable:{URI:fI,unfold:fk},Witherable:fZ,Zero:fB,alt:ff,altW:fl,ap:l6,apFirst:fD,apS:f9,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:lV,partitionMap:l$,mapWithIndex:lD,partitionMapWithIndex:lK,partitionWithIndex:lq,filterMapWithIndex:l0,filterWithIndex:l1,alt:lH,zero:l5,unfold:fk,reduce:lG,foldMap:lZ,reduceRight:lJ,traverse:l3,sequence:fS,reduceWithIndex:lY,foldMapWithIndex:lQ,reduceRightWithIndex:lX,traverseWithIndex:l4,extend:l2,wither:fH,wilt:fG},bind:f5,bindTo:f4,chain:l8,chainFirst:fz,chainRecBreadthFirst:cL,chainRecDepthFirst:cP,chainWithIndex:le,chop:lM,chunksOf:lE,compact:fr,comprehension:function(t,n,r){void 0===r&&(r=function(){return!0});var i=function(t,o){return oQ(o)?G(ui(o),l8(function(n){return i(G(t,o1(n)),uo(o))})):r.apply(void 0,t)?[n.apply(void 0,t)]:[]};return i([],t)},concat:lA,concatW:lA,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:cG,exists:f2,extend:fp,filter:fo,filterE:fJ,filterMap:fn,filterMapWithIndex:ft,filterWithIndex:fd,findFirst:lf,findFirstMap:u3,findIndex:u1,findLast:ld,findLastIndex:u9,findLastMap:u5,flap:fP,flatten:l7,foldLeft:c8,foldMap:fm,foldMapWithIndex:fg,foldRight:c7,fromEither:c9,fromEitherK:fQ,fromOption:c5,fromOptionK:lj,fromPredicate:function(t){return function(n){return t(n)?[n]:[]}},getDifferenceMagma:fA,getEq:cy,getIntersectionSemigroup:fj,getMonoid:fM,getOrd:cv,getSemigroup:fC,getShow:ch,getUnionMonoid:fE,getUnionSemigroup:fR,guard:fV,head:uK,init:lo,insertAt:lh,intercalate:cJ,intersection:lP,intersperse:lO,isEmpty:c2,isNonEmpty:oQ,isOutOfBound:oX,last:uH,lefts:lx,lookup:uq,makeBy:c3,map:l9,mapWithIndex:fe,match:c6,matchLeft:c8,matchLeftW:c8,matchRight:c7,matchRightW:c7,matchW:c6,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:lC,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 dC=function(t,n){return G(t,dM(n))},dM=function(t){return function(n){return V(t,n)}},dR="Predicate",dE=function(){return{concat:function(t,n){return G(t,dL(n))}}},dj=function(){return{concat:dE().concat,empty:U}},dA=function(){return{concat:function(t,n){return G(t,dF(n))}}},dN=function(){return{concat:dA().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:dC},URI:dR,and:dF,contramap:dM,getMonoidAll:dN,getMonoidAny:dj,getSemigroupAll:dA,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 G(t,d9(n))},dV=function(t,n){return G(t,d7(n))},d$=function(t,n){return G(t,pn(n))},dq=function(t,n,r){return G(t,pi(n,r))},dK=function(t){var n=po(t);return function(t,r){return G(t,n(r))}},dH=function(t,n,r){return G(t,pa(n,r))},dG=function(t){var n=pS(t);return function(t,r){return G(t,n(r))}},dZ=function(t,n){return G(t,ps(n))},dJ=function(t,n){return G(t,py(n))},dY=function(t,n){return G(t,pv(n))},dQ=function(t,n){return G(t,pd(n))},dX=function(t,n){return G(t,pb(n))},d0=function(t,n){return G(t,px(n))},d1="Option",d2=function(t){return{show:function(n){return pj(n)?"none":"some(".concat(t.show(n.value),")")}}},d3=function(t){return{equals:function(n,r){return n===r||(pj(n)?pj(r):!pj(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 pj(n)?r:pj(r)?n:ev(t.concat(n.value,r.value))},empty:ey}},d9=function(t){return function(n){return pj(n)?ey:ev(t(n.value))}},d6={URI:d1,map:dB},d8={URI:d1,of:ev},d7=function(t){return function(n){return pj(n)||pj(t)?ey:ev(n.value(t.value))}},pe={URI:d1,map:dB,ap:dV},pt={URI:d1,map:dB,ap:dV,of:ev},pn=function(t){return function(n){return pj(n)?ey:t(n.value)}},pr={URI:d1,map:dB,ap:dV,chain:d$},pi=function(t,n){return function(r){return pj(r)?t:n(t,r.value)}},po=function(t){return function(n){return function(r){return pj(r)?t.empty:n(r.value)}}},pa=function(t,n){return function(r){return pj(r)?t:n(r.value,t)}},pu=function(t){return function(n){return pj(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 pj(n)?ey:ev(t(n))}},pp=pn(F),ph=eE(ey,ey),pm=function(t){return pj(t)?ph:eE(dU(t.value),dz(t.value))},pg={URI:d1,compact:pp,separate:pm},py=function(t){return function(n){return pj(n)?ey:t(n.value)?n:ey}},pv=function(t){return function(n){return pj(n)?ey:t(n.value)}},pb=function(t){return function(n){return eE(dJ(n,dP(t)),dJ(n,t))}},px=function(t){return V(d9(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 pj(r)?t.of(ey):t.map(n(r.value),ev)}}},pT=function(t){return function(n){return pj(n)?t.of(ey):t.map(n.value,ev)}},pw={URI:d1,map:dB,reduce:dq,foldMap:dK,reduceRight:dH,traverse:dG,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)}}},pC=function(t){var n=pk(t);return function(t){return function(r){return n(r,t)}}},pM=function(){return ey},pR={URI:d1,fromEither:dz},pE=eg,pj=function(t){return"None"===t._tag},pA=function(t,n){return function(r){return pj(r)?t():n(r.value)}},pN=function(t){return function(n){return pj(n)?t():n.value}},pP=el(d6),pL=e$(pe),pF=eq(pe),pD=eX(pr),pW=pd(F),pU=oK(pR),pz=oH(pR,pr),pB=oG(pR,pr),pV=function(t){return null==t?ey:ev(t)},p$=function(t){try{return ev(t())}catch{return ey}},pq=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return p$(function(){return t.apply(void 0,n)})}},pK=function(t){return V(t,pV)},pH=function(t){return function(n){return pj(n)?ey:pV(t(n.value))}},pG=pA(z,F),pZ=pA(B,F),pJ=function(t){return function(n){return!pj(n)&&t(n.value)}},pY=ev(eC),pQ=ef(d6),pX=e0(pr),p0=eK(pe),p1=ev(eI),p2=function(t){return function(n){var r=t(0,eO(n));if(pj(r))return ey;for(var i=[r.value],o=1;o<n.length;o++){var a=t(o,n[o]);if(pj(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),p9={URI:d1,map:dB,of:ev,ap:dV,chain:d$,reduce:dq,foldMap:dK,reduceRight:dH,traverse:dG,sequence:pT,zero:pc,alt:dZ,extend:dQ,compact:pp,separate:pm,filter:dJ,filterMap:dY,partition:dX,partitionMap:d0,wither:pO,wilt:pk,throwError:pM},p6=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:dZ},Alternative:{URI:d1,map:dB,ap:dV,of:ev,alt:dZ,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:dq,foldMap:dK,reduceRight:dH},FromEither:pR,Functor:d6,Monad:{URI:d1,map:dB,ap:dV,of:ev,chain:d$},MonadThrow:{URI:d1,map:dB,ap:dV,of:ev,chain:d$,throwError:pM},Pointed:d8,Traversable:pw,URI:d1,Witherable:{URI:d1,map:dB,reduce:dq,foldMap:dK,reduceRight:dH,traverse:dG,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!pj(i)&&n.equals(r,i.value)}},exists:pJ,extend:pd,filter:py,filterMap:pv,flap:pP,flatten:pp,fold:pA,foldMap:po,foldW:pA,fromEither:dz,fromEitherK:pU,fromNullable:pV,fromNullableK:pK,fromPredicate:dW,getApplyMonoid:p8,getApplySemigroup:p6,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:pj,isSome:pE,map:d9,mapNullable:pH,match:pA,matchW:pA,none:ey,of:ev,option:p9,partition:pb,partitionMap:px,reduce:pi,reduceRight:pa,separate:pm,sequence:pT,sequenceArray:p5,some:ev,throwError:pM,toNullable:pG,toUndefined:pZ,traverse:pS,traverseArray:p4,traverseArrayWithIndex:p3,traverseReadonlyArrayWithIndex:p3,traverseReadonlyNonEmptyArrayWithIndex:p2,tryCatch:p$,tryCatchK:pq,wilt:pC,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(G(t,o(dU))),i(G(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 G(t,hg())},hp=function(t,n){return G(t,hy())},hh=function(t,n,r){return G(t,hv(n))},hm=function(t,n){return G(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=G(u_,e9(function(t){return t.valueOf()})),hk=function(){return new Date},hI=function(){return new Date().getTime()};let hC=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 hM=function(t,n){return G(t,hJ(n))},hR=function(t,n){return G(t,h0(n))},hE=function(t,n){return G(t,h4(n))},hj=function(t,n,r){return G(t,h9(n,r))},hA=function(t){return function(n,r){var i=h6(t);return G(n,i(r))}},hN=function(t,n,r){return G(t,h8(n,r))},hP=function(t){var n=h7(t);return function(t,r){return G(t,n(r))}},hL=function(t,n,r){return G(t,mn(n,r))},hF=function(t,n){return G(t,mr(n))},hD=function(t,n){return G(t,mo(n))},hW=function(t,n){return G(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),")")}}},hV=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))}}},h$=function(t){return{concat:function(n,r){return ml(r)?n:ml(n)?r:eS(t.concat(n.right,r.right))}}},hq=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=hq(t),o=i.compact;return{URI:hz,_E:void 0,map:hM,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=hq(t);return{URI:hz,_E:void 0,map:hM,compact:n.compact,separate:n.separate,filter:n.filter,filterMap:n.filterMap,partition:n.partition,partitionMap:n.partitionMap,traverse:hP,sequence:me,reduce:hj,foldMap:hA,reduceRight:hN,wither:rI(mt,r),wilt:rk(mt,r)}},hG=function(t){return{URI:hz,_E:void 0,map:hM,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}},hZ=function(t){return{URI:hz,_E:void 0,map:hM,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:hM},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:hM,ap:hR},h2={URI:hz,map:hM,ap:hR,of:hQ},h3=function(t){return function(n){return ml(n)?n:t(n.right)}},h4=h3,h5={URI:hz,map:hM,ap:hR,chain:hE},h9=function(t,n){return function(r){return ml(r)?t:n(t,r.right)}},h6=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:hM,reduce:hj,foldMap:hA,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=oV(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=e$(h1),mg=eq(h1),my=eX(h5),mv=h3(F),mb=ma(F),mx=o$(mu),m_=oq(mu,h5),mS=oZ(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)}},mC=function(t){var n=mO(t);return function(t){return V(t,n)}},mM=function(t){var n=mC(t);return function(t){return h4(n(t))}},mR=md(F,F),mE=function(t){return function(n){return!ml(n)&&t(n.right)}},mj=hQ(eC),mA=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),mV=oW(h2),m$=function(t,n){return eH(hG(t))(n)},mq=function(t,n){return oW(hG(t))(n)};let mK=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:hz,map:hM,alt:hD},ApT:mL,Applicative:h2,Apply:h1,Bifunctor:{URI:hz,bimap:hL,mapLeft:hF},Chain:h5,ChainRec:{URI:hz,map:hM,ap:hR,chain:hE,chainRec:hU},Do:mj,Extend:{URI:hz,map:hM,extend:hW},Foldable:{URI:hz,reduce:hj,foldMap:hA,reduceRight:hN},FromEither:mu,Functor:hY,Monad:{URI:hz,map:hM,ap:hR,of:hQ,chain:hE},MonadThrow:{URI:hz,map:hM,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:mA,bindW:mN,chain:h4,chainFirst:my,chainFirstW:my,chainNullableK:mM,chainOptionK:m_,chainW:h3,duplicate:mb,either:{URI:hz,map:hM,of:hQ,ap:hR,chain:hE,reduce:hj,foldMap:hA,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:h6,foldW:md,fromNullable:mO,fromNullableK:mC,fromOption:mc,fromOptionK:mx,fromPredicate:ms,getAltValidation:hZ,getApplicativeValidation:hG,getApplyMonoid:mV,getApplySemigroup:mB,getCompactable:hq,getEq:hV,getFilterable:hK,getOrElse:mp,getOrElseW:mp,getSemigroup:h$,getShow:hB,getValidation:function(t){var n=hG(t).ap,r=hZ(t).alt;return{URI:hz,_E:void 0,map:hM,of:hQ,chain:hE,bimap:hL,mapLeft:hF,reduce:hj,foldMap:hA,reduceRight:hN,extend:hW,traverse:hP,sequence:me,chainRec:hU,throwError:e_,ap:n,alt:r}},getValidationMonoid:mq,getValidationSemigroup:m$,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:h9,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 V(eS,t.of)}function mG(t){return V(e_,t.of)}function mZ(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 V(mO(n),t.of)}}function mQ(t){var n=mY(t);return function(t){var r=n(t);return function(t){return V(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 eV(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 m9(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 m6(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:m9,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 G(t,r(n))},ap:function(t,r){return G(t,n(r))},of:mH(t),chain:function(t,n){return G(t,i(n))},alt:function(t,n){return G(t,o(n))},bimap:function(t,n,r){return G(t,a(n,r))},mapLeft:function(t,n){return G(t,u(n))},fold:function(t,n,r){return G(t,s(n,r))},getOrElse:function(t,n){return G(t,c(n))},orElse:function(t,n){return G(t,l(n))},swap:gr(t),rightM:mZ(t),leftM:mJ(t),left:mG(t)}},getOrElse:m7,left:mG,leftF:mJ,map:m0,mapLeft:m5,match:m6,matchE:m8,orElse:ge,orElseFirst:gt,orLeft:gn,right:mH,rightF:mZ,swap:gr,toUnion:gi},Symbol.toStringTag,{value:"Module"}));var ga=function(){return{concat:function(t,n){return V(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(G(n,r(function(n){return dU(t(n))})),G(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 G(t,a(n))},filterMap:function(t,n){return G(t,u(n))},partition:function(t,n){return G(t,s(n))},partitionMap:function(t,n){return G(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 G(t,r(n,i))},foldMap:function(t){var n=i(t);return function(t,r){return G(t,n(r))}},reduceRight:function(t,n,r){return G(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 G(t,i(n,r))},foldMapWithIndex:function(t){var n=o(t);return function(t,r){return G(t,n(r))}},reduceRightWithIndex:function(t,n,r){return G(t,a(n,r))}}},reduceRightWithIndex:gk,reduceWithIndex:gw},Symbol.toStringTag,{value:"Module"}));function gC(t){return function(n){return V(n,t.fromIO)}}function gM(t,n){return function(r){var i=V(r,t.fromIO);return function(t){return n.chain(t,i)}}}function gR(t,n){var r=eX(n);return function(n){return r(V(n,t.fromIO))}}let gE=Object.freeze(Object.defineProperty({__proto__:null,chainFirstIOK:gR,chainIOK:gM,fromIOK:gC},Symbol.toStringTag,{value:"Module"}));var gj=function(){return F},gA=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 G(t,gU(n))},gL=function(t,n){return G(t,gB(n))},gF=function(t,n){return G(t,g$(n))},gD=function(t,n){return G(t,gK(n))},gW=function(t,n,r){return G(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,gV=function(t){return function(n){return function(r){return t(n(r))(r)}}},g$=gV,gq=gV(F),gK=function(t){return function(n){return V(t,n)}},gH=function(t,n){return function(r){return function(i){return n(r(t(i)))}}},gG=function(){return F},gZ=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=e$(g3),g5=eq(g3),g9={URI:gX,map:gP,ap:gL,of:D},g6={URI:gX,map:gP,ap:gL,chain:gF},g8={URI:gX,map:gP,of:D,ap:gL,chain:gF},g7=eX(g6),ye=ef(g0),yt=e0(g6),yn=D(eC),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(g9);let yf=Object.freeze(Object.defineProperty({__proto__:null,ApT:yi,Applicative:g9,Apply:g3,Category:{URI:gX,compose:gD,id:gG},Chain:g6,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:gZ,second:gJ},URI:gX,ap:gB,apFirst:g4,apFirstW:g4,apS:yr,apSW:yr,apSecond:g5,apSecondW:g5,apW:gz,ask:gj,asks:F,asksReader:gN,asksReaderW:gN,bind:yt,bindTo:ye,bindW:yt,chain:g$,chainFirst:g7,chainFirstW:g7,chainW:gV,compose:gK,first:gZ,flap:g1,flatten:gq,flattenW:gq,getMonoid:yl,getSemigroup:yc,id:gG,left:gY,local:gA,map:gU,of:D,promap:gH,reader:{URI:gX,map:gP,of:D,ap:gL,chain:gF,promap:gW,compose:gD,id:gG,first:gZ,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(gj())}}function yp(t){return t.fromReader}function yh(t){return function(n){return V(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 V(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 G(t,yO(n))},yT=function(t,n){return G(t,yk(n))},yw=function(t,n){return G(t,yC(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]}},yC=function(t){return function(n){return function(r){var i=n(r),o=i[0],a=i[1];return t(o)(a)}}},yM=yC(F),yR="State",yE={URI:yR,map:yS},yj=el(yE),yA={URI:yR,map:yS,ap:yT},yN=e$(yA),yP=eq(yA),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),yV=eK(yA),y$=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]}}},yq=function(t){var n=y$(t);return function(t){return ew(t)?n(t):yI(eI)}},yK=function(t){return yq(function(n,r){return t(r)})},yH=yK(F),yG=function(t,n){return t(n)[0]},yZ=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:yA,Chain:yL,FromState:{URI:yR,fromState:F},Functor:yE,Monad:yF,Pointed:{URI:yR,of:yI},URI:yR,ap:yk,apFirst:yN,apS:yV,apSecond:yP,bind:yB,bindTo:yz,chain:yC,chainFirst:yD,evalState:yG,evaluate:yW,execState:yZ,execute:yU,flap:yj,flatten:yM,get:yv,gets:y_,map:yO,modify:yx,of:yI,put:yb,sequenceArray:yH,state:yF,traverseArray:yK,traverseArrayWithIndex:yq,traverseReadonlyArrayWithIndex:yq,traverseReadonlyNonEmptyArrayWithIndex:y$},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 V(yx,t.fromState)}function y0(t){return V(y_,t.fromState)}function y1(t){return function(n){return V(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 V(n,t.fromTask)}}function y5(t,n){return function(r){var i=V(r,t.fromTask);return function(t){return n.chain(t,i)}}}function y9(t,n){var r=eX(n);return function(n){return r(V(n,t.fromTask))}}let y6=Object.freeze(Object.defineProperty({__proto__:null,chainFirstTaskK:y9,chainTaskK:y5,fromTaskK:y4},Symbol.toStringTag,{value:"Module"}));function y8(t){return function(n){return V(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 G(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 G(t,vh(n))},va=function(t,n){return G(t,vm(n))},vu=function(t,n){return G(t,vg(n))},vs=function(t,n,r){return G(t,vx(n,r))},vc=function(t){return function(t,n){return G(t,v_()(n))}},vl=function(t,n,r){return G(t,vS(n,r))},vf=function(t,n){return G(t,vk())},vd=function(t,n){return G(t,vy(n))},vp=function(t){var n=vT(t);return function(t,r){return G(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",vC={URI:vI,map:vo},vM=el(vC),vR={URI:vI,map:vo,ap:va},vE=e$(vR),vj=eq(vR),vA={URI:vI,map:vo,ap:va,chain:vu},vN=eX(vA),vP=F(eC),vL=ef(vC),vF=e0(vA),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:vA,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:vC,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:vj,bind:vF,bindTo:vL,chain:vg,chainFirst:vN,duplicate:vv,extend:vy,extract:F,flap:vM,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())}},vV=function(t,n){return function(){return n(t())()}},v$=function(t,n){return function(){for(var r=n(t)();"Left"===r._tag;)r=n(r.left)();return r.right}},vq=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 vV(n,t)}},vG=vH(F),vZ={URI:"IO",map:vz},vJ=el(vZ),vY={URI:"IO",of:D},vQ={URI:"IO",map:vz,ap:vB},vX=e$(vQ),v0=eq(vQ),v1={URI:"IO",map:vz,ap:vB,of:D},v2={URI:"IO",map:vz,ap:vB,chain:vV},v3={URI:"IO",map:vz,ap:vB,of:D,chain:vV},v4=eX(v2),v5=D(eC),v9=ef(vZ),v6=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:vV,chainRec:v$},Do:v5,FromIO:{URI:"IO",fromIO:F},Functor:vZ,Monad:v3,MonadIO:{URI:"IO",map:vz,ap:vB,of:D,chain:vV,fromIO:F},Pointed:vY,URI:"IO",ap:vK,apFirst:vX,apS:v8,apSecond:v0,bind:v6,bindTo:v9,chain:vH,chainFirst:v4,flap:vJ,flatten:vG,fromIO:F,getMonoid:bo,getSemigroup:bi,io:{URI:"IO",map:vz,of:D,ap:vB,chain:vV,fromIO:F,chainRec:v$},map:vq,of:D,sequenceArray:br,traverseArray:bn,traverseArrayWithIndex:bt,traverseReadonlyArrayWithIndex:bt,traverseReadonlyNonEmptyArrayWithIndex:be},Symbol.toStringTag,{value:"Module"}));var bu=mG(vY),bs=mH(vY),bc=mZ(vZ),bl=mJ(vZ),bf=m6(vZ),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(vZ),by=ge(v3),bv=gt(v3),bb=function(t){return bv(bZ(t))},bx=gn(v3),b_=gr(vZ),bS=function(t,n){return G(t,bM(n))},bT=function(t,n){return G(t,bj(n))},bw=function(t,n){return G(t,bA(function(t){return G(n,bM(t))}))},bO=function(t,n){return G(t,bA(n))},bk=function(t,n,r){return G(t,bR(n,r))},bI=function(t,n){return G(t,bE(n))},bC=function(t,n){return G(t,bP(n))},bM=m0(vZ),bR=m4(vZ),bE=m5(vZ),bj=m1(vQ),bA=m2(v3),bN=bA(F),bP=m3(v3),bL="IOEither";function bF(t){var n=eV(vQ,hG(t));return{URI:bL,_E:void 0,map:bS,ap:function(t,r){return G(t,n(r))},of:bs}}function bD(t){var n=m9(v3,t);return{URI:bL,_E:void 0,map:bS,alt:function(t,r){return G(t,n(r))}}}var bW=function(t){var n=hq(t);return{URI:bL,_E:void 0,compact:hn(vZ,n),separate:hr(vZ,n,hY)}},bU={URI:bL,map:bS},bz=el(bU),bB={URI:bL,map:bS,ap:bT},bV=e$(bB),b$=eq(bB),bq={URI:bL,map:bS,ap:bT,of:bs},bK={URI:bL,map:bS,ap:bT,chain:bO},bH=eX(bK),bG={URI:bL,fromIO:bc},bZ=gC(bG),bJ=gM(bG,bK),bY=gR(bG,bK),bQ={URI:bL,fromEither:D},bX=oB(bQ),b0=o$(bQ),b1=oq(bQ,bK),b2=oH(bQ,bK),b3=oG(bQ,bK),b4=oV(bQ),b5=oZ(bQ,bK),b9=oK(bQ),b6=function(t,n,r){return b8(t,n,r)},b8=function(t,n,r){return G(t,bA(function(t){return G(n(t),vH(function(n){return G(r(t,n),bA(function(){return D(n)}))}))}))},b7=bs(eC),xe=ef(bU),xt=e0(bK),xn=eK(bB),xr=bs(eI),xi=function(t){return V(be(t),vq(mF(Z)))},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(bq),xh=function(t){return eH(vQ)(h$(t))};let xm=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:bL,map:bS,alt:bC},ApT:xr,Applicative:bq,ApplicativePar:bq,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:bG,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:bj,apFirst:bV,apFirstW:bV,apS:xn,apSW:xn,apSecond:b$,apSecondW:b$,apW:bj,bimap:bR,bind:xt,bindTo:xe,bindW:xt,bracket:b6,bracketW:b8,chain:bA,chainEitherK:b2,chainEitherKW:b2,chainFirst:bH,chainFirstEitherK:b3,chainFirstEitherKW:b3,chainFirstIOK:bY,chainFirstW:bH,chainIOK:bJ,chainOptionK:b1,chainW:bA,filterOrElse:b5,filterOrElseW:b5,flap:bz,flatten:bN,flattenW:bN,fold:bd,foldW:bd,fromEither:D,fromEitherK:b9,fromIO:bc,fromIOK:bZ,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(vZ,n),o=gp(vZ,n),a=gh(vZ,n),u=gm(vZ,n);return{URI:bL,_E:void 0,map:bS,compact:r.compact,separate:r.separate,filter:function(t,n){return G(t,i(n))},filterMap:function(t,n){return G(t,o(n))},partition:function(t,n){return G(t,a(n))},partitionMap:function(t,n){return G(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:bC,fromIO:bc,throwError:bu},left:bu,leftIO:bl,map:bM,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 V(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 V(pV,t.of)}function xx(t){var n=xb(t);return function(t){return V(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 V(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 V(dz,t.of)}function xk(t){return function(n,r){return function(i){return t.map(i,pA(n,r))}}}function xI(t){return function(n,r){return function(i){return t.chain(i,pA(n,r))}}}function xC(t){return function(n){return function(r){return t.chain(r,pA(n,t.of))}}}function xM(t){return ec(t,d6)}function xR(t){return eV(t,pe)}function xE(t){var n=xy(t);return function(r){return function(i){return t.chain(i,pA(function(){return n()},r))}}}function xj(t){var n=xg(t);return function(r){return function(i){return t.chain(i,pA(r,n))}}}let xA=Object.freeze(Object.defineProperty({__proto__:null,alt:xj,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=xM(t),i=xE(t),o=xj(t),a=xI(t),u=xC(t),s=xy(t);return{map:function(t,n){return G(t,r(n))},ap:function(t,r){return G(t,n(r))},of:xg(t),chain:function(t,n){return G(t,i(n))},alt:function(t,n){return G(t,o(n))},fold:function(t,n,r){return G(t,a(n,r))},getOrElse:function(t,n){return G(t,u(n))},fromM:xv(t),none:function(){return s()}}},getOrElse:xC,map:xM,match:xk,matchE:xI,some:xg,zero:xy},Symbol.toStringTag,{value:"Module"}));var xN=xg(vY),xP=xw(vY),xL=xO(vY),xF=xv(vZ),xD=vq(dz),xW=xk(vZ),xU=xI(v2),xz=xC(v3),xB=vq(pZ),xV=vq(pG),x$=xb(vY),xq=xx(vY),xK=x_(v3),xH=xS(vY),xG=xT(v3),xZ=xM(vZ),xJ=xR(vQ),xY=xE(v3),xQ=xY(F),xX=xj(v3),x0=xy(vY),x1=x0(),x2=hn(vZ,pg),x3=hr(vZ,pg,d6),x4=gd(vZ,p_),x5=gp(vZ,p_),x9=gh(vZ,p_),x6=gm(vZ,p_),x8=function(t,n){return G(t,xZ(n))},x7=function(t,n){return G(t,xJ(n))},_e=function(t,n){return G(t,xY(n))},_t=function(t,n){return G(t,xX(n))},_n=function(t,n){return G(t,x4(n))},_r=function(t,n){return G(t,x5(n))},_i=function(t,n){return G(t,x9(n))},_o=function(t,n){return G(t,x6(n))},_a="IOOption",_u={URI:_a,map:x8},_s=el(_u),_c={URI:_a,of:xN},_l={URI:_a,map:x8,ap:x7},_f=e$(_l),_d=eq(_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=gC(_y),_b=gM(_y,_p),_x=gR(_y,_p),__={URI:_a,fromEither:xL},_S=oK(__),_T=oH(__,_p),_w=oG(__,_p),_O=xN(eC),_k=ef(_u),_I=e0(_p),_C=eK(_l),_M=xN(eI),_R=function(t){return V(be(t),vq(p2(Z)))},_E=function(t){var n=_R(t);return function(t){return ew(t)?n(t):_M}};let _j=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:_M,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:_C,apSecond:_d,bind:_I,bindTo:_k,chain:xY,chainEitherK:_T,chainFirst:_h,chainFirstEitherK:_w,chainFirstIOK:_x,chainIOK:_b,chainNullableK:xK,chainOptionK:xG,compact:x2,filter:x4,filterMap:x5,flap:_s,flatten:xQ,fold:xU,fromEither:xL,fromEitherK:_S,fromIO:xF,fromIOEither:xD,fromIOK:_v,fromNullable:x$,fromNullableK:xq,fromOption:D,fromOptionK:xH,fromPredicate:xP,getOrElse:xz,getOrElseW:xz,guard:_g,map:xZ,match:xW,matchE:xU,matchEW:xU,matchW:xW,none:x1,of:xN,partition:x9,partitionMap:x6,separate:x3,some:xN,toNullable:xV,toUndefined:xB,traverseReadonlyArrayWithIndex:_E,traverseReadonlyNonEmptyArrayWithIndex:_R,zero:x0},Symbol.toStringTag,{value:"Module"}));var _A=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:_A,newIORef:function(t){return function(){return new _A(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},_V=function(t){return 0===t.size};function _$(t){var n=_1(t);return function(r,i){if(void 0===i){var o=_$(t);return function(t){return o(r,t)}}return eg(n(r,i))}}function _q(t){return function(n,r){if(void 0===r){var i=_q(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 _G(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 _Z=function(t){return _G(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 G(n(r,i),d9(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]])},_9=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},_6=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 _9(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 G(t,Se(n))},Su=function(t,n){return G(t,_7(n))},Ss=function(t,n){return G(t,_8(n))},Sc=function(t,n){return G(t,_6(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 _9(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:_9}},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)})}},SC=function(t){var n=Sj(t);return function(t){var r=n(t);return function(t){return r(function(n,r){return t(r)})}}},SM=function(t){var n=SA(t);return function(t,r){return n(t,function(t,n,i){return r(n,i)})}},SR=function(t){var n=SI(t),r=SC(t),i=SM(t);return{URI:Sv,_E:void 0,reduce:function(t,r,i){return G(t,n(r,i))},foldMap:function(t){var n=r(t);return function(t,r){return G(t,n(r))}},reduceRight:function(t,n,r){return G(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}}},Sj=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}}}},SA=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=Sj(t),o=SA(t);return{URI:Sv,_E:void 0,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,reduceWithIndex:function(t,n,i){return G(t,r(n,i))},foldMapWithIndex:function(t){var n=i(t);return function(t,r){return G(t,n(r))}},reduceRightWithIndex:function(t,n,r){return G(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,Z)}};return{URI:Sv,_E:void 0,map:St,mapWithIndex:_9,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(_V(i))return t;if(_V(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(_V(i)||_V(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=_$(t);return function(t){return function(r){if(_V(r))return t;if(_V(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:_G,compact:Sl,deleteAt:_Y,difference:SW,elem:_q,empty:_3,filter:Sf,filterMap:Sd,filterMapWithIndex:_7,filterWithIndex:Se,flap:Sw,foldMap:SC,foldMapWithIndex:Sj,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:_9,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(_V(t))return i;if(_V(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:_9,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:_V,isSubmap:_2,keys:_K,lookup:_1,lookupWithKey:_0,map:Sp,mapWithIndex:Sh,member:_$,modifyAt:_X,partition:Sm,partitionMap:Sg,partitionMapWithIndex:_6,partitionWithIndex:_8,pop:function(t){var n=_1(t),r=_Y(t);return function(t){var i=r(t);return function(r){return G(n(t,r),d9(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:SM,reduceRightWithIndex:SA,reduceWithIndex:SE,separate:Sy,singleton:_5,size:_B,toMap:function(t){return new Map(t)},toReadonlyArray:_Z,toUnfoldable:function(t,n){var r=_Z(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)}},SV=function(t){return function(n){return Array.from(n.values()).sort(t.compare)}};function S$(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 Sq(t){return S$(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}}},SG=function(t){var n=SZ(t);return function(t,r){return n(t,function(){return r})}},SZ=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)})},S9=function(t,n){return Te(t,function(t,r){return n(r)})},S6=function(t,n){return Tt(t,function(t,r){return n(r)})},S8=function(t,n){return G(t,S2(n))},S7=function(t,n){return G(t,S1(n))},Te=function(t,n){return G(t,S0(n))},Tt=function(t,n){return G(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 S9(n,t)}},Ts=function(t){return function(n){return S6(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:S9,partitionMap:S6},T_=function(t){return new Map(t)},TS=function(t,n){var r=SF(t,n);return function(t){return function(n){return _V(n)?T_(t):_V(t)?T_(n):r(t)(n)}}},TT=function(t,n){var r=SD(t,n);return function(t){return function(n){return _V(n)||_V(t)?new Map:r(t)(n)}}},Tw=function(t){var n=SW(t);return function(t){return function(r){return _V(r)?T_(t):_V(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:S$,compact:Tn,deleteAt:SH,difference:Tw,elem:_q,empty:TO,filter:Tr,filterMap:Ti,filterMapWithIndex:S1,filterWithIndex:S2,flap:Tv,foldMap:SC,foldMapWithIndex:Sj,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:S9,partitionMap:S6,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(_V(t))return i;if(_V(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:S9,partitionMap:S6,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:_V,isSubmap:_2,keys:SB,lookup:_1,lookupWithKey:SJ,map:To,mapWithIndex:Ta,map_:Tx,member:_$,modifyAt:SZ,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 G(n(t,r),d9(function(t){return[t,i(r)]}))}}},reduce:SI,reduceRight:SM,reduceRightWithIndex:SA,reduceWithIndex:SE,separate:Tc,singleton:SY,size:_B,toArray:Sq,toUnfoldable:function(t,n){var r=Sq(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:SG,upsertAt:SK,values:SV},Symbol.toStringTag,{value:"Module"})),TI=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),TC=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),TM=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 Tj=function(t){return{concat:tb(t).concat,empty:t.top}},TA=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)eM.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:tM.concat,empty:!0},TU={concat:tR.concat,empty:!1},Tz=function(){return TN(gu())},TB={concat:tE.concat,empty:""},TV={concat:tj.concat,empty:0},T$={concat:tA.concat,empty:1};let Tq=Object.freeze(Object.defineProperty({__proto__:null,concatAll:TF,fold:TF,getDualMonoid:TN,getEndomorphismMonoid:Tz,getFunctionMonoid:A,getJoinMonoid:TA,getMeetMonoid:Tj,getStructMonoid:TP,getTupleMonoid:TL,max:TA,min:Tj,monoidAll:TW,monoidAny:TU,monoidProduct:T$,monoidString:TB,monoidSum:TV,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()}},TG=function(t){return -1===t?1:1===t?-1:0},TZ={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:TZ,Monoid:TY,Semigroup:TJ,eqOrdering:TZ,invert:TG,match:TH,matchW:TH,monoidOrdering:TY,reverse:TG,semigroupOrdering:TJ,sign:TQ},Symbol.toStringTag,{value:"Module"})),T0=Object.freeze(Object.defineProperty({__proto__:null,pipe:G,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 C=function(n){return function(r){return t.extend(r,n)}},M=function(n){return t.extend(n,F)};y.extend=C,y.duplicate=M}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)}}},j=function(n,r){return function(i){return t.reduceRight(i,n,r)}};y.reduce=R,y.foldMap=E,y.reduceRight=j}if("function"==typeof t.reduceWithIndex){var A=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=A,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)}},V=function(n){return function(r){return t.filterMapWithIndex(r,n)}},$=function(n){return function(r){return t.partitionWithIndex(r,n)}},q=function(n){return function(r){return t.partitionMapWithIndex(r,n)}};y.filterWithIndex=B,y.filterMapWithIndex=V,y.partitionWithIndex=$,y.partitionMapWithIndex=q}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 G=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)},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=G,y.fromEither=Z,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 G(T3,vq(function(r){return Math.floor((n-t+1)*r+t)}))}var T5=G(T3,vq(function(t){return t<.5})),T9=function(t){return G(T4(0,t.length-1),vq(function(n){return t[n]}))};let T6=Object.freeze(Object.defineProperty({__proto__:null,random:T3,randomBool:T5,randomElem:T9,randomInt:T4,randomRange:function(t,n){return G(T3,vq(function(r){return(n-t)*r+t}))}},Symbol.toStringTag,{value:"Module"}));var T8=mG(g2),T7=mH(g2),we=mZ(g0),wt=mJ(g0),wn=m6(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 G(t,wg(n))},wf=function(t,n,r){return G(t,wy(n,r))},wd=function(t,n){return G(t,wv(n))},wp=function(t,n){return G(t,wb(n))},wh=function(t,n){return G(t,wx(n))},wm=function(t,n){return G(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=hq(t);return{URI:wT,_E:void 0,compact:hn(g0,n),separate:hr(g0,n,hY)}};function wO(t){var n=eV(g3,hG(t));return{URI:wT,_E:void 0,map:wl,ap:function(t,r){return G(t,n(r))},of:T7}}function wk(t){var n=m9(g8,t);return{URI:wT,_E:void 0,map:wl,alt:function(t,r){return G(t,n(r))}}}var wI={URI:wT,map:wl},wC=el(wI),wM={URI:wT,map:wl,ap:wp},wR=e$(wM),wE=eq(wM),wj={URI:wT,map:wl,ap:wp,of:T7},wA={URI:wT,map:wl,ap:wp,chain:wh},wN=eX(wA),wP={URI:wT,fromReader:we},wL=yd(wP),wF=yp(wP),wD=yh(wP),wW=ym(wP,wA),wU=yg(wP,wA),wz={URI:wT,fromEither:D},wB=oB(wz),wV=o$(wz),w$=oq(wz,wA),wq=oH(wz,wA),wK=oG(wz,wA),wH=oV(wz),wG=oZ(wz,wA),wZ=oK(wz),wJ=T7(eC),wY=ef(wI),wQ=e0(wA),wX=eK(wM),w0=T7(eI),w1=function(t){return V(yo(t),gU(mF(Z)))},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(wM),w9=oW(wj),w6=function(t){return eH(g3)(h$(t))};let w8=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:wT,map:wl,alt:wm},ApT:w0,Applicative:wj,Apply:wM,Bifunctor:{URI:wT,bimap:wf,mapLeft:wd},Chain:wA,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:wq,chainEitherKW:wq,chainFirst:wN,chainFirstEitherK:wK,chainFirstEitherKW:wK,chainFirstReaderK:wU,chainFirstReaderKW:wU,chainFirstW:wN,chainOptionK:w$,chainReaderK:wW,chainReaderKW:wW,chainW:wx,filterOrElse:wG,filterOrElseW:wG,flap:wC,flatten:w_,flattenW:w_,fold:wr,foldW:wr,fromEither:D,fromEitherK:wZ,fromOption:wB,fromOptionK:wV,fromPredicate:wH,fromReader:we,fromReaderK:wD,getAltReaderValidation:wk,getApplicativeReaderValidation:wO,getApplyMonoid:w9,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 G(t,i(n))},filterMap:function(t,n){return G(t,o(n))},partition:function(t,n){return G(t,a(n))},partitionMap:function(t,n){return G(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:w6,left:T8,leftReader:wt,local:gA,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 V(n,t.of)}}let Oi=Object.freeze(Object.defineProperty({__proto__:null,ap:Ot,chain:On,fromNaturalTransformation:function(t){return function(n){return V(n,t)}},fromReader:Or,getReaderM:function(t){var n=Ot(t),r=Oe(t),i=On(t);return{map:function(t,n){return G(t,r(n))},ap:function(t,r){return G(t,n(r))},of:w7(t),chain:function(t,n){return G(t,i(n))},ask:function(){return t.of},asks:function(n){return V(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 G(t,Ol(n))},Ou=function(t,n){return G(t,Of(n))},Os=function(t,n){return G(t,Op(function(t){return G(n,Ol(t))}))},Oc=function(t,n){return G(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=e$(Ob),O_=eq(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),OC={URI:Om,fromIO:Oo},OM=gC(OC),OR=gM(OC,OO),OE=gR(OC,OO),Oj=function(){return new Promise(function(t){})},OA=Od(eC),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)})},OV=OB(F),O$=function(t){return Oz(function(n,r){return t(r)})},Oq=O$(F),OK=eH(OT),OH=oW(Ow);let OG=Object.freeze(Object.defineProperty({__proto__:null,ApT:OF,ApplicativePar:OS,ApplicativeSeq:Ow,ApplyPar:Ob,ApplySeq:OT,Chain:OO,Do:OA,FromIO:OC,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:OM,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:Oj}},getSemigroup:OK,map:Ol,never:Oj,of:Od,sequenceArray:OV,sequenceSeqArray:Oq,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:O$,traverseSeqArrayWithIndex:Oz},Symbol.toStringTag,{value:"Module"}));var OZ=Or(Ov),OJ=V(Oo,D),OY=function(t,n){return G(t,O1(n))},OQ=function(t,n){return G(t,O2(n))},OX=function(t,n){return G(t,O4(function(t){return G(n,O1(t))}))},O0=function(t,n){return G(t,O4(n))},O1=Oe(Og),O2=Ot(Ob),O3=w7(Ov),O4=On(Ok),O5=O4(F),O9="ReaderTask",O6={URI:O9,map:OY},O8=el(O6),O7={URI:O9,of:O3},ke={URI:O9,map:OY,ap:OQ},kt=e$(ke),kn=eq(ke),kr={URI:O9,map:OY,ap:OX},ki={URI:O9,map:OY,ap:OX,of:O3},ko={URI:O9,map:OY,ap:OQ,chain:O0},ka={URI:O9,map:OY,of:O3,ap:OQ,chain:O0},ku=eX(ko),ks={URI:O9,fromIO:OJ},kc=gC(ks),kl=gM(ks,ko),kf=gR(ks,ko),kd={URI:O9,fromReader:OZ},kp=yd(kd),kh=yp(kd),km=yh(kd),kg=ym(kd,ko),ky=yg(kd,ko),kv={URI:O9,fromIO:OJ,fromTask:D},kb=y4(kv),kx=y5(kv,ko),k_=y9(kv,ko),kS=O3(eC),kT=ef(O6),kw=e0(ko),kO=eK(ke),kk=O3(eI),kI=function(t){return V(yo(t),gU(OD(Z)))},kC=function(t){var n=kI(t);return function(t){return ew(t)?n(t):kk}},kM=function(t){return V(yo(t),gU(OU(Z)))},kR=function(t){var n=kM(t);return function(t){return ew(t)?n(t):kk}},kE=function(t){return kC(function(n,r){return t(r)})},kj=kE(F),kA=function(t){return kR(function(n,r){return t(r)})},kN=kA(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:O9,map:OY,ap:OQ,of:O3},ApplicativeSeq:ki,ApplyPar:ke,ApplySeq:kr,Chain:ko,Do:kS,FromIO:ks,FromReader:kd,FromTask:kv,Functor:O6,Monad:ka,MonadIO:{URI:O9,map:OY,of:O3,ap:OQ,chain:O0,fromIO:OJ},MonadTask:{URI:O9,map:OY,of:O3,ap:OQ,chain:O0,fromIO:OJ,fromTask:D},Pointed:O7,URI:O9,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:OZ,fromReaderK:km,fromTask:D,fromTaskK:kb,getMonoid:kL,getSemigroup:kP,local:gA,map:O1,of:O3,readerTask:{URI:O9,map:OY,of:O3,ap:OQ,chain:O0,fromIO:OJ,fromTask:D},readerTaskSeq:{URI:O9,map:OY,of:O3,ap:OX,chain:O0,fromIO:OJ,fromTask:D},run:kF,sequenceArray:kj,sequenceSeqArray:kN,traverseArray:kE,traverseArrayWithIndex:kC,traverseReadonlyArrayWithIndex:kC,traverseReadonlyArrayWithIndexSeq:kR,traverseReadonlyNonEmptyArrayWithIndex:kI,traverseReadonlyNonEmptyArrayWithIndexSeq:kM,traverseSeqArray:kA,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=mG(Ov),kB=mH(Ov),kV=mZ(Og),k$=mJ(Og),kq=V(Oo,kV),kK=V(Oo,k$),kH=function(t){return Ol(mc(t))},kG=m6(Og),kZ=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))},k9=function(t){return k4(Iq(t))},k6=gn(Ok),k8=gr(Og),k7=function(t){var n=kH(t);return function(t){return V(t,n)}},Ie=function(t){return function(n){return function(r){return G(r,Ih(k7(t)(n)))}}},It=function(t){return V(t,Oo)},In=function(t){return Im(It(t))},Ir=function(t,n){return G(t,Il(n))},Ii=function(t,n){return G(t,Ip(n))},Io=function(t,n){return G(t,Ih(function(t){return G(n,Il(t))}))},Ia=function(t,n){return G(t,Ih(n))},Iu=function(t,n,r){return G(t,If(n,r))},Is=function(t,n){return G(t,Id(n))},Ic=function(t,n){return G(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=eV(t,hG(n));return{URI:Iv,_E:void 0,map:Ir,ap:function(t,n){return G(t,r(n))},of:kB}}function Ix(t){var n=m9(Ok,t);return{URI:Iv,_E:void 0,map:Ir,alt:function(t,r){return G(t,n(r))}}}var I_=function(t){var n=hq(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=e$(Iw),Ik=eq(Iw),II={URI:Iv,map:Ir,ap:Io},IC={URI:Iv,map:Ir,ap:Io,of:kB},IM={URI:Iv,map:Ir,ap:Ii,chain:Ia},IR=eX(IM),IE={URI:Iv,fromEither:Od},Ij=oB(IE),IA=o$(IE),IN=oq(IE,IM),IP=oH(IE,IM),IL=oG(IE,IM),IF=oV(IE),ID=oZ(IE,IM),IW=oK(IE),IU={URI:Iv,fromIO:kq},Iz=gC(IU),IB=gM(IU,IM),IV=gR(IU,IM),I$={URI:Iv,fromIO:kq,fromTask:kV},Iq=y4(I$),IK=y5(I$,IM),IH=y9(I$,IM),IG=function(t,n,r){return IZ(t,n,r)},IZ=function(t,n,r){return G(t,Im(function(t){return G(n(t),Op(function(n){return G(r(t,n),Im(function(){return Od(n)}))}))}))},IJ=kB(eC),IY=ef(IS),IQ=e0(IM),IX=eK(Iw),I0=kB(eI),I1=function(t){return V(OD(t),Ol(mF(Z)))},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)})},I9=I5(F),I6=function(t){return I4(function(n,r){return t(r)})},I8=I6(F),I7=eH(II),Ce=oW(IC),Ct=function(t){return eH(OT)(h$(t))};let Cn=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:IC,ApplyPar:Iw,ApplySeq:II,Bifunctor:{URI:Iv,bimap:Iu,mapLeft:Is},Chain:IM,Do:IJ,FromEither:IE,FromIO:IU,FromTask:I$,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:kq},MonadTask:{URI:Iv,map:Ir,ap:Ii,chain:Ia,of:kB,fromIO:kq,fromTask:kV},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:IG,bracketW:IZ,chain:Ih,chainEitherK:IP,chainEitherKW:IP,chainFirst:IR,chainFirstEitherK:IL,chainFirstEitherKW:IL,chainFirstIOK:IV,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:kZ,foldW:kZ,fromEither:Od,fromEitherK:IW,fromIO:kq,fromIOEither:Oo,fromIOEitherK:It,fromIOK:Iz,fromNullable:k0,fromNullableK:k1,fromOption:Ij,fromOptionK:IA,fromPredicate:IF,fromTask:kV,fromTaskK:Iq,fromTaskOption:kH,fromTaskOptionK:k7,getAltTaskValidation:Ix,getApplicativeTaskValidation:Ib,getApplyMonoid:Ce,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 G(t,i(n))},filterMap:function(t,n){return G(t,o(n))},partition:function(t,n){return G(t,a(n))},partitionMap:function(t,n){return G(t,u(n))}}},getOrElse:kJ,getOrElseW:kJ,getSemigroup:Ct,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:kq,fromTask:kV,throwError:kz}},left:kz,leftIO:kK,leftTask:k$,map:Il,mapLeft:Id,match:kG,matchE:kZ,matchEW:kZ,matchW:kG,of:kB,orElse:k3,orElseFirst:k4,orElseFirstIOK:k5,orElseFirstTaskK:k9,orElseFirstW:k4,orElseW:k3,orLeft:k6,right:kB,rightIO:kq,rightTask:kV,sequenceArray:I9,sequenceSeqArray:I8,swap:k8,taskEither:{URI:Iv,bimap:Iu,mapLeft:Is,map:Ir,of:kB,ap:Ii,chain:Ia,alt:Ic,fromIO:kq,fromTask:kV,throwError:kz},taskEitherSeq:{URI:Iv,bimap:Iu,mapLeft:Is,map:Ir,of:kB,ap:Io,chain:Ia,alt:Ic,fromIO:kq,fromTask:kV,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:I6,traverseSeqArrayWithIndex:I4,tryCatch:kY,tryCatchK:kQ},Symbol.toStringTag,{value:"Module"}));var Cr=mG(O7),Ci=mH(O7),Co=V(kV,D),Ca=V(k$,D),Cu=function(t){return V(t,kB)},Cs=function(t){return V(t,kz)},Cc=mZ(O6),Cl=mJ(O6),Cf=V(kq,D),Cd=V(kK,D),Cp=V(Oo,D),Ch=function(t){return V(t,Od)},Cm=m6(O6),Cg=m8(ko),Cy=m7(ka),Cv=gi(O6),Cb=mY(O7),Cx=mQ(O7),C_=mX(ka),CS=ge(ka),CT=gt(ka),Cw=gn(ka),CO=gr(O6),Ck=function(t){return V(t,Cp)},CI=function(t){return CK(Ck(t))},CC=function(t){return V(t,D)},CM=function(t){return CK(CC(t))},CR=function(t){return C7(CC(t))},CE=function(t){return V(t,Ch)},Cj=function(t){return CK(CE(t))},CA=function(t){return C7(CE(t))},CN=function(t,n){return G(t,Cz(n))},CP=function(t,n){return G(t,C$(n))},CL=function(t,n){return G(t,Cq(function(t){return G(n,Cz(t))}))},CF=function(t,n){return G(t,Cq(n))},CD=function(t,n){return G(t,CG(n))},CW=function(t,n,r){return G(t,CB(n,r))},CU=function(t,n){return G(t,CV(n))},Cz=m0(O6),CB=m4(O6),CV=m5(O6),C$=m1(ke),Cq=m2(ka),CK=Cq,CH=CK(F),CG=m3(ka),CZ="ReaderTaskEither",CJ=function(t){var n=hq(t);return{URI:CZ,_E:void 0,compact:hn(O6,n),separate:hr(O6,n,hY)}};function CY(t,n){var r=eV(g3,Ib(t,n));return{URI:CZ,_E:void 0,map:CN,ap:function(t,n){return G(t,r(n))},of:Ci}}function CQ(t){var n=m9(ka,t);return{URI:CZ,_E:void 0,map:CN,alt:function(t,r){return G(t,n(r))}}}var CX={URI:CZ,map:CN},C0=el(CX),C1={URI:CZ,of:Ci},C2={URI:CZ,map:CN,ap:CP},C3=e$(C2),C4=eq(C2),C5={URI:CZ,map:CN,ap:CL},C9={URI:CZ,map:CN,ap:CL,of:Ci},C6={URI:CZ,map:CN,ap:CP,chain:CF},C8=eX(C6),C7=C8,Me={URI:CZ,fromReader:Cu},Mt=yd(Me),Mn=yp(Me),Mr=yh(Me),Mi=ym(Me,C6),Mo=yg(Me,C6),Ma=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return Cc(t.apply(void 0,n))}},Mu=function(t){return CK(Ma(t))},Ms=function(t){return C7(Ma(t))},Mc={URI:CZ,fromEither:O3},Ml=oB(Mc),Mf=o$(Mc),Md=oq(Mc,C6),Mp=oH(Mc,C6),Mh=oG(Mc,C6),Mm=oV(Mc),Mg=oZ(Mc,C6),My=oK(Mc),Mv={URI:CZ,fromIO:Cf},Mb=gC(Mv),Mx=gM(Mv,C6),M_=gR(Mv,C6),MS={URI:CZ,fromIO:Cf,fromTask:Co},MT=y4(MS),Mw=y5(MS,C6),MO=y9(MS,C6);function Mk(t,n,r){return MI(t,n,r)}function MI(t,n,r){return function(i){return IZ(t(i),function(t){return n(t)(i)},function(t,n){return r(t,n)(i)})}}var MC=Ci(eC),MM=ef(CX),MR=e0(C6),ME=eK(C2),Mj=Ci(eI),MA=function(t){return V(yo(t),gU(I1(Z)))},MN=function(t){var n=MA(t);return function(t){return ew(t)?n(t):Mj}},MP=function(t){return V(yo(t),gU(I3(Z)))},ML=function(t){var n=MP(t);return function(t){return ew(t)?n(t):Mj}},MF=function(t){return MN(function(n,r){return t(r)})},MD=MF(F),MW=function(t){return ML(function(n,r){return t(r)})},MU=MW(F),Mz=eH(C5),MB=oW(C9),MV=function(t){return eH(kr)(h$(t))};function M$(t,n){return t(n)()}let Mq=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:CZ,map:CN,alt:CD},ApT:Mj,ApplicativePar:{URI:CZ,map:CN,ap:CP,of:Ci},ApplicativeSeq:C9,ApplyPar:C2,ApplySeq:C5,Bifunctor:{URI:CZ,bimap:CW,mapLeft:CU},Chain:C6,Do:MC,FromEither:Mc,FromIO:Mv,FromReader:Me,FromTask:MS,Functor:CX,Monad:{URI:CZ,map:CN,ap:CP,chain:CF,of:Ci},MonadIO:{URI:CZ,map:CN,ap:CP,chain:CF,of:Ci,fromIO:Cf},MonadTask:{URI:CZ,map:CN,ap:CP,chain:CF,of:Ci,fromIO:Cf,fromTask:Co},MonadThrow:{URI:CZ,map:CN,ap:CP,chain:CF,of:Ci,throwError:Cr},Pointed:C1,URI:CZ,alt:CG,altW:CG,ap:C$,apFirst:C3,apFirstW:C3,apS:ME,apSW:ME,apSecond:C4,apSecondW:C4,apW:C$,ask:Mt,asks:Mn,asksReaderTaskEither:gN,asksReaderTaskEitherW:gN,bimap:CB,bind:MR,bindTo:MM,bindW:MR,bracket:Mk,bracketW:MI,chain:Cq,chainEitherK:Mp,chainEitherKW:Mp,chainFirst:C8,chainFirstEitherK:Mh,chainFirstEitherKW:Mh,chainFirstIOK:M_,chainFirstReaderEitherK:CA,chainFirstReaderEitherKW:CA,chainFirstReaderK:Mo,chainFirstReaderKW:Mo,chainFirstReaderTaskK:Ms,chainFirstReaderTaskKW:Ms,chainFirstTaskEitherK:CR,chainFirstTaskEitherKW:CR,chainFirstTaskK:MO,chainFirstW:C7,chainIOEitherK:CI,chainIOEitherKW:CI,chainIOK:Mx,chainNullableK:C_,chainOptionK:Md,chainReaderEitherK:Cj,chainReaderEitherKW:Cj,chainReaderK:Mi,chainReaderKW:Mi,chainReaderTaskK:Mu,chainReaderTaskKW:Mu,chainTaskEitherK:CM,chainTaskEitherKW:CM,chainTaskK:Mw,chainW:CK,filterOrElse:Mg,filterOrElseW:Mg,flap:C0,flatten:CH,flattenW:CH,fold:Cg,foldW:Cg,fromEither:O3,fromEitherK:My,fromIO:Cf,fromIOEither:Cp,fromIOEitherK:Ck,fromIOK:Mb,fromNullable:Cb,fromNullableK:Cx,fromOption:Ml,fromOptionK:Mf,fromPredicate:Mm,fromReader:Cu,fromReaderEither:Ch,fromReaderEitherK:CE,fromReaderK:Mr,fromReaderTaskK:Ma,fromTask:Co,fromTaskEither:D,fromTaskEitherK:CC,fromTaskK:MT,getAltReaderTaskValidation:CQ,getApplicativeReaderTaskValidation:CY,getApplyMonoid:MB,getApplySemigroup:Mz,getCompactable:CJ,getFilterable:function(t){var n=hK(t),r=CJ(t),i=gd(O6,n),o=gp(O6,n),a=gh(O6,n),u=gm(O6,n);return{URI:CZ,_E:void 0,map:CN,compact:r.compact,separate:r.separate,filter:function(t,n){return G(t,i(n))},filterMap:function(t,n){return G(t,o(n))},partition:function(t,n){return G(t,a(n))},partitionMap:function(t,n){return G(t,u(n))}}},getOrElse:Cy,getOrElseW:Cy,getReaderTaskValidation:function(t){var n=CY(OS,t),r=CQ(t);return{URI:CZ,_E:void 0,map:CN,of:Ci,chain:CF,bimap:CW,mapLeft:CU,ap:n.ap,alt:r.alt,fromIO:Cf,fromTask:Co,throwError:Cr}},getSemigroup:MV,left:Cr,leftIO:Cd,leftReader:Cs,leftReaderTask:Cl,leftTask:Ca,local:gA,map:Cz,mapLeft:CV,match:Cm,matchE:Cg,matchEW:Cg,matchW:Cm,of:Ci,orElse:CS,orElseFirst:CT,orElseFirstW:CT,orElseW:CS,orLeft:Cw,readerTaskEither:{URI:CZ,map:CN,of:Ci,ap:CP,chain:CF,alt:CD,bimap:CW,mapLeft:CU,fromIO:Cf,fromTask:Co,throwError:Cr},readerTaskEitherSeq:{URI:CZ,map:CN,of:Ci,ap:CL,chain:CF,alt:CD,bimap:CW,mapLeft:CU,fromIO:Cf,fromTask:Co,throwError:Cr},right:Ci,rightIO:Cf,rightReader:Cu,rightReaderTask:Cc,rightTask:Co,run:M$,sequenceArray:MD,sequenceSeqArray:MU,swap:CO,throwError:Cr,toUnion:Cv,traverseArray:MF,traverseArrayWithIndex:MN,traverseReadonlyArrayWithIndex:MN,traverseReadonlyArrayWithIndexSeq:ML,traverseReadonlyNonEmptyArrayWithIndex:MA,traverseReadonlyNonEmptyArrayWithIndexSeq:MP,traverseSeqArray:MW,traverseSeqArrayWithIndex:ML},Symbol.toStringTag,{value:"Module"}));var MK=function(t){return new Set(t)},MH=function(t){return new Set([t])},MG=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 MZ(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 MJ(t){var n=Rr(t);return function(r,i){if(void 0===i){var o=MJ(t);return function(t){return o(r,t)}}if(M8(r))return i;if(M8(i))return r;var a=new Set(r);return i.forEach(function(t){n(t,a)||a.add(t)}),a}}function MY(t){var n=Rr(t);return function(r,i){if(void 0===i){var o=MY(t);return function(t){return o(t,r)}}if(M8(r)||M8(i))return M6;var a=new Set;return r.forEach(function(t){n(t,i)&&a.add(t)}),a}}function MQ(t){var n=Rr(t);return function(r,i){if(void 0===i){var o=MQ(t);return function(t){return o(t,r)}}return MZ(function(t){return!n(t,i)})(r)}}function MX(t){var n=Ri(t);return function(t,r){return function(i){return n(i).reduce(r,t)}}}function M0(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 M1=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 M2(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 M3=function(t){return function(n){return function(r){return MZ(function(r){return!t.equals(n,r)})(r)}}},M4=function(t){var n=Rr(t),r=M3(t),i=M2(t);return function(t){return function(o){return(n(t,o)?r:i)(t)(o)}}},M5=function(t){return M9(t)(F)};function M9(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 M6=new Set,M8=function(t){return 0===t.size},M7=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:MJ(t)}},Rs=function(t){return{concat:Ru(t).concat,empty:M6}},Rc=function(t){return{concat:MY(t)}},Rl=function(t){return{concat:MQ(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:M5,difference:MQ,elem:Rr,empty:M6,every:Rt,filter:MZ,filterMap:M9,foldMap:M0,fromArray:MG,fromReadonlyArray:MG,fromSet:MK,getDifferenceMagma:Rl,getEq:Ra,getIntersectionSemigroup:Rc,getShow:Ro,getUnionMonoid:Rs,getUnionSemigroup:Ru,insert:M2,intersection:MY,isEmpty:M8,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:MX,reduceRight:M1,remove:M3,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:MH,size:M7,some:Re,toReadonlyArray:Ri,toSet:function(t){return new Set(t)},toggle:M4,union:MJ},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 G(t,RR(n))},Rb=function(t,n){return G(t,RC(n))},Rx=function(t,n,r){return G(t,RI(n,r))},R_=function(t,n){return G(t,RM(n))},RS=function(t,n){return G(t,RE(n))},RT=function(t,n,r){return G(t,RA(n,r))},Rw=function(t){var n=RN();return function(t,r){return G(t,n(r))}},RO=function(t,n,r){return G(t,RP(n,r))},Rk=function(t){var n=RL(t);return function(t,r){return G(t,n(r))}},RI=function(t,n){return function(r){var i;return[n(r[0]),t(Rp(r))]}},RC=function(t){return function(n){var r;return[t(n[0]),Rp(n)]}},RM=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)]}},Rj=RE(F),RA=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:Rj,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:RC,mapFst:RC,mapLeft:RM,mapSnd:RM,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:RA,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)},RV=function(t){return function(n){return Object.keys(n).sort(t.compare)}},R$=RV(rl);function Rq(t){if("function"==typeof t)return Rq(rl)(t);var n=RV(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=Rq(rl)(function(t,n){return[t,n]});function RH(t){return function(n){if(!eM.call(n,t))return n;var r=Object.assign({},n);return delete r[t],r}}var RG=function(t,n){return RZ(t,function(){return n})},RZ=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(G(i,r(n)),Ee)}}},R0=function(t){var n,r=rX(t);return function(n){return function(i){return t.map(G(i,r(n)),Et)}}};function R1(t){return r4(t)}function R2(t){return r9(t)}function R3(t,n){return r6(t,n)}var R4=function(t){var n,r;return(n=tk(),r6(n,fq))(t)};function R5(t,n){return r8(t,n)}var R9=function(t){var n=ii(t);return function(t){return function(r){return rA(r)?RB({},t):rA(t)?RB({},r):n(t)(r)}}},R6=function(t){return function(n){return function(r){return rA(r)||rA(n)?{}:io(t)(n)(r)}}},R8=function(t){return function(n){return rA(n)?RB({},t):rA(t)?RB({},n):ia(t)(n)}},R7=function(t){return function(n){var r=RV(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=R9(t);return{concat:function(t,r){return n(r)(t)}}},Ed=function(t){return{concat:Ef(t).concat,empty:{}}},Ep=function(t){var n=R6(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:Rq,compact:Ee,deleteAt:RH,difference:R8,elem:ir,empty:{},every:ie,filter:iI,filterMap:iC,filterMapWithIndex:r5,filterWithIndex:R2,flap:Ei,foldMap:function(t){return"compare"in t?ij(t):ij(rl)(t)},foldMapWithIndex:function(t){return"compare"in t?rZ(t):rZ(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:R6,isEmpty:rA,isSubrecord:rV,keys:R$,lookup:r$,map:rH,mapWithIndex:rK,modifyAt:RZ,partition:iM,partitionMap:iR,partitionMapWithIndex:r3,partitionWithIndex:R1,pop:function(t){var n=RH(t);return function(r){var i=r$(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?iA(t[0]):iA(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?rG(t[0]):rG(rl).apply(void 0,t)},separate:Et,sequence:RQ,singleton:rY,size:rj,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:R9,updateAt:RG,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)}},EC=function(t){return function(n){return function(r){return n(r)||t(r)}}},EM=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 Ej=Object.freeze(Object.defineProperty({__proto__:null,and:EM,compose:EE,fromEitherK:EO,fromOptionK:Ew,id:Ek,not:EI,or:EC,zero:ER},Symbol.toStringTag,{value:"Module"}));var EA=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:EA,negate:EN,tuple:EA},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)}},EV=function(t){return{concat:EB(t).concat,empty:new Set}},E$=function(t){return{concat:EU(t)}},Eq=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 EG=function(t){return function(n){return function(r){return ED(function(r){return!t.equals(n,r)})(r)}}},EZ=function(t){var n=E2(t),r=EG(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:M0,fromArray:EJ,getDifferenceMagma:Eq,getEq:Ra,getIntersectionSemigroup:E$,getShow:Ro,getUnionMonoid:EV,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:MX,reduceRight:M1,remove:EG,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:EZ,union:EW},Symbol.toStringTag,{value:"Module"}));var E5=function(t){return{show:function(n){var r="{";for(var i in t)eM.call(t,i)&&(r+=" ".concat(i,": ").concat(t[i].show(n[i]),","));return r.length>1&&(r=r.slice(0,-1)+" "),r+="}"}}},E9=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 E6=Object.freeze(Object.defineProperty({__proto__:null,getStructShow:E5,getTupleShow:E9,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:E9},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 je(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 jt(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 jn(t){return function(n){return function(r){return t.of(n(r))}}}function jr(t){return function(n){return function(r){return t.map(n,function(t){return[t,r]})}}}function ji(t){return function(n){return function(r){return t.map(r(n),function(t){return t[0]})}}}function jo(t){return function(n){return function(r){return t.map(r(n),Rp)}}}let ja=Object.freeze(Object.defineProperty({__proto__:null,ap:je,chain:jt,evaluate:ji,execute:jo,fromF:jr,fromState:jn,getStateM:function(t){var n=je(t),r=E7(t),i=jt(t),o=ji(t),a=jo(t);return{map:function(t,n){return G(t,r(n))},ap:function(t,r){return G(t,n(r))},of:E8(t),chain:function(t,n){return G(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:jn(t),fromM:jr(t),evalState:function(t,n){return G(t,o(n))},execState:function(t,n){return G(t,a(n))}}},map:E7,of:E8},Symbol.toStringTag,{value:"Module"}));var ju=function(t){return function(){return Cr(t)}},js=E8(C1);function jc(t){return jb(Co(t))}function jl(t){return jb(Cu(t))}function jf(t){return jb(Cf(t))}var jd=function(t){return V(t,Ci)},jp=function(t){return function(n){return Cr(t(n)[0])}},jh=md(function(t){return ju(t)},js),jm=jn(C1),jg=function(t){return jb(D(t))},jy=function(t){return jb(Cp(t))},jv=function(t){return jb(Ch(t))},jb=jr(CX),jx=function(t){return function(n){return V(n,gA(t))}},j_=function(t){return function(n){return function(r){return t(r)(n)(r)}}},jS=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return jy(t.apply(void 0,n))}},jT=function(t){return function(n){return G(n,jW(jS(t)))}},jw=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return jg(t.apply(void 0,n))}},jO=function(t){return function(n){return G(n,jW(jw(t)))}},jk=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return jb(t.apply(void 0,n))}},jI=function(t){return function(n){return G(n,jW(jk(t)))}},jC=function(t,n){return G(t,jN(n))},jM=function(t,n){return G(t,jF(n))},jR=function(t,n){return G(t,jD(n))},jE=function(t,n){return function(r){return G(t(r),CG(function(){return n()(r)}))}},jj=function(t,n,r){return function(i){return G(t(i),CB(n,function(t){var n=t[0],i=t[1];return[r(n),i]}))}},jA=function(t,n){return function(r){return G(t(r),CV(n))}},jN=E7(CX),jP=function(t,n){return function(r){return jj(r,t,n)}},jL=function(t){return function(n){return jA(n,t)}},jF=je(C6),jD=jt(C6),jW=jD,jU=jW(F),jz=function(t){return function(n){return function(r){return G(n(r),CG(function(){return t()(r)}))}}},jB="StateReaderTaskEither",jV={URI:jB,map:jC},j$=el(jV),jq={URI:jB,map:jC,ap:jM},jK=e$(jq),jH=eq(jq),jG={URI:jB,map:jC,ap:jM,chain:jR},jZ={URI:jB,fromState:jm},jJ=yY(jZ),jY=yQ(jZ),jQ=yX(jZ),jX=y0(jZ),j0=y1(jZ),j1=y2(jZ,jG),j2=eX(jG),j3={URI:jB,fromReader:jl},j4=yd(j3),j5=yp(j3),j9=yh(j3),j6=ym(j3,jG),j8=yg(j3,jG),j7={URI:jB,fromEither:jh},Ae=oB(j7),At=o$(j7),An=oq(j7,jG),Ar=oH(j7,jG),Ai=oG(j7,jG),Ao=oV(j7),Aa=oZ(j7,jG),Au=oK(j7),As={URI:jB,fromIO:jf},Ac=gC(As),Al=gM(As,jG),Af=gR(As,jG),Ad={URI:jB,fromIO:jf,fromTask:jc},Ap=y4(Ad),Ah=y5(Ad,jG),Am=y9(Ad,jG),Ag=ji(CX),Ay=jo(CX),Av=ef(jV),Ab=e0(jG),Ax=eK(jq),A_=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]]})))}}}}},AS=function(t){var n=A_(t);return function(t){return ew(t)?n(t):js(eI)}},AT=function(t){return AS(function(n,r){return t(r)})},Aw=AT(F),AO=function(t,n){return G(t(n),Cz(function(t){return t[0]}))},Ak=function(t,n){return G(t(n),Cz(function(t){return t[0],t[1]}))};let AI=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:jB,map:jC,alt:jE},Applicative:{URI:jB,map:jC,ap:jM,of:js},Apply:jq,Bifunctor:{URI:jB,bimap:jj,mapLeft:jA},Chain:jG,FromEither:j7,FromIO:As,FromReader:j3,FromState:jZ,FromTask:Ad,Functor:jV,Monad:{URI:jB,map:jC,ap:jM,of:js,chain:jR},MonadIO:{URI:jB,map:jC,ap:jM,of:js,chain:jR,fromIO:jf},MonadTask:{URI:jB,map:jC,ap:jM,of:js,chain:jR,fromIO:jf,fromTask:jc},MonadThrow:{URI:jB,map:jC,ap:jM,of:js,chain:jR,throwError:ju},Pointed:{URI:jB,of:js},URI:jB,alt:jz,altW:jz,ap:jF,apFirst:jK,apFirstW:jK,apS:Ax,apSW:Ax,apSecond:jH,apSecondW:jH,apW:jF,ask:j4,asks:j5,asksStateReaderTaskEither:j_,asksStateReaderTaskEitherW:j_,bimap:jP,bind:Ab,bindTo:Av,bindW:Ab,chain:jD,chainEitherK:Ar,chainEitherKW:Ar,chainFirst:j2,chainFirstEitherK:Ai,chainFirstEitherKW:Ai,chainFirstIOK:Af,chainFirstReaderK:j8,chainFirstReaderKW:j8,chainFirstTaskK:Am,chainFirstW:j2,chainIOEitherK:jT,chainIOEitherKW:jT,chainIOK:Al,chainOptionK:An,chainReaderK:j6,chainReaderKW:j6,chainReaderTaskEitherK:jI,chainReaderTaskEitherKW:jI,chainStateK:j1,chainTaskEitherK:jO,chainTaskEitherKW:jO,chainTaskK:Ah,chainW:jW,evalState:AO,evaluate:Ag,execState:Ak,execute:Ay,filterOrElse:Aa,filterOrElseW:Aa,flap:j$,flatten:jU,flattenW:jU,fromEither:jh,fromEitherK:Au,fromIO:jf,fromIOEither:jy,fromIOEitherK:jS,fromIOK:Ac,fromOption:Ae,fromOptionK:At,fromPredicate:Ao,fromReader:jl,fromReaderEither:jv,fromReaderK:j9,fromReaderTaskEither:jb,fromReaderTaskEitherK:jk,fromState:jm,fromStateK:j0,fromTask:jc,fromTaskEither:jg,fromTaskEitherK:jw,fromTaskK:Ap,get:jJ,gets:jX,left:ju,leftIO:function(t){return jb(Cd(t))},leftReader:function(t){return jb(Cs(t))},leftState:jp,leftTask:function(t){return jb(Ca(t))},local:jx,map:jN,mapLeft:jL,modify:jQ,of:js,put:jY,right:js,rightIO:jf,rightReader:jl,rightState:jd,rightTask:jc,run:function(t,n,r){return t(n)(r)()},sequenceArray:Aw,stateReaderTaskEither:{URI:jB,map:jC,of:js,ap:jM,chain:jR,bimap:jj,mapLeft:jA,alt:jE,fromIO:jf,fromTask:jc,throwError:ju},stateReaderTaskEitherSeq:{URI:jB,map:jC,of:js,ap:jM,chain:jR,bimap:jj,mapLeft:jA,alt:jE,fromIO:jf,fromTask:jc,throwError:ju},throwError:ju,traverseArray:AT,traverseArrayWithIndex:AS,traverseReadonlyArrayWithIndex:AS,traverseReadonlyNonEmptyArrayWithIndex:A_},Symbol.toStringTag,{value:"Module"}));var AC=function(t,n){return G(t,AA(n))},AM=function(t,n){return G(t,AR(n))},AR=function(t){return function(n){return{peek:function(r){return t({peek:n.peek,pos:r})},pos:n.pos}}},AE=function(t){return t.peek(t.pos)},Aj=AR(F),AA=function(t){return function(n){return{peek:function(r){return t(n.peek(r))},pos:n.pos}}},AN="Store",AP={URI:AN,map:AC},AL=el(AP),AF={URI:AN,map:AC,extend:AM,extract:AE};let AD=Object.freeze(Object.defineProperty({__proto__:null,Comonad:AF,Functor:AP,URI:AN,duplicate:Aj,experiment:function(t){return function(n){return function(r){return t.map(n(r.pos),function(t){return r.peek(t)})}}},extend:AR,extract:AE,flap:AL,map:AA,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:AF},Symbol.toStringTag,{value:"Module"}));function AW(t,n){return function(r,i){return n.compose(t.second(i),t.first(r))}}function AU(t,n){var r=AW(t,n);return function(i,o){return n.compose(r(i,o),t.promap(n.id(),F,function(t){return[t,t]}))}}let Az=Object.freeze(Object.defineProperty({__proto__:null,fanOut:AU,fanout:function(t){return AU(t,t)},split:AW,splitStrong:function(t){return AW(t,t)}},Symbol.toStringTag,{value:"Module"}));var AB=function(){return{concat:function(t,n){return Object.assign({},t,n)}}},AV=function(t){return function(n){var r={};for(var i in n)eM.call(n,i)&&(r[i]=t[i](n[i]));return r}};let A$=Object.freeze(Object.defineProperty({__proto__:null,evolve:AV,getAssignSemigroup:AB},Symbol.toStringTag,{value:"Module"}));var Aq=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())})},AK=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])}}},AH=xg(Ov),AG=xw(Ov),AZ=xO(Ov),AJ=function(t){return AY(Oo(t))},AY=xv(Og),AQ=Ol(dz),AX=xk(Og),A0=xI(OO),A1=xC(Ok),A2=xb(Ov),A3=function(t){return function(){return Aq(void 0,void 0,void 0,function(){return AK(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]}})})}},A4=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return A3(function(){return t.apply(void 0,n)})}},A5=xx(Ov),A9=x_(Ok),A6=xS(Ov),A8=xT(Ok),A7=xM(Og),Ne=xR(Ob),Nt=xE(Ok),Nn=Nt(F),Nr=xj(Ok),Ni=xy(Ov),No=Ni(),Na=hn(Og,pg),Nu=hr(Og,pg,d6),Ns=gd(Og,p_),Nc=gp(Og,p_),Nl=gh(Og,p_),Nf=gm(Og,p_),Nd=function(t,n){return G(t,A7(n))},Np=function(t,n){return G(t,Ne(n))},Nh=function(t,n){return G(t,Nt(n))},Nm=function(t,n){return G(t,Nr(n))},Ng=function(t,n){return G(t,Ns(n))},Ny=function(t,n){return G(t,Nc(n))},Nv=function(t,n){return G(t,Nl(n))},Nb=function(t,n){return G(t,Nf(n))},Nx="TaskOption",N_={URI:Nx,map:Nd},NS=el(N_),NT={URI:Nx,of:AH},Nw={URI:Nx,map:Nd,ap:Np},NO=e$(Nw),Nk=eq(Nw),NI=function(t,n){return G(t,Nt(function(t){return G(n,A7(t))}))},NC={URI:Nx,map:Nd,ap:Np,chain:Nh},NM=eX(NC),NR={URI:Nx,zero:Ni},NE=uR(NR,NT),Nj={URI:Nx,fromIO:AJ},NA=gC(Nj),NN=gM(Nj,NC),NP=gR(Nj,NC),NL={URI:Nx,fromEither:AZ},NF=oK(NL),ND=oH(NL,NC),NW=oG(NL,NC),NU={URI:Nx,fromIO:AJ,fromTask:AY},Nz=y4(NU),NB=y5(NU,NC),NV=y9(NU,NC),N$=AH(eC),Nq=ef(N_),NK=e0(NC),NH=eK(Nw),NG=AH(eI),NZ=function(t){return V(OD(t),Ol(p2(Z)))},NJ=function(t){var n=NZ(t);return function(t){return ew(t)?n(t):NG}},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(d9(eT)))}}},NQ=function(t){var n=NY(t);return function(t){return ew(t)?n(t):NG}},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:AH,alt:Nm,zero:Ni},ApT:NG,ApplicativePar:{URI:Nx,map:Nd,ap:Np,of:AH},ApplicativeSeq:{URI:Nx,map:Nd,ap:NI,of:AH},ApplyPar:Nw,ApplySeq:{URI:Nx,map:Nd,ap:NI},Chain:NC,Compactable:{URI:Nx,compact:Na,separate:Nu},Do:N$,Filterable:{URI:Nx,map:Nd,compact:Na,separate:Nu,filter:Ng,filterMap:Ny,partition:Nv,partitionMap:Nb},FromEither:NL,FromIO:Nj,FromTask:NU,Functor:N_,Monad:{URI:Nx,map:Nd,ap:Np,of:AH,chain:Nh},MonadIO:{URI:Nx,map:Nd,ap:Np,of:AH,chain:Nh,fromIO:AJ},MonadTask:{URI:Nx,map:Nd,ap:Np,of:AH,chain:Nh,fromIO:AJ,fromTask:AY},Pointed:NT,Zero:NR,alt:Nr,altW:Nr,ap:Ne,apFirst:NO,apS:NH,apSecond:Nk,bind:NK,bindTo:Nq,chain:Nt,chainEitherK:ND,chainFirst:NM,chainFirstEitherK:NW,chainFirstIOK:NP,chainFirstTaskK:NV,chainIOK:NN,chainNullableK:A9,chainOptionK:A8,chainTaskK:NB,compact:Na,filter:Ns,filterMap:Nc,flap:NS,flatten:Nn,fold:A0,foldW:A0,fromEither:AZ,fromEitherK:NF,fromIO:AJ,fromIOK:NA,fromNullable:A2,fromNullableK:A5,fromOption:Od,fromOptionK:A6,fromPredicate:AG,fromTask:AY,fromTaskEither:AQ,fromTaskK:Nz,getOrElse:A1,getOrElseW:A1,guard:NE,map:A7,match:AX,matchE:A0,matchEW:A0,matchW:AX,none:No,of:AH,partition:Nl,partitionMap:Nf,separate:Nu,sequenceArray:N0,sequenceSeqArray:N2,some:AH,traverseArray:NX,traverseArrayWithIndex:NJ,traverseReadonlyArrayWithIndex:NJ,traverseReadonlyArrayWithIndexSeq:NQ,traverseReadonlyNonEmptyArrayWithIndex:NZ,traverseReadonlyNonEmptyArrayWithIndexSeq:NY,traverseSeqArray:N1,traverseSeqArrayWithIndex:NQ,tryCatch:A3,tryCatchK:A4,zero:Ni},Symbol.toStringTag,{value:"Module"}));var N4=function(t){return"Left"===t._tag},N5=function(t){return"Right"===t._tag};function N9(t){return"Both"===t._tag}function N6(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,N6,function(t,n){return N7(n,t)});function Pn(t,n){return{concat:function(r,i){return N4(r)?N4(i)?N6(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)?N6(t.concat(n.left,r.left)):N5(r)?N6(n.left):N6(t.concat(n.left,r.left)):N5(n)?N4(r)?N6(r.left):N5(r)?N8(n.right(r.right)):N7(r.left,n.right(r.right)):N4(r)?N6(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)?N6(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(N6(t.value)):ev(N7(t.value,n.value))},Pa=function(t,n){return G(t,Pm(n))},Pu=function(t,n,r){return G(t,Pp(n,r))},Ps=function(t,n){return G(t,Ph(n))},Pc=function(t,n,r){return G(t,Pg(n,r))},Pl=function(t){var n=Py(t);return function(t,r){return G(t,n(r))}},Pf=function(t,n,r){return G(t,Pv(n,r))},Pd=function(t){var n=Pb(t);return function(t,r){return G(t,n(r))}},Pp=function(t,n){return function(r){return N4(r)?N6(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)?N6(t(n.left)):N9(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=o$(Pw),PI=function(t){return function(n){return function(r){return!N4(r)&&t.equals(n,r.right)}}},PC=function(t){return function(n){return!N4(n)&&t(n.right)}},PM=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 PM(function(){return t},function(){return n})},PE=N8(eI),Pj=function(t){return function(n){return function(r){var i=ey,o=n(0,eO(r));if(N4(o))return o;N9(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;N9(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)}}},PA=function(t){return function(n){var r=Pj(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:PC,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):N9(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:N6}},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:N9,isLeft:N4,isRight:N5,left:N6,leftOrBoth:function(t){return function(n){return em(n)?N6(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:PM,traverse:Pb,traverseReadonlyArrayWithIndex:PA,traverseReadonlyNonEmptyArrayWithIndex:Pj},Symbol.toStringTag,{value:"Module"}));function PP(t){return V(N8,t.of)}function PL(t){return V(N6,t.of)}function PF(t){return V(N7,t.of)}function PD(t){return function(n){return t.map(n,N8)}}function PW(t){return function(n){return t.map(n,N6)}}function PU(t){return ec(t,PS)}function Pz(t,n){return eV(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 N6(n.concat(r,t))},function(t){return N7(r,t)},function(t,i){return N7(n.concat(r,t),i)}))}))}}}function PV(t){return function(n,r){return function(i){return t.map(i,Pp(n,r))}}}function P$(t){return function(n){return function(r){return t.map(r,Ph(n))}}}function Pq(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 PG(t){return function(n,r){return function(i){return t.map(i,PM(n,r))}}}let PZ=Object.freeze(Object.defineProperty({__proto__:null,ap:Pz,bimap:PV,both:PF,chain:PB,getTheseM:function(t){var n=PU(t),r=PV(t),i=P$(t),o=PK(t),a=PG(t),u=PP(t),s=function(t,r){return G(t,n(r))};return{map:s,bimap:function(t,n,i){return G(t,r(n,i))},mapLeft:function(t,n){return G(t,i(n))},fold:function(t,n,r,i){return G(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 G(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 G(t,r(n))},chain:function(t,n){return G(t,i(n))}}}}},left:PL,leftF:PW,map:PU,mapLeft:P$,match:Pq,matchE:PK,right:PP,rightF:PD,swap:PH,toTuple2:PG},Symbol.toStringTag,{value:"Module"}));var PJ=PL(Ov),PY=PP(Ov),PQ=PF(Ov),PX=PD(Og),P0=PW(Og),P1=V(Oo,PX),P2=V(Oo,P0),P3=Pq(Og),P4=PK(Ok),P5=PH(Og),P9=function(t,n){return G(t,P7(n))},P6=function(t,n,r){return G(t,Le(n,r))},P8=function(t,n){return G(t,Lt(n))},P7=PU(Og),Le=PV(Og),Lt=P$(Og),Ln="TaskThese",Lr=function(t,n){var r=Pz(t,n);return{URI:Ln,_E:void 0,map:P9,ap:function(t,n){return G(t,r(n))}}};function Li(t,n){var r=Lr(t,n).ap;return{URI:Ln,_E:void 0,map:P9,ap:r,of:PY}}function Lo(t){var n=Lr(OS,t),r=PB(Ok,t);return{URI:Ln,_E:void 0,map:P9,ap:n.ap,chain:function(t,n){return G(t,r(n))}}}var La={URI:Ln,map:P9},Lu=el(La),Ls={URI:Ln,fromEither:Od},Lc=oB(Ls),Ll=o$(Ls),Lf=oV(Ls),Ld={URI:Ln,fromThese:Od},Lp=y8(Ld),Lh={URI:Ln,fromIO:P1},Lm=gC(Lh),Lg={URI:Ln,fromIO:P1,fromTask:PX},Ly=y4(Lg),Lv=PG(Og),Lb=PY(eI),Lx=function(t){var n=Pj(t);return function(t){return V(OD(t),Ol(n(Z)))}},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(N9(n)){var r=a.right;return r.push(n.right),N9(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:P6,mapLeft:P8},FromEither:Ls,FromIO:Lh,FromTask:Lg,FromThese:Ld,Functor:La,Pointed:{URI:Ln,of:PY},URI:Ln,bifunctorTaskThese:{URI:Ln,bimap:P6,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:P9},getApplicative:Li,getApply:Lr,getChain:Lo,getMonad:function(t){var n=Li(OS,t),r=Lo(t);return{URI:Ln,_E:void 0,map:P9,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:P9,bimap:P6,mapLeft:P8},toTuple:Lw,toTuple2:Lv,traverseReadonlyArrayWithIndex:L_,traverseReadonlyArrayWithIndexSeq:LT,traverseReadonlyNonEmptyArrayWithIndex:Lx,traverseReadonlyNonEmptyArrayWithIndexSeq:LS},Symbol.toStringTag,{value:"Module"}));var LI=function(t,n){return G(t,LC(n))},LC=function(t){return function(n){return function(r){return t(n(r))}}},LM="Traced",LR={URI:LM,map:LI},LE=el(LR);let Lj=Object.freeze(Object.defineProperty({__proto__:null,Functor:LR,URI:LM,censor:function(t){return function(n){return function(r){return n(t(r))}}},flap:LE,getComonad:function(t){return{URI:LM,_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:LC,traced:LR,tracks:function(t,n){return function(r){return r(n(r(t.empty)))}}},Symbol.toStringTag,{value:"Module"}));function LA(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=LA(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 G(t,n(r))}},sequence:function(t){var n=a(t);return function(t){return G(t,n)}}}},sequence:LN,traverse:LA},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=LV(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 LV(t){var n=f_(t);return function(r,i){return G(r,n(function(n){return LB(t)(n,i)}))}}var L$=function(t,n){return G(t,L3(n))},Lq=function(t,n){return G(t,LX(function(t){return G(n,L3(t))}))},LK=function(t,n){return G(t,LX(n))},LH=function(t,n,r){return G(t,L4(n,r))},LG=function(t){var n=L5(t);return function(t,r){return G(t,n(r))}},LZ=function(t,n,r){return G(t,L9(n,r))},LJ=function(t,n){return G(t,L0(n))},LY=function(t){var n=L8(t);return function(t,r){return G(t,n(r))}},LQ=function(t){return function(n){return Lq(n,t)}},LX=function(t){return function(n){var r=t(n.value),i=r.value,o=r.forest,a=fM().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=G(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))})}},L9=function(t,n){return function(r){for(var i=t,o=r.forest.length,a=o-1;a>=0;a--)i=G(r.forest[a],L9(i,n));return n(r.value,i)}},L6=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}}}),G(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:L$},Fr=el(Fn),Fi={URI:Ft,map:L$,ap:Lq},Fo=e$(Fi),Fa=eq(Fi),Fu={URI:Ft,map:L$,ap:Lq,chain:LK},Fs=eX(Fu),Fc=Fe(eC),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:L$,ap:Lq,of:Fe},Apply:Fi,Chain:Fu,Comonad:{URI:Ft,map:L$,extend:LJ,extract:L6},Do:Fc,Foldable:{URI:Ft,reduce:LH,foldMap:LG,reduceRight:LZ},Functor:Fn,Monad:{URI:Ft,map:L$,ap:Lq,of:Fe,chain:LK},Pointed:{URI:Ft,of:Fe},Traversable:{URI:Ft,map:L$,reduce:LH,foldMap:LG,reduceRight:LZ,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:L6,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:L9,sequence:L7,traverse:L8,tree:{URI:Ft,map:L$,of:Fe,ap:Lq,chain:LK,reduce:LH,foldMap:LG,reduceRight:LZ,traverse:LY,sequence:L7,extract:L6,extend:LJ},unfoldForest:Lz,unfoldForestM:LV,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 G(t,FE(n))},Fx=function(t,n){return G(t,FM(n))},F_=function(t,n,r){return G(t,FC(n,r))},FS=function(t,n){return G(t,FR(n))},FT=function(t,n){return G(t,Fj(n))},Fw=function(t,n,r){return G(t,FP(n,r))},FO=function(t){var n=FN();return function(t,r){return G(t,n(r))}},Fk=function(t,n,r){return G(t,FL(n,r))};function FI(t){var n=FF(t);return function(t,r){return G(t,n(r))}}var FC=function(t,n){return function(r){var i;return[n((i=r,i[0])),t(Rp(r))]}},FM=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)]}},Fj=function(t){return function(n){return[t(n),Rp(n)]}},FA=Fj(F),FN=RN,FP=RA,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:FC,compose:FE,duplicate:FA,extend:Fj,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:FM,mapFst:FM,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"})),FV=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),F$=Object.freeze(Object.defineProperty({__proto__:null,getValidationM:function(t,n){var r=oU(n,hG(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 Fq=t_(void 0),FK={concat:Fq.concat,empty:void 0};let FH=Object.freeze(Object.defineProperty({__proto__:null,Monoid:FK,Semigroup:Fq},Symbol.toStringTag,{value:"Module"}));var FG=function(t){return function(){return[void 0,t]}},FZ=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 G(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 F9={URI:F1,map:FX},F6=el(F9),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:F9,URI:F1,censor:FQ,evalWriter:De,evaluate:F8,execWriter:Dt,execute:F7,flap:F6,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:FZ,listens:FY,map:F0,pass:FJ,tell:FG,writer:F9},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:f6,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:hC,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:y6,fromThese:y7,function:Y,functor:ep,functorWithIndex:vt,group:vn,heytingAlgebra:vr,hkt:vi,identity:vW,invariant:vU,io:ba,ioEither:xm,ioOption:_j,ioRef:_N,joinSemilattice:_P,json:_D,lattice:_W,magma:tv,map:Tk,meetSemilattice:TI,monad:TC,monadIO:TM,monadTask:TR,monadThrow:TE,monoid:Tq,naturalTransformation:TK,nonEmptyArray:uv,number:uM,option:ht,optionT:xA,ord:td,ordering:TX,pipeable:T0,pointed:T1,predicate:dD,profunctor:T2,random:T6,reader:yf,readerEither:w8,readerT:Oi,readerTask:kD,readerTaskEither:Mq,readonlyArray:c1,readonlyMap:SU,readonlyNonEmptyArray:ra,readonlyRecord:i6,readonlySet:Rf,readonlyTuple:Rz,record:ET,refinement:Ej,ring:EP,semigroup:tN,semigroupoid:EL,semiring:EF,separated:eB,set:E4,show:E6,state:yJ,stateReaderTaskEither:AI,stateT:ja,store:AD,string:rO,strong:Az,struct:A$,task:OG,taskEither:Cn,taskOption:N3,taskThese:Lk,these:PN,theseT:PZ,traced:Lj,traversable:LP,traversableWithIndex:LL,tree:Fh,tuple:FB,unfoldable:FV,validationT:F$,void:FH,witherable:rM,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 DC(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):DC(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 DM={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(DM,t)||(DM[t]=DC(Dc.tuple,t-1,[])),DM[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 DC(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 Dj={};function DA(t,n){return function(r){return function(i){return t.map(i,function(t){return n.map(t,r)})}}}Object.defineProperty(Dj,"__esModule",{value:!0}),Dj.getFunctorComposition=Dj.bindTo=Dj.flap=Dj.map=void 0,Dj.map=DA,Dj.flap=function(t){return function(n){return function(r){return t.map(r,function(t){return t(n)})}}},Dj.bindTo=function(t){return function(n){return function(r){return t.map(r,function(t){var r;return(r={})[n]=t,r})}}},Dj.getFunctorComposition=function(t,n){var r=DA(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,Dj.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 DV(t){var n=DB(t);return function(t){var r=n(t);return function(t){return(0,Dc.flow)(t,r)}}}function D$(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=DV,DF.chainOptionK=function(t,n){var r=DV(t);return function(t){var i=r(t);return function(t){return function(r){return n.chain(r,i(t))}}}},DF.fromEitherK=D$,DF.chainEitherK=function(t,n){var r=D$(t);return function(t){return function(i){return n.chain(i,r(t))}}},DF.chainFirstEitherK=function(t,n){return(0,Dc.flow)(D$(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 Dq,DK,DH,DG,DZ,DJ,DY,DQ,DX,D0,D1={};Object.defineProperty(Dq=D1,"__esModule",{value:!0}),Dq.right=Dq.left=Dq.flap=Dq.Functor=Dq.Bifunctor=Dq.URI=Dq.bimap=Dq.mapLeft=Dq.map=Dq.separated=void 0,DK=function(t,n){return{left:t,right:n}},Dq.separated=DK,DH=function(t,n){return(0,Dc.pipe)(t,(0,Dq.map)(n))},DG=function(t,n){return(0,Dc.pipe)(t,(0,Dq.mapLeft)(n))},DZ=function(t,n,r){return(0,Dc.pipe)(t,(0,Dq.bimap)(n,r))},DJ=function(t){return function(n){return(0,Dq.separated)((0,Dq.left)(n),t((0,Dq.right)(n)))}},Dq.map=DJ,DY=function(t){return function(n){return(0,Dq.separated)(t((0,Dq.left)(n)),(0,Dq.right)(n))}},Dq.mapLeft=DY,DQ=function(t,n){return function(r){return(0,Dq.separated)(t((0,Dq.left)(r)),n((0,Dq.right)(r)))}},Dq.bimap=DQ,Dq.URI="Separated",Dq.Bifunctor={URI:Dq.URI,mapLeft:DG,bimap:DZ},Dq.Functor={URI:Dq.URI,map:DH},Dq.flap=(0,Dj.flap)(Dq.Functor),DX=function(t){return t.left},Dq.left=DX,D0=function(t){return t.right},Dq.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 D9=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?D9.some(r):D9.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))}},W9=function(t,n,r){return(0,Dc.pipe)(t,(0,WJ.reduceRight)(n,r))},W6=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:W6,sequence:WJ.sequence,reduce:W4,foldMap:W5,reduceRight:W9,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:W9},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:W9,traverse:W6,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,Dj.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,UC=function(t,n){try{return(0,WJ.right)(t())}catch(r){return(0,WJ.left)(n(r))}},WJ.tryCatch=UC,UM=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=UM,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)}},Uj=function(t){return function(n){return!(0,WJ.isLeft)(n)&&t(n.right)}},WJ.exists=Uj,WJ.Do=(0,WJ.of)(W0.emptyRecord),WJ.bindTo=(0,Dj.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),UA=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=UA,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:W9,traverse:W6,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:W9,extend:Ut,traverse:W6,sequence:WJ.sequence,chainRec:Un,throwError:WJ.throwError,ap:n,alt:r}};var D6=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(WC.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=!W$.is(t),a=0;a<n.length;a++){var u=n[a];u!==t&&(r=!1),W$.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 D6(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 D6(n,t),n}(Wt),WC=new WI,WM=function(t){function n(){var n=t.call(this,"void",WC.is,WC.validate,Wn)||this;return n._tag="VoidType",n}return D6(n,t),n}(Wt),WR=new WM,WE=function(t){function n(){var n=t.call(this,"unknown",function(t){return!0},eS,Wn)||this;return n._tag="UnknownType",n}return D6(n,t),n}(Wt),Wj=new WE,WA=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 D6(n,t),n}(Wt),WN=new WA,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 D6(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 D6(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 D6(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 D6(n,t),n}(Wt),WB=new Wz,WV=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 D6(n,t),n}(Wt),W$=new WV,Wq=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 D6(n,t),n}(Wt);function WK(t,n){void 0===n&&(n=JSON.stringify(t));var r=function(n){return n===t};return new Wq(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 D6(n,t),n}(Wt),WG=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 D6(n,t),n}(Wt);function WZ(t,n,r){return zl(t,n,r)}var WJ,WY,WQ,WX,W0,W1,W2,W3,W4,W5,W9,W6,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,UC,UM,UR,UE,Uj,UA,UN,UP,UL,UF,UD,UW,UU,Uz,UB=zl(WL,Uz=function(t){return Number.isInteger(t)},"Int"),UV=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 D6(n,t),n}(Wt);function U$(t,n){var r,i=function(){return r||((r=n(o)).name=t),r},o=new UV(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(UV.prototype,"type",{get:function(){return this.runDefinition()},enumerable:!0,configurable:!0});var Uq=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 D6(n,t),n}(Wt);function UK(t,n){return void 0===n&&(n="Array<".concat(t.name,">")),new Uq(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 D6(n,t),n}(Wt);function UG(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(W$.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=W$.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 UZ=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 D6(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 D6(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 W$.is(t)&&i.every(function(r){return n.is(t[r])})},function(t,r){var o=W$.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 W$.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(W$.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 D6(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(W$.is(n)){var r=u(n[i]);return void 0!==r&&t[r].is(n)}return!1},function(n,r){var o=W$.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 D6(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 D6(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 D6(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 D6(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 U6(UG(t),n)},U9=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 D6(n,t),n}(Wt);function U6(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 U9(n,t.is,function(n,r){var i=W$.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 D6(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 D6(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 D6(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 D6(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 D6(n,t),n}(Wt),zc=new zs;function zl(t,n,r){return void 0===r&&(r="(".concat(t.name," | ").concat(Wr(n),")")),new WG(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 D6(n,t),n}(Wt);function zp(t){return t}let zh=Object.freeze(Object.defineProperty({__proto__:null,AnyArrayType:Wz,AnyDictionaryType:WV,AnyType:za,Array:WB,ArrayType:Uq,BigIntType:WF,BooleanType:WW,Dictionary:W$,DictionaryType:UJ,ExactType:U9,Function:U7,FunctionType:U8,Int:UB,Integer:zf,InterfaceType:UH,IntersectionType:U0,KeyofType:WH,LiteralType:Wq,NeverType:zi,NullType:WO,NumberType:WP,ObjectType:zs,PartialType:UZ,ReadonlyArrayType:U3,ReadonlyType:U2,RecursiveType:UV,RefinementType:WG,StrictType:zd,StringType:WA,TaggedUnionType:ze,TupleType:U1,Type:Wt,UndefinedType:WI,UnionType:UQ,UnknownArray:WB,UnknownRecord:W$,UnknownType:WE,VoidType:WM,alias:function(t){return function(){return t}},any:zu,appendContext:Wi,array:UK,bigint:WD,boolean:WU,brand:WZ,clean:zp,dictionary:UY,emptyTags:Wg,exact:U6,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:UG,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 UZ(n,function(n){if(W$.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=W$.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:U$,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:UG,undefined:WC,union:UX,unknown:Wj,void:WR,voidType:WR},Symbol.toStringTag,{value:"Module"})),zm=k(zh);var zg={};Object.defineProperty(zg,"__esModule",{value:!0}),zg.ContentPath=void 0,zg.ContentPath={serialize:t=>t.map(t=>t.key).join("::"),current:t=>t[t.length-1],append:(t,n)=>t+"::"+n,make:t=>t.reduce((t,{key:n,type:r})=>n?t.concat({key:n,type:r}):t,[])};var zy={},zv={};Object.defineProperty(zv,"__esModule",{value:!0}),zv.getAssetOrThrow=void 0;let zb=t=>n=>{let r=t[n];if(!r)throw Error(`Missing asset with id '${n}'!`);return r};zv.getAssetOrThrow=zb;var zx={};Object.defineProperty(zx,"__esModule",{value:!0}),zx.getEmbedOrThrow=void 0;let z_=t=>n=>{let r=t[n];if(!r)throw Error(`Missing embed with url '${n}'`);return r};zx.getEmbedOrThrow=z_;var zS={},zT={};let zw=k(Y);function zO(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 zk=Object.freeze(Object.defineProperty({__proto__:null,mapOutput:zO},Symbol.toStringTag,{value:"Module"}));var zI,zC,zM,zR=zl(WN,zC=function(t){return t.length>0},"NonEmptyString");function zE(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 G(r.validate(t,n),h4(function(r){var i=o7(r);return pj(i)?We(t,n):eS(i.value)}))},function(t){return r.encode(t)})}function zj(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 G(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 zA(t,n){return new Wt(t,n,function(t,r){return n(t)?eS(t):We(t,r)},Wn)}var zN=zA("Date",function(t){return t instanceof Date}),zP=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))},zL=function(t,n){return{get:t,reverseGet:n}},zF=function(t){return zz(t.get,V(t.reverseGet,D))},zD=function(t){return zQ(V(t.get,ev),t.reverseGet)},zW=function(t){return z3(V(t.get,ev),V(t.reverseGet,D))},zU=function(t){return z7(function(n){return function(r){return function(i){return n.map(r(t.get(i)),function(n){return t.reverseGet(n)})}}})},zz=function(t,n){return{get:t,set:n}},zB=function(t){return z3(V(t.get,ev),t.set)},zV=function(t){return z7(function(n){return function(r){return function(i){return n.map(r(t.get(i)),function(n){return t.set(n)(i)})}}})},z$=function(t){return function(n){return zz(function(r){return t.get(n.get(r))},function(r){return function(i){return n.set(t.set(r)(n.get(i)))(i)}})}},zq=function(t){return function(n){return zQ(V(n.getOption,pn(t.getOption)),V(t.reverseGet,n.reverseGet))}},zK=function(t){return function(n){return z6(zX(t))(zB(n))}},zH=function(){return zz(F,D)},zG=function(t){return function(n){return zz(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)}})}},zZ=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return function(n){return zz(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}})}},zJ=function(t){return function(n){return zz(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)}})}},zY=function(t){return function(n){var r;return G(n,z$(({at:r=function(t){return zz(function(n){return r$(t,n)},pA(function(){return rU(t)},function(n){return rD(t,n)}))}}).at(t)))}},zQ=function(t,n){return{getOption:t,reverseGet:n}},zX=function(t){return z3(t.getOption,function(n){return z1(n)(t)})},z0=function(t){return z7(function(n){return function(r){return function(i){return G(t.getOption(i),pA(function(){return n.of(i)},function(o){return n.map(r(o),function(n){return z1(n)(t)(i)})}))}}})},z1=function(t){var n;return n=function(){return t},function(t){var r,i,o=(r=t,function(t){return G(r.getOption(t),d9(function(i){var o=n(i);return o===i?t:r.reverseGet(o)}))});return function(t){return G(o(t),pN(function(){return t}))}}},z2=function(t){return zQ(dW(t),F)},z3=function(t,n){return{getOption:t,set:n}},z4=function(t){return z7(function(n){return function(r){return function(i){return G(t.getOption(i),pA(function(){return n.of(i)},function(o){return n.map(r(o),function(n){return t.set(n)(i)})}))}}})},z5=function(t){return function(n){return function(r){return G(n.getOption(r),d9(function(i){var o=t(i);return o===i?r:n.set(o)(r)}))}}},z9=function(t){return function(n){var r=z5(t)(n);return function(t){return G(r(t),pN(function(){return t}))}}},z6=function(t){return function(n){return z3(V(n.getOption,pn(t.getOption)),function(r){return z9(t.set(r))(n)})}},z8=function(t,n,r){if(r[t]===n)return r;var i=zP([r[0]],r.slice(1),!0);return i[t]=n,i},z7=function(t){return{modifyF:t}};function Be(t){return function(n){return z7(function(r){return function(i){return n.modifyF(r)(t.modifyF(r)(i))}})}}var Bt={URI:"Identity",map:function(t,n){return n(t)},of:F,ap:function(t,n){return t(n)}},Bn=function(t){return{index:t}},Br=V(zF,z$),Bi=function(t){return V(zB,z6(t))},Bo=function(t){return V(zV,Be(t))},Ba=function(t){return function(n){return function(r){var i=n.get(r),o=t(i);return i===o?r:n.set(o)(r)}}},Bu=function(t){return zK(zQ(pV,F))(t)},Bs=function(t){var n;return V(zB,function(n){return G(n,z6(Bn(function(t){return z3(function(n){return uq(t,n)},function(n){return function(r){return G(uq(t,r),pA(function(){return r},function(){return cV(t,n,r)}))}})}).index(t)))})},Bc=function(t){var n;return V(zB,function(n){return G(n,z6(Bn(function(t){return z3(function(n){return uq(t,n)},function(n){return function(r){return G(uq(t,r),pA(function(){return r},function(){return z8(t,n,r)}))}})}).index(t)))})},Bl=function(t){var n;return V(zB,function(n){return G(n,z6(Bn(function(t){return z3(function(n){return r$(t,n)},function(n){return function(r){return r[t]===n||pj(r$(t,r))?r:rD(t,n)(r)}})}).index(t)))})},Bf=zK(zQ(F,ev)),Bd=zK(zQ(dz,eS)),Bp=zK(zQ(function(t){return ml(t)?ev(t.left):ey},e_)),Bh=function(t,n){return function(r){return Bm(r,t,n)}},Bm=function(t,n,r){return zz(V(t.get,n),V(r,t.set))},Bg="monocle-ts/Lens",By={URI:Bg,compose:function(t,n){return z$(t)(n)}},Bv={URI:Bg,compose:By.compose,id:zH};let Bb=Object.freeze(Object.defineProperty({__proto__:null,Category:Bv,Invariant:{URI:Bg,imap:Bm},Semigroupoid:By,URI:Bg,asOptional:zB,asTraversal:zV,atKey:zY,component:zJ,compose:z$,composeIso:Br,composeLens:z$,composeOptional:Bi,composePrism:zK,composeTraversal:Bo,filter:function(t){return zK(z2(t))},findFirst:function(t){var n;return Bi(z3(u2(t),function(n){return function(r){return G(u1(t)(r),pA(function(){return r},function(t){return cV(t,n,r)}))}}))},findFirstNonEmpty:function(t){var n;return Bi(z3(u2(t),function(n){return function(r){return G(u1(t)(r),pA(function(){return r},function(t){return z8(t,n,r)}))}}))},fromNullable:Bu,id:zH,imap:Bh,index:Bs,indexNonEmpty:Bc,key:Bl,left:Bp,lens:zz,modify:Ba,modifyF:function(t){return function(n){return function(r){return function(i){return G(r.get(i),n,function(n){return t.map(n,function(t){return r.set(t)(i)})})}}}},prop:zG,props:zZ,right:Bd,some:Bf,traverse:function(t){var n,r;return V(zV,Be(z7(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 Bx=function(t){return function(n){return n.modifyF(Bt)(t)}},B_=function(t){return new BI(t.get,t.reverseGet)},BS=function(t){return new BC(t.get,t.set)},BT=function(t){return new BM(t.getOption,t.reverseGet)},Bw=function(t){return new BE(t.getOption,t.set)},BO=function(t){return new Bj(t.modifyF)},Bk=function(t,n,r){var i;return r===t[n]?t:Object.assign({},t,((i={})[n]=r,i))},BI=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 B_(zL(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 BS(zF(this))},t.prototype.asPrism=function(){return BT(zD(this))},t.prototype.asOptional=function(){return Bw(zW(this))},t.prototype.asTraversal=function(){return BO(zU(this))},t.prototype.asFold=function(){var t=this;return new BN(function(){return function(n){return function(r){return n(t.get(r))}}})},t.prototype.asGetter=function(){var t=this;return new BA(function(n){return t.get(n)})},t.prototype.asSetter=function(){var t=this;return new BP(function(n){return t.modify(n)})},t.prototype.compose=function(t){var n,r;return B_((r=this,zL(V(r.get,t.get),V(t.reverseGet,r.reverseGet))))},t.prototype.composeIso=function(t){return this.compose(t)},t.prototype.composeLens=function(t){return BS(G(this,zF,z$(t)))},t.prototype.composePrism=function(t){return BT(G(this,zD,zq(t)))},t.prototype.composeOptional=function(t){return Bw(G(this,zW,z6(t)))},t.prototype.composeTraversal=function(t){return BO(G(this,zU,Be(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}(),BC=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 BS(G(zH(),zG(t)))}},t.fromProps=function(){return function(t){return BS(G(zH(),zZ.apply(Bb,t)))}},t.fromNullableProp=function(){return function(n,r){return new t(function(t){var i=pV(t[n]);return pj(i)?r:i.value},function(t){return function(r){return Bk(r,n,t)}})}},t.prototype.modify=function(t){return Ba(t)(this)},t.prototype.asOptional=function(){return Bw(zB(this))},t.prototype.asTraversal=function(){return BO(zV(this))},t.prototype.asSetter=function(){var t=this;return new BP(function(n){return t.modify(n)})},t.prototype.asGetter=function(){var t=this;return new BA(function(n){return t.get(n)})},t.prototype.asFold=function(){var t=this;return new BN(function(){return function(n){return function(r){return n(t.get(r))}}})},t.prototype.compose=function(t){return BS(z$(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 Bw(G(this,zB,z6(t)))},t.prototype.composeTraversal=function(t){return BO(G(this,zV,Be(t)))},t.prototype.composeSetter=function(t){return this.asSetter().compose(t)},t.prototype.composeIso=function(t){return BS(G(this,z$(G(t,zF))))},t.prototype.composePrism=function(t){return Bw(zK(t)(this))},t}(),BM=function(){function t(t,n){this.getOption=t,this.reverseGet=n,this._tag="Prism"}return t.fromPredicate=function(t){return BT(z2(t))},t.some=function(){return BR},t.prototype.modify=function(t){var n=this;return function(r){var i=n.modifyOption(t)(r);return pj(i)?r:i.value}},t.prototype.modifyOption=function(t){var n=this;return function(r){return p9.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 Bw(zX(this))},t.prototype.asTraversal=function(){return BO(z0(this))},t.prototype.asSetter=function(){var t=this;return new BP(function(n){return t.modify(n)})},t.prototype.asFold=function(){var t=this;return new BN(function(n){return function(r){return function(i){var o=t.getOption(i);return pj(o)?n.empty:r(o.value)}}})},t.prototype.compose=function(t){return BT(zq(t)(this))},t.prototype.composePrism=function(t){return this.compose(t)},t.prototype.composeOptional=function(t){return Bw(G(this,zX,z6(t)))},t.prototype.composeTraversal=function(t){return BO(G(this,z0,Be(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 BT(G(this,zq(G(t,zD))))},t.prototype.composeLens=function(t){var n;return Bw((n=t,function(t){return z6(zB(n))(zX(t))})(this))},t.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},t}(),BR=new BM(F,ev),BE=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 pV(t[n])},function(t){return function(r){return null==r[n]?r:Bk(r,n,t)}})}},t.fromOptionProp=function(){var t=BC.fromProp();return function(n){return t(n).composePrism(BR)}},t.prototype.modify=function(t){return z9(t)(this)},t.prototype.modifyOption=function(t){return z5(t)(this)},t.prototype.asTraversal=function(){return BO(z4(this))},t.prototype.asFold=function(){var t=this;return new BN(function(n){return function(r){return function(i){var o=t.getOption(i);return pj(o)?n.empty:r(o.value)}}})},t.prototype.asSetter=function(){var t=this;return new BP(function(n){return t.modify(n)})},t.prototype.compose=function(t){return Bw(z6(t)(this))},t.prototype.composeOptional=function(t){return this.compose(t)},t.prototype.composeTraversal=function(t){return BO(G(this,z4,Be(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 Bw(G(this,z6(G(t,zB))))},t.prototype.composePrism=function(t){return Bw(G(this,z6(G(t,zX))))},t.prototype.composeIso=function(t){return Bw(G(this,z6(G(t,zW))))},t.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},t}(),Bj=function(){function t(t){this.modifyF=t,this._tag="Traversal"}return t.prototype.modify=function(t){return Bx(t)(this)},t.prototype.set=function(t){var n;return Bx(function(){return t})(this)},t.prototype.filter=function(t){var n;return BO(Be(z0(z2(t)))(this))},t.prototype.asFold=function(){var t=this;return new BN(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 BP(function(n){return t.modify(n)})},t.prototype.compose=function(t){return BO(Be(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 BO(G(this,Be(G(t,zV))))},t.prototype.composePrism=function(t){return BO(G(this,Be(G(t,z0))))},t.prototype.composeIso=function(t){return BO(G(this,Be(G(t,zU))))},t.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},t}(),BA=function(){function t(t){this.get=t,this._tag="Getter"}return t.prototype.asFold=function(){var t=this;return new BN(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}(),BN=function(){function t(t){this.foldMap=t,this._tag="Fold",this.getAll=t(fM())(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}(),BP=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}(),BL=new BI(F,F),BF=U5({_tag:WK("None")}),BD=WK("Some");function BW(t,n){return void 0===n&&(n="Option<"+t.name+">"),UX([BF,U5({_tag:BD,value:t},"Some<"+t.name+">")],n)}var BU=new Wt("DateFromISOString",function(t){return t instanceof Date},function(t,n){return G(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 Bz(t){var n=Object.create(Object.getPrototypeOf(t));return Object.assign(n,t),n}var BB=new Wt("DateFromNumber",function(t){return t instanceof Date},function(t,n){return G(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 BV(t,n,r){void 0===r&&(r=t.name);var i=Bz(t);return i.validate=n,i.decode=function(t){return n(t,zr(i))},i.name=r,i}var B$,Bq,BK,BH=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,BG=zl(WN,Bq=function(t){return BH.test(t)},"UUID"),BZ=new Wt("BooleanFromString",WU.is,function(t,n){return G(WN.validate(t,n),h4(function(r){return"true"===r?eS(!0):"false"===r?eS(!1):We(t,n)}))},String);function BJ(t){switch(t._tag){case"InterfaceType":return t.props;case"ExactType":return BJ(t.type)}}var BY=BC.fromProp(),BQ=zA("RegExp",function(t){return"[object RegExp]"===Object.prototype.toString.call(t)}),BX=new Wt("DateFromUnixTime",function(t){return t instanceof Date},function(t,n){return G(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)}),B0=new Wt("NumberFromString",WL.is,function(t,n){return G(WN.validate(t,n),h4(function(r){var i=+r;return isNaN(i)||""===r.trim()?We(t,n):eS(i)}))},String),B1=new Wt("IntFromString",UB.is,function(t,n){return G(B0.validate(t,n),h4(function(r){return UB.is(r)?eS(r):We(t,n)}))},B0.encode),B2=U$("JsonArray",function(){return U4(B4)}),B3=U$("JsonRecord",function(){return UY(WN,B4)}),B4=UX([WU,WL,WN,Wk,B2,B3],"Json"),B5=new Wt("JsonFromString",B4.is,function(t,n){try{return eS(JSON.parse(t))}catch{return We(t,n)}},function(t){return JSON.stringify(t)}),B9=WK("Left"),B6=WK("Right"),B8=new Wt("BigIntFromString",function(t){return"bigint"==typeof t},function(t,n){return G(WN.validate(t,n),h4(function(r){if(!zR.is(r.trim()))return We(t,n);try{return eS(BigInt(r))}catch{return We(t,n)}}))},String),B7=new Wt("BooleanFromNumber",WU.is,function(t,n){return G(WL.validate(t,n),hJ(function(t){return 0!==t}))},Number);let Ve=Object.freeze(Object.defineProperty({__proto__:null,BigIntFromString:B8,BooleanFromNumber:B7,BooleanFromString:BZ,DateFromISOString:BU,DateFromNumber:BB,DateFromUnixTime:BX,IntFromString:B1,Json:B4,JsonArray:B2,JsonFromString:B5,JsonRecord:B3,NonEmptyString:zR,NumberFromString:B0,UUID:BG,clone:Bz,date:zN,either:function(t,n,r){return void 0===r&&(r="Either<"+t.name+", "+n.name+">"),UX([U5({_tag:B9,left:t},"Left<"+t.name+">"),U5({_tag:B6,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 G(t.validate(n,r),hJ(BL.wrap))},function(n){return t.encode(BL.unwrap(n))})},fromNullable:function(t,n,r){return void 0===r&&(r="fromNullable("+t.name+")"),BV(t,function(r,i){return null==r?eS(n):t.validate(r,i)},r)},fromRefinement:zA,getLenses:function(t){var n={};for(var r in BJ(t))n[r]=BY(r);return n},mapOutput:zO,nonEmptyArray:zE,option:BW,optionFromNullable:function(t,n){return void 0===n&&(n="Option<"+t.name+">"),new Wt(n,BW(t).is,function(n,r){return null==n?eS(ey):G(t.validate(n,r),hJ(ev))},function(n){return pG(G(n,d9(t.encode)))})},readonlyNonEmptyArray:function(t,n){return void 0===n&&(n="ReadonlyNonEmptyArray<"+t.name+">"),zE(t,n)},readonlySetFromArray:function(t,n,r){return void 0===r&&(r="ReadonlySet<"+t.name+">"),zj(t,n,r)},regexp:BQ,setFromArray:zj,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+")"),BV(t,function(r,i){return mw(function(){return eS(n)})(t.validate(r,i))},r)},withMessage:function(t,n){return BV(t,function(r,i){return mr(function(){return[{value:r,context:i,message:n(r,i),actual:r}]})(t.validate(r,i))})},withValidate:BV},Symbol.toStringTag,{value:"Module"})),Vt=k(Ve),Vn=k(zk);Object.defineProperty(zT,"__esModule",{value:!0}),zT.withCustomError=zT.addType=zT.isEmpty=zT.objectToMap=zT.grouped=zT.formatDate=zT.formatDateTime=zT.filterDouble=zT.refineType=zT.nullable=void 0;let Vr=oN,Vi=(0,Vr.__importStar)(zm);zT.nullable=function(t){return Vi.union([t,Vi.null,Vi.undefined])},zT.refineType=function(t,n,r){return new Vi.Type(n,t.is,(n,i)=>(0,zw.pipe)(t.validate(n,i),Do.either.chain(t=>r(t)?Vi.success(t):Vi.failure(n,i))),t.encode)},zT.filterDouble=function(t){if(""===t)return null;let n=Number(t);return Number.isNaN(n)?null:n},zT.formatDateTime=function(t){return t.toISOString().replace(/\.\d{3}Z$/,"+0000")},zT.formatDate=function(t){return t.toISOString().replace(/T.*/,"")},zT.grouped=function(t,n){return t.reduce((t,r,i)=>(i%n==0?t.push([r]):t[Math.floor(i/n)].push(r),t),[])},zT.objectToMap=function(t){return new Map(Object.entries(t))},zT.isEmpty=function(t){for(let n in t)return!1;return!0},zT.addType=function(t,n){return(0,Vn.mapOutput)(t,t=>({...t,__TYPE__:n}))},zT.withCustomError=function(t,n){return(0,Vt.withValidate)(t,(r,i)=>Do.either.mapLeft(t=>t.find(t=>t.message)?t:[{value:r,context:i,message:n(r,i),actual:r}])(t.validate(r,i)))},Object.defineProperty(zS,"__esModule",{value:!0}),zS.WidgetKey=void 0;let Vo=oN,Va=(0,Vo.__importStar)(zm),Vu=RegExp("^[^<>]+$");zS.WidgetKey=(0,zT.refineType)(Va.string,"WidgetKey",t=>0===t.length||Vu.test(t)),function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=oN;(0,n.__exportStar)(zv,t),(0,n.__exportStar)(zx,t),(0,n.__exportStar)(zS,t)}(zy);var Vs={},Vc={},Vl={},Vf={},Vd={};Object.defineProperty(Vd,"__esModule",{value:!0}),Vd.clone=void 0,Vd.clone=function(t){var n=Object.create(Object.getPrototypeOf(t));return Object.assign(n,t),n};var Vp=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]}),Vh=O&&O.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),Vm=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)&&Vp(n,t,r);return Vh(n,t),n};Object.defineProperty(Vf,"__esModule",{value:!0}),Vf.withValidate=void 0;var Vg=Vm(zm);Vf.withValidate=function(t,n,r){void 0===r&&(r=t.name);var i=Vd.clone(t);return i.validate=n,i.decode=function(t){return n(t,Vg.getDefaultContext(i))},i.name=r,i};var Vy=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]}),Vv=O&&O.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),Vb=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)&&Vy(n,t,r);return Vv(n,t),n};Object.defineProperty(Vl,"__esModule",{value:!0}),Vl.withFallback=void 0;var Vx=Vb(zm);Vl.withFallback=function(t,n,r){return void 0===r&&(r="withFallback("+t.name+")"),Vf.withValidate(t,function(r,i){return Da.orElse(function(){return Vx.success(n)})(t.validate(r,i))},r)};var V_={},VS={};Object.defineProperty(VS,"__esModule",{value:!0}),VS.EmptyArray=VS.EmptyObject=VS.Boolean=VS.NumberOrNull=VS.Number=VS.StringOrNull=VS.String=void 0;let VT=oN,Vw=(0,VT.__importStar)(zm);VS.String=(0,zT.withCustomError)(Vw.string,()=>"The value must be a string"),VS.StringOrNull=(0,zT.withCustomError)(Vw.union([Vw.string,Vw.null]),()=>"The value must be a string or null"),VS.Number=(0,zT.withCustomError)(Vw.number,()=>"The value must be a number"),VS.NumberOrNull=(0,zT.withCustomError)(Vw.union([Vw.number,Vw.null]),()=>"The value must be a number or null"),VS.Boolean=(0,zT.withCustomError)(Vw.boolean,()=>"The value must be a boolean"),VS.EmptyObject=Vw.UnknownRecord.pipe(new Vw.Type("emptyObject",t=>Vw.UnknownRecord.is(t),(t,n)=>Object.keys(t).length>0?Vw.failure(t,n,"The object is not empty."):Vw.success({}),Vw.identity)),VS.EmptyArray=new Vw.Type("emptyArray",t=>Vw.UnknownArray.is(t)&&0===t.length,(t,n)=>(0,Dc.pipe)(Vw.UnknownArray.decode(t),Do.either.chain(r=>r.length>0?Vw.failure(t,n,"The array is not empty."):Vw.success([]))),()=>[]);var VO={};let Vk=k(mK);var VI={};Object.defineProperty(VI,"__esModule",{value:!0});let VC=oN,VM=(0,VC.__importStar)(zm);VI.default=new VM.Type("dateFromStringOrNumber",t=>t instanceof Date,(t,n)=>(0,zw.pipe)(VM.union([VM.number,VM.string]).validate(t,n),(0,Vk.chain)(r=>{let i=new Date(r);return isNaN(i.getTime())?VM.failure(t,n):VM.success(i)})),t=>t);var VR={};Object.defineProperty(VR,"__esModule",{value:!0});let VE=oN,Vj=(0,VE.__importStar)(zm);VR.default=new Vj.Type("dateFromTsMs",t=>t instanceof Date,(t,n)=>(0,zw.pipe)(Vj.number.validate(t,n),(0,Vk.chain)(r=>{let i=new Date(r);return isNaN(i.getTime())?Vj.failure(t,n):Vj.success(i)})),t=>t.getTime());var VA={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.EmptyArrayOrElse=t.EmptyObjectOrElse=t.NullOrElse=t.DefaultOrElse=void 0;let n=oN,r=(0,n.__importStar)(zm),i=t=>n=>new r.Type(`DefaultOrElse<${t.name}, ${n.name}>`,t=>null===t||n.is(t),(i,o)=>(0,Da.isRight)(t.validate(i,o))?r.success(null):n.validate(i,o),t=>t?n.encode(t):void 0);t.DefaultOrElse=i;let o=n=>(0,t.DefaultOrElse)(r.null)(n);t.NullOrElse=o;let a=n=>(0,t.DefaultOrElse)(VS.EmptyObject)(n);t.EmptyObjectOrElse=a;let u=n=>(0,t.DefaultOrElse)(VS.EmptyArray)(n);t.EmptyArrayOrElse=u}(VA);var VN={};Object.defineProperty(VN,"__esModule",{value:!0});let VP=oN,VL=(0,VP.__importStar)(zm);VN.default=new VL.Type("IntFromNumber",VL.Int.is,(t,n)=>(0,zw.pipe)(VL.number.validate(t,n),(0,Vk.chain)(t=>VL.Int.is(t)?VL.success(t):VL.success(Math.round(t)))),VL.Int.encode);var VF={};Object.defineProperty(VF,"__esModule",{value:!0});let VD=oN,VW=(0,VD.__importStar)(zm),VU=/^([0-9]+)px$/;VF.default=new VW.Type("IntFromPixels",VW.Int.is,(t,n)=>(0,zw.pipe)(VW.string.validate(t,n),(0,Vk.chain)(r=>{try{let i=r.match(VU);if(!i)return VW.failure(t,n);let o=parseInt(i[1]);return VW.success(o)}catch{return VW.failure(t,n)}})),String);var Vz={};Object.defineProperty(Vz,"__esModule",{value:!0});let VB=oN,VV=(0,VB.__importStar)(zm);Vz.default=(0,zT.withCustomError)((0,zT.refineType)(VV.string,"nonEmptyString",t=>t.trim().length>0),()=>"The value must be a non-empty string");var V$={},Vq={};Object.defineProperty(Vq,"__esModule",{value:!0});let VK=oN,VH=(0,VK.__importStar)(zm);Vq.default=(0,zT.nullable)(VH.string),Object.defineProperty(V$,"__esModule",{value:!0});let VG=oN,VZ=(0,VG.__importDefault)(Vq);V$.default=new zm.Type("nonEmptyStringOrNull",t=>"string"==typeof t||null===t,(t,n)=>(0,zw.pipe)(VZ.default.validate(t,n),(0,Vk.chain)(t=>"string"==typeof t&&t.length>0?(0,zm.success)(t):(0,zm.success)(null))),t=>t);var VJ={};Object.defineProperty(VJ,"__esModule",{value:!0});let VY=oN,VQ=(0,VY.__importStar)(zm);VJ.default=(0,zT.nullable)(VQ.number);var VX={};Object.defineProperty(VX,"__esModule",{value:!0});let V0=oN,V1=(0,V0.__importStar)(zm);VX.default=(t,n,r)=>VS.Number.pipe(new V1.Type("numberInRange",t=>VS.Number.is(t),(i,o)=>i>n||i<t?V1.failure(i,o,`${r} must be a number between ${t} and ${n}`):V1.success(i),V1.identity));var V2={};Object.defineProperty(V2,"__esModule",{value:!0});let V3=oN,V4=(0,V3.__importStar)(zm);V2.default=new V4.Type("StringFromInt",V4.string.is,(t,n)=>(0,zw.pipe)(V4.boolean.validate(t,n),(0,Vk.chain)(t=>V4.success(t.toString()))),t=>t);var V5={};Object.defineProperty(V5,"__esModule",{value:!0});let V9=oN,V6=(0,V9.__importStar)(zm);function V8(){return qv||(qv=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.StringOrNull=t.StringFromNumber=t.StringFromBoolean=t.NumberRange=t.NumberOrNull=t.NonEmptyStringOrNull=t.NonEmptyString=t.IntFromPixels=t.IntFromNumber=t.Function=t.DateFromTsMs=t.DateFromStringOrNumber=t.DateFromString=void 0;let n=oN;(0,n.__exportStar)(VS,t);var r=function(){if(qy)return VO;qy=1,Object.defineProperty(VO,"__esModule",{value:!0});let t=oN,n=(0,t.__importStar)(zm),r=V8();return VO.default=new n.Type("dateFromString",t=>t instanceof Date,(t,i)=>(0,zw.pipe)(r.String.validate(t,i),(0,Vk.chain)(r=>{let o=new Date(r);return isNaN(o.getTime())?n.failure(t,i):n.success(o)})),t=>t.toISOString()),VO}();Object.defineProperty(t,"DateFromString",{enumerable:!0,get:function(){return(0,n.__importDefault)(r).default}}),Object.defineProperty(t,"DateFromStringOrNumber",{enumerable:!0,get:function(){return(0,n.__importDefault)(VI).default}}),Object.defineProperty(t,"DateFromTsMs",{enumerable:!0,get:function(){return(0,n.__importDefault)(VR).default}}),(0,n.__exportStar)(VA,t),t.Function=(0,n.__importStar)(zT),Object.defineProperty(t,"IntFromNumber",{enumerable:!0,get:function(){return(0,n.__importDefault)(VN).default}}),Object.defineProperty(t,"IntFromPixels",{enumerable:!0,get:function(){return(0,n.__importDefault)(VF).default}}),Object.defineProperty(t,"NonEmptyString",{enumerable:!0,get:function(){return(0,n.__importDefault)(Vz).default}}),Object.defineProperty(t,"NonEmptyStringOrNull",{enumerable:!0,get:function(){return(0,n.__importDefault)(V$).default}}),Object.defineProperty(t,"NumberOrNull",{enumerable:!0,get:function(){return(0,n.__importDefault)(VJ).default}}),Object.defineProperty(t,"NumberRange",{enumerable:!0,get:function(){return(0,n.__importDefault)(VX).default}}),Object.defineProperty(t,"StringFromBoolean",{enumerable:!0,get:function(){return(0,n.__importDefault)(V2).default}}),Object.defineProperty(t,"StringFromNumber",{enumerable:!0,get:function(){return(0,n.__importDefault)(V5).default}}),Object.defineProperty(t,"StringOrNull",{enumerable:!0,get:function(){return(0,n.__importDefault)(Vq).default}})}(V_)),V_}V5.default=new V6.Type("StringFromInt",V6.string.is,(t,n)=>(0,zw.pipe)(V6.number.validate(t,n),(0,Vk.chain)(t=>V6.success(t.toString()))),t=>t);var V7={},$e={},$t={},$n={},$r={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanField=t.BooleanConfig=t.BooleanFieldType=void 0;let n=(0,oN.__importStar)(zm),r=V8();t.BooleanFieldType="Boolean",t.BooleanConfig=n.exact(n.partial({label:r.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})]))}($r);var $i={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Color=t.ColorConfig=t.ColorFieldType=void 0;let n=(0,oN.__importStar)(zm),r=V8();t.ColorFieldType="Color",t.ColorConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string})),t.Color=n.exact(n.intersection([n.type({type:n.literal(t.ColorFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.ColorConfig})]))}($i);var $o={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Date=t.DateConfig=t.DateFieldType=void 0;let n=(0,oN.__importStar)(zm),r=V8();t.DateFieldType="Date",t.DateConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,default:n.string})),t.Date=n.exact(n.intersection([n.type({type:n.literal(t.DateFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.DateConfig})]))}($o);var $a={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Embed=t.EmbedConfig=t.EmbedFieldType=void 0;let n=(0,oN.__importStar)(zm),r=V8();t.EmbedFieldType="Embed",t.EmbedConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,useAsTitle:n.boolean})),t.Embed=n.exact(n.intersection([n.type({type:n.literal(t.EmbedFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.EmbedConfig})]))}($a);var $u={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.GeoPoint=t.GeoPointConfig=t.GeoPointFieldType=void 0;let n=(0,oN.__importStar)(zm),r=V8();t.GeoPointFieldType="GeoPoint",t.GeoPointConfig=n.exact(n.partial({label:r.StringOrNull})),t.GeoPoint=n.exact(n.intersection([n.type({type:n.literal(t.GeoPointFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.GeoPointConfig})]))}($u);var $s={},$c={},$l={},$f={},$d={};Object.defineProperty($d,"__esModule",{value:!0}),$d.pipe=$d.pipeable=void 0,$d.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 C=function(n){return function(r){return t.extend(r,n)}},M=function(n){return t.extend(n,Dc.identity)};y.extend=C,y.duplicate=M}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)}}},j=function(n,r){return function(i){return t.reduceRight(i,n,r)}};y.reduce=R,y.foldMap=E,y.reduceRight=j}if("function"==typeof t.reduceWithIndex){var A=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=A,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)}},V=function(n){return function(r){return t.partitionWithIndex(r,n)}},$=function(n){return function(r){return t.partitionMapWithIndex(r,n)}};y.filterWithIndex=z,y.filterMapWithIndex=B,y.partitionWithIndex=V,y.partitionMapWithIndex=$}if("function"==typeof t.promap){var q=function(n,r){return function(i){return t.promap(i,n,r)}};y.promap=q}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)}},G=function(n){return"Left"===n._tag?t.throwError(n.left):t.of(n.right)},Z=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=G,y.fromPredicate=Z,y.filterOrElse=J}return y},$d.pipe=Dc.pipe;var $p=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]}),$h=O&&O.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),$m=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)&&$p(n,t,r);return $h(n,t),n};Object.defineProperty($f,"__esModule",{value:!0}),$f.NumberFromString=void 0;var $g=$m(zm);$f.NumberFromString=new $g.Type("NumberFromString",$g.number.is,function(t,n){return $d.pipe($g.string.validate(t,n),Da.chain(function(r){var i=+r;return isNaN(i)||""===r.trim()?$g.failure(t,n):$g.success(i)}))},String);var $y=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]}),$v=O&&O.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),$b=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)&&$y(n,t,r);return $v(n,t),n};Object.defineProperty($l,"__esModule",{value:!0}),$l.IntFromString=void 0;var $x=$b(zm);$l.IntFromString=new $x.Type("IntFromString",$x.Int.is,function(t,n){return $d.pipe($f.NumberFromString.validate(t,n),Da.chain(function(r){return $x.Int.is(r)?$x.success(r):$x.failure(t,n)}))},$f.NumberFromString.encode),Object.defineProperty($c,"__esModule",{value:!0});let $_=oN,$S=(0,$_.__importStar)(zm),$T=V8(),$w=new $S.Type("SideConstraints",t=>!t||"number"==typeof t,(t,n)=>Da.either.chain($S.union([$S.literal("auto"),$S.literal(""),$S.Int,$l.IntFromString,$T.IntFromNumber,$T.IntFromPixels,$S.null]).validate(t,n),t=>"auto"===t||""===t?$S.success(null):$S.success(t)),t=>t),$O=$S.partial({width:$w,height:$w});$c.default=$O,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=V8(),o=(0,n.__importDefault)($c);t.ImageFieldType="Image",t.Thumbnail=r.exact(r.intersection([r.type({name:r.string}),o.default])),t.ImageConfig=r.exact(r.partial({label:i.StringOrNull,placeholder:r.string,constraint:o.default,thumbnails:r.readonlyArray(t.Thumbnail)})),t.Image=r.exact(r.intersection([r.type({type:r.literal(t.ImageFieldType)}),r.partial({fieldset:i.StringOrNull,config:t.ImageConfig})]))}($s);var $k={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.IntegrationField=t.IntegrationFieldConfig=t.IntegrationFieldType=void 0;let n=(0,oN.__importStar)(zm),r=V8();t.IntegrationFieldType="IntegrationFields",t.IntegrationFieldConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,catalog:n.string})),t.IntegrationField=n.exact(n.intersection([n.type({type:n.literal(t.IntegrationFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.IntegrationFieldConfig})]))}($k);var $I={};!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=V8(),o=t=>{if(t instanceof Array&&t.reduce((t,n)=>t&&"string"==typeof n,!0))return r.success(t)},a=t=>{if("string"==typeof t)return r.success([t])},u=new r.Type("MasksArrayString",t=>t instanceof Array,(t,n)=>Da.either.chain(r.union([r.array(r.string),r.string]).validate(t,n),i=>o(i)||a(i)||r.failure(t,n)),t=>t);t.LinkFieldType="Link",t.LinkConfig=r.exact(r.partial({label:i.StringOrNull,useAsTitle:r.boolean,placeholder:r.string,select:(0,Vl.withFallback)(r.union([r.literal("media"),r.literal("document"),r.literal("web"),r.null]),null),customtypes:r.readonlyArray(r.string),masks:u,tags:u,allowTargetBlank:r.boolean})),t.Link=r.exact(r.intersection([r.type({type:r.literal(t.LinkFieldType)}),r.partial({fieldset:i.StringOrNull,config:t.LinkConfig})]))}($I);var $C={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Number=t.NumberConfig=t.NumberFieldType=void 0;let n=(0,oN.__importStar)(zm),r=V8();t.NumberFieldType="Number",t.NumberConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,min:n.union([n.number,$f.NumberFromString]),max:n.union([n.number,$f.NumberFromString]),step:n.union([n.number,$f.NumberFromString])})),t.Number=n.exact(n.intersection([n.type({type:n.literal(t.NumberFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.NumberConfig})]))}($C);var $M={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Range=t.RangeConfig=t.RangeFieldType=void 0;let n=(0,oN.__importStar)(zm),r=V8();t.RangeFieldType="Range",t.RangeConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,min:n.union([n.number,$f.NumberFromString]),max:n.union([n.number,$f.NumberFromString]),step:n.union([n.number,$f.NumberFromString])})),t.Range=n.exact(n.intersection([n.type({type:n.literal(t.RangeFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.RangeConfig})]))}($M);var $R={};!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=V8(),o=(0,n.__importDefault)($c);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 a=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),u=t=>{if(!t)return r.success([])},s=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)}},c=t=>{if(t instanceof Array&&t.reduce((t,n)=>t&&"string"==typeof n,!0))return r.success(t)},l=t=>{if("string"==typeof t)return r.success([t])},f=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=>u(i)||c(i)||s(i)||l(i)||r.failure(t,n)))},t=>t);t.RichTextConfig=r.exact(r.partial({label:i.StringOrNull,placeholder:r.string,useAsTitle:r.boolean,single:a,multi:a,imageConstraint:o.default,labels:f,allowTargetBlank:r.boolean})),t.RichText=r.exact(r.intersection([r.type({type:r.literal(t.RichTextFieldType)}),r.partial({fieldset:i.StringOrNull,config:t.RichTextConfig})]))}($R);var $E={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Select=t.SelectConfig=t.SelectFieldType=void 0;let n=(0,oN.__importStar)(zm),r=V8();t.SelectFieldType="Select",t.SelectConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,default_value:n.string,options:n.readonlyArray(n.union([n.string,r.StringFromNumber,r.StringFromBoolean]))})),t.Select=n.exact(n.intersection([n.type({type:n.literal(t.SelectFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.SelectConfig})]))}($E);var $j={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Separator=t.SeparatorConfig=t.SeparatorFieldType=void 0;let n=(0,oN.__importStar)(zm),r=V8();t.SeparatorFieldType="Separator",t.SeparatorConfig=n.exact(n.partial({label:r.StringOrNull})),t.Separator=n.exact(n.intersection([n.type({type:n.literal(t.SeparatorFieldType)}),n.partial({config:t.SeparatorConfig})]))}($j);var $A={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Text=t.TextConfig=t.TextFieldType=void 0;let n=(0,oN.__importStar)(zm),r=V8();t.TextFieldType="Text",t.TextConfig=n.exact(n.partial({label:r.StringOrNull,useAsTitle:n.boolean,placeholder:n.string})),t.Text=n.exact(n.intersection([n.type({type:n.literal(t.TextFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.TextConfig})]))}($A);var $N={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Timestamp=t.TimestampConfig=t.TimestampFieldType=void 0;let n=(0,oN.__importStar)(zm),r=V8();t.TimestampFieldType="Timestamp",t.TimestampConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,default:n.string})),t.Timestamp=n.exact(n.intersection([n.type({type:n.literal(t.TimestampFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.TimestampConfig})]))}($N),Object.defineProperty($n,"__esModule",{value:!0}),$n.NestableWidget=void 0;let $P=oN,$L=(0,$P.__importStar)(zm);$n.NestableWidget=$L.union([$i.Color,$r.BooleanField,$a.Embed,$u.GeoPoint,$o.Date,$C.Number,$M.Range,$R.RichText,$E.Select,$j.Separator,$A.Text,$N.Timestamp,$I.Link,$s.Image,$k.IntegrationField]),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Group=t.GroupConfig=t.GroupFieldType=void 0;let n=(0,oN.__importStar)(zm),r=V8();t.GroupFieldType="Group",t.GroupConfig=n.exact(n.partial({label:r.StringOrNull,repeat:n.boolean,fields:n.record(zy.WidgetKey,$n.NestableWidget)})),t.Group=n.exact(n.intersection([n.type({type:n.literal(t.GroupFieldType)}),n.partial({fieldset:r.StringOrNull,icon:n.string,description:n.string,config:t.GroupConfig})]))}($t);var $F={};!function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=oN;(0,n.__exportStar)($r,t),(0,n.__exportStar)($i,t),(0,n.__exportStar)($o,t),(0,n.__exportStar)($a,t),(0,n.__exportStar)($u,t),(0,n.__exportStar)($s,t),(0,n.__exportStar)($k,t),(0,n.__exportStar)($I,t),(0,n.__exportStar)($n,t),(0,n.__exportStar)($C,t),(0,n.__exportStar)($M,t),(0,n.__exportStar)($R,t),(0,n.__exportStar)($E,t),(0,n.__exportStar)($j,t),(0,n.__exportStar)($A,t),(0,n.__exportStar)($N,t)}($F);var $D={},$W={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.isCompositeSlice=t.CompositeSlice=t.CompositeSliceConfig=t.CompositeSliceType=void 0;let n=(0,oN.__importStar)(zm),r=V8();t.CompositeSliceType="Slice",t.CompositeSliceConfig=n.exact(n.partial({label:r.StringOrNull})),t.CompositeSlice=n.exact(n.intersection([n.type({type:n.literal(t.CompositeSliceType)}),n.partial({fieldset:r.StringOrNull,description:n.string,icon:n.string,display:n.string,"non-repeat":n.record(zy.WidgetKey,$n.NestableWidget),repeat:n.record(zy.WidgetKey,$n.NestableWidget),config:t.CompositeSliceConfig})])),t.isCompositeSlice=function(t){return"Slice"===t.type}}($W);var $U={};Object.defineProperty($U,"__esModule",{value:!0}),$U.isLegacySlice=$U.LegacySlice=void 0;let $z=oN,$B=(0,$z.__importStar)(zm);$U.LegacySlice=$B.union([$n.NestableWidget,$t.Group]),$U.isLegacySlice=function(t){return"Slice"!==t.type&&"SharedSlice"!==t.type};var $V={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.isDynamicSharedSlice=t.isStaticSharedSlice=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,Vl.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(zy.WidgetKey,$n.NestableWidget),items:n.record(zy.WidgetKey,$n.NestableWidget)})])),t.SharedSliceType="SharedSlice";let r=n.string,i=n.string;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,legacyPaths:n.record(r,i)})])),t.isStaticSharedSlice=function(t){return"SharedSlice"===t.type},t.isDynamicSharedSlice=function(t){return"SharedSlice"===t.type}}($V);var $$={};Object.defineProperty($$,"__esModule",{value:!0}),$$.SharedSliceRef=void 0;let $q=oN,$K=(0,$q.__importStar)(zm);$$.SharedSliceRef=$K.exact($K.type({type:$K.literal($V.SharedSliceType)})),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),r=V8();function i(i){return n.exact(n.partial({label:r.StringOrNull,labels:t.SlicesLabels,choices:n.record(zy.WidgetKey,n.union([$U.LegacySlice,$W.CompositeSlice,i]))}))}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=i,t.StaticSlicesConfig=i($V.SharedSlice),t.DynamicSlicesConfig=i($$.SharedSliceRef);let o={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 a(i){return n.exact(n.intersection([n.type({type:n.keyof({[t.SlicesFieldType]:null,[t.LegacySlicesFieldType]:null})}),n.partial({fieldset:r.StringOrNull,config:i})]))}t.slicesReader=a,t.StaticSlices=a(t.StaticSlicesConfig),t.DynamicSlices=a(t.DynamicSlicesConfig),t.Slices={toStatic:(t,n)=>t.config?{...t,config:o.toStatic(t.config,n)}:t}}($D);var $H={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.UID=t.UIDConfig=t.UIDFieldType=void 0;let n=(0,oN.__importStar)(zm),r=V8();t.UIDFieldType="UID",t.UIDConfig=n.exact(n.partial({label:r.StringOrNull,useAsTitle:n.boolean,placeholder:n.string})),t.UID=n.exact(n.intersection([n.type({type:n.literal(t.UIDFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.UIDConfig})]))}($H),Object.defineProperty($e,"__esModule",{value:!0}),$e.Widgets=$e.FieldType=$e.DynamicWidget=$e.StaticWidget=$e.widgetReader=void 0;let $G=oN,$Z=(0,$G.__importStar)(zm);function $J(t){return $Z.union([$H.UID,$n.NestableWidget,$t.Group,t])}$e.widgetReader=$J,$e.StaticWidget=$J($D.StaticSlices),$e.DynamicWidget=$J($D.DynamicSlices),$e.FieldType=$Z.keyof({[$F.ColorFieldType]:null,[$F.BooleanFieldType]:null,[$F.NumberFieldType]:null,[$F.EmbedFieldType]:null,[$F.GeoPointFieldType]:null,[$F.DateFieldType]:null,[$F.RangeFieldType]:null,[$F.RichTextFieldType]:null,[$F.SelectFieldType]:null,[$F.SeparatorFieldType]:null,[$F.TextFieldType]:null,[$F.TimestampFieldType]:null,[$F.LinkFieldType]:null,[$F.ImageFieldType]:null,[$F.IntegrationFieldType]:null,[$H.UIDFieldType]:null,[$t.GroupFieldType]:null,[$D.SlicesFieldType]:null,[$D.LegacySlicesFieldType]:null}),$e.Widgets={toStatic(t,n){switch(t.type){case"Choice":case"Slices":return $D.Slices.toStatic(t,n);default:return t}}},Object.defineProperty(V7,"__esModule",{value:!0}),V7.Sections=V7.DynamicSection=V7.StaticSection=V7.sectionReader=void 0;let $Y=oN,$Q=(0,$Y.__importStar)(zm);function $X(t){return $Q.record(zy.WidgetKey,t)}V7.sectionReader=$X,V7.StaticSection=$X($e.StaticWidget),V7.DynamicSection=$X($e.DynamicWidget),V7.Sections={toStatic:(t,n)=>Object.entries(t).reduce((t,[r,i])=>({...t,[r]:$e.Widgets.toStatic(i,n)}),{})},function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.collectSharedSlices=t.flattenCustomTypeFields=t.filterMissingSharedSlices=t.collectWidgets=t.validateSlices=t.toStatic=t.flattenSections=t.flattenWidgets=t.CustomType=t.StaticCustomType=t.CustomTypeFormat=void 0;let n=oN,r=(0,n.__importStar)(zm),i=V8();t.CustomTypeFormat={page:"page",custom:"custom"};class o 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:
|
|
3
|
-
${t.map(t=>` - ${t}`).join(`
|
|
4
|
-
`)}
|
|
5
|
-
`}}function a(n){return r.exact(r.intersection([r.type({id:r.string,label:i.StringOrNull,repeatable:(0,Vl.withFallback)(r.boolean,!0),json:r.record(r.string,n),status:(0,Vl.withFallback)(r.boolean,!0)}),r.partial({hash:r.string,format:(0,Vl.withFallback)(r.keyof(t.CustomTypeFormat),"custom")})]))}function u(t){return Object.entries(t.json).reduce((t,[,n])=>{let r=Object.entries(n);return t.concat(r)},[])}function s(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=a(V7.StaticSection),t.CustomType=a(V7.DynamicSection),t.flattenWidgets=u,t.flattenSections=function(t){return Object.entries(t.json).reduce((t,[,n])=>{let r=Object.entries(n);return t.concat(r)},[])},t.toStatic=function(t,n){let r=Object.entries(t.json).reduce((t,[r,i])=>({...t,[r]:V7.Sections.toStatic(i,n)}),{});return{...t,json:r}},t.validateSlices=function(t,n){let r=(function(t){var n;let r=u(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 o(r)):(0,Da.right)(t)},t.collectWidgets=s,t.filterMissingSharedSlices=function(t,n){return s(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})},t.flattenCustomTypeFields=function(t){return Object.values(t.json).reduce((t,n)=>({...t,...n}),{})},t.collectSharedSlices=function(t){return Object.entries(t.fields).reduce((t,[,n])=>{var r;return"Slices"===n.type||"Choice"===n.type?{...t,...Object.entries((null===(r=n.config)||void 0===r?void 0:r.choices)||{}).reduce((t,[n,r])=>"SharedSlice"===r.type?{...t,[n]:r}:t,{})}:t},{})}}(Vc);var $0,$1,$2={},$3={};Object.defineProperty($0=$3,"__esModule",{value:!0}),$0.DiffOperation=void 0,($1=$0.DiffOperation||($0.DiffOperation={})).Added="added",$1.Removed="removed",$1.Updated="updated";var $4={},$5={},$9={};Object.defineProperty($9,"__esModule",{value:!0}),$9.HexaColor=void 0;let $6=/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;$9.HexaColor={is:t=>$6.test(t)};var $8={};Object.defineProperty($8,"__esModule",{value:!0}),$8.toRecord=void 0,$8.toRecord=function(t,n){return t.reduce((t,r)=>{let i=n(r);return{...t,[i]:r}},{})};var $7={};Object.defineProperty($7,"__esModule",{value:!0}),$7.mapValues=$7.isObject=$7.withOptionals=$7.isNotEmpty=$7.zipObjects=void 0;let qe=oN,qt=(0,qe.__importStar)(zm);$7.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}}},{})},$7.isNotEmpty=function(t){return Boolean(Object.keys(t).length)},$7.withOptionals=function(t,n){return{...t,...n.reduce((t,[n,r])=>r?{...t,[n]:r}:t,{})}};let qn=qt.record(qt.string,qt.unknown);$7.isObject=function(t){return(0,Da.isRight)(qn.decode(t))},$7.mapValues=function(t,n){return Object.entries(t).reduce((t,[r,i])=>({...t,[r]:n(i,r)}),{})},Object.defineProperty($5,"__esModule",{value:!0}),$5.Objects=$5.Arrays=$5.HexaColorCode=void 0;let qr=oN;$5.HexaColorCode=(0,qr.__importStar)($9),$5.Arrays=(0,qr.__importStar)($8),$5.Objects=(0,qr.__importStar)($7);var qi={};function qo(t,n){let r=$5.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:$3.DiffOperation.Removed}:!(null!=r&&r.left)&&null!=r&&r.right?{op:$3.DiffOperation.Added,value:r.right}:{op:$3.DiffOperation.Updated,value:r.right}})();return i?{...t,[n]:i}:t},{});return $5.Objects.isNotEmpty(i)?i:void 0}Object.defineProperty(qi,"__esModule",{value:!0}),qi.VariationComparator=void 0,qi.VariationComparator={compare(t,n){if(t&&!n)return{op:$3.DiffOperation.Removed};if(!t&&n)return{op:$3.DiffOperation.Added,value:n};let r=function(t,n){let r=$5.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=qo(null==t?void 0:t.primary,null==n?void 0:n.primary),o=qo(null==t?void 0:t.items,null==n?void 0:n.items),a={...r,...i?{primary:i}:{},...o?{items:o}:{}};if($5.Objects.isNotEmpty(a))return{op:$3.DiffOperation.Updated,value:a}}},Object.defineProperty($4,"__esModule",{value:!0}),$4.SliceComparator=void 0,$4.SliceComparator={compare(t,n){if(!t&&n)return{op:$3.DiffOperation.Added,value:n};if(t&&!n)return{op:$3.DiffOperation.Removed};let r=function(t,n){let r=$5.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=$5.Objects.zipObjects(t&&$5.Arrays.toRecord(t.variations,t=>t.id),n&&$5.Arrays.toRecord(n.variations,t=>t.id)),o=Object.entries(i).reduce((t,[n,r])=>{if(!r)return t;let i=qi.VariationComparator.compare(r.left,r.right);return i?{...t,[n]:i}:t},{}),a={...r,...$5.Objects.isNotEmpty(o)?{variations:o}:{}};if($5.Objects.isNotEmpty(a))return{op:$3.DiffOperation.Updated,value:a}}},function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=oN;(0,n.__exportStar)($3,t),(0,n.__exportStar)($4,t),(0,n.__exportStar)(qi,t)}($2);var qa,qu,qs={},qc={};qa=qc,qu=O&&O.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},Object.defineProperty(qa,"__esModule",{value:!0}),qa.ImageConstraint=void 0,Object.defineProperty(qa,"ImageConstraint",{enumerable:!0,get:function(){return qu($c).default}});var ql={},qf={};Object.defineProperty(qf,"__esModule",{value:!0});var qd={};Object.defineProperty(qd,"__esModule",{value:!0}),qd.SlicesTypes=void 0;let qp=oN,qh=(0,qp.__importStar)(zm);qd.SlicesTypes=qh.keyof({[$W.CompositeSliceType]:null,[$V.SharedSliceType]:null}),function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=oN;(0,n.__exportStar)($W,t),(0,n.__exportStar)($U,t),(0,n.__exportStar)($V,t),(0,n.__exportStar)($$,t),(0,n.__exportStar)(qf,t),(0,n.__exportStar)($D,t),(0,n.__exportStar)(qd,t)}(ql),function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=oN;(0,n.__exportStar)($t,t),(0,n.__exportStar)($F,t),(0,n.__exportStar)(qc,t),(0,n.__exportStar)(ql,t),(0,n.__exportStar)($H,t),(0,n.__exportStar)($e,t)}(qs),function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=oN;(0,n.__exportStar)(Vc,t),(0,n.__exportStar)($2,t),(0,n.__exportStar)(V7,t),(0,n.__exportStar)(qs,t)}(Vs);var qm,qg,qy,qv,qb,qx={},q_={},qS={};function qT(){if(qb)return qS;qb=1,Object.defineProperty(qS,"__esModule",{value:!0}),qS.hasContentType=qS.hasFieldContentType=void 0;let t=K3();function n(t){return"object"==typeof t&&null!==t&&"__TYPE__"in t}return qS.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))},qS.hasContentType=n,qS}function qw(){return qR||(qR=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=qT();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)})}(q_)),q_}var qO={},qk={};Object.defineProperty(qk,"__esModule",{value:!0}),qk.defaultCtx=qk.getFieldCtx=qk.LegacyContentCtx=qk.FieldOrSliceType=void 0;let qI=oN,qC=(0,qI.__importStar)(zm);qk.FieldOrSliceType=qC.union([qs.FieldType,qs.SlicesTypes]);class qM{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)}}qk.LegacyContentCtx=qM,qk.getFieldCtx=function(t,n,r){return new qM(t,[...n.fieldPath,n.fieldKey,...r||[]],n.allTypes)},qk.defaultCtx=function(t,n=new Map){return new qM(t,[],n)};var qR,qE,qj={},qA={};function qN(){return qE||(qE=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=qT();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})}(qA)),qA}var qP,qL={};function qF(){return qP||(qP=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=V8(),o=qT();t.EmbedContentType="EmbedContent";let a=n=>(0,o.hasContentType)(n)&&n.__TYPE__===t.EmbedContentType;t.isEmbedContent=a,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:i.StringOrNull,author_name:i.StringOrNull,author_url:i.StringOrNull,provider_name:i.StringOrNull,provider_url:i.StringOrNull,cache_age:r.union([r.string,r.number,r.null]),thumbnail_url:i.StringOrNull,thumbnail_width:i.NumberOrNull,thumbnail_height:i.NumberOrNull,html:i.StringOrNull})]));let u=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=u,t.EmbedContent=r.intersection([t.EmbedContentLegacy,r.strict({__TYPE__:r.literal(t.EmbedContentType),all:r.unknown})])}(qL)),qL}var qD={},qW={},qU={};Object.defineProperty(qU,"__esModule",{value:!0});let qz=oN,qB=(0,qz.__importStar)(zm);qU.default=new qB.Type("TrimmedString",qB.string.is,(t,n)=>(0,zw.pipe)(qB.string.validate(t,n),(0,Vk.chain)(t=>qB.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 qV={};function q$(){return qq||(qq=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)(qU),o=qT(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===qV.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:qs.ColorFieldType,__TYPE__:qV.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:qs.ColorFieldType}}));t.ColorLegacy=u,t.ColorContent=r.strict({type:r.literal(qs.ColorFieldType),value:i.default,__TYPE__:r.literal(qV.FieldContentType)})}(qW)),qW}Object.defineProperty(qV,"__esModule",{value:!0}),qV.FieldContentType=void 0,qV.FieldContentType="FieldContent";var qq,qK,qH={};function qG(){return qK||(qK=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)(qU),o=qT(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===qV.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:qs.DateFieldType,__TYPE__:qV.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:qs.DateFieldType}}));t.DateLegacy=u,t.DateContent=r.strict({type:r.literal(qs.DateFieldType),value:i.default,__TYPE__:r.literal(qV.FieldContentType)})}(qH)),qH}var qZ,qJ={};function qY(){return qZ||(qZ=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)(qU),o=qT(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===qV.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:qs.NumberFieldType,__TYPE__:qV.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:qs.NumberFieldType}}));t.NumberLegacy=u,t.NumberContent=r.strict({type:r.literal(qs.NumberFieldType),value:i.default,__TYPE__:r.literal(qV.FieldContentType)})}(qJ)),qJ}var qQ,qX={};function q0(){return qQ||(qQ=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)(qU),o=qT(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===qV.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:qs.RangeFieldType,__TYPE__:qV.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:qs.RangeFieldType}}));t.RangeLegacy=u,t.RangeContent=r.strict({type:r.literal(qs.RangeFieldType),value:i.default,__TYPE__:r.literal(qV.FieldContentType)})}(qX)),qX}var q1,q2={};function q3(){return q1||(q1=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)(qU),o=qT(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===qV.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:qs.SelectFieldType,__TYPE__:qV.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:qs.SelectFieldType}}));t.SelectLegacy=u,t.SelectContent=r.strict({type:r.literal(qs.SelectFieldType),value:i.default,__TYPE__:r.literal(qV.FieldContentType)})}(q2)),q2}var q4,q5={};function q9(){return q4||(q4=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)(qU),o=qT(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===qV.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:qs.TextFieldType,__TYPE__:qV.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:qs.TextFieldType}}));t.TextLegacy=u,t.TextContent=r.strict({type:r.literal(qs.TextFieldType),value:i.default,__TYPE__:r.literal(qV.FieldContentType)})}(q5)),q5}var q6,q8={};function q7(){return q6||(q6=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)(qU),o=qT(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===qV.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:qs.TimestampFieldType,__TYPE__:qV.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:qs.TimestampFieldType}}));t.TimestampLegacy=u,t.TimestampContent=r.strict({type:r.literal(qs.TimestampFieldType),value:i.default,__TYPE__:r.literal(qV.FieldContentType)})}(q8)),q8}function Ke(){return Kt||(Kt=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.FieldContent=t.FieldType=void 0;let n=oN,r=(0,n.__importStar)(zm),i=q$(),o=qG(),a=qY(),u=q0(),s=q3(),c=q9(),l=q7();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)(q$(),t),(0,n.__exportStar)(qV,t),(0,n.__exportStar)(qG(),t),(0,n.__exportStar)(qY(),t),(0,n.__exportStar)(q0(),t),(0,n.__exportStar)(q3(),t),(0,n.__exportStar)(q9(),t),(0,n.__exportStar)(q7(),t)}(qD)),qD}var Kt,Kn,Kr={};function Ki(){return Kn||(Kn=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=qT();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,zw.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)})])}(Kr)),Kr}var Ko,Ka={};function Ku(){return Ko||(Ko=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=V8(),o=qT();t.ImageContentType="ImageContent";let a=n=>(0,o.hasContentType)(n)&&n.__TYPE__===t.ImageContentType;t.isImageContent=a;let u=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:u,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:i.NonEmptyStringOrNull,alt:i.NonEmptyStringOrNull,provider:i.StringOrNull})]));let s=r.intersection([t.ImageContentView,r.partial({thumbnails:r.record(r.string,t.ImageContentView)})]),c=n=>new r.Type("ImageLegacy",t.isImageContent,n=>(0,Dc.pipe)(s.decode(n),Do.either.map(n=>t.ImageContent.encode({...n,__TYPE__:t.ImageContentType}))),t=>({content:(0,$7.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=c,t.ImageContent=r.intersection([s,r.strict({__TYPE__:r.literal(t.ImageContentType)})])}(Ka)),Ka}var Ks,Kc={};function Kl(){return Ks||(Ks=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=qT();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})}(Kc)),Kc}var Kf,Kd={};function Kp(){return Kf||(Kf=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=V8(),o=qT();t.ImageLinkType="ImageLink";let a=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:i.StringOrNull})])),u=new r.Type("ImageLink",n=>(0,o.hasContentType)(n)&&n.__TYPE__===t.ImageLinkType,n=>(0,Dc.pipe)(a.decode(n),Do.either.map(n=>t.ImageLinkContent.encode({...n,__TYPE__:t.ImageLinkType}))),t=>a.encode(t));t.ImageLinkContent=r.intersection([r.strict({__TYPE__:r.literal(t.ImageLinkType)}),a]),t.FileLinkType="FileLink";let s=r.exact(r.intersection([r.type({id:r.string,url:r.string,name:r.string,kind:r.string,size:(0,Vt.withFallback)(r.string,"0")}),r.partial({date:(0,zT.nullable)(r.string)})])),c=new r.Type("FileLink",n=>(0,o.hasContentType)(n)&&n.__TYPE__===t.FileLinkType,n=>(0,Dc.pipe)(s.decode(n),Do.either.map(n=>t.FileLinkContent.encode({...n,__TYPE__:t.FileLinkType}))),t=>s.encode(t));t.FileLinkContent=r.intersection([s,r.exact(r.intersection([r.type({__TYPE__:r.literal(t.FileLinkType)}),r.partial({size:(0,Vt.withFallback)(r.string,"0")})]))]),t.DocumentLinkType="DocumentLink";let l=r.strict({id:i.NonEmptyString}),f=new r.Type("DocumentLink",n=>(0,o.hasContentType)(n)&&n.__TYPE__===t.DocumentLinkType,n=>(0,Dc.pipe)(l.decode(n),Do.either.map(n=>t.DocumentLinkContent.encode({...n,__TYPE__:t.DocumentLinkType}))),t=>l.encode(t));t.DocumentLinkContent=r.intersection([r.strict({__TYPE__:r.literal(t.DocumentLinkType)}),l]),t.ExternalLinkType="ExternalLink";let d=r.exact(r.intersection([r.type({url:r.string}),r.partial({kind:r.literal("web"),target:i.StringOrNull,preview:(0,zT.nullable)(r.partial({title:r.string}))})])),p=new r.Type("ExternalLink",n=>(0,o.hasContentType)(n)&&n.__TYPE__===t.ExternalLinkType,n=>(0,Dc.pipe)(d.decode(n),Do.either.map(n=>t.ExternalLinkContent.encode({...n,__TYPE__:t.ExternalLinkType}))),t=>d.encode(t));t.ExternalLinkContent=r.intersection([r.strict({__TYPE__:r.literal(t.ExternalLinkType)}),d]),t.LinkContentType="LinkContent";let h=n=>(0,o.hasContentType)(n)&&n.__TYPE__===t.LinkContentType;t.isLinkContent=h,t.LinkLegacy=r.union([u,c,f,p]);let m=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=m,t.Link=r.union([t.ImageLinkContent,t.FileLinkContent,t.DocumentLinkContent,t.ExternalLinkContent]),t.LinkContent=r.strict({__TYPE__:r.literal(t.LinkContentType),value:t.Link})}(Kd)),Kd}var Kh,Km={},Kg={},Ky={};function Kv(){return Kh||(Kh=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Block=t.BlockLegacy=t.TextBlock=t.checkEmbedBlock=t.EmbedBlock=t.checkImageBlock=t.ImageBlock=t.ValidatedSpans=t.SpanLegacy=t.Span=void 0;let n=oN,r=(0,n.__importStar)(zm),i=V8(),o=qF(),a=Ku(),u=Kp(),s=t=>r.strict({data:t,start:r.number,end:r.number,type:r.literal($F.RichTextNodeType.hyperlink)}),c=r.strict({data:(0,Vt.withFallback)(r.string,""),start:r.number,end:r.number,type:r.literal("label")}),l=r.strict({start:r.number,end:r.number,type:r.keyof({[$F.RichTextNodeType.strong]:null,[$F.RichTextNodeType.em]:null,"list-item":null})});t.Span=r.union([s(u.Link),c,l]),t.SpanLegacy=r.union([s(u.LinkLegacy),c,l]);let f=t=>new r.Type("ValidatedSpans",n=>Array.isArray(n)&&n.every(t.is),(n,i)=>{if(!Array.isArray(n))return r.failure(n,i);{let o=n.reduce((n,r)=>{let i=t.decode(r);return(0,Da.isLeft)(i)?n:[...n,i.right]},[]).sort((t,n)=>t.start-n.start);return r.success(o)}},n=>n.reduce((n,r)=>{let i=t.encode(r);return[...n,i]},[]));t.ValidatedSpans=f;let d=t=>r.exact(r.intersection([r.type({type:r.literal($F.RichTextNodeType.image),data:r.intersection([a.ImageContentView,r.partial({linkTo:(0,zT.nullable)(t)})])}),r.partial({label:i.StringOrNull,direction:i.StringOrNull})]));t.ImageBlock=d(u.Link);let p=d(u.LinkLegacy);t.checkImageBlock=function(t){return t.type===$F.RichTextNodeType.image};let h=r.exact(r.intersection([r.type({type:r.literal($F.RichTextNodeType.embed),data:r.unknown}),r.partial({label:i.StringOrNull,direction:i.StringOrNull})])),m=new r.Type("EmbedBlockLegacy",t=>"embed"===t.type,n=>(0,Dc.pipe)(h.decode(n),Do.either.chain(t=>Do.either.map(n=>[t,n])(o.EmbedContentLegacy.decode(t.data))),Do.either.map(([n,r])=>t.EmbedBlock.encode({...n,data:{...r,__TYPE__:o.EmbedContentType,all:n.data}}))),t=>({...h.encode(t),data:o.EmbedContentLegacy.encode(t.data)}));t.EmbedBlock=r.exact(r.intersection([r.type({type:r.literal($F.RichTextNodeType.embed),data:o.EmbedContent}),r.partial({label:i.StringOrNull,direction:i.StringOrNull})])),t.checkEmbedBlock=function(t){return t.type===$F.RichTextNodeType.embed};let g=n=>r.exact(r.intersection([r.type({type:(0,zT.refineType)($F.RichTextNodeTypeCodec,`string which isn't ${$F.RichTextNodeType.image} ${$F.RichTextNodeType.embed}`,t=>t!==$F.RichTextNodeType.image&&t!==$F.RichTextNodeType.embed),content:r.intersection([r.type({text:r.string}),r.partial({spans:(0,t.ValidatedSpans)(n)})])}),r.partial({label:r.string,direction:r.string})]));t.TextBlock=g(t.Span);let y=g(t.SpanLegacy),v=r.union([m,p,y]);t.BlockLegacy=new r.Type("BlockLegacy",t=>m.is(t)||p.is(t)||y.is(t),t=>v.decode(t),n=>t.ImageBlock.is(n)?p.encode(n):t.EmbedBlock.is(n)?m.encode(n):y.encode(n)),t.Block=r.union([t.ImageBlock,t.EmbedBlock,t.TextBlock])}(Ky)),Ky}function Kb(){return Kx||(Kx=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=qT(),o=Kv();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)(Kv(),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}(Kg)),Kg}var Kx,K_,KS={};function KT(){return K_||(K_=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=qT();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)})}(KS)),KS}function Kw(){return KI||(KI=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=oN;(0,n.__exportStar)(qN(),t),(0,n.__exportStar)(qF(),t),(0,n.__exportStar)(Ke(),t),(0,n.__exportStar)(Ki(),t),(0,n.__exportStar)(Ku(),t),(0,n.__exportStar)(Kl(),t),(0,n.__exportStar)(Kp(),t),(0,n.__exportStar)(function(){if(Kk)return Km;Kk=1,Object.defineProperty(Km,"__esModule",{value:!0}),Km.NestableLegacy=Km.isNestableContent=Km.NestableContent=void 0;let t=oN,n=(0,t.__importStar)(zm),r=qw(),i=qN(),o=qF(),a=Ke(),u=Ki(),s=Ku(),c=Kl(),l=Kp(),f=Kb(),d=KT();Km.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);Km.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 qV.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 Km.NestableLegacy=h,Km}(),t),(0,n.__exportStar)(Kb(),t),(0,n.__exportStar)(KT(),t)}(qj)),qj}function KO(){return KC||(KC=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.traverseGroupItemsContent=t.traverseGroupContent=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=qT(),o=Kw();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,qk.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,qk.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;function l({path:t,model:n,content:r}){return i=>r.map((r,a)=>{let u=t.concat([{key:a.toString(),type:"GroupItem"}]),s=r.value.reduce((t,[r,a])=>{let s=null==n?void 0:n[r],c=i({path:u.concat([{key:r,type:"Widget"}]),key:r,apiId:r,model:s,content:a});return c&&(0,o.isNestableContent)(c)?t.concat([[r,c]]):t},[]);return{__TYPE__:r.__TYPE__,value:s}})}t.isGroupContent=c,t.GroupContent=r.strict({__TYPE__:r.literal(t.GroupContentType),value:r.array(t.GroupItemContent)}),t.traverseGroupContent=function({path:t,key:n,apiId:r,model:i,content:o}){return a=>{var u;let s=l({path:t,model:null===(u=null==i?void 0:i.config)||void 0===u?void 0:u.fields,content:o.value})(a);return a({path:t,key:n,apiId:r,model:i,content:{__TYPE__:o.__TYPE__,value:s}})}},t.traverseGroupItemsContent=l}(qO)),qO}var Kk,KI,KC,KM,KR={},KE={},Kj={},KA={};function KN(){if(KM)return KA;KM=1,Object.defineProperty(KA,"__esModule",{value:!0}),KA.RepeatableWidgets=KA.RepeatableWidgetsLegacy=void 0;let t=(0,oN.__importStar)(zm),n=KO(),r=Kw(),i=r=>t.array((0,n.GroupItemLegacy)(r));KA.RepeatableWidgetsLegacy=i;let o=t.tuple([t.string,r.NestableContent]),a=t.strict({__TYPE__:t.literal(n.GroupItemContentType),value:t.array(o)});return KA.RepeatableWidgets=t.array(a),KA}function KP(){return KL||(KL=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.migrateCompositeSlice=t.traverseCompositeSliceContent=t.CompositeSliceContent=t.CompositeSliceLegacy=t.isCompositeSliceContent=t.CompositeSliceContentType=void 0;let n=oN,r=(0,n.__importStar)(zm),i=qT(),o=KO(),a=Kw(),u=KN();t.CompositeSliceContentType="CompositeSliceContent";let s=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.CompositeSliceContentType;t.isCompositeSliceContent=s;let c=r.exact(r.partial({repeat:r.array(r.unknown),"non-repeat":r.UnknownRecord})),l=n=>new r.Type("CompositeSliceLegacy",t.isCompositeSliceContent,r=>(0,Dc.pipe)(c.decode(r),Do.either.map(r=>{let i=(()=>{let t=(0,qk.getFieldCtx)("repeat",n),i=(0,u.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 o=(0,qk.getFieldCtx)(r,n,["non-repeat"]);if(!o)return t;let u=(0,a.NestableLegacy)(o).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 o=(0,qk.getFieldCtx)(r,n,["non-repeat"]),u=(0,a.NestableLegacy)(o).encode(i);return u?{content:{...t.content,[r]:u.content},types:{...t.types,...u.types}}:t},{content:{},types:{}}),i=(()=>{let r=(0,qk.getFieldCtx)("repeat",n);return(0,u.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=l,t.CompositeSliceContent=r.strict({__TYPE__:r.literal(t.CompositeSliceContentType),nonRepeat:r.record(r.string,a.NestableContent),repeat:u.RepeatableWidgets}),t.traverseCompositeSliceContent=function({path:t,sliceKey:n,sliceName:r,model:i,content:u}){return(s,c)=>{let l=Object.entries(u.widget.nonRepeat).reduce((o,[u,c])=>{var l,f,d;let p=(null==i?void 0:i.type)==="SharedSlice"?null===(f=null===(l=null==i?void 0:i.fields)||void 0===l?void 0:l.primary)||void 0===f?void 0:f[u]:null===(d=null==i?void 0:i["non-repeat"])||void 0===d?void 0:d[u],h=s({path:t.concat([{key:"non-repeat",type:"primary"},{key:u,type:"Widget"}]),key:u,apiId:r,model:p,content:c});return h?(0,a.isNestableContent)(h)?{...o,[u]:h}:(console.warn(`Warn: Non nestable content with key [${u}] detected in a composite slice [${r}] with key [${n}]`),o):o},{}),f=(0,o.traverseGroupItemsContent)({path:t.concat([{key:"repeat",type:"items"}]),model:(null==i?void 0:i.type)==="SharedSlice"?null==i?void 0:i.fields.items:null==i?void 0:i.repeat,content:u.widget.repeat})(s);return c({key:n,apiId:r,path:t,model:i,content:{...u,widget:{__TYPE__:"CompositeSliceContent",repeat:f,nonRepeat:l}}})}},t.migrateCompositeSlice=function(t,n){return{key:n.key,name:t.sliceName,maybeLabel:n.maybeLabel,widget:{__TYPE__:"SharedSliceContent",variation:t.variationId,primary:Object.entries(n.widget.nonRepeat).reduce((r,[i,o])=>{var a;return!(null===(a=t.fields.primary)||void 0===a)&&a[i]?{...r,[i]:o}:(console.warn(`The widget ${i} in the non-repeat zone of the composite slice [${t.sliceName}] with key [${n.key}] doesn't exist in the model.`),r)},{}),items:n.widget.repeat.map(r=>({__TYPE__:"GroupItemContent",value:r.value.reduce((r,[i,o])=>{var a;return!(null===(a=t.fields.items)||void 0===a)&&a[i]?r.concat([[i,o]]):(console.warn(`The widget ${i} in the repeat zone of the composite slice [${t.sliceName}] with key [${n.key}] doesn't exist in the model.`),r)},[])}),[])}}}}(Kj)),Kj}var KL,KF,KD={};function KW(){return KF||(KF=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.traverseSharedSliceContent=t.SharedSliceContent=t.SharedSliceLegacy=t.isSharedSliceContent=t.SharedSliceContentType=void 0;let n=oN,r=(0,n.__importStar)(zm),i=qT(),o=KO(),a=Kw(),u=KN();t.SharedSliceContentType="SharedSliceContent";let s=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.SharedSliceContentType;t.isSharedSliceContent=s;let c=r.exact(r.type({variation:r.string,items:(0,Vt.withFallback)(r.array(r.unknown),[]),primary:(0,Vt.withFallback)(r.UnknownRecord,{})})),l=n=>new r.Type("SharedSliceLegacy",t.isSharedSliceContent,r=>(0,Dc.pipe)(c.decode(r),Do.either.map(r=>{let i=(()=>{let t=(0,qk.getFieldCtx)("items",n,["variations",r.variation]),i=(0,u.RepeatableWidgetsLegacy)(t).decode(r.items);if(!(!i||(0,Da.isLeft)(i)))return i.right})()||[],o=Object.entries(r.primary).reduce((t,[i,o])=>{let u=(0,qk.getFieldCtx)(i,n,["variations",r.variation,"primary"]),s=(0,a.NestableLegacy)(u).decode(o);return!s||(0,Da.isLeft)(s)?t:{...t,[i]:s.right}},{});return{variation:r.variation,primary:o,items:i,__TYPE__:t.SharedSliceContentType}})),t=>{let r=Object.entries(t.primary).reduce((r,[i,o])=>{let u=(0,qk.getFieldCtx)(i,n,["variations",t.variation,"primary"]),s=(0,a.NestableLegacy)(u).encode(o);return s?{content:{...r.content,[i]:s.content},types:{...r.types,...s.types}}:r},{content:{},types:{}}),i=(()=>{let r=(0,qk.getFieldCtx)("items",n,["variations",t.variation]);return(0,u.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=l,t.SharedSliceContent=r.strict({__TYPE__:r.literal(t.SharedSliceContentType),variation:r.string,primary:r.record(r.string,a.NestableContent),items:u.RepeatableWidgets}),t.traverseSharedSliceContent=function({path:t,sliceKey:n,sliceName:r,model:i,content:u}){return(s,c)=>{let l=Object.entries(u.widget.primary).reduce((o,[u,c])=>{var l,f;let d=null===(f=null===(l=null==i?void 0:i.fields)||void 0===l?void 0:l.primary)||void 0===f?void 0:f[u],p=s({path:t.concat([{key:"primary",type:"primary"},{key:u,type:"Widget"}]),key:u,apiId:r,model:d,content:c});return p?(0,a.isNestableContent)(p)?{...o,[u]:p}:(console.warn(`Warn: Non nestable content with key [${u}] detected in a shared slice [${r}] with key [${n}]`),o):o},{}),f=(0,o.traverseGroupItemsContent)({path:t.concat([{key:"items",type:"items"}]),model:null==i?void 0:i.fields.items,content:u.widget.items})(s);return c({key:n,apiId:r,path:t,model:i,content:{...u,widget:{__TYPE__:"SharedSliceContent",variation:u.widget.variation,primary:l,items:f}}})}}}(KD)),KD}var KU,Kz={};function KB(){if(KU)return Kz;KU=1,Object.defineProperty(Kz,"__esModule",{value:!0}),Kz.migrateSimpleSlice=Kz.traverseSimpleSliceContent=Kz.SimpleSliceLegacy=Kz.isSimpleSliceContent=Kz.SimpleSliceContent=void 0;let t=(0,oN.__importStar)(zm),n=KO(),r=Kw();Kz.SimpleSliceContent=t.union([r.NestableContent,n.GroupContent]);let i=t=>(0,r.isNestableContent)(t)||(0,n.isGroupContent)(t);Kz.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 Kz.SimpleSliceLegacy=o,Kz.traverseSimpleSliceContent=function({path:t,sliceKey:r,sliceName:i,model:o,content:a}){return(u,s)=>{var c;if((0,n.isGroupContent)(a.widget)){let l=(0,n.traverseGroupContent)({path:t,key:a.key,apiId:a.name,model:(null==o?void 0:o.type)==="Group"?o:(null==o?void 0:o.type)==="SharedSlice"?{type:"Group",config:{fields:o.fields.items||{}}}:void 0,content:a.widget})(u);return l&&s({key:a.key,apiId:a.name,path:t,model:o,content:{...a,widget:l}})}let f=u({key:a.key,apiId:a.name,path:t,model:(null==o?void 0:o.type)==="SharedSlice"?null===(c=o.fields.primary)||void 0===c?void 0:c[a.name]:(null==o?void 0:o.type)!=="Group"?o:void 0,content:a.widget});return f&&s({key:r,apiId:i,path:t,model:o,content:{...a,widget:f}})}},Kz.migrateSimpleSlice=function(t,n){var r;return"GroupContentType"===n.widget.__TYPE__?{key:n.key,name:t.sliceName,maybeLabel:n.maybeLabel,widget:{__TYPE__:"SharedSliceContent",variation:t.variationId,primary:{},items:n.widget.value.map(n=>({__TYPE__:"GroupItemContent",value:n.value.reduce((n,[r,i])=>{var o;return!(null===(o=t.fields.items)||void 0===o)&&o[r]?n.concat([[r,i]]):n},[])}),[])}}:{key:n.key,name:t.sliceName,maybeLabel:n.maybeLabel,widget:{__TYPE__:"SharedSliceContent",variation:t.variationId,primary:!(null===(r=t.fields.primary)||void 0===r)&&r[n.name]?{[n.name]:n.widget}:{},items:[]}}},Kz}function KV(){return K$||(K$=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SliceContent=t.SliceLegacy=void 0;let n=oN,r=(0,n.__importStar)(zm),i=KP(),o=KW(),a=KB(),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)(KP(),t),(0,n.__exportStar)(KW(),t),(0,n.__exportStar)(KB(),t)}(KE)),KE}var K$,Kq,KK={};function KH(){if(Kq)return KK;Kq=1,Object.defineProperty(KK,"__esModule",{value:!0}),KK.migrateSliceItem=KK.SlicesItemLegacy=KK.isSimpleSliceItemContent=KK.isCompositeSliceItemContent=KK.isSharedSliceItemContent=KK.SliceItemContent=void 0;let t=oN,n=(0,t.__importStar)(zm),r=KO(),i=Kw(),o=KV(),a=KP(),u=KW(),s=KB();function c(t){return(0,a.isCompositeSliceContent)(t.widget)}function l(t){return(0,r.isGroupContent)(t.widget)||(0,i.isNestableContent)(t.widget)}KK.SliceItemContent=n.type({key:n.string,name:n.string,maybeLabel:n.union([n.string,n.undefined]),widget:o.SliceContent}),KK.isSharedSliceItemContent=function(t){return(0,u.isSharedSliceContent)(t.widget)},KK.isCompositeSliceItemContent=c,KK.isSimpleSliceItemContent=l;let f=n.exact(n.intersection([n.type({key:n.string,value:n.unknown}),n.partial({label:(0,zT.nullable)(n.string)})])),d=t=>new n.Type("SlicesItemLegacy",t=>((0,u.isSharedSliceContent)(t.widget),(0,a.isCompositeSliceContent)(t.widget),(0,s.isSimpleSliceContent)(t.widget)),(r,i)=>(0,Dc.pipe)(f.decode(r),Do.either.chain(a=>{var u;let s=a.key.indexOf("$"),c=a.key.substring(0,s>0?s:void 0),l=(0,qk.getFieldCtx)(c,t),f=(0,o.SliceLegacy)(l).decode(a.value);return!f||(0,Da.isLeft)(f)?n.failure(r,i):n.success({key:a.key,name:c,maybeLabel:null!==(u=a.label)&&void 0!==u?u:void 0,widget:f.right})})),n=>{let r=(0,qk.getFieldCtx)(n.name,t),i=(0,o.SliceLegacy)(r).encode(n.widget);return{content:{key:n.key,label:n.maybeLabel,value:(null==i?void 0:i.content)||{}},types:(null==i?void 0:i.types)||{}}});KK.SlicesItemLegacy=d;let p=({model:t,content:n})=>c(n)&&(null==t?void 0:t.type)==="SharedSlice"?(0,a.migrateCompositeSlice)(t,n):l(n)&&(null==t?void 0:t.type)==="SharedSlice"?(0,s.migrateSimpleSlice)(t,n):n;return KK.migrateSliceItem=p,KK}var KG,KZ={};function KJ(){return KY||(KY=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=oN;(0,n.__exportStar)(KV(),t),(0,n.__exportStar)(KH(),t),(0,n.__exportStar)((KG||(KG=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.traverseSlices=t.SlicesContent=t.SlicesLegacy=t.isSlicesContent=t.SlicesContentType=void 0;let n=oN,r=(0,n.__importStar)(zm),i=qT(),o=KP(),a=KW(),u=KB(),s=KH();t.SlicesContentType="SliceContentType";let c=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.SlicesContentType;t.isSlicesContent=c;let l=n=>{let i=r.array((0,s.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=l,t.SlicesContent=r.type({__TYPE__:r.literal(t.SlicesContentType),value:r.array(s.SliceItemContent)}),t.traverseSlices=function({path:t,key:n,model:r,content:i}){return({transformWidget:c=({content:t})=>t,transformSlice:l=({content:t})=>t})=>{let f=i.value.reduce((n,i)=>{let f=r&&function(t,n,r){var i,o;let a=null===(o=null===(i=null==n?void 0:n.config)||void 0===i?void 0:i.choices)||void 0===o?void 0:o[r.name];return(()=>{if((0,s.isSharedSliceItemContent)(r)&&a&&(0,Vs.isStaticSharedSlice)(a)){let t=a.variations.find(t=>t.id===r.widget.variation);return t?{type:"SharedSlice",sliceName:a.id,variationId:t.id,fields:{primary:t.primary||{},items:t.items||{}}}:void 0}})()||(()=>{var i;let o=zg.ContentPath.append(zg.ContentPath.serialize(t),r.name),a=Object.values((null===(i=null==n?void 0:n.config)||void 0===i?void 0:i.choices)||{}).find(t=>{var n;return!!(0,Vs.isStaticSharedSlice)(t)&&!!(!(null===(n=t.legacyPaths)||void 0===n)&&n[o])});if(!a)return;let u=null==a?void 0:a.variations.find(t=>{var n;return t.id===(null===(n=a.legacyPaths)||void 0===n?void 0:n[o])});if(u)return{type:"SharedSlice",sliceName:a.id,variationId:u.id,fields:{primary:u.primary||{},items:u.items||{}}}})()||(()=>{if(a){if((0,Vs.isCompositeSlice)(a))return{type:"Slice","non-repeat":a["non-repeat"]||{},repeat:a.repeat||{}};if((0,Vs.isLegacySlice)(a))return a}})()}(t,r,i),d=(0,s.isSharedSliceItemContent)(i)?(0,a.traverseSharedSliceContent)({path:t.concat({key:i.key,type:"SharedSlice"}),sliceKey:i.key,sliceName:i.name,model:(null==f?void 0:f.type)==="SharedSlice"?f:void 0,content:i})(c,l):(0,s.isCompositeSliceItemContent)(i)?(0,o.traverseCompositeSliceContent)({path:t.concat({key:i.key,type:"Slice"}),sliceKey:i.key,sliceName:i.name,model:(null==f?void 0:f.type)==="Slice"||(null==f?void 0:f.type)==="SharedSlice"?f:void 0,content:i})(c,l):(0,s.isSimpleSliceItemContent)(i)?(0,u.traverseSimpleSliceContent)({path:t.concat({key:i.key,type:"LegacySlice"}),sliceKey:i.key,sliceName:i.name,model:f&&(null==f?void 0:f.type)!=="Slice"?f:void 0,content:i})(c,l):void 0;return d?n.concat(d):n},[]);return c({path:t,key:n,apiId:n,model:r,content:{__TYPE__:i.__TYPE__,value:f}})}}}(KZ)),KZ),t)}(KR)),KR}var KY,KQ,KX={};function K0(){return KQ||(KQ=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=qT();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})}(KX)),KX}var K1,K2={};function K3(){return i||(i=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=oN;(0,n.__exportStar)(qw(),t),(0,n.__exportStar)(KO(),t),(0,n.__exportStar)(Kw(),t),(0,n.__exportStar)(KJ(),t),(0,n.__exportStar)(K0(),t),(0,n.__exportStar)(function(){if(K1)return K2;K1=1,Object.defineProperty(K2,"__esModule",{value:!0}),K2.WidgetLegacy=K2.isWidgetContent=K2.WidgetContent=void 0;let t=(0,oN.__importStar)(zm),n=KO(),r=Kw(),i=KJ(),o=K0();K2.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);K2.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 K2.WidgetLegacy=u,K2}(),t)}(qx)),qx}Object.defineProperty(oP,"__esModule",{value:!0}),oP.migrateDocument=oP.collectWidgets=oP.traverseDocument=oP.DocumentLegacy=oP.Document=void 0;let K4=oN,K5=(0,K4.__importStar)(zm),K9=K3();oP.Document=K5.record(zy.WidgetKey,K9.WidgetContent);let K6=K5.record(zy.WidgetKey,K5.unknown),K8=t=>new K5.Type("Document",t=>!!t&&"object"==typeof t,n=>(0,Dc.pipe)(K6.decode(n),Do.either.map(n=>Object.entries(n).reduce((n,[r,i])=>{let o=(0,qk.defaultCtx)(r,t),a=(0,K9.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,qk.defaultCtx)(r,t),a=(0,K9.WidgetLegacy)(o).encode(i);return a?{content:{...n.content,[r]:a.content},types:{...n.types,...a.types}}:n},{content:{},types:{}}));function K7(t){let n=Object.entries(t),{types:r,widgets:i}=n.reduce((t,[n,r])=>{if(n.endsWith("_TYPE")){let i=qk.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 He({document:t,customType:n}){let r=n&&Vs.StaticCustomType.is(n)?Ht(n):n;return({transformWidget:n=({content:t})=>t,transformSlice:i=({content:t})=>t})=>{let o=r&&Object.entries(r.fields).reduce((t,[n,r])=>({...t,[n]:r}),{});return Object.entries(t).reduce((t,[a,u])=>{let s=o&&o[a],c=zg.ContentPath.make([{key:null==r?void 0:r.customTypeId,type:"CustomType"},{key:a,type:"Widget"}]),l=(()=>{switch(u.__TYPE__){case"SliceContentType":return(0,K9.traverseSlices)({path:c,key:a,model:(null==s?void 0:s.type)==="Slices"||(null==s?void 0:s.type)==="Choice"?s:void 0,content:u})({transformWidget:n,transformSlice:i});case"GroupContentType":return(0,K9.traverseGroupContent)({path:c,key:a,apiId:a,model:(null==s?void 0:s.type)==="Group"?s:void 0,content:u})(n);default:return n({path:c,key:a,apiId:a,model:(null==s?void 0:s.type)!=="Group"&&(null==s?void 0:s.type)!=="Slices"&&(null==s?void 0:s.type)!=="Choice"?s:void 0,content:u})}})();return{...t,...l?{[a]:l}:{}}},{})}}function Ht(t){return{customTypeId:null==t?void 0:t.id,fields:Object.fromEntries((0,Vs.flattenSections)(t))}}function Hn(t,n){let r=Vs.StaticCustomType.is(n)?Ht(n):n;return Object.values((0,Vs.collectSharedSlices)(r)).some(t=>Boolean(t.legacyPaths))?He({document:t,customType:n})({transformSlice:K9.migrateSliceItem}):t}function Hr(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 Hi(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 Ho(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 C.jsxs(l.gN,{children:[C.jsx(l.fw,{name:"toggleOff"}),C.jsx(l.Qy,{htmlFor:o,children:Hr(i)}),C.jsxs(l.JO,{children:[C.jsx(l.xu,{padding:4,alignItems:"center",children:C.jsx(l.xv,{children:Hi(i,s)})}),C.jsx(l.rs,{checked:s,id:o,onCheckedChange(t){var n;u||a((n=t,{__TYPE__:"BooleanContent",value:n}))}})]})]})}function Ha(t){let{id:n,field:r,content:i,onContentChange:o}=t;return C.jsxs(l.gN,{children:[C.jsx(l.fw,{name:"colorLens"}),C.jsx(l.Qy,{id:n,children:Hr(r)}),C.jsx(l.JO,{children:C.jsx(l.xu,{padding:{left:4},alignItems:"center",children:C.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:Hi(r)})})})]})}function Hu(t){let{id:n,readOnly:r,field:i,content:o,onContentChange:a}=t;return C.jsxs(l.gN,{children:[C.jsx(l.fw,{name:"dateRange"}),C.jsx(l.Qy,{id:n,children:Hr(i)}),C.jsx(l.JO,{children:C.jsx(l.xu,{padding:{left:4,right:12},width:"100%",flexDirection:"column",justifyContent:"center",children:C.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:K8,extractMetadata:K7,parse:function(t,n){let r=(0,Dc.pipe)(K5.record(zy.WidgetKey,K5.unknown).decode(t),Do.either.chain(t=>{let{types:n,widgets:r}=K7(t);return K8(n).decode(r)}));return(0,Da.isLeft)(r)?void 0:Hn(r.right,n)},encode:function(t){let n=K8().encode(t);return{...n.content,...n.types}}},oP.traverseDocument=He,oP.collectWidgets=function(t,n){let r={};return He({document:t})({transformWidget({content:t,path:i}){let o=zg.ContentPath.serialize(i);return n(t,i)&&(r[o]=t),t}}),r},oP.migrateDocument=Hn,function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=oN;(0,n.__exportStar)(oP,t),(0,n.__exportStar)(K3(),t),(0,n.__exportStar)(qk,t)}(oA),(eig=o||(o={})).assertEqual=t=>t,eig.assertIs=function(t){},eig.assertNever=function(t){throw Error()},eig.arrayToEnum=t=>{let n={};for(let r of t)n[r]=r;return n},eig.getValidEnumValues=t=>{let n=eig.objectKeys(t).filter(n=>"number"!=typeof t[t[n]]),r={};for(let i of n)r[i]=t[i];return eig.objectValues(r)},eig.objectValues=t=>eig.objectKeys(t).map(function(n){return t[n]}),eig.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},eig.find=(t,n)=>{for(let r of t)if(n(r))return r},eig.isInteger="function"==typeof Number.isInteger?t=>Number.isInteger(t):t=>"number"==typeof t&&isFinite(t)&&Math.floor(t)===t,eig.joinValues=function(t,n=" | "){return t.map(t=>"string"==typeof t?`'${t}'`:t).join(n)},eig.jsonStringifyReplacer=(t,n)=>"bigint"==typeof n?n.toString():n,(eiy=a||(a={})).mergeShapes=(t,n)=>({...t,...n});let Hs=o.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Hc=t=>{switch(typeof t){case"undefined":return Hs.undefined;case"string":return Hs.string;case"number":return isNaN(t)?Hs.nan:Hs.number;case"boolean":return Hs.boolean;case"function":return Hs.function;case"bigint":return Hs.bigint;case"symbol":return Hs.symbol;case"object":return Array.isArray(t)?Hs.array:null===t?Hs.null:t.then&&"function"==typeof t.then&&t.catch&&"function"==typeof t.catch?Hs.promise:"u">typeof Map&&t instanceof Map?Hs.map:"u">typeof Set&&t instanceof Set?Hs.set:"u">typeof Date&&t instanceof Date?Hs.date:Hs.object;default:return Hs.unknown}},Hl=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"]),Hf=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class Hd 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()}}Hd.create=t=>new Hd(t);let Hp=(t,n)=>{let r;switch(t.code){case Hl.invalid_type:r=t.received===Hs.undefined?"Required":`Expected ${t.expected}, received ${t.received}`;break;case Hl.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,o.jsonStringifyReplacer)}`;break;case Hl.unrecognized_keys:r=`Unrecognized key(s) in object: ${o.joinValues(t.keys,", ")}`;break;case Hl.invalid_union:r="Invalid input";break;case Hl.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${o.joinValues(t.options)}`;break;case Hl.invalid_enum_value:r=`Invalid enum value. Expected ${o.joinValues(t.options)}, received '${t.received}'`;break;case Hl.invalid_arguments:r="Invalid function arguments";break;case Hl.invalid_return_type:r="Invalid function return type";break;case Hl.invalid_date:r="Invalid date";break;case Hl.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 Hl.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 Hl.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 Hl.custom:r="Invalid input";break;case Hl.invalid_intersection_types:r="Intersection results could not be merged";break;case Hl.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case Hl.not_finite:r="Number must be finite";break;default:r=n.defaultError,o.assertNever(t)}return{message:r}},Hh=Hp;function Hm(t){Hh=t}function Hg(){return Hh}let Hy=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 Hv(t,n){let r=Hy({issueData:n,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Hh,Hp].filter(t=>!!t)});t.common.issues.push(r)}class Hb{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 Hx;"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 Hb.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 Hx;"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 Hx=Object.freeze({status:"aborted"}),H_=t=>({status:"dirty",value:t}),HS=t=>({status:"valid",value:t}),HT=t=>"aborted"===t.status,Hw=t=>"dirty"===t.status,HO=t=>"valid"===t.status,Hk=t=>"u">typeof Promise&&t instanceof Promise;(eiv=u||(u={})).errToObj=t=>"string"==typeof t?{message:t}:t||{},eiv.toString=t=>"string"==typeof t?t:null==t?void 0:t.message;class HI{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 HC=(t,n)=>{if(HO(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 Hd(t.common.issues);return this._error=r,this._error}}};function HM(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 HR{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 Hc(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Hc(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Hb,ctx:{common:t.parent.common,data:t.data,parsedType:Hc(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(Hk(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:Hc(t)},o=this._parseSync({data:t,path:i.path,parent:i});return HC(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:Hc(t)},i=this._parse({data:t,path:r.path,parent:r}),o=await (Hk(i)?i:Promise.resolve(i));return HC(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:Hl.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 Gu({schema:this,typeName:s.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Gs.create(this,this._def)}nullable(){return Gc.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return H0.create(this,this._def)}promise(){return Ga.create(this,this._def)}or(t){return H2.create([this,t],this._def)}and(t){return H5.create(this,t,this._def)}transform(t){return new Gu({...HM(this._def),schema:this,typeName:s.ZodEffects,effect:{type:"transform",transform:t}})}default(t){return new Gl({...HM(this._def),innerType:this,defaultValue:"function"==typeof t?t:()=>t,typeName:s.ZodDefault})}brand(){return new Gh({typeName:s.ZodBranded,type:this,...HM(this._def)})}catch(t){return new Gf({...HM(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 Gm.create(this,t)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}let HE=/^c[^\s-]{8,}$/i,Hj=/^[a-z][a-z0-9]*$/,HA=/[0-9A-HJKMNP-TV-Z]{26}/,HN=/^([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,HP=/^(([^<>()[\]\\.,;:\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,})+))$/,HL=/^(\p{Extended_Pictographic}|\p{Emoji_Component})+$/u,HF=/^(((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}))$/,HD=/^(([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})))$/,HW=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 HU(t,n){return!!(("v4"===n||!n)&&HF.test(t)||("v6"===n||!n)&&HD.test(t))}class Hz extends HR{constructor(){super(...arguments),this._regex=(t,n,r)=>this.refinement(n=>t.test(n),{validation:n,code:Hl.invalid_string,...u.errToObj(r)}),this.nonempty=t=>this.min(1,u.errToObj(t)),this.trim=()=>new Hz({...this._def,checks:[...this._def.checks,{kind:"trim"}]}),this.toLowerCase=()=>new Hz({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]}),this.toUpperCase=()=>new Hz({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Hs.string){let n=this._getOrReturnCtx(t);return Hv(n,{code:Hl.invalid_type,expected:Hs.string,received:n.parsedType}),Hx}let r=new Hb,i;for(let a of this._def.checks)if("min"===a.kind)t.data.length<a.value&&(Hv(i=this._getOrReturnCtx(t,i),{code:Hl.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&&(Hv(i=this._getOrReturnCtx(t,i),{code:Hl.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?Hv(i,{code:Hl.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):s&&Hv(i,{code:Hl.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),r.dirty())}else if("email"===a.kind)HP.test(t.data)||(Hv(i=this._getOrReturnCtx(t,i),{validation:"email",code:Hl.invalid_string,message:a.message}),r.dirty());else if("emoji"===a.kind)HL.test(t.data)||(Hv(i=this._getOrReturnCtx(t,i),{validation:"emoji",code:Hl.invalid_string,message:a.message}),r.dirty());else if("uuid"===a.kind)HN.test(t.data)||(Hv(i=this._getOrReturnCtx(t,i),{validation:"uuid",code:Hl.invalid_string,message:a.message}),r.dirty());else if("cuid"===a.kind)HE.test(t.data)||(Hv(i=this._getOrReturnCtx(t,i),{validation:"cuid",code:Hl.invalid_string,message:a.message}),r.dirty());else if("cuid2"===a.kind)Hj.test(t.data)||(Hv(i=this._getOrReturnCtx(t,i),{validation:"cuid2",code:Hl.invalid_string,message:a.message}),r.dirty());else if("ulid"===a.kind)HA.test(t.data)||(Hv(i=this._getOrReturnCtx(t,i),{validation:"ulid",code:Hl.invalid_string,message:a.message}),r.dirty());else if("url"===a.kind)try{new URL(t.data)}catch{Hv(i=this._getOrReturnCtx(t,i),{validation:"url",code:Hl.invalid_string,message:a.message}),r.dirty()}else"regex"===a.kind?(a.regex.lastIndex=0,a.regex.test(t.data)||(Hv(i=this._getOrReturnCtx(t,i),{validation:"regex",code:Hl.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)||(Hv(i=this._getOrReturnCtx(t,i),{code:Hl.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)||(Hv(i=this._getOrReturnCtx(t,i),{code:Hl.invalid_string,validation:{startsWith:a.value},message:a.message}),r.dirty()):"endsWith"===a.kind?t.data.endsWith(a.value)||(Hv(i=this._getOrReturnCtx(t,i),{code:Hl.invalid_string,validation:{endsWith:a.value},message:a.message}),r.dirty()):"datetime"===a.kind?HW(a).test(t.data)||(Hv(i=this._getOrReturnCtx(t,i),{code:Hl.invalid_string,validation:"datetime",message:a.message}),r.dirty()):"ip"===a.kind?HU(t.data,a.version)||(Hv(i=this._getOrReturnCtx(t,i),{validation:"ip",code:Hl.invalid_string,message:a.message}),r.dirty()):o.assertNever(a);return{status:r.value,value:t.data}}_addCheck(t){return new Hz({...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 HB(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)}Hz.create=t=>{var n;return new Hz({checks:[],typeName:s.ZodString,coerce:null!==(n=null==t?void 0:t.coerce)&&void 0!==n&&n,...HM(t)})};class HV extends HR{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)!==Hs.number){let n=this._getOrReturnCtx(t);return Hv(n,{code:Hl.invalid_type,expected:Hs.number,received:n.parsedType}),Hx}let r,i=new Hb;for(let a of this._def.checks)"int"===a.kind?o.isInteger(t.data)||(Hv(r=this._getOrReturnCtx(t,r),{code:Hl.invalid_type,expected:"integer",received:"float",message:a.message}),i.dirty()):"min"===a.kind?(a.inclusive?t.data<a.value:t.data<=a.value)&&(Hv(r=this._getOrReturnCtx(t,r),{code:Hl.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)&&(Hv(r=this._getOrReturnCtx(t,r),{code:Hl.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):"multipleOf"===a.kind?0!==HB(t.data,a.value)&&(Hv(r=this._getOrReturnCtx(t,r),{code:Hl.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):"finite"===a.kind?Number.isFinite(t.data)||(Hv(r=this._getOrReturnCtx(t,r),{code:Hl.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 HV({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:u.toString(i)}]})}_addCheck(t){return new HV({...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)}}HV.create=t=>new HV({checks:[],typeName:s.ZodNumber,coerce:(null==t?void 0:t.coerce)||!1,...HM(t)});class H$ extends HR{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)!==Hs.bigint){let n=this._getOrReturnCtx(t);return Hv(n,{code:Hl.invalid_type,expected:Hs.bigint,received:n.parsedType}),Hx}let r,i=new Hb;for(let a of this._def.checks)"min"===a.kind?(a.inclusive?t.data<a.value:t.data<=a.value)&&(Hv(r=this._getOrReturnCtx(t,r),{code:Hl.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)&&(Hv(r=this._getOrReturnCtx(t,r),{code:Hl.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):"multipleOf"===a.kind?t.data%a.value!==BigInt(0)&&(Hv(r=this._getOrReturnCtx(t,r),{code:Hl.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 H$({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:u.toString(i)}]})}_addCheck(t){return new H$({...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}}H$.create=t=>{var n;return new H$({checks:[],typeName:s.ZodBigInt,coerce:null!==(n=null==t?void 0:t.coerce)&&void 0!==n&&n,...HM(t)})};class Hq extends HR{_parse(t){if(this._def.coerce&&(t.data=Boolean(t.data)),this._getType(t)!==Hs.boolean){let n=this._getOrReturnCtx(t);return Hv(n,{code:Hl.invalid_type,expected:Hs.boolean,received:n.parsedType}),Hx}return HS(t.data)}}Hq.create=t=>new Hq({typeName:s.ZodBoolean,coerce:(null==t?void 0:t.coerce)||!1,...HM(t)});class HK extends HR{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Hs.date){let n=this._getOrReturnCtx(t);return Hv(n,{code:Hl.invalid_type,expected:Hs.date,received:n.parsedType}),Hx}if(isNaN(t.data.getTime())){let r=this._getOrReturnCtx(t);return Hv(r,{code:Hl.invalid_date}),Hx}let i=new Hb,a;for(let u of this._def.checks)"min"===u.kind?t.data.getTime()<u.value&&(Hv(a=this._getOrReturnCtx(t,a),{code:Hl.too_small,message:u.message,inclusive:!0,exact:!1,minimum:u.value,type:"date"}),i.dirty()):"max"===u.kind?t.data.getTime()>u.value&&(Hv(a=this._getOrReturnCtx(t,a),{code:Hl.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 HK({...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}}HK.create=t=>new HK({checks:[],coerce:(null==t?void 0:t.coerce)||!1,typeName:s.ZodDate,...HM(t)});class HH extends HR{_parse(t){if(this._getType(t)!==Hs.symbol){let n=this._getOrReturnCtx(t);return Hv(n,{code:Hl.invalid_type,expected:Hs.symbol,received:n.parsedType}),Hx}return HS(t.data)}}HH.create=t=>new HH({typeName:s.ZodSymbol,...HM(t)});class HG extends HR{_parse(t){if(this._getType(t)!==Hs.undefined){let n=this._getOrReturnCtx(t);return Hv(n,{code:Hl.invalid_type,expected:Hs.undefined,received:n.parsedType}),Hx}return HS(t.data)}}HG.create=t=>new HG({typeName:s.ZodUndefined,...HM(t)});class HZ extends HR{_parse(t){if(this._getType(t)!==Hs.null){let n=this._getOrReturnCtx(t);return Hv(n,{code:Hl.invalid_type,expected:Hs.null,received:n.parsedType}),Hx}return HS(t.data)}}HZ.create=t=>new HZ({typeName:s.ZodNull,...HM(t)});class HJ extends HR{constructor(){super(...arguments),this._any=!0}_parse(t){return HS(t.data)}}HJ.create=t=>new HJ({typeName:s.ZodAny,...HM(t)});class HY extends HR{constructor(){super(...arguments),this._unknown=!0}_parse(t){return HS(t.data)}}HY.create=t=>new HY({typeName:s.ZodUnknown,...HM(t)});class HQ extends HR{_parse(t){let n=this._getOrReturnCtx(t);return Hv(n,{code:Hl.invalid_type,expected:Hs.never,received:n.parsedType}),Hx}}HQ.create=t=>new HQ({typeName:s.ZodNever,...HM(t)});class HX extends HR{_parse(t){if(this._getType(t)!==Hs.undefined){let n=this._getOrReturnCtx(t);return Hv(n,{code:Hl.invalid_type,expected:Hs.void,received:n.parsedType}),Hx}return HS(t.data)}}HX.create=t=>new HX({typeName:s.ZodVoid,...HM(t)});class H0 extends HR{_parse(t){let{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==Hs.array)return Hv(n,{code:Hl.invalid_type,expected:Hs.array,received:n.parsedType}),Hx;if(null!==i.exactLength){let o=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(o||a)&&(Hv(n,{code:o?Hl.too_big:Hl.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&&(Hv(n,{code:Hl.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&&(Hv(n,{code:Hl.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 HI(n,t,n.path,r)))).then(t=>Hb.mergeArray(r,t));let u=[...n.data].map((t,r)=>i.type._parseSync(new HI(n,t,n.path,r)));return Hb.mergeArray(r,u)}get element(){return this._def.type}min(t,n){return new H0({...this._def,minLength:{value:t,message:u.toString(n)}})}max(t,n){return new H0({...this._def,maxLength:{value:t,message:u.toString(n)}})}length(t,n){return new H0({...this._def,exactLength:{value:t,message:u.toString(n)}})}nonempty(t){return this.min(1,t)}}H0.create=(t,n)=>new H0({type:t,minLength:null,maxLength:null,exactLength:null,typeName:s.ZodArray,...HM(n)});class H1 extends HR{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)!==Hs.object){let n=this._getOrReturnCtx(t);return Hv(n,{code:Hl.invalid_type,expected:Hs.object,received:n.parsedType}),Hx}let{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),u=[];if(!(this._def.catchall instanceof HQ&&"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 HI(i,d,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof HQ){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&&(Hv(i,{code:Hl.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 HI(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=>Hb.mergeObjectSync(r,t)):Hb.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(t){return u.errToObj,new H1({...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 H1({...this._def,unknownKeys:"strip"})}passthrough(){return new H1({...this._def,unknownKeys:"passthrough"})}extend(t){return new H1({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new H1({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 H1({...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 H1({...this._def,shape:()=>n})}omit(t){let n={};return o.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new H1({...this._def,shape:()=>n})}deepPartial(){return function t(n){if(!(n instanceof H1))return n instanceof H0?new H0({...n._def,type:t(n.element)}):n instanceof Gs?Gs.create(t(n.unwrap())):n instanceof Gc?Gc.create(t(n.unwrap())):n instanceof H9?H9.create(n.items.map(n=>t(n))):n;{let r={};for(let i in n.shape){let o=n.shape[i];r[i]=Gs.create(t(o))}return new H1({...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 H1({...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 Gs;)i=i._def.innerType;n[r]=i}}),new H1({...this._def,shape:()=>n})}keyof(){return Gr(o.objectKeys(this.shape))}}H1.create=(t,n)=>new H1({shape:()=>t,unknownKeys:"strip",catchall:HQ.create(),typeName:s.ZodObject,...HM(n)}),H1.strictCreate=(t,n)=>new H1({shape:()=>t,unknownKeys:"strict",catchall:HQ.create(),typeName:s.ZodObject,...HM(n)}),H1.lazycreate=(t,n)=>new H1({shape:t,unknownKeys:"strip",catchall:HQ.create(),typeName:s.ZodObject,...HM(n)});class H2 extends HR{_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 Hd(t.ctx.common.issues));return Hv(n,{code:Hl.invalid_union,unionErrors:o}),Hx});{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 Hd(t));return Hv(n,{code:Hl.invalid_union,unionErrors:c}),Hx}}get options(){return this._def.options}}H2.create=(t,n)=>new H2({options:t,typeName:s.ZodUnion,...HM(n)});let H3=t=>t instanceof Gt?H3(t.schema):t instanceof Gu?H3(t.innerType()):t instanceof Gn?[t.value]:t instanceof Gi?t.options:t instanceof Go?Object.keys(t.enum):t instanceof Gl?H3(t._def.innerType):t instanceof HG?[void 0]:t instanceof HZ?[null]:null;class H4 extends HR{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==Hs.object)return Hv(n,{code:Hl.invalid_type,expected:Hs.object,received:n.parsedType}),Hx;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}):(Hv(n,{code:Hl.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Hx)}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=H3(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 H4({typeName:s.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...HM(r)})}}class H5 extends HR{_parse(t){let{status:n,ctx:r}=this._processInputParams(t),i=(t,i)=>{if(HT(t)||HT(i))return Hx;let a=function t(n,r){let i=Hc(n),a=Hc(r);if(n===r)return{valid:!0,data:n};if(i===Hs.object&&a===Hs.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!==Hs.array||a!==Hs.array)return i===Hs.date&&a===Hs.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?((Hw(t)||Hw(i))&&n.dirty(),{status:n.value,value:a.data}):(Hv(r,{code:Hl.invalid_intersection_types}),Hx)};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}))}}H5.create=(t,n,r)=>new H5({left:t,right:n,typeName:s.ZodIntersection,...HM(r)});class H9 extends HR{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Hs.array)return Hv(r,{code:Hl.invalid_type,expected:Hs.array,received:r.parsedType}),Hx;if(r.data.length<this._def.items.length)return Hv(r,{code:Hl.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Hx;!this._def.rest&&r.data.length>this._def.items.length&&(Hv(r,{code:Hl.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 HI(r,t,r.path,n)):null}).filter(t=>!!t);return r.common.async?Promise.all(i).then(t=>Hb.mergeArray(n,t)):Hb.mergeArray(n,i)}get items(){return this._def.items}rest(t){return new H9({...this._def,rest:t})}}H9.create=(t,n)=>{if(!Array.isArray(t))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new H9({items:t,typeName:s.ZodTuple,rest:null,...HM(n)})};class H6 extends HR{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!==Hs.object)return Hv(r,{code:Hl.invalid_type,expected:Hs.object,received:r.parsedType}),Hx;let i=[],o=this._def.keyType,a=this._def.valueType;for(let u in r.data)i.push({key:o._parse(new HI(r,u,r.path,u)),value:a._parse(new HI(r,r.data[u],r.path,u))});return r.common.async?Hb.mergeObjectAsync(n,i):Hb.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return new H6(n instanceof HR?{keyType:t,valueType:n,typeName:s.ZodRecord,...HM(r)}:{keyType:Hz.create(),valueType:t,typeName:s.ZodRecord,...HM(n)})}}class H8 extends HR{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Hs.map)return Hv(r,{code:Hl.invalid_type,expected:Hs.map,received:r.parsedType}),Hx;let i=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([t,n],a)=>({key:i._parse(new HI(r,t,r.path,[a,"key"])),value:o._parse(new HI(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 Hx;("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 Hx;("dirty"===l.status||"dirty"===f.status)&&n.dirty(),s.set(l.value,f.value)}return{status:n.value,value:s}}}}H8.create=(t,n,r)=>new H8({valueType:n,keyType:t,typeName:s.ZodMap,...HM(r)});class H7 extends HR{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Hs.set)return Hv(r,{code:Hl.invalid_type,expected:Hs.set,received:r.parsedType}),Hx;let i=this._def;null!==i.minSize&&r.data.size<i.minSize.value&&(Hv(r,{code:Hl.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&&(Hv(r,{code:Hl.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 Hx;"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 HI(r,t,r.path,n)));return r.common.async?Promise.all(u).then(t=>a(t)):a(u)}min(t,n){return new H7({...this._def,minSize:{value:t,message:u.toString(n)}})}max(t,n){return new H7({...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)}}H7.create=(t,n)=>new H7({valueType:t,minSize:null,maxSize:null,typeName:s.ZodSet,...HM(n)});class Ge extends HR{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==Hs.function)return Hv(n,{code:Hl.invalid_type,expected:Hs.function,received:n.parsedType}),Hx;function r(t,r){return Hy({data:t,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Hh,Hp].filter(t=>!!t),issueData:{code:Hl.invalid_arguments,argumentsError:r}})}function i(t,r){return Hy({data:t,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Hh,Hp].filter(t=>!!t),issueData:{code:Hl.invalid_return_type,returnTypeError:r}})}let o={errorMap:n.common.contextualErrorMap},a=n.data;return this._def.returns instanceof Ga?HS(async(...t)=>{let n=new Hd([]),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})}):HS((...t)=>{let n=this._def.args.safeParse(t,o);if(!n.success)throw new Hd([r(t,n.error)]);let u=a(...n.data),s=this._def.returns.safeParse(u,o);if(!s.success)throw new Hd([i(u,s.error)]);return s.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Ge({...this._def,args:H9.create(t).rest(HY.create())})}returns(t){return new Ge({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new Ge({args:t||H9.create([]).rest(HY.create()),returns:n||HY.create(),typeName:s.ZodFunction,...HM(r)})}}class Gt extends HR{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})}}Gt.create=(t,n)=>new Gt({getter:t,typeName:s.ZodLazy,...HM(n)});class Gn extends HR{_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return Hv(n,{received:n.data,code:Hl.invalid_literal,expected:this._def.value}),Hx}return{status:"valid",value:t.data}}get value(){return this._def.value}}function Gr(t,n){return new Gi({values:t,typeName:s.ZodEnum,...HM(n)})}Gn.create=(t,n)=>new Gn({value:t,typeName:s.ZodLiteral,...HM(n)});class Gi extends HR{_parse(t){if("string"!=typeof t.data){let n=this._getOrReturnCtx(t),r=this._def.values;return Hv(n,{expected:o.joinValues(r),received:n.parsedType,code:Hl.invalid_type}),Hx}if(-1===this._def.values.indexOf(t.data)){let i=this._getOrReturnCtx(t),a=this._def.values;return Hv(i,{received:i.data,code:Hl.invalid_enum_value,options:a}),Hx}return HS(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 Gi.create(t)}exclude(t){return Gi.create(this.options.filter(n=>!t.includes(n)))}}Gi.create=Gr;class Go extends HR{_parse(t){let n=o.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Hs.string&&r.parsedType!==Hs.number){let i=o.objectValues(n);return Hv(r,{expected:o.joinValues(i),received:r.parsedType,code:Hl.invalid_type}),Hx}if(-1===n.indexOf(t.data)){let a=o.objectValues(n);return Hv(r,{received:r.data,code:Hl.invalid_enum_value,options:a}),Hx}return HS(t.data)}get enum(){return this._def.values}}Go.create=(t,n)=>new Go({values:t,typeName:s.ZodNativeEnum,...HM(n)});class Ga extends HR{unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==Hs.promise&&!1===n.common.async)return Hv(n,{code:Hl.invalid_type,expected:Hs.promise,received:n.parsedType}),Hx;let r=n.parsedType===Hs.promise?n.data:Promise.resolve(n.data);return HS(r.then(t=>this._def.type.parseAsync(t,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Ga.create=(t,n)=>new Ga({type:t,typeName:s.ZodPromise,...HM(n)});class Gu extends HR{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){Hv(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?Hx:("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?Hx:("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=>HO(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(!HO(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)}}Gu.create=(t,n,r)=>new Gu({schema:t,typeName:s.ZodEffects,effect:n,...HM(r)}),Gu.createWithPreprocess=(t,n,r)=>new Gu({schema:n,effect:{type:"preprocess",transform:t},typeName:s.ZodEffects,...HM(r)});class Gs extends HR{_parse(t){return this._getType(t)===Hs.undefined?HS(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Gs.create=(t,n)=>new Gs({innerType:t,typeName:s.ZodOptional,...HM(n)});class Gc extends HR{_parse(t){return this._getType(t)===Hs.null?HS(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Gc.create=(t,n)=>new Gc({innerType:t,typeName:s.ZodNullable,...HM(n)});class Gl extends HR{_parse(t){let{ctx:n}=this._processInputParams(t),r=n.data;return n.parsedType===Hs.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Gl.create=(t,n)=>new Gl({innerType:t,typeName:s.ZodDefault,defaultValue:"function"==typeof n.default?n.default:()=>n.default,...HM(n)});class Gf extends HR{_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 Hk(i)?i.then(t=>({status:"valid",value:"valid"===t.status?t.value:this._def.catchValue({get error(){return new Hd(r.common.issues)},input:r.data})})):{status:"valid",value:"valid"===i.status?i.value:this._def.catchValue({get error(){return new Hd(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Gf.create=(t,n)=>new Gf({innerType:t,typeName:s.ZodCatch,catchValue:"function"==typeof n.catch?n.catch:()=>n.catch,...HM(n)});class Gd extends HR{_parse(t){if(this._getType(t)!==Hs.nan){let n=this._getOrReturnCtx(t);return Hv(n,{code:Hl.invalid_type,expected:Hs.nan,received:n.parsedType}),Hx}return{status:"valid",value:t.data}}}Gd.create=t=>new Gd({typeName:s.ZodNaN,...HM(t)});let Gp=Symbol("zod_brand");class Gh extends HR{_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 Gm extends HR{_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?Hx:"dirty"===t.status?(n.dirty(),H_(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?Hx:"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 Gm({in:t,out:n,typeName:s.ZodPipeline})}}let Gg=(t,n={},r)=>t?HJ.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})}}):HJ.create(),Gy={object:H1.lazycreate};(eib=s||(s={})).ZodString="ZodString",eib.ZodNumber="ZodNumber",eib.ZodNaN="ZodNaN",eib.ZodBigInt="ZodBigInt",eib.ZodBoolean="ZodBoolean",eib.ZodDate="ZodDate",eib.ZodSymbol="ZodSymbol",eib.ZodUndefined="ZodUndefined",eib.ZodNull="ZodNull",eib.ZodAny="ZodAny",eib.ZodUnknown="ZodUnknown",eib.ZodNever="ZodNever",eib.ZodVoid="ZodVoid",eib.ZodArray="ZodArray",eib.ZodObject="ZodObject",eib.ZodUnion="ZodUnion",eib.ZodDiscriminatedUnion="ZodDiscriminatedUnion",eib.ZodIntersection="ZodIntersection",eib.ZodTuple="ZodTuple",eib.ZodRecord="ZodRecord",eib.ZodMap="ZodMap",eib.ZodSet="ZodSet",eib.ZodFunction="ZodFunction",eib.ZodLazy="ZodLazy",eib.ZodLiteral="ZodLiteral",eib.ZodEnum="ZodEnum",eib.ZodEffects="ZodEffects",eib.ZodNativeEnum="ZodNativeEnum",eib.ZodOptional="ZodOptional",eib.ZodNullable="ZodNullable",eib.ZodDefault="ZodDefault",eib.ZodCatch="ZodCatch",eib.ZodPromise="ZodPromise",eib.ZodBranded="ZodBranded",eib.ZodPipeline="ZodPipeline";let Gv=(t,n={message:`Input not instance of ${t.name}`})=>Gg(n=>n instanceof t,n),Gb=Hz.create,Gx=HV.create,G_=Gd.create,GS=H$.create,GT=Hq.create,Gw=HK.create,GO=HH.create,Gk=HG.create,GI=HZ.create,GC=HJ.create,GM=HY.create,GR=HQ.create,GE=HX.create,Gj=H0.create,GA=H1.create,GN=H1.strictCreate,GP=H2.create,GL=H4.create,GF=H5.create,GD=H9.create,GW=H6.create,GU=H8.create,Gz=H7.create,GB=Ge.create,GV=Gt.create,G$=Gn.create,Gq=Gi.create,GK=Go.create,GH=Ga.create,GG=Gu.create,GZ=Gs.create,GJ=Gc.create,GY=Gu.createWithPreprocess,GQ=Gm.create,GX=()=>Gb().optional(),G0=()=>Gx().optional(),G1=()=>GT().optional();var G2=Object.freeze({__proto__:null,defaultErrorMap:Hp,setErrorMap:Hm,getErrorMap:Hg,makeIssue:Hy,EMPTY_PATH:[],addIssueToContext:Hv,ParseStatus:Hb,INVALID:Hx,DIRTY:H_,OK:HS,isAborted:HT,isDirty:Hw,isValid:HO,isAsync:Hk,get util(){return o},get objectUtil(){return a},ZodParsedType:Hs,getParsedType:Hc,ZodType:HR,ZodString:Hz,ZodNumber:HV,ZodBigInt:H$,ZodBoolean:Hq,ZodDate:HK,ZodSymbol:HH,ZodUndefined:HG,ZodNull:HZ,ZodAny:HJ,ZodUnknown:HY,ZodNever:HQ,ZodVoid:HX,ZodArray:H0,ZodObject:H1,ZodUnion:H2,ZodDiscriminatedUnion:H4,ZodIntersection:H5,ZodTuple:H9,ZodRecord:H6,ZodMap:H8,ZodSet:H7,ZodFunction:Ge,ZodLazy:Gt,ZodLiteral:Gn,ZodEnum:Gi,ZodNativeEnum:Go,ZodPromise:Ga,ZodEffects:Gu,ZodTransformer:Gu,ZodOptional:Gs,ZodNullable:Gc,ZodDefault:Gl,ZodCatch:Gf,ZodNaN:Gd,BRAND:Gp,ZodBranded:Gh,ZodPipeline:Gm,custom:Gg,Schema:HR,ZodSchema:HR,late:Gy,get ZodFirstPartyTypeKind(){return s},coerce:{string:t=>Hz.create({...t,coerce:!0}),number:t=>HV.create({...t,coerce:!0}),boolean:t=>Hq.create({...t,coerce:!0}),bigint:t=>H$.create({...t,coerce:!0}),date:t=>HK.create({...t,coerce:!0})},any:GC,array:Gj,bigint:GS,boolean:GT,date:Gw,discriminatedUnion:GL,effect:GG,enum:Gq,function:GB,instanceof:Gv,intersection:GF,lazy:GV,literal:G$,map:GU,nan:G_,nativeEnum:GK,never:GR,null:GI,nullable:GJ,number:Gx,object:GA,oboolean:G1,onumber:G0,optional:GZ,ostring:GX,pipeline:GQ,preprocess:GY,promise:GH,record:GW,set:Gz,strictObject:GN,string:Gb,symbol:GO,transformer:GG,tuple:GD,undefined:Gk,union:GP,unknown:GM,void:GE,NEVER:Hx,ZodIssueCode:Hl,quotelessJson:Hf,ZodError:Hd});function G3(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)?C.jsx(G5,{content:r}):C.jsx(l.SV,{ref:a,renderError:G4,onError:function(){s(!0),i(void 0)},children:C.jsx(c.Suspense,{fallback:r&&C.jsx(G5,{content:r}),children:C.jsx(G9,{url:n,selected:o,onContentChange:i})})})}function G4(){return C.jsx(l.yO,{title:"There is no embed data available."})}function G5(t){let{content:n,selected:r}=t;return C.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 G9(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)(G6,[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 C.jsx(G5,{content:o,selected:i})}function G6(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,G2.object({type:G2.string(),version:G2.string().or(G2.number()).nullish(),title:G2.string().nullish(),author_name:G2.string().nullish(),author_url:G2.string().nullish(),provider_name:G2.string().nullish(),provider_url:G2.string().nullish(),cache_age:G2.string().or(G2.number()).nullish(),thumbnail_url:G2.string().nullish(),thumbnail_width:G2.number().nullish(),thumbnail_height:G2.number().nullish(),html:G2.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 G8(t){let{id:n,readOnly:r,field:i,content:o,onContentChange:a}=t,u=(0,f.$P)({initialState:(null==o?void 0:o.embed_url)??"",startTransition:c.startTransition});function s(t){u.set(t),(0,g.j)(t)||a(void 0)}return C.jsxs(l.gN,{footer:(0,g.j)(u.value)&&C.jsx(l.mS,{children:C.jsx(G3,{debouncedUrl:u.debouncedValue,content:o,onContentChange:a})}),children:[C.jsx(l.fw,{name:"cloud"}),C.jsx(l.Qy,{htmlFor:n,children:Hr(i)}),C.jsx(l.JO,{children:C.jsx(l.oi,{id:n,readOnly:r,placeholder:Hi(i),value:u.value,onValueChange:s,variant:(0,g.j)(u.value)?"link":"normal",endAdornment:C.jsx(l.zx,{startIcon:"close",variant:"secondary",size:"small",disabled:!u,onClick:()=>s("")})})})]})}function G7(t){return!(t.lat>85||t.lat<-85||t.lng>180||t.lng<-180)}function Ze(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(G7(o))return o}function Zt(t){return t?`${t.lat}, ${t.lng}`:""}function Zn(t){let n=t.match(/\(?([\d|.|-]*)[\s+]*,[\s]*([\d|.|-]*)\)?/);if(!n)return Ze(t);let r=parseFloat(n[1]??""),i=parseFloat(n[2]??"");if(isNaN(r)||isNaN(i))return Ze(t);let o={lat:r,lng:i};return G7(o)?o:Ze(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=Zt(null==n?void 0:n.position),[o,a]=(0,c.useState)(i),u=Boolean(Zn(o));return{displayedValue:o,isValidCoordinates:u,onValueChange:a,onBlur:function(){let t=Zn(o);if(!t)return a(""),r(void 0);let{lat:n,lng:i}=t;a(Zt({lat:n,lng:i})),r({__TYPE__:"GeoPointContent",position:{lat:n,lng:i}})},clearValue:function(){a(""),r(void 0)}}}(o);return C.jsxs(l.gN,{children:[C.jsx(l.fw,{name:"place"}),C.jsx(l.Qy,{htmlFor:r,children:Hr(n)}),C.jsx(l.JO,{children:C.jsx(l.oi,{id:r,onValueChange:a,placeholder:"...",readOnly:i,value:u,onBlur:s,variant:d?"link":"normal",endAdornment:C.jsx(l.zx,{startIcon:"close",variant:"secondary",size:"small",disabled:!u,onClick:f})})})]})}let Zi="__MAIN_THUMBNAIL__";function Zo(t,n,r){let i=t.name===Zi?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 Za(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 Zu(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 Zs(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 Zc(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 Zl(t){return null!=t&&t.url?Zs(t.url):void 0}let Zf=GA({id:Gb(),kind:Gb(),extension:Gb(),filename:Gb(),width:Gx().optional(),height:Gx().optional(),last_modified:Gx(),url:Gb(),alt:Gb().optional()}),Zd=GA({total:Gx(),cursor:Gb().optional(),items:Gj(Zf)});function Zp(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:Zd})}function Zh(t){let{onFilesSelected:n}=t,[r,i]=(0,c.useTransition)(),o=(0,f.$P)({initialState:r,ms:100});return C.jsx(l.SV,{renderError:Zx,children:C.jsx(c.Suspense,{children:C.jsxs(l.Zz,{onFilesSelected:n,overlay:C.jsx(Zy,{}),children:[C.jsx(Zm,{...t,startTransition:i}),C.jsx(l.xu,{position:"relative",width:"100%",justifyContent:"center",children:C.jsx(l.FN,{anchor:C.jsx(l.xu,{position:"fixed",bottom:72}),loadingIndicator:!0,open:o.debouncedValue,title:"Loading media ...",seconds:1})})]})})})}function Zm(t){let{uploadingFiles:n,isUploading:r,onFilesSelected:i,onMediaSelected:o,startTransition:a,onRetry:u}=t,{media:s,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)(Zp,[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)(Zp,[s,l,t.env,n],{total:a.length,items:a,cursor:void 0})}}}();return(0,f.pQ)(n,()=>{if(r)return;let t=n.flatMap(t=>"success"!==t.status?[]:s.find(n=>n.id===t.id)?[]:[t.response]);t.length>0&&g(t)}),0===s.length?C.jsx(Zg,{onFilesSelected:i}):C.jsxs(Zv,{onScrollToBottom:function(){m.total===d&&a(p)},children:[C.jsx(l.Fp,{enterDuration:400,exitDuration:400,children:n.length?C.jsx(l.xu,{flexDirection:"column",gap:6,children:n.map((t,n)=>C.jsx(l.tK,{file:t.file,status:t.status,onRetry:0!==n||r?void 0:u},t.id))},n.length):null}),C.jsx(l.Rk,{items:s,getItemInfo:Zb,children:t=>C.jsx(c.Suspense,{fallback:C.jsx(l.Od,{width:"100%",height:"100%"}),children:C.jsx(l.P0,{url:Zc(t.url),onClick:()=>o({...t,width:t.width??2e3,height:t.height??2e3})})})})]})}function Zg(t){let{onFilesSelected:n}=t;return C.jsx(l.xu,{justifyContent:"center",flexDirection:"column",height:"100%",padding:24,children:C.jsx(l.xu,{justifyContent:"center",flexDirection:"column",height:"100%",backgroundColor:"grey2",borderRadius:4,padding:{inline:80},children:C.jsxs(l.R$,{children:[C.jsx(l.av,{name:"cloudUpload",lineColor:"purple10",backgroundColor:"purple12"}),C.jsx(l._T,{size:"big",children:"Drop files here or"}),C.jsx(l.nf,{children:C.jsxs(l.xv,{color:"grey11",align:"center",variant:"normal",children:["Explore our documentation to find out the"," ",C.jsx(l.hh,{underline:!0,color:"grey11",href:" https://prismic.io/docs/guides/manage-images#maximum-file-size",children:"maximum size"})," ","and"," ",C.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."]})}),C.jsx(l.Qj,{children:C.jsx(l.ZD,{title:"Upload Media",onFilesSelected:n})})]})})})}function Zy(){return C.jsx(l.xu,{justifyContent:"center",flexDirection:"column",height:"100%",children:C.jsxs(l.R$,{children:[C.jsx(l.av,{name:"cloudUpload",lineColor:"purple10",backgroundColor:"purple12"}),C.jsx(l._T,{size:"big",children:"Drop files here"}),C.jsx(l.nf,{children:"Drop your files to upload them instantly to your media library"})]})})}function Zv(t){let{children:n,onScrollToBottom:r}=t;return C.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 Zb(t){return{key:t.id,aspectRatio:(t.width??2e3)/(t.height??2e3)}}function Zx(){return C.jsx(l.xu,{height:"100%",flexDirection:"column",alignItems:"center",justifyContent:"center",children:C.jsx(l.Iq,{title:"Request failed",description:"An error occurred while searching for your image.",errorImageSrc:l.Os})})}h.Fs.registerFetcherConfig(Zp,{cacheCapacity:100,revalidationStrategy:{type:"never"}});let Z_,ZS=new Uint8Array(16);function ZT(){if(!Z_&&!(Z_="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 Z_(ZS)}let Zw=[];for(let ZO=0;ZO<256;++ZO)Zw.push((ZO+256).toString(16).slice(1));let Zk="u">typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),ZI={randomUUID:Zk},ZC=GA({id:Gb(),width:Gx(),height:Gx(),urls:GA({full:Gb(),small:Gb().transform(Zc)})}),ZM=GA({results:Gj(ZC)}).transform(t=>t.results);function ZR(t,n){let r=new URLSearchParams({page:"1",per_page:"30",query:n});return(0,p.WY)(`${t}/search/photos?${r.toString()}`,{okType:ZM})}h.Fs.registerFetcherConfig(ZR,{cacheCapacity:5,revalidationStrategy:{type:"never"}});let ZE=t=>{let{onMediaSelected:n}=t,[r,i]=(0,c.useTransition)(),o=(0,f.$P)({initialState:"",ms:200,startTransition:i});return C.jsxs(C.Fragment,{children:[C.jsx(l.xu,{padding:{inline:24,top:16},flexDirection:"column",children:C.jsx(l.Mj,{value:o.value,placeholder:"Search on Unsplash.com",onValueChange:o.set})}),C.jsx(ZA,{children:C.jsx(l.SV,{renderError:ZP,children:C.jsx(c.Suspense,{fallback:C.jsx(l.DW,{}),children:C.jsx(Zj,{term:o.debouncedValue,isUpdating:r,onMediaSelected:n})})})})]})},Zj=t=>{var n,r,i;let{term:o,isUpdating:a,onMediaSelected:u}=t,s=i7(),c=(n=s.unsplashUrl,(0,h.QT)(ZR,[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?C.jsx(l.Rk,{items:c,getItemInfo:ZN,style:f,children:t=>C.jsx(l.P0,{url:t.urls.small,onClick:()=>u({id:t.id,url:t.urls.full,width:t.width,height:t.height})})}):C.jsxs(l.R$,{style:{marginTop:"auto",marginBottom:"auto",...f},children:[C.jsx(l.u2,{children:C.jsx("img",{src:l.Os,alt:"No results"})}),C.jsx(l._T,{size:"big",children:"Oh no ..."}),C.jsx(l.nf,{children:"The search returned no result."})]})},ZA=({children:t})=>C.jsx(l.xr,{style:{height:"100%",paddingInline:l.TV.space[24],paddingTop:l.TV.space[4]},children:t});function ZN(t){return{key:t.id,aspectRatio:t.width/t.height}}function ZP(){return C.jsx(l.xu,{height:"100%",flexDirection:"column",alignItems:"center",justifyContent:"center",children:C.jsx(l.Iq,{title:"Request failed",description:"An error occurred while searching for your image.",errorImageSrc:l.Os})})}function ZL(t){let{trigger:n,onMediaSelected:r}=t,i=i7(),[o,a]=(0,c.useState)(!1),[u,s]=(0,c.useState)(i.mediaLibrary?"media":"unsplash"),{uploadingFiles:f,isUploading:d,onFilesSelected:h,onRetry:m}=function(t){let[n,r]=(0,c.useState)([]),i=n.some(t=>"idle"===t.status||"uploading"===t.status),o=i7();return(0,c.useEffect)(function(){if(!n.length||n.some(t=>"uploading"===t.status)||n.every(t=>"error"===t.status)||!o.mediaLibrary)return;let t=n.find(t=>"idle"===t.status);if(!t){setTimeout(()=>{r(t=>t.filter(t=>"error"===t.status))},1e3);return}let{assetsUrl:i,repository:a,env:u}=o;r(n=>n.map(n=>n.id===t.id?{...n,status:"uploading"}:n)),(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:Zf})})({file:t.file,url:i,repository:a,env:u}).then(n=>{r(r=>r.map(r=>r.id===t.id?{...r,status:"success",response:n}:r))}).catch(()=>{r(n=>n.map(n=>n.id===t.id?{...n,status:"error"}:n))})},[o,n]),!t&&n.length&&r([]),{uploadingFiles:n,isUploading:i,onFilesSelected:function(t){r(t.map(t=>({id:function(t,n,r){if(ZI.randomUUID&&!n&&!t)return ZI.randomUUID();t=t||{};let i=t.random||(t.rng||ZT)();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(Zw[t[n+0]]+Zw[t[n+1]]+Zw[t[n+2]]+Zw[t[n+3]]+"-"+Zw[t[n+4]]+Zw[t[n+5]]+"-"+Zw[t[n+6]]+Zw[t[n+7]]+"-"+Zw[t[n+8]]+Zw[t[n+9]]+"-"+Zw[t[n+10]]+Zw[t[n+11]]+Zw[t[n+12]]+Zw[t[n+13]]+Zw[t[n+14]]+Zw[t[n+15]]).toLowerCase()}(i)}(),file:t,status:"idle"})))},onRetry:function(){r(t=>t.map(t=>"error"===t.status?{...t,status:"idle"}:t))}}}(o),g=t=>{if("media"!==t&&"unsplash"!==t)throw Error(`Invalid option ${t}.`);s(t)};return C.jsxs(l.Vq,{trigger:n,open:o,onOpenChange:a,children:[C.jsx(l.fK,{icon:"folder",title:"Add an image"}),C.jsxs(l.Zp,{value:u,onValueChange:g,children:[i.mediaLibrary&&C.jsx(l.T9,{value:"media",title:"Media library",subtitle:"From Prismic",icon:"photo"}),C.jsx(l.T9,{value:"unsplash",title:"Unsplash",subtitle:"Source of free images",icon:"unsplash"}),i.mediaLibrary&&C.jsx(l.xu,{flexDirection:"column",justifyContent:"end",flexGrow:1,animation:{name:"fadeIn"},children:C.jsx(l.ZD,{startIcon:"cloudUpload",title:"Upload media",disabled:d,onFilesSelected:h})})]}),C.jsx(l.cZ,{children:C.jsx(ZF,{option:u,uploadingFiles:f,isUploading:d,onFilesSelected:h,onRetry:m,onMediaSelected(t){a(!1),null==r||r(t)}})})]})}function ZF(t){let{option:n,onMediaSelected:r,...i}=t,o=i7();switch(n){case"media":return o.mediaLibrary?C.jsx(Zh,{onMediaSelected:r,...i}):null;case"unsplash":return C.jsx(ZE,{onMediaSelected:r})}}function ZD(t){let{onMediaSelected:n,readOnly:r,isUpdating:i}=t;return C.jsx(l.aY,{children:C.jsx(l.Zb,{color:"grey3",variant:"outlined",children:C.jsx(l.aY,{children:C.jsx(l.xu,{padding:{block:48},flexDirection:"column",children:C.jsxs(l.R$,{children:[C.jsx(l.av,{name:"cloudUpload"}),C.jsx(l._T,{children:i?"Preparing your image...":"You haven't selected an image"}),!r&&C.jsx(l.Qj,{children:C.jsx(ZL,{trigger:C.jsx(l.zx,{disabled:i,children:"Select image"}),onMediaSelected:n})})]})})})})})}function ZW(t){let{id:n,readOnly:r,altText:i,onValueChange:o,selected:a}=t;return C.jsxs(l.gN,{labelPosition:"side",selected:a,children:[C.jsx(l.Qy,{htmlFor:n,children:"Alt text"}),C.jsx(l.JO,{children:C.jsx(l.oi,{id:n,onValueChange:o,placeholder:"Short description for the visually impaired",readOnly:r,value:i})})]})}let ZU=({contentView:t,constraints:n,croppedImage:r})=>{let[i,o]=Za(t.origin,n),a=Zu(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}}}},Zz=({field:t,content:n,thumbnail:r,croppedImage:i})=>{var o,a,u,s;if(r===Zi){let c=ZU({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=ZU({contentView:f,constraints:l,croppedImage:i});return d.url===f.url?n:{...n,thumbnails:{...n.thumbnails,[r]:d}}},ZB=({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)}},ZV=({contentView:t,constraints:n})=>{let r=ZB({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}},Z$={x:0,y:0,width:0,height:0,zoom:1},Zq=({selectedImage:{thumbnail:t,contentView:n}})=>t.width&&t.height?t.width/t.height:n?n.origin.width/n.origin.height:1,ZK=({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]??Z$;u({...a,[n]:{...r,zoom:t}})},x=t=>{if(!v)return;let n=v.thumbnail.name,r=a[n]??Z$;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)&&ZV({contentView:v.contentView,constraints:v.thumbnail})):void 0,O=s[(null==v?void 0:v.thumbnail.name)??""];return C.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:[C.jsx(l.fK,{icon:"photo",title:"Image editor"}),C.jsx(l.Zp,{value:String(g),onValueChange:t=>y(Number(t)),children:n.map((t,n)=>C.jsx(l.T9,{value:String(n),icon:"photo",title:t.labels[0]??"Main",subtitle:t.labels[1]??""},t.thumbnail.name))}),v&&C.jsx(l.cZ,{children:h&&C.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:Zq({selectedImage:v,cropper:O}),onAspectRatioChange:S,initialCroppedArea:w,onCropAreaChange:x},v.thumbnail.name)})]})};function ZH(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 C.jsxs(l.Zb,{color:o?"indigo2":"grey2",variant:o?"selected":"dashed",children:[C.jsxs(l.Ol,{children:[C.jsxs(l.wP,{children:[a,0!==s.length&&C.jsx(l.xv,{color:"grey11",component:"span",noSelect:!0,children:` • ${s.join(" • ")}`})]}),C.jsxs(l.Pf,{style:{visibility:y},children:[C.jsx(ZK,{trigger:C.jsx(l.zx,{startIcon:"crop",disabled:g,children:"Crop & Resize"}),initialImages:f,initialOption:d,onClose:p}),C.jsx(ZL,{trigger:C.jsx(l.zx,{startIcon:"imageSearch",children:"Replace"}),onMediaSelected:c}),C.jsx(l.zx,{onClick:h,startIcon:"delete",children:"Clear"})]})]}),m]})}function ZG(t,n){let{width:r,height:i,rect:o}=function(t,n){let[r,i]=Za(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:Zu(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 ZZ(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:Zi}].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])=>Zz({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,ZG(i,t)]));return{__TYPE__:"ImageContent",...ZG(i,null==(a=n.config)?void 0:a.constraint),thumbnails:d}}if(t===Zi){let p=ZG(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=ZG(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=Hr(r),_=g.map((t,r)=>{let i=null==y?void 0:y[r];return{thumbnail:t,contentView:i,labels:Zo(t,n,i)}}),S=h?Zo(h,n,v).filter(d.$):[];return C.jsx(ZH,{content:n,fieldLabel:x,imageLabel:S,initialOption:p,initialImages:_,readOnly:a,onMediaSelected:l,onCropperDialogClose:u,onClear:b,children:C.jsx(c.Suspense,{fallback:C.jsx("div",{style:{height:466}}),children:h&&n&&y?C.jsx(ZJ,{allContentViews:y,content:n,contentView:v,id:i,onContentChange:o,onPageChange:s,page:p,readOnly:a,thumbnailName:h.name,isUpdating:f}):C.jsx(ZD,{onMediaSelected:l,readOnly:a,isUpdating:f})})})}function ZJ(t){let{allContentViews:n,content:r,contentView:i,id:o,onContentChange:a,onPageChange:u,page:s,readOnly:c,thumbnailName:f,isUpdating:d}=t;return C.jsxs(l.aY,{children:[C.jsx(l.lr,{getItemSource:Zl,items:n,onPageChange:u,page:s,style:{height:400},children:t=>(null==t?void 0:t.url)&&C.jsx(l.d$,{src:Zs(t.url),alt:t.alt??void 0,isUpdating:d},`${f}_${t.url}`)}),C.jsx(ZW,{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===Zi?{...n,alt:o}:{...n,thumbnails:{...n.thumbnails,[t]:{...r,alt:o}}}}(f,r,i,t))}})]})}function ZY(t){let{content:n,field:r,id:i,onContentChange:o,readOnly:a}=t;return C.jsxs(l.gN,{children:[C.jsx(l.fw,{name:"notes"}),C.jsx(l.Qy,{htmlFor:i,children:Hr(r)}),C.jsx(l.JO,{children:C.jsx(l.Kx,{id:i,placeholder:Hi(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}))}})})]})}function ZQ(t,n,r,i){return(0,y.W7)(t,n,r,i,30)}function ZX(){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 Z0(){let t=i7();t.searchDocuments||ot("searchDocuments");let{coreApiUrl:n,env:r}=t,i=(0,h.QT)(Z3,[n,r]);return new Set(i.results.map(t=>({id:t,label:t})))}function Z1(){let t=i7();t.searchDocuments||ot("searchDocuments");let{customTypesApiUrl:n,env:r,repository:i}=t,o=(0,h.QT)(Z5,[n,r,i??""]);return new Set(o)}h.Fs.registerFetcherConfig(ZQ,{cacheCapacity:500,revalidationStrategy:{type:"never"}});let Z2=GA({results:Gj(Gb())});function Z3(t,n){return(0,p.WY)(`${t}/repository/tags`,{credentials:(0,p.xb)(n),okType:Z2})}let Z4=Gj(GA({id:Gb(),label:Gb()}));function Z5(t,n,r){return(0,p.WY)(`${t}/customtypes`,{headers:{repository:r},credentials:(0,p.xb)(n),okType:Z4})}function Z9(t){return t?(0,v.UI)(t,t=>({id:t,label:t})):new Set}function Z6(t){let{filteredLocales:n,setFilteredLocales:r,filteredTags:i,setFilteredTags:o,filteredCustomTypes:a,setFilteredCustomTypes:u,fixedTags:s,fixedCustomTypes:f}=t;return C.jsxs(C.Fragment,{children:[C.jsx(l.SV,{children:C.jsx(c.Suspense,{fallback:C.jsx(Z8,{selectedValues:n,onSelectedValuesChange:r,label:"Locale",icon:"public",fetchFilters:ZX,multiple:!1}),children:C.jsx(Je,{selectedValues:n,onSelectedValuesChange:r})})}),C.jsx(Z8,{selectedValues:i,fixedSelectedValues:Z9(s),onSelectedValuesChange:o,label:"Tags",icon:"label",fetchFilters:Z0}),C.jsx(Z8,{selectedValues:a,fixedSelectedValues:Z9(f),onSelectedValuesChange:u,label:"Type",icon:"description",fetchFilters:Z1})]})}function Z8(t){let[n,r]=(0,c.useState)(!1),i=(0,c.useContext)(h.U9);return C.jsx(l.SV,{renderError:()=>C.jsx(l.R0,{mode:"error",onErrorRetry:null==i?void 0:i.reset,open:n,setOpen:r,values:new Set,...t}),children:C.jsx(c.Suspense,{fallback:C.jsx(l.R0,{mode:"loading",open:n,setOpen:r,values:new Set,...t}),children:C.jsx(Z7,{open:n,setOpen:r,...t})})})}function Z7(t){let{open:n,setOpen:r,onSelectedValuesChange:i,fixedSelectedValues:o,selectedValues:a,label:u,icon:s,fetchFilters:c,multiple:f}=t,d=c();return C.jsx(l.R0,{open:n,setOpen:r,label:u,icon:s,selectedValues:a,values:new Set(d),fixedSelectedValues:o,onSelectedValuesChange:i,multiple:f})}function Je(t){let{selectedValues:n,onSelectedValuesChange:r}=t,[i,o]=(0,c.useState)((0,v.Ps)(n)),a=(0,v.sE)(ZX(),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),C.jsx(Z8,{selectedValues:new Set(i?[i]:[]),onSelectedValuesChange:function(t){r(t),o((0,v.Ps)(t))},label:"Locale",icon:"public",fetchFilters:ZX,multiple:!1})}function Jt(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)(""),{debouncedValue:a}=(0,f.$P)({initialState:i}),[u,s]=(0,c.useState)(new Set),[l,d]=(0,c.useState)(new Set),[p,h]=(0,c.useState)(function(){return r.searchDocuments&&r.localeId?new Set([{id:r.localeId,label:r.localeId}]):new Set}),m=(0,v.G0)(l,Z9(t)),g=(0,v.G0)(u,Z9(n));return{searchTerm:i,setSearchTerm:o,debouncedSearchTerm:a,filteredTags:u,setFilteredTags:s,filteredCustomTypes:l,setFilteredCustomTypes:d,filteredLocales:p,setFilteredLocales:h,typesFilter:m,tagsFilter:g}}(r,i),[S,T]=(0,c.useTransition)(),w=(0,f.$P)({initialState:S,ms:100});return C.jsx(l.Vq,{size:{height:727,width:656},hasClose:!1,...o,children:C.jsx(l.cZ,{children:C.jsxs(l.xu,{flexDirection:"column",height:"100%",children:[C.jsxs(l.xu,{padding:{top:16,inline:16},flexDirection:"column",gap:12,children:[C.jsx(l.yt,{value:u,onValueChange:s,placeholder:"Search a page",icon:"search"}),C.jsx(Z6,{filteredTags:p,setFilteredTags:h,filteredCustomTypes:m,setFilteredCustomTypes:g,filteredLocales:y,setFilteredLocales:b,fixedTags:i,fixedCustomTypes:r}),C.jsx(l.xv,{variant:"smallBold",color:"grey11",children:"Link to a document"})]}),a.searchDocuments?C.jsx(l.SV,{renderError:Jr,children:C.jsx(c.Suspense,{children:C.jsx(Ji,{searchTerm:d,tagsFilter:_,typesFilter:x,localesFilter:y,startTransition:T,onSelectDocument:n})})}):C.jsx(Jo,{message:"Slice Machine does not yet support mock data for linked documents in the simulator."}),C.jsx(Jn,{debouncedIsLoading:w.debouncedValue})]})})})}function Jn(t){return C.jsx(l.FN,{anchor:C.jsx(l.xu,{position:"relative",width:"100%",justifyContent:"center",bottom:72}),loadingIndicator:!0,open:t.debouncedIsLoading,title:"Loading more results ...",seconds:1})}function Jr(){return C.jsx(l.xu,{height:"100%",flexDirection:"column",alignItems:"center",justifyContent:"center",children:C.jsx(l.Iq,{title:"Request failed",description:"An error occurred while fetching documents.",errorImageSrc:l.Os})})}function Ji(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:y.Vu[d]},{name:"term",values:[i]}])).toString(),T=(0,h.QT)(ZQ,[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 C.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:C.jsxs(l.xu,{flexDirection:"column",gap:12,children:[0===s.length&&C.jsx(Jo,{}),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 C.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 Jo(t){let{message:n="There are no versions matching this request"}=t;return C.jsxs(l.xu,{justifyContent:"center",flexDirection:"column",alignItems:"center",gap:16,children:[C.jsx(l.xu,{height:56,width:56,backgroundColor:"purple12",alignItems:"center",justifyContent:"center",borderRadius:"100%",children:C.jsx(l.I5,{name:"close",size:"large",color:"purple10"})}),C.jsx(l.xu,{maxWidth:204,children:C.jsx(l.xv,{color:"grey11",align:"center",children:n})})]})}function Ja(t){let{hasLink:n,onUnlink:r,selectEnabled:i,selectedType:o,onValueChange:a,openInNewTab:u=!0,setOpenInNewTab:s}=t;return C.jsxs(C.Fragment,{children:[s&&"web"===o&&C.jsx(l.zx,{startIcon:u?"checkBox":"checkBoxOutlinedBlank",variant:"secondary",size:"small",onClick:()=>s(!u),children:"Open in new tab"}),C.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:[C.jsx(l.Ql,{value:"web",icon:"public",children:"Link to web page"}),C.jsx(l.Ql,{value:"document",icon:"description",children:"Link to Prismic page"})]}),C.jsx(l.zx,{startIcon:"close",variant:"secondary",size:"small",disabled:!n,onClick:r})]})}let Ju={DocumentLink:"document",ExternalLink:"web",FileLink:"media",ImageLink:"media"},Js={document:"DocumentLink",web:"ExternalLink",media:"FileLink"},Jc=GA({id:Gb(),title:Gb()});function Jl(t,n,r){return(0,p.WY)(`${t}/documents/${r}`,{credentials:(0,p.xb)(n),okType:Jc})}function Jf(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?Js[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?Ju[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(Js[t]),x("")},placeholder:Hi(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 C.jsx(Jh,{id:a,field:o,content:i});let k=(0,g.j)(_),I=(d||h)&&Boolean(k),M={id:a,contentType:b,onBlur:()=>p(!1),onFocus(){p(!0),"DocumentLink"===b&&v(!0)},readOnly:s||!b,textType:k?"link":"normal",value:_,...O};return C.jsxs(C.Fragment,{children:[C.jsx(l.J2,{onMouseOverChange:m,open:I,align:"start",sideOffset:-3,openDelay:100,closeDelay:200,focusOnEnter:!1,anchor:C.jsxs(l.gN,{onMouseOverChange:p,children:[C.jsx(l.fw,{name:"link"}),C.jsx(l.Qy,{htmlFor:a,children:Hr(o)}),C.jsx(l.JO,{children:"DocumentLink"===b&&""!==_?C.jsx(l.SV,{ref:S,onError:w,renderError(){var t;return t=M,C.jsx(Jd,{...t,textType:"link"})},children:C.jsx(c.Suspense,{fallback:C.jsx(Jd,{...M,value:"..."}),children:C.jsx(Jp,{...M,documentId:_,openDocumentListModal:()=>v(!0)})})}):C.jsx(Jd,{...M})})]}),children:k&&C.jsx(l.oZ,{url:k,title:(0,g.S)(k)??"",subTitle:k.toString()})}),C.jsx(Jt,{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 Jd(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 C.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:C.jsx(Ja,{hasLink:Boolean(a),onUnlink:()=>r(""),selectEnabled:d,selectedType:p,onValueChange:h,openInNewTab:m,setOpenInNewTab:g})})}function Jp(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)(Jl,[r,i,t]).title}(r);return C.jsx(l.oi,{id:n,readOnly:!0,value:c,variant:"link",onFocus:i,cursor:"pointer",endAdornment:C.jsx(Ja,{hasLink:!0,onUnlink:()=>o(""),selectEnabled:a,selectedType:u,onValueChange:s})})}function Jh({id:t,field:n,content:r}){let i=(0,f.$P)({initialState:!1}),o=(null==r?void 0:r.value.__TYPE__)==="DocumentLink"?null==r?void 0:r.value.id:null==r?void 0:r.value.url;return C.jsxs(l.gN,{onMouseOverChange:i.set,children:[C.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:i.debouncedValue,children:C.jsx(Jm,{})}),C.jsx(l.fw,{disabled:!0,name:"link"}),C.jsx(l.Qy,{htmlFor:t,children:Hr(n)}),C.jsx(l.JO,{disabled:!0,children:C.jsx(l.Kx,{id:t,onChange(){},placeholder:Hi(n),readOnly:!0,value:o})})]})}let Jm=(0,c.forwardRef)(function(t,n){return C.jsx("div",{ref:n,style:{width:50,position:"absolute",top:40,left:30}})}),Jg=({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 C.jsxs(l.gN,{children:[C.jsx(l.fw,{name:"pin"}),C.jsx(l.Qy,{htmlFor:r,children:Hr(n)}),C.jsx(l.JO,{children:C.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:Hi(n),readOnly:o,onValueChange(t){var n;return i((n=t,void 0===n?void 0:{__TYPE__:"FieldContent",type:"Number",value:String(n)}))}})})]})};function Jy(t){this.content=t}Jy.prototype={constructor:Jy,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 Jy(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 Jy(r)},addToStart:function(t,n){return new Jy([t,n].concat(this.remove(t).content))},addToEnd:function(t,n){var r=this.remove(t).content.slice();return r.push(t,n),new Jy(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 Jy(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=Jy.from(t)).size?new Jy(t.content.concat(this.subtract(t).content)):this},append:function(t){return(t=Jy.from(t)).size?new Jy(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var n=this;t=Jy.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}},Jy.from=function(t){if(t instanceof Jy)return t;var n=[];if(t)for(var r in t)n.push(r,t[r]);return new Jy(n)};class Jv{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 Jv(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 Jv(r,i)}cutByIndex(t,n){return t==n?Jv.empty:0==t&&n==this.content.length?this:new Jv(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 Jv(i,o)}addToStart(t){return new Jv([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new Jv(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 Jx(0,t);if(t==this.size)return Jx(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?Jx(r+1,o):Jx(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 Jv.empty;if(!Array.isArray(n))throw RangeError("Invalid input for Fragment.fromJSON");return new Jv(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return Jv.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 Jv(n||t,r)}static from(t){if(!t)return Jv.empty;if(t instanceof Jv)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new Jv([t],t.nodeSize);throw RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Jv.empty=new Jv([],0);let Jb={index:0,offset:0};function Jx(t,n){return Jb.index=t,Jb.offset=n,Jb}function J_(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(!J_(t[i],n[i]))return!1}else{for(let o in t)if(!(o in n)||!J_(t[o],n[o]))return!1;for(let a in n)if(!(a in t))return!1}return!0}let JS=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&&J_(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}};JS.none=[];class JT extends Error{}class Jw{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 Jw(r,this.openStart,this.openEnd)}removeBetween(t,n){return new Jw(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 Jw.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 Jw(Jv.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 Jw(t,r,i)}}function JO(t,n){if(!n.type.compatibleContent(t.type))throw new JT("Cannot join "+n.type.name+" onto "+t.type.name)}function Jk(t,n,r){let i=t.node(r);return JO(i,n.node(r)),i}function JI(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 JC(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&&(JI(t.nodeAfter,i),a++));for(let s=a;s<u;s++)JI(o.child(s),i);n&&n.depth==r&&n.textOffset&&JI(n.nodeBefore,i)}function JM(t,n){return t.type.checkContent(n),t.copy(n)}function JR(t,n,r){let i=[];return JC(null,t,r,i),t.depth>r&&JI(JM(Jk(t,n,r+1),JR(t,n,r+1)),i),JC(n,null,r,i),new Jv(i)}Jw.empty=new Jw(Jv.empty,0,0);class JE{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 JS.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 JP(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 JE(n,r,o)}static resolveCached(t,n){for(let r=0;r<Jj.length;r++){let i=Jj[r];if(i.pos==n&&i.doc==t)return i}let o=Jj[JA]=JE.resolve(t,n);return JA=(JA+1)%JN,o}}let Jj=[],JA=0,JN=12;class JP{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 JL=Object.create(null),JF=class t{constructor(t,n,r,i=JS.none){this.type=t,this.attrs=n,this.marks=i,this.content=r||Jv.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&&J_(this.attrs,n||t.defaultAttrs||JL)&&JS.sameSet(this.marks,r||JS.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 Jw.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 Jw(s,i.depth-a,o.depth-a)}replace(t,n,r){return function(t,n,r){if(r.openStart>t.depth)throw new JT("Inserted content deeper than insertion position");if(t.depth-r.openStart!=n.depth-r.openEnd)throw new JT("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 JM(u,JR(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(Jv.from(i));return{start:i.resolveNoCache(t.openStart+r),end:i.resolveNoCache(i.content.size-t.openEnd-r)}}(i,n);return JM(u,function t(n,r,i,o,a){let u=n.depth>a&&Jk(n,r,a+1),s=o.depth>a&&Jk(i,o,a+1),c=[];return JC(null,n,a,c),u&&s&&r.index(a)==i.index(a)?(JO(u,s),JI(JM(u,t(n,r,i,o,a+1)),c)):(u&&JI(JM(u,JR(n,r,a+1)),c),JC(r,i,a,c),s&&JI(JM(s,JR(i,o,a+1)),c)),JC(o,null,a,c),new Jv(c)}(n,c,l,r,o))}{let f=n.parent,d=f.content;return JM(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 JE.resolveCached(this,t)}resolveNoCache(t){return JE.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()+")"),JW(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=Jv.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=JS.none;for(let n=0;n<this.marks.length;n++)t=this.marks[n].addToSet(t);if(!JS.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=Jv.fromJSON(t,n.content);return t.nodeType(n.type).create(n.attrs,i,r)}};JF.prototype.text=void 0;class JD extends JF{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):JW(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 JD(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new JD(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 JW(t,n){for(let r=t.length-1;r>=0;r--)n=t[r].type.name+"("+n+")";return n}class JU{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){var r;let i=new Jz(t,n);if(null==i.next)return JU.empty;let o=JB(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]);JZ(r,n).forEach(n=>{o||i.push([t,o=[]]),-1==o.indexOf(n)&&o.push(n)})})});let o=a[n.join(",")]=new JU(n.indexOf(r.length-1)>-1);for(let u=0;u<i.length;u++){let s=i[u][1].sort(JG);o.next.push({type:i[u][0],next:a[s.join(",")]||t(s)})}return o}(JZ(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 Jv.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(`
|
|
6
|
-
`)}}JU.empty=new JU(!0);class Jz{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 JB(t){let n=[];do n.push(JV(t));while(t.eat("|"));return 1==n.length?n[0]:{type:"choice",exprs:n}}function JV(t){let n=[];do n.push(J$(t));while(t.next&&")"!=t.next&&"|"!=t.next);return 1==n.length?n[0]:{type:"seq",exprs:n}}function J$(t){let n=JH(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=JK(t,n);else break;return n}function Jq(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let n=Number(t.next);return t.pos++,n}function JK(t,n){let r=Jq(t),i=r;return t.eat(",")&&(i="}"!=t.next?Jq(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:r,max:i,expr:n}}function JH(t){if(t.eat("(")){let n=JB(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 JG(t,n){return n-t}function JZ(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(JG)}function JJ(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 JY(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 JQ(t){let n=Object.create(null);if(t)for(let r in t)n[r]=new J0(t[r]);return n}let JX=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=JQ(r.attrs),this.defaultAttrs=JJ(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==JU.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:JY(this.attrs,t)}create(t=null,n,r){if(this.isText)throw Error("NodeType.create can't construct text nodes");return new JF(this,this.computeAttrs(t),Jv.from(n),JS.setFrom(r))}createChecked(t=null,n,r){return n=Jv.from(n),this.checkContent(n),new JF(this,this.computeAttrs(t),n,JS.setFrom(r))}createAndFill(t=null,n,r){if(t=this.computeAttrs(t),(n=Jv.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(Jv.empty,!0);return a?new JF(this,t,n.append(a),JS.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:JS.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 J0{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class J1{constructor(t,n,r,i){this.name=t,this.rank=n,this.schema=r,this.spec=i,this.attrs=JQ(i.attrs),this.excluded=null;let o=JJ(this.attrs);this.instance=o?new JS(this,o):null}create(t=null){return!t&&this.instance?this.instance:new JS(this,JY(this.attrs,t))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,o)=>r[t]=new J1(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 J2{constructor(t){this.cached=Object.create(null);let n=this.spec={};for(let r in t)n[r]=t[r];n.nodes=Jy.from(t.nodes),n.marks=Jy.from(t.marks||{}),this.nodes=JX.compile(this.spec.nodes,this),this.marks=J1.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]=JU.parse(u,this.nodes)),a.inlineContent=a.contentMatch.inlineContent,a.markSet="_"==s?null:s?J3(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?[]:J3(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 JX){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 JD(r,r.defaultAttrs,t,JS.setFrom(n))}mark(t,n){return"string"==typeof t&&(t=this.marks[t]),t.create(n)}nodeFromJSON(t){return JF.fromJSON(this,t)}markFromJSON(t){return JS.fromJSON(this,t)}nodeType(t){let n=this.nodes[t];if(!n)throw RangeError("Unknown node type: "+t);return n}}function J3(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 J4{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 Ye(this,n,!1);return r.addAll(t,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new Ye(this,n,!0);return r.addAll(t,n.from,n.to),Jw.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(Yt(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=Yn(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=Yn(t)),t.node||t.ignore||t.mark||(t.node=a)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new J4(t,J4.schemaRules(t)))}}let J5={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},J9={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},J6={ol:!0,ul:!0};function J8(t,n,r){return null!=n?(n?1:0)|("full"===n?2:0):t&&"pre"==t.whitespace?3:-5&r}class J7{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=JS.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(Jv.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=Jv.from(this.content);return!t&&this.match&&(i=i.append(this.match.fillBefore(Jv.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):Yr(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&&!J5.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class Ye{constructor(t,n,r){this.parser=t,this.options=n,this.isOpen=r,this.open=0;let i=n.topNode,o,a=J8(null,n.preserveWhitespace,0)|(r?4:0);o=i?new J7(i.type,i.attrs,JS.none,JS.none,!0,n.topMatch||i.type.contentMatch,a):r?new J7(null,null,JS.none,JS.none,!0,null,a):new J7(t.schema.topNodeType,null,JS.none,JS.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,`
|
|
7
|
-
`):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;J6.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&&J6.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:J9.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(J5.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(`
|
|
8
|
-
`))}ignoreFallback(t){"BR"!=t.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))}readStyles(t){let n=JS.none,r=JS.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=J8(t,i,o.options);4&o.options&&0==o.content.length&&(a|=4),this.nodes.push(new J7(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 Yt(t,n){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,n)}function Yn(t){let n={};for(let r in t)n[r]=t[r];return n}function Yr(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 Yi{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},r){r||(r=Ya(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}=Yi.renderSpec(Ya(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&&Yi.renderSpec(Ya(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}=Yi.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 Yi(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=Yo(t.nodes);return n.text||(n.text=t=>t.text),n}static marksFromSchema(t){return Yo(t.marks)}}function Yo(t){let n={};for(let r in t){let i=t[r].spec.toDOM;i&&(n[r]=i)}return n}function Ya(t){return t.document||window.document}function Yu(t,n){return t+65536*n}function Ys(t){return 65535&t}class Yc{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 Yl{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&Yl.empty)return Yl.empty}recover(t){var n;let r=0,i=Ys(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:Yu(u/3,t-s),m=t==s?2:t==f?1:4;return(n<0?t!=s:t!=f)&&(m|=8),new Yc(p,m,h)}i+=l-c}return r?t+i:new Yc(t+i,0,null)}touches(t,n){let r=0,i=Ys(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 Yl(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return 0==t?Yl.empty:new Yl(t<0?[0,-t,0]:[0,0,t])}}Yl.empty=new Yl([]);class Yf{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 Yf(this.maps,this.mirror,t,n)}copy(){return new Yf(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 Yf;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 Yc(t,i,null)}}let Yd=Object.create(null);class Yp{getMap(){return Yl.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw RangeError("Invalid input for Step.fromJSON");let r=Yd[n.stepType];if(!r)throw RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in Yd)throw RangeError("Duplicate use of step JSON ID "+t);return Yd[t]=n,n.prototype.jsonID=t,n}}class Yh{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new Yh(t,null)}static fail(t){return new Yh(null,t)}static fromReplace(t,n,r,i){try{return Yh.ok(t.replace(n,r,i))}catch(o){if(o instanceof JT)return Yh.fail(o.message);throw o}}}function Ym(t,n,r){let i=[];for(let o=0;o<t.childCount;o++){let a=t.child(o);a.content.size&&(a=a.copy(Ym(a.content,n,a))),a.isInline&&(a=n(a,r,o)),i.push(a)}return Jv.fromArray(i)}class Yg extends Yp{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 Jw(Ym(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 Yh.fromReplace(t,this.from,this.to,o)}invert(){return new Yy(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 Yg(n.pos,r.pos,this.mark)}merge(t){return t instanceof Yg&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Yg(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 Yg(n.from,n.to,t.markFromJSON(n.mark))}}Yp.jsonID("addMark",Yg);class Yy extends Yp{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 Jw(Ym(n.content,t=>t.mark(this.mark.removeFromSet(t.marks)),t),n.openStart,n.openEnd);return Yh.fromReplace(t,this.from,this.to,r)}invert(){return new Yg(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 Yy(n.pos,r.pos,this.mark)}merge(t){return t instanceof Yy&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Yy(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 Yy(n.from,n.to,t.markFromJSON(n.mark))}}Yp.jsonID("removeMark",Yy);class Yv extends Yp{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Yh.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Yh.fromReplace(t,this.pos,this.pos+1,new Jw(Jv.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 Yv(this.pos,n.marks[i]);return new Yv(this.pos,this.mark)}}return new Yb(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Yv(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 Yv(n.pos,t.markFromJSON(n.mark))}}Yp.jsonID("addNodeMark",Yv);class Yb extends Yp{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Yh.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Yh.fromReplace(t,this.pos,this.pos+1,new Jw(Jv.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return n&&this.mark.isInSet(n.marks)?new Yv(this.pos,this.mark):this}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Yb(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 Yb(n.pos,t.markFromJSON(n.mark))}}Yp.jsonID("removeNodeMark",Yb);class Yx extends Yp{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&YS(t,this.from,this.to)?Yh.fail("Structure replace would overwrite content"):Yh.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new Yl([this.from,this.to-this.from,this.slice.size])}invert(t){return new Yx(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 Yx(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof Yx)||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?Jw.empty:new Jw(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new Yx(t.from,this.to,n,this.structure)}}{let r=this.slice.size+t.slice.size==0?Jw.empty:new Jw(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new Yx(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 Yx(n.from,n.to,Jw.fromJSON(t,n.slice),!!n.structure)}}Yp.jsonID("replace",Yx);class Y_ extends Yp{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&&(YS(t,this.from,this.gapFrom)||YS(t,this.gapTo,this.to)))return Yh.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Yh.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Yh.fromReplace(t,this.from,this.to,r):Yh.fail("Content does not fit in gap")}getMap(){return new Yl([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 Y_(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 Y_(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 Y_(n.from,n.to,n.gapFrom,n.gapTo,Jw.fromJSON(t,n.slice),n.insert,!!n.structure)}}function YS(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 YT(t,n,r){return(0==n||t.canReplace(n,t.childCount))&&(r==t.childCount||t.canReplace(0,r))}function Yw(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||!YT(i,o,a))break}return null}function YO(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(Yk).concat({type:n,attrs:r}).concat(a.map(Yk)):null}function Yk(t){return{type:t,attrs:null}}function YI(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 YC(t,n){let r=t.resolve(n),i=r.index();return YM(r.nodeBefore,r.nodeAfter)&&r.parent.canReplace(i,i+1)}function YM(t,n){return!!(t&&n&&!t.isLeaf&&t.canAppend(n))}function YR(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&&YM(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 YE(t,n,r=n,i=Jw.empty){if(n==r&&!i.size)return null;let o=t.resolve(n),a=t.resolve(r);return Yj(o,a,i)?new Yx(n,r,i):new YA(o,a,i).fit()}function Yj(t,n,r){return!r.openStart&&!r.openEnd&&t.start()==n.start()&&t.parent.canReplace(t.index(),n.index(),r.content)}Yp.jsonID("replaceAround",Y_);class YA{constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=Jv.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=Jv.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 Jw(a,u,s);return n>-1?new Y_(i.pos,n,this.$to.pos,this.$to.end(),c,r):c.size||i.pos!=this.$to.pos?new Yx(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=YL(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(Jv.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=YL(t,n);return!!i.childCount&&!i.firstChild.isLeaf&&(this.unplaced=new Jw(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=YL(t,n);if(i.childCount<=1&&n>0){let o=t.size-n<=n+i.size;this.unplaced=new Jw(YN(t,n-1,1),n-1,o?n-1:r)}else this.unplaced=new Jw(YN(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(YF(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=YP(this.placed,n,Jv.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?Jw.empty:new Jw(YN(u.content,t-1,1),t-1,m<0?u.openEnd:t-1):new Jw(YN(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||!YD(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=YD(t,n,i,r,o);if(a){for(let u=n-1;u>=0;u--){let{match:s,type:c}=this.frontier[u],l=YD(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=YP(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=YP(this.placed,this.depth,Jv.from(t.create(n,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(Jv.empty,!0);t.childCount&&(this.placed=YP(this.placed,this.frontier.length,t))}}function YN(t,n,r){return 0==n?t.cutByIndex(r,t.childCount):t.replaceChild(0,t.firstChild.copy(YN(t.firstChild.content,n-1,r)))}function YP(t,n,r){return 0==n?t.append(r):t.replaceChild(t.childCount-1,t.lastChild.copy(YP(t.lastChild.content,n-1,r)))}function YL(t,n){for(let r=0;r<n;r++)t=t.firstChild.content;return t}function YF(t,n,r){if(n<=0)return t;let i=t.content;return n>1&&(i=i.replaceChild(0,YF(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(Jv.empty,!0)))),t.copy(i)}function YD(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 YW(t){return t.spec.defining||t.spec.definingForContent}function YU(t,n,r,i,o){if(n<r){let a=t.firstChild;t=t.replaceChild(0,a.copy(YU(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(Jv.empty,!0))}return t}function Yz(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 YB extends Yp{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 Yh.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 Yh.fromReplace(t,this.pos,this.pos+1,new Jw(Jv.from(o),0,n.isLeaf?0:1))}getMap(){return Yl.empty}invert(t){return new YB(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 YB(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 YB(n.pos,n.attr,n.value)}}Yp.jsonID("attr",YB);let YV=class extends Error{};(YV=function t(n){let r=Error.call(this,n);return r.__proto__=t.prototype,r}).prototype=Object.create(Error.prototype),YV.prototype.constructor=YV,YV.prototype.name="TransformError";class Y${constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new Yf}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new YV(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=Jw.empty){let i=YE(this.doc,t,n,r);return i&&this.step(i),this}replaceWith(t,n,r){return this.replace(t,n,new Jw(Jv.from(r),0,0))}delete(t,n){return this.replace(t,n,Jw.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(Yj(o,a,i))return t.step(new Yx(n,r,i));let u=Yz(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=YW(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),C=o.index(O-1);if(I.canReplaceWith(C,C,T.type,T.marks))return t.replace(o.before(O),k?a.after(O):r,new Jw(YU(i.content,0,i.openStart,S),S,i.openEnd))}}let M=t.steps.length;for(let R=u.length-1;R>=0&&(t.replace(n,r,i),!(t.steps.length>M));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 Jw(Jv.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=Yz(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=Jv.empty,d=0;for(let p=a,h=!1;p>r;p--)h||i.index(p)>0?(h=!0,f=Jv.from(i.node(p).copy(f)),d++):c--;let m=Jv.empty,g=0;for(let y=a,v=!1;y>r;y--)v||o.after(y+1)<o.end(y)?(v=!0,m=Jv.from(o.node(y).copy(m)),g++):l++;t.step(new Y_(c,l,u,s,new Jw(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 Yx(n-r,n+r,Jw.empty,!0);t.step(i)}(this,t,n),this}wrap(t,n){return function(t,n,r){let i=Jv.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=Jv.from(r[o].type.create(r[o].attrs,i))}let u=n.start,s=n.end;t.step(new Y_(u,s,u,s,new Jw(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 Y_(p,h,p+1,h-1,new Jw(Jv.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 Y_(n,n+a.nodeSize,n+1,n+a.nodeSize-1,new Jw(Jv.from(u),0,0),1,!0))}(this,t,n,r,i),this}setNodeAttribute(t,n,r){return this.step(new YB(t,n,r)),this}addNodeMark(t,n){return this.step(new Yv(t,n)),this}removeNodeMark(t,n){if(!(n instanceof JS)){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 Yb(t,n)),this}split(t,n=1,r){return function(t,n,r=1,i){let o=t.doc.resolve(n),a=Jv.empty,u=Jv.empty;for(let s=o.depth,c=o.depth-r,l=r-1;s>c;s--,l--){a=Jv.from(o.node(s).copy(a));let f=i&&i[l];u=Jv.from(f?f.type.create(f.attrs,u):o.node(s).copy(u))}t.step(new Yx(n,n,new Jw(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 Yy(d,p,u[m])));f&&f.to==d?f.to=p:c.push(f=new Yg(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 J1){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 Yy(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 Yy(u,l,c.marks[d]))}else a.push(new Yx(u,l,Jw.empty));u=l}if(!i.validEnd){let p=i.fillBefore(Jv.empty,!0);t.replace(u,u,new Jw(p,0,0))}for(let h=a.length-1;h>=0;h--)t.step(a[h])}(this,t,n,r),this}}let Yq=Object.create(null);class YK{constructor(t,n,r){this.$anchor=t,this.$head=n,this.ranges=r||[new YH(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=Jw.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?Jw.empty:n),0==s&&Y3(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),Y3(t,r,n.isInline?-1:1))}}static findFrom(t,n,r=!1){let i=t.parent.inlineContent?new YJ(t):Y2(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?Y2(t.node(0),t.node(o),t.before(o+1),t.index(o),n,r):Y2(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 Y0(t.node(0))}static atStart(t){return Y2(t,t,0,0,1)||new Y0(t)}static atEnd(t){return Y2(t,t,t.content.size,t.childCount,-1)||new Y0(t)}static fromJSON(t,n){if(!n||!n.type)throw RangeError("Invalid input for Selection.fromJSON");let r=Yq[n.type];if(!r)throw RangeError(`No selection type ${n.type} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in Yq)throw RangeError("Duplicate use of selection JSON ID "+t);return Yq[t]=n,n.prototype.jsonID=t,n}getBookmark(){return YJ.between(this.$anchor,this.$head).getBookmark()}}YK.prototype.visible=!0;class YH{constructor(t,n){this.$from=t,this.$to=n}}let YG=!1;function YZ(t){YG||t.parent.inlineContent||(YG=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class YJ extends YK{constructor(t,n=t){YZ(t),YZ(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 YK.near(r);let i=t.resolve(n.map(this.anchor));return new YJ(i.parent.inlineContent?i:r,r)}replace(t,n=Jw.empty){if(super.replace(t,n),n==Jw.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof YJ&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new YY(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 YJ(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=YK.findFrom(n,r,!0)||YK.findFrom(n,-r,!0);if(!o)return YK.near(n,r);n=o.$head}return t.parent.inlineContent||(0==i?t=n:(t=(YK.findFrom(t,-r,!0)||YK.findFrom(t,r,!0)).$anchor).pos<n.pos!=i<0&&(t=n)),new YJ(t,n)}}YK.jsonID("text",YJ);class YY{constructor(t,n){this.anchor=t,this.head=n}map(t){return new YY(t.map(this.anchor),t.map(this.head))}resolve(t){return YJ.between(t.resolve(this.anchor),t.resolve(this.head))}}class YQ extends YK{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?YK.near(o):new YQ(o)}content(){return new Jw(Jv.from(this.node),0,0)}eq(t){return t instanceof YQ&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new YX(this.anchor)}static fromJSON(t,n){if("number"!=typeof n.anchor)throw RangeError("Invalid input for NodeSelection.fromJSON");return new YQ(t.resolve(n.anchor))}static create(t,n){return new YQ(t.resolve(n))}static isSelectable(t){return!t.isText&&!1!==t.type.spec.selectable}}YQ.prototype.visible=!1,YK.jsonID("node",YQ);class YX{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new YY(r,r):new YX(r)}resolve(t){let n=t.resolve(this.anchor),r=n.nodeAfter;return r&&YQ.isSelectable(r)?new YQ(n):YK.near(n)}}class Y0 extends YK{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,n=Jw.empty){if(n==Jw.empty){t.delete(0,t.doc.content.size);let r=YK.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(t){return new Y0(t)}map(t){return new Y0(t)}eq(t){return t instanceof Y0}getBookmark(){return Y1}}YK.jsonID("all",Y0);let Y1={map(){return this},resolve:t=>new Y0(t)};function Y2(t,n,r,i,o,a=!1){if(n.inlineContent)return YJ.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&&YQ.isSelectable(s))return YQ.create(t,r-(o<0?s.nodeSize:0))}else{let c=Y2(t,s,r+o,o<0?s.childCount:0,o,a);if(c)return c}r+=s.nodeSize*o}return null}function Y3(t,n,r){let i=t.steps.length-1;if(i<n)return;let o=t.steps[i];if(!(o instanceof Yx||o instanceof Y_))return;let a;t.mapping.maps[i].forEach((t,n,r,i)=>{null==a&&(a=i)}),t.setSelection(YK.near(t.doc.resolve(a),r))}class Y4 extends Y${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 JS.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)||JS.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(YK.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 Y5(t,n){return n&&t?t.bind(n):t}class Y9{constructor(t,n,r){this.name=t,this.init=Y5(n.init,r),this.apply=Y5(n.apply,r)}}let Y6=[new Y9("doc",{init:t=>t.doc||t.schema.topNodeType.createAndFill(),apply:t=>t.doc}),new Y9("selection",{init:(t,n)=>t.selection||YK.atStart(n.doc),apply:t=>t.selection}),new Y9("storedMarks",{init:t=>t.storedMarks||null,apply:(t,n,r,i)=>i.selection.$cursor?t.storedMarks:null}),new Y9("scrollToSelection",{init:()=>0,apply:(t,n)=>t.scrolledIntoView?n+1:n})];class Y8{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Y6.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 Y9(t.key,t.spec.state,t))})}}class Y7{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 Y7(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 Y4(this)}static create(t){let n=new Y8(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new Y7(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 Y8(this.schema,t.plugins),r=n.fields,i=new Y7(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 Y8(t.schema,t.plugins),o=new Y7(i);return i.fields.forEach(i=>{if("doc"==i.name)o.doc=JF.fromJSON(t.schema,n.doc);else if("selection"==i.name)o.selection=YK.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 Qe{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:Qn("plugin")}getState(t){return t[this.key]}}let Qt=Object.create(null);function Qn(t){return t in Qt?t+"$"+ ++Qt[t]:(Qt[t]=0,t+"$")}class Qr{constructor(t="key"){this.key=Qn(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}let Qi=function(t){for(var n=0;;n++)if(!(t=t.previousSibling))return n},Qo=function(t){let n=t.assignedSlot||t.parentNode;return n&&11==n.nodeType?n.host:n},Qa=null,Qu=function(t,n,r){let i=Qa||(Qa=document.createRange());return i.setEnd(t,r??t.nodeValue.length),i.setStart(t,n||0),i},Qs=function(t,n,r,i){return r&&(Ql(t,n,r,i,-1)||Ql(t,n,r,i,1))},Qc=/^(img|br|input|textarea|hr)$/i;function Ql(t,n,r,i,o){for(;;){if(t==r&&n==i)return!0;if(n==(o<0?0:Qf(t))){let a=t.parentNode;if(!a||1!=a.nodeType||Qd(t)||Qc.test(t.nodeName)||"false"==t.contentEditable)return!1;n=Qi(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?Qf(t):0}}}function Qf(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Qd(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 Qp=function(t){return t.focusNode&&Qs(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Qh(t,n){let r=document.createEvent("Event");return r.initEvent("keydown",!0,!0),r.keyCode=t,r.key=r.code=n,r}function Qm(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 Qg="u">typeof navigator?navigator:null,Qy="u">typeof document?document:null,Qv=Qg&&Qg.userAgent||"",Qb=/Edge\/(\d+)/.exec(Qv),Qx=/MSIE \d/.exec(Qv),Q_=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Qv),QS=!!(Qx||Q_||Qb),QT=Qx?document.documentMode:Q_?+Q_[1]:Qb?+Qb[1]:0,Qw=!QS&&/gecko\/(\d+)/i.test(Qv);Qw&&(/Firefox\/(\d+)/.exec(Qv)||[0,0])[1];let QO=!QS&&/Chrome\/(\d+)/.exec(Qv),Qk=!!QO,QI=QO?+QO[1]:0,QC=!QS&&!!Qg&&/Apple Computer/.test(Qg.vendor),QM=QC&&(/Mobile\/\w+/.test(Qv)||!!Qg&&Qg.maxTouchPoints>2),QR=QM||!!Qg&&/Mac/.test(Qg.platform),QE=!!Qg&&/Win/.test(Qg.platform),Qj=/Android \d/.test(Qv),QA=!!Qy&&"webkitFontSmoothing"in Qy.documentElement.style,QN=QA?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function QP(t){return{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function QL(t,n){return"number"==typeof t?t:t[n]}function QF(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 QD(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=Qo(u)){if(1!=u.nodeType)continue;let s=u,c=s==a.body,l=c?QP(a):QF(s),f=0,d=0;if(n.top<l.top+QL(i,"top")?d=-(l.top-n.top+QL(o,"top")):n.bottom>l.bottom-QL(i,"bottom")&&(d=n.bottom-l.bottom+QL(o,"bottom")),n.left<l.left+QL(i,"left")?f=-(l.left-n.left+QL(o,"left")):n.right>l.right-QL(i,"right")&&(f=n.right-l.right+QL(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 QW(t){let n=[],r=t.ownerDocument;for(let i=t;i&&(n.push({dom:i,top:i.scrollTop,left:i.scrollLeft}),t!=r);i=Qo(i));return n}function QU(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 Qz=null;function QB(t,n){return t.left>=n.left-1&&t.left<=n.right+1&&t.top>=n.top-1&&t.top<=n.bottom+1}function QV(t){return t.top<t.bottom||t.left<t.right}function Q$(t,n){let r=t.getClientRects();if(r.length){let i=r[n<0?0:r.length-1];if(QV(i))return i}return Array.prototype.find.call(r,QV)||t.getBoundingClientRect()}let Qq=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function QK(t,n,r){let{node:i,offset:o,atom:a}=t.docView.domFromPos(n,r<0?-1:1),u=QA||Qw;if(3==i.nodeType){if(u&&(Qq.test(i.nodeValue)||(r<0?!o:o==i.nodeValue.length))){let s=Q$(Qu(i,o,o),r);if(Qw&&o&&/\s/.test(i.nodeValue[o-1])&&o<i.nodeValue.length){let c=Q$(Qu(i,o-1,o-1),-1);if(c.top==s.top){let l=Q$(Qu(i,o,o+1),-1);if(l.top!=s.top)return QH(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++,QH(Q$(Qu(i,f,d),p),p<0)}}if(!t.state.doc.resolve(n-(a||0)).parent.inlineContent){if(null==a&&o&&(r<0||o==Qf(i))){let h=i.childNodes[o-1];if(1==h.nodeType)return QG(h.getBoundingClientRect(),!1)}if(null==a&&o<Qf(i)){let m=i.childNodes[o];if(1==m.nodeType)return QG(m.getBoundingClientRect(),!0)}return QG(i.getBoundingClientRect(),r>=0)}if(null==a&&o&&(r<0||o==Qf(i))){let g=i.childNodes[o-1],y=3==g.nodeType?Qu(g,Qf(g)-(u?0:1)):1!=g.nodeType||"BR"==g.nodeName&&g.nextSibling?null:g;if(y)return QH(Q$(y,1),!1)}if(null==a&&o<Qf(i)){let v=i.childNodes[o];for(;v.pmViewDesc&&v.pmViewDesc.ignoreForCoords;)v=v.nextSibling;let b=v?3==v.nodeType?Qu(v,0,u?0:1):1==v.nodeType?v:null:null;if(b)return QH(Q$(b,-1),!0)}return QH(Q$(3==i.nodeType?Qu(i):i,-r),r>=0)}function QH(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 QG(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 QZ(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 QJ=/[\u0590-\u08ac]/,QY=null,QQ=null,QX=!1;class Q0{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>Qi(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 Q6){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 Q1&&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?Qi(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?Qi(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=Qi(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=Qi(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((Qw||QC)&&t==n){let{node:m,offset:g}=f;if(3==m.nodeType){if((h=!!(g&&m.nodeValue[g-1]==`
|
|
9
|
-
`))&&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:Qi(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(Qw&&p.focusNode&&p.focusNode!=d.node&&1==p.focusNode.nodeType){let _=p.focusNode.childNodes[p.focusOffset];_&&"false"==_.contentEditable&&(i=!0)}if(!(i||h&&QC)&&Qs(f.node,f.offset,p.anchorNode,p.anchorOffset)&&Qs(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 Q1 extends Q0{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 Q2 extends Q0{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 Q3 extends Q0{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=Yi.renderSpec(document,n.type.spec.toDOM(n,r))),new Q3(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=Q3.create(this.parent,this.mark,!0,r),o=this.children,a=this.size;n<a&&(o=Xc(o,n,a,r)),t>0&&(o=Xc(o,0,t,r));for(let u=0;u<o.length;u++)o[u].parent=i;return i.children=o,i}}class Q4 extends Q0{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}=Yi.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=Xi(l,r,n),c?s=new Q8(t,n,r,i,l,f||null,d,c,o,a+1):n.isText?new Q9(t,n,r,i,l,d,o):new Q4(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=()=>Jv.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)&&Xo(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 Xu(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(Xs);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?JS.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=Xa(o),a=!0;o=o.nextSibling}else a=!0,n.insertBefore(c,o);if(s instanceof Q3){let l=o?o.previousSibling:n.lastChild;t(s.contentDOM,s.children,i),o=l?l.nextSibling:n.firstChild}}for(;o;)o=Xa(o),a=!0;a&&i.trackWrites==n&&(i.trackWrites=null)}(this.contentDOM,this.children,t),QM&&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 YJ)||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=Qf(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 Q2(this,o,n,i);t.input.compositionNodes.push(a),this.children=Xc(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(Xo(t,this.outerDeco))return;let n=1!=this.nodeDOM.nodeType,r=this.dom;this.dom=Xn(this.dom,this.nodeDOM,Xt(this.outerDeco,this.node,n),Xt(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 Q5(t,n,r,i,o){Xi(i,n,t);let a=new Q4(void 0,t,n,r,i,i,i,o,0);return a.contentDOM&&a.updateChildren(o,0),a}class Q9 extends Q4{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 Q9(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 Q6 extends Q0{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 Q8 extends Q4{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 Q7=function(t){t&&(this.nodeName=t)};Q7.prototype=Object.create(null);let Xe=[new Q7];function Xt(t,n,r){if(0==t.length)return Xe;let i=r?Xe[0]:new Q7,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 Q7(u.nodeName)),u){let c=u[s];null!=c&&(r&&1==o.length&&o.push(i=new Q7(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 Xn(t,n,r,i){if(r==Xe&&i==Xe)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=Xe[0]),o=c}Xr(o,s||Xe[0],u)}return o}function Xr(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 Xi(t,n,r){return Xn(t,t,Xe,Xt(n,r,1!=t.nodeType))}function Xo(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 Xa(t){let n=t.nextSibling;return t.parentNode.removeChild(t),n}class Xu{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 Q3)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=Q3.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 Q4){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&&Xo(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=Q4.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=Q4.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 Q1(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 Q3;)t=(n=t).children[n.children.length-1];(!t||!(t instanceof Q9)||/\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(t.node.text))&&((QC||Qk)&&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 Q6(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 Xs(t,n){return t.type.side-n.type.side}function Xc(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 Xl(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(Qp(r)){for(c=s;o&&!o.node;)o=o.parent;let f=o.node;if(o&&f.isAtom&&YQ.isSelectable(f)&&o.parent&&!(f.isInline&&function(t,n,r){for(let i=0==n,o=n==Qf(t);i||o;){if(t==r)return!0;let a=Qi(t);if(!(t=t.parentNode))return!1;i=i&&0==a,o=o&&a==Qf(t)}}(r.focusNode,r.focusOffset,o.dom))){let d=o.posBefore;l=new YQ(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=Xb(t,c,s,h)}return l}function Xf(t){return t.editable?t.hasFocus():X_(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Xd(t,n=!1){let r=t.state.selection;if(Xy(t,r),Xf(t)){var i,o;if(!n&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&Qk){let a=t.domSelectionRange(),u=t.domObserver.currentSelection;if(a.anchorNode&&u.anchorNode&&Qs(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,Qi(l)+1):c.setEnd(l,0),c.collapse(!1),s.removeAllRanges(),s.addRange(c),!f&&!i.state.selection.visible&&QS&&QT<=11&&(l.disabled=!0,l.disabled=!1)}else{let{anchor:d,head:p}=r,h,m,g,y,v,b;!Xp||r instanceof YJ||(r.$from.parent.inlineContent||(h=Xh(t,r.from)),r.empty||r.$from.parent.inlineContent||(m=Xh(t,r.to))),t.docView.setSelection(d,p,t.root,n),Xp&&(h&&Xg(h),m&&Xg(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(()=>{(!Xf(o)||o.state.selection.visible)&&o.dom.classList.remove("ProseMirror-hideselection")},20))})))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}let Xp=QC||Qk&&QI<63;function Xh(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(QC&&o&&"false"==o.contentEditable)return Xm(o);if((!o||"false"==o.contentEditable)&&(!a||"false"==a.contentEditable)){if(o)return Xm(o);if(a)return Xm(a)}}function Xm(t){return t.contentEditable="true",QC&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function Xg(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function Xy(t,n){if(n instanceof YQ){let r=t.docView.descAt(n.from);r!=t.lastSelectedViewDesc&&(Xv(t),r&&r.selectNode(),t.lastSelectedViewDesc=r)}else Xv(t)}function Xv(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Xb(t,n,r,i){return t.someProp("createSelectionBetween",i=>i(t,n,r))||YJ.between(n,r,i)}function Xx(t){return(!t.editable||!!t.hasFocus())&&X_(t)}function X_(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 XS(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&&YK.findFrom(a,n)}function XT(t,n){return t.dispatch(t.state.tr.setSelection(n).scrollIntoView()),!0}function Xw(t,n,r){let i=t.state.selection;if(i instanceof YJ){if(!i.empty||r.indexOf("s")>-1)return!1;if(t.endOfTextblock(n>0?"forward":"backward")){let o=XS(t.state,n);return!!o&&o instanceof YQ&&XT(t,o)}if(!(QR&&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)&&(YQ.isSelectable(u)?XT(t,new YQ(n<0?t.state.doc.resolve(a.pos-u.nodeSize):a)):!!QA&&XT(t,new YJ(t.state.doc.resolve(n<0?c:c+u.nodeSize))))}}else{if(i instanceof YQ&&i.node.isInline)return XT(t,new YJ(n>0?i.$to:i.$from));{let l=XS(t.state,n);return!!l&&XT(t,l)}}}function XO(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Xk(t){let n=t.pmViewDesc;return n&&0==n.size&&(t.nextSibling||"BR"!=t.nodeName)}function XI(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(Qw&&1==r.nodeType&&i<XO(r)&&Xk(r.childNodes[i])&&(u=!0);;)if(i>0){if(1!=r.nodeType)break;{let s=r.childNodes[i-1];if(Xk(s))o=r,a=--i;else if(3==s.nodeType)i=(r=s).nodeValue.length;else break}}else{if(XM(r))break;{let c=r.previousSibling;for(;c&&Xk(c);)o=r.parentNode,a=Qi(c),c=c.previousSibling;if(c)i=XO(r=c);else{if((r=r.parentNode)==t.dom)break;i=0}}}u?XR(t,r,i):o&&XR(t,o,a)}(t):XC(t)}function XC(t){let n=t.domSelectionRange(),r=n.focusNode,i=n.focusOffset;if(!r)return;let o=XO(r),a,u;for(;;)if(i<o){if(1!=r.nodeType)break;if(Xk(r.childNodes[i]))a=r,u=++i;else break}else{if(XM(r))break;{let s=r.nextSibling;for(;s&&Xk(s);)a=s.parentNode,u=Qi(s)+1,s=s.nextSibling;if(s)i=0,o=XO(r=s);else{if((r=r.parentNode)==t.dom)break;i=o=0}}}a&&XR(t,a,u)}function XM(t){let n=t.pmViewDesc;return n&&n.node&&n.node.isBlock}function XR(t,n,r){let i=t.domSelection();if(Qp(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&&Xd(t)},50)}function XE(t,n){let r=t.state.doc.resolve(n);if(!(Qk||QE)&&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 Xj(t,n,r){let i=t.state.selection;if(i instanceof YJ&&!i.empty||r.indexOf("s")>-1||QR&&r.indexOf("m")>-1)return!1;let{$from:o,$to:a}=i;if(!o.parent.inlineContent||t.endOfTextblock(n<0?"up":"down")){let u=XS(t.state,n);if(u&&u instanceof YQ)return XT(t,u)}if(!o.parent.inlineContent){let s=n<0?o:a,c=i instanceof Y0?YK.near(s,n):YK.findFrom(s,n);return!!c&&XT(t,c)}return!1}function XA(t,n){if(!(t.state.selection instanceof YJ))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 XN(t,n,r){t.domObserver.stop(),n.contentEditable=r,t.domObserver.start()}function XP(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")||Yi.fromSchema(t.state.schema),c=Xq(),l=c.createElement("div");l.appendChild(s.serializeFragment(i,{document:c}));let f=l.firstChild,d,p=0;for(;f&&1==f.nodeType&&(d=XV[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,`
|
|
10
|
-
|
|
11
|
-
`)}}function XL(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 Jw(Jv.from(t.state.schema.text(n.replace(/\r\n?/g,`
|
|
12
|
-
`))),0,0):Jw.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=Yi.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=Xq().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(t),o;if((o=i&&XV[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),QA&&function(t){let n=t.querySelectorAll(Qk?"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")||J4.fromSchema(t.state.schema)).parseSlice(u,{preserveWhitespace:!!(c||m),context:o,ruleFromNode:t=>"BR"!=t.nodeName||t.nextSibling||!t.parentNode||XF.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=Jv.from(c.create(i[s+1],o)),a++,u++}return new Jw(o,a,u)}(XB(s,+m[1],+m[2]),m[4]);else if((s=Jw.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&&XW(n,o,t,a[a.length-1],0))a[a.length-1]=r;else{a.length&&(a[a.length-1]=XU(a[a.length-1],o.length));let u=XD(t,n);a.push(u),i=i.matchType(u.type),o=n}}),a)return Jv.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=XB(s,v,b)}return t.someProp("transformPasted",n=>{s=n(s,t)}),s}let XF=/^(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 XD(t,n,r=0){for(let i=n.length-1;i>=r;i--)t=n[i].create(null,Jv.from(t));return t}function XW(t,n,r,i,o){if(o<t.length&&o<n.length&&t[o]==n[o]){let a=XW(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(Jv.from(XD(r,t,o+1))))}}function XU(t,n){if(0==n)return t;let r=t.content.replaceChild(t.childCount-1,XU(t.lastChild,n-1)),i=t.contentMatchAt(t.childCount).fillBefore(Jv.empty,!0);return t.copy(r.append(i))}function Xz(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=Xz(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(Jv.empty,!0))),t.replaceChild(n<0?0:t.childCount-1,u.copy(s))}function XB(t,n,r){return n<t.openStart&&(t=new Jw(Xz(t.content,-1,n,t.openStart,0,t.openEnd),n,t.openEnd)),r<t.openEnd&&(t=new Jw(Xz(t.content,1,r,t.openEnd,0,0),t.openStart,r)),t}let XV={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},X$=null;function Xq(){return X$||(X$=document.implementation.createHTMLDocument("title"))}let XK={},XH={},XG={touchstart:!0,touchmove:!0};class XZ{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 XJ(t,n){t.input.lastSelectionOrigin=n,t.input.lastSelectionTime=Date.now()}function XY(t){t.someProp("handleDOMEvents",n=>{for(let r in n)t.input.eventHandlers[r]||t.dom.addEventListener(r,t.input.eventHandlers[r]=n=>XQ(t,n))})}function XQ(t,n){return t.someProp("handleDOMEvents",r=>{let i=r[n.type];return!!i&&(i(t,n)||n.defaultPrevented)})}function XX(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 X0(t){return{left:t.clientX,top:t.clientY}}function X1(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 X2(t,n,r){t.focused||t.focus();let i=t.state.tr.setSelection(n);"pointer"==r&&i.setMeta("pointer",!0),t.dispatch(i)}function X3(t,n,r,i){return X1(t,"handleDoubleClickOn",n,r,i)||t.someProp("handleDoubleClick",r=>r(t,n,i))}function X4(t,n,r,i){return X1(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&&(X2(t,YJ.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)X2(t,YJ.create(i,s+1,s+1+u.content.size),"pointer");else{if(!YQ.isSelectable(u))continue;X2(t,YQ.create(i,s),"pointer")}return!0}}(t,r,i)}XH.keydown=(t,n)=>{if(t.input.shiftKey=16==n.keyCode||n.shiftKey,!X6(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Qj&&Qk&&13==n.keyCode))){if(229!=n.keyCode&&t.domObserver.forceFlush(),!QM||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||QR&&72==o&&"c"==a)return XA(t,-1)||XI(t,-1);if(46==o&&!n.shiftKey||QR&&68==o&&"c"==a)return XA(t,1)||XI(t,1);if(13==o||27==o)return!0;if(37==o||QR&&66==o&&"c"==a){let u=37==o?"ltr"==XE(t,t.state.selection.from)?-1:1:-1;return Xw(t,u,a)||XI(t,u)}if(39==o||QR&&70==o&&"c"==a){let s=39==o?"ltr"==XE(t,t.state.selection.from)?1:-1:1;return Xw(t,s,a)||XI(t,s)}return 38==o||QR&&80==o&&"c"==a?Xj(t,-1,a)||XI(t,-1):40==o||QR&&78==o&&"c"==a?function(t){if(!QC||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;XN(t,i,"true"),setTimeout(()=>XN(t,i,"false"),20)}return!1}(t)||Xj(t,1,a)||XC(t):a==(QR?"m":"c")&&(66==o||73==o||89==o||90==o)}(t,n)?n.preventDefault():XJ(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,Qh(13,"Enter"))),t.input.lastIOSEnter=0)},200)}}},XH.keyup=(t,n)=>{16==n.keyCode&&(t.input.shiftKey=!1)},XH.keypress=(t,n)=>{if(X6(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||QR&&n.metaKey)return;if(t.someProp("handleKeyPress",r=>r(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof YJ)||!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 X5=QR?"metaKey":"ctrlKey";XK.mousedown=(t,n)=>{var r,i,o;t.input.shiftKey=n.shiftKey;let a=eet(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[X5]&&("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(X0(n));f&&("singleClick"==s?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new X9(t,f,n,!!a)):("doubleClick"==s?X3:X4)(t,f.pos,f.inside,n)?n.preventDefault():XJ(t,"pointer"))};class X9{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[X5],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 YQ&&l.from<=a&&l.to>a)&&(this.mightDrag={node:o,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Qw&&!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)),XJ(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(()=>Xd(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(X0(t))),this.updateAllowDefault(t),this.allowDefault||!u?XJ(this.view,"pointer"):(n=this.view,r=u.pos,i=u.inside,a=this.selectNode,X1(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 YQ&&(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(YQ.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&&(X2(t,YQ.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&&YQ.isSelectable(i))&&(X2(t,new YQ(r),"pointer"),!0)}(n,i)))?t.preventDefault():0==t.button&&(this.flushed||QC&&this.mightDrag&&!this.mightDrag.node.isAtom||Qk&&!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)))?(X2(this.view,YK.near(this.view.state.doc.resolve(u.pos)),"pointer"),t.preventDefault()):XJ(this.view,"pointer")}move(t){this.updateAllowDefault(t),XJ(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 X6(t,n){return!!t.composing||!!(QC&&500>Math.abs(n.timeStamp-t.input.compositionEndedAt))&&(t.input.compositionEndedAt=-2e8,!0)}XK.touchstart=t=>{t.input.lastTouch=Date.now(),eet(t),XJ(t,"pointer")},XK.touchmove=t=>{t.input.lastTouch=Date.now(),XJ(t,"pointer")},XK.contextmenu=t=>{var n;return eet(t)};let X8=Qj?5e3:-1;function X7(t,n){clearTimeout(t.input.composingTimeout),n>-1&&(t.input.composingTimeout=setTimeout(()=>eet(t),n))}function eee(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 eet(t,n=!1){if(!(Qj&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),eee(t),n||t.docView&&t.docView.dirty){let r=Xl(t);return r&&!r.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(r)):t.updateState(t.state),!0}return!1}}XH.compositionstart=XH.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(),eet(t,!0),t.markCursor=null;else if(eet(t),Qw&&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}X7(t,X8)},XH.compositionend=(t,n)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=n.timeStamp,t.input.compositionID++,X7(t,20))};let een=QS&&QT<15||QM&&QN<604;function eer(t,n,r,i,o){var a;let u=XL(t,n,r,i,t.state.selection.$from);if(t.someProp("handlePaste",n=>n(t,o,u||Jw.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}XK.copy=XH.cut=(t,n)=>{let r=t.state.selection,i="cut"==n.type;if(r.empty)return;let o=een?null:n.clipboardData,{dom:a,text:u}=XP(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"))},XH.paste=(t,n)=>{if(t.composing&&!Qj)return;let r=een?null:n.clipboardData,i=t.input.shiftKey&&45!=t.input.lastKeyCode;r&&eer(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?eer(t,i.value,null,o,n):eer(t,i.textContent,i.innerHTML,o,n)},50)}(t,n)};class eei{constructor(t,n){this.slice=t,this.move=n}}let eeo=QR?"altKey":"ctrlKey";for(let eea in XK.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(X0(r));if(!(a&&a.pos>=o.from&&a.pos<=(o instanceof YQ?o.to-1:o.to))){if(i&&i.mightDrag)t.dispatch(t.state.tr.setSelection(YQ.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(YQ.create(t.state.doc,u.posBefore)))}}let s=t.state.selection.content(),{dom:c,text:l}=XP(t,s);r.dataTransfer.clearData(),r.dataTransfer.setData(een?"Text":"text/html",c.innerHTML),r.dataTransfer.effectAllowed="copyMove",een||r.dataTransfer.setData("text/plain",l),t.dragging=new eei(s,!r[eeo])},XK.dragend=t=>{let n=t.dragging;window.setTimeout(()=>{t.dragging==n&&(t.dragging=null)},50)},XH.dragover=XH.dragenter=(t,n)=>n.preventDefault(),XH.drop=(t,n)=>{let r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(X0(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=XL(t,n.dataTransfer.getData(een?"Text":"text/plain"),een?null:n.dataTransfer.getData("text/html"),!1,o);let u=!!(r&&!n[eeo]);if(t.someProp("handleDrop",r=>r(t,n,a||Jw.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&&YQ.isSelectable(a.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new YQ(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(Xb(t,p,c.doc.resolve(h)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))},XK.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())&&Xd(t)},20))},XK.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)},XK.beforeinput=(t,n)=>{if(Qk&&Qj&&"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,Qh(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)}},XH)XK[eea]=XH[eea];function eeu(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 ees{constructor(t,n){this.toDOM=t,this.spec=n||eep,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 eef(o-r,o-r,this)}valid(){return!0}eq(t){return this==t||t instanceof ees&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&eeu(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class eec{constructor(t,n){this.attrs=t,this.spec=n||eep}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 eef(o,a,this)}valid(t,n){return n.from<n.to}eq(t){return this==t||t instanceof eec&&eeu(this.attrs,t.attrs)&&eeu(this.spec,t.spec)}static is(t){return t.type instanceof eec}destroy(){}}let eel=class t{constructor(t,n){this.attrs=t,this.spec=n||eep}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 eef(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&&eeu(this.attrs,n.attrs)&&eeu(this.spec,n.spec)}destroy(){}};class eef{constructor(t,n,r){this.from=t,this.to=n,this.type=r}copy(t,n){return new eef(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 eef(t,t,new ees(n,r))}static inline(t,n,r,i){return new eef(t,n,new eec(r,i))}static node(t,n,r,i){return new eef(t,n,new eel(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof eec}}let eed=[],eep={};class eeh{constructor(t,n){this.local=t.length?t:eed,this.children=n.length?n:eed}static create(t,n){return n.length?eex(n,t,0,eep):eem}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==eem||0==t.maps.length?this:this.mapInner(t,n,0,0,r||eep)}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!=eem?(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=eex(_,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 eeh(n.sort(ee_),s)}(this.children,a||[],t,n,r,i,o):a?new eeh(a.sort(ee_),eed):eem}add(t,n){return n.length?this==eem?eeh.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=eev(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,eex(s,t,u+1,eep)),o+=3}});let a=eey(o?eeb(n):n,-r);for(let u=0;u<a.length;u++)a[u].type.valid(t,a[u])||a.splice(u--,1);return new eeh(a.length?this.local.concat(a).sort(ee_):this.local,i||this.children)}remove(t){return 0==t.length||this==eem?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!=eem?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 eeh(i,r):eem}forChild(t,n){if(this==eem)return this;if(n.isLeaf)return eeh.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 eec){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 eeh(i.sort(ee_),eed);return r?new eeg([d,r]):d}return r||eem}eq(t){if(this==t)return!0;if(!(t instanceof eeh)||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 eeS(this.localsInner(t))}localsInner(t){if(this==eem)return eed;if(t.inlineContent||!this.local.some(eec.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof eec||n.push(this.local[r]);return n}}eeh.empty=new eeh([],[]),eeh.removeOverlap=eeS;let eem=eeh.empty;class eeg{constructor(t){this.members=t}map(t,n){let r=this.members.map(r=>r.map(t,n,eep));return eeg.from(r)}forChild(t,n){if(n.isLeaf)return eeh.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(t,n);o!=eem&&(o instanceof eeg?r=r.concat(o.members):r.push(o))}return eeg.from(r)}eq(t){if(!(t instanceof eeg)||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?eeS(r?n:n.sort(ee_)):eed}static from(t){switch(t.length){case 0:return eem;case 1:return t[0];default:return new eeg(t.every(t=>t instanceof eeh)?t:t.reduce((t,n)=>t.concat(n instanceof eeh?n:n.members),[]))}}}function eey(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 eef(o.from+n,o.to+n,o.type))}return r}function eev(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 eeb(t){let n=[];for(let r=0;r<t.length;r++)null!=t[r]&&n.push(t[r]);return n}function eex(t,n,r,i){let o=[],a=!1;n.forEach((n,u)=>{let s=eev(t,n,u+r);if(s){a=!0;let c=eex(s,n,r+u+1,i);c!=eem&&o.push(u,u+n.nodeSize,c)}});let u=eey(a?eeb(t):t,-r).sort(ee_);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 eeh(u,o):eem}function ee_(t,n){return t.from-n.from||t.to-n.to}function eeS(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),eeT(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),eeT(n,o,i.copy(a.from,i.to)));break}}return n}function eeT(t,n,r){for(;n<t.length&&ee_(r,t[n])>0;)n++;t.splice(n,0,r)}function eew(t){let n=[];return t.someProp("decorations",r=>{let i=r(t.state);i&&i!=eem&&n.push(i)}),t.cursorWrapper&&n.push(eeh.create(t.state.doc,[t.cursorWrapper.deco])),eeg.from(n)}let eeO={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},eek=QS&&QT<=11;class eeI{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 eeC{constructor(t,n){this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new eeI,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]);QS&&QT<=11&&t.some(t=>"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length)?this.flushSoon():this.flush()}),eek&&(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,eeO)),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(Xx(this.view)){if(this.suppressingSelectionUpdates)return Xd(this.view);if(QS&&QT<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&Qs(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=Qo(i))n.add(i);for(let o=t.anchorNode;o;o=Qo(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)&&Xx(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(Qw&&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&&Qp(i)&&(m=Xl(n))&&m.eq(YK.near(n.state.doc.resolve(0),1))?(n.input.lastFocus=0,Xd(n),this.currentSelection.set(i),n.scrollToSelection()):(a>-1||o)&&(a>-1&&(n.docView.markDirty(a,u),t=n,eeM.has(t)||(eeM.set(t,null),-1===["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace))||(t.requiresGeckoHackNode=Qw,eeR||(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."),eeR=!0))),this.handleDOMChange(a,u,s,c),n.docView&&n.docView.dirty?n.updateState(n.state):this.currentSelection.eq(i)||Xd(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(QS&&QT<=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?Qi(o)+1:0,f=r.localPosFromDOM(t.target,l,-1),d=a&&a.parentNode==t.target?Qi(a):t.target.childNodes.length,p=r.localPosFromDOM(t.target,d,1);return{from:f,to:p}}}}let eeM=new WeakMap,eeR=!1;function eeE(t){let n=t.pmViewDesc;if(n)return n.parseRule();if("BR"==t.nodeName&&t.parentNode){if(QC&&/^(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||QC&&/^(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 eej=/^(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 eeA(t,n,r){return Math.max(r.anchor,r.head)>n.content.size?null:Xb(t,n.resolve(r.anchor),n.resolve(r.head))}function eeN(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 eeP{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 XZ,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(eeU),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=eeD(this),eeF(this),this.nodeViews=eeW(this),this.docView=Q5(this.state.doc,eeL(this),eew(this),this.dom,this),this.domObserver=new eeC(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=Xl(t,a);if(u&&!t.state.selection.eq(u)){if(Qk&&Qj&&13===t.input.lastKeyCode&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",n=>n(t,Qh(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}],Qp(c)||l.push({node:c.focusNode,offset:c.focusOffset})),Qk&&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")||J4.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:eeE,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((QM&&t.input.lastIOSEnter>Date.now()-225||Qj)&&o.some(t=>1==t.nodeType&&!eej.test(t.nodeName))&&(!y||y.endA>=y.endB)&&t.someProp("handleKeyDown",n=>n(t,Qh(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!y){if(i&&f instanceof YJ&&!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=eeA(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(Qk&&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 YJ&&(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)),QS&&QT<=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((QM&&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=YK.findFrom(d.doc.resolve(_.pos+1),1,!0))&&O.head==S.pos)&&t.someProp("handleKeyDown",n=>n(t,Qh(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||eeN(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(eeN(a,!0,!0));return!(!u.parent.isTextblock||u.pos>r||eeN(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,Qh(8,"Backspace")))){Qj&&Qk&&t.domObserver.suppressSelectionUpdates();return}Qk&&Qj&&y.endB==y.start&&(t.input.lastAndroidDelete=Date.now()),Qj&&!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,Qh(13,"Enter"))})},20));let k=y.start,I=y.endA,C,M,R;if(w){if(_.pos==S.pos)QS&&QT<=11&&0==_.parentOffset&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Xd(t),20)),C=t.state.tr.delete(k,I),M=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(Jv.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()))))C=t.state.tr,"add"==R.type?C.addMark(k,I,R.mark):C.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;C=t.state.tr.insertText(E,k,I)}}if(C||(C=t.state.tr.replace(k,I,d.doc.slice(y.start-d.from,y.endB-d.from))),d.sel){let j=eeA(t,C.doc,d.sel);j&&!(Qk&&Qj&&t.composing&&j.empty&&(y.start!=y.endB||t.input.lastAndroidDelete<Date.now()-100)&&(j.head==k||j.head==C.mapping.map(I)-1)||QS&&j.empty&&j.head==k)&&C.setSelection(j)}M&&C.ensureMarks(M),t.composing&&C.setMeta("composition",t.input.compositionID),t.dispatch(C.scrollIntoView())})(this,t,n,r,i)),this.domObserver.start(),function(t){for(let n in XK){let r=XK[n];t.dom.addEventListener(n,t.input.eventHandlers[n]=n=>{!XX(t,n)||XQ(t,n)||!t.editable&&n.type in XH||r(t,n)},XG[n]?{passive:!0}:void 0)}QC&&t.dom.addEventListener("input",()=>null),XY(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&&XY(this);let n=this._props;this._props=t,t.plugins&&(t.plugins.forEach(eeU),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&&(eee(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=eeW(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)&&XY(this),this.editable=eeD(this),eeF(this);let s=eew(this),c=eeL(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:QW(t.dom)}}(this);if(o){var p,h,m;this.domObserver.stop();let g,y=f&&(QS||Qk)&&!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=Qk?this.trackWrites=this.domSelectionRange().focusNode:null;(i||!this.docView.update(t.doc,c,s,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=Q5(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(),Qs(b.node,b.offset,x.anchorNode,x.anchorOffset)))?Xd(this,y):(Xy(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;QU(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 YQ){let n=this.docView.domAfterPos(this.state.selection.from);1==n.nodeType&&QD(this,n.getBoundingClientRect(),t)}else QD(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(QS){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(Qz)return t.focus(Qz);let n=QW(t);t.focus(null==Qz?{get preventScroll(){return Qz={preventScroll:!0},!0}}:void 0),Qz||(Qz=!1,QU(n,0))}(this.dom),Xd(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=Qm(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(!QB(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(QB(r,f))return t(s,r,f)}}if((u=(u+1)%o)==a)break}return n}(t.dom,n,f)))return null}if(QC)for(let d=c;a&&d;d=Qo(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(Qw&&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=Qu(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=Q$(i,1);if(a.top!=a.bottom&&QB(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 QK(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 QY==(i=n||this.state)&&QQ==t?QX:(QY=i,QQ=t,QX="up"==t||"down"==t?(a=this,c=i.selection,l="up"==t?c.$from:c.$to,QZ(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=QK(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=Qu(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 QJ.test(i.parent.textContent)&&u.modify?QZ(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 eer(this,"",t,!1,n||new ClipboardEvent("paste"))}pasteText(t,n){return eer(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,[],eew(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;XQ(this,t)||!XK[t.type]||!this.editable&&t.type in XH||XK[t.type](this,t)}dispatch(t){let n=this._props.dispatchTransaction;n?n.call(this,t):this.updateState(this.state.apply(t))}domSelectionRange(){return QC&&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 Qs(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 eeL(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"),[eef.node(0,t.state.doc.content.size,n)]}function eeF(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:eef.widget(t.state.selection.head,n,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function eeD(t){return!t.someProp("editable",n=>!1===n(t.state))}function eeW(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 eeU(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 eez={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:"'"},eeB={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},eeV="u">typeof navigator&&/Mac/.test(navigator.platform),ee$="u">typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),eeq=0;eeq<10;eeq++)eez[48+eeq]=eez[96+eeq]=String(eeq);for(var eeq=1;eeq<=24;eeq++)eez[eeq+111]="F"+eeq;for(var eeq=65;eeq<=90;eeq++)eez[eeq]=String.fromCharCode(eeq+32),eeB[eeq]=String.fromCharCode(eeq);for(var eeK in eez)eeB.hasOwnProperty(eeK)||(eeB[eeK]=eez[eeK]);let eeH="u">typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function eeG(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))eeH?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 eeZ(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 eeJ=(t,n)=>!t.selection.empty&&(n&&n(t.tr.deleteSelection().scrollIntoView()),!0),eeY=(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=ee0(i);if(!o){let a=i.blockRange(),u=a&&Yw(a);return null!=u&&(n&&n(t.tr.lift(a,u).scrollIntoView()),!0)}let s=o.nodeBefore;if(!s.type.spec.isolating&&etr(t,o,n))return!0;if(0==i.parent.content.size&&(eeQ(s,"end")||YQ.isSelectable(s))){let c=YE(t.doc,i.before(),i.after(),Jw.empty);if(c&&c.slice.size<c.to-c.from){if(n){let l=t.tr.step(c);l.setSelection(eeQ(s,"end")?YK.findFrom(l.doc.resolve(l.mapping.map(o.pos,-1)),-1):YQ.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 eeQ(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 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("backward",t):i.parentOffset>0)return!1;a=ee0(i)}let u=a&&a.nodeBefore;return!!(u&&YQ.isSelectable(u))&&(n&&n(t.tr.setSelection(YQ.create(t.doc,a.pos-u.nodeSize)).scrollIntoView()),!0)};function ee0(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 ee1=(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=ee3(i);if(!o)return!1;let a=o.nodeAfter;if(etr(t,o,n))return!0;if(0==i.parent.content.size&&(eeQ(a,"start")||YQ.isSelectable(a))){let u=YE(t.doc,i.before(),i.after(),Jw.empty);if(u&&u.slice.size<u.to-u.from){if(n){let s=t.tr.step(u);s.setSelection(eeQ(a,"start")?YK.findFrom(s.doc.resolve(s.mapping.map(o.pos)),1):YQ.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)},ee2=(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=ee3(i)}let u=a&&a.nodeAfter;return!!(u&&YQ.isSelectable(u))&&(n&&n(t.tr.setSelection(YQ.create(t.doc,a.pos)).scrollIntoView()),!0)};function ee3(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 ee4=(t,n)=>{let r=t.selection,i=r instanceof YQ,o;if(i){if(r.node.isTextblock||!YC(t.doc,r.from))return!1;o=r.from}else if(null==(o=YR(t.doc,r.from,-1)))return!1;if(n){let a=t.tr.join(o);i&&a.setSelection(YQ.create(a.doc,o-t.doc.resolve(o).nodeBefore.nodeSize)),n(a.scrollIntoView())}return!0},ee5=(t,n)=>{let r=t.selection,i;if(r instanceof YQ){if(r.node.isTextblock||!YC(t.doc,r.to))return!1;i=r.to}else if(null==(i=YR(t.doc,r.to,1)))return!1;return n&&n(t.tr.join(i).scrollIntoView()),!0},ee9=(t,n)=>{let{$from:r,$to:i}=t.selection,o=r.blockRange(i),a=o&&Yw(o);return null!=a&&(n&&n(t.tr.lift(o,a).scrollIntoView()),!0)},ee6=(t,n)=>{let{$head:r,$anchor:i}=t.selection;return!!(r.parent.type.spec.code&&r.sameParent(i))&&(n&&n(t.tr.insertText(`
|
|
13
|
-
`).scrollIntoView()),!0)};function ee8(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 ee7=(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=ee8(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(YK.near(c.doc.resolve(s),1)),n(c.scrollIntoView())}return!0},ete=(t,n)=>{let r=t.selection,{$from:i,$to:o}=r;if(r instanceof Y0||i.parent.inlineContent||o.parent.inlineContent)return!1;let a=ee8(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(YJ.create(s.doc,u+1)),n(s.scrollIntoView())}return!0},ett=(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(YI(t.doc,i))return n&&n(t.tr.split(i).scrollIntoView()),!0}let o=r.blockRange(),a=o&&Yw(o);return null!=a&&(n&&n(t.tr.lift(o,a).scrollIntoView()),!0)},etn=(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(YQ.create(t.doc,o))),!0)};function etr(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||YC(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=Jv.empty;for(let y=c.length-1;y>=0;y--)g=Jv.from(c[y].create(null,g));g=Jv.from(u.copy(g));let v=t.tr.step(new Y_(n.pos-1,m,n.pos,m,new Jw(g,1,0),c.length,!0)),b=m+2*c.length;YC(v.doc,b)&&v.join(b),r(v.scrollIntoView())}return!0}let x=YK.findFrom(n,1),_=x&&x.$from.blockRange(x.$to),S=_&&Yw(_);if(null!=S&&S>=n.depth)return r&&r(t.tr.lift(_,S).scrollIntoView()),!0;if(h&&eeQ(s,"start",!0)&&eeQ(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=Jv.empty;for(let C=w.length-1;C>=0;C--)I=Jv.from(w[C].copy(I));let M=t.tr.step(new Y_(n.pos-w.length,n.pos+s.nodeSize,n.pos+k,n.pos+s.nodeSize-k,new Jw(I,w.length,0),0,!0));r(M.scrollIntoView())}return!0}}return!1}function eti(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(YJ.create(n.doc,t<0?o.start(a):o.end(a)))),!0)}}let eto=eti(-1),eta=eti(1);function etu(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 ets(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 etc{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:ets({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 etl{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 etf(t,n,r){return void 0===t.config[n]&&t.parent?etf(t.parent,n,r):"function"==typeof t.config[n]?t.config[n].bind({...r,parent:t.parent?etf(t.parent,n,r):null}):t.config[n]}function etd(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 etp(t){let n=[],{nodeExtensions:r,markExtensions:i}=etd(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=etf(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=etf(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 eth(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 etm(...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 etg(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)=>etm(t,n),{})}function ety(t){return"function"==typeof t}function etv(t,n,...r){return ety(t)?n?t.bind(n)(...r):t(...r):t}function etb(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 etx(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 et_(t,n){var r;let i=etp(t),{nodeExtensions:o,markExtensions:a}=etd(t),u=null===(r=o.find(t=>etf(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=etf(n,"extendNodeSchema",a);return{...t,...i?i(r):{}}},{}),s=etx({...u,content:etv(etf(r,"content",a)),marks:etv(etf(r,"marks",a)),group:etv(etf(r,"group",a)),inline:etv(etf(r,"inline",a)),atom:etv(etf(r,"atom",a)),selectable:etv(etf(r,"selectable",a)),draggable:etv(etf(r,"draggable",a)),code:etv(etf(r,"code",a)),defining:etv(etf(r,"defining",a)),isolating:etv(etf(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=etv(etf(r,"parseHTML",a));c&&(s.parseDOM=c.map(t=>etb(t,o)));let l=etf(r,"renderHTML",a);l&&(s.toDOM=t=>l({node:t,HTMLAttributes:etg(t,o)}));let f=etf(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=etf(n,"extendMarkSchema",a);return{...t,...i?i(r):{}}},{}),s=etx({...u,inclusive:etv(etf(r,"inclusive",a)),excludes:etv(etf(r,"excludes",a)),group:etv(etf(r,"group",a)),spanning:etv(etf(r,"spanning",a)),code:etv(etf(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=etv(etf(r,"parseHTML",a));c&&(s.parseDOM=c.map(t=>etb(t,o)));let l=etf(r,"renderHTML",a);return l&&(s.toDOM=t=>l({mark:t,HTMLAttributes:etg(t,o)})),[r.name,s]}));return new J2({topNode:u,nodes:s,marks:c})}function etS(t,n){return n.nodes[t]||n.marks[t]||null}function etT(t,n){return Array.isArray(n)?n.some(n=>("string"==typeof n?n:n.name)===t.name):n}let etw=(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 etO(t){return"[object RegExp]"===Object.prototype.toString.call(t)}class etk{constructor(t){this.find=t.find,this.handler=t.handler}}let etI=(t,n)=>{if(etO(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 etC(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=etw(l)+a;return u.forEach(t=>{if(f)return;let n=etI(d,t.find);if(!n)return;let u=c.state.tr,l=ets({state:c.state,transaction:u}),p={from:i-(n[0].length-a.length),to:o},{commands:h,chain:m,can:g}=new etc({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 etM{constructor(t){this.find=t.find,this.handler=t.handler}}let etR=(t,n)=>{if(etO(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 etE{constructor(t,n){this.splittableMarks=[],this.editor=n,this.extensions=etE.resolve(t),this.schema=et_(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:etS(t.name,this.schema)};"mark"===t.type&&(!(null!==(n=etv(etf(t,"keepOnSplit",r)))&&void 0!==n)||n)&&this.splittableMarks.push(t.name);let i=etf(t,"onBeforeCreate",r);i&&this.editor.on("beforeCreate",i);let o=etf(t,"onCreate",r);o&&this.editor.on("create",o);let a=etf(t,"onUpdate",r);a&&this.editor.on("update",a);let u=etf(t,"onSelectionUpdate",r);u&&this.editor.on("selectionUpdate",u);let s=etf(t,"onTransaction",r);s&&this.editor.on("transaction",s);let c=etf(t,"onFocus",r);c&&this.editor.on("focus",c);let l=etf(t,"onBlur",r);l&&this.editor.on("blur",l);let f=etf(t,"onDestroy",r);f&&this.editor.on("destroy",f)})}static resolve(t){let n=etE.sort(etE.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=etf(t,"addExtensions",n);return r?[t,...this.flatten(r())]:t}).flat(10)}static sort(t){return t.sort((t,n)=>{let r=etf(t,"priority")||100,i=etf(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:etS(n.name,this.schema)},i=etf(n,"addCommands",r);return i?{...t,...i()}:t},{})}get plugins(){let{editor:t}=this,n=etE.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:etS(n.name,this.schema)},s=[],c=etf(n,"addKeyboardShortcuts",u),l={};if("mark"===n.type&&n.config.exitable&&(l.ArrowRight=()=>ert.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 Qe({props:{handleKeyDown:(a=o,d=function(t){let n=Object.create(null);for(let r in t)n[eeG(r)]=t[r];return n}(a),function(t,n){var r,i;let o=("Esc"==(i=!(eeV&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||ee$&&n.shiftKey&&n.key&&1==n.key.length||"Unidentified"==n.key)&&n.key||(n.shiftKey?eeB:eez)[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[eeZ(o,n)];if(u&&u(t.state,t.dispatch,t))return!0;if(1==o.length&&" "!=o){if(n.shiftKey){let s=d[eeZ(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=eez[n.keyCode])&&a!=o){let c=d[eeZ(a,n)];if(c&&c(t.state,t.dispatch,t))return!0}}return!1})}}));s.push(p);let h=etf(n,"addInputRules",u);etT(n,t.options.enableInputRules)&&h&&r.push(...h());let m=etf(n,"addPasteRules",u);etT(n,t.options.enablePasteRules)&&m&&i.push(...m());let g=etf(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 Qe({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)=>etC({editor:n,from:o,to:a,text:u,rules:r,plugin:i}),handleDOMEvents:{compositionend:t=>(setTimeout(()=>{let{$cursor:o}=t.state.selection;o&&etC({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&&etC({editor:n,from:a.pos,to:a.pos,text:`
|
|
14
|
-
`,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 Qe({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=ets({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 etc({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,"");etR(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 etp(this.extensions)}get nodeViews(){let{editor:t}=this,{nodeExtensions:n}=etd(this.extensions);return Object.fromEntries(n.filter(t=>!!etf(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:eth(n.name,this.schema)},o=etf(n,"addNodeView",i);if(!o)return[];let a=(i,a,u,s)=>{let c=etg(i,r);return o()({editor:t,node:i,getPos:u,decorations:s,HTMLAttributes:c,extension:n})};return[n.name,a]}))}}function etj(t){var n;return"Object"===Object.prototype.toString.call(t).slice(8,-1)&&t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function etA(t,n){let r={...t};return etj(t)&&etj(n)&&Object.keys(n).forEach(i=>{etj(n[i])&&i in t?r[i]=etA(t[i],n[i]):Object.assign(r,{[i]:n[i]})}),r}class etN{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=etv(etf(this,"addOptions",{name:this.name}))),this.storage=etv(etf(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new etN(t)}configure(t={}){let n=this.extend();return n.options=etA(this.options,t),n.storage=etv(etf(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){let n=new etN(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=etv(etf(n,"addOptions",{name:n.name})),n.storage=etv(etf(n,"addStorage",{name:n.name,options:n.options})),n}}function etP(t,n,r){let{from:i,to:o}=n,{blockSeparator:a=`
|
|
15
|
-
|
|
16
|
-
`,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 etL(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}let etF=etN.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new Qe({key:new Qr("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=etL(r);return etP(i,{from:u,to:s},{textSerializers:c})}}})]}}),etD=()=>({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),etW=(t=!1)=>({commands:n})=>n.setContent("",t),etU=()=>({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=Yw(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},etz=t=>n=>t(n),etB=()=>({state:t,dispatch:n})=>ete(t,n),etV=()=>({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},et$=t=>({tr:n,state:r,dispatch:i})=>{let o=eth(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},etq=t=>({tr:n,dispatch:r})=>{let{from:i,to:o}=t;return r&&n.delete(i,o),!0},etK=()=>({state:t,dispatch:n})=>eeJ(t,n),etH=()=>({commands:t})=>t.keyboardShortcut("Enter"),etG=()=>({state:t,dispatch:n})=>ee7(t,n);function etZ(t,n,r={strict:!0}){let i=Object.keys(n);return!i.length||i.every(i=>r.strict?n[i]===t[i]:etO(n[i])?n[i].test(t[i]):n[i]===t[i])}function etJ(t,n,r={}){return t.find(t=>t.type===n&&etZ(t.attrs,r))}function etY(t,n,r={}){return!!etJ(t,n,r)}function etQ(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=etJ([...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(etJ([...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&&etY([...t.parent.child(s).marks],n,r);)c+=t.parent.child(s).nodeSize,s+=1;return{from:u,to:c}}function etX(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 et0=(t,n={})=>({tr:r,state:i,dispatch:o})=>{let a=etX(t,i.schema),{doc:u,selection:s}=r,{$from:c,from:l,to:f}=s;if(o){let d=etQ(c,a,n);if(d&&d.from<=l&&d.to>=f){let p=YJ.create(u,d.from,d.to);r.setSelection(p)}}return!0},et1=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 et2(t){return t instanceof YJ}function et3(t=0,n=0,r=0){return Math.min(Math.max(t,n),r)}function et4(t,n=null){if(!n)return null;let r=YK.atStart(t),i=YK.atEnd(t);if("start"===n||!0===n)return r;if("end"===n)return i;let o=r.from,a=i.to;return"all"===n?YJ.create(t,et3(0,o,a),et3(t.content.size,o,a)):YJ.create(t,et3(n,o,a),et3(n,o,a))}function et5(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}let et9=(t=null,n={})=>({editor:r,view:i,tr:o,dispatch:a})=>{n={scrollIntoView:!0,...n};let u=()=>{et5()&&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&&!et2(r.state.selection))return u(),!0;let s=et4(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},et6=(t,n)=>r=>t.every((t,i)=>n(t,{...r,index:i})),et8=(t,n)=>({tr:r,commands:i})=>i.insertContentAt({from:r.selection.from,to:r.selection.to},t,n);function et7(t){let n=`<body>${t}</body>`;return new window.DOMParser().parseFromString(n,"text/html").body}function ene(t,n,r){if(r={slice:!0,parseOptions:{},...r},"object"==typeof t&&null!==t)try{return Array.isArray(t)&&t.length>0?Jv.fromArray(t.map(t=>n.nodeFromJSON(t))):n.nodeFromJSON(t)}catch(i){return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",i),ene("",n,r)}if("string"==typeof t){let o=J4.fromSchema(n);return r.slice?o.parseSlice(et7(t),r.parseOptions).content:o.parse(et7(t),r.parseOptions)}return ene("",n,r)}let ent=t=>t.toString().startsWith("<"),enn=(t,n,r)=>({tr:i,dispatch:o,editor:a})=>{if(o){r={parseOptions:{},updateSelection:!0,...r};let u=ene(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((ent(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 Yx||o instanceof Y_))return;let a=t.mapping.maps[i],u=0;a.forEach((t,n,r,i)=>{0===u&&(u=i)}),t.setSelection(YK.near(t.doc.resolve(u),-1))}(i,i.steps.length-1,-1)}return!0},enr=()=>({state:t,dispatch:n})=>ee4(t,n),eni=()=>({state:t,dispatch:n})=>ee5(t,n),eno=()=>({state:t,dispatch:n})=>eeY(t,n),ena=()=>({state:t,dispatch:n})=>ee1(t,n);function enu(){return"u">typeof navigator&&/Mac/.test(navigator.platform)}let ens=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))et5()||enu()?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 enc(t,n,r={}){let{from:i,to:o,empty:a}=t.selection,u=n?eth(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=>etZ(t.node.attrs,r,{strict:!1}));return a?!!c.length:c.reduce((t,n)=>t+n.to-n.from,0)>=o-i}let enl=(t,n={})=>({state:r,dispatch:i})=>{let o=eth(t,r.schema);return!!enc(r,o,n)&&ee9(r,i)},enf=()=>({state:t,dispatch:n})=>ett(t,n),end=t=>({state:n,dispatch:r})=>{var i;let o=eth(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 Y_(a-1,u,a,u,new Jw(Jv.from(r.create(null,i.parent.copy())),1,0),1,!0)),i=new JP(o.doc.resolve(i.$from.pos),o.doc.resolve(u),i.depth));let s=Yw(i);if(null==s)return!1;o.lift(i,s);let c=o.mapping.map(a,-1)-1;return YC(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?Jv.empty:Jv.from(o))))return!1;let m=c.pos,g=m+l.nodeSize;return i.step(new Y_(m-(f?1:0),g+(d?1:0),m+1,g-1,new Jw((f?Jv.empty:Jv.from(o.copy(Jv.empty))).append(d?Jv.empty:Jv.from(o.copy(Jv.empty))),f?0:1,d?0:1),f?0:1)),n(i.scrollIntoView()),!0}(t,n,a)))}(n,r)},enp=()=>({state:t,dispatch:n})=>ee6(t,n);function enh(t,n){return n.nodes[t]?"node":n.marks[t]?"mark":null}function enm(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 eng=(t,n)=>({tr:r,state:i,dispatch:o})=>{let a=null,u=null,s=enh("string"==typeof t?t:t.name,i.schema);return!!s&&("node"===s&&(a=eth(t,i.schema)),"mark"===s&&(u=etX(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,enm(t.attrs,n)),u&&t.marks.length&&t.marks.forEach(o=>{u===o.type&&r.addMark(i,i+t.nodeSize,u.create(enm(o.attrs,n)))})})}),!0)},eny=()=>({tr:t,dispatch:n})=>(n&&t.scrollIntoView(),!0),env=()=>({tr:t,commands:n})=>n.setTextSelection({from:0,to:t.doc.content.size}),enb=()=>({state:t,dispatch:n})=>eeX(t,n),enx=()=>({state:t,dispatch:n})=>ee2(t,n),en_=()=>({state:t,dispatch:n})=>etn(t,n),enS=()=>({state:t,dispatch:n})=>eta(t,n),enT=()=>({state:t,dispatch:n})=>eto(t,n);function enw(t,n,r={}){return ene(t,n,{slice:!1,parseOptions:r})}let enO=(t,n=!1,r={})=>({tr:i,editor:o,dispatch:a})=>{let{doc:u}=i,s=enw(t,o.schema,r);return a&&i.replaceWith(0,u.content.size,s).setMeta("preventUpdate",!n),!0};function enk(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 enI(t,n){let r=etX(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 enC(t,n,r){let i=[];return t===n?r.resolve(t).marks().forEach(n=>{let o=r.resolve(t-1),a=etQ(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 enM(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 enR(t,n,r={}){let{empty:i,ranges:o}=t.selection,a=n?etX(n,t.schema):null;if(i)return!!(t.storedMarks||t.selection.$from.marks()).filter(t=>!a||a.name===t.type.name).find(t=>etZ(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=>etZ(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 enE(t,n){let{nodeExtensions:r}=etd(n),i=r.find(n=>n.name===t);if(!i)return!1;let o={name:i.name,options:i.options,storage:i.storage},a=etv(etf(i,"group",o));return"string"==typeof a&&a.split(" ").includes("list")}let enj=(t,n={})=>({tr:r,state:i,dispatch:o})=>{let{selection:a}=r,{empty:u,ranges:s}=a,c=etX(t,i.schema);if(o){if(u){let l=enI(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(et2(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)},enA=(t,n)=>({tr:r})=>(r.setMeta(t,n),!0),enN=(t,n={})=>({state:r,dispatch:i,chain:o})=>{let a=eth(t,r.schema);return a.isTextblock?o().command(({commands:t})=>!!etu(a,n)(r)||t.clearNodes()).command(({state:t})=>etu(a,n)(t,i)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},enP=t=>({tr:n,dispatch:r})=>{if(r){let{doc:i}=n,o=et3(t,0,i.content.size),a=YQ.create(i,o);n.setSelection(a)}return!0},enL=t=>({tr:n,dispatch:r})=>{if(r){let{doc:i}=n,{from:o,to:a}="number"==typeof t?{from:t,to:t}:t,u=YJ.atStart(i).from,s=YJ.atEnd(i).to,c=et3(o,u,s),l=et3(a,u,s),f=YJ.create(i,c,l);n.setSelection(f)}return!0},enF=t=>({state:n,dispatch:r})=>{var i;let o=eth(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=Jv.from(l?o.create():null),d=new Jw(Jv.from(o.create(null,Jv.from(s.type.create(null,f)))),l?3:1,0),p=a.start,h=a.end;n(t.tr.step(new Y_(p-(l?3:1),h,p,h,d,1,!0)).scrollIntoView())}return!0}(n,r)};function enD(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 enW=({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=enM(l,s.node().type.name,s.node().attrs);if(a instanceof YQ&&a.node.isBlock)return!!(s.parentOffset&&YI(u,s.pos))&&(i&&(t&&enD(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 YJ&&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=YI(n.doc,n.mapping.map(s.pos),1,h);if(!h&&!m&&YI(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&&enD(r,o.extensionManager.splittableMarks),n.scrollIntoView()}return!0},enU=t=>({tr:n,state:r,dispatch:i,editor:o})=>{var a;let u=eth(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=Jv.empty,h=s.index(-1)?1:s.index(-2)?2:3;for(let m=s.depth-h;m>=s.depth-3;m-=1)p=Jv.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=enM(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(Jv.from(u.createAndFill(null,v)||void 0));let b=s.before(s.depth-(h-1));n.replace(b,s.after(-g),new Jw(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(YJ.near(n.doc.resolve(x))),n.scrollIntoView()}return!0}let _=c.pos===s.end()?f.contentMatchAt(0).defaultType:null,S=enM(d,f.type.name,f.attrs),T=enM(d,s.node().type.name,s.node().attrs);if(n.delete(s.pos,c.pos),!YI(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 C=I.filter(t=>k.includes(t.type.name));n.ensureMarks(C)}return!0},enz=(t,n)=>{let r=enk(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)&&YC(t.doc,r.pos)&&t.join(r.pos),!0},enB=(t,n)=>{let r=enk(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)&&YC(t.doc,i)&&t.join(i),!0},enV=(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=eth(t,u.schema),m=eth(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=enk(t=>enE(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(enE(S.node.type.name,d)&&h.validContent(S.node.content)&&s)return c().command(()=>(a.setNodeMarkup(S.pos,h),!0)).command(()=>enz(a,h)).command(()=>enB(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(()=>enz(a,h)).command(()=>enB(a,h)).run():c().command(()=>!!f().wrapInList(h,i)||l.clearNodes()).wrapInList(h,i).command(()=>enz(a,h)).command(()=>enB(a,h)).run()},en$=(t,n={},r={})=>({state:i,commands:o})=>{let{extendEmptyMarkRange:a=!1}=r,u=etX(t,i.schema);return enR(i,u,n)?o.unsetMark(u,{extendEmptyMarkRange:a}):o.setMark(u,n)},enq=(t,n,r={})=>({state:i,commands:o})=>{let a=eth(t,i.schema),u=eth(n,i.schema);return enc(i,a,r)?o.setNode(u):o.setNode(a,r)},enK=(t,n={})=>({state:r,commands:i})=>{let o=eth(t,r.schema);return enc(r,o,n)?i.lift(o):i.wrapIn(o,n)},enH=()=>({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},enG=()=>({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},enZ=(t,n={})=>({tr:r,state:i,dispatch:o})=>{var a;let{extendEmptyMarkRange:u=!1}=n,{selection:s}=r,c=etX(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=etQ(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},enJ=(t,n={})=>({tr:r,state:i,dispatch:o})=>{let a=null,u=null,s=enh("string"==typeof t?t:t.name,i.schema);return!!s&&("node"===s&&(a=eth(t,i.schema)),"mark"===s&&(u=etX(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)},enY=(t,n={})=>({state:r,dispatch:i})=>{let o=eth(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&&YO(u,t,n);return!!s&&(i&&i(r.tr.wrap(u,s).scrollIntoView()),!0)}})(o,n)(r,i)},enQ=(t,n={})=>({state:r,dispatch:i})=>{let o=eth(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 JP(l,l,u.depth),u.endIndex<u.parent.childCount&&(u=new JP(o,r.doc.resolve(a.end(u.depth)),u.depth)),s=!0}let f=YO(c,t,n,u);return!!f&&(i&&i((function(t,n,r,i,o){let a=Jv.empty;for(let u=r.length-1;u>=0;u--)a=Jv.from(r[u].type.create(r[u].attrs,a));t.step(new Y_(n.start-(i?2:0),n.end,n.start,n.end,new Jw(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&&YI(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 enX=Object.freeze({__proto__:null,blur:etD,clearContent:etW,clearNodes:etU,command:etz,createParagraphNear:etB,deleteCurrentNode:etV,deleteNode:et$,deleteRange:etq,deleteSelection:etK,enter:etH,exitCode:etG,extendMarkRange:et0,first:et1,focus:et9,forEach:et6,insertContent:et8,insertContentAt:enn,joinUp:enr,joinDown:eni,joinBackward:eno,joinForward:ena,keyboardShortcut:ens,lift:enl,liftEmptyBlock:enf,liftListItem:end,newlineInCode:enp,resetAttributes:eng,scrollIntoView:eny,selectAll:env,selectNodeBackward:enb,selectNodeForward:enx,selectParentNode:en_,selectTextblockEnd:enS,selectTextblockStart:enT,setContent:enO,setMark:enj,setMeta:enA,setNode:enN,setNodeSelection:enP,setTextSelection:enL,sinkListItem:enF,splitBlock:enW,splitListItem:enU,toggleList:enV,toggleMark:en$,toggleNode:enq,toggleWrap:enK,undoInputRule:enH,unsetAllMarks:enG,unsetMark:enZ,updateAttributes:enJ,wrapIn:enY,wrapInList:enQ});let en0=etN.create({name:"commands",addCommands:()=>({...enX})}),en1=etN.create({name:"editable",addProseMirrorPlugins(){return[new Qe({key:new Qr("editable"),props:{editable:()=>this.editor.options.editable}})]}}),en2=etN.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:t}=this;return[new Qe({key:new Qr("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}}}})]}}),en3=etN.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=YK.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 et5()||enu()?o:i},addProseMirrorPlugins(){return[new Qe({key:new Qr("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=YK.atStart(n.doc).from,s=YK.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=ets({state:r,transaction:c}),{commands:f}=new etc({editor:this.editor,state:l});if(f.clearNodes(),c.steps.length)return c}})]}}),en4=etN.create({name:"tabindex",addProseMirrorPlugins(){return[new Qe({key:new Qr("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var en5=Object.freeze({__proto__:null,ClipboardTextSerializer:etF,Commands:en0,Editable:en1,FocusEvents:en2,Keymap:en3,Tabindex:en4});let en9=`.ProseMirror {
|
|
17
|
-
position: relative;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.ProseMirror {
|
|
21
|
-
word-wrap: break-word;
|
|
22
|
-
white-space: pre-wrap;
|
|
23
|
-
white-space: break-spaces;
|
|
24
|
-
-webkit-font-variant-ligatures: none;
|
|
25
|
-
font-variant-ligatures: none;
|
|
26
|
-
font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.ProseMirror [contenteditable="false"] {
|
|
30
|
-
white-space: normal;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.ProseMirror [contenteditable="false"] [contenteditable="true"] {
|
|
34
|
-
white-space: pre-wrap;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.ProseMirror pre {
|
|
38
|
-
white-space: pre-wrap;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
img.ProseMirror-separator {
|
|
42
|
-
display: inline !important;
|
|
43
|
-
border: none !important;
|
|
44
|
-
margin: 0 !important;
|
|
45
|
-
width: 1px !important;
|
|
46
|
-
height: 1px !important;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.ProseMirror-gapcursor {
|
|
50
|
-
display: none;
|
|
51
|
-
pointer-events: none;
|
|
52
|
-
position: absolute;
|
|
53
|
-
margin: 0;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.ProseMirror-gapcursor:after {
|
|
57
|
-
content: "";
|
|
58
|
-
display: block;
|
|
59
|
-
position: absolute;
|
|
60
|
-
top: -2px;
|
|
61
|
-
width: 20px;
|
|
62
|
-
border-top: 1px solid black;
|
|
63
|
-
animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
@keyframes ProseMirror-cursor-blink {
|
|
67
|
-
to {
|
|
68
|
-
visibility: hidden;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.ProseMirror-hideselection *::selection {
|
|
73
|
-
background: transparent;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.ProseMirror-hideselection *::-moz-selection {
|
|
77
|
-
background: transparent;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.ProseMirror-hideselection * {
|
|
81
|
-
caret-color: transparent;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.ProseMirror-focused .ProseMirror-gapcursor {
|
|
85
|
-
display: block;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.tippy-box[data-animation=fade][data-state=hidden] {
|
|
89
|
-
opacity: 0
|
|
90
|
-
}`,en6=class extends etl{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}(en9,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=ety(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(en5):[],...this.options.extensions].filter(t=>["extension","node","mark"].includes(null==t?void 0:t.type));this.extensionManager=new etE(t,this)}createCommandManager(){this.commandManager=new etc({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){let t=enw(this.options.content,this.schema,this.options.parseOptions),n=et4(t,this.options.autofocus);this.view=new eeP(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:Y7.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 function(t,n){let r=enh("string"==typeof n?n:n.name,t.schema);return"node"===r?function(t,n){let r=eth(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?enI(t,n):{}}(this.state,t)}isActive(t,n){return function(t,n,r={}){if(!n)return enc(t,null,r)||enR(t,null,r);let i=enh(n,t.schema);return"node"===i?enc(t,n,r):"mark"===i&&enR(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=Yi.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=`
|
|
91
|
-
|
|
92
|
-
`,textSerializers:r={}}=t||{};return function(t,n){let r={from:0,to:t.content.size};return etP(t,r,n)}(this.state.doc,{blockSeparator:n,textSerializers:{...etL(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 en8(t){return new etk({find:t.find,handler({state:n,range:r,match:i}){let o=etv(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(enC(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 en7(t){return new etk({find:t.find,handler({state:n,range:r,match:i}){let o=n.doc.resolve(r.from),a=etv(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 ere(t){return new etk({find:t.find,handler({state:n,range:r,match:i,chain:o}){let a=etv(t.getAttributes,void 0,i)||{},u=n.tr.delete(r.from,r.to),s=u.doc.resolve(r.from).blockRange(),c=s&&YO(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&&YC(u.doc,r.from-1)&&(!t.joinPredicate||t.joinPredicate(i,g))&&u.join(r.from-1)}})}let ert=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=etv(etf(this,"addOptions",{name:this.name}))),this.storage=etv(etf(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(n={}){return new t(n)}configure(t={}){let n=this.extend();return n.options=etA(this.options,t),n.storage=etv(etf(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=etv(etf(r,"addOptions",{name:r.name})),r.storage=etv(etf(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 ern{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=etv(etf(this,"addOptions",{name:this.name}))),this.storage=etv(etf(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new ern(t)}configure(t={}){let n=this.extend();return n.options=etA(this.options,t),n.storage=etv(etf(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){let n=new ern(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=etv(etf(n,"addOptions",{name:n.name})),n.storage=etv(etf(n,"addStorage",{name:n.name,options:n.options})),n}}class err{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=YQ.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=YQ.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&&et5()&&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 eri(t){return new etM({find:t.find,handler({state:n,range:r,match:i}){let o=etv(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(enC(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 ero=function(){};ero.prototype.append=function(t){return t.length?(t=ero.from(t),!this.length&&t||t.length<200&&this.leafAppend(t)||this.length<200&&t.leafPrepend(this)||this.appendInner(t)):this},ero.prototype.prepend=function(t){return t.length?ero.from(t).append(this):this},ero.prototype.appendInner=function(t){return new eru(this,t)},ero.prototype.slice=function(t,n){return void 0===t&&(t=0),void 0===n&&(n=this.length),t>=n?ero.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))},ero.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},ero.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)},ero.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},ero.from=function(t){return t instanceof ero?t:t&&t.length?new era(t):ero.empty};var era=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}(ero);ero.empty=new era([]);var eru=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}(ero);class ers{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 erc(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 erc(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 ers(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 erc(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>erf&&(o=c,a=m,c=(o.forEach((t,n)=>{if(t.selection&&0==a--)return g=n,!1}),o.slice(g)),s-=m),new ers(c.append(u),s)}remapping(t,n){let r=new Yf;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 ers(this.items.append(t.map(t=>new erc(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 erc(c,l,f))}else r.push(new erc(c))},i);let c=[];for(let l=n;l<a;l++)c.push(new erc(o.maps[l]));let f=this.items.slice(0,i).append(c).append(r),d=new ers(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 erc(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 ers(ero.from(i.reverse()),o)}}ers.empty=new ers(ero.empty,0);class erc{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 erc(n.getMap().invert(),n,this.selection)}}}class erl{constructor(t,n,r,i,o){this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}let erf=20;function erd(t){let n=[];return t.forEach((t,r,i,o)=>n.push(i,o)),n}function erp(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 erh(t,n,r,i){let o=ery(n),a=erv.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 erl(i?c:u.remaining,i?u.remaining:c,null,0,-1);r(u.transform.setSelection(s).setMeta(erv,{redo:i,historyState:l}).scrollIntoView())}let erm=!1,erg=null;function ery(t){let n=t.plugins;if(erg!=n){erm=!1,erg=n;for(let r=0;r<n.length;r++)if(n[r].spec.historyPreserveItems){erm=!0;break}}return erm}let erv=new Qr("history"),erb=new Qr("closeHistory"),erx=(t,n)=>{let r=erv.getState(t);return!!r&&0!=r.done.eventCount&&(n&&erh(r,t,n,!1),!0)},er_=(t,n)=>{let r=erv.getState(t);return!!r&&0!=r.undone.eventCount&&(n&&erh(r,t,n,!0),!0)},erS=etN.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:t,dispatch:n})=>erx(t,n),redo:()=>({state:t,dispatch:n})=>er_(t,n)}),addProseMirrorPlugins(){return[function(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Qe({key:erv,state:{init:()=>new erl(ers.empty,ers.empty,null,0,-1),apply:(n,r,i)=>(function(t,n,r,i){let o=r.getMeta(erv),a;if(o)return o.historyState;r.getMeta(erb)&&(t=new erl(t.done,t.undone,null,0,-1));let u=r.getMeta("appendedTransaction");if(0==r.steps.length)return t;if(u&&u.getMeta(erv))return u.getMeta(erv).redo?new erl(t.done.addTransform(r,void 0,i,ery(n)),t.undone,erd(r.mapping.maps[r.steps.length-1]),t.prevTime,t.prevComposition):new erl(t.done,t.undone.addTransform(r,void 0,i,ery(n)),null,t.prevTime,t.prevComposition);if(!1===r.getMeta("addToHistory")||u&&!1===u.getMeta("addToHistory"))return(a=r.getMeta("rebased"))?new erl(t.done.rebased(r,a),t.undone.rebased(r,a),erp(t.prevRanges,r.mapping),t.prevTime,t.prevComposition):new erl(t.done.addMaps(r.mapping.maps),t.undone.addMaps(r.mapping.maps),erp(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?erp(t.prevRanges,r.mapping):erd(r.mapping.maps[r.steps.length-1]);return new erl(t.done.addTransform(r,c?n.selection.getBookmark():void 0,i,ery(n)),ers.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?erx:"historyRedo"==r?er_: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 erT="bottom",erw="right",erO="left",erk="auto",erI=["top",erT,erw,erO],erC="start",erM="viewport",erR="popper",erE=erI.reduce(function(t,n){return t.concat([n+"-"+erC,n+"-end"])},[]),erj=[].concat(erI,[erk]).reduce(function(t,n){return t.concat([n,n+"-"+erC,n+"-end"])},[]),erA=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function erN(t){return t?(t.nodeName||"").toLowerCase():null}function erP(t){if(null==t)return window;if("[object Window]"!==t.toString()){var n=t.ownerDocument;return n&&n.defaultView||window}return t}function erL(t){var n=erP(t).Element;return t instanceof n||t instanceof Element}function erF(t){var n=erP(t).HTMLElement;return t instanceof n||t instanceof HTMLElement}function erD(t){if(typeof ShadowRoot>"u")return!1;var n=erP(t).ShadowRoot;return t instanceof n||t instanceof ShadowRoot}let erW={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];erF(o)&&erN(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},{});erF(i)&&erN(i)&&(Object.assign(i.style,a),Object.keys(o).forEach(function(t){i.removeAttribute(t)}))})}},requires:["computeStyles"]};function erU(t){return t.split("-")[0]}var erz=Math.max,erB=Math.min,erV=Math.round;function er$(){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 erq(){return!/^((?!chrome|android).)*safari/i.test(er$())}function erK(t,n,r){void 0===n&&(n=!1),void 0===r&&(r=!1);var i=t.getBoundingClientRect(),o=1,a=1;n&&erF(t)&&(o=t.offsetWidth>0&&erV(i.width)/t.offsetWidth||1,a=t.offsetHeight>0&&erV(i.height)/t.offsetHeight||1);var u=(erL(t)?erP(t):window).visualViewport,s=!erq()&&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 erH(t){var n=erK(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 erG(t,n){var r=n.getRootNode&&n.getRootNode();if(t.contains(n))return!0;if(r&&erD(r)){var i=n;do{if(i&&t.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function erZ(t){return erP(t).getComputedStyle(t)}function erJ(t){return["table","td","th"].indexOf(erN(t))>=0}function erY(t){return((erL(t)?t.ownerDocument:t.document)||window.document).documentElement}function erQ(t){return"html"===erN(t)?t:t.assignedSlot||t.parentNode||(erD(t)?t.host:null)||erY(t)}function erX(t){return erF(t)&&"fixed"!==erZ(t).position?t.offsetParent:null}function er0(t){for(var n=erP(t),r=erX(t);r&&erJ(r)&&"static"===erZ(r).position;)r=erX(r);return r&&("html"===erN(r)||"body"===erN(r)&&"static"===erZ(r).position)?n:r||function(t){var n=/firefox/i.test(er$());if(/Trident/i.test(er$())&&erF(t)&&"fixed"===erZ(t).position)return null;var r=erQ(t);for(erD(r)&&(r=r.host);erF(r)&&0>["html","body"].indexOf(erN(r));){var i=erZ(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 er1(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function er2(t,n,r){return erz(t,erB(n,r))}function er3(){return{top:0,right:0,bottom:0,left:0}}function er4(t){return Object.assign({},er3(),t)}function er5(t,n){return n.reduce(function(n,r){return n[r]=t,n},{})}function er9(t){return t.split("-")[1]}var er6={top:"auto",right:"auto",bottom:"auto",left:"auto"};function er8(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"),_=erO,S="top",T=window;if(f){var w=er0(i),O="clientHeight",k="clientWidth";w===erP(i)&&(w=erY(i),"static"!==erZ(w).position&&"absolute"===c&&(O="scrollHeight",k="scrollWidth")),("top"===a||(a===erO||a===erw)&&"end"===u)&&(S=erT,y-=(p&&w===T&&T.visualViewport?T.visualViewport.height:w[O])-o.height,y*=l?1:-1),(a===erO||("top"===a||a===erT)&&"end"===u)&&(_=erw,m-=(p&&w===T&&T.visualViewport?T.visualViewport.width:w[k])-o.width,m*=l?1:-1)}var I,C,M,R,E,j=Object.assign({position:c},f&&er6),A=!0===d?(I={x:m,y:y},C=erP(i),M=I.x,R=I.y,{x:erV(M*(E=C.devicePixelRatio||1))/E||0,y:erV(R*E)/E||0}):{x:m,y:y};return(m=A.x,y=A.y,l)?Object.assign({},j,((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({},j,((r={})[S]=x?y+"px":"",r[_]=b?m+"px":"",r.transform="",r))}var er7={passive:!0},eie={left:"right",right:"left",bottom:"top",top:"bottom"};function eit(t){return t.replace(/left|right|bottom|top/g,function(t){return eie[t]})}var ein={start:"end",end:"start"};function eir(t){return t.replace(/start|end/g,function(t){return ein[t]})}function eii(t){var n,r=erP(t);return{scrollLeft:r.pageXOffset,scrollTop:r.pageYOffset}}function eio(t){return erK(erY(t)).left+eii(t).scrollLeft}function eia(t){var n=erZ(t),r=n.overflow,i=n.overflowX,o=n.overflowY;return/auto|scroll|overlay|hidden/.test(r+o+i)}function eiu(t,n){void 0===n&&(n=[]);var r,i=function t(n){return["html","body","#document"].indexOf(erN(n))>=0?n.ownerDocument.body:erF(n)&&eia(n)?n:t(erQ(n))}(t),o=i===(null==(r=t.ownerDocument)?void 0:r.body),a=erP(i),u=o?[a].concat(a.visualViewport||[],eia(i)?i:[]):i,s=n.concat(u);return o?s:s.concat(eiu(erQ(u)))}function eis(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function eic(t,n,r){var i,o,a,u,s,c,l,f,d,p,h,m;return n===erM?eis(function(t,n){var r=erP(t),i=erY(t),o=r.visualViewport,a=i.clientWidth,u=i.clientHeight,s=0,c=0;if(o){a=o.width,u=o.height;var l=erq();(l||!l&&"fixed"===n)&&(s=o.offsetLeft,c=o.offsetTop)}return{width:a,height:u,x:s+eio(t),y:c}}(t,r)):erL(n)?((a=erK(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):eis((u=erY(t),c=erY(u),l=eii(u),f=null==(s=u.ownerDocument)?void 0:s.body,d=erz(c.scrollWidth,c.clientWidth,f?f.scrollWidth:0,f?f.clientWidth:0),p=erz(c.scrollHeight,c.clientHeight,f?f.scrollHeight:0,f?f.clientHeight:0),h=-l.scrollLeft+eio(u),m=-l.scrollTop,"rtl"===erZ(f||c).direction&&(h+=erz(c.clientWidth,f?f.clientWidth:0)-d),{width:d,height:p,x:h,y:m}))}function eil(t){var n,r=t.reference,i=t.element,o=t.placement,a=o?erU(o):null,u=o?er9(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 erT:n={x:s,y:r.y+r.height};break;case erw:n={x:r.x+r.width,y:c};break;case erO:n={x:r.x-i.width,y:c};break;default:n={x:r.x,y:r.y}}var l=a?er1(a):null;if(null!=l){var f="y"===l?"height":"width";switch(u){case erC: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 eif(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?erR:x,S=p.altBoundary,T=p.padding,w=void 0===T?0:T,O=er4("number"!=typeof w?w:er5(w,erI)),k=t.rects.popper,I=t.elements[void 0!==S&&S?_===erR?"reference":erR:_],C=(r=erL(I)?I:I.contextElement||erY(t.elements.popper),f=(l=[].concat("clippingParents"===(i=void 0===v?"clippingParents":v)?(s=eiu(erQ(r)),c=["absolute","fixed"].indexOf(erZ(r).position)>=0&&erF(r)?er0(r):r,erL(c)?s.filter(function(t){return erL(t)&&erG(t,c)&&"body"!==erN(t)}):[]):[].concat(i),[void 0===b?erM:b]))[0],(d=l.reduce(function(t,n){var i=eic(r,n,y);return t.top=erz(i.top,t.top),t.right=erB(i.right,t.right),t.bottom=erB(i.bottom,t.bottom),t.left=erz(i.left,t.left),t},eic(r,f,y))).width=d.right-d.left,d.height=d.bottom-d.top,d.x=d.left,d.y=d.top,d),M=erK(t.elements.reference),R=eil({reference:M,element:k,strategy:"absolute",placement:m}),E=eis(Object.assign({},k,R)),j=_===erR?E:M,A={top:C.top-j.top+O.top,bottom:j.bottom-C.bottom+O.bottom,left:C.left-j.left+O.left,right:j.right-C.right+O.right},N=t.modifiersData.offset;if(_===erR&&N){var P=N[m];Object.keys(A).forEach(function(t){var n=[erw,erT].indexOf(t)>=0?1:-1,r=["top",erT].indexOf(t)>=0?"y":"x";A[t]+=P[r]*n})}return A}function eid(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 eip(t){return["top",erw,erT,erO].some(function(n){return t[n]>=0})}var eih={placement:"bottom",modifiers:[],strategy:"absolute"};function eim(){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 eig,eiy,eiv,eib,eix,ei_,eiS,eiT,eiw,eiO,eik=(eix={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=erP(n.elements.popper),l=[].concat(n.scrollParents.reference,n.scrollParents.popper);return a&&l.forEach(function(t){t.addEventListener("scroll",r.update,er7)}),s&&c.addEventListener("resize",r.update,er7),function(){a&&l.forEach(function(t){t.removeEventListener("scroll",r.update,er7)}),s&&c.removeEventListener("resize",r.update,er7)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var n=t.state,r=t.name;n.modifiersData[r]=eil({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:erU(n.placement),variation:er9(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,er8(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,er8(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:{}},erW,{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=erj.reduce(function(t,r){var i,o,u,s,c,l,f,d;return t[r]=(o=n.rects,c=[erO,"top"].indexOf(s=erU(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,[erO,erw].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=erU(y),b=c||(v!==y&&m?function(t){if(erU(t)===erk)return[];var n=eit(t);return[eir(t),n,eir(n)]}(y):[eit(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(erU(r)===erk?(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)?erj:y,0===(_=(x=(b=er9(u))?h?erE:erE.filter(function(t){return er9(t)===b}):erI).filter(function(t){return v.indexOf(t)>=0})).length&&(_=x),Object.keys(S=_.reduce(function(t,r){return t[r]=eif(n,{placement:r,boundary:s,rootBoundary:c,padding:p})[erU(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],C=erU(I),M=er9(I)===erC,R=["top",erT].indexOf(C)>=0,E=R?"width":"height",j=eif(n,{placement:I,boundary:f,rootBoundary:d,altBoundary:p,padding:l}),A=R?M?erw:erO:M?erT:"top";_[E]>S[E]&&(A=eit(A));var N=eit(A),P=[];if(a&&P.push(j[C]<=0),s&&P.push(j[A]<=0,j[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=eif(r,{boundary:s,rootBoundary:c,padding:f,altBoundary:l}),y=erU(r.placement),v=er9(r.placement),b=!v,x=er1(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,C={x:0,y:0};if(S){if(void 0===a||a){var M,R="y"===x?"top":erO,E="y"===x?erT:erw,j="y"===x?"height":"width",A=S[x],N=A+g[R],P=A-g[E],L=p?-w[j]/2:0,F=v===erC?T[j]:w[j],D=v===erC?-w[j]:-T[j],W=r.elements.arrow,U=p&&W?erH(W):{width:0,height:0},z=r.modifiersData["arrow#persistent"]?r.modifiersData["arrow#persistent"].padding:er3(),B=z[R],V=z[E],$=er2(0,T[j],U[j]),q=b?T[j]/2-L-$-B-k.mainAxis:F-$-B-k.mainAxis,K=b?-T[j]/2+L+$+V+k.mainAxis:D+$+V+k.mainAxis,H=r.elements.arrow&&er0(r.elements.arrow),G=H?"y"===x?H.clientTop||0:H.clientLeft||0:0,Z=null!=(M=null==I?void 0:I[x])?M:0,J=er2(p?erB(N,A+q-Z-G):N,A,p?erz(P,A+K-Z):P);S[x]=J,C[x]=J-A}if(void 0!==u&&u){var Y,Q,X,ee,et,en=S[_],er="y"===_?"height":"width",ei=en+g["x"===x?"top":erO],eo=en-g["x"===x?erT:erw],ea=-1!==["top",erO].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=er2(es,en,ec))>ec?ec:ee:er2(p?es:ei,en,p?ec:eo);S[_]=el,C[_]=el-en}r.modifiersData[o]=C}},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=erU(r.placement),c=er1(s),l=[erO,erw].indexOf(s)>=0?"height":"width";if(!(!a||!u)){var f,d,p=er4("number"!=typeof(f="function"==typeof(f=o.padding)?f(Object.assign({},r.rects,{placement:r.placement})):f)?f:er5(f,erI)),h=erH(a),m=r.rects.reference[l]+r.rects.reference[c]-u[c]-r.rects.popper[l],g=u[c]-r.rects.reference[c],y=er0(a),v=y?"y"===c?y.clientHeight||0:y.clientWidth||0:0,b=p["y"===c?"top":erO],x=v-h[l]-p["y"===c?erT:erw],_=v/2-h[l]/2+(m/2-g/2),S=er2(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)))&&erG(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=eif(n,{elementContext:"reference"}),s=eif(n,{altBoundary:!0}),c=eid(u,i),l=eid(s,o,a),f=eip(c),d=eip(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})}}]},eiT=void 0===(eiS=(ei_=eix).defaultModifiers)?[]:eiS,eiO=void 0===(eiw=ei_.defaultOptions)?eih:eiw,function(t,n,r){void 0===r&&(r=eiO);var i,o,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},eih,eiO),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({},eiO,a.options,g),a.scrollParents={reference:erL(t)?eiu(t):t.contextElement?eiu(t.contextElement):[],popper:eiu(n)};var y=(s=Object.keys(o=(i=[].concat(eiT,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)}),erA.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(eim(x,_)){a.rects={reference:(t=x,n=er0(_),r="fixed"===a.options.strategy,f=erF(n),d=erF(n)&&(u=erV((o=(i=n).getBoundingClientRect()).width)/i.offsetWidth||1,l=erV(o.height)/i.offsetHeight||1,1!==u||1!==l),p=erY(n),h=erK(t,d,r),m={scrollLeft:0,scrollTop:0},g={x:0,y:0},(f||!f&&!r)&&(("body"!==erN(n)||eia(p))&&(m=(y=n)!==erP(y)&&erF(y)?{scrollLeft:(v=y).scrollLeft,scrollTop:v.scrollTop}:eii(y)),erF(n)?(g=erK(n,!0),g.x+=n.clientLeft,g.y+=n.clientTop):p&&(g.x=eio(p))),{x:h.left+m.scrollLeft-g.x,y:h.top+m.scrollTop-g.y,width:h.width,height:h.height}),popper:erH(_)},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(!eim(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}),eiI="tippy-content",eiC="tippy-arrow",eiM="tippy-svg-arrow",eiR={passive:!0,capture:!0},eiE=function(){return document.body};function eij(t,n,r){return Array.isArray(t)?t[n]??(Array.isArray(r)?r[n]:r):t}function eiA(t,n){var r=({}).toString.call(t);return 0===r.indexOf("[object")&&r.indexOf(n+"]")>-1}function eiN(t,n){return"function"==typeof t?t.apply(void 0,n):t}function eiP(t,n){var r;return 0===n?t:function(i){clearTimeout(r),r=setTimeout(function(){t(i)},n)}}function eiL(t){return[].concat(t)}function eiF(t,n){-1===t.indexOf(n)&&t.push(n)}function eiD(t){return[].slice.call(t)}function eiW(t){return Object.keys(t).reduce(function(n,r){return void 0!==t[r]&&(n[r]=t[r]),n},{})}function eiU(){return document.createElement("div")}function eiz(t){return["Element","Fragment"].some(function(n){return eiA(t,n)})}function eiB(t,n){t.forEach(function(t){t&&(t.style.transitionDuration=n+"ms")})}function eiV(t,n){t.forEach(function(t){t&&t.setAttribute("data-state",n)})}function ei$(t,n,r){var i=n+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(n){t[i](n,r)})}function eiq(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 eiK={isTouch:!1},eiH=0;function eiG(){eiK.isTouch||(eiK.isTouch=!0,window.performance&&document.addEventListener("mousemove",eiZ))}function eiZ(){var t=performance.now();t-eiH<20&&(eiK.isTouch=!1,document.removeEventListener("mousemove",eiZ)),eiH=t}function eiJ(){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 eiY=!!("u">typeof window&&"u">typeof document)&&!!window.msCrypto,eiQ=Object.assign({appendTo:eiE,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}),eiX=Object.keys(eiQ),ei0=function(t){Object.keys(t).forEach(function(n){eiQ[n]=t[n]})};function ei1(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=eiQ[o])?i:a),n},{});return Object.assign({},t,n)}function ei2(t,n){var r,i,o=Object.assign({},n,{content:eiN(n.content,[t])},n.ignoreAttributes?{}:((i=n.plugins)?Object.keys(ei1(Object.assign({},eiQ,{plugins:i}))):eiX).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({},eiQ.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 ei3=function(){return"innerHTML"};function ei4(t,n){t[ei3()]=n}function ei5(t){var n=eiU();return!0===t?n.className=eiC:(n.className=eiM,eiz(t)?n.appendChild(t):ei4(n,t)),n}function ei9(t,n){eiz(n.content)?(ei4(t,""),t.appendChild(n.content)):"function"!=typeof n.content&&(n.allowHTML?ei4(t,n.content):t.textContent=n.content)}function ei6(t){var n=t.firstElementChild,r=eiD(n.children);return{box:n,content:r.find(function(t){return t.classList.contains(eiI)}),arrow:r.find(function(t){return t.classList.contains(eiC)||t.classList.contains(eiM)}),backdrop:r.find(function(t){return t.classList.contains("tippy-backdrop")})}}function ei8(t){var n=eiU(),r=eiU();r.className="tippy-box",r.setAttribute("data-state","hidden"),r.setAttribute("tabindex","-1");var i=eiU();function o(r,i){var o=ei6(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)&&ei9(u,t.props),i.arrow?s?r.arrow!==i.arrow&&(a.removeChild(s),a.appendChild(ei5(i.arrow))):a.appendChild(ei5(i.arrow)):s&&a.removeChild(s)}return i.className=eiI,i.setAttribute("data-state","hidden"),ei9(i,t.props),n.appendChild(r),r.appendChild(i),o(t.props,t.props),{popper:n,onUpdate:o}}ei8.$$tippy=!0;var ei7=1,eoe=[],eot=[];function eon(t,n){void 0===n&&(n={});var r,i,o=eiQ.plugins.concat(n.plugins||[]);document.addEventListener("touchstart",eiG,eiR),window.addEventListener("blur",eiJ);var a,u=Object.assign({},n,{plugins:o}),s=(eiz(t)?[t]:eiA(t,"NodeList")?eiD(t):Array.isArray(t)?t:eiD(document.querySelectorAll(t))).reduce(function(t,n){var r=n&&function(t,n){var r,i,o,a,u,s,c,l,f=ei2(t,Object.assign({},eiQ,ei1(eiW(n)))),d=!1,p=!1,h=!1,m=!1,g=[],y=eiP(G,f.interactiveDebounce),v=ei7++,b=(r=f.plugins).filter(function(t,n){return r.indexOf(t)===n}),x={id:v,reference:t,popper:eiU(),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=ei2(t,Object.assign({},r,eiW(n),{ignoreAttributes:!0}));x.props=i,q(),r.interactiveDebounce!==i.interactiveDebounce&&(F(),y=eiP(G,i.interactiveDebounce)),r.triggerTarget&&!i.triggerTarget?eiL(r.triggerTarget).forEach(function(t){t.removeAttribute("aria-expanded")}):i.triggerTarget&&t.removeAttribute("aria-expanded"),L(),A(),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=eiK.isTouch&&!x.props.touch,o=eij(x.props.duration,0,eiQ.duration);if(!(t||n||r||i)&&!M().hasAttribute("disabled")&&(N("onShow",[x],!1),!1!==x.props.onShow(x))){if(x.state.isVisible=!0,C()&&(S.style.visibility="visible"),A(),z(),x.state.isMounted||(S.style.transition="none"),C()){var a,u,s,l,f=E();eiB([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,C()&&x.props.animation){var n,r,i=E(),a=i.box,u=i.content;eiB([a,u],o),eiV([a,u],"visible")}P(),L(),eiF(eot,x),null==(t=x.popperInstance)||t.forceUpdate(),N("onMount",[x]),x.props.animation&&C()&&V(o,r=function(){x.state.isShown=!0,N("onShown",[x])})}},u=x.props.appendTo,s=M(),(a=x.props.interactive&&u===eiE||"parent"===u?s.parentNode:eiN(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=eij(x.props.duration,1,eiQ.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,C()&&(S.style.visibility="hidden"),F(),B(),A(!0),C()){var o,a,u=E(),s=u.box,c=u.content;x.props.animation&&(eiB([s,c],i),eiV([s,c],"hidden"))}P(),L(),x.props.animation?C()&&(a=x.unmount,V(i,function(){!x.state.isVisible&&S.parentNode&&S.parentNode.contains(S)&&a()})):x.unmount()}},hideWithInteractivity:function(t){R().addEventListener("mousemove",y),eiF(eoe,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),eot=eot.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 q(),L(),A(),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 C(){var t;return!!(null!=(t=x.props.render)&&t.$$tippy)}function M(){return l||t}function R(){var t,n,r,i=M().parentNode;return i&&null!=(r=eiL(i)[0])&&null!=(n=r.ownerDocument)&&n.body?r.ownerDocument:document}function E(){return ei6(S)}function j(t){return x.state.isMounted&&!x.state.isVisible||eiK.isTouch||u&&"focus"===u.type?0:eij(x.props.delay,t?0:1,eiQ.delay)}function A(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;eiL(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)&&eiL(x.props.triggerTarget||t).forEach(function(t){x.props.interactive?t.setAttribute("aria-expanded",x.state.isVisible&&t===M()?"true":"false"):t.removeAttribute("aria-expanded")})}function F(){R().removeEventListener("mousemove",y),eoe=eoe.filter(function(t){return t!==y})}function D(n){if(!(eiK.isTouch&&(h||"mousedown"===n.type))){var r=n.composedPath&&n.composedPath()[0]||n.target;if(!(x.props.interactive&&eiq(S,r))){if(eiL(x.props.triggerTarget||t).some(function(t){return eiq(t,r)})){if(eiK.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,eiR),t.addEventListener("touchstart",U,eiR),t.addEventListener("touchmove",W,eiR)}function B(){var t=R();t.removeEventListener("mousedown",D,!0),t.removeEventListener("touchend",D,eiR),t.removeEventListener("touchstart",U,eiR),t.removeEventListener("touchmove",W,eiR)}function V(t,n){var r=E().box;function i(t){t.target===r&&(ei$(r,"remove",i),n())}if(0===t)return n();ei$(r,"remove",s),ei$(r,"add",i),s=i}function $(n,r,i){void 0===i&&(i=!1),eiL(x.props.triggerTarget||t).forEach(function(t){t.addEventListener(n,r,i),g.push({node:t,eventType:n,handler:r,options:i})})}function q(){var t;I()&&($("touchstart",H,{passive:!0}),$("touchend",Z,{passive:!0})),(t=x.props.trigger).split(/\s+/).filter(Boolean).forEach(function(t){if("manual"!==t)switch($(t,H),t){case"mouseenter":$("mouseleave",Z);break;case"focus":$(eiY?"focusout":"blur",J);break;case"focusin":$("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&&eiA(t,"MouseEvent")&&eoe.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 G(t){var n,r,i,o,a=t.target,u=M().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 Z(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!==M()||x.props.interactive&&t.relatedTarget&&S.contains(t.relatedTarget)||en(t)}function Y(t){return!!eiK.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=C()?ei6(S).arrow:null,l=a?{getBoundingClientRect:a,contextElement:a.contextElement||M()}: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(C()){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={}}}}];C()&&s&&f.push({name:"arrow",options:{element:s,padding:3}}),f.push.apply(f,(null==r?void 0:r.modifiers)||[]),x.popperInstance=eik(l,S,Object.assign({},r,{placement:i,onFirstUpdate:c,modifiers:f}))}function X(){x.popperInstance&&(x.popperInstance.destroy(),x.popperInstance=null)}function ee(){return eiD(S.querySelectorAll("[data-tippy-root]"))}function et(t){x.clearDelayTimeouts(),t&&N("onTrigger",[x,t]),z();var n=j(!0),r=k(),o=r[0],a=r[1];eiK.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=j(!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 eiz(t)?s[0]:s}eon.defaultProps=eiQ,eon.setDefaultProps=ei0,eon.currentInput=eiK,Object.assign({},erW,{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)}}),eon.setDefaultProps({render:ei8});class eor{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&&et2(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 YQ){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=et3(n,0,i),a=et3(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=eon(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 eoi=t=>new Qe({key:"string"==typeof t.pluginKey?new Qr(t.pluginKey):t.pluginKey,view:n=>new eor({view:n,...t})});etN.create({name:"bubbleMenu",addOptions:()=>({element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}),addProseMirrorPlugins(){return this.options.element?[eoi({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});let eoo=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=eoi({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 eoa extends en6{constructor(){super(...arguments),this.contentComponent=null}}let eou=({renderers:t})=>c.createElement(c.Fragment,null,Object.entries(t).map(([t,n])=>b.createPortal(n.reactElement,n.element,t)));class eos 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(eou,{renderers:this.state.renderers}))}}let eoc=c.memo(eos),eol=(0,c.createContext)({onDragStart:void 0}),eof=()=>(0,c.useContext)(eol),eod=c.forwardRef((t,n)=>{let{onDragStart:r}=eof(),i=t.as||"div";return c.createElement(i,{...t,ref:n,"data-node-view-wrapper":"",onDragStart:r,style:{whiteSpace:"normal",...t.style}})});class eop{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 eoh extends err{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(eol.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 eop(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 eom(t,n){return r=>r.editor.contentComponent?new eoh(t,r,n):{}}let eog=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,eoy=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,eov=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,eob=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,eox=ert.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",etm(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[en8({find:eog,type:this.type}),en8({find:eov,type:this.type})]},addPasteRules(){return[eri({find:eoy,type:this.type}),eri({find:eob,type:this.type})]}});var eo_,eoS,eoT=((eo_=eoT||{}).Document="document",eo_.Mark="mark",eo_.Node="node",eo_),eow=((eoS=eow||{}).Text="text",eoS.Embed="embed",eoS.Image="image",eoS);class eoO{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 eok(t){return t instanceof eoO}class eoI extends eoO{constructor(t,n,r,i,o){super(t,"heading",n,i,o),this.levels=r}}class eoC extends eoO{constructor(t,n,r,i){super(t,n,r,i)}}function eoM(t){return t instanceof eoC}let eoR=ern.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:t}){return["br",etm(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()}}}),eoE={isHardBreak:t=>t.type.name===eoR.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 eoj(){return{extensions:esw(),defaultTextConverter:void 0}}let eoA=eox.extend({name:"bold"}),eoN=new class{constructor(t,n,r){w(this,"extType",eoT.Mark),w(this,"richTextNodeTypes",Vs.RichTextNodeType.strong),this.name=t,this.component=n,this.converter=r}}(eoA.name,eoA,{fromPrismic:t=>function(){var n;return null==(n=t.marks[eoA.name])?void 0:n.create()},toPrismic(){}}),eoP=ern.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",etm(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=ert.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:t=>!!t.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:t}){return["span",etm(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:n})=>{let r=enI(t,this.type);return!!Object.entries(r).some(([,t])=>!!t)||n.unsetMark(this.name)}}}}),eoF=/^\s*([-+*])\s$/,eoD=ern.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",etm(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(eoP.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=ere({find:eoF,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=ere({find:eoF,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(eoL.name),editor:this.editor})),[t]}}),eoW=ern.create({name:"doc",topNode:!0,content:"block+"}),eoU=ern.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",etm(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)}}}),eoz=eoU.extend({name:"listItem",content:"paragraph*",addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name)}}}),eoB={component:eoz,converter:{fromPrismic:t=>function(n){var r;let i=euz.converter.fromPrismic(t)(n);if(i)return null==(r=t.nodes[eoz.name])?void 0:r.create({},i)},toPrismic:(t,n)=>eoE.children.reduce(t,(t,r)=>{let i=euz.converter.toPrismic(r),o=i instanceof Array?i.map(t=>({...t,type:n})):i?[{...i,type:n}]:[];return[...t,...o]},[])},placeholder:"List"},eoV="document",eo$=t=>eoW.extend({name:eoV,content:t?"block+":"block"}),eoq=t=>({fromPrismic(n,r){function i(t,n){return!n&&r&&oA.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=function(t){let{ext:n,block:r,schema:i}=t;if(n)switch(n.nodeType){case eow.Embed:return oA.EmbedBlock.is(r)?n.converter.fromPrismic(i)(r):void 0;case eow.Text:return oA.TextBlock.is(r)?n.converter.fromPrismic(i)(r):void 0;case eow.Image:return oA.ImageBlock.is(r)?n.converter.fromPrismic(i)(r):void 0;default:return}}({ext:a,block:o,schema:n}),s=r.slice(0,r.length-1),c=r.at(-1),l=function(t){var n,r;let{node:i,block:o,nodeWithDefault:a,previousNode:u}=t;return i&&u?i.type.name===u.type.name&&(i.type.name===euJ.name||i.type.name===esS.name)?{merged:!0,updatedNode:u.copy(u.content.append(i.content))}:{merged:!1,updatedNode:a(o,i)}:{merged:!1,updatedNode:i}}({node:u,block:o,nodeWithDefault:i,previousNode:c});return l.updatedNode?[...l.merged?s:r,l.updatedNode]:r},[]);return null==(o=n.nodes[eoV])?void 0:o.create({},a)}},toPrismic:n=>({__TYPE__:"StructuredTextContent",value:[...eoE.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},[])]})}),eoK=new class{constructor(t,n,r){w(this,"extType","document"),this.name=t,this.component=n,this.converter=r}}(eoV,eo$,eoq),eoH=eoR.extend({name:"hard_break"}),eoG=`
|
|
94
|
-
`,eoZ={fromPrismic:t=>function(n){var r;if(n===eoG)return null==(r=t.nodes[eoH.name])?void 0:r.create({})},toPrismic(t){if(t.type.name===eoH.name)return eoG}},eoJ={isEmptyLine:t=>0===t.length,isFirst:t=>0===t},eoY={name:eoH.name,component:eoH,converter:eoZ,splitTextToNodes:function(t,n){return function(r){let i=eoZ.fromPrismic(t)(eoG);if(!i)return[r(n)];let o=n.split(eoG);return 1===o.length?n.length?[r(n)]:[i]:o.reduce((t,n,o)=>eoJ.isFirst(o)?eoJ.isEmptyLine(n)?t:[...t,r(n)]:eoJ.isEmptyLine(n)?[...t,i]:[...t,i,r(n)],[])}}},eoQ=etN.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){return[new Qe({key:new Qr("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=eef.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}),eeh.create(t,o)}}})]}}),eoX=t=>eoQ.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=!eoE.children.exists(i.state.doc,t=>t===a),f=i.isEditable,d=i.isFocused&&o,p=a.type.name!==euz.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 eo0(t){return t.split("-")[1]}function eo1(t){return"y"===t?"height":"width"}function eo2(t){return t.split("-")[0]}function eo3(t){return["top","bottom"].includes(eo2(t))?"x":"y"}function eo4(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=eo3(n),c=eo1(s),l=i[c]/2-o[c]/2,f=eo2(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(eo0(n)){case"start":p[s]-=l*(r&&d?-1:1);break;case"end":p[s]+=l*(r&&d?-1:1)}return p}let eo5=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}=eo4(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}=eo4(l,p,c)),g=-1;continue}}return{x:f,y:d,placement:p,strategy:o,middlewareData:h}};function eo9(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}async function eo6(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=eo9(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=eo9(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 eo8=Math.min,eo7=Math.max;function eae(t,n,r){return eo7(t,eo8(n,r))}let eat={left:"right",right:"left",bottom:"top",top:"bottom"};function ean(t){return t.replace(/left|right|bottom|top/g,t=>eat[t])}let ear={start:"end",end:"start"};function eai(t){return t.replace(/start|end/g,t=>ear[t])}async function eao(t,n){let{placement:r,platform:i,elements:o}=t,a=await (null==i.isRTL?void 0:i.isRTL(o.floating)),u=eo2(r),s=eo0(r),c="x"===eo3(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 eaa(t){return"x"===t?"y":"x"}function eau(t){var n;return(null==(n=t.ownerDocument)?void 0:n.defaultView)||window}function eas(t){return eau(t).getComputedStyle(t)}let eac=Math.min,eal=Math.max,eaf=Math.round;function ead(t){let n=eas(t),r=parseFloat(n.width),i=parseFloat(n.height),o=t.offsetWidth,a=t.offsetHeight,u=eaf(r)!==o||eaf(i)!==a;return u&&(r=o,i=a),{width:r,height:i,fallback:u}}function eap(t){return eav(t)?(t.nodeName||"").toLowerCase():""}let eah;function eam(){if(eah)return eah;let t=navigator.userAgentData;return t&&Array.isArray(t.brands)?eah=t.brands.map(t=>t.brand+"/"+t.version).join(" "):navigator.userAgent}function eag(t){return t instanceof eau(t).HTMLElement}function eay(t){return t instanceof eau(t).Element}function eav(t){return t instanceof eau(t).Node}function eab(t){if(typeof ShadowRoot>"u")return!1;let n=eau(t).ShadowRoot;return t instanceof n||t instanceof ShadowRoot}function eax(t){let{overflow:n,overflowX:r,overflowY:i,display:o}=eas(t);return/auto|scroll|overlay|hidden|clip/.test(n+i+r)&&!["inline","contents"].includes(o)}function ea_(t){return["table","td","th"].includes(eap(t))}function eaS(t){let n=/firefox/i.test(eam()),r=eas(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 eaT(){return/^((?!chrome|android).)*safari/i.test(eam())}function eaw(t){return["html","body","#document"].includes(eap(t))}function eaO(t){return eay(t)?t:t.contextElement}let eak={x:1,y:1};function eaI(t){let n=eaO(t);if(!eag(n))return eak;let r=n.getBoundingClientRect(),{width:i,height:o,fallback:a}=ead(n),u=(a?eaf(r.width):r.width)/i,s=(a?eaf(r.height):r.height)/o;return u&&Number.isFinite(u)||(u=1),s&&Number.isFinite(s)||(s=1),{x:u,y:s}}function eaC(t,n,r,i){var o,a;void 0===n&&(n=!1),void 0===r&&(r=!1);let u=t.getBoundingClientRect(),s=eaO(t),c=eak;n&&(i?eay(i)&&(c=eaI(i)):c=eaI(t));let l=s?eau(s):window,f=eaT()&&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=eau(s),y=i&&eay(i)?eau(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=eau(v).frameElement}}return{width:h,height:m,top:p,right:d+h,bottom:p+m,left:d,x:d,y:p}}function eaM(t){return((eav(t)?t.ownerDocument:t.document)||window.document).documentElement}function eaR(t){return eay(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function eaE(t){return eaC(eaM(t)).left+eaR(t).scrollLeft}function eaj(t){if("html"===eap(t))return t;let n=t.assignedSlot||t.parentNode||eab(t)&&t.host||eaM(t);return eab(n)?n.host:n}function eaA(t,n){var r;void 0===n&&(n=[]);let i=function t(n){let r=eaj(n);return eaw(r)?r.ownerDocument.body:eag(r)&&eax(r)?r:t(r)}(t),o=i===(null==(r=t.ownerDocument)?void 0:r.body),a=eau(i);return o?n.concat(a,a.visualViewport||[],eax(i)?i:[]):n.concat(i,eaA(i))}function eaN(t,n,r){let i;if("viewport"===n)i=function(t,n){let r=eau(t),i=eaM(t),o=r.visualViewport,a=i.clientWidth,u=i.clientHeight,s=0,c=0;if(o){a=o.width,u=o.height;let l=eaT();(!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=eaM(t),r=eaR(t),i=t.ownerDocument.body,o=eal(n.scrollWidth,n.clientWidth,i.scrollWidth,i.clientWidth),a=eal(n.scrollHeight,n.clientHeight,i.scrollHeight,i.clientHeight),u=-r.scrollLeft+eaE(t),s=-r.scrollTop;return"rtl"===eas(i).direction&&(u+=eal(n.clientWidth,i.clientWidth)-o),{width:o,height:a,x:u,y:s}}(eaM(t));else if(eay(n))i=function(t,n){let r=eaC(t,!0,"fixed"===n),i=r.top+t.clientTop,o=r.left+t.clientLeft,a=eag(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(eaT()){var a,u;let s=eau(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 eo9(i)}function eaP(t,n){return eag(t)&&"fixed"!==eas(t).position?n?n(t):t.offsetParent:null}function eaL(t,n){let r=eau(t),i=eaP(t,n);for(;i&&ea_(i)&&"static"===eas(i).position;)i=eaP(i,n);return i&&("html"===eap(i)||"body"===eap(i)&&"static"===eas(i).position&&!eaS(i))?r:i||function(t){let n=eaj(t);for(;eag(n)&&!eaw(n);){if(eaS(n))return n;n=eaj(n)}return null}(t)||r}let eaF={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=eaA(t).filter(t=>eay(t)&&"body"!==eap(t)),o=null,a="fixed"===eas(t).position,u=a?eaj(t):t;for(;eay(u)&&!eaw(u);){let s=eas(u),c=eaS(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=eaj(u)}return n.set(t,i),i}(n,this._c):[].concat(r),i],u=a[0],s=a.reduce((t,r)=>{let i=eaN(n,r,o);return t.top=eal(i.top,t.top),t.right=eac(i.right,t.right),t.bottom=eac(i.bottom,t.bottom),t.left=eal(i.left,t.left),t},eaN(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=eag(r),a=eaM(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"!==eap(r)||eax(a))&&(u=eaR(r)),eag(r))){let l=eaC(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:eay,getDimensions:function(t){return eag(t)?ead(t):t.getBoundingClientRect()},getOffsetParent:eaL,getDocumentElement:eaM,getScale:eaI,async getElementRects(t){let{reference:n,floating:r,strategy:i}=t,o=this.getOffsetParent||eaL,a=this.getDimensions;return{reference:function(t,n,r){let i=eag(n),o=eaM(n),a=eaC(t,!0,"fixed"===r,n),u={scrollLeft:0,scrollTop:0},s={x:0,y:0};if(i||!i&&"fixed"!==r){if(("body"!==eap(n)||eax(o))&&(u=eaR(n)),eag(n)){let c=eaC(n,!0);s.x=c.x+n.clientLeft,s.y=c.y+n.clientTop}else o&&(s.x=eaE(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"===eas(t).direction};function eaD(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?[...eay(t)?eaA(t):t.contextElement?eaA(t.contextElement):[],...eaA(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}),eay(t)&&!s&&f.observe(t),eay(t)||!t.contextElement||s||f.observe(t.contextElement),f.observe(n)}let p,h=s?eaC(t):null;return s&&function n(){let i=eaC(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 eaW=(t,n,r)=>{let i=new Map,o={platform:eaF,...r},a={...o.platform,_c:i};return eo5(t,n,{...o,platform:a})};var eaU="u">typeof document?c.useLayoutEffect:c.useEffect;function eaz(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(!eaz(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)&&!eaz(t[a],n[a]))return!1}return!0}return t!=t&&n!=n}function eaB(t){let n=c.useRef(t);return eaU(()=>{n.current=t}),n}var eaV="u">typeof document?c.useLayoutEffect:c.useEffect;let ea$=!1,eaq=0,eaK=()=>"floating-ui-"+eaq++,eaH=(qm||(qm=r.t(c,2)))["useId".toString()],eaG=eaH??function(){let[t,n]=c.useState(()=>ea$?eaK():void 0);return eaV(()=>{null==t&&n(eaK())},[]),c.useEffect(()=>{ea$||(ea$=!0)},[]),t},eaZ=c.createContext(null),eaJ=c.createContext(null),eaY=()=>{var t,n;return null!=(t=null==(n=c.useContext(eaZ))?void 0:n.id)?t:null},eaQ=()=>c.useContext(eaJ);function eaX(t){var n;return null!=(n=null==t?void 0:t.ownerDocument)?n:document}function ea0(t){var n;return null!=(n=eaX(t).defaultView)?n:window}function ea1(t){return!!t&&t instanceof ea0(t).Element}let ea2=(qm||(qm=r.t(c,2)))["useInsertionEffect".toString()];function ea3(t){let n=c.useRef(()=>{});return ea2?ea2(()=>{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 ea4(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 ea5(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 ea9(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 ea6(t){t.preventDefault(),t.stopPropagation()}function ea8(t){let n=(0,c.useRef)();return eaV(()=>{n.current=t},[t]),n.current}let ea7=function(t,n){let{open:r}=t,{enabled:i=!0,role:o="dialog"}=void 0===n?{}:n,a=eaG(),u=eaG(),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 eue(t,n){return null!=n&&("composedPath"in t?t.composedPath().includes(n):null!=t.target&&n.contains(t.target))}let eut=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=eaQ(),g=null!=eaY(),y=c.useRef(!1);return c.useEffect(()=>{if(!r||!s)return;function t(t){"Escape"!==t.key||!h&&m&&ea5(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(ea1(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&&ea5(m.nodesRef.current,u).some(n=>{var r;return eue(t,null==(r=n.context)?void 0:r.refs.floating.current)});eue(t,o.floating.current)||eue(t,o.domReference.current)||v||!h&&m&&ea5(m.nodesRef.current,u).length>0||(a.emit("dismiss",!!g&&{preventScroll:!0}),i(!1))}function c(){i(!1)}let d=eaX(o.floating.current);l&&d.addEventListener("keydown",t),f&&d.addEventListener("pointerdown",n);let v=(p?[...ea1(o.reference.current)?eaA(o.reference.current):[],...ea1(o.floating.current)?eaA(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}}}:{}},eun="ArrowUp",eur="ArrowDown",eui="ArrowLeft",euo="ArrowRight";function eua(t,n,r){return Math.floor(t/n)!==r}function euu(t,n){return n<0||n>=t.current.length}function eus(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 euc(t,n,r){switch(t){case"vertical":return n;case"horizontal":return r;default:return n||r}}function eul(t,n){return euc(n,t===eun||t===eur,t===eui||t===euo)}function euf(t,n,r){return euc(n,t===eur,r?t===eui:t===euo)||"Enter"===t||" "==t||""===t}function eud(t,n){return eus(t,{disabledIndices:n})}function eup(t,n){return eus(t,{decrement:!0,startingIndex:t.current.length,disabledIndices:n})}let euh=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=eaY(),w=eaQ(),O=ea8(r),k=ea3(s),I=ea3(ea8(s)),C=c.useRef(y),M=c.useRef(f??-1),R=c.useRef(null),E=function(t){let n=(0,c.useRef)(t);return eaV(()=>{n.current=t}),n}(x),j=c.useRef(!1),A=c.useRef(-1),[N,P]=c.useState(),L=c.useCallback((t,n)=>{A.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(j.current=!0,h&&(n=t.key,euc(_,m?n===euo:n===eui,n===eun))){ea6(t),i(!1),(c=o.domReference.current)&&c instanceof ea0(c).HTMLElement&&o.domReference.current.focus();return}let l=M.current,f=eud(a,x),y=eup(a,x);if("Home"===t.key&&(M.current=f,k(M.current)),"End"===t.key&&(M.current=y,k(M.current)),S>1){let v=M.current;if(t.key===eun){if(ea6(t),-1===v)M.current=y;else if(M.current=eus(a,{startingIndex:v,amount:S,decrement:!0,disabledIndices:x}),p&&(v-S<f||M.current<0)){let b=v%S,T=y%S,w=y-(T-b);T===b?M.current=y:M.current=T>b?w:w-S}euu(a,M.current)&&(M.current=v),k(M.current)}if(t.key===eur&&(ea6(t),-1===v?M.current=f:(M.current=eus(a,{startingIndex:v,amount:S,disabledIndices:x}),p&&v+S>y&&(M.current=eus(a,{startingIndex:v%S-S,amount:S,disabledIndices:x}))),euu(a,M.current)&&(M.current=v),k(M.current)),"both"===_){let O=Math.floor(v/S);t.key===euo&&(ea6(t),v%S!=S-1?(M.current=eus(a,{startingIndex:v,disabledIndices:x}),p&&eua(M.current,S,O)&&(M.current=eus(a,{startingIndex:v-v%S-1,disabledIndices:x}))):p&&(M.current=eus(a,{startingIndex:v-v%S-1,disabledIndices:x})),eua(M.current,S,O)&&(M.current=v)),t.key===eui&&(ea6(t),v%S!=0?(M.current=eus(a,{startingIndex:v,disabledIndices:x,decrement:!0}),p&&eua(M.current,S,O)&&(M.current=eus(a,{startingIndex:v+(S-v%S),decrement:!0,disabledIndices:x}))):p&&(M.current=eus(a,{startingIndex:v+(S-v%S),decrement:!0,disabledIndices:x})),eua(M.current,S,O)&&(M.current=v)),euu(a,M.current)&&(p&&Math.floor(y/S)===O?M.current=t.key===eui?y:eus(a,{startingIndex:v-v%S-1,disabledIndices:x}):M.current=v),k(M.current);return}}if(eul(t.key,_)){if(ea6(t),r&&!g&&ea9(t.currentTarget.ownerDocument)===t.currentTarget){M.current=euf(t.key,_,m)?f:y,k(M.current);return}euf(t.key,_,m)?p?M.current=l>=y?d&&l!==a.current.length?-1:f:eus(a,{startingIndex:l,disabledIndices:x}):M.current=Math.min(y,eus(a,{startingIndex:l,disabledIndices:x})):p?M.current=l<=f?d&&-1!==l?a.current.length:y:eus(a,{startingIndex:l,decrement:!0,disabledIndices:x}):M.current=Math.max(f,eus(a,{startingIndex:l,decrement:!0,disabledIndices:x})),euu(a,M.current)?k(null):k(M.current)}}return eaV(()=>{l&&(!O&&r&&C.current&&null!=f&&k(f),O&&!r&&(cancelAnimationFrame(A.current),M.current=-1,I(null)))},[r,O,f,a,L,l,k,I]),eaV(()=>{l&&r&&(null==u?null==f&&(O&&(M.current=-1,L(a,M)),!O&&C.current&&(null!=R.current||!0===C.current&&null==R.current)&&(M.current=null==R.current||euf(R.current,_,m)||h?eud(a,E.current):eup(a,E.current),k(M.current),L(a,M))):euu(a,u)||(M.current=u,L(a,M)))},[r,O,u,f,h,a,k,L,l,d,_,m,g,E]),eaV(()=>{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(ea9(eaX(i)))&&i.focus({preventScroll:!0})}},[l,r,O,w,T]),eaV(()=>{R.current=null}),l?{reference:{...g&&r&&null!=u&&{"aria-activedescendant":N},onKeyDown(t){if(j.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,euc(_,m?n===eui:n===euo,n===eur)&&(ea6(t),r?(M.current=eud(a,x),k(M.current)):i(!0));return}eul(t.key,_)&&(null!=f&&(M.current=f),ea6(t),!r&&b?i(!0):F(t),r&&k(M.current))}},floating:{"aria-orientation":"both"===_?void 0:_,...g&&null!=u&&{"aria-activedescendant":N},onKeyDown:F,onPointerMove(){j.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(!j.current&&(M.current=-1,L(a,M),k(null),!g)){var t;null==(t=o.floating.current)||t.focus({preventScroll:!0})}}}}}:{}},eum=new Qr("suggestion");function eug(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=eug(t[n]))&&(i&&(i+=" "),i+=r);else for(n in t)t[n]&&(i&&(i+=" "),i+=n)}return i}function euy(){for(var t,n,r=0,i="";r<arguments.length;)(t=arguments[r++])&&(n=eug(t))&&(i&&(i+=" "),i+=n);return i}let euv=ern.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:t}){return["p",etm(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),eub={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"},eux=()=>(++eux.i).toString();eux.i=0;let eu_=t=>{let n=euw(t),r=[];for(let i=0;i<n.length;i++)r.push(euO(n[i]));return{key:eux(),children:r}},euS=(t,n=[])=>({key:eux(),type:t.type,text:"text"in t?t.text:void 0,node:t,children:n}),euT=t=>euS({type:eub.span,text:t,spans:[]}),euw=t=>{let n=t.slice(0);for(let r=0;r<n.length;r++){let i=n[r];if(i.type===eub.listItem||i.type===eub.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===eub.listItem?n[r]={type:eub.list,items:o}:n[r]={type:eub.oList,items:o}}}return n},euO=t=>{if("text"in t)return euS(t,euk(t.spans,t));if("items"in t){let n=[];for(let r=0;r<t.items.length;r++)n.push(euO(t.items[r]));return euS(t,n)}return euS(t)},euk=(t,n,r)=>{if(!t.length)return[euT(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(euT(n.text.slice(0,c)));let m={...u,text:f};o.push(euS(m,euk(d,{...n,text:f},u))),l<n.text.length&&o.push(euT(n.text.slice(l,i[a+1]?i[a+1].start-s:void 0)))}return o},euI=(t,n)=>euC(eu_(t).children,n),euC=(t,n)=>{let r=[];for(let i=0;i<t.length;i++){let o=t[i],a=n(o.type,o.node,o.text,euC(o.children,n),o.key);null!=a&&r.push(a)}return r};eub.listItem,eub.oListItem,eub.list,eub.oList;let euM=ern.create({name:"text",group:"inline"}),euR={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)}},euE={fromPrismic:t=>n=>{switch(n.type){case"hyperlink":return esm.converter.fromPrismic(t)(n);case"em":return esp.converter.fromPrismic(t)(n);case"strong":return eoN.converter.fromPrismic(t)(n);default:return}},toPrismic(t,n,r){let i=esT.find(n=>t.type.name===n.name);if(!i)throw Error(`Invalid mark extension '${t.type.name}'.`);let o=i.richTextNodeTypes;if("hyperlink"!==o)return{type:o,start:n,end:r};let a=i.converter.toPrismic(t);return{type:o,start:n,end:r,data:a}}},euj=euM.extend({name:"text"}),euA={name:euj.name,component:euj,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)]:eoY.splitTextToNodes(t,o)(n=>t.text(n));{let u=euE.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=eoE.children.reduce(t,(t,n)=>{let r=n.type.name===eoY.name?eoY.converter.toPrismic(n):n.textContent,i=r?t.text+r:t.text,o=t.text.length,a=i.length,u=n.marks.length?eoE.marks.map(n,t=>euE.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:[...euR.mergeOverlap(i.spans)].sort((t,n)=>t.type.localeCompare(n.type))},...r}}}};var euN,euP=((euN=euP||{}).LeftToRight="ltr",euN.RightToLeft="rtl",euN);let euL=Vs.RichTextNodeType.rtl,euF=etN.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()}}}),euD={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)}}},euW=euv.extend({name:"paragraph",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:t}){return["p",etm(this.options.HTMLAttributes,t),0]}}),euU=new eoO([Vs.RichTextNodeType.paragraph],euW.name,euW,{fromPrismic:t=>function(n){var r;let i=euA.converter.fromPrismic(t)(euW.name,n);return null==(r=t.nodes[euW.name])?void 0:r.create(euD.fromPrismic(n),i)},toPrismic:t=>euA.converter.toPrismic(t,Vs.RichTextNodeType.paragraph,euD.toPrismic(t))},"Type '/' for commands"),euz=euU,euB=["ArrowDown","ArrowUp","End","Home"],euV=["Enter"],eu$=["Escape",...euB,...euV],euq=etN.create({name:"slash-commands",addOptions:()=>({nodeTypes:[]}),addProseMirrorPlugins(){let t=esR(esO,this.options.nodeTypes);return t.length>1?[function({pluginKey:t=eum,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 Qe({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?eeh.create(t.doc,[eef.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===euz.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 eop(euK,{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()}}}})]:[]}}),euK=(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=eaQ(),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);eaz(f,i)||d(i);let p=c.useRef(null),h=c.useRef(null),m=c.useRef(s),g=eaB(a),y=eaB(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),eaW(p.current,h.current,t).then(t=>{let n={...t,isPositioned:!0};k.current&&!eaz(m.current,n)&&(m.current=n,b.flushSync(()=>{l(n)}))})},[f,n,r,y]);eaU(()=>{!1===u&&m.current.isPositioned&&(m.current.isPositioned=!1,l(t=>({...t,isPositioned:!1})))},[u]);let k=c.useRef(!1);eaU(()=>(k.current=!0,()=>{k.current=!1}),[]),eaU(()=>{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]),C=c.useMemo(()=>({reference:v,floating:_}),[v,_]);return c.useMemo(()=>({...s,update:O,refs:I,elements:C,reference:T,floating:w}),[s,O,I,C,T,w])}({placement:o,middleware:a,strategy:u,whileElementsMounted:i}),y=ea3(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]);eaV(()=>{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=>{(ea1(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 eao(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=eo2(a),_=eo2(l)===l,S=await (null==f.isRTL?void 0:f.isRTL(d.floating)),T=m||(_||!v?[ean(l)]:function(t){let n=ean(t);return[eai(t),n,eai(n)]}(l));m||"none"===y||T.push(...function(t,n,r,i){let o=eo0(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[]}}(eo2(t),"start"===r,i);return o&&(a=a.map(t=>t+"-"+o),n&&(a=a.concat(a.map(eai)))),a}(l,v,y,S));let w=await eo6(t,b),O=[],k=(null==(n=s.flip)?void 0:n.overflows)||[];if(p&&O.push(w[x]),h){let{main:I,cross:C}=function(t,n,r){void 0===r&&(r=!1);let i=eo0(t),o=eo3(t),a=eo1(o),u="x"===o?i===(r?"end":"start")?"right":"left":"start"===i?"bottom":"top";return n.reference[a]>n.floating[a]&&(u=ean(u)),{main:u,cross:ean(u)}}(a,c,S);O.push(w[I],w[C])}if(k=[...k,{placement:a,overflows:O}],!O.every(t=>t<=0)){let M=((null==(r=s.flip)?void 0:r.index)||0)+1,R=[l,...T][M];if(R)return{data:{index:M,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 j=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];j&&(E=j);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=eo3(i),p=eaa(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(eo2(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 eo6(t,s),f=eo3(eo2(i)),p=eaa(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=eae(g,h,y)}if(a){let v=m+l["y"===p?"top":"left"],b=m-l["y"===p?"bottom":"right"];m=eae(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:eaD});(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:M,getReferenceProps:R}=(p=[eut(y,{outsidePointerDown:!1}),euh(y,{activeIndex:w,listRef:k,onNavigate(t){O(n=>t??n)},openOnArrowKeyDown:!1,virtual:!0}),ea7(y,{role:"menu"})],{getReferenceProps:t=>ea4(t,p,"reference"),getFloatingProps:t=>ea4(t,p,"floating"),getItemProps:t=>ea4(t,p,"item")}),E=R().onKeyDown;(0,c.useImperativeHandle)(o,()=>({handleKeyDown(n){if(!h)return!1;if(euB.includes(n.key)&&E(n),euV.includes(n.key)){let r=i[w];void 0!==r&&t(r)}return!0}}),[w,t,i,E,h]);let j=(0,c.useId)();return h?C.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)(euH,{...M({onClick(){t(n)},onPointerDown(t){t.preventDefault()}}),"data-highlighted":r===w?"":void 0,id:`${j}[${r}]`,key:n.nodeType,ref(t){k.current[r]=t},shortcut:`/${n.shortText??""}`,startIcon:n.icon},n.text)),0===i.length?C.jsx(euH,{...M({onPointerDown(t){t.preventDefault()}}),disabled:!0,id:`${j}[0]`,ref(t){k.current[0]=t},children:"No results"}):null]}):null}),euH=(0,c.forwardRef)(function({children:t,disabled:n,shortcut:r,startIcon:i,...o},a){return C.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:euy(i.props.className,l._s.itemStartIcon)}):null,C.jsx(l.xv,{className:euy(l._s.itemText,l._s.itemTextColor.grey),component:"span",children:t}),r?C.jsx(l.xv,{className:l._s.itemShortcut,color:"inherit",component:"span",variant:"inherit",children:r}):null]})}),euG=eoD.extend({name:"bulletList",parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:t}){return["ul",etm(this.options.HTMLAttributes,t),0]}}).configure({itemTypeName:"listItem"}),euZ=new eoC([Vs.RichTextNodeType.list],euG.name,euG,{fromPrismic:t=>function(n){var r;let i=eoB.converter.fromPrismic(t)(n);if(i)return null==(r=t.nodes[euG.name])?void 0:r.create(euD.fromPrismic(n),i)},toPrismic:t=>eoE.children.map(t,t=>eoB.converter.toPrismic(t,Vs.RichTextNodeType.list).filter(d.$)).flat()}),euJ=euZ,euY=/^```([a-z]+)?[\s\n]$/,euQ=/^~~~([a-z]+)?[\s\n]$/,euX=ern.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",etm(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
|
-
|
|
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[en7({find:euY,type:this.type,getAttributes:t=>({language:t[1]})}),en7({find:euQ,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new Qe({key:new Qr("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(YJ.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}}})]}}),eu0=euX.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",etm(this.options.HTMLAttributes),["code",t,0]]}}).configure({exitOnTripleEnter:!1}),eu1=new eoO([Vs.RichTextNodeType.preformatted],eu0.name,eu0,{fromPrismic:t=>function(n){var r;let i=euA.converter.fromPrismic(t)(eu0.name,n,!0);return null==(r=t.nodes[eu0.name])?void 0:r.create(euD.fromPrismic(n),i)},toPrismic:t=>euA.converter.toPrismic(t,Vs.RichTextNodeType.preformatted,euD.toPrismic(t))},"",!0);function eu2(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 eu3(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=(0,f.R9)(t.updateAttributes),u=(0,f.$P)({initialState:(null==o?void 0:o.embed_url)??"",startTransition:c.startTransition});function s(t){a({content:t})}let{onKeyDown:l}=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,u.value,n,r);return{inputRef:n,containerRef:r,onKeyDown:l,url:u.value,urlChanged:function(t){u.set(t),(0,g.j)(t)||s(void 0)},onContentChange:s,debouncedUrl:u.debouncedValue}}(t,n,r),{selected:d}=eu2(t);return C.jsx(eod,{className:"custom-embed",children:C.jsx("div",{contentEditable:"false",suppressContentEditableWarning:!0,children:C.jsxs(l.xu,{flexDirection:"column",children:[C.jsxs(l.xu,{flexGrow:1,alignItems:"center",children:[C.jsx(l.I5,{size:"small",name:"cloud",color:"grey11"}),C.jsx(l.xu,{flexGrow:1,flexDirection:"column",ref:r,children:C.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)&&C.jsx(G3,{selected:d,debouncedUrl:s,onContentChange:u})]})})})}let eu4=ern.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",etm(t)],addNodeView:()=>eom(eu3)}),eu5=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}}([Vs.RichTextNodeType.embed],eu4.name,eu4,{fromPrismic:t=>function(n){var r;return null==(r=t.nodes[eu4.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}}}),eu9=ern.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]}`,etm(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=>en7({find:RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),eu6="heading",eu8={byLevel(t){switch(t){case 1:return Vs.RichTextNodeType.heading1;case 2:return Vs.RichTextNodeType.heading2;case 3:return Vs.RichTextNodeType.heading3;case 4:return Vs.RichTextNodeType.heading4;case 5:return Vs.RichTextNodeType.heading5;case 6:return Vs.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:eu8.byLevel(o),level:o}},fromProsemirror(t,n){let r=t.level;if(n.includes(r))return{fullName:eu8.byLevel(r),level:r}}},eu7=t=>eu9.extend({name:eu6,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}`,etm(this.options.HTMLAttributes,n,i),0]}}),ese=t=>{let n=t[0];return{fromPrismic:r=>function(i){var o;let a=euA.converter.fromPrismic(r)(eu6,i),u=eu8.fromPrismic(i.type,t)||eu8.default(n);return null==(o=r.nodes[eu6])?void 0:o.create({level:u.level,...euD.fromPrismic(i)},a)},toPrismic(r){let{fullName:i}=eu8.fromProsemirror(r.attrs,t)||eu8.default(n);return euA.converter.toPrismic(r,i,euD.toPrismic(r))}}},est={name:eu6,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=eu8.fromPrismic(n);return r?[...t,r.level]:t},[]).sort((t,n)=>t-n);return G(tq(n),pN(()=>{}))}(t);if(!n)return;let r=tq(n.map(t=>eu8.byLevel(t)));if(!pj(r))return new eoI(r.value,eu7(n),n,ese(n),t=>{let r=eu8.fromProsemirror(t,n);return r&&`Heading ${r.level}`})}};function esn(t){let{node:n}=t,r=n.attrs.content,{selected:i}=eu2(t),o={width:null==r?void 0:r.width,height:null==r?void 0:r.height,name:Zi},{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=ZG(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=Zz({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:Zo(o,r,r)};return C.jsx(eod,{className:"custom-image",children:C.jsx("div",{contentEditable:"false",suppressContentEditableWarning:!0,children:C.jsx(ZH,{content:r,selected:i,fieldLabel:"Feature image",imageLabel:h,initialImages:[g],readOnly:!1,onMediaSelected:a,onCropperDialogClose:u,onClear:d,children:C.jsx(c.Suspense,{fallback:esr,children:null!=r&&r.url?C.jsxs(l.aY,{children:[C.jsx(l.hM,{children:C.jsx(l.xu,{flexDirection:"column",alignItems:"center",position:"relative",height:400,children:C.jsx(l.xu,{justifyContent:"center",flexDirection:"column",flexGrow:1,maxHeight:"100%",maxWidth:"100%",children:C.jsx(l.kg,{src:Zs(r.url),alt:m,sizing:"contain"})})})}),C.jsx(ZW,{onValueChange(t){f({...r,alt:t})},altText:m,readOnly:!r,selected:i})]}):C.jsx(ZD,{isUpdating:s,readOnly:!1,onMediaSelected:a})})})})})}let esr=C.jsx("div",{style:{height:468}}),esi=ern.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",etm(t)],addNodeView:()=>eom(esn)}),eso=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}}([Vs.RichTextNodeType.image],esi.name,esi,{fromPrismic:t=>function(n){var r;return null==(r=t.nodes[esi.name])?void 0:r.create({content:n.data})},toPrismic(t){if(void 0!==t.attrs.content)return{type:"image",data:{...t.attrs.content}}}}),esa=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,esu=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,ess=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,esc=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,esl=ert.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",etm(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[en8({find:esa,type:this.type}),en8({find:ess,type:this.type})]},addPasteRules(){return[eri({find:esu,type:this.type}),eri({find:esc,type:this.type})]}}),esf=esl.extend({name:"em"}),esd=new class{constructor(t,n,r){w(this,"extType",eoT.Mark),w(this,"richTextNodeTypes",Vs.RichTextNodeType.em),this.name=t,this.component=n,this.converter=r}}(esf.name,esf,{fromPrismic:t=>function(){var n;return null==(n=t.marks[esf.name])?void 0:n.create()},toPrismic(){}}),esp=esd,esh=ert.create({name:"hyperlink",priority:1e3,keepOnSplit:!1,inclusive:!1,addOptions:()=>({openOnClick:!1,linkOnPaste:!0,autolink:!0,protocols:[],htmlAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null,id:""},validate:void 0}),addAttributes:()=>({href:{default:""},id:{default:""},target:{default:"_blank"},rel:{default:"noopener noreferrer nofollow"},class:{default:null}}),parseHTML:()=>[{tag:'a[href]:not([href *= "javascript:" i])'}],renderHTML({HTMLAttributes:t}){return["a",etm(this.options.htmlAttributes,t),0]},addCommands(){return{setWebLink:t=>({chain:n})=>n().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMark(this.name,t).setMeta("preventAutolink",!0).run(),setDocumentLink:t=>({chain:n})=>n().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMark(this.name,t).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}}}),esm=new class{constructor(t,n,r){w(this,"extType",eoT.Mark),w(this,"richTextNodeTypes",Vs.RichTextNodeType.hyperlink),this.name=t,this.component=n,this.converter=r}}(esh.name,esh,{fromPrismic:t=>function(n){var r,i;let o=n.data;if("DocumentLink"===o.__TYPE__){let a={type:esh.name,id:o.id};return null==(r=t.marks[esh.name])?void 0:r.create(a)}if("ExternalLink"===o.__TYPE__){let u={type:esh.name,url:o.url,href:o.url,target:o.target};return null==(i=t.marks[esh.name])?void 0:i.create(u)}},toPrismic:t=>t.attrs.id?{__TYPE__:"DocumentLink",id:t.attrs.id}:{__TYPE__:"ExternalLink",url:t.attrs.href,target:t.attrs.target}}),esg=ern.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",etm(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)}}}),esy=ert.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:t=>!!t.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:t}){return["span",etm(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:n})=>{let r=enI(t,this.type);return!!Object.entries(r).some(([,t])=>!!t)||n.unsetMark(this.name)}}}}),esv=/^(\d+)\.\s$/,esb=ern.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",etm(this.options.HTMLAttributes,r),0]:["ol",etm(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(esg.name,this.editor.getAttributes(esy.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=ere({find:esv,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=ere({find:esv,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(esy.name)}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1],editor:this.editor})),[t]}}),esx=esb.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",etm(this.options.HTMLAttributes,r),0]:["ol",etm(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"}),es_=new eoC([Vs.RichTextNodeType.orderedList],esx.name,esx,{fromPrismic:t=>function(n){var r;let i=eoB.converter.fromPrismic(t)(n);if(i)return null==(r=t.nodes[esx.name])?void 0:r.create(euD.fromPrismic(n),i)},toPrismic:t=>eoE.children.map(t,t=>eoB.converter.toPrismic(t,Vs.RichTextNodeType.orderedList).filter(d.$)).flat()}),esS=es_,esT=[eoN,esp,esm];function esw(t){return[euz,euJ,esS,est.build(t),eu1,eu5,eso,...esT].filter(d.$)}let esO=[{nodeType:Vs.RichTextNodeType.paragraph,icon:"textFields",isActive:t=>t.isActive(euz.name)&&!t.isActive(euJ.name)&&!t.isActive(esS.name),runCommands:esC((t,n)=>t.clearNodes().setDirection(esM(n))),shortText:"par",text:"Paragraph"},{nodeType:Vs.RichTextNodeType.heading1,icon:"looks1",isActive:t=>t.isActive(est.name,{level:1}),runCommands:esC((t,n)=>t.setHeading({level:1}).setDirection(esM(n))),shortText:"h1",text:"Heading 1"},{nodeType:Vs.RichTextNodeType.heading2,icon:"looks2",isActive:t=>t.isActive(est.name,{level:2}),runCommands:esC((t,n)=>t.setHeading({level:2}).setDirection(esM(n))),shortText:"h2",text:"Heading 2"},{nodeType:Vs.RichTextNodeType.heading3,icon:"looks3",isActive:t=>t.isActive(est.name,{level:3}),runCommands:esC((t,n)=>t.setHeading({level:3}).setDirection(esM(n))),shortText:"h3",text:"Heading 3"},{nodeType:Vs.RichTextNodeType.heading4,icon:"looks4",isActive:t=>t.isActive(est.name,{level:4}),runCommands:esC((t,n)=>t.setHeading({level:4}).setDirection(esM(n))),shortText:"h4",text:"Heading 4"},{nodeType:Vs.RichTextNodeType.heading5,icon:"looks5",isActive:t=>t.isActive(est.name,{level:5}),runCommands:esC((t,n)=>t.setHeading({level:5}).setDirection(esM(n))),shortText:"h5",text:"Heading 5"},{nodeType:Vs.RichTextNodeType.heading6,icon:"looks6",isActive:t=>t.isActive(est.name,{level:6}),runCommands:esC((t,n)=>t.setHeading({level:6}).setDirection(esM(n))),shortText:"h6",text:"Heading 6"},{nodeType:Vs.RichTextNodeType.list,icon:"formatListBulleted",isActive:t=>t.isActive(euJ.name),runCommands:esC((t,n)=>t.toggleBulletList().setDirection(esM(n))),shortText:"bull",text:"Bulleted list"},{nodeType:Vs.RichTextNodeType.orderedList,icon:"formatListNumbered",isActive:t=>t.isActive(esS.name),runCommands:esC((t,n)=>t.toggleOrderedList().setDirection(esM(n))),shortText:"num",text:"Numbered list"},{nodeType:Vs.RichTextNodeType.preformatted,icon:"dataObject",isActive:t=>t.isActive(eu1.name),runCommands:esC((t,n)=>t.setCodeBlock().setDirection(esM(n))),shortText:"code",text:"Code"},{nodeType:Vs.RichTextNodeType.embed,icon:"cloud",isActive:t=>t.isActive(eu5.name),runCommands:esC(t=>t.setEmbed()),shortText:"emb",text:"Embed"},{nodeType:Vs.RichTextNodeType.image,icon:"image",isActive:t=>t.isActive(eso.name),runCommands:esC(t=>t.setImage()),shortText:"img",text:"Image"}],esk=[{nodeType:Vs.RichTextNodeType.strong,icon:"formatBold",isActive:t=>t.isActive(eoN.name),runCommands:esC(t=>t.toggleBold())},{nodeType:Vs.RichTextNodeType.em,icon:"formatItalic",isActive:t=>t.isActive(esp.name),runCommands:esC(t=>t.toggleItalic())}],esI=[{nodeType:Vs.RichTextNodeType.rtl,icon:"formatTextDirectionRToL",isActive:t=>t.isActive({dir:euP.RightToLeft}),runCommands:esC((t,n)=>t.toggleDirection(esM(n)))}];function esC(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 esM(t){let n=t.state.selection.$from.parent.attrs;return euD.parseNodeAttrsDirection(n)}function esR(t,n){return t.filter(t=>n.includes(t.nodeType))}function esE(t){let{items:n,editor:r}=t;return 0===n.length?null:C.jsxs(C.Fragment,{children:[C.jsx(l.Jf,{}),n.map(t=>C.jsx(l.r8,{disabled:!t.runCommands(r,{can:!0}),onPressedChange(){t.runCommands(r)},pressed:t.isActive(r),startIcon:t.icon},t.nodeType))]})}function esj(t){let{bubbleMenuContainerRef:n}=t,{disabled:r,toggleWebLink:i,toggleDocumentsLink:o}=function(t){let{editor:n,setModal:r}=t;return{disabled:!esC(t=>t.setWebLink({href:""}))(n,{can:!0}),toggleWebLink:function(){r("webLink")},toggleDocumentsLink:function(){r("documentLink")}}}(t);return C.jsxs(C.Fragment,{children:[C.jsx(l.Jf,{}),C.jsxs(l.yM,{density:"compact",children:[C.jsx(l.hA,{disabled:r,startIcon:"link",onClick:i},Vs.RichTextNodeType.hyperlink),C.jsxs(l.h_,{children:[C.jsx(l.$F,{children:C.jsx(l.hA,{startIcon:"arrowDropDown"})}),C.jsxs(l.AW,{align:"end",containerRef:n,children:[C.jsx(l.Xi,{startIcon:C.jsx(l.I5,{name:"public"}),onSelect:i,children:"Link to web page"}),C.jsx(l.Xi,{startIcon:C.jsx(l.I5,{name:"description"}),onSelect:o,children:"Link to document"})]})]})]})]})}function esA(t){let{docId:n,onEdit:r,onUnlink:i}=t,o=function(t){let n=i7();n.searchDocuments||ot("searchDocuments");let{coreApiUrl:r,env:i}=n;return(0,h.QT)(y.tf,[r,i,t])}(n);if(!o)return null;let a=o.versions[0],u=`/pages/${o.id}?version=${(null==a?void 0:a.version_id)??""}`??0,s=(null==a?void 0:a.preview_summary)??"",c=(null==a?void 0:a.custom_type_label)??"";return C.jsx(l.oZ,{url:u,title:o.title,subTitle:c,description:s,onEdit:r,onUnlink:i,largeIconName:"description"})}function esN(t){let{editor:n}=t,r=n.getAttributes(Vs.RichTextNodeType.hyperlink);if(r.id){let i=r.id;return C.jsx(esP,{docId:i,...t})}if(r.href){let o=r.href;return C.jsx(esL,{url:o,...t})}return null}function esP(t){let{editor:n,onEditDocumentLink:r,docId:i}=t;return C.jsx(l.SV,{renderError:()=>C.jsx(l.oZ,{url:"",title:"Failed to Load Linked Document Data",subTitle:"",error:!0,onEdit:r,onUnlink:()=>esF(n)}),children:C.jsx(c.Suspense,{fallback:C.jsx(l.oZ,{url:"",title:"",subTitle:"",loading:!0,onEdit:r,onUnlink:()=>esF(n)}),children:C.jsx(esA,{docId:i,onEdit:r,onUnlink:()=>esF(n)})})})}function esL(t){let{url:n,editor:r,onEditWebLink:i}=t,o=(0,g.j)(n);return o?C.jsx(l.oZ,{url:n,title:(0,g.S)(o),subTitle:n,onEdit:i,onUnlink:()=>esF(r)}):C.jsx(l.oZ,{url:n,title:"",subTitle:n,onEdit:i,onUnlink:()=>esF(r)})}function esF(t){esC(t=>t.unsetLink())(t)}function esD(t){let{open:n}=t,{onOpenChange:r,onSelectDocument:i}=function(t){let{editor:n,setOpen:r}=t;function i(t){r(t)}return{onSelectDocument:function(t){esC(n=>n.extendMarkRange(Vs.RichTextNodeType.hyperlink).setDocumentLink({id:t}))(n),r(!1)},onOpenChange:i}}(t);return C.jsx(Jt,{open:n,onOpenChange:r,onSelectDocument:i})}function esW(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(Vs.RichTextNodeType.hyperlink);return n.href?n.href:void 0}(r),f=(n=r,"_blank"===n.getAttributes(Vs.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";esC(r=>r.extendMarkRange(Vs.RichTextNodeType.hyperlink).setWebLink({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 C.jsx(l.Vq,{open:n,onOpenChange:o,hasClose:!1,size:"small",children:C.jsx(l.cZ,{children:C.jsxs(l.xu,{flexDirection:"column",children:[C.jsxs(l.xu,{flexDirection:"column",height:"100%",padding:16,gap:4,children:[C.jsx(l.yt,{value:r,onValueChange:i,placeholder:"Paste URL",icon:"public",onKeyDown:a}),d&&C.jsxs(l.xu,{flexDirection:"column",padding:{top:8},gap:4,children:[C.jsx(l.xv,{variant:"smallBold",color:"grey11",children:"Linked to"}),C.jsxs(l.xu,{backgroundColor:"grey4",borderRadius:6,padding:8,alignItems:"center",gap:8,children:[C.jsx(l.pI,{largeIconName:"public",smallIconName:"link"}),C.jsxs(l.xu,{flexDirection:"column",children:[C.jsx(l.xv,{variant:"bold",color:"grey12",children:p}),C.jsx(l.xv,{color:"grey11",variant:"small",children:"Web page"})]})]})]})]}),r&&C.jsxs(l.xu,{flexDirection:"column",padding:{block:8},border:{top:!0},children:[C.jsx(l.UN,{onSelect:()=>s(!u),icon:u?"checkBox":"checkBoxOutlinedBlank",textContent:"Open in new tab"}),C.jsx(l.UN,{onSelect:()=>f(r),icon:"link",textContent:"Link to URL"})]})]})})})}function esU(t){let{items:n,editor:r}=t;return 0===n.length?null:C.jsxs(C.Fragment,{children:[C.jsx(l.Jf,{}),C.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=>C.jsx(l.nG,{disabled:!t.runCommands(r,{can:!0}),startIcon:t.icon,value:t.nodeType},t.nodeType))},"mark")]})}function esz(t){var n;let{items:r,editor:i}=t;return 0===r.length?null:C.jsx(l.vT,{disabled:1===r.length,value:(null==(n=r.find(t=>t.isActive(i)))?void 0:n.nodeType)??"",onValueChange(t){var n;null==(n=r.find(n=>n.nodeType===t))||n.runCommands(i)},children:r.map(t=>C.jsx(l.KG,{value:t.nodeType,children:t.text},t.nodeType))})}let esB={duration:100,hideOnClick:!0,offset:[-48,parseFloat(l.TV.space[8])],placement:"top-start",zIndex:parseFloat(l.TV.zIndex.toolbar)};function esV(t){let{editor:n,nodeTypes:r}=t,[i,o]=(0,c.useState)(),a=r.includes(Vs.RichTextNodeType.hyperlink),u=!i,{shouldShowBubbleMenu:s,shouldShowLinkPopover:l}=function(t){let{editor:n}=t;return{shouldShowBubbleMenu:function(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(Vs.RichTextNodeType.preformatted)||s.empty||0===u.textBetween(o,a).length)},shouldShowLinkPopover:function(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 C.jsxs(C.Fragment,{children:[C.jsx(eoo,{editor:n,tippyOptions:esB,shouldShow:s,children:u&&C.jsx("div",{ref:f,children:C.jsx(es$,{...t,bubbleMenuContainerRef:f,setModal:o})})}),C.jsx(eoo,{editor:n,tippyOptions:esB,shouldShow:l,children:u&&C.jsx(esN,{editor:n,onEditWebLink:()=>o("webLink"),onEditDocumentLink:()=>o("documentLink")})}),a&&C.jsxs(C.Fragment,{children:[C.jsx(esW,{open:"webLink"===i,setOpen:function(t){o(t?"webLink":void 0)},editor:n}),C.jsx(esD,{open:"documentLink"===i,setOpen:function(t){o(t?"documentLink":void 0)},editor:n})]})]})}function es$(t){let{editor:n,nodeTypes:r}=t,i=r.includes("hyperlink"),o=esR(esO,r),a=esR(esk,r),u=esR(esI,r),s=o.length+a.length+u.length+Number(i);return 0===s?null:C.jsxs(l.o8,{children:[C.jsx(esz,{items:o,editor:n}),C.jsx(esU,{items:a,editor:n}),i&&C.jsx(esj,{...t}),C.jsx(esE,{items:u,editor:n}),s>1&&C.jsxs(C.Fragment,{children:[C.jsx(l.Jf,{}),C.jsx(l.hA,{onClick(){n.chain().focus().clearNodes().unsetAllMarks().run()},startIcon:"formatClear"},"clear")]})]})}function esq(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 eoj();let r=function(t){let n=(t.single||t.multi||"").split(/\s*,\s*/).map(t=>{let n=Vs.RichTextNodeTypeCodec.decode(t);return"Right"===n._tag?n.right:void 0}).filter(d.$);return new Set(n)}(t);if(!(null!=r&&r.size))return eoj();let i=(n=r,esw(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,eoM)&&n.add(euz),(0,v.G)(n,eok)||n.add(euz),[...n]}(i);return{extensions:o,defaultTextConverter:function(t){let n=t.find(eok)??euz;return function(t){return r=>n.converter.fromPrismic(t)({...r,type:n.richTextNodeTypes[0]})}}(o)}}(r.config),i=t.filter(esK),o=t.flatMap(t=>t.richTextNodeTypes),a=t.map(t=>t.component),u=t.filter(esH).map(t=>t.name),s=[...a,...function(t,n){var r,i;let o=n.map(t=>t.richTextNodeTypes).flat(),a={placeholderByNodeType:G(n,s0(t=>t.nodeType===eow.Text),cn({},(t,n)=>({...t,[n.name]:n.placeholder}))),unfocusedPlaceholder:null==(r=t.config)?void 0:r.placeholder,nodeExtensions:n},u=o.includes(Vs.RichTextNodeType.orderedList)||o.includes(Vs.RichTextNodeType.list);return s0(t=>void 0!==t)([eoK.component((null==(i=t.config)?void 0:i.single)===void 0),euA.component,eoY.component,eoX(a),u?eoB.component:void 0,euq.configure({nodeTypes:o})])}(r,i),euF.configure({supportedExtensionNames:u}),erS],c=s.map(t=>t.name),l=function(t,n){let r=etE.resolve(t);return et_(r,void 0)}(s);return{allComponents:s,extensionNames:c,defaultTextConverter:n,nodeExtensions:i,names:o,schema:l}},[r])),p=i&&eoK.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 eoa(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=eoK.converter(s.nodeExtensions).toPrismic(t.state.doc);h(n)}},[s,u]);return C.jsxs(l.gN,{children:[C.jsx(l.Qy,{htmlFor:a,children:Hr(o)}),C.jsxs(l.JO,{children:[C.jsx(eoc,{editor:m??null,style:{flex:1}}),(null==m?void 0:m.isEditable)&&C.jsx(esV,{editor:m,nodeTypes:s.names.concat(euL)})]})]})}function esK(t){return t.extType===eoT.Node}function esH(t){return!(t.extType!==eoT.Node||t.nodeType!==eow.Text||t.lockedFormat)}function esG(t){var n,r,i,o,a;let{content:u,field:s,id:c,onContentChange:f,readOnly:d}=t,p=Hi(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 C.jsxs(l.gN,{children:[C.jsx(l.fw,{name:"arrowDropDownCircle"}),C.jsx(l.Qy,{htmlFor:c,children:Hr(s)}),C.jsx(l.JO,{children:C.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:C.jsx(l.Ql,{value:"",children:p}),null==(r=null==(n=s.config)?void 0:n.options)?void 0:r.map(t=>C.jsx(l.Ql,{value:t,children:t},t))]})})]},m)}function esZ(t){let{id:n,readOnly:r,field:i,content:o,onContentChange:a}=t;return C.jsxs(l.gN,{children:[C.jsx(l.fw,{name:"event"}),C.jsx(l.Qy,{id:n,children:Hr(i)}),C.jsx(l.JO,{children:C.jsx(l.xu,{padding:{left:4,right:12},width:"100%",flexDirection:"column",justifyContent:"center",children:C.jsx(l.Wr,{mode:"date-time","aria-labelledby":n,readOnly:r,value:null==o?void 0:o.value,onValueChange:t=>a(esJ(t))})})})]})}let esJ=t=>void 0===t?void 0:{__TYPE__:"FieldContent",type:"Timestamp",value:t};function esY(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?C.jsx(Ho,{...t,field:o,content:oA.isBooleanContent(i)?i:void 0}):"Date"===o.type?C.jsx(Hu,{...t,field:o,content:oA.isDateContent(i)?i:void 0}):"Timestamp"===o.type?C.jsx(esZ,{...t,field:o,content:oA.isTimestampContent(i)?i:void 0}):"Image"===o.type?C.jsx(ZZ,{...t,field:o,content:oA.isImageContent(i)?i:void 0}):"Link"===o.type?C.jsx(Jf,{...t,field:o,content:oA.isLinkContent(i)?i:void 0}):"Number"===o.type?C.jsx(Jg,{...t,field:o,content:oA.isNumberContent(i)?i:void 0}):"StructuredText"===o.type?C.jsx(esq,{...t,field:o,content:oA.isRichTextContent(i)?i:void 0}):"Select"===o.type?C.jsx(esG,{...t,field:o,content:oA.isSelectContent(i)?i:void 0}):"Text"===o.type?C.jsx(ZY,{...t,field:o,content:oA.isTextContent(i)?i:void 0}):"Embed"===o.type?C.jsx(G8,{...t,field:o,content:oA.isEmbedContent(i)?i:void 0}):"Color"===o.type?C.jsx(Ha,{...t,field:o,content:oA.isColorContent(i)?i:void 0}):"GeoPoint"===o.type?C.jsx(Zr,{...t,field:o,content:oA.isGeoPointContent(i)?i:void 0}):null},[i,n,o,a,r])}let esQ=({content:t,id:n,nonRepeatableZone:r,onContentChange:i,readOnly:o})=>{let a=(0,c.useMemo)(()=>Object.entries(r),[r]);return C.jsx(C.Fragment,{children:a.map(([r,a])=>{let u=t[r];return C.jsx(esY,{id:`${n}.${r}`,readOnly:o,nestableWidget:a,content:oA.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 esX(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??[es0],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:C.jsx(l.ZA,{title:"Repeatable zone"+(r?` • ${r}`:""),addItemButtonTitle:"Add item in group",items:f,getItemKey:p,onAddItem:function(){o(f.concat(es1()))},children(t,r){let i=new Map(t.value),u=p(t);return C.jsx(l.MN,{index:r,title:"Item",onMove:h,onDelete:m,children:s.map(([s,c])=>{let l=i.get(s),p=oA.isNestableContent(l)?l:void 0;return C.jsx(esY,{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 es1(o)}let a=Array.from(new Map(t.value).set(r,i));return es1(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 es0={__TYPE__:"GroupItemContent",value:[]};function es1(t=[]){return{__TYPE__:"GroupItemContent",value:t}}function es2(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 C.jsx(i8.Provider,{value:a,children:C.jsxs(l.C3,{id:s,selected:f,children:[C.jsx(l.ax,{children:(i=p,o=g,[i.name,o.name].join(" • "))}),C.jsx(esQ,{...v,nonRepeatableZone:g.primary??{},content:u.primary,onContentChange(t){h({...u,primary:t})}}),C.jsx(esX,{...v,repeatableZone:g.items??{},content:u.items,onContentChange(t){h({...u,items:t})}})]})})}}}]);
|