@prismicio/editor-fields 0.1.0-rc.6 → 0.1.0

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/dist/index.umd.js CHANGED
@@ -1,8 +1,8 @@
1
- (function(ti,ue){typeof exports=="object"&&typeof module<"u"?ue(exports,require("react"),require("@prismicio/editor-ui"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","@prismicio/editor-ui","react-dom"],ue):(ti=typeof globalThis<"u"?globalThis:ti||self,ue(ti.EditorFields={},ti.React,ti.EditorUi,ti.ReactDOM))})(this,function(ti,ue,P,um){"use strict";const FM=e=>e&&typeof e=="object"&&"default"in e?e:{default:e};function DM(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const Pc=FM(ue),Te=DM(ue),M5=FM(um),x5=DM(um);var se=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Da(e){var t=e.default;if(typeof t=="function"){var n=function(){return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var LM={},ee={exports:{}};(function(e){var t,n,r,i,o,a,u,s,c,l,f,d,p,h,v,y,b,w,F,g,I,T,k,E,Y;(function(K){var x=typeof se=="object"?se:typeof self=="object"?self:typeof this=="object"?this:{};K(X(x,X(e.exports)));function X(O,R){return O!==x&&(typeof Object.create=="function"?Object.defineProperty(O,"__esModule",{value:!0}):O.__esModule=!0),function(W,L){return O[W]=R?R(W,L):L}}})(function(K){var x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(O,R){O.__proto__=R}||function(O,R){for(var W in R)Object.prototype.hasOwnProperty.call(R,W)&&(O[W]=R[W])};t=function(O,R){if(typeof R!="function"&&R!==null)throw new TypeError("Class extends value "+String(R)+" is not a constructor or null");x(O,R);function W(){this.constructor=O}O.prototype=R===null?Object.create(R):(W.prototype=R.prototype,new W)},n=Object.assign||function(O){for(var R,W=1,L=arguments.length;W<L;W++){R=arguments[W];for(var z in R)Object.prototype.hasOwnProperty.call(R,z)&&(O[z]=R[z])}return O},r=function(O,R){var W={};for(var L in O)Object.prototype.hasOwnProperty.call(O,L)&&R.indexOf(L)<0&&(W[L]=O[L]);if(O!=null&&typeof Object.getOwnPropertySymbols=="function")for(var z=0,L=Object.getOwnPropertySymbols(O);z<L.length;z++)R.indexOf(L[z])<0&&Object.prototype.propertyIsEnumerable.call(O,L[z])&&(W[L[z]]=O[L[z]]);return W},i=function(O,R,W,L){var z=arguments.length,j=z<3?R:L===null?L=Object.getOwnPropertyDescriptor(R,W):L,S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(O,R,W,L);else for(var _=O.length-1;_>=0;_--)(S=O[_])&&(j=(z<3?S(j):z>3?S(R,W,j):S(R,W))||j);return z>3&&j&&Object.defineProperty(R,W,j),j},o=function(O,R){return function(W,L){R(W,L,O)}},a=function(O,R){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(O,R)},u=function(O,R,W,L){function z(j){return j instanceof W?j:new W(function(S){S(j)})}return new(W||(W=Promise))(function(j,S){function _(ge){try{G(L.next(ge))}catch(he){S(he)}}function U(ge){try{G(L.throw(ge))}catch(he){S(he)}}function G(ge){ge.done?j(ge.value):z(ge.value).then(_,U)}G((L=L.apply(O,R||[])).next())})},s=function(O,R){var W={label:0,sent:function(){if(j[0]&1)throw j[1];return j[1]},trys:[],ops:[]},L,z,j,S;return S={next:_(0),throw:_(1),return:_(2)},typeof Symbol=="function"&&(S[Symbol.iterator]=function(){return this}),S;function _(G){return function(ge){return U([G,ge])}}function U(G){if(L)throw new TypeError("Generator is already executing.");for(;W;)try{if(L=1,z&&(j=G[0]&2?z.return:G[0]?z.throw||((j=z.return)&&j.call(z),0):z.next)&&!(j=j.call(z,G[1])).done)return j;switch(z=0,j&&(G=[G[0]&2,j.value]),G[0]){case 0:case 1:j=G;break;case 4:return W.label++,{value:G[1],done:!1};case 5:W.label++,z=G[1],G=[0];continue;case 7:G=W.ops.pop(),W.trys.pop();continue;default:if(j=W.trys,!(j=j.length>0&&j[j.length-1])&&(G[0]===6||G[0]===2)){W=0;continue}if(G[0]===3&&(!j||G[1]>j[0]&&G[1]<j[3])){W.label=G[1];break}if(G[0]===6&&W.label<j[1]){W.label=j[1],j=G;break}if(j&&W.label<j[2]){W.label=j[2],W.ops.push(G);break}j[2]&&W.ops.pop(),W.trys.pop();continue}G=R.call(O,W)}catch(ge){G=[6,ge],z=0}finally{L=j=0}if(G[0]&5)throw G[1];return{value:G[0]?G[1]:void 0,done:!0}}},c=function(O,R){for(var W in O)W!=="default"&&!Object.prototype.hasOwnProperty.call(R,W)&&Y(R,O,W)},Y=Object.create?function(O,R,W,L){L===void 0&&(L=W);var z=Object.getOwnPropertyDescriptor(R,W);(!z||("get"in z?!R.__esModule:z.writable||z.configurable))&&(z={enumerable:!0,get:function(){return R[W]}}),Object.defineProperty(O,L,z)}:function(O,R,W,L){L===void 0&&(L=W),O[L]=R[W]},l=function(O){var R=typeof Symbol=="function"&&Symbol.iterator,W=R&&O[R],L=0;if(W)return W.call(O);if(O&&typeof O.length=="number")return{next:function(){return O&&L>=O.length&&(O=void 0),{value:O&&O[L++],done:!O}}};throw new TypeError(R?"Object is not iterable.":"Symbol.iterator is not defined.")},f=function(O,R){var W=typeof Symbol=="function"&&O[Symbol.iterator];if(!W)return O;var L=W.call(O),z,j=[],S;try{for(;(R===void 0||R-- >0)&&!(z=L.next()).done;)j.push(z.value)}catch(_){S={error:_}}finally{try{z&&!z.done&&(W=L.return)&&W.call(L)}finally{if(S)throw S.error}}return j},d=function(){for(var O=[],R=0;R<arguments.length;R++)O=O.concat(f(arguments[R]));return O},p=function(){for(var O=0,R=0,W=arguments.length;R<W;R++)O+=arguments[R].length;for(var L=Array(O),z=0,R=0;R<W;R++)for(var j=arguments[R],S=0,_=j.length;S<_;S++,z++)L[z]=j[S];return L},h=function(O,R,W){if(W||arguments.length===2)for(var L=0,z=R.length,j;L<z;L++)(j||!(L in R))&&(j||(j=Array.prototype.slice.call(R,0,L)),j[L]=R[L]);return O.concat(j||Array.prototype.slice.call(R))},v=function(O){return this instanceof v?(this.v=O,this):new v(O)},y=function(O,R,W){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var L=W.apply(O,R||[]),z,j=[];return z={},S("next"),S("throw"),S("return"),z[Symbol.asyncIterator]=function(){return this},z;function S(Se){L[Se]&&(z[Se]=function(Qe){return new Promise(function(Ft,Jt){j.push([Se,Qe,Ft,Jt])>1||_(Se,Qe)})})}function _(Se,Qe){try{U(L[Se](Qe))}catch(Ft){he(j[0][3],Ft)}}function U(Se){Se.value instanceof v?Promise.resolve(Se.value.v).then(G,ge):he(j[0][2],Se)}function G(Se){_("next",Se)}function ge(Se){_("throw",Se)}function he(Se,Qe){Se(Qe),j.shift(),j.length&&_(j[0][0],j[0][1])}},b=function(O){var R,W;return R={},L("next"),L("throw",function(z){throw z}),L("return"),R[Symbol.iterator]=function(){return this},R;function L(z,j){R[z]=O[z]?function(S){return(W=!W)?{value:v(O[z](S)),done:z==="return"}:j?j(S):S}:j}},w=function(O){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var R=O[Symbol.asyncIterator],W;return R?R.call(O):(O=typeof l=="function"?l(O):O[Symbol.iterator](),W={},L("next"),L("throw"),L("return"),W[Symbol.asyncIterator]=function(){return this},W);function L(j){W[j]=O[j]&&function(S){return new Promise(function(_,U){S=O[j](S),z(_,U,S.done,S.value)})}}function z(j,S,_,U){Promise.resolve(U).then(function(G){j({value:G,done:_})},S)}},F=function(O,R){return Object.defineProperty?Object.defineProperty(O,"raw",{value:R}):O.raw=R,O};var X=Object.create?function(O,R){Object.defineProperty(O,"default",{enumerable:!0,value:R})}:function(O,R){O.default=R};g=function(O){if(O&&O.__esModule)return O;var R={};if(O!=null)for(var W in O)W!=="default"&&Object.prototype.hasOwnProperty.call(O,W)&&Y(R,O,W);return X(R,O),R},I=function(O){return O&&O.__esModule?O:{default:O}},T=function(O,R,W,L){if(W==="a"&&!L)throw new TypeError("Private accessor was defined without a getter");if(typeof R=="function"?O!==R||!L:!R.has(O))throw new TypeError("Cannot read private member from an object whose class did not declare it");return W==="m"?L:W==="a"?L.call(O):L?L.value:R.get(O)},k=function(O,R,W,L,z){if(L==="m")throw new TypeError("Private method is not writable");if(L==="a"&&!z)throw new TypeError("Private accessor was defined without a setter");if(typeof R=="function"?O!==R||!z:!R.has(O))throw new TypeError("Cannot write private member to an object whose class did not declare it");return L==="a"?z.call(O,W):z?z.value=W:R.set(O,W),W},E=function(O,R){if(R===null||typeof R!="object"&&typeof R!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof O=="function"?R===O:O.has(R)},K("__extends",t),K("__assign",n),K("__rest",r),K("__decorate",i),K("__param",o),K("__metadata",a),K("__awaiter",u),K("__generator",s),K("__exportStar",c),K("__createBinding",Y),K("__values",l),K("__read",f),K("__spread",d),K("__spreadArrays",p),K("__spreadArray",h),K("__await",v),K("__asyncGenerator",y),K("__asyncDelegator",b),K("__asyncValues",w),K("__makeTemplateObject",F),K("__importStar",g),K("__importDefault",I),K("__classPrivateFieldGet",T),K("__classPrivateFieldSet",k),K("__classPrivateFieldIn",E)})})(ee);var pn={},_o={},Fc={},Gt={},La={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getEndomorphismMonoid=e.not=e.SK=e.hole=e.pipe=e.untupled=e.tupled=e.absurd=e.decrement=e.increment=e.tuple=e.flow=e.flip=e.constVoid=e.constUndefined=e.constNull=e.constFalse=e.constTrue=e.constant=e.unsafeCoerce=e.identity=e.apply=e.getRing=e.getSemiring=e.getMonoid=e.getSemigroup=e.getBooleanAlgebra=void 0;var t=function(I){return function(){return{meet:function(T,k){return function(E){return I.meet(T(E),k(E))}},join:function(T,k){return function(E){return I.join(T(E),k(E))}},zero:function(){return I.zero},one:function(){return I.one},implies:function(T,k){return function(E){return I.implies(T(E),k(E))}},not:function(T){return function(k){return I.not(T(k))}}}}};e.getBooleanAlgebra=t;var n=function(I){return function(){return{concat:function(T,k){return function(E){return I.concat(T(E),k(E))}}}}};e.getSemigroup=n;var r=function(I){var T=(0,e.getSemigroup)(I);return function(){return{concat:T().concat,empty:function(){return I.empty}}}};e.getMonoid=r;var i=function(I){return{add:function(T,k){return function(E){return I.add(T(E),k(E))}},zero:function(){return I.zero},mul:function(T,k){return function(E){return I.mul(T(E),k(E))}},one:function(){return I.one}}};e.getSemiring=i;var o=function(I){var T=(0,e.getSemiring)(I);return{add:T.add,mul:T.mul,one:T.one,zero:T.zero,sub:function(k,E){return function(Y){return I.sub(k(Y),E(Y))}}}};e.getRing=o;var a=function(I){return function(T){return T(I)}};e.apply=a;function u(I){return I}e.identity=u,e.unsafeCoerce=u;function s(I){return function(){return I}}e.constant=s,e.constTrue=s(!0),e.constFalse=s(!1),e.constNull=s(null),e.constUndefined=s(void 0),e.constVoid=e.constUndefined;function c(I){return function(T,k){return I(k,T)}}e.flip=c;function l(I,T,k,E,Y,K,x,X,O){switch(arguments.length){case 1:return I;case 2:return function(){return T(I.apply(this,arguments))};case 3:return function(){return k(T(I.apply(this,arguments)))};case 4:return function(){return E(k(T(I.apply(this,arguments))))};case 5:return function(){return Y(E(k(T(I.apply(this,arguments)))))};case 6:return function(){return K(Y(E(k(T(I.apply(this,arguments))))))};case 7:return function(){return x(K(Y(E(k(T(I.apply(this,arguments)))))))};case 8:return function(){return X(x(K(Y(E(k(T(I.apply(this,arguments))))))))};case 9:return function(){return O(X(x(K(Y(E(k(T(I.apply(this,arguments)))))))))}}}e.flow=l;function f(){for(var I=[],T=0;T<arguments.length;T++)I[T]=arguments[T];return I}e.tuple=f;function d(I){return I+1}e.increment=d;function p(I){return I-1}e.decrement=p;function h(I){throw new Error("Called `absurd` function which should be uncallable")}e.absurd=h;function v(I){return function(T){return I.apply(void 0,T)}}e.tupled=v;function y(I){return function(){for(var T=[],k=0;k<arguments.length;k++)T[k]=arguments[k];return I(T)}}e.untupled=y;function b(I,T,k,E,Y,K,x,X,O){switch(arguments.length){case 1:return I;case 2:return T(I);case 3:return k(T(I));case 4:return E(k(T(I)));case 5:return Y(E(k(T(I))));case 6:return K(Y(E(k(T(I)))));case 7:return x(K(Y(E(k(T(I))))));case 8:return X(x(K(Y(E(k(T(I)))))));case 9:return O(X(x(K(Y(E(k(T(I))))))));default:{for(var R=arguments[0],W=1;W<arguments.length;W++)R=arguments[W](R);return R}}}e.pipe=b,e.hole=h;var w=function(I,T){return T};e.SK=w;function F(I){return function(T){return!I(T)}}e.not=F;var g=function(){return{concat:function(I,T){return l(I,T)},empty:u}};e.getEndomorphismMonoid=g})(La);var Re={},C5=se&&se.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))};Object.defineProperty(Re,"__esModule",{value:!0}),Re.fromReadonlyNonEmptyArray=Re.has=Re.emptyRecord=Re.emptyReadonlyArray=Re.tail=Re.head=Re.isNonEmpty=Re.singleton=Re.right=Re.left=Re.isRight=Re.isLeft=Re.some=Re.none=Re.isSome=Re.isNone=void 0;var A5=function(e){return e._tag==="None"};Re.isNone=A5;var k5=function(e){return e._tag==="Some"};Re.isSome=k5,Re.none={_tag:"None"};var W5=function(e){return{_tag:"Some",value:e}};Re.some=W5;var N5=function(e){return e._tag==="Left"};Re.isLeft=N5;var P5=function(e){return e._tag==="Right"};Re.isRight=P5;var F5=function(e){return{_tag:"Left",left:e}};Re.left=F5;var D5=function(e){return{_tag:"Right",right:e}};Re.right=D5;var L5=function(e){return[e]};Re.singleton=L5;var j5=function(e){return e.length>0};Re.isNonEmpty=j5;var U5=function(e){return e[0]};Re.head=U5;var B5=function(e){return e.slice(1)};Re.tail=B5,Re.emptyReadonlyArray=[],Re.emptyRecord={},Re.has=Object.prototype.hasOwnProperty;var z5=function(e){return C5([e[0]],e.slice(1),!0)};Re.fromReadonlyNonEmptyArray=z5;var q5=se&&se.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),K5=se&&se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),V5=se&&se.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&q5(t,e,n);return K5(t,e),t};Object.defineProperty(Gt,"__esModule",{value:!0}),Gt.sequenceS=Gt.sequenceT=Gt.getApplySemigroup=Gt.apS=Gt.apSecond=Gt.apFirst=Gt.ap=void 0;var H5=La,J5=V5(Re);function G5(e,t){return function(n){return function(r){return e.ap(e.map(r,function(i){return function(o){return t.ap(i,o)}}),n)}}}Gt.ap=G5;function Y5(e){return function(t){return function(n){return e.ap(e.map(n,function(r){return function(){return r}}),t)}}}Gt.apFirst=Y5;function Z5(e){return function(t){return function(n){return e.ap(e.map(n,function(){return function(r){return r}}),t)}}}Gt.apSecond=Z5;function X5(e){return function(t,n){return function(r){return e.ap(e.map(r,function(i){return function(o){var a;return Object.assign({},i,(a={},a[t]=o,a))}}),n)}}}Gt.apS=X5;function Q5(e){return function(t){return{concat:function(n,r){return e.ap(e.map(n,function(i){return function(o){return t.concat(i,o)}}),r)}}}}Gt.getApplySemigroup=Q5;function M$(e,t,n){return function(r){for(var i=Array(n.length+1),o=0;o<n.length;o++)i[o]=n[o];return i[n.length]=r,t===0?e.apply(null,i):M$(e,t-1,i)}}var x$={1:function(e){return[e]},2:function(e){return function(t){return[e,t]}},3:function(e){return function(t){return function(n){return[e,t,n]}}},4:function(e){return function(t){return function(n){return function(r){return[e,t,n,r]}}}},5:function(e){return function(t){return function(n){return function(r){return function(i){return[e,t,n,r,i]}}}}}};function eH(e){return J5.has.call(x$,e)||(x$[e]=M$(H5.tuple,e-1,[])),x$[e]}function tH(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r=t.length,i=eH(r),o=e.map(t[0],i),a=1;a<r;a++)o=e.ap(o,t[a]);return o}}Gt.sequenceT=tH;function nH(e){var t=e.length;switch(t){case 1:return function(n){var r;return r={},r[e[0]]=n,r};case 2:return function(n){return function(r){var i;return i={},i[e[0]]=n,i[e[1]]=r,i}};case 3:return function(n){return function(r){return function(i){var o;return o={},o[e[0]]=n,o[e[1]]=r,o[e[2]]=i,o}}};case 4:return function(n){return function(r){return function(i){return function(o){var a;return a={},a[e[0]]=n,a[e[1]]=r,a[e[2]]=i,a[e[3]]=o,a}}}};case 5:return function(n){return function(r){return function(i){return function(o){return function(a){var u;return u={},u[e[0]]=n,u[e[1]]=r,u[e[2]]=i,u[e[3]]=o,u[e[4]]=a,u}}}}};default:return M$(function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i={},o=0;o<t;o++)i[e[o]]=n[o];return i},t-1,[])}}function rH(e){return function(t){for(var n=Object.keys(t),r=n.length,i=nH(n),o=e.map(t[n[0]],i),a=1;a<r;a++)o=e.ap(o,t[n[a]]);return o}}Gt.sequenceS=rH;var xr={};Object.defineProperty(xr,"__esModule",{value:!0}),xr.getFunctorComposition=xr.bindTo=xr.flap=xr.map=void 0;var iH=La;function jM(e,t){return function(n){return function(r){return e.map(r,function(i){return t.map(i,n)})}}}xr.map=jM;function oH(e){return function(t){return function(n){return e.map(n,function(r){return r(t)})}}}xr.flap=oH;function aH(e){return function(t){return function(n){return e.map(n,function(r){var i;return i={},i[t]=r,i})}}}xr.bindTo=aH;function uH(e,t){var n=jM(e,t);return{map:function(r,i){return(0,iH.pipe)(r,n(i))}}}xr.getFunctorComposition=uH,Object.defineProperty(Fc,"__esModule",{value:!0}),Fc.getApplicativeComposition=Fc.getApplicativeMonoid=void 0;var UM=Gt,sH=La,cH=xr;function lH(e){var t=(0,UM.getApplySemigroup)(e);return function(n){return{concat:t(n).concat,empty:e.of(n.empty)}}}Fc.getApplicativeMonoid=lH;function fH(e,t){var n=(0,cH.getFunctorComposition)(e,t).map,r=(0,UM.ap)(e,t);return{map:n,of:function(i){return e.of(t.of(i))},ap:function(i,o){return(0,sH.pipe)(i,r(o))}}}Fc.getApplicativeComposition=fH;var Xu={};Object.defineProperty(Xu,"__esModule",{value:!0}),Xu.bind=Xu.chainFirst=void 0;function dH(e){return function(t){return function(n){return e.chain(n,function(r){return e.map(t(r),function(){return r})})}}}Xu.chainFirst=dH;function pH(e){return function(t,n){return function(r){return e.chain(r,function(i){return e.map(n(i),function(o){var a;return Object.assign({},i,(a={},a[t]=o,a))})})}}}Xu.bind=pH;var sm={};Object.defineProperty(sm,"__esModule",{value:!0}),sm.tailRec=void 0;var hH=function(e,t){for(var n=t(e);n._tag==="Left";)n=t(n.left);return n.right};sm.tailRec=hH;var Dt={},mH=se&&se.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),vH=se&&se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),gH=se&&se.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&mH(t,e,n);return vH(t,e),t};Object.defineProperty(Dt,"__esModule",{value:!0}),Dt.filterOrElse=Dt.chainFirstEitherK=Dt.chainEitherK=Dt.fromEitherK=Dt.chainOptionK=Dt.fromOptionK=Dt.fromPredicate=Dt.fromOption=void 0;var yH=Xu,C$=La,Qu=gH(Re);function BM(e){return function(t){return function(n){return e.fromEither(Qu.isNone(n)?Qu.left(t()):Qu.right(n.value))}}}Dt.fromOption=BM;function bH(e){return function(t,n){return function(r){return e.fromEither(t(r)?Qu.right(r):Qu.left(n(r)))}}}Dt.fromPredicate=bH;function zM(e){var t=BM(e);return function(n){var r=t(n);return function(i){return(0,C$.flow)(i,r)}}}Dt.fromOptionK=zM;function $H(e,t){var n=zM(e);return function(r){var i=n(r);return function(o){return function(a){return t.chain(a,i(o))}}}}Dt.chainOptionK=$H;function A$(e){return function(t){return(0,C$.flow)(t,e.fromEither)}}Dt.fromEitherK=A$;function _H(e,t){var n=A$(e);return function(r){return function(i){return t.chain(i,n(r))}}}Dt.chainEitherK=_H;function SH(e,t){return(0,C$.flow)(A$(e),(0,yH.chainFirst)(t))}Dt.chainFirstEitherK=SH;function TH(e,t){return function(n,r){return function(i){return t.chain(i,function(o){return e.fromEither(n(o)?Qu.right(o):Qu.left(r(o)))})}}}Dt.filterOrElse=TH;var qM={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.right=e.left=e.flap=e.Functor=e.Bifunctor=e.URI=e.bimap=e.mapLeft=e.map=e.separated=void 0;var t=La,n=xr,r=function(d,p){return{left:d,right:p}};e.separated=r;var i=function(d,p){return(0,t.pipe)(d,(0,e.map)(p))},o=function(d,p){return(0,t.pipe)(d,(0,e.mapLeft)(p))},a=function(d,p,h){return(0,t.pipe)(d,(0,e.bimap)(p,h))},u=function(d){return function(p){return(0,e.separated)((0,e.left)(p),d((0,e.right)(p)))}};e.map=u;var s=function(d){return function(p){return(0,e.separated)(d((0,e.left)(p)),(0,e.right)(p))}};e.mapLeft=s;var c=function(d,p){return function(h){return(0,e.separated)(d((0,e.left)(h)),p((0,e.right)(h)))}};e.bimap=c,e.URI="Separated",e.Bifunctor={URI:e.URI,mapLeft:o,bimap:a},e.Functor={URI:e.URI,map:i},e.flap=(0,n.flap)(e.Functor);var l=function(d){return d.left};e.left=l;var f=function(d){return d.right};e.right=f})(qM);var ja={},IH=se&&se.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),OH=se&&se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),wH=se&&se.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&IH(t,e,n);return OH(t,e),t};Object.defineProperty(ja,"__esModule",{value:!0}),ja.filterE=ja.witherDefault=ja.wiltDefault=void 0;var KM=wH(Re);function EH(e,t){return function(n){var r=e.traverse(n);return function(i,o){return n.map(r(i,o),t.separate)}}}ja.wiltDefault=EH;function RH(e,t){return function(n){var r=e.traverse(n);return function(i,o){return n.map(r(i,o),t.compact)}}}ja.witherDefault=RH;function MH(e){return function(t){var n=e.wither(t);return function(r){return function(i){return n(i,function(o){return t.map(r(o),function(a){return a?KM.some(o):KM.none})})}}}}ja.filterE=MH,function(e){var t=se&&se.__createBinding||(Object.create?function(C,M,D,Me){Me===void 0&&(Me=D);var A=Object.getOwnPropertyDescriptor(M,D);(!A||("get"in A?!M.__esModule:A.writable||A.configurable))&&(A={enumerable:!0,get:function(){return M[D]}}),Object.defineProperty(C,Me,A)}:function(C,M,D,Me){Me===void 0&&(Me=D),C[Me]=M[D]}),n=se&&se.__setModuleDefault||(Object.create?function(C,M){Object.defineProperty(C,"default",{enumerable:!0,value:M})}:function(C,M){C.default=M}),r=se&&se.__importStar||function(C){if(C&&C.__esModule)return C;var M={};if(C!=null)for(var D in C)D!=="default"&&Object.prototype.hasOwnProperty.call(C,D)&&t(M,C,D);return n(M,C),M};Object.defineProperty(e,"__esModule",{value:!0}),e.fold=e.match=e.foldW=e.matchW=e.isRight=e.isLeft=e.fromOption=e.fromPredicate=e.FromEither=e.MonadThrow=e.throwError=e.ChainRec=e.Extend=e.extend=e.Alt=e.alt=e.altW=e.Bifunctor=e.mapLeft=e.bimap=e.Traversable=e.sequence=e.traverse=e.Foldable=e.reduceRight=e.foldMap=e.reduce=e.Monad=e.Chain=e.chain=e.chainW=e.Applicative=e.Apply=e.ap=e.apW=e.Pointed=e.of=e.Functor=e.map=e.getAltValidation=e.getApplicativeValidation=e.getWitherable=e.getFilterable=e.getCompactable=e.getSemigroup=e.getEq=e.getShow=e.URI=e.right=e.left=void 0,e.getValidation=e.getValidationMonoid=e.getValidationSemigroup=e.getApplyMonoid=e.getApplySemigroup=e.either=e.stringifyJSON=e.parseJSON=e.sequenceArray=e.traverseArray=e.traverseArrayWithIndex=e.traverseReadonlyArrayWithIndex=e.traverseReadonlyNonEmptyArrayWithIndex=e.ApT=e.apSW=e.apS=e.bindW=e.bind=e.bindTo=e.Do=e.exists=e.elem=e.toError=e.toUnion=e.chainNullableK=e.fromNullableK=e.tryCatchK=e.tryCatch=e.fromNullable=e.orElse=e.orElseW=e.swap=e.filterOrElseW=e.filterOrElse=e.chainOptionK=e.fromOptionK=e.duplicate=e.flatten=e.flattenW=e.chainFirstW=e.chainFirst=e.apSecondW=e.apSecond=e.apFirstW=e.apFirst=e.flap=e.getOrElse=e.getOrElseW=void 0;var i=Fc,o=Gt,a=Xu,u=sm,s=Dt,c=La,l=xr,f=r(Re),d=qM,p=ja;e.left=f.left,e.right=f.right;var h=function(C,M){return(0,c.pipe)(C,(0,e.map)(M))},v=function(C,M){return(0,c.pipe)(C,(0,e.ap)(M))},y=function(C,M){return(0,c.pipe)(C,(0,e.chain)(M))},b=function(C,M,D){return(0,c.pipe)(C,(0,e.reduce)(M,D))},w=function(C){return function(M,D){var Me=(0,e.foldMap)(C);return(0,c.pipe)(M,Me(D))}},F=function(C,M,D){return(0,c.pipe)(C,(0,e.reduceRight)(M,D))},g=function(C){var M=(0,e.traverse)(C);return function(D,Me){return(0,c.pipe)(D,M(Me))}},I=function(C,M,D){return(0,c.pipe)(C,(0,e.bimap)(M,D))},T=function(C,M){return(0,c.pipe)(C,(0,e.mapLeft)(M))},k=function(C,M){return(0,c.pipe)(C,(0,e.alt)(M))},E=function(C,M){return(0,c.pipe)(C,(0,e.extend)(M))},Y=function(C,M){return(0,u.tailRec)(M(C),function(D){return(0,e.isLeft)(D)?(0,e.right)((0,e.left)(D.left)):(0,e.isLeft)(D.right)?(0,e.left)(M(D.right.left)):(0,e.right)((0,e.right)(D.right.right))})};e.URI="Either";var K=function(C,M){return{show:function(D){return(0,e.isLeft)(D)?"left(".concat(C.show(D.left),")"):"right(".concat(M.show(D.right),")")}}};e.getShow=K;var x=function(C,M){return{equals:function(D,Me){return D===Me||((0,e.isLeft)(D)?(0,e.isLeft)(Me)&&C.equals(D.left,Me.left):(0,e.isRight)(Me)&&M.equals(D.right,Me.right))}}};e.getEq=x;var X=function(C){return{concat:function(M,D){return(0,e.isLeft)(D)?M:(0,e.isLeft)(M)?D:(0,e.right)(C.concat(M.right,D.right))}}};e.getSemigroup=X;var O=function(C){var M=(0,e.left)(C.empty);return{URI:e.URI,_E:void 0,compact:function(D){return(0,e.isLeft)(D)?D:D.right._tag==="None"?M:(0,e.right)(D.right.value)},separate:function(D){return(0,e.isLeft)(D)?(0,d.separated)(D,D):(0,e.isLeft)(D.right)?(0,d.separated)((0,e.right)(D.right.left),M):(0,d.separated)(M,(0,e.right)(D.right.right))}}};e.getCompactable=O;var R=function(C){var M=(0,e.left)(C.empty),D=(0,e.getCompactable)(C),Me=D.compact,A=D.separate,ne=function(de,$e){return(0,e.isLeft)(de)||$e(de.right)?de:M},pe=function(de,$e){return(0,e.isLeft)(de)?(0,d.separated)(de,de):$e(de.right)?(0,d.separated)(M,(0,e.right)(de.right)):(0,d.separated)((0,e.right)(de.right),M)};return{URI:e.URI,_E:void 0,map:h,compact:Me,separate:A,filter:ne,filterMap:function(de,$e){if((0,e.isLeft)(de))return de;var it=$e(de.right);return it._tag==="None"?M:(0,e.right)(it.value)},partition:pe,partitionMap:function(de,$e){if((0,e.isLeft)(de))return(0,d.separated)(de,de);var it=$e(de.right);return(0,e.isLeft)(it)?(0,d.separated)((0,e.right)(it.left),M):(0,d.separated)(M,(0,e.right)(it.right))}}};e.getFilterable=R;var W=function(C){var M=(0,e.getFilterable)(C),D=(0,e.getCompactable)(C);return{URI:e.URI,_E:void 0,map:h,compact:M.compact,separate:M.separate,filter:M.filter,filterMap:M.filterMap,partition:M.partition,partitionMap:M.partitionMap,traverse:g,sequence:e.sequence,reduce:b,foldMap:w,reduceRight:F,wither:(0,p.witherDefault)(e.Traversable,D),wilt:(0,p.wiltDefault)(e.Traversable,D)}};e.getWitherable=W;var L=function(C){return{URI:e.URI,_E:void 0,map:h,ap:function(M,D){return(0,e.isLeft)(M)?(0,e.isLeft)(D)?(0,e.left)(C.concat(M.left,D.left)):M:(0,e.isLeft)(D)?D:(0,e.right)(M.right(D.right))},of:e.of}};e.getApplicativeValidation=L;var z=function(C){return{URI:e.URI,_E:void 0,map:h,alt:function(M,D){if((0,e.isRight)(M))return M;var Me=D();return(0,e.isLeft)(Me)?(0,e.left)(C.concat(M.left,Me.left)):Me}}};e.getAltValidation=z;var j=function(C){return function(M){return(0,e.isLeft)(M)?M:(0,e.right)(C(M.right))}};e.map=j,e.Functor={URI:e.URI,map:h},e.of=e.right,e.Pointed={URI:e.URI,of:e.of};var S=function(C){return function(M){return(0,e.isLeft)(M)?M:(0,e.isLeft)(C)?C:(0,e.right)(M.right(C.right))}};e.apW=S,e.ap=e.apW,e.Apply={URI:e.URI,map:h,ap:v},e.Applicative={URI:e.URI,map:h,ap:v,of:e.of};var _=function(C){return function(M){return(0,e.isLeft)(M)?M:C(M.right)}};e.chainW=_,e.chain=e.chainW,e.Chain={URI:e.URI,map:h,ap:v,chain:y},e.Monad={URI:e.URI,map:h,ap:v,of:e.of,chain:y};var U=function(C,M){return function(D){return(0,e.isLeft)(D)?C:M(C,D.right)}};e.reduce=U;var G=function(C){return function(M){return function(D){return(0,e.isLeft)(D)?C.empty:M(D.right)}}};e.foldMap=G;var ge=function(C,M){return function(D){return(0,e.isLeft)(D)?C:M(D.right,C)}};e.reduceRight=ge,e.Foldable={URI:e.URI,reduce:b,foldMap:w,reduceRight:F};var he=function(C){return function(M){return function(D){return(0,e.isLeft)(D)?C.of((0,e.left)(D.left)):C.map(M(D.right),e.right)}}};e.traverse=he;var Se=function(C){return function(M){return(0,e.isLeft)(M)?C.of((0,e.left)(M.left)):C.map(M.right,e.right)}};e.sequence=Se,e.Traversable={URI:e.URI,map:h,reduce:b,foldMap:w,reduceRight:F,traverse:g,sequence:e.sequence};var Qe=function(C,M){return function(D){return(0,e.isLeft)(D)?(0,e.left)(C(D.left)):(0,e.right)(M(D.right))}};e.bimap=Qe;var Ft=function(C){return function(M){return(0,e.isLeft)(M)?(0,e.left)(C(M.left)):M}};e.mapLeft=Ft,e.Bifunctor={URI:e.URI,bimap:I,mapLeft:T};var Jt=function(C){return function(M){return(0,e.isLeft)(M)?C():M}};e.altW=Jt,e.alt=e.altW,e.Alt={URI:e.URI,map:h,alt:k};var Yr=function(C){return function(M){return(0,e.isLeft)(M)?M:(0,e.right)(C(M))}};e.extend=Yr,e.Extend={URI:e.URI,map:h,extend:E},e.ChainRec={URI:e.URI,map:h,ap:v,chain:y,chainRec:Y},e.throwError=e.left,e.MonadThrow={URI:e.URI,map:h,ap:v,of:e.of,chain:y,throwError:e.throwError},e.FromEither={URI:e.URI,fromEither:c.identity},e.fromPredicate=(0,s.fromPredicate)(e.FromEither),e.fromOption=(0,s.fromOption)(e.FromEither),e.isLeft=f.isLeft,e.isRight=f.isRight;var Wn=function(C,M){return function(D){return(0,e.isLeft)(D)?C(D.left):M(D.right)}};e.matchW=Wn,e.foldW=e.matchW,e.match=e.matchW,e.fold=e.match;var bo=function(C){return function(M){return(0,e.isLeft)(M)?C(M.left):M.right}};e.getOrElseW=bo,e.getOrElse=e.getOrElseW,e.flap=(0,l.flap)(e.Functor),e.apFirst=(0,o.apFirst)(e.Apply),e.apFirstW=e.apFirst,e.apSecond=(0,o.apSecond)(e.Apply),e.apSecondW=e.apSecond,e.chainFirst=(0,a.chainFirst)(e.Chain),e.chainFirstW=e.chainFirst,e.flattenW=(0,e.chainW)(c.identity),e.flatten=e.flattenW,e.duplicate=(0,e.extend)(c.identity),e.fromOptionK=(0,s.fromOptionK)(e.FromEither),e.chainOptionK=(0,s.chainOptionK)(e.FromEither,e.Chain),e.filterOrElse=(0,s.filterOrElse)(e.FromEither,e.Chain),e.filterOrElseW=e.filterOrElse;var xa=function(C){return(0,e.isLeft)(C)?(0,e.right)(C.left):(0,e.left)(C.right)};e.swap=xa;var Ca=function(C){return function(M){return(0,e.isLeft)(M)?C(M.left):M}};e.orElseW=Ca,e.orElse=e.orElseW;var Yu=function(C){return function(M){return M==null?(0,e.left)(C):(0,e.right)(M)}};e.fromNullable=Yu;var ki=function(C,M){try{return(0,e.right)(C())}catch(D){return(0,e.left)(M(D))}};e.tryCatch=ki;var Zr=function(C,M){return function(){for(var D=[],Me=0;Me<arguments.length;Me++)D[Me]=arguments[Me];return(0,e.tryCatch)(function(){return C.apply(void 0,D)},M)}};e.tryCatchK=Zr;var $o=function(C){var M=(0,e.fromNullable)(C);return function(D){return(0,c.flow)(D,M)}};e.fromNullableK=$o;var Aa=function(C){var M=(0,e.fromNullableK)(C);return function(D){return(0,e.chain)(M(D))}};e.chainNullableK=Aa,e.toUnion=(0,e.foldW)(c.identity,c.identity);function Wi(C){return C instanceof Error?C:new Error(String(C))}e.toError=Wi;function ir(C){return function(M,D){if(D===void 0){var Me=ir(C);return function(A){return Me(M,A)}}return(0,e.isLeft)(D)?!1:C.equals(M,D.right)}}e.elem=ir;var Xr=function(C){return function(M){return(0,e.isLeft)(M)?!1:C(M.right)}};e.exists=Xr,e.Do=(0,e.of)(f.emptyRecord),e.bindTo=(0,l.bindTo)(e.Functor),e.bind=(0,a.bind)(e.Chain),e.bindW=e.bind,e.apS=(0,o.apS)(e.Apply),e.apSW=e.apS,e.ApT=(0,e.of)(f.emptyReadonlyArray);var Ni=function(C){return function(M){var D=C(0,f.head(M));if((0,e.isLeft)(D))return D;for(var Me=[D.right],A=1;A<M.length;A++){var ne=C(A,M[A]);if((0,e.isLeft)(ne))return ne;Me.push(ne.right)}return(0,e.right)(Me)}};e.traverseReadonlyNonEmptyArrayWithIndex=Ni;var Pi=function(C){var M=(0,e.traverseReadonlyNonEmptyArrayWithIndex)(C);return function(D){return f.isNonEmpty(D)?M(D):e.ApT}};e.traverseReadonlyArrayWithIndex=Pi,e.traverseArrayWithIndex=e.traverseReadonlyArrayWithIndex;var ka=function(C){return(0,e.traverseReadonlyArrayWithIndex)(function(M,D){return C(D)})};e.traverseArray=ka,e.sequenceArray=(0,e.traverseArray)(c.identity);function Wa(C,M){return(0,e.tryCatch)(function(){return JSON.parse(C)},M)}e.parseJSON=Wa;var Na=function(C,M){return(0,e.tryCatch)(function(){var D=JSON.stringify(C);if(typeof D!="string")throw new Error("Converting unsupported structure to JSON");return D},M)};e.stringifyJSON=Na,e.either={URI:e.URI,map:h,of:e.of,ap:v,chain:y,reduce:b,foldMap:w,reduceRight:F,traverse:g,sequence:e.sequence,bimap:I,mapLeft:T,alt:k,extend:E,chainRec:Y,throwError:e.throwError},e.getApplySemigroup=(0,o.getApplySemigroup)(e.Apply),e.getApplyMonoid=(0,i.getApplicativeMonoid)(e.Applicative);var Qr=function(C,M){return(0,o.getApplySemigroup)((0,e.getApplicativeValidation)(C))(M)};e.getValidationSemigroup=Qr;var Zu=function(C,M){return(0,i.getApplicativeMonoid)((0,e.getApplicativeValidation)(C))(M)};e.getValidationMonoid=Zu;function sd(C){var M=(0,e.getApplicativeValidation)(C).ap,D=(0,e.getAltValidation)(C).alt;return{URI:e.URI,_E:void 0,map:h,of:e.of,chain:y,bimap:I,mapLeft:T,reduce:b,foldMap:w,reduceRight:F,extend:E,traverse:g,sequence:e.sequence,chainRec:Y,throwError:e.throwError,ap:M,alt:D}}e.getValidation=sd}(_o);var VM=function(e){return function(){return{meet:function(t,n){return function(r){return e.meet(t(r),n(r))}},join:function(t,n){return function(r){return e.join(t(r),n(r))}},zero:function(){return e.zero},one:function(){return e.one},implies:function(t,n){return function(r){return e.implies(t(r),n(r))}},not:function(t){return function(n){return e.not(t(n))}}}}},k$=function(e){return function(){return{concat:function(t,n){return function(r){return e.concat(t(r),n(r))}}}}},HM=function(e){var t=k$(e);return function(){return{concat:t().concat,empty:function(){return e.empty}}}},W$=function(e){return{add:function(t,n){return function(r){return e.add(t(r),n(r))}},zero:function(){return e.zero},mul:function(t,n){return function(r){return e.mul(t(r),n(r))}},one:function(){return e.one}}},JM=function(e){var t=W$(e);return{add:t.add,mul:t.mul,one:t.one,zero:t.zero,sub:function(n,r){return function(i){return e.sub(n(i),r(i))}}}},xH=function(e){return function(t){return t(e)}};function B(e){return e}var Dc=B;function Fn(e){return function(){return e}}var N$=Fn(!0),GM=Fn(!1),YM=Fn(null),P$=Fn(void 0),CH=P$;function AH(e){return function(t,n){return e(n,t)}}function H(e,t,n,r,i,o,a,u,s){switch(arguments.length){case 1:return e;case 2:return function(){return t(e.apply(this,arguments))};case 3:return function(){return n(t(e.apply(this,arguments)))};case 4:return function(){return r(n(t(e.apply(this,arguments))))};case 5:return function(){return i(r(n(t(e.apply(this,arguments)))))};case 6:return function(){return o(i(r(n(t(e.apply(this,arguments))))))};case 7:return function(){return a(o(i(r(n(t(e.apply(this,arguments)))))))};case 8:return function(){return u(a(o(i(r(n(t(e.apply(this,arguments))))))))};case 9:return function(){return s(u(a(o(i(r(n(t(e.apply(this,arguments)))))))))}}}function ZM(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e}function kH(e){return e+1}function WH(e){return e-1}function XM(e){throw new Error("Called `absurd` function which should be uncallable")}function NH(e){return function(t){return e.apply(void 0,t)}}function PH(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e(t)}}function m(e,t,n,r,i,o,a,u,s){switch(arguments.length){case 1:return e;case 2:return t(e);case 3:return n(t(e));case 4:return r(n(t(e)));case 5:return i(r(n(t(e))));case 6:return o(i(r(n(t(e)))));case 7:return a(o(i(r(n(t(e))))));case 8:return u(a(o(i(r(n(t(e)))))));case 9:return s(u(a(o(i(r(n(t(e))))))));default:{for(var c=arguments[0],l=1;l<arguments.length;l++)c=arguments[l](c);return c}}}var FH=XM,Dn=function(e,t){return t};function DH(e){return function(t){return!e(t)}}var LH=function(){return{concat:function(e,t){return H(e,t)},empty:B}};const QM=Object.freeze(Object.defineProperty({__proto__:null,getBooleanAlgebra:VM,getSemigroup:k$,getMonoid:HM,getSemiring:W$,getRing:JM,apply:xH,identity:B,unsafeCoerce:Dc,constant:Fn,constTrue:N$,constFalse:GM,constNull:YM,constUndefined:P$,constVoid:CH,flip:AH,flow:H,tuple:ZM,increment:kH,decrement:WH,absurd:XM,tupled:NH,untupled:PH,pipe:m,hole:FH,SK:Dn,not:DH,getEndomorphismMonoid:LH},Symbol.toStringTag,{value:"Module"}));var jH=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},xt=function(e){return e._tag==="None"},ht=function(e){return e._tag==="Some"},me={_tag:"None"},le=function(e){return{_tag:"Some",value:e}},Lt=function(e){return e._tag==="Left"},F$=function(e){return e._tag==="Right"},So=function(e){return{_tag:"Left",left:e}},Ua=function(e){return{_tag:"Right",right:e}},hd=function(e){return[e]},ft=function(e){return e.length>0},or=function(e){return e[0]},Lc=function(e){return e.slice(1)},Yt=[],jt={},ot=Object.prototype.hasOwnProperty,cm=function(e){return jH([e[0]],e.slice(1),!0)};function To(e,t){return function(n){return function(r){return e.ap(e.map(r,function(i){return function(o){return t.ap(i,o)}}),n)}}}function _t(e){return function(t){return function(n){return e.ap(e.map(n,function(r){return function(){return r}}),t)}}}function St(e){return function(t){return function(n){return e.ap(e.map(n,function(){return function(r){return r}}),t)}}}function Tt(e){return function(t,n){return function(r){return e.ap(e.map(r,function(i){return function(o){var a;return Object.assign({},i,(a={},a[t]=o,a))}}),n)}}}function Ut(e){return function(t){return{concat:function(n,r){return e.ap(e.map(n,function(i){return function(o){return t.concat(i,o)}}),r)}}}}function D$(e,t,n){return function(r){for(var i=Array(n.length+1),o=0;o<n.length;o++)i[o]=n[o];return i[n.length]=r,t===0?e.apply(null,i):D$(e,t-1,i)}}var L$={1:function(e){return[e]},2:function(e){return function(t){return[e,t]}},3:function(e){return function(t){return function(n){return[e,t,n]}}},4:function(e){return function(t){return function(n){return function(r){return[e,t,n,r]}}}},5:function(e){return function(t){return function(n){return function(r){return function(i){return[e,t,n,r,i]}}}}}};function UH(e){return ot.call(L$,e)||(L$[e]=D$(ZM,e-1,[])),L$[e]}function BH(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r=t.length,i=UH(r),o=e.map(t[0],i),a=1;a<r;a++)o=e.ap(o,t[a]);return o}}function zH(e){var t=e.length;switch(t){case 1:return function(n){var r;return r={},r[e[0]]=n,r};case 2:return function(n){return function(r){var i;return i={},i[e[0]]=n,i[e[1]]=r,i}};case 3:return function(n){return function(r){return function(i){var o;return o={},o[e[0]]=n,o[e[1]]=r,o[e[2]]=i,o}}};case 4:return function(n){return function(r){return function(i){return function(o){var a;return a={},a[e[0]]=n,a[e[1]]=r,a[e[2]]=i,a[e[3]]=o,a}}}};case 5:return function(n){return function(r){return function(i){return function(o){return function(a){var u;return u={},u[e[0]]=n,u[e[1]]=r,u[e[2]]=i,u[e[3]]=o,u[e[4]]=a,u}}}}};default:return D$(function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i={},o=0;o<t;o++)i[e[o]]=n[o];return i},t-1,[])}}function qH(e){return function(t){for(var n=Object.keys(t),r=n.length,i=zH(n),o=e.map(t[n[0]],i),a=1;a<r;a++)o=e.ap(o,t[n[a]]);return o}}const KH=Object.freeze(Object.defineProperty({__proto__:null,ap:To,apFirst:_t,apSecond:St,apS:Tt,getApplySemigroup:Ut,sequenceT:BH,sequenceS:qH},Symbol.toStringTag,{value:"Module"}));function jc(e,t){return function(n){return function(r){return e.map(r,function(i){return t.map(i,n)})}}}function De(e){return function(t){return function(n){return e.map(n,function(r){return r(t)})}}}function It(e){return function(t){return function(n){return e.map(n,function(r){var i;return i={},i[t]=r,i})}}}function Uc(e,t){var n=jc(e,t);return{map:function(r,i){return m(r,n(i))}}}const VH=Object.freeze(Object.defineProperty({__proto__:null,map:jc,flap:De,bindTo:It,getFunctorComposition:Uc},Symbol.toStringTag,{value:"Module"}));function Cr(e){var t=Ut(e);return function(n){return{concat:t(n).concat,empty:e.of(n.empty)}}}function ex(e,t){var n=Uc(e,t).map,r=To(e,t);return{map:n,of:function(i){return e.of(t.of(i))},ap:function(i,o){return m(i,r(o))}}}const HH=Object.freeze(Object.defineProperty({__proto__:null,getApplicativeMonoid:Cr,getApplicativeComposition:ex},Symbol.toStringTag,{value:"Module"}));function at(e){return function(t){return function(n){return e.chain(n,function(r){return e.map(t(r),function(){return r})})}}}function Ot(e){return function(t,n){return function(r){return e.chain(r,function(i){return e.map(n(i),function(o){var a;return Object.assign({},i,(a={},a[t]=o,a))})})}}}const JH=Object.freeze(Object.defineProperty({__proto__:null,chainFirst:at,bind:Ot},Symbol.toStringTag,{value:"Module"}));var j$=function(e,t){for(var n=t(e);n._tag==="Left";)n=t(n.left);return n.right};const GH=Object.freeze(Object.defineProperty({__proto__:null,tailRec:j$},Symbol.toStringTag,{value:"Module"}));function Di(e){return function(t){return function(n){return e.fromEither(xt(n)?So(t()):Ua(n.value))}}}function Ba(e){return function(t,n){return function(r){return e.fromEither(t(r)?Ua(r):So(n(r)))}}}function Li(e){var t=Di(e);return function(n){var r=t(n);return function(i){return H(i,r)}}}function es(e,t){var n=Li(e);return function(r){var i=n(r);return function(o){return function(a){return t.chain(a,i(o))}}}}function ar(e){return function(t){return H(t,e.fromEither)}}function Io(e,t){var n=ar(e);return function(r){return function(i){return t.chain(i,n(r))}}}function Oo(e,t){return H(ar(e),at(t))}function ts(e,t){return function(n,r){return function(i){return t.chain(i,function(o){return e.fromEither(n(o)?Ua(o):So(r(o)))})}}}const YH=Object.freeze(Object.defineProperty({__proto__:null,fromOption:Di,fromPredicate:Ba,fromOptionK:Li,chainOptionK:es,fromEitherK:ar,chainEitherK:Io,chainFirstEitherK:Oo,filterOrElse:ts},Symbol.toStringTag,{value:"Module"}));var Oe=function(e,t){return{left:e,right:t}},ZH=function(e,t){return m(e,U$(t))},XH=function(e,t){return m(e,tx(t))},QH=function(e,t,n){return m(e,nx(t,n))},U$=function(e){return function(t){return Oe(md(t),e(vd(t)))}},tx=function(e){return function(t){return Oe(e(md(t)),vd(t))}},nx=function(e,t){return function(n){return Oe(e(md(n)),t(vd(n)))}},B$="Separated",e6={URI:B$,mapLeft:XH,bimap:QH},rx={URI:B$,map:ZH},t6=De(rx),md=function(e){return e.left},vd=function(e){return e.right};const n6=Object.freeze(Object.defineProperty({__proto__:null,separated:Oe,map:U$,mapLeft:tx,bimap:nx,URI:B$,Bifunctor:e6,Functor:rx,flap:t6,left:md,right:vd},Symbol.toStringTag,{value:"Module"}));function ni(e,t){return function(n){var r=e.traverse(n);return function(i,o){return n.map(r(i,o),t.separate)}}}function ri(e,t){return function(n){var r=e.traverse(n);return function(i,o){return n.map(r(i,o),t.compact)}}}function z$(e){return function(t){var n=e.wither(t);return function(r){return function(i){return n(i,function(o){return t.map(r(o),function(a){return a?le(o):me})})}}}}const r6=Object.freeze(Object.defineProperty({__proto__:null,wiltDefault:ni,witherDefault:ri,filterE:z$},Symbol.toStringTag,{value:"Module"}));var yt=So,Be=Ua,hn=function(e,t){return m(e,is(t))},ns=function(e,t){return m(e,ux(t))},Bc=function(e,t){return m(e,Ar(t))},gd=function(e,t,n){return m(e,cx(t,n))},yd=function(e){return function(t,n){var r=lx(e);return m(t,r(n))}},bd=function(e,t,n){return m(e,fx(t,n))},lm=function(e){var t=dx(e);return function(n,r){return m(n,t(r))}},q$=function(e,t,n){return m(e,Y$(t,n))},K$=function(e,t){return m(e,Td(t))},ix=function(e,t){return m(e,hx(t))},V$=function(e,t){return m(e,Z$(t))},H$=function(e,t){return j$(t(e),function(n){return re(n)?Be(yt(n.left)):re(n.right)?yt(t(n.right.left)):Be(Be(n.right.right))})},bt="Either",i6=function(e,t){return{show:function(n){return re(n)?"left(".concat(e.show(n.left),")"):"right(".concat(t.show(n.right),")")}}},o6=function(e,t){return{equals:function(n,r){return n===r||(re(n)?re(r)&&e.equals(n.left,r.left):X$(r)&&t.equals(n.right,r.right))}}},$d=function(e){return{concat:function(t,n){return re(n)?t:re(t)?n:Be(e.concat(t.right,n.right))}}},rs=function(e){var t=yt(e.empty);return{URI:bt,_E:void 0,compact:function(n){return re(n)?n:n.right._tag==="None"?t:Be(n.right.value)},separate:function(n){return re(n)?Oe(n,n):re(n.right)?Oe(Be(n.right.left),t):Oe(t,Be(n.right.right))}}},zc=function(e){var t=yt(e.empty),n=rs(e),r=n.compact,i=n.separate,o=function(u,s){return re(u)||s(u.right)?u:t},a=function(u,s){return re(u)?Oe(u,u):s(u.right)?Oe(t,Be(u.right)):Oe(Be(u.right),t)};return{URI:bt,_E:void 0,map:hn,compact:r,separate:i,filter:o,filterMap:function(u,s){if(re(u))return u;var c=s(u.right);return c._tag==="None"?t:Be(c.value)},partition:a,partitionMap:function(u,s){if(re(u))return Oe(u,u);var c=s(u.right);return re(c)?Oe(Be(c.left),t):Oe(t,Be(c.right))}}},a6=function(e){var t=zc(e),n=rs(e);return{URI:bt,_E:void 0,map:hn,compact:t.compact,separate:t.separate,filter:t.filter,filterMap:t.filterMap,partition:t.partition,partitionMap:t.partitionMap,traverse:lm,sequence:Sd,reduce:gd,foldMap:yd,reduceRight:bd,wither:ri(G$,n),wilt:ni(G$,n)}},za=function(e){return{URI:bt,_E:void 0,map:hn,ap:function(t,n){return re(t)?re(n)?yt(e.concat(t.left,n.left)):t:re(n)?n:Be(t.right(n.right))},of:ji}},ox=function(e){return{URI:bt,_E:void 0,map:hn,alt:function(t,n){if(X$(t))return t;var r=n();return re(r)?yt(e.concat(t.left,r.left)):r}}},is=function(e){return function(t){return re(t)?t:Be(e(t.right))}},qa={URI:bt,map:hn},ji=Be,u6={URI:bt,of:ji},ax=function(e){return function(t){return re(t)?t:re(e)?e:Be(t.right(e.right))}},ux=ax,qc={URI:bt,map:hn,ap:ns},sx={URI:bt,map:hn,ap:ns,of:ji},J$=function(e){return function(t){return re(t)?t:e(t.right)}},Ar=J$,_d={URI:bt,map:hn,ap:ns,chain:Bc},s6={URI:bt,map:hn,ap:ns,of:ji,chain:Bc},cx=function(e,t){return function(n){return re(n)?e:t(e,n.right)}},lx=function(e){return function(t){return function(n){return re(n)?e.empty:t(n.right)}}},fx=function(e,t){return function(n){return re(n)?e:t(n.right,e)}},c6={URI:bt,reduce:gd,foldMap:yd,reduceRight:bd},dx=function(e){return function(t){return function(n){return re(n)?e.of(yt(n.left)):e.map(t(n.right),Be)}}},Sd=function(e){return function(t){return re(t)?e.of(yt(t.left)):e.map(t.right,Be)}},G$={URI:bt,map:hn,reduce:gd,foldMap:yd,reduceRight:bd,traverse:lm,sequence:Sd},Y$=function(e,t){return function(n){return re(n)?yt(e(n.left)):Be(t(n.right))}},Td=function(e){return function(t){return re(t)?yt(e(t.left)):t}},l6={URI:bt,bimap:q$,mapLeft:K$},px=function(e){return function(t){return re(t)?e():t}},hx=px,f6={URI:bt,map:hn,alt:ix},Z$=function(e){return function(t){return re(t)?t:Be(e(t))}},d6={URI:bt,map:hn,extend:V$},p6={URI:bt,map:hn,ap:ns,chain:Bc,chainRec:H$},fm=yt,h6={URI:bt,map:hn,ap:ns,of:ji,chain:Bc,throwError:fm},Kc={URI:bt,fromEither:B},m6=Ba(Kc),mx=Di(Kc),re=Lt,X$=F$,Q$=function(e,t){return function(n){return re(n)?e(n.left):t(n.right)}},vx=Q$,Ka=Q$,e_=Ka,t_=function(e){return function(t){return re(t)?e(t.left):t.right}},v6=t_,g6=De(qa),gx=_t(qc),y6=gx,yx=St(qc),b6=yx,bx=at(_d),$6=bx,$x=J$(B),_6=$x,S6=Z$(B),T6=Li(Kc),I6=es(Kc,_d),_x=ts(Kc,_d),O6=_x,Sx=function(e){return re(e)?Be(e.left):yt(e.right)},Tx=function(e){return function(t){return re(t)?e(t.left):t}},Ix=Tx,n_=function(e){return function(t){return t==null?yt(e):Be(t)}},as=function(e,t){try{return Be(e())}catch(n){return yt(t(n))}},w6=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return as(function(){return e.apply(void 0,n)},t)}},Ox=function(e){var t=n_(e);return function(n){return H(n,t)}},E6=function(e){var t=Ox(e);return function(n){return Ar(t(n))}},wx=vx(B,B);function R6(e){return e instanceof Error?e:new Error(String(e))}function Ex(e){return function(t,n){if(n===void 0){var r=Ex(e);return function(i){return r(t,i)}}return re(n)?!1:e.equals(t,n.right)}}var M6=function(e){return function(t){return re(t)?!1:e(t.right)}},x6=ji(jt),C6=It(qa),Rx=Ot(_d),A6=Rx,Mx=Tt(qc),k6=Mx,xx=ji(Yt),Id=function(e){return function(t){var n=e(0,or(t));if(re(n))return n;for(var r=[n.right],i=1;i<t.length;i++){var o=e(i,t[i]);if(re(o))return o;r.push(o.right)}return Be(r)}},r_=function(e){var t=Id(e);return function(n){return ft(n)?t(n):xx}},W6=r_,Cx=function(e){return r_(function(t,n){return e(n)})},N6=Cx(B);function P6(e,t){return as(function(){return JSON.parse(e)},t)}var F6=function(e,t){return as(function(){var n=JSON.stringify(e);if(typeof n!="string")throw new Error("Converting unsupported structure to JSON");return n},t)},D6={URI:bt,map:hn,of:ji,ap:ns,chain:Bc,reduce:gd,foldMap:yd,reduceRight:bd,traverse:lm,sequence:Sd,bimap:q$,mapLeft:K$,alt:ix,extend:V$,chainRec:H$,throwError:fm},L6=Ut(qc),j6=Cr(sx),U6=function(e,t){return Ut(za(e))(t)},B6=function(e,t){return Cr(za(e))(t)};function z6(e){var t=za(e).ap,n=ox(e).alt;return{URI:bt,_E:void 0,map:hn,of:ji,chain:Bc,bimap:q$,mapLeft:K$,reduce:gd,foldMap:yd,reduceRight:bd,extend:V$,traverse:lm,sequence:Sd,chainRec:H$,throwError:fm,ap:t,alt:n}}const Ax=Object.freeze(Object.defineProperty({__proto__:null,left:yt,right:Be,URI:bt,getShow:i6,getEq:o6,getSemigroup:$d,getCompactable:rs,getFilterable:zc,getWitherable:a6,getApplicativeValidation:za,getAltValidation:ox,map:is,Functor:qa,of:ji,Pointed:u6,apW:ax,ap:ux,Apply:qc,Applicative:sx,chainW:J$,chain:Ar,Chain:_d,Monad:s6,reduce:cx,foldMap:lx,reduceRight:fx,Foldable:c6,traverse:dx,sequence:Sd,Traversable:G$,bimap:Y$,mapLeft:Td,Bifunctor:l6,altW:px,alt:hx,Alt:f6,extend:Z$,Extend:d6,ChainRec:p6,throwError:fm,MonadThrow:h6,FromEither:Kc,fromPredicate:m6,fromOption:mx,isLeft:re,isRight:X$,matchW:Q$,foldW:vx,match:Ka,fold:e_,getOrElseW:t_,getOrElse:v6,flap:g6,apFirst:gx,apFirstW:y6,apSecond:yx,apSecondW:b6,chainFirst:bx,chainFirstW:$6,flattenW:$x,flatten:_6,duplicate:S6,fromOptionK:T6,chainOptionK:I6,filterOrElse:_x,filterOrElseW:O6,swap:Sx,orElseW:Tx,orElse:Ix,fromNullable:n_,tryCatch:as,tryCatchK:w6,fromNullableK:Ox,chainNullableK:E6,toUnion:wx,toError:R6,elem:Ex,exists:M6,Do:x6,bindTo:C6,bind:Rx,bindW:A6,apS:Mx,apSW:k6,ApT:xx,traverseReadonlyNonEmptyArrayWithIndex:Id,traverseReadonlyArrayWithIndex:r_,traverseArrayWithIndex:W6,traverseArray:Cx,sequenceArray:N6,parseJSON:P6,stringifyJSON:F6,either:D6,getApplySemigroup:L6,getApplyMonoid:j6,getValidationSemigroup:U6,getValidationMonoid:B6,getValidation:z6},Symbol.toStringTag,{value:"Module"}));var Ve=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Vc=globalThis&&globalThis.__assign||function(){return Vc=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Vc.apply(this,arguments)},q6=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},Ui=yt,Ye=function(e,t,n){return Ui([{value:e,context:t,message:n}])},Ie=Be,ye=function(){function e(t,n,r,i){this.name=t,this.is=n,this.validate=r,this.encode=i,this.decode=this.decode.bind(this)}return e.prototype.pipe=function(t,n){var r=this;return n===void 0&&(n="pipe(".concat(this.name,", ").concat(t.name,")")),new e(n,t.is,function(i,o){var a=r.validate(i,o);return re(a)?a:t.validate(a.right,o)},this.encode===We&&t.encode===We?We:function(i){return r.encode(t.encode(i))})},e.prototype.asDecoder=function(){return this},e.prototype.asEncoder=function(){return this},e.prototype.decode=function(t){return this.validate(t,[{key:"",type:this,actual:t}])},e}(),We=function(e){return e};function kx(e){return e.displayName||e.name||"<function".concat(e.length,">")}function K6(e,t){return{key:e,type:t}}function ii(e,t,n,r){for(var i=e.length,o=Array(i+1),a=0;a<i;a++)o[a]=e[a];return o[i]={key:t,type:n,actual:r},o}function wo(e,t){for(var n=t.length,r=0;r<n;r++)e.push(t[r])}var us=Object.prototype.hasOwnProperty;function i_(e){return Object.keys(e).map(function(t){return"".concat(t,": ").concat(e[t].name)}).join(", ")}function Od(e){for(var t=0;t<e.length;t++)if(e[t].encode!==We)return!1;return!0}function Wx(e){return"{ ".concat(i_(e)," }")}function Nx(e){return"Partial<".concat(e,">")}function V6(e,t,n,r){r===void 0&&(r="{ [K in ".concat(t.name,"]: ").concat(n.name," }"));var i=e.length;return new p_(r,function(o){return _n.is(o)&&e.every(function(a){return n.is(o[a])})},function(o,a){var u=_n.validate(o,a);if(re(u))return u;for(var s=u.right,c={},l=[],f=!1,d=0;d<i;d++){var p=e[d],h=s[p],v=n.validate(h,ii(a,p,n,h));if(re(v))wo(l,v.left);else{var y=v.right;f=f||y!==h,c[p]=y}}return l.length>0?Ui(l):Ie(f||Object.keys(s).length!==i?c:s)},n.encode===We?We:function(o){for(var a={},u=0;u<i;u++){var s=e[u];a[s]=n.encode(o[s])}return a},t,n)}function o_(e){var t;if(jx(e)){var n=e.value;if(oi.is(n))return t={},t[n]=null,t}else{if(X6(e))return e.keys;if(Bx(e)){var r=e.types.map(function(i){return o_(i)});return r.some(dm.is)?void 0:Object.assign.apply(Object,q6([{}],r,!1))}}}function H6(e,t,n){return n===void 0&&(n="{ [K in ".concat(e.name,"]: ").concat(t.name," }")),new p_(n,function(r){return _n.is(r)?Object.keys(r).every(function(i){return e.is(i)&&t.is(r[i])}):Lx(t)&&Array.isArray(r)},function(r,i){if(_n.is(r)){for(var o={},a=[],u=Object.keys(r),s=u.length,c=!1,l=0;l<s;l++){var f=u[l],d=r[f],p=e.validate(f,ii(i,f,e,f));if(re(p))wo(a,p.left);else{var h=p.right;c=c||h!==f,f=h;var v=t.validate(d,ii(i,f,t,d));if(re(v))wo(a,v.left);else{var y=v.right;c=c||y!==d,o[f]=y}}}return a.length>0?Ui(a):Ie(c?o:r)}return Lx(t)&&Array.isArray(r)?Ie(r):Ye(r,i)},e.encode===We&&t.encode===We?We:function(r){for(var i={},o=Object.keys(r),a=o.length,u=0;u<a;u++){var s=o[u];i[String(e.encode(s))]=t.encode(r[s])}return i},e,t)}function Px(e){return"("+e.map(function(t){return t.name}).join(" | ")+")"}function a_(e,t){for(var n=!0,r=!0,i=!_n.is(e),o=0,a=t;o<a.length;o++){var u=a[o];u!==e&&(n=!1),_n.is(u)&&(r=!1)}if(n)return e;if(r)return t[t.length-1];for(var s={},c=0,l=t;c<l.length;c++){var u=l[c];for(var f in u)(!us.call(s,f)||i||u[f]!==e[f])&&(s[f]=u[f])}return s}function u_(e){switch(e._tag){case"RefinementType":case"ReadonlyType":return u_(e.type);case"InterfaceType":case"StrictType":case"PartialType":return e.props;case"IntersectionType":return e.types.reduce(function(t,n){return Object.assign(t,u_(n))},{})}}function Fx(e,t){for(var n=Object.getOwnPropertyNames(e),r=!1,i={},o=0;o<n.length;o++){var a=n[o];us.call(t,a)?i[a]=e[a]:r=!0}return r?i:e}function J6(e){return Ux(e)?"{| ".concat(i_(e.props)," |}"):Q6(e)?Nx("{| ".concat(i_(e.props)," |}")):"Exact<".concat(e.name,">")}function G6(e){return e.length>0}var Ln={};function Dx(e,t){for(var n=[],r=0,i=e;r<i.length;r++){var o=i[r];t.indexOf(o)!==-1&&n.push(o)}return n}function Y6(e,t){if(e===Ln)return t;if(t===Ln)return e;var n=Object.assign({},e);for(var r in t)if(us.call(e,r)){var i=Dx(e[r],t[r]);if(G6(i))n[r]=i;else{n=Ln;break}}else n[r]=t[r];return n}function Z6(e,t){if(e===Ln||t===Ln)return Ln;var n=Ln;for(var r in e)if(us.call(t,r)){var i=Dx(e[r],t[r]);i.length===0&&(n===Ln&&(n={}),n[r]=e[r].concat(t[r]))}return n}function Lx(e){return e._tag==="AnyType"}function jx(e){return e._tag==="LiteralType"}function X6(e){return e._tag==="KeyofType"}function Ux(e){return e._tag==="InterfaceType"}function Q6(e){return e._tag==="PartialType"}function eJ(e){return e._tag==="StrictType"}function tJ(e){return e._tag==="ExactType"}function nJ(e){return e._tag==="RefinementType"}function rJ(e){return e._tag==="IntersectionType"}function Bx(e){return e._tag==="UnionType"}function iJ(e){return e._tag==="RecursiveType"}var s_=[];function Va(e){if(s_.indexOf(e)!==-1)return Ln;if(Ux(e)||eJ(e)){var t=Ln;for(var n in e.props){var r=e.props[n];jx(r)&&(t===Ln&&(t={}),t[n]=[r.value])}return t}else{if(tJ(e)||nJ(e))return Va(e.type);if(rJ(e))return e.types.reduce(function(o,a){return Y6(o,Va(a))},Ln);if(Bx(e))return e.types.slice(1).reduce(function(o,a){return Z6(o,Va(a))},Va(e.types[0]));if(iJ(e)){s_.push(e);var i=Va(e.type);return s_.pop(),i}}return Ln}function zx(e){var t=Va(e[0]),n=Object.keys(t),r=e.length,i=function(c){for(var l=t[c].slice(),f=[t[c]],d=1;d<r;d++){var p=e[d],h=Va(p),v=h[c];if(v===void 0)return"continue-keys";if(v.some(function(y){return l.indexOf(y)!==-1}))return"continue-keys";l.push.apply(l,v),f.push(v)}return{value:[c,f]}};e:for(var o=0,a=n;o<a.length;o++){var u=a[o],s=i(u);if(typeof s=="object")return s.value;switch(s){case"continue-keys":continue e}}}var qx=function(e){Ve(t,e);function t(){var n=e.call(this,"null",function(r){return r===null},function(r,i){return n.is(r)?Ie(r):Ye(r,i)},We)||this;return n._tag="NullType",n}return t}(ye),c_=new qx,Kx=function(e){Ve(t,e);function t(){var n=e.call(this,"undefined",function(r){return r===void 0},function(r,i){return n.is(r)?Ie(r):Ye(r,i)},We)||this;return n._tag="UndefinedType",n}return t}(ye),dm=new Kx,Vx=function(e){Ve(t,e);function t(){var n=e.call(this,"void",dm.is,dm.validate,We)||this;return n._tag="VoidType",n}return t}(ye),Hx=new Vx,Jx=function(e){Ve(t,e);function t(){var n=e.call(this,"unknown",function(r){return!0},Ie,We)||this;return n._tag="UnknownType",n}return t}(ye),oJ=new Jx,Gx=function(e){Ve(t,e);function t(){var n=e.call(this,"string",function(r){return typeof r=="string"},function(r,i){return n.is(r)?Ie(r):Ye(r,i)},We)||this;return n._tag="StringType",n}return t}(ye),oi=new Gx,Yx=function(e){Ve(t,e);function t(){var n=e.call(this,"number",function(r){return typeof r=="number"},function(r,i){return n.is(r)?Ie(r):Ye(r,i)},We)||this;return n._tag="NumberType",n}return t}(ye),ss=new Yx,Zx=function(e){Ve(t,e);function t(){var n=e.call(this,"bigint",function(r){return typeof r=="bigint"},function(r,i){return n.is(r)?Ie(r):Ye(r,i)},We)||this;return n._tag="BigIntType",n}return t}(ye),aJ=new Zx,Xx=function(e){Ve(t,e);function t(){var n=e.call(this,"boolean",function(r){return typeof r=="boolean"},function(r,i){return n.is(r)?Ie(r):Ye(r,i)},We)||this;return n._tag="BooleanType",n}return t}(ye),pm=new Xx,Qx=function(e){Ve(t,e);function t(){var n=e.call(this,"UnknownArray",Array.isArray,function(r,i){return n.is(r)?Ie(r):Ye(r,i)},We)||this;return n._tag="AnyArrayType",n}return t}(ye),Hc=new Qx,eC=function(e){Ve(t,e);function t(){var n=e.call(this,"UnknownRecord",function(r){var i=Object.prototype.toString.call(r);return i==="[object Object]"||i==="[object Window]"},function(r,i){return n.is(r)?Ie(r):Ye(r,i)},We)||this;return n._tag="AnyDictionaryType",n}return t}(ye),_n=new eC,tC=function(e){Ve(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.value=a,u._tag="LiteralType",u}return t}(ye);function wd(e,t){t===void 0&&(t=JSON.stringify(e));var n=function(r){return r===e};return new tC(t,n,function(r,i){return n(r)?Ie(e):Ye(r,i)},We,e)}var nC=function(e){Ve(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.keys=a,u._tag="KeyofType",u}return t}(ye);function uJ(e,t){t===void 0&&(t=Object.keys(e).map(function(r){return JSON.stringify(r)}).join(" | "));var n=function(r){return oi.is(r)&&us.call(e,r)};return new nC(t,n,function(r,i){return n(r)?Ie(r):Ye(r,i)},We,e)}var rC=function(e){Ve(t,e);function t(n,r,i,o,a,u){var s=e.call(this,n,r,i,o)||this;return s.type=a,s.predicate=u,s._tag="RefinementType",s}return t}(ye);function hm(e,t,n){return v_(e,t,n)}var mm=hm(ss,function(e){return Number.isInteger(e)},"Int"),l_=function(e){Ve(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.runDefinition=a,u._tag="RecursiveType",u}return t}(ye);Object.defineProperty(l_.prototype,"type",{get:function(){return this.runDefinition()},enumerable:!0,configurable:!0});function f_(e,t){var n,r=function(){return n||(n=t(i),n.name=e),n},i=new l_(e,function(o){return r().is(o)},function(o,a){return r().validate(o,a)},function(o){return r().encode(o)},r);return i}var iC=function(e){Ve(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.type=a,u._tag="ArrayType",u}return t}(ye);function vm(e,t){return t===void 0&&(t="Array<".concat(e.name,">")),new iC(t,function(n){return Hc.is(n)&&n.every(e.is)},function(n,r){var i=Hc.validate(n,r);if(re(i))return i;for(var o=i.right,a=o.length,u=o,s=[],c=0;c<a;c++){var l=o[c],f=e.validate(l,ii(r,String(c),e,l));if(re(f))wo(s,f.left);else{var d=f.right;d!==l&&(u===o&&(u=o.slice()),u[c]=d)}}return s.length>0?Ui(s):Ie(u)},e.encode===We?We:function(n){return n.map(e.encode)},e)}var oC=function(e){Ve(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.props=a,u._tag="InterfaceType",u}return t}(ye);function d_(e,t){t===void 0&&(t=Wx(e));var n=Object.keys(e),r=n.map(function(o){return e[o]}),i=n.length;return new oC(t,function(o){if(_n.is(o)){for(var a=0;a<i;a++){var u=n[a],s=o[u];if(s===void 0&&!us.call(o,u)||!r[a].is(s))return!1}return!0}return!1},function(o,a){var u=_n.validate(o,a);if(re(u))return u;for(var s=u.right,c=s,l=[],f=0;f<i;f++){var d=n[f],p=c[d],h=r[f],v=h.validate(p,ii(a,d,h,p));if(re(v))wo(l,v.left);else{var y=v.right;(y!==p||y===void 0&&!us.call(c,d))&&(c===s&&(c=Vc({},s)),c[d]=y)}}return l.length>0?Ui(l):Ie(c)},Od(r)?We:function(o){for(var a=Vc({},o),u=0;u<i;u++){var s=n[u],c=r[u].encode;c!==We&&(a[s]=c(o[s]))}return a},e)}var aC=function(e){Ve(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.props=a,u._tag="PartialType",u}return t}(ye);function sJ(e,t){t===void 0&&(t=Nx(Wx(e)));var n=Object.keys(e),r=n.map(function(o){return e[o]}),i=n.length;return new aC(t,function(o){if(_n.is(o)){for(var a=0;a<i;a++){var u=n[a],s=o[u];if(s!==void 0&&!e[u].is(s))return!1}return!0}return!1},function(o,a){var u=_n.validate(o,a);if(re(u))return u;for(var s=u.right,c=s,l=[],f=0;f<i;f++){var d=n[f],p=c[d],h=e[d],v=h.validate(p,ii(a,d,h,p));if(re(v))p!==void 0&&wo(l,v.left);else{var y=v.right;y!==p&&(c===s&&(c=Vc({},s)),c[d]=y)}}return l.length>0?Ui(l):Ie(c)},Od(r)?We:function(o){for(var a=Vc({},o),u=0;u<i;u++){var s=n[u],c=o[s];c!==void 0&&(a[s]=r[u].encode(c))}return a},e)}var p_=function(e){Ve(t,e);function t(n,r,i,o,a,u){var s=e.call(this,n,r,i,o)||this;return s.domain=a,s.codomain=u,s._tag="DictionaryType",s}return t}(ye);function h_(e,t,n){var r=o_(e);return r?V6(Object.keys(r),e,t,n):H6(e,t,n)}var m_=function(e){Ve(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.types=a,u._tag="UnionType",u}return t}(ye);function Ed(e,t){t===void 0&&(t=Px(e));var n=zx(e);if(n!==void 0&&e.length>0){var r=n[0],i=n[1],o=i.length,a=function(u){for(var s=0;s<o;s++)if(i[s].indexOf(u)!==-1)return s};return new gm(t,function(u){if(_n.is(u)){var s=a(u[r]);return s!==void 0?e[s].is(u):!1}return!1},function(u,s){var c=_n.validate(u,s);if(re(c))return c;var l=c.right,f=a(l[r]);if(f===void 0)return Ye(u,s);var d=e[f];return d.validate(l,ii(s,String(f),d,l))},Od(e)?We:function(u){var s=a(u[r]);if(s===void 0)throw new Error("no codec found to encode value in union codec ".concat(t));return e[s].encode(u)},e,r)}else return new m_(t,function(u){return e.some(function(s){return s.is(u)})},function(u,s){for(var c=[],l=0;l<e.length;l++){var f=e[l],d=f.validate(u,ii(s,String(l),f,u));if(re(d))wo(c,d.left);else return Ie(d.right)}return Ui(c)},Od(e)?We:function(u){for(var s=0,c=e;s<c.length;s++){var l=c[s];if(l.is(u))return l.encode(u)}throw new Error("no codec found to encode value in union type ".concat(t))},e)}var uC=function(e){Ve(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.types=a,u._tag="IntersectionType",u}return t}(ye);function cJ(e,t){t===void 0&&(t="(".concat(e.map(function(r){return r.name}).join(" & "),")"));var n=e.length;return new uC(t,function(r){return e.every(function(i){return i.is(r)})},e.length===0?Ie:function(r,i){for(var o=[],a=[],u=0;u<n;u++){var s=e[u],c=s.validate(r,ii(i,String(u),s,r));re(c)?wo(a,c.left):o.push(c.right)}return a.length>0?Ui(a):Ie(a_(r,o))},e.length===0?We:function(r){return a_(r,e.map(function(i){return i.encode(r)}))},e)}var sC=function(e){Ve(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.types=a,u._tag="TupleType",u}return t}(ye);function lJ(e,t){t===void 0&&(t="[".concat(e.map(function(r){return r.name}).join(", "),"]"));var n=e.length;return new sC(t,function(r){return Hc.is(r)&&r.length===n&&e.every(function(i,o){return i.is(r[o])})},function(r,i){var o=Hc.validate(r,i);if(re(o))return o;for(var a=o.right,u=a.length>n?a.slice(0,n):a,s=[],c=0;c<n;c++){var l=a[c],f=e[c],d=f.validate(l,ii(i,String(c),f,l));if(re(d))wo(s,d.left);else{var p=d.right;p!==l&&(u===a&&(u=a.slice()),u[c]=p)}}return s.length>0?Ui(s):Ie(u)},Od(e)?We:function(r){return e.map(function(i,o){return i.encode(r[o])})},e)}var cC=function(e){Ve(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.type=a,u._tag="ReadonlyType",u}return t}(ye);function fJ(e,t){return t===void 0&&(t="Readonly<".concat(e.name,">")),new cC(t,e.is,e.validate,e.encode,e)}var lC=function(e){Ve(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.type=a,u._tag="ReadonlyArrayType",u}return t}(ye);function fC(e,t){t===void 0&&(t="ReadonlyArray<".concat(e.name,">"));var n=vm(e);return new lC(t,n.is,n.validate,n.encode,e)}var Rd=function(e,t){return pC(d_(e),t)},dC=function(e){Ve(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.type=a,u._tag="ExactType",u}return t}(ye);function pC(e,t){t===void 0&&(t=J6(e));var n=u_(e);return new dC(t,e.is,function(r,i){var o=_n.validate(r,i);if(re(o))return o;var a=e.validate(r,i);return re(a)?a:Be(Fx(a.right,n))},function(r){return e.encode(Fx(r,n))},e)}var hC=function(e){Ve(t,e);function t(){var n=e.call(this,"Function",function(r){return typeof r=="function"},function(r,i){return n.is(r)?Ie(r):Ye(r,i)},We)||this;return n._tag="FunctionType",n}return t}(ye),dJ=new hC,gm=function(e){Ve(t,e);function t(n,r,i,o,a,u){var s=e.call(this,n,r,i,o,a)||this;return s.tag=u,s}return t}(m_),pJ=function(e,t,n){n===void 0&&(n=Px(t));var r=Ed(t,n);return r instanceof gm?r:(console.warn("[io-ts] Cannot build a tagged union for ".concat(n,", returning a de-optimized union")),new gm(n,r.is,r.validate,r.encode,t,e))},hJ=function(e,t){return{value:e,context:t}},mC=function(e){return[{key:"",type:e}]},vC=function(e){Ve(t,e);function t(){var n=e.call(this,"never",function(r){return!1},function(r,i){return Ye(r,i)},function(){throw new Error("cannot encode never")})||this;return n._tag="NeverType",n}return t}(ye),mJ=new vC,gC=function(e){Ve(t,e);function t(){var n=e.call(this,"any",function(r){return!0},Ie,We)||this;return n._tag="AnyType",n}return t}(ye),vJ=new gC,gJ=_n,yC=function(e){Ve(t,e);function t(){var n=e.call(this,"object",function(r){return r!==null&&typeof r=="object"},function(r,i){return n.is(r)?Ie(r):Ye(r,i)},We)||this;return n._tag="ObjectType",n}return t}(ye),yJ=new yC;function v_(e,t,n){return n===void 0&&(n="(".concat(e.name," | ").concat(kx(t),")")),new rC(n,function(r){return e.is(r)&&t(r)},function(r,i){var o=e.validate(r,i);if(re(o))return o;var a=o.right;return t(a)?Ie(a):Ye(a,i)},e.encode,e,t)}var bJ=v_(ss,Number.isInteger,"Integer"),$J=h_,_J=function(e){Ve(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.props=a,u._tag="StrictType",u}return t}(ye);function SJ(e){return e}function TJ(e){return function(){return e}}const ie=Da(Object.freeze(Object.defineProperty({__proto__:null,failures:Ui,failure:Ye,success:Ie,Type:ye,identity:We,getFunctionName:kx,getContextEntry:K6,appendContext:ii,getDomainKeys:o_,mergeAll:a_,emptyTags:Ln,getTags:Va,getIndex:zx,NullType:qx,nullType:c_,UndefinedType:Kx,VoidType:Vx,voidType:Hx,UnknownType:Jx,unknown:oJ,StringType:Gx,string:oi,NumberType:Yx,number:ss,BigIntType:Zx,bigint:aJ,BooleanType:Xx,boolean:pm,AnyArrayType:Qx,UnknownArray:Hc,AnyDictionaryType:eC,UnknownRecord:_n,null:c_,undefined:dm,void:Hx,LiteralType:tC,literal:wd,KeyofType:nC,keyof:uJ,RefinementType:rC,brand:hm,Int:mm,RecursiveType:l_,recursion:f_,ArrayType:iC,array:vm,InterfaceType:oC,type:d_,PartialType:aC,partial:sJ,DictionaryType:p_,record:h_,UnionType:m_,union:Ed,IntersectionType:uC,intersection:cJ,TupleType:sC,tuple:lJ,ReadonlyType:cC,readonly:fJ,ReadonlyArrayType:lC,readonlyArray:fC,strict:Rd,ExactType:dC,exact:pC,FunctionType:hC,Function:dJ,TaggedUnionType:gm,taggedUnion:pJ,Array:Hc,interface:d_,getValidationError:hJ,getDefaultContext:mC,NeverType:vC,never:mJ,AnyType:gC,any:vJ,Dictionary:gJ,ObjectType:yC,object:yJ,refinement:v_,Integer:bJ,dictionary:$J,StrictType:_J,clean:SJ,alias:TJ},Symbol.toStringTag,{value:"Module"})));var Jc={},ym={},bm={};Object.defineProperty(bm,"__esModule",{value:!0}),bm.clone=void 0;function IJ(e){var t=Object.create(Object.getPrototypeOf(e));return Object.assign(t,e),t}bm.clone=IJ;var OJ=se&&se.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),wJ=se&&se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),EJ=se&&se.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.hasOwnProperty.call(e,n)&&OJ(t,e,n);return wJ(t,e),t};Object.defineProperty(ym,"__esModule",{value:!0}),ym.withValidate=void 0;var RJ=EJ(ie),MJ=bm;function xJ(e,t,n){n===void 0&&(n=e.name);var r=MJ.clone(e);return r.validate=t,r.decode=function(i){return t(i,RJ.getDefaultContext(r))},r.name=n,r}ym.withValidate=xJ;var CJ=se&&se.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),AJ=se&&se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),kJ=se&&se.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.hasOwnProperty.call(e,n)&&CJ(t,e,n);return AJ(t,e),t};Object.defineProperty(Jc,"__esModule",{value:!0}),Jc.withFallback=void 0;var WJ=kJ(ie),NJ=ym,PJ=_o;function FJ(e,t,n){return n===void 0&&(n="withFallback("+e.name+")"),NJ.withValidate(e,function(r,i){return PJ.orElse(function(){return WJ.success(t)})(e.validate(r,i))},n)}Jc.withFallback=FJ;var Ze={},g_={};const Sn=Da(Ax),ur=Da(QM);Object.defineProperty(g_,"__esModule",{value:!0});const DJ=ee.exports,LJ=Sn,jJ=ur,$m=(0,DJ.__importStar)(ie);g_.default=new $m.Type("dateFromString",e=>e instanceof Date,(e,t)=>(0,jJ.pipe)($m.string.validate(e,t),(0,LJ.chain)(n=>{const r=new Date(n);return isNaN(r.getTime())?$m.failure(e,t):$m.success(r)})),e=>e.toISOString());var y_={};Object.defineProperty(y_,"__esModule",{value:!0});const UJ=ee.exports,BJ=Sn,zJ=ur,Gc=(0,UJ.__importStar)(ie);y_.default=new Gc.Type("dateFromStringOrNumber",e=>e instanceof Date,(e,t)=>(0,zJ.pipe)(Gc.union([Gc.number,Gc.string]).validate(e,t),(0,BJ.chain)(n=>{const r=new Date(n);return isNaN(r.getTime())?Gc.failure(e,t):Gc.success(r)})),e=>e);var b_={};Object.defineProperty(b_,"__esModule",{value:!0});const qJ=ee.exports,KJ=Sn,VJ=ur,_m=(0,qJ.__importStar)(ie);b_.default=new _m.Type("dateFromTsMs",e=>e instanceof Date,(e,t)=>(0,VJ.pipe)(_m.number.validate(e,t),(0,KJ.chain)(n=>{const r=new Date(n);return isNaN(r.getTime())?_m.failure(e,t):_m.success(r)})),e=>e.getTime());var je={};function bC(e){return function(t){return function(n){return n.reduce(function(r,i){return e.alt(r,function(){return i})},t)}}}const HJ=Object.freeze(Object.defineProperty({__proto__:null,altAll:bC},Symbol.toStringTag,{value:"Module"}));function JJ(e){return bC(e)(e.zero())}const GJ=Object.freeze(Object.defineProperty({__proto__:null,altAll:JJ},Symbol.toStringTag,{value:"Module"}));var kr=function(e){return{equals:function(t,n){return t===n||e(t,n)}}},$C=function(e){return kr(function(t,n){for(var r in e)if(!e[r].equals(t[r],n[r]))return!1;return!0})},_C=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return kr(function(n,r){return e.every(function(i,o){return i.equals(n[o],r[o])})})},YJ=function(e,t){return m(e,SC(t))},SC=function(e){return function(t){return kr(function(n,r){return t.equals(e(n),e(r))})}},TC="Eq",Yc={equals:function(e,t){return e===t}},ZJ={equals:function(){return!0}},IC=function(){return{concat:function(e,t){return kr(function(n,r){return e.equals(n,r)&&t.equals(n,r)})}}},XJ=function(){return{concat:IC().concat,empty:ZJ}},OC={URI:TC,contramap:YJ},QJ=_C,e7=$C,t7=Yc.equals,n7=OC,r7=Yc,i7=Yc,o7=Yc,a7={equals:function(e,t){return e.valueOf()===t.valueOf()}};const u7=Object.freeze(Object.defineProperty({__proto__:null,fromEquals:kr,struct:$C,tuple:_C,contramap:SC,URI:TC,eqStrict:Yc,getSemigroup:IC,getMonoid:XJ,Contravariant:OC,getTupleEq:QJ,getStructEq:e7,strictEqual:t7,eq:n7,eqBoolean:r7,eqString:i7,eqNumber:o7,eqDate:a7},Symbol.toStringTag,{value:"Module"}));var wC=function(e){return function(t,n){return t===n||e(t,n)===0}},cs=function(e){return{equals:wC(e),compare:function(t,n){return t===n?0:e(t,n)}}},EC=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return cs(function(n,r){for(var i=0;i<e.length-1;i++){var o=e[i].compare(n[i],r[i]);if(o!==0)return o}return e[i].compare(n[i],r[i])})},$_=function(e){return cs(function(t,n){return e.compare(n,t)})},s7=function(e,t){return m(e,Sm(t))},Sm=function(e){return function(t){return cs(function(n,r){return t.compare(e(n),e(r))})}},RC="Ord",MC=function(){return{concat:function(e,t){return cs(function(n,r){var i=e.compare(n,r);return i!==0?i:t.compare(n,r)})}}},__=function(){return{concat:MC().concat,empty:cs(function(){return 0})}},xC={URI:RC,contramap:s7},c7={equals:N$,compare:Fn(0)},l7=function(e){return function(t){return function(n){return n===t||e.compare(n,t)===0}}},CC=function(e){return function(t,n){return e.compare(t,n)===-1}},AC=function(e){return function(t,n){return e.compare(t,n)===1}},f7=function(e){return function(t,n){return e.compare(t,n)!==1}},d7=function(e){return function(t,n){return e.compare(t,n)!==-1}},Tm=function(e){return function(t,n){return t===n||e.compare(t,n)<1?t:n}},Im=function(e){return function(t,n){return t===n||e.compare(t,n)>-1?t:n}},kC=function(e){var t=Tm(e),n=Im(e);return function(r,i){return function(o){return n(t(o,i),r)}}},p7=function(e){var t=CC(e),n=AC(e);return function(r,i){return function(o){return!(t(o,r)||n(o,i))}}},h7=EC,m7=$_,v7=xC;function g7(e,t){return e<t?-1:e>t?1:0}var S_={equals:Yc.equals,compare:g7},y7=S_,b7=S_,Om=S_,$7=m(Om,Sm(function(e){return e.valueOf()}));const _7=Object.freeze(Object.defineProperty({__proto__:null,equalsDefault:wC,fromCompare:cs,tuple:EC,reverse:$_,contramap:Sm,URI:RC,getSemigroup:MC,getMonoid:__,Contravariant:xC,trivial:c7,equals:l7,lt:CC,gt:AC,leq:f7,geq:d7,min:Tm,max:Im,clamp:kC,between:p7,getTupleOrd:h7,getDualOrd:m7,ord:v7,ordBoolean:y7,ordString:b7,ordNumber:Om,ordDate:$7},Symbol.toStringTag,{value:"Module"}));var WC=function(e){return{concat:function(t,n){return e.concat(n,t)}}},S7=function(e){return function(t){return{concat:function(n,r){return e(n)?t.concat(n,r):r}}}},T7=function(e){return function(t){return{concat:function(n,r){return e(r)?t.concat(n,r):n}}}},I7=function(e){return function(t){return{concat:function(n,r){return t.concat(e(n),e(r))}}}},NC=function(e){return function(t){return function(n){return n.reduce(function(r,i){return e.concat(r,i)},t)}}};const O7=Object.freeze(Object.defineProperty({__proto__:null,reverse:WC,filterFirst:S7,filterSecond:T7,endo:I7,concatAll:NC},Symbol.toStringTag,{value:"Module"}));var wm=function(e){return{concat:Tm(e)}},Em=function(e){return{concat:Im(e)}},T_=function(e){return{concat:function(){return e}}},I_=WC,O_=function(e){return{concat:function(t,n){var r={};for(var i in e)ot.call(e,i)&&(r[i]=e[i].concat(t[i],n[i]));return r}}},w_=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return{concat:function(n,r){return e.map(function(i,o){return i.concat(n[o],r[o])})}}},PC=function(e){return function(t){return{concat:function(n,r){return t.concat(n,t.concat(e,r))}}}},E_=function(){return{concat:B}},Rm=function(){return{concat:function(e,t){return t}}},R_=NC,FC=T_(void 0),w7=function(){return{concat:function(e,t){return Object.assign({},e,t)}}},E7=Rm,R7=E_,M7=w_,x7=O_,C7=I_,A7=Em,k7=wm,W7=PC;function N7(e){var t=R_(e);return function(n,r){return r===void 0?t(n):t(n)(r)}}var DC={concat:function(e,t){return e&&t}},LC={concat:function(e,t){return e||t}},P7=k$,jC={concat:function(e,t){return e+t}},UC={concat:function(e,t){return e+t}},BC={concat:function(e,t){return e*t}};const zC=Object.freeze(Object.defineProperty({__proto__:null,min:wm,max:Em,constant:T_,reverse:I_,struct:O_,tuple:w_,intercalate:PC,first:E_,last:Rm,concatAll:R_,semigroupVoid:FC,getObjectSemigroup:w7,getLastSemigroup:E7,getFirstSemigroup:R7,getTupleSemigroup:M7,getStructSemigroup:x7,getDualSemigroup:C7,getJoinSemigroup:A7,getMeetSemigroup:k7,getIntercalateSemigroup:W7,fold:N7,semigroupAll:DC,semigroupAny:LC,getFunctionSemigroup:P7,semigroupString:jC,semigroupSum:UC,semigroupProduct:BC},Symbol.toStringTag,{value:"Module"}));var Md=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},xd=Yt,Bi=ft,Mm=function(e,t){return e<0||e>=t.length},M_=function(e){return function(t){return Md([e],t,!0)}},Zc=M_,x_=function(e){return function(t){return Md(Md([],t,!0),[e],!1)}},xm=x_,Cm=function(e,t,n){if(Bi(n)){var r=cm(n);return r.splice(e,0,t),r}return[t]},C_=function(e,t,n){if(n[e]===t)return n;var r=cm(n);return r[e]=t,r},A_=function(e){return function(t){if(t.length===1)return t;for(var n=[In(t)],r=ui(t),i=function(s){n.every(function(c){return!e.equals(c,s)})&&n.push(s)},o=0,a=r;o<a.length;o++){var u=a[o];i(u)}return n}},qC=function(e){if(Bi(e)){var t=__();return N_(e.reduce(t.concat,t.empty))}return B},k_=function(e){var t=A_(e);return function(n){return function(r){return t(m(r,Ad(n)))}}},W_=function(e){return function(t){var n=t.length,r=Math.round(e)%n;if(Mm(Math.abs(r),t)||r===0)return t;if(r<0){var i=Wm(-r)(t),o=i[0],a=i[1];return m(a,Ad(o))}else return W_(r-n)(t)}},Cd=function(e){return Bi(e)?le(e):me},Am=function(e){return function(t){for(var n=Math.max(0,Math.floor(t)),r=[e(0)],i=1;i<n;i++)r.push(e(i));return r}},F7=function(e){return Am(function(){return e})},KC=function(e,t){return e<=t?Am(function(n){return e+n})(t-e+1):[e]},VC=function(e){return[In(e),ui(e)]},HC=function(e){return[Xc(e),Ja(e)]},D7=function(e){return Cd(e.slice())};function JC(e){return function(t){return t.concat(e)}}function Ad(e,t){return t?e.concat(t):function(n){return n.concat(e)}}var L7=function(e){return e.length===1?e:Md([Ja(e)],e.slice(0,-1).reverse(),!0)};function GC(e){return function(t){var n=t.length;if(n===0)return xd;for(var r=[],i=t[0],o=[i],a=1;a<n;a++){var u=t[a];e.equals(u,i)?o.push(u):(r.push(o),i=u,o=[i])}return r.push(o),r}}var j7=function(e){return function(t){for(var n={},r=0,i=t;r<i.length;r++){var o=i[r],a=e(o);ot.call(n,a)?n[a].push(o):n[a]=[o]}return n}},N_=function(e){return function(t){return t.length===1?t:t.slice().sort(e.compare)}},U7=function(e,t){return YC(e,function(){return t})},YC=function(e,t){return function(n){return Mm(e,n)?me:le(C_(e,t(n[e]),n))}},ZC=function(e,t,n){for(var r=[n(e[0],t[0])],i=Math.min(e.length,t.length),o=1;o<i;o++)r[o]=n(e[o],t[o]);return r};function XC(e,t){return t===void 0?function(n){return XC(n,e)}:ZC(e,t,function(n,r){return[n,r]})}var B7=function(e){for(var t=[e[0][0]],n=[e[0][1]],r=1;r<e.length;r++)t[r]=e[r][0],n[r]=e[r][1];return[t,n]},km=function(e){return function(t){for(var n=[e,t[0]],r=1;r<t.length;r++)n.push(e,t[r]);return n}},P_=function(e){return function(t){var n=ui(t);return Bi(n)?m(n,km(e),Zc(In(t))):t}},QC=function(e){return function(t){for(var n=cm(e(0,In(t))),r=1;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},F_=function(e){return function(t){for(var n=e(t),r=n[0],i=n[1],o=[r],a=i;Bi(a);){var u=e(a),s=u[0],c=u[1];o.push(s),a=c}return o}},Wm=function(e){return function(t){var n=Math.max(1,e);return n>=t.length?[t,xd]:[m(t.slice(1,n),Zc(In(t))),t.slice(n)]}},eA=function(e){return F_(Wm(e))},ai=function(e,t){return m(e,K_(t))},D_=function(e,t){return m(e,V_(t))},kd=function(e,t){return m(e,aA(t))},L_=function(e,t){return m(e,Nm(t))},tA=function(e,t){return m(e,q_(t))},Wd=function(e,t,n){return m(e,H_(t,n))},Nd=function(e){var t=J_(e);return function(n,r){return m(n,t(r))}},Pd=function(e,t,n){return m(e,G_(t,n))},j_=function(e){var t=uA(e);return function(n,r){return m(n,t(r))}},nA=function(e,t){return m(e,oA(t))},U_=function(e,t,n){return m(e,Pm(t,n))},B_=function(e){var t=Y_(e);return function(n,r){return m(n,t(r))}},z_=function(e,t,n){return m(e,Fm(t,n))},rA=function(e){var t=Lm(e);return function(n,r){return m(n,t(r))}},Ha=hd,iA=function(e){return function(t){return m(t,JC(e()))}},oA=iA,aA=function(e){return Nm(function(t){return m(e,K_(t))})},Nm=function(e){return QC(function(t,n){return e(n)})},q_=function(e){return function(t){for(var n=ui(t),r=[e(t)];Bi(n);)r.push(e(n)),n=ui(n);return r}},z7=q_(B),q7=Nm(B),K_=function(e){return V_(function(t,n){return e(n)})},V_=function(e){return function(t){for(var n=[e(0,In(t))],r=1;r<t.length;r++)n.push(e(r,t[r]));return n}},H_=function(e,t){return Pm(e,function(n,r,i){return t(r,i)})},J_=function(e){return function(t){return function(n){return n.slice(1).reduce(function(r,i){return e.concat(r,t(i))},t(n[0]))}}},G_=function(e,t){return Fm(e,function(n,r,i){return t(r,i)})},Pm=function(e,t){return function(n){return n.reduce(function(r,i,o){return t(o,r,i)},e)}},Y_=function(e){return function(t){return function(n){return n.slice(1).reduce(function(r,i,o){return e.concat(r,t(o+1,i))},t(0,n[0]))}}},Fm=function(e,t){return function(n){return n.reduceRight(function(r,i,o){return t(o,i,r)},e)}},uA=function(e){var t=Lm(e);return function(n){return t(function(r,i){return n(i)})}},Dm=function(e){return Lm(e)(Dn)},Lm=function(e){return function(t){return function(n){for(var r=e.map(t(0,In(n)),Ha),i=1;i<n.length;i++)r=e.ap(e.map(r,function(o){return function(a){return m(o,xm(a))}}),t(i,n[i]));return r}}},jm=or,Tn="ReadonlyNonEmptyArray",sA=function(e){return{show:function(t){return"[".concat(t.map(e.show).join(", "),"]")}}},K7=function(){return{concat:Ad}},cA=function(e){return kr(function(t,n){return t.length===n.length&&t.every(function(r,i){return e.equals(r,n[i])})})},V7=function(e){var t=k_(e);return{concat:function(n,r){return t(r)(n)}}},Z_={URI:Tn,map:ai},H7=De(Z_),J7={URI:Tn,of:Ha},G7={URI:Tn,map:ai,mapWithIndex:D_},Um={URI:Tn,map:ai,ap:kd},Y7=_t(Um),Z7=St(Um),X7={URI:Tn,map:ai,ap:kd,of:Ha},X_={URI:Tn,map:ai,ap:kd,chain:L_},Q7=at(X_),e8={URI:Tn,map:ai,ap:kd,of:Ha,chain:L_},t8={URI:Tn,reduce:Wd,foldMap:Nd,reduceRight:Pd},n8={URI:Tn,reduce:Wd,foldMap:Nd,reduceRight:Pd,reduceWithIndex:U_,foldMapWithIndex:B_,reduceRightWithIndex:z_},r8={URI:Tn,map:ai,reduce:Wd,foldMap:Nd,reduceRight:Pd,traverse:j_,sequence:Dm},i8={URI:Tn,map:ai,mapWithIndex:D_,reduce:Wd,foldMap:Nd,reduceRight:Pd,traverse:j_,sequence:Dm,reduceWithIndex:U_,foldMapWithIndex:B_,reduceRightWithIndex:z_,traverseWithIndex:rA},o8={URI:Tn,map:ai,alt:nA},a8={URI:Tn,map:ai,extend:tA,extract:jm},u8=Ha(jt),s8=It(Z_),c8=Ot(X_),l8=Tt(Um),In=jm,ui=Lc,Ja=function(e){return e[e.length-1]},Xc=function(e){return e.slice(0,-1)},lA=function(e){var t=wm(e);return function(n){return n.reduce(t.concat)}},fA=function(e){var t=Em(e);return function(n){return n.reduce(t.concat)}},Bm=function(e){return function(t){return t.reduce(e.concat)}},f8=function(e){return function(t){return e(In(t),ui(t))}},d8=function(e){return function(t){return e(Xc(t),Ja(t))}},dA=function(e){return function(t){return Md([e(In(t))],ui(t),!0)}},p8=function(e){return dA(function(){return e})},pA=function(e){return function(t){return m(Xc(t),xm(e(Ja(t))))}},h8=function(e){return pA(function(){return e})},Q_=function(e){var t=Bm(e);return function(n){return H(P_(n),t)}};function m8(e){var t=N_(e),n=GC(e);return function(r){return Bi(r)?n(t(r)):xd}}function v8(e){return hA(function(t,n){return e(n)})}var hA=function(e){return function(t){return Cd(t.filter(function(n,r){return e(r,n)}))}},g8=VC,y8=HC;function mA(e,t){return t===void 0?Zc(e):m(t,Zc(e))}var vA=function(e,t){return m(e,Ad([t]))},b8=function(e,t){return function(n){return e<0||e>n.length?me:le(Cm(e,t,n))}},$8=km,_8=Bm,S8={URI:Tn,of:Ha,map:ai,mapWithIndex:D_,ap:kd,chain:L_,extend:tA,extract:jm,reduce:Wd,foldMap:Nd,reduceRight:Pd,traverse:j_,sequence:Dm,reduceWithIndex:U_,foldMapWithIndex:B_,reduceRightWithIndex:z_,traverseWithIndex:rA,alt:nA};const T8=Object.freeze(Object.defineProperty({__proto__:null,empty:xd,isNonEmpty:Bi,isOutOfBound:Mm,prependW:M_,prepend:Zc,appendW:x_,append:xm,unsafeInsertAt:Cm,unsafeUpdateAt:C_,uniq:A_,sortBy:qC,union:k_,rotate:W_,fromReadonlyArray:Cd,makeBy:Am,replicate:F7,range:KC,unprepend:VC,unappend:HC,fromArray:D7,concatW:JC,concat:Ad,reverse:L7,group:GC,groupBy:j7,sort:N_,updateAt:U7,modifyAt:YC,zipWith:ZC,zip:XC,unzip:B7,prependAll:km,intersperse:P_,chainWithIndex:QC,chop:F_,splitAt:Wm,chunksOf:eA,of:Ha,altW:iA,alt:oA,ap:aA,chain:Nm,extend:q_,duplicate:z7,flatten:q7,map:K_,mapWithIndex:V_,reduce:H_,foldMap:J_,reduceRight:G_,reduceWithIndex:Pm,foldMapWithIndex:Y_,reduceRightWithIndex:Fm,traverse:uA,sequence:Dm,traverseWithIndex:Lm,extract:jm,URI:Tn,getShow:sA,getSemigroup:K7,getEq:cA,getUnionSemigroup:V7,Functor:Z_,flap:H7,Pointed:J7,FunctorWithIndex:G7,Apply:Um,apFirst:Y7,apSecond:Z7,Applicative:X7,Chain:X_,chainFirst:Q7,Monad:e8,Foldable:t8,FoldableWithIndex:n8,Traversable:r8,TraversableWithIndex:i8,Alt:o8,Comonad:a8,Do:u8,bindTo:s8,bind:c8,apS:l8,head:In,tail:ui,last:Ja,init:Xc,min:lA,max:fA,concatAll:Bm,matchLeft:f8,matchRight:d8,modifyHead:dA,updateHead:p8,modifyLast:pA,updateLast:h8,intercalate:Q_,groupSort:m8,filter:v8,filterWithIndex:hA,uncons:g8,unsnoc:y8,cons:mA,snoc:vA,insertAt:b8,prependToAll:$8,fold:_8,readonlyNonEmptyArray:S8},Symbol.toStringTag,{value:"Module"}));var Fd=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},Eo=function(e){return e.length>0},zm=function(e,t){return e<0||e>=t.length},eS=function(e){return function(t){return Fd([e],t,!0)}},Qc=eS,tS=function(e){return function(t){return Fd(Fd([],t,!0),[e],!1)}},Dd=tS,nS=function(e,t,n){if(Eo(n)){var r=Ld(n);return r.splice(e,0,t),r}return[t]},rS=function(e,t,n){var r=Ld(n);return r[e]=t,r},iS=function(e){return function(t){if(t.length===1)return el(t);for(var n=[Wr(t)],r=ci(t),i=function(s){n.every(function(c){return!e.equals(c,s)})&&n.push(s)},o=0,a=r;o<a.length;o++){var u=a[o];i(u)}return n}},gA=function(e){if(Eo(e)){var t=__();return sS(e.reduce(t.concat,t.empty))}return el},oS=function(e){var t=iS(e);return function(n){return function(r){return t(m(r,Km(n)))}}},aS=function(e){return function(t){var n=t.length,r=Math.round(e)%n;if(zm(Math.abs(r),t)||r===0)return el(t);if(r<0){var i=Hm(-r)(t),o=i[0],a=i[1];return m(a,Km(o))}else return aS(r-n)(t)}},Ld=cm,uS=function(e){return Eo(e)?le(e):me},qm=function(e){return function(t){for(var n=Math.max(0,Math.floor(t)),r=[e(0)],i=1;i<n;i++)r.push(e(i));return r}},I8=function(e){return qm(function(){return e})},yA=function(e,t){return e<=t?qm(function(n){return e+n})(t-e+1):[e]},bA=function(e){return[Wr(e),ci(e)]},$A=function(e){return[nl(e),tl(e)]};function _A(e){return function(t){return t.concat(e)}}function Km(e,t){return t?e.concat(t):function(n){return n.concat(e)}}var O8=function(e){return Fd([tl(e)],e.slice(0,-1).reverse(),!0)};function SA(e){return function(t){var n=t.length;if(n===0)return[];for(var r=[],i=t[0],o=[i],a=1;a<n;a++){var u=t[a];e.equals(u,i)?o.push(u):(r.push(o),i=u,o=[i])}return r.push(o),r}}var w8=function(e){return function(t){for(var n={},r=0,i=t;r<i.length;r++){var o=i[r],a=e(o);ot.call(n,a)?n[a].push(o):n[a]=[o]}return n}},sS=function(e){return function(t){return t.slice().sort(e.compare)}},E8=function(e,t){return function(n){return e<0||e>n.length?me:le(nS(e,t,n))}},R8=function(e,t){return TA(e,function(){return t})},TA=function(e,t){return function(n){return zm(e,n)?me:le(rS(e,t(n[e]),n))}},el=Ld,Ga=function(e){return[e]},IA=function(e,t,n){for(var r=[n(e[0],t[0])],i=Math.min(e.length,t.length),o=1;o<i;o++)r[o]=n(e[o],t[o]);return r};function OA(e,t){return t===void 0?function(n){return OA(n,e)}:IA(e,t,function(n,r){return[n,r]})}var M8=function(e){for(var t=[e[0][0]],n=[e[0][1]],r=1;r<e.length;r++)t[r]=e[r][0],n[r]=e[r][1];return[t,n]},Vm=function(e){return function(t){for(var n=[e,t[0]],r=1;r<t.length;r++)n.push(e,t[r]);return n}},wA=function(e){return function(t){var n=ci(t);return Eo(n)?m(n,Vm(e),Qc(Wr(t))):el(t)}},EA=Y_,RA=J_,MA=function(e){return function(t){for(var n=Ld(e(0,Wr(t))),r=1;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},cS=function(e){return function(t){for(var n=e(t),r=n[0],i=n[1],o=[r],a=i;Eo(a);){var u=e(a),s=u[0],c=u[1];o.push(s),a=c}return o}},Hm=function(e){return function(t){var n=Math.max(1,e);return n>=t.length?[el(t),[]]:[m(t.slice(1,n),Qc(Wr(t))),t.slice(n)]}},xA=function(e){return cS(Hm(e))},si=function(e,t){return m(e,gS(t))},lS=function(e,t){return m(e,yS(t))},jd=function(e,t){return m(e,PA(t))},fS=function(e,t){return m(e,Jm(t))},CA=function(e,t){return m(e,vS(t))},Ud=function(e,t,n){return m(e,FA(t,n))},Bd=function(e){var t=RA(e);return function(n,r){return m(n,t(r))}},zd=function(e,t,n){return m(e,LA(t,n))},dS=function(e){var t=UA(e);return function(n,r){return m(n,t(r))}},AA=function(e,t){return m(e,NA(t))},pS=function(e,t,n){return m(e,DA(t,n))},hS=function(e){var t=EA(e);return function(n,r){return m(n,t(r))}},mS=function(e,t,n){return m(e,jA(t,n))},kA=function(e){var t=Ym(e);return function(n,r){return m(n,t(r))}},WA=function(e){return function(t){return m(t,_A(e()))}},NA=WA,PA=function(e){return Jm(function(t){return m(e,gS(t))})},Jm=function(e){return MA(function(t,n){return e(n)})},vS=function(e){return function(t){for(var n=ci(t),r=[e(t)];Eo(n);)r.push(e(n)),n=ci(n);return r}},x8=vS(B),C8=Jm(B),gS=function(e){return yS(function(t,n){return e(n)})},yS=function(e){return function(t){for(var n=[e(0,Wr(t))],r=1;r<t.length;r++)n.push(e(r,t[r]));return n}},FA=H_,DA=Pm,LA=G_,jA=Fm,UA=function(e){var t=Ym(e);return function(n){return t(function(r,i){return n(i)})}},Gm=function(e){return Ym(e)(function(t,n){return n})},Ym=function(e){return function(t){return function(n){for(var r=e.map(t(0,Wr(n)),Ga),i=1;i<n.length;i++)r=e.ap(e.map(r,function(o){return function(a){return m(o,Dd(a))}}),t(i,n[i]));return r}}},bS=In,On="NonEmptyArray",A8=sA,k8=function(){return{concat:Km}},W8=cA,N8=function(e){var t=oS(e);return{concat:function(n,r){return t(r)(n)}}},$S={URI:On,map:si},P8=De($S),F8={URI:On,of:Ga},D8={URI:On,map:si,mapWithIndex:lS},Zm={URI:On,map:si,ap:jd},L8=_t(Zm),j8=St(Zm),U8={URI:On,map:si,ap:jd,of:Ga},_S={URI:On,map:si,ap:jd,chain:fS},B8=at(_S),z8={URI:On,map:si,ap:jd,of:Ga,chain:fS},q8={URI:On,reduce:Ud,foldMap:Bd,reduceRight:zd},K8={URI:On,reduce:Ud,foldMap:Bd,reduceRight:zd,reduceWithIndex:pS,foldMapWithIndex:hS,reduceRightWithIndex:mS},V8={URI:On,map:si,reduce:Ud,foldMap:Bd,reduceRight:zd,traverse:dS,sequence:Gm},H8={URI:On,map:si,mapWithIndex:lS,reduce:Ud,foldMap:Bd,reduceRight:zd,traverse:dS,sequence:Gm,reduceWithIndex:pS,foldMapWithIndex:hS,reduceRightWithIndex:mS,traverseWithIndex:kA},J8={URI:On,map:si,alt:AA},G8={URI:On,map:si,extend:CA,extract:bS},Y8=Ga(jt),Z8=It($S),X8=Ot(_S),Q8=Tt(Zm),Wr=In,ci=function(e){return e.slice(1)},tl=Ja,nl=function(e){return e.slice(0,-1)},eG=lA,tG=fA,nG=function(e){return function(t){return t.reduce(e.concat)}},rG=function(e){return function(t){return e(Wr(t),ci(t))}},iG=function(e){return function(t){return e(nl(t),tl(t))}},BA=function(e){return function(t){return Fd([e(Wr(t))],ci(t),!0)}},oG=function(e){return BA(function(){return e})},zA=function(e){return function(t){return m(nl(t),Dd(e(tl(t))))}},aG=function(e){return zA(function(){return e})},uG=Q_;function sG(e){var t=sS(e),n=SA(e);return function(r){return Eo(r)?n(t(r)):[]}}function cG(e){return qA(function(t,n){return e(n)})}var qA=function(e){return function(t){return uS(t.filter(function(n,r){return e(r,n)}))}},lG=bA,fG=$A;function KA(e,t){return t===void 0?Qc(e):m(t,Qc(e))}var VA=function(e,t){return m(e,Dd(t))},dG=Vm,pG=Bm,hG={URI:On,of:Ga,map:si,mapWithIndex:lS,ap:jd,chain:fS,extend:CA,extract:bS,reduce:Ud,foldMap:Bd,reduceRight:zd,traverse:dS,sequence:Gm,reduceWithIndex:pS,foldMapWithIndex:hS,reduceRightWithIndex:mS,traverseWithIndex:kA,alt:AA};const mG=Object.freeze(Object.defineProperty({__proto__:null,isNonEmpty:Eo,isOutOfBound:zm,prependW:eS,prepend:Qc,appendW:tS,append:Dd,unsafeInsertAt:nS,unsafeUpdateAt:rS,uniq:iS,sortBy:gA,union:oS,rotate:aS,fromReadonlyNonEmptyArray:Ld,fromArray:uS,makeBy:qm,replicate:I8,range:yA,unprepend:bA,unappend:$A,concatW:_A,concat:Km,reverse:O8,group:SA,groupBy:w8,sort:sS,insertAt:E8,updateAt:R8,modifyAt:TA,copy:el,of:Ga,zipWith:IA,zip:OA,unzip:M8,prependAll:Vm,intersperse:wA,foldMapWithIndex:EA,foldMap:RA,chainWithIndex:MA,chop:cS,splitAt:Hm,chunksOf:xA,altW:WA,alt:NA,ap:PA,chain:Jm,extend:vS,duplicate:x8,flatten:C8,map:gS,mapWithIndex:yS,reduce:FA,reduceWithIndex:DA,reduceRight:LA,reduceRightWithIndex:jA,traverse:UA,sequence:Gm,traverseWithIndex:Ym,extract:bS,URI:On,getShow:A8,getSemigroup:k8,getEq:W8,getUnionSemigroup:N8,Functor:$S,flap:P8,Pointed:F8,FunctorWithIndex:D8,Apply:Zm,apFirst:L8,apSecond:j8,Applicative:U8,Chain:_S,chainFirst:B8,Monad:z8,Foldable:q8,FoldableWithIndex:K8,Traversable:V8,TraversableWithIndex:H8,Alt:J8,Comonad:G8,Do:Y8,bindTo:Z8,bind:X8,apS:Q8,head:Wr,tail:ci,last:tl,init:nl,min:eG,max:tG,concatAll:nG,matchLeft:rG,matchRight:iG,modifyHead:BA,updateHead:oG,modifyLast:zA,updateLast:aG,intercalate:uG,groupSort:sG,filter:cG,filterWithIndex:qA,uncons:lG,unsnoc:fG,cons:KA,snoc:VA,prependToAll:dG,fold:pG,nonEmptyArray:hG},Symbol.toStringTag,{value:"Module"}));var vG=function(e){return typeof e=="number"},Xm={equals:function(e,t){return e===t}},Qm={equals:Xm.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},gG={equals:Xm.equals,compare:Qm.compare,top:1/0,bottom:-1/0},yG={show:function(e){return JSON.stringify(e)}},HA={concat:function(e,t){return e-t}},SS={concat:function(e,t){return e+t}},TS={concat:function(e,t){return e*t}},bG={concat:SS.concat,empty:0},$G={concat:TS.concat,empty:1},_G={add:SS.concat,zero:0,mul:TS.concat,one:1,sub:HA.concat,degree:function(e){return 1},div:function(e,t){return e/t},mod:function(e,t){return e%t}};const SG=Object.freeze(Object.defineProperty({__proto__:null,isNumber:vG,Eq:Xm,Ord:Qm,Bounded:gG,Show:yG,MagmaSub:HA,SemigroupSum:SS,SemigroupProduct:TS,MonoidSum:bG,MonoidProduct:$G,Field:_G},Symbol.toStringTag,{value:"Module"}));function rl(e,t){return function(n){return n?t.of(void 0):e.zero()}}const TG=Object.freeze(Object.defineProperty({__proto__:null,guard:rl},Symbol.toStringTag,{value:"Module"}));var IG=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},zi=function(e){return e.length===0},wt=Bi,OG=Zc,wG=M_,ev=xm,EG=x_,JA=function(e,t){return e<=0?$t:Am(t)(e)},RG=function(e,t){return JA(e,function(){return t})};function MG(e){return function(t){return e(t)?[t]:$t}}var GA=function(e){return xt(e)?$t:[e.value]},YA=function(e){return Lt(e)?$t:[e.right]},ZA=function(e,t){return function(n){return wt(n)?t(n):e()}},XA=ZA,QA=function(e,t){return function(n){return wt(n)?t(In(n),ui(n)):e()}},ek=QA,xG=ek,tk=function(e,t){return function(n){return wt(n)?t(Xc(n),Ja(n)):e()}},nk=tk,CG=nk,rk=function(e){return function(t){if(zi(t))return $t;for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},AG=function(e,t){return function(n){var r=n.length,i=new Array(r+1);i[0]=e;for(var o=0;o<r;o++)i[o+1]=t(i[o],n[o]);return i}},kG=function(e,t){return function(n){var r=n.length,i=new Array(r+1);i[r]=e;for(var o=r-1;o>=0;o--)i[o]=t(n[o],i[o+1]);return i}},WG=function(e){return e.length},il=Mm;function Ro(e,t){return t===void 0?function(n){return Ro(e,n)}:il(e,t)?me:le(t[e])}var ik=function(e){return wt(e)?le(In(e)):me},IS=function(e){return wt(e)?le(Ja(e)):me},NG=function(e){return wt(e)?le(ui(e)):me},PG=function(e){return wt(e)?le(Xc(e)):me},FG=function(e){return function(t){return il(e,t)?t:e===0?$t:t.slice(0,e)}},DG=function(e){return function(t){return il(e,t)?t:e===0?$t:t.slice(-e)}};function LG(e){return function(t){for(var n=[],r=0,i=t;r<i.length;r++){var o=i[r];if(!e(o))break;n.push(o)}var a=n.length;return a===t.length?t:a===0?$t:n}}var ok=function(e,t){for(var n=e.length,r=0;r<n&&t(e[r]);r++);return r};function jG(e){return function(t){var n=wS(ok(t,e))(t),r=n[0],i=n[1];return{init:r,rest:i}}}var UG=function(e){return function(t){return e<=0||zi(t)?t:e>=t.length?$t:t.slice(e,t.length)}},BG=function(e){return function(t){return e<=0||zi(t)?t:e>=t.length?$t:t.slice(0,t.length-e)}};function zG(e){return function(t){var n=ok(t,e);return n===0?t:n===t.length?$t:t.slice(n)}}var tv=function(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return le(n);return me}};function nv(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return le(t[n]);return me}}var ak=function(e){return function(t){for(var n=0;n<t.length;n++){var r=e(t[n]);if(ht(r))return r}return me}};function uk(e){return function(t){for(var n=t.length-1;n>=0;n--)if(e(t[n]))return le(t[n]);return me}}var sk=function(e){return function(t){for(var n=t.length-1;n>=0;n--){var r=e(t[n]);if(ht(r))return r}return me}},ck=function(e){return function(t){for(var n=t.length-1;n>=0;n--)if(e(t[n]))return le(n);return me}},qG=function(e,t){return function(n){return e<0||e>n.length?me:le(Cm(e,t,n))}},OS=function(e,t){return lk(e,function(){return t})},KG=function(e){return function(t){return il(e,t)?me:le(Fk(e,t))}},lk=function(e,t){return function(n){return il(e,n)?me:le(hv(e,t(n[e]),n))}},VG=function(e){return e.length<=1?e:e.slice().reverse()},HG=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Right"&&t.push(r.right)}return t},JG=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Left"&&t.push(r.left)}return t},GG=function(e){return function(t){return t.length<=1?t:t.slice().sort(e.compare)}},fk=function(e,t,n){for(var r=[],i=Math.min(e.length,t.length),o=0;o<i;o++)r[o]=n(e[o],t[o]);return r};function dk(e,t){return t===void 0?function(n){return dk(n,e)}:fk(e,t,function(n,r){return[n,r]})}var YG=function(e){for(var t=[],n=[],r=0;r<e.length;r++)t[r]=e[r][0],n[r]=e[r][1];return[t,n]},pk=function(e){var t=km(e);return function(n){return wt(n)?t(n):n}},ZG=function(e){var t=P_(e);return function(n){return wt(n)?t(n):n}},XG=function(e){var t=W_(e);return function(n){return wt(n)?t(n):n}};function ol(e){return function(t,n){if(n===void 0){var r=ol(e);return function(a){return r(t,a)}}for(var i=function(a){return e.equals(a,t)},o=0;o<n.length;o++)if(i(n[o]))return!0;return!1}}var QG=function(e){var t=A_(e);return function(n){return wt(n)?t(n):n}},e9=function(e){var t=qC(e);return function(n){return wt(n)?t(n):n}},t9=function(e){var t=F_(e);return function(n){return wt(n)?t(n):$t}},wS=function(e){return function(t){return e>=1&&wt(t)?Wm(e)(t):zi(t)?[t,$t]:[$t,t]}},n9=function(e){var t=eA(e);return function(n){return wt(n)?t(n):$t}},r9=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return GA(e.apply(void 0,t))}};function i9(e,t,n){n===void 0&&(n=function(){return!0});var r=function(i,o){return wt(o)?m(In(o),Kd(function(a){return r(m(i,ev(a)),ui(o))})):n.apply(void 0,i)?[t.apply(void 0,i)]:$t};return r($t,e)}var hk=function(e){return function(t){return zi(t)?e:zi(e)?t:t.concat(e)}},o9=hk;function ES(e){var t=k_(e);return function(n,r){if(r===void 0){var i=ES(e);return function(o){return i(o,n)}}return wt(n)&&wt(r)?t(r)(n):wt(n)?n:r}}function RS(e){var t=ol(e);return function(n,r){if(r===void 0){var i=RS(e);return function(o){return i(o,n)}}return n.filter(function(o){return t(o,r)})}}function MS(e){var t=ol(e);return function(n,r){if(r===void 0){var i=MS(e);return function(o){return i(o,n)}}return n.filter(function(o){return!t(o,r)})}}var Zt=function(e,t){return m(e,cv(t))},rv=function(e,t){return m(e,Ik(t))},Ya=function(e,t){return m(e,Tk(t))},qd=function(e,t){return m(e,Kd(t))},iv=function(e,t){return m(e,li(t))},ov=function(e,t){return m(e,DS(t))},av=function(e,t){return m(e,Ok(t))},uv=function(e,t){return m(e,wk(t))},mk=function(e,t){return m(e,LS(t))},vk=function(e,t){return m(e,jS(t))},xS=function(e,t){return m(e,Sk(t))},ls=function(e,t,n){return m(e,fv(t,n))},al=function(e){var t=zS(e);return function(n,r){return m(n,t(r))}},ul=function(e,t,n){return m(e,qS(t,n))},CS=function(e,t,n){return m(e,Vd(t,n))},AS=function(e){var t=lv(e);return function(n,r){return m(n,t(r))}},kS=function(e,t,n){return m(e,dv(t,n))},gk=function(e,t){return m(e,FS(t))},yk=function(e,t){return m(e,US(t))},bk=function(e,t){return m(e,BS(t))},sv=function(e){var t=Ek(e);return function(n,r){return m(n,t(r))}},$k=function(e){var t=KS(e);return function(n,r){return m(n,t(r))}},WS=function(e,t){return m(e,ZS(t))},NS=function(e,t){return m(e,XS(t))},fs=Ha,sl=function(){return $t},_k=function(e){return function(t){return t.concat(e())}},Sk=_k,Tk=function(e){return Kd(function(t){return m(e,cv(t))})},Kd=function(e){return function(t){return m(t,rk(function(n,r){return e(r)}))}},PS=Kd(B),cv=function(e){return function(t){return t.map(function(n){return e(n)})}},Ik=function(e){return function(t){return t.map(function(n,r){return e(r,n)})}},cl=function(e){for(var t=[],n=[],r=0,i=e;r<i.length;r++){var o=i[r];o._tag==="Left"?t.push(o.left):n.push(o.right)}return Oe(t,n)},li=function(e){return function(t){return t.filter(e)}},FS=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);ht(i)&&n.push(i.value)}return n}},DS=function(e){return FS(function(t,n){return e(n)})},ll=DS(B),Ok=function(e){return LS(function(t,n){return e(n)})},LS=function(e){return function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=t[i];e(i,o)?r.push(o):n.push(o)}return Oe(n,r)}},wk=function(e){return jS(function(t,n){return e(n)})},jS=function(e){return function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=e(i,t[i]);o._tag==="Left"?n.push(o.left):r.push(o.right)}return Oe(n,r)}},US=function(e){return function(t){return t.filter(function(n,r){return e(r,n)})}},BS=function(e){return function(t){return t.map(function(n,r){return e(t.slice(r))})}},a9=BS(B),lv=function(e){return function(t){return function(n){return n.reduce(function(r,i,o){return e.concat(r,t(o,i))},e.empty)}}},fv=function(e,t){return Vd(e,function(n,r,i){return t(r,i)})},zS=function(e){var t=lv(e);return function(n){return t(function(r,i){return n(i)})}},Vd=function(e,t){return function(n){for(var r=n.length,i=e,o=0;o<r;o++)i=t(o,i,n[o]);return i}},qS=function(e,t){return dv(e,function(n,r,i){return t(r,i)})},dv=function(e,t){return function(n){return n.reduceRight(function(r,i,o){return t(o,i,r)},e)}},Ek=function(e){var t=KS(e);return function(n){return t(function(r,i){return n(i)})}},Hd=function(e){return function(t){return ls(t,e.of(sl()),function(n,r){return e.ap(e.map(n,function(i){return function(o){return m(i,ev(o))}}),r)})}},KS=function(e){return function(t){return Vd(e.of(sl()),function(n,r,i){return e.ap(e.map(r,function(o){return function(a){return m(o,ev(a))}}),t(n,i))})}},u9=function(e){var t=QS(e);return function(n){return function(r){return t(r,n)}}},s9=function(e){var t=e0(e);return function(n){return function(r){return t(r,n)}}},VS=function(e,t){for(var n=[],r=e;;){var i=t(r);if(ht(i)){var o=i.value,a=o[0],u=o[1];n.push(a),r=u}else break}return n},ut="ReadonlyArray",Rk=function(e){return{show:function(t){return"[".concat(t.map(e.show).join(", "),"]")}}},Mk=function(){return{concat:function(e,t){return zi(e)?t:zi(t)?e:e.concat(t)}}},c9=function(){return{concat:Mk().concat,empty:$t}},xk=function(e){return kr(function(t,n){return t.length===n.length&&t.every(function(r,i){return e.equals(r,n[i])})})},Ck=function(e){return cs(function(t,n){for(var r=t.length,i=n.length,o=Math.min(r,i),a=0;a<o;a++){var u=e.compare(t[a],n[a]);if(u!==0)return u}return Qm.compare(r,i)})},Ak=function(e){var t=ES(e);return{concat:function(n,r){return t(r)(n)}}},l9=function(e){return{concat:Ak(e).concat,empty:$t}},f9=function(e){var t=RS(e);return{concat:function(n,r){return t(r)(n)}}},d9=function(e){var t=MS(e);return{concat:function(n,r){return t(r)(n)}}},HS={URI:ut,map:Zt},p9=De(HS),kk={URI:ut,of:fs},h9={URI:ut,map:Zt,mapWithIndex:rv},pv={URI:ut,map:Zt,ap:Ya},m9=_t(pv),v9=St(pv),g9={URI:ut,map:Zt,ap:Ya,of:fs},JS={URI:ut,map:Zt,ap:Ya,chain:qd},y9={URI:ut,map:Zt,ap:Ya,of:fs,chain:qd},b9=at(JS),$9={URI:ut,unfold:VS},_9={URI:ut,map:Zt,alt:xS},Wk={URI:ut,zero:sl},S9=rl(Wk,kk),T9={URI:ut,map:Zt,ap:Ya,of:fs,alt:xS,zero:sl},I9={URI:ut,map:Zt,extend:bk},GS={URI:ut,compact:ll,separate:cl},O9={URI:ut,map:Zt,compact:ll,separate:cl,filter:iv,filterMap:ov,partition:av,partitionMap:uv},w9={URI:ut,map:Zt,mapWithIndex:rv,compact:ll,separate:cl,filter:iv,filterMap:ov,partition:av,partitionMap:uv,partitionMapWithIndex:vk,partitionWithIndex:mk,filterMapWithIndex:gk,filterWithIndex:yk},E9={URI:ut,reduce:ls,foldMap:al,reduceRight:ul},R9={URI:ut,reduce:ls,foldMap:al,reduceRight:ul,reduceWithIndex:CS,foldMapWithIndex:AS,reduceRightWithIndex:kS},YS={URI:ut,map:Zt,reduce:ls,foldMap:al,reduceRight:ul,traverse:sv,sequence:Hd},M9={URI:ut,map:Zt,mapWithIndex:rv,reduce:ls,foldMap:al,reduceRight:ul,reduceWithIndex:CS,foldMapWithIndex:AS,reduceRightWithIndex:kS,traverse:sv,sequence:Hd,traverseWithIndex:$k},ZS=function(e){return function(t){for(var n=IG([],e(t),!0),r=[];n.length>0;){var i=n.shift();Lt(i)?n.unshift.apply(n,e(i.left)):r.push(i.right)}return r}},x9={URI:ut,map:Zt,ap:Ya,chain:qd,chainRec:WS},XS=function(e){return function(t){var n=e(t),r=[],i=[];function o(c){Lt(c)?e(c.left).forEach(function(l){return r.push(l)}):i.push(c.right)}for(var a=0,u=n;a<u.length;a++){var s=u[a];o(s)}for(;r.length>0;)o(r.shift());return i}},C9={URI:ut,map:Zt,ap:Ya,chain:qd,chainRec:NS},QS=ri(YS,GS),e0=ni(YS,GS),Nk={URI:ut,map:Zt,compact:ll,separate:cl,filter:iv,filterMap:ov,partition:av,partitionMap:uv,reduce:ls,foldMap:al,reduceRight:ul,traverse:sv,sequence:Hd,wither:QS,wilt:e0},A9=z$(Nk),Pk={URI:ut,fromEither:YA},k9=ar(Pk),W9=Cm,hv=function(e,t,n){return wt(n)?C_(e,t,n):n},Fk=function(e,t){var n=t.slice();return n.splice(e,1),n},N9=function(e){return e.slice()},P9=function(e){return zi(e)?$t:e.slice()},$t=xd;function Dk(e){return function(t){return t.every(e)}}var Lk=function(e){return function(t){return t.some(e)}},F9=Lk,jk=function(e){var t=Q_(e);return function(n){return XA(function(){return e.empty},t(n))}},D9=fs(jt),L9=It(HS),j9=Ot(JS),U9=Tt(pv),B9=KC,z9=mA,q9=vA,K9=pk,V9={URI:ut,compact:ll,separate:cl,map:Zt,ap:Ya,of:fs,chain:qd,filter:iv,filterMap:ov,partition:av,partitionMap:uv,mapWithIndex:rv,partitionMapWithIndex:vk,partitionWithIndex:mk,filterMapWithIndex:gk,filterWithIndex:yk,alt:xS,zero:sl,unfold:VS,reduce:ls,foldMap:al,reduceRight:ul,traverse:sv,sequence:Hd,reduceWithIndex:CS,foldMapWithIndex:AS,reduceRightWithIndex:kS,traverseWithIndex:$k,extend:bk,wither:QS,wilt:e0};const H9=Object.freeze(Object.defineProperty({__proto__:null,isEmpty:zi,isNonEmpty:wt,prepend:OG,prependW:wG,append:ev,appendW:EG,makeBy:JA,replicate:RG,fromPredicate:MG,fromOption:GA,fromEither:YA,matchW:ZA,match:XA,matchLeftW:QA,matchLeft:ek,foldLeft:xG,matchRightW:tk,matchRight:nk,foldRight:CG,chainWithIndex:rk,scanLeft:AG,scanRight:kG,size:WG,isOutOfBound:il,lookup:Ro,head:ik,last:IS,tail:NG,init:PG,takeLeft:FG,takeRight:DG,takeLeftWhile:LG,spanLeft:jG,dropLeft:UG,dropRight:BG,dropLeftWhile:zG,findIndex:tv,findFirst:nv,findFirstMap:ak,findLast:uk,findLastMap:sk,findLastIndex:ck,insertAt:qG,updateAt:OS,deleteAt:KG,modifyAt:lk,reverse:VG,rights:HG,lefts:JG,sort:GG,zipWith:fk,zip:dk,unzip:YG,prependAll:pk,intersperse:ZG,rotate:XG,elem:ol,uniq:QG,sortBy:e9,chop:t9,splitAt:wS,chunksOf:n9,fromOptionK:r9,comprehension:i9,concatW:hk,concat:o9,union:ES,intersection:RS,difference:MS,_chainRecDepthFirst:WS,_chainRecBreadthFirst:NS,of:fs,zero:sl,altW:_k,alt:Sk,ap:Tk,chain:Kd,flatten:PS,map:cv,mapWithIndex:Ik,separate:cl,filter:li,filterMapWithIndex:FS,filterMap:DS,compact:ll,partition:Ok,partitionWithIndex:LS,partitionMap:wk,partitionMapWithIndex:jS,filterWithIndex:US,extend:BS,duplicate:a9,foldMapWithIndex:lv,reduce:fv,foldMap:zS,reduceWithIndex:Vd,reduceRight:qS,reduceRightWithIndex:dv,traverse:Ek,sequence:Hd,traverseWithIndex:KS,wither:u9,wilt:s9,unfold:VS,URI:ut,getShow:Rk,getSemigroup:Mk,getMonoid:c9,getEq:xk,getOrd:Ck,getUnionSemigroup:Ak,getUnionMonoid:l9,getIntersectionSemigroup:f9,getDifferenceMagma:d9,Functor:HS,flap:p9,Pointed:kk,FunctorWithIndex:h9,Apply:pv,apFirst:m9,apSecond:v9,Applicative:g9,Chain:JS,Monad:y9,chainFirst:b9,Unfoldable:$9,Alt:_9,Zero:Wk,guard:S9,Alternative:T9,Extend:I9,Compactable:GS,Filterable:O9,FilterableWithIndex:w9,Foldable:E9,FoldableWithIndex:R9,Traversable:YS,TraversableWithIndex:M9,chainRecDepthFirst:ZS,ChainRecDepthFirst:x9,chainRecBreadthFirst:XS,ChainRecBreadthFirst:C9,Witherable:Nk,filterE:A9,FromEither:Pk,fromEitherK:k9,unsafeInsertAt:W9,unsafeUpdateAt:hv,unsafeDeleteAt:Fk,toArray:N9,fromArray:P9,empty:$t,every:Dk,some:Lk,exists:F9,intercalate:jk,Do:D9,bindTo:L9,bind:j9,apS:U9,range:B9,cons:z9,snoc:q9,prependToAll:K9,readonlyArray:V9},Symbol.toStringTag,{value:"Module"}));var Za=function(e){return e.length===0},Ct=Eo,J9=Qc,G9=eS,mv=Dd,Y9=tS,Uk=function(e,t){return e<=0?[]:qm(t)(e)},Z9=function(e,t){return Uk(e,function(){return t})};function X9(e){return function(t){return e(t)?[t]:[]}}var Bk=function(e){return xt(e)?[]:[e.value]},zk=function(e){return Lt(e)?[]:[e.right]},qk=function(e,t){return function(n){return Ct(n)?t(n):e()}},Q9=qk,Kk=function(e,t){return function(n){return Ct(n)?t(Wr(n),ci(n)):e()}},Vk=Kk,eY=Vk,Hk=function(e,t){return function(n){return Ct(n)?t(nl(n),tl(n)):e()}},Jk=Hk,tY=Jk,Gk=function(e){return function(t){for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},nY=function(e,t){return function(n){var r=n.length,i=new Array(r+1);i[0]=e;for(var o=0;o<r;o++)i[o+1]=t(i[o],n[o]);return i}},rY=function(e,t){return function(n){var r=n.length,i=new Array(r+1);i[r]=e;for(var o=r-1;o>=0;o--)i[o]=t(n[o],i[o+1]);return i}},iY=function(e){return e.length},Jd=zm,oY=Ro,aY=ik,uY=IS,sY=function(e){return Ct(e)?le(ci(e)):me},cY=function(e){return Ct(e)?le(nl(e)):me},lY=function(e){return function(t){return Jd(e,t)?mn(t):t.slice(0,e)}},fY=function(e){return function(t){return Jd(e,t)?mn(t):e===0?[]:t.slice(-e)}};function dY(e){return function(t){for(var n=[],r=0,i=t;r<i.length;r++){var o=i[r];if(!e(o))break;n.push(o)}return n}}var Yk=function(e,t){for(var n=e.length,r=0;r<n&&t(e[r]);r++);return r};function pY(e){return function(t){var n=tW(Yk(t,e))(t),r=n[0],i=n[1];return{init:r,rest:i}}}var hY=function(e){return function(t){return e<=0||Za(t)?mn(t):e>=t.length?[]:t.slice(e,t.length)}},mY=function(e){return function(t){return e<=0||Za(t)?mn(t):e>=t.length?[]:t.slice(0,t.length-e)}};function vY(e){return function(t){return t.slice(Yk(t,e))}}var gY=tv;function yY(e){return nv(e)}var bY=ak;function $Y(e){return uk(e)}var _Y=sk,SY=ck,mn=function(e){return e.slice()},TY=function(e,t){return function(n){return e<0||e>n.length?me:le(xW(e,t,n))}},IY=function(e,t){return Zk(e,function(){return t})},OY=function(e){return function(t){return Jd(e,t)?me:le(AW(e,t))}},Zk=function(e,t){return function(n){return Jd(e,n)?me:le(CW(e,t(n[e]),n))}},wY=function(e){return Za(e)?[]:e.slice().reverse()},EY=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Right"&&t.push(r.right)}return t},RY=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Left"&&t.push(r.left)}return t},MY=function(e){return function(t){return t.length<=1?mn(t):t.slice().sort(e.compare)}},Xk=function(e,t,n){for(var r=[],i=Math.min(e.length,t.length),o=0;o<i;o++)r[o]=n(e[o],t[o]);return r};function Qk(e,t){return t===void 0?function(n){return Qk(n,e)}:Xk(e,t,function(n,r){return[n,r]})}var xY=function(e){for(var t=[],n=[],r=0;r<e.length;r++)t[r]=e[r][0],n[r]=e[r][1];return[t,n]},eW=function(e){var t=Vm(e);return function(n){return Ct(n)?t(n):[]}},CY=function(e){var t=wA(e);return function(n){return Ct(n)?t(n):mn(n)}},AY=function(e){var t=aS(e);return function(n){return Ct(n)?t(n):mn(n)}},t0=ol,kY=function(e){var t=iS(e);return function(n){return Ct(n)?t(n):mn(n)}},WY=function(e){var t=gA(e);return function(n){return Ct(n)?t(n):mn(n)}},NY=function(e){var t=cS(e);return function(n){return Ct(n)?t(n):[]}},tW=function(e){return function(t){return e>=1&&Ct(t)?Hm(e)(t):Za(t)?[mn(t),[]]:[[],mn(t)]}},PY=function(e){var t=xA(e);return function(n){return Ct(n)?t(n):[]}},FY=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Bk(e.apply(void 0,t))}};function DY(e,t,n){n===void 0&&(n=function(){return!0});var r=function(i,o){return Ct(o)?m(Wr(o),Yd(function(a){return r(m(i,mv(a)),ci(o))})):n.apply(void 0,i)?[t.apply(void 0,i)]:[]};return r([],e)}var nW=function(e){return function(t){return Za(t)?mn(e):Za(e)?mn(t):t.concat(e)}},LY=nW;function n0(e){var t=oS(e);return function(n,r){if(r===void 0){var i=n0(e);return function(o){return i(o,n)}}return Ct(n)&&Ct(r)?t(r)(n):Ct(n)?mn(n):mn(r)}}function r0(e){var t=t0(e);return function(n,r){if(r===void 0){var i=r0(e);return function(o){return i(o,n)}}return n.filter(function(o){return t(o,r)})}}function i0(e){var t=t0(e);return function(n,r){if(r===void 0){var i=i0(e);return function(o){return i(o,n)}}return n.filter(function(o){return!t(o,r)})}}var Xt=function(e,t){return m(e,c0(t))},vv=function(e,t){return m(e,lW(t))},Xa=function(e,t){return m(e,cW(t))},Gd=function(e,t){return m(e,Yd(t))},gv=function(e,t){return m(e,fW(t))},yv=function(e,t){return m(e,d0(t))},bv=function(e,t){return m(e,dW(t))},$v=function(e,t){return m(e,pW(t))},rW=function(e,t){return m(e,p0(t))},iW=function(e,t){return m(e,h0(t))},o0=function(e,t){return m(e,mW(t))},ds=function(e,t,n){return m(e,bW(t,n))},fl=function(e){var t=gW(e);return function(n,r){return m(n,t(r))}},dl=function(e,t,n){return m(e,$W(t,n))},a0=function(e,t,n){return m(e,v0(t,n))},u0=function(e){var t=yW(e);return function(n,r){return m(n,t(r))}},s0=function(e,t,n){return m(e,_W(t,n))},oW=function(e,t){return m(e,f0(t))},aW=function(e,t){return m(e,vW(t))},uW=function(e,t){return m(e,m0(t))},_v=function(e){var t=Sv(e);return function(n,r){return m(n,t(r))}},sW=function(e){var t=g0(e);return function(n,r){return m(n,t(r))}},jY=WS,UY=NS,Qa=Ga,pl=function(){return[]},c0=function(e){return function(t){return t.map(function(n){return e(n)})}},cW=function(e){return Yd(function(t){return m(e,c0(t))})},Yd=function(e){return function(t){return m(t,Gk(function(n,r){return e(r)}))}},l0=Yd(B),lW=function(e){return function(t){return t.map(function(n,r){return e(r,n)})}},f0=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);ht(i)&&n.push(i.value)}return n}},d0=function(e){return f0(function(t,n){return e(n)})},hl=d0(B),ml=function(e){for(var t=[],n=[],r=0,i=e;r<i.length;r++){var o=i[r];o._tag==="Left"?t.push(o.left):n.push(o.right)}return Oe(t,n)},fW=function(e){return function(t){return t.filter(e)}},dW=function(e){return p0(function(t,n){return e(n)})},p0=function(e){return function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=t[i];e(i,o)?r.push(o):n.push(o)}return Oe(n,r)}},pW=function(e){return h0(function(t,n){return e(n)})},h0=function(e){return function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=e(i,t[i]);o._tag==="Left"?n.push(o.left):r.push(o.right)}return Oe(n,r)}},hW=function(e){return function(t){return t.concat(e())}},mW=hW,vW=function(e){return function(t){return t.filter(function(n,r){return e(r,n)})}},m0=function(e){return function(t){return t.map(function(n,r){return e(t.slice(r))})}},BY=m0(B),gW=zS,yW=lv,bW=fv,v0=Vd,$W=qS,_W=dv,Sv=function(e){var t=g0(e);return function(n){return t(function(r,i){return n(i)})}},Zd=function(e){return function(t){return ds(t,e.of(pl()),function(n,r){return e.ap(e.map(n,function(i){return function(o){return m(i,mv(o))}}),r)})}},g0=function(e){return function(t){return v0(e.of(pl()),function(n,r,i){return e.ap(e.map(r,function(o){return function(a){return m(o,mv(a))}}),t(n,i))})}},zY=function(e){var t=I0(e);return function(n){return function(r){return t(r,n)}}},qY=function(e){var t=O0(e);return function(n){return function(r){return t(r,n)}}},y0=function(e,t){for(var n=[],r=e;;){var i=t(r);if(ht(i)){var o=i.value,a=o[0],u=o[1];n.push(a),r=u}else break}return n},st="Array",KY=Rk,SW=function(){return{concat:function(e,t){return e.concat(t)}}},b0=function(){return{concat:SW().concat,empty:[]}},TW=xk,VY=Ck,IW=function(e){var t=n0(e);return{concat:function(n,r){return t(r)(n)}}},HY=function(e){return{concat:IW(e).concat,empty:[]}},JY=function(e){var t=r0(e);return{concat:function(n,r){return t(r)(n)}}},GY=function(e){var t=i0(e);return{concat:function(n,r){return t(r)(n)}}},$0={URI:st,map:Xt},YY=De($0),OW={URI:st,of:Qa},ZY={URI:st,map:Xt,mapWithIndex:vv},Tv={URI:st,map:Xt,ap:Xa},XY=_t(Tv),QY=St(Tv),eZ={URI:st,map:Xt,ap:Xa,of:Qa},_0={URI:st,map:Xt,ap:Xa,chain:Gd},tZ=at(_0),nZ={URI:st,map:Xt,ap:Xa,of:Qa,chain:Gd},rZ={URI:st,unfold:y0},iZ={URI:st,map:Xt,alt:o0},wW={URI:st,zero:pl},oZ=rl(wW,OW),aZ={URI:st,map:Xt,ap:Xa,of:Qa,alt:o0,zero:pl},uZ={URI:st,map:Xt,extend:uW},S0={URI:st,compact:hl,separate:ml},sZ={URI:st,map:Xt,compact:hl,separate:ml,filter:gv,filterMap:yv,partition:bv,partitionMap:$v},cZ={URI:st,map:Xt,mapWithIndex:vv,compact:hl,separate:ml,filter:gv,filterMap:yv,partition:bv,partitionMap:$v,partitionMapWithIndex:iW,partitionWithIndex:rW,filterMapWithIndex:oW,filterWithIndex:aW},EW={URI:st,reduce:ds,foldMap:fl,reduceRight:dl},lZ={URI:st,reduce:ds,foldMap:fl,reduceRight:dl,reduceWithIndex:a0,foldMapWithIndex:u0,reduceRightWithIndex:s0},T0={URI:st,map:Xt,reduce:ds,foldMap:fl,reduceRight:dl,traverse:_v,sequence:Zd},fZ={URI:st,map:Xt,mapWithIndex:vv,reduce:ds,foldMap:fl,reduceRight:dl,reduceWithIndex:a0,foldMapWithIndex:u0,reduceRightWithIndex:s0,traverse:_v,sequence:Zd,traverseWithIndex:sW},I0=ri(T0,S0),O0=ni(T0,S0),RW={URI:st,map:Xt,compact:hl,separate:ml,filter:gv,filterMap:yv,partition:bv,partitionMap:$v,reduce:ds,foldMap:fl,reduceRight:dl,traverse:_v,sequence:Zd,wither:I0,wilt:O0},dZ=ZS,pZ={URI:st,map:Xt,ap:Xa,chain:Gd,chainRec:jY},hZ=XS,mZ={URI:st,map:Xt,ap:Xa,chain:Gd,chainRec:UY},vZ=z$(RW),MW={URI:st,fromEither:zk},gZ=ar(MW),xW=nS,CW=function(e,t,n){return Ct(n)?rS(e,t,n):[]},AW=function(e,t){var n=t.slice();return n.splice(e,1),n},yZ=Dk,kW=function(e){return function(t){return t.some(e)}},bZ=kW,$Z=jk,_Z=Qa(jt),SZ=It($0),TZ=Ot(_0),IZ=Tt(Tv),OZ=yA,wZ=[],EZ=KA,RZ=VA,MZ=eW,xZ={URI:st,compact:hl,separate:ml,map:Xt,ap:Xa,of:Qa,chain:Gd,filter:gv,filterMap:yv,partition:bv,partitionMap:$v,mapWithIndex:vv,partitionMapWithIndex:iW,partitionWithIndex:rW,filterMapWithIndex:oW,filterWithIndex:aW,alt:o0,zero:pl,unfold:y0,reduce:ds,foldMap:fl,reduceRight:dl,traverse:_v,sequence:Zd,reduceWithIndex:a0,foldMapWithIndex:u0,reduceRightWithIndex:s0,traverseWithIndex:sW,extend:uW,wither:I0,wilt:O0};const WW=Object.freeze(Object.defineProperty({__proto__:null,isEmpty:Za,isNonEmpty:Ct,prepend:J9,prependW:G9,append:mv,appendW:Y9,makeBy:Uk,replicate:Z9,fromPredicate:X9,fromOption:Bk,fromEither:zk,matchW:qk,match:Q9,matchLeftW:Kk,matchLeft:Vk,foldLeft:eY,matchRightW:Hk,matchRight:Jk,foldRight:tY,chainWithIndex:Gk,scanLeft:nY,scanRight:rY,size:iY,isOutOfBound:Jd,lookup:oY,head:aY,last:uY,tail:sY,init:cY,takeLeft:lY,takeRight:fY,takeLeftWhile:dY,spanLeft:pY,dropLeft:hY,dropRight:mY,dropLeftWhile:vY,findIndex:gY,findFirst:yY,findFirstMap:bY,findLast:$Y,findLastMap:_Y,findLastIndex:SY,copy:mn,insertAt:TY,updateAt:IY,deleteAt:OY,modifyAt:Zk,reverse:wY,rights:EY,lefts:RY,sort:MY,zipWith:Xk,zip:Qk,unzip:xY,prependAll:eW,intersperse:CY,rotate:AY,elem:t0,uniq:kY,sortBy:WY,chop:NY,splitAt:tW,chunksOf:PY,fromOptionK:FY,comprehension:DY,concatW:nW,concat:LY,union:n0,intersection:r0,difference:i0,of:Qa,zero:pl,map:c0,ap:cW,chain:Yd,flatten:l0,mapWithIndex:lW,filterMapWithIndex:f0,filterMap:d0,compact:hl,separate:ml,filter:fW,partition:dW,partitionWithIndex:p0,partitionMap:pW,partitionMapWithIndex:h0,altW:hW,alt:mW,filterWithIndex:vW,extend:m0,duplicate:BY,foldMap:gW,foldMapWithIndex:yW,reduce:bW,reduceWithIndex:v0,reduceRight:$W,reduceRightWithIndex:_W,traverse:Sv,sequence:Zd,traverseWithIndex:g0,wither:zY,wilt:qY,unfold:y0,URI:st,getShow:KY,getSemigroup:SW,getMonoid:b0,getEq:TW,getOrd:VY,getUnionSemigroup:IW,getUnionMonoid:HY,getIntersectionSemigroup:JY,getDifferenceMagma:GY,Functor:$0,flap:YY,Pointed:OW,FunctorWithIndex:ZY,Apply:Tv,apFirst:XY,apSecond:QY,Applicative:eZ,Chain:_0,chainFirst:tZ,Monad:nZ,Unfoldable:rZ,Alt:iZ,Zero:wW,guard:oZ,Alternative:aZ,Extend:uZ,Compactable:S0,Filterable:sZ,FilterableWithIndex:cZ,Foldable:EW,FoldableWithIndex:lZ,Traversable:T0,TraversableWithIndex:fZ,Witherable:RW,chainRecDepthFirst:dZ,ChainRecDepthFirst:pZ,chainRecBreadthFirst:hZ,ChainRecBreadthFirst:mZ,filterE:vZ,FromEither:MW,fromEitherK:gZ,unsafeInsertAt:xW,unsafeUpdateAt:CW,unsafeDeleteAt:AW,every:yZ,some:kW,exists:bZ,intercalate:$Z,Do:_Z,bindTo:SZ,bind:TZ,apS:IZ,range:OZ,empty:wZ,cons:EZ,snoc:RZ,prependToAll:MZ,array:xZ},Symbol.toStringTag,{value:"Module"})),CZ=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var AZ=function(e){return typeof e=="boolean"},NW=function(e,t){return function(n){return n?t():e()}},PW=NW,FW=PW,kZ=FW,DW={equals:function(e,t){return e===t}},WZ={meet:function(e,t){return e&&t},join:function(e,t){return e||t},zero:!1,one:!0,implies:function(e,t){return!e||t},not:function(e){return!e}},LW={concat:function(e,t){return e&&t}},jW={concat:function(e,t){return e||t}},NZ={concat:LW.concat,empty:!0},PZ={concat:jW.concat,empty:!1},FZ={equals:DW.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},DZ={show:function(e){return JSON.stringify(e)}};const LZ=Object.freeze(Object.defineProperty({__proto__:null,isBoolean:AZ,matchW:NW,foldW:PW,match:FW,fold:kZ,Eq:DW,BooleanAlgebra:WZ,SemigroupAll:LW,SemigroupAny:jW,MonoidAll:NZ,MonoidAny:PZ,Ord:FZ,Show:DZ},Symbol.toStringTag,{value:"Module"}));var UW=function(e){return{meet:function(t,n){return e.join(t,n)},join:function(t,n){return e.meet(t,n)},zero:e.one,one:e.zero,implies:function(t,n){return e.join(e.not(t),n)},not:e.not}},jZ={meet:function(){},join:function(){},zero:void 0,one:void 0,implies:function(){},not:function(){}},UZ=UW,BZ={meet:function(e,t){return e&&t},join:function(e,t){return e||t},zero:!1,one:!0,implies:function(e,t){return!e||t},not:function(e){return!e}},zZ=VM;const qZ=Object.freeze(Object.defineProperty({__proto__:null,reverse:UW,booleanAlgebraVoid:jZ,getDualBooleanAlgebra:UZ,booleanAlgebraBoolean:BZ,getFunctionBooleanAlgebra:zZ},Symbol.toStringTag,{value:"Module"}));var KZ=function(e){return kC(e)(e.bottom,e.top)},VZ=function(e){var t=$_(e);return{equals:t.equals,compare:t.compare,top:e.bottom,bottom:e.top}},HZ={equals:Om.equals,compare:Om.compare,top:1/0,bottom:-1/0};const JZ=Object.freeze(Object.defineProperty({__proto__:null,clamp:KZ,reverse:VZ,boundedNumber:HZ},Symbol.toStringTag,{value:"Module"}));function BW(e){return{meet:Tm(e),join:Im(e)}}const GZ=Object.freeze(Object.defineProperty({__proto__:null,getMinMaxDistributiveLattice:BW},Symbol.toStringTag,{value:"Module"}));function YZ(e){var t=BW(e);return function(n,r){return{join:t.join,meet:t.meet,zero:n,one:r}}}const ZZ=Object.freeze(Object.defineProperty({__proto__:null,getMinMaxBoundedDistributiveLattice:YZ},Symbol.toStringTag,{value:"Module"})),XZ=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),QZ=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),eX=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),tX=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function w0(e,t){return function(n,r){return t.compose(e.right(r),e.left(n))}}function zW(e,t){var n=w0(e,t);return function(r,i){return t.compose(e.promap(t.id(),function(o){return o._tag==="Left"?o.left:o.right},B),n(r,i))}}function nX(e){return w0(e,e)}function rX(e){return zW(e,e)}const iX=Object.freeze(Object.defineProperty({__proto__:null,split:w0,fanIn:zW,splitChoice:nX,fanin:rX},Symbol.toStringTag,{value:"Module"})),oX=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var aX=function(e,t){return m(e,qW(t))},qW=function(e){return function(t){return H(e,t)}},KW="Predicate",VW=function(){return{concat:function(e,t){return m(e,JW(t))}}},uX=function(){return{concat:VW().concat,empty:GM}},HW=function(){return{concat:function(e,t){return m(e,GW(t))}}},sX=function(){return{concat:HW().concat,empty:N$}},cX={URI:KW,contramap:aX},Xd=function(e){return function(t){return!e(t)}},JW=function(e){return function(t){return function(n){return t(n)||e(n)}}},GW=function(e){return function(t){return function(n){return t(n)&&e(n)}}};const lX=Object.freeze(Object.defineProperty({__proto__:null,contramap:qW,URI:KW,getSemigroupAny:VW,getMonoidAny:uX,getSemigroupAll:HW,getMonoidAll:sX,Contravariant:cX,not:Xd,or:JW,and:GW},Symbol.toStringTag,{value:"Module"}));var et=me,mt=le;function Iv(e){return function(t){return e(t)?mt(t):et}}var Ov=function(e){return e._tag==="Right"?et:mt(e.left)},Qd=function(e){return e._tag==="Left"?et:mt(e.right)},sr=function(e,t){return m(e,qi(t))},ps=function(e,t){return m(e,QW(t))},wv=function(e,t){return m(e,eu(t))},Ev=function(e,t,n){return m(e,tN(t,n))},Rv=function(e){var t=nN(e);return function(n,r){return m(n,t(r))}},Mv=function(e,t,n){return m(e,rN(t,n))},E0=function(e){var t=fN(e);return function(n,r){return m(n,t(r))}},R0=function(e,t){return m(e,oN(t))},ep=function(e,t){return m(e,uN(t))},M0=function(e,t){return m(e,sN(t))},YW=function(e,t){return m(e,k0(t))},x0=function(e,t){return m(e,cN(t))},C0=function(e,t){return m(e,lN(t))},Wt="Option",fX=function(e){return{show:function(t){return Ne(t)?"none":"some(".concat(e.show(t.value),")")}}},ZW=function(e){return{equals:function(t,n){return t===n||(Ne(t)?Ne(n):Ne(n)?!1:e.equals(t.value,n.value))}}},dX=function(e){return{equals:ZW(e).equals,compare:function(t,n){return t===n?0:kv(t)?kv(n)?e.compare(t.value,n.value):1:-1}}},A0=function(e){return{concat:function(t,n){return Ne(t)?n:Ne(n)?t:mt(e.concat(t.value,n.value))},empty:et}},qi=function(e){return function(t){return Ne(t)?et:mt(e(t.value))}},vl={URI:Wt,map:sr},Mo=mt,XW={URI:Wt,of:Mo},QW=function(e){return function(t){return Ne(t)||Ne(e)?et:mt(t.value(e.value))}},gl={URI:Wt,map:sr,ap:ps},eN={URI:Wt,map:sr,ap:ps,of:Mo},eu=function(e){return function(t){return Ne(t)?et:e(t.value)}},tp={URI:Wt,map:sr,ap:ps,chain:wv},pX={URI:Wt,map:sr,ap:ps,of:Mo,chain:wv},tN=function(e,t){return function(n){return Ne(n)?e:t(e,n.value)}},nN=function(e){return function(t){return function(n){return Ne(n)?e.empty:t(n.value)}}},rN=function(e,t){return function(n){return Ne(n)?e:t(n.value,e)}},hX={URI:Wt,reduce:Ev,foldMap:Rv,reduceRight:Mv},iN=function(e){return function(t){return Ne(t)?e():t}},oN=iN,mX={URI:Wt,map:sr,alt:R0},xv=function(){return et},aN={URI:Wt,zero:xv},vX=rl(aN,XW),gX={URI:Wt,map:sr,ap:ps,of:Mo,alt:R0,zero:xv},k0=function(e){return function(t){return Ne(t)?et:mt(e(t))}},yX={URI:Wt,map:sr,extend:YW},yl=eu(B),bX=Oe(et,et),bl=function(e){return Ne(e)?bX:Oe(Ov(e.value),Qd(e.value))},hs={URI:Wt,compact:yl,separate:bl},uN=function(e){return function(t){return Ne(t)?et:e(t.value)?t:et}},sN=function(e){return function(t){return Ne(t)?et:e(t.value)}},cN=function(e){return function(t){return Oe(ep(t,Xd(e)),ep(t,e))}},lN=function(e){return H(qi(e),bl)},xo={URI:Wt,map:sr,compact:yl,separate:bl,filter:ep,filterMap:M0,partition:x0,partitionMap:C0},fN=function(e){return function(t){return function(n){return Ne(n)?e.of(et):e.map(t(n.value),mt)}}},Cv=function(e){return function(t){return Ne(t)?e.of(et):e.map(t.value,mt)}},W0={URI:Wt,map:sr,reduce:Ev,foldMap:Rv,reduceRight:Mv,traverse:E0,sequence:Cv},N0=ri(W0,hs),P0=ni(W0,hs),$X=function(e){var t=N0(e);return function(n){return function(r){return t(r,n)}}},_X=function(e){var t=P0(e);return function(n){return function(r){return t(r,n)}}},SX={URI:Wt,map:sr,reduce:Ev,foldMap:Rv,reduceRight:Mv,traverse:E0,sequence:Cv,compact:yl,separate:bl,filter:ep,filterMap:M0,partition:x0,partitionMap:C0,wither:N0,wilt:P0},F0=function(){return et},TX={URI:Wt,map:sr,ap:ps,of:Mo,chain:wv,throwError:F0},$l=Qd,Av={URI:Wt,fromEither:$l},kv=ht,Ne=function(e){return e._tag==="None"},D0=function(e,t){return function(n){return Ne(n)?e():t(n.value)}},IX=D0,Co=D0,Ki=Co,L0=function(e){return function(t){return Ne(t)?e():t.value}},j0=L0,OX=De(vl),wX=_t(gl),EX=St(gl),RX=yl,MX=at(tp),xX=k0(B),CX=ar(Av),AX=Io(Av,tp),kX=Oo(Av,tp),ms=function(e){return e==null?et:mt(e)},dN=function(e){try{return mt(e())}catch{return et}},WX=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return dN(function(){return e.apply(void 0,t)})}},NX=function(e){return H(e,ms)},pN=function(e){return function(t){return Ne(t)?et:ms(e(t.value))}},U0=Co(YM,B),hN=Co(P$,B);function mN(e){return function(t,n){if(n===void 0){var r=mN(e);return function(i){return r(t,i)}}return Ne(n)?!1:e.equals(t,n.value)}}var PX=function(e){return function(t){return Ne(t)?!1:e(t.value)}},FX=Mo(jt),DX=It(vl),LX=Ot(tp),jX=Tt(gl),vN=Mo(Yt),Wv=function(e){return function(t){var n=e(0,or(t));if(Ne(n))return et;for(var r=[n.value],i=1;i<t.length;i++){var o=e(i,t[i]);if(Ne(o))return et;r.push(o.value)}return mt(r)}},B0=function(e){var t=Wv(e);return function(n){return ft(n)?t(n):vN}},UX=B0,gN=function(e){return B0(function(t,n){return e(n)})},BX=gN(B);function zX(e){return function(t){return kv(e(t))}}var qX=pN,yN={URI:Wt,map:sr,of:Mo,ap:ps,chain:wv,reduce:Ev,foldMap:Rv,reduceRight:Mv,traverse:E0,sequence:Cv,zero:xv,alt:R0,extend:YW,compact:yl,separate:bl,filter:ep,filterMap:M0,partition:x0,partitionMap:C0,wither:N0,wilt:P0,throwError:F0},KX=Ut(gl),VX=Cr(eN),bN=function(){return A0(E_())},HX=function(){return A0(Rm())};const $N=Object.freeze(Object.defineProperty({__proto__:null,none:et,some:mt,fromPredicate:Iv,getLeft:Ov,getRight:Qd,URI:Wt,getShow:fX,getEq:ZW,getOrd:dX,getMonoid:A0,map:qi,Functor:vl,of:Mo,Pointed:XW,ap:QW,Apply:gl,Applicative:eN,chain:eu,Chain:tp,Monad:pX,reduce:tN,foldMap:nN,reduceRight:rN,Foldable:hX,altW:iN,alt:oN,Alt:mX,zero:xv,Zero:aN,guard:vX,Alternative:gX,extend:k0,Extend:yX,compact:yl,separate:bl,Compactable:hs,filter:uN,filterMap:sN,partition:cN,partitionMap:lN,Filterable:xo,traverse:fN,sequence:Cv,Traversable:W0,wither:$X,wilt:_X,Witherable:SX,throwError:F0,MonadThrow:TX,fromEither:$l,FromEither:Av,isSome:kv,isNone:Ne,matchW:D0,foldW:IX,match:Co,fold:Ki,getOrElseW:L0,getOrElse:j0,flap:OX,apFirst:wX,apSecond:EX,flatten:RX,chainFirst:MX,duplicate:xX,fromEitherK:CX,chainEitherK:AX,chainFirstEitherK:kX,fromNullable:ms,tryCatch:dN,tryCatchK:WX,fromNullableK:NX,chainNullableK:pN,toNullable:U0,toUndefined:hN,elem:mN,exists:PX,Do:FX,bindTo:DX,bind:LX,apS:jX,ApT:vN,traverseReadonlyNonEmptyArrayWithIndex:Wv,traverseReadonlyArrayWithIndex:B0,traverseArrayWithIndex:UX,traverseArray:gN,sequenceArray:BX,getRefinement:zX,mapNullable:qX,option:yN,getApplySemigroup:KX,getApplyMonoid:VX,getFirstMonoid:bN,getLastMonoid:HX},Symbol.toStringTag,{value:"Module"}));function Vi(e,t){return function(n){return e.map(n,t.compact)}}function Ao(e,t,n){var r=Vi(e,t),i=jc(e,n);return function(o){return Oe(r(m(o,i(Ov))),r(m(o,i(Qd))))}}function JX(e,t){var n=Uc(e,t).map;return{map:n,compact:Vi(e,t),separate:Ao(e,t,t)}}const GX=Object.freeze(Object.defineProperty({__proto__:null,compact:Vi,separate:Ao,getCompactableComposition:JX},Symbol.toStringTag,{value:"Module"}));var YX=function(e){return function(){return console.log(e)}},ZX=function(e){return function(){return console.warn(e)}},XX=function(e){return function(){return console.error(e)}},QX=function(e){return function(){return console.info(e)}};const eQ=Object.freeze(Object.defineProperty({__proto__:null,log:YX,warn:ZX,error:XX,info:QX},Symbol.toStringTag,{value:"Module"}));var _l=Dc;function tQ(e){return{show:function(t){return"make(".concat(e.show(t),")")}}}var nQ=B,rQ=B,iQ=B,oQ=B,aQ=B,uQ=B,sQ=B,cQ=B,lQ=B;function _N(e){return{URI:vs,_E:void 0,map:z0,ap:function(t,n){return _l(e.concat(t,n))}}}function SN(e){var t=_N(e);return{URI:vs,_E:void 0,map:t.map,ap:t.ap,of:function(){return _l(e.empty)}}}var TN=function(e,t){return m(e,wN())},z0=function(e,t){return m(e,EN())},IN=function(e,t,n){return m(e,RN(t))},ON=function(e,t){return m(e,MN(t))},wN=function(){return Dc},EN=function(){return Dc},RN=function(e){return function(t){return _l(e(t))}},MN=function(e){return function(t){return _l(e(t))}},vs="Const",xN={URI:vs,map:z0},fQ=De(xN),dQ={URI:vs,contramap:TN},pQ={URI:vs,bimap:IN,mapLeft:ON},hQ={URI:vs,map:z0,contramap:TN,bimap:IN,mapLeft:ON};const mQ=Object.freeze(Object.defineProperty({__proto__:null,make:_l,getShow:tQ,getEq:nQ,getOrd:rQ,getBounded:iQ,getSemigroup:oQ,getMonoid:aQ,getSemiring:uQ,getRing:sQ,getHeytingAlgebra:cQ,getBooleanAlgebra:lQ,getApply:_N,getApplicative:SN,contramap:wN,map:EN,bimap:RN,mapLeft:MN,URI:vs,Functor:xN,flap:fQ,Contravariant:dQ,Bifunctor:pQ,const_:hQ},Symbol.toStringTag,{value:"Module"})),vQ=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var gQ={equals:function(e,t){return e.valueOf()===t.valueOf()}},yQ={equals:function(e,t){return e.getDate()===t.getDate()}},bQ={equals:function(e,t){return e.getMonth()===t.getMonth()}},$Q={equals:function(e,t){return e.getFullYear()===t.getFullYear()}},_Q=m(Qm,Sm(function(e){return e.valueOf()})),SQ=function(){return new Date},TQ=function(){return new Date().getTime()};const IQ=Object.freeze(Object.defineProperty({__proto__:null,Eq:gQ,eqDate:yQ,eqMonth:bQ,eqYear:$Q,Ord:_Q,create:SQ,now:TQ},Symbol.toStringTag,{value:"Module"}));function gs(e){return H(Be,e.of)}function Sl(e){return H(yt,e.of)}function Tl(e){return function(t){return e.map(t,Be)}}function Il(e){return function(t){return e.map(t,yt)}}function Nv(e){return function(t){return H(n_(t),e.of)}}function Pv(e){var t=Nv(e);return function(n){var r=t(n);return function(i){return H(i,r)}}}function q0(e){var t=ys(e),n=Pv(e);return function(r){var i=n(r);return function(o){return t(i(o))}}}function Ol(e){return jc(e,qa)}function wl(e){return To(e,qc)}function ys(e){return function(t){return function(n){return e.chain(n,function(r){return re(r)?e.of(r):t(r.right)})}}}function El(e){return function(t){return function(n){return e.chain(n,function(r){return re(r)?t():e.of(r)})}}}function Rl(e){return function(t,n){return function(r){return e.map(r,Y$(t,n))}}}function Ml(e){return function(t){return function(n){return e.map(n,Td(t))}}}function np(e,t){return function(n){return function(r){return e.chain(r,Ka(function(i){return e.map(n(),Td(function(o){return t.concat(i,o)}))},gs(e)))}}}function rp(e){return function(t,n){return function(r){return e.map(r,Ka(t,n))}}}function xl(e){return function(t,n){return function(r){return e.chain(r,Ka(t,n))}}}function Cl(e){return function(t){return function(n){return e.chain(n,Ka(t,e.of))}}}function bs(e){return function(t){return function(n){return e.chain(n,function(r){return re(r)?t(r.left):e.of(r)})}}}function ip(e){var t=bs(e);return function(n){return t(function(r){return e.map(n(r),function(i){return re(i)?i:yt(r)})})}}function op(e){return function(t){return function(n){return e.chain(n,Ka(function(r){return e.map(t(r),yt)},function(r){return e.of(Be(r))}))}}}function Al(e){return function(t){return e.map(t,Sx)}}function ap(e){return function(t){return e.map(t,wx)}}function OQ(e){var t=wl(e),n=Ol(e),r=ys(e),i=El(e),o=Rl(e),a=Ml(e),u=xl(e),s=Cl(e),c=bs(e);return{map:function(l,f){return m(l,n(f))},ap:function(l,f){return m(l,t(f))},of:gs(e),chain:function(l,f){return m(l,r(f))},alt:function(l,f){return m(l,i(f))},bimap:function(l,f,d){return m(l,o(f,d))},mapLeft:function(l,f){return m(l,a(f))},fold:function(l,f,d){return m(l,u(f,d))},getOrElse:function(l,f){return m(l,s(f))},orElse:function(l,f){return m(l,c(f))},swap:Al(e),rightM:Tl(e),leftM:Il(e),left:Sl(e)}}const wQ=Object.freeze(Object.defineProperty({__proto__:null,right:gs,left:Sl,rightF:Tl,leftF:Il,fromNullable:Nv,fromNullableK:Pv,chainNullableK:q0,map:Ol,ap:wl,chain:ys,alt:El,bimap:Rl,mapLeft:Ml,altValidation:np,match:rp,matchE:xl,getOrElse:Cl,orElse:bs,orElseFirst:ip,orLeft:op,swap:Al,toUnion:ap,getEitherM:OQ},Symbol.toStringTag,{value:"Module"}));var EQ="Endomorphism",CN=function(){return{concat:function(e,t){return H(e,t)}}},AN=function(){return{concat:CN().concat,empty:B}};const RQ=Object.freeze(Object.defineProperty({__proto__:null,URI:EQ,getSemigroup:CN,getMonoid:AN},Symbol.toStringTag,{value:"Module"})),MQ=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function kN(e,t){var n=t.zero,r=function(i,o){return e.equals(o,n)?i:r(o,t.mod(i,o))};return r}function xQ(e,t){var n=t.zero,r=kN(e,t);return function(i,o){return e.equals(i,n)||e.equals(o,n)?n:t.div(t.mul(i,o),r(i,o))}}var CQ={add:function(e,t){return e+t},zero:0,mul:function(e,t){return e*t},one:1,sub:function(e,t){return e-t},degree:function(e){return 1},div:function(e,t){return e/t},mod:function(e,t){return e%t}};const AQ=Object.freeze(Object.defineProperty({__proto__:null,gcd:kN,lcm:xQ,fieldNumber:CQ},Symbol.toStringTag,{value:"Module"}));function ko(e,t){return function(n){return function(r){return e.map(r,function(i){return t.filter(i,n)})}}}function Wo(e,t){return function(n){return function(r){return e.map(r,function(i){return t.filterMap(i,n)})}}}function tu(e,t){var n=ko(e,t);return function(r){var i=n(Xd(r)),o=n(r);return function(a){return Oe(i(a),o(a))}}}function nu(e,t){var n=Wo(e,t);return function(r){return function(i){return Oe(m(i,n(function(o){return Ov(r(o))})),m(i,n(function(o){return Qd(r(o))})))}}}function kQ(e,t){var n=Uc(e,t).map,r=Vi(e,t),i=Ao(e,t,t),o=ko(e,t),a=Wo(e,t),u=tu(e,t),s=nu(e,t);return{map:n,compact:r,separate:i,filter:function(c,l){return m(c,o(l))},filterMap:function(c,l){return m(c,a(l))},partition:function(c,l){return m(c,u(l))},partitionMap:function(c,l){return m(c,s(l))}}}const WQ=Object.freeze(Object.defineProperty({__proto__:null,filter:ko,filterMap:Wo,partition:tu,partitionMap:nu,getFilterableComposition:kQ},Symbol.toStringTag,{value:"Module"})),NQ=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function WN(e,t){return function(n,r){return function(i){return e.reduce(i,n,function(o,a){return t.reduce(a,o,r)})}}}function NN(e,t){return function(n){var r=e.foldMap(n),i=t.foldMap(n);return function(o){return function(a){return r(a,function(u){return i(u,o)})}}}}function PN(e,t){return function(n,r){return function(i){return e.reduceRight(i,n,function(o,a){return t.reduceRight(o,a,r)})}}}function PQ(e,t){return function(n,r){return function(i){return t.reduce(i,e.of(n),function(o,a){return e.chain(o,function(u){return r(u,a)})})}}}function FQ(e,t){return function(n,r){var i=function(o,a){var u=o.init,s=o.acc;return u?{init:!1,acc:a}:{init:!1,acc:e.concat(e.concat(s,n),a)}};return t.reduce(r,{init:!0,acc:e.empty},i).acc}}function FN(e){return function(t){return e.reduce(t,[],function(n,r){return n.push(r),n})}}function DQ(e,t){var n=function(i,o){return e.ap(e.map(i,Fn),o)},r=e.of(void 0);return function(i,o){return t.reduce(i,r,function(a,u){return n(a,o(u))})}}function LQ(e,t){return function(n,r,i){return t.reduce(n,e.of(r),function(o,a){return e.chain(o,function(u){return i(u,a)})})}}var jQ=FN;function K0(e,t){var n=WN(e,t),r=NN(e,t),i=PN(e,t);return{reduce:function(o,a,u){return m(o,n(a,u))},foldMap:function(o){var a=r(o);return function(u,s){return m(u,a(s))}},reduceRight:function(o,a,u){return m(o,i(a,u))}}}const UQ=Object.freeze(Object.defineProperty({__proto__:null,reduce:WN,foldMap:NN,reduceRight:PN,reduceM:PQ,intercalate:FQ,toReadonlyArray:FN,traverse_:DQ,foldM:LQ,toArray:jQ,getFoldableComposition:K0},Symbol.toStringTag,{value:"Module"}));function DN(e,t){return function(n,r){return function(i){return e.reduceWithIndex(i,n,function(o,a,u){return t.reduceWithIndex(u,a,function(s,c,l){return r([o,s],c,l)})})}}}function LN(e,t){return function(n){var r=e.foldMapWithIndex(n),i=t.foldMapWithIndex(n);return function(o){return function(a){return r(a,function(u,s){return i(s,function(c,l){return o([u,c],l)})})}}}}function jN(e,t){return function(n,r){return function(i){return e.reduceRightWithIndex(i,n,function(o,a,u){return t.reduceRightWithIndex(a,u,function(s,c,l){return r([o,s],c,l)})})}}}function BQ(e,t){var n=K0(e,t),r=DN(e,t),i=LN(e,t),o=jN(e,t);return{reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,reduceWithIndex:function(a,u,s){return m(a,r(u,s))},foldMapWithIndex:function(a){var u=i(a);return function(s,c){return m(s,u(c))}},reduceRightWithIndex:function(a,u,s){return m(a,o(u,s))}}}const zQ=Object.freeze(Object.defineProperty({__proto__:null,reduceWithIndex:DN,foldMapWithIndex:LN,reduceRightWithIndex:jN,getFoldableWithIndexComposition:BQ},Symbol.toStringTag,{value:"Module"}));function Hi(e){return function(t){return H(t,e.fromIO)}}function No(e,t){return function(n){var r=H(n,e.fromIO);return function(i){return t.chain(i,r)}}}function Po(e,t){var n=at(t);return function(r){return n(H(r,e.fromIO))}}const qQ=Object.freeze(Object.defineProperty({__proto__:null,fromIOK:Hi,chainIOK:No,chainFirstIOK:Po},Symbol.toStringTag,{value:"Module"}));var UN=function(){return B},KQ=B,up=function(e){return function(t){return function(n){return t(e(n))}}},sp=function(e){return function(t){return e(t)(t)}},VQ=sp,Fo=function(e,t){return m(e,$s(t))},cp=function(e,t){return m(e,qN(t))},V0=function(e,t){return m(e,KN(t))},BN=function(e,t){return m(e,HN(t))},Fv=function(e,t,n){return m(e,JN(t,n))},$s=function(e){return function(t){return function(n){return e(t(n))}}},zN=function(e){return function(t){return function(n){return t(n)(e(n))}}},qN=zN,Ji=Fn,H0=function(e){return function(t){return function(n){return e(t(n))(n)}}},KN=H0,VN=H0(B),HQ=VN,HN=function(e){return function(t){return H(e,t)}},JN=function(e,t){return function(n){return function(r){return t(n(e(r)))}}},J0=function(){return B},G0=function(e){return function(t){var n=t[0],r=t[1];return[e(n),r]}},Y0=function(e){return function(t){var n=t[0],r=t[1];return[n,e(r)]}},Z0=function(e){return e_(function(t){return So(e(t))},Be)},X0=function(e){return e_(yt,function(t){return Ua(e(t))})},Nr="Reader",Qt={URI:Nr,map:Fo},JQ=De(Qt),Q0={URI:Nr,of:Ji},Do={URI:Nr,map:Fo,ap:cp},GN=_t(Do),GQ=GN,YN=St(Do),YQ=YN,ZN={URI:Nr,map:Fo,ap:cp,of:Ji},eT={URI:Nr,map:Fo,ap:cp,chain:V0},Lo={URI:Nr,map:Fo,of:Ji,ap:cp,chain:V0},XN=at(eT),ZQ=XN,XQ={URI:Nr,map:Fo,promap:Fv},QQ={URI:Nr,compose:BN,id:J0},eee={URI:Nr,map:Fo,promap:Fv,first:G0,second:Y0},tee={URI:Nr,map:Fo,promap:Fv,left:Z0,right:X0},nee=It(Qt),QN=Ot(eT),ree=QN,iee=Ji(jt),eP=Tt(Do),oee=eP,tP=Ji(Yt),_s=function(e){return function(t){return function(n){for(var r=[e(0,or(t))(n)],i=1;i<t.length;i++)r.push(e(i,t[i])(n));return r}}},tT=function(e){var t=_s(e);return function(n){return ft(n)?t(n):tP}},aee=tT,nP=function(e){return tT(function(t,n){return e(n)})},uee=nP(B),see={URI:Nr,map:Fo,of:Ji,ap:cp,chain:V0,promap:Fv,compose:BN,id:J0,first:G0,second:Y0,left:Z0,right:X0},cee=Ut(Do),lee=Cr(ZN);const fee=Object.freeze(Object.defineProperty({__proto__:null,ask:UN,asks:KQ,local:up,asksReaderW:sp,asksReader:VQ,map:$s,apW:zN,ap:qN,of:Ji,chainW:H0,chain:KN,flattenW:VN,flatten:HQ,compose:HN,promap:JN,id:J0,first:G0,second:Y0,left:Z0,right:X0,URI:Nr,Functor:Qt,flap:JQ,Pointed:Q0,Apply:Do,apFirst:GN,apFirstW:GQ,apSecond:YN,apSecondW:YQ,Applicative:ZN,Chain:eT,Monad:Lo,chainFirst:XN,chainFirstW:ZQ,Profunctor:XQ,Category:QQ,Strong:eee,Choice:tee,bindTo:nee,bind:QN,bindW:ree,Do:iee,apS:eP,apSW:oee,ApT:tP,traverseReadonlyNonEmptyArrayWithIndex:_s,traverseReadonlyArrayWithIndex:tT,traverseArrayWithIndex:aee,traverseArray:nP,sequenceArray:uee,reader:see,getSemigroup:cee,getMonoid:lee},Symbol.toStringTag,{value:"Module"}));function lp(e){return function(){return e.fromReader(UN())}}function fp(e){return e.fromReader}function Ss(e){return function(t){return H(t,e.fromReader)}}function dp(e,t){var n=Ss(e);return function(r){return function(i){return t.chain(i,n(r))}}}function pp(e,t){return H(Ss(e),at(t))}const dee=Object.freeze(Object.defineProperty({__proto__:null,ask:lp,asks:fp,fromReaderK:Ss,chainReaderK:dp,chainFirstReaderK:pp},Symbol.toStringTag,{value:"Module"}));var rP=function(){return function(e){return[e,e]}},iP=function(e){return function(){return[void 0,e]}},oP=function(e){return function(t){return[void 0,e(t)]}},aP=function(e){return function(t){return[e(t),t]}},hp=function(e,t){return m(e,sP(t))},Dv=function(e,t){return m(e,cP(t))},uP=function(e,t){return m(e,nT(t))},sP=function(e){return function(t){return function(n){var r=t(n),i=r[0],o=r[1];return[e(i),o]}}},cP=function(e){return function(t){return function(n){var r=t(n),i=r[0],o=r[1],a=e(o),u=a[0],s=a[1];return[i(u),s]}}},mp=function(e){return function(t){return[e,t]}},nT=function(e){return function(t){return function(n){var r=t(n),i=r[0],o=r[1];return e(i)(o)}}},pee=nT(B),ru="State",rT={URI:ru,map:hp},hee=De(rT),mee={URI:ru,of:mp},Lv={URI:ru,map:hp,ap:Dv},vee=_t(Lv),gee=St(Lv),yee={URI:ru,map:hp,ap:Dv,of:mp},iT={URI:ru,map:hp,ap:Dv,chain:uP},lP={URI:ru,map:hp,ap:Dv,of:mp,chain:uP},bee=at(iT),$ee={URI:ru,fromState:B},_ee=function(e){return function(t){return t(e)[0]}},See=function(e){return function(t){return t(e)[1]}},Tee=It(rT),Iee=Ot(iT),Oee=Tt(Lv),fP=function(e){return function(t){return function(n){for(var r=e(0,or(t))(n),i=r[0],o=r[1],a=[i],u=o,s=1;s<t.length;s++){var c=e(s,t[s])(u),l=c[0],f=c[1];a.push(l),u=f}return[a,u]}}},oT=function(e){var t=fP(e);return function(n){return ft(n)?t(n):mp(Yt)}},wee=oT,dP=function(e){return oT(function(t,n){return e(n)})},Eee=dP(B),Ree=function(e,t){return e(t)[0]},Mee=function(e,t){return e(t)[1]},xee=lP;const Cee=Object.freeze(Object.defineProperty({__proto__:null,get:rP,put:iP,modify:oP,gets:aP,map:sP,ap:cP,of:mp,chain:nT,flatten:pee,URI:ru,Functor:rT,flap:hee,Pointed:mee,Apply:Lv,apFirst:vee,apSecond:gee,Applicative:yee,Chain:iT,Monad:lP,chainFirst:bee,FromState:$ee,evaluate:_ee,execute:See,bindTo:Tee,bind:Iee,apS:Oee,traverseReadonlyNonEmptyArrayWithIndex:fP,traverseReadonlyArrayWithIndex:oT,traverseArrayWithIndex:wee,traverseArray:dP,sequenceArray:Eee,evalState:Ree,execState:Mee,state:xee},Symbol.toStringTag,{value:"Module"}));function pP(e){return function(){return e.fromState(rP())}}function hP(e){return function(t){return e.fromState(iP(t))}}function mP(e){return H(oP,e.fromState)}function vP(e){return H(aP,e.fromState)}function aT(e){return function(t){return H(t,e.fromState)}}function gP(e,t){var n=aT(e);return function(r){return function(i){return t.chain(i,n(r))}}}const Aee=Object.freeze(Object.defineProperty({__proto__:null,get:pP,put:hP,modify:mP,gets:vP,fromStateK:aT,chainStateK:gP},Symbol.toStringTag,{value:"Module"}));function Ts(e){return function(t){return H(t,e.fromTask)}}function kl(e,t){return function(n){var r=H(n,e.fromTask);return function(i){return t.chain(i,r)}}}function Wl(e,t){var n=at(t);return function(r){return n(H(r,e.fromTask))}}const kee=Object.freeze(Object.defineProperty({__proto__:null,fromTaskK:Ts,chainTaskK:kl,chainFirstTaskK:Wl},Symbol.toStringTag,{value:"Module"}));function yP(e){return function(t){return H(t,e.fromThese)}}const Wee=Object.freeze(Object.defineProperty({__proto__:null,fromTheseK:yP},Symbol.toStringTag,{value:"Module"}));function bP(e,t){return function(n){return function(r){return e.mapWithIndex(r,function(i,o){return t.mapWithIndex(o,function(a,u){return n([i,a],u)})})}}}function Nee(e,t){var n=Uc(e,t).map,r=bP(e,t);return{map:n,mapWithIndex:function(i,o){return m(i,r(o))}}}const Pee=Object.freeze(Object.defineProperty({__proto__:null,mapWithIndex:bP,getFunctorWithIndexComposition:Nee},Symbol.toStringTag,{value:"Module"})),Fee=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Dee=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Lee=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Gi=function(e,t){return m(e,IP(t))},Nl=function(e,t){return m(e,OP(t))},jv=function(e,t){return m(e,lT(t))},uT=function(e,t,n){return m(e,wP(t,n))},sT=function(e){return function(t,n){return m(t,EP()(n))}},cT=function(e,t,n){return m(e,RP(t,n))},$P=function(e,t){return m(e,CP())},_P=function(e,t){return m(e,fT(t))},SP=function(e){var t=MP(e);return function(n,r){return m(n,t(r))}},TP=j$,IP=function(e){return function(t){return e(t)}},OP=function(e){return function(t){return t(e)}},Pl=B,lT=function(e){return function(t){return e(t)}},fT=function(e){return function(t){return e(t)}},dT=B,jee=fT(B),Uee=lT(B),wP=function(e,t){return function(n){return t(e,n)}},EP=function(){return function(e){return function(t){return e(t)}}},RP=function(e,t){return function(n){return t(n,e)}},MP=function(e){return function(t){return function(n){return e.map(t(n),B)}}},pT=function(e){return function(t){return e.map(t,B)}},xP=function(){return B},CP=xP,cr="Identity",Bee=B,zee=B,hT={URI:cr,map:Gi},qee=De(hT),Kee={URI:cr,of:Pl},Uv={URI:cr,map:Gi,ap:Nl},Vee=_t(Uv),Hee=St(Uv),Jee={URI:cr,map:Gi,ap:Nl,of:Pl},mT={URI:cr,map:Gi,ap:Nl,chain:jv},Gee={URI:cr,map:Gi,ap:Nl,of:Pl,chain:jv},Yee=at(mT),Zee={URI:cr,reduce:uT,foldMap:sT,reduceRight:cT},Xee={URI:cr,map:Gi,reduce:uT,foldMap:sT,reduceRight:cT,traverse:SP,sequence:pT},Qee={URI:cr,map:Gi,alt:$P},ete={URI:cr,map:Gi,extend:_P,extract:dT},tte={URI:cr,map:Gi,ap:Nl,chain:jv,chainRec:TP},nte=Pl(jt),rte=It(hT),ite=Ot(mT),ote=Tt(Uv),ate={URI:cr,map:Gi,ap:Nl,of:Pl,chain:jv,reduce:uT,foldMap:sT,reduceRight:cT,traverse:SP,sequence:pT,alt:$P,extract:dT,extend:_P,chainRec:TP};const ute=Object.freeze(Object.defineProperty({__proto__:null,map:IP,ap:OP,of:Pl,chain:lT,extend:fT,extract:dT,duplicate:jee,flatten:Uee,reduce:wP,foldMap:EP,reduceRight:RP,traverse:MP,sequence:pT,altW:xP,alt:CP,URI:cr,getShow:Bee,getEq:zee,Functor:hT,flap:qee,Pointed:Kee,Apply:Uv,apFirst:Vee,apSecond:Hee,Applicative:Jee,Chain:mT,Monad:Gee,chainFirst:Yee,Foldable:Zee,Traversable:Xee,Alt:Qee,Comonad:ete,ChainRec:tte,Do:nte,bindTo:rte,bind:ite,apS:ote,identity:ate},Symbol.toStringTag,{value:"Module"})),ste=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var jo=function(e,t){return function(){return t(e())}},iu=function(e,t){return function(){return e()(t())}},Fl=function(e,t){return function(){return t(e())()}},AP=function(e,t){return function(){for(var n=t(e)();n._tag==="Left";)n=t(n.left)();return n.right}},Yi=function(e){return function(t){return jo(t,e)}},cte=function(e){return function(t){return iu(t,e)}},fi=Fn,vT=function(e){return function(t){return Fl(t,e)}},lte=vT(B),di="IO",rt={URI:di,map:jo},fte=De(rt),Zi={URI:di,of:fi},Uo={URI:di,map:jo,ap:iu},dte=_t(Uo),pte=St(Uo),kP={URI:di,map:jo,ap:iu,of:fi},Bv={URI:di,map:jo,ap:iu,chain:Fl},jn={URI:di,map:jo,ap:iu,of:fi,chain:Fl},hte=at(Bv),gT=B,mte={URI:di,map:jo,ap:iu,of:fi,chain:Fl,fromIO:gT},vte={URI:di,map:jo,ap:iu,chain:Fl,chainRec:AP},gte={URI:di,fromIO:B},yte=fi(jt),bte=It(rt),$te=Ot(Bv),_te=Tt(Uo),WP=fi(Yt),zv=function(e){return function(t){return function(){for(var n=[e(0,or(t))()],r=1;r<t.length;r++)n.push(e(r,t[r])());return n}}},yT=function(e){var t=zv(e);return function(n){return ft(n)?t(n):WP}},Ste=yT,NP=function(e){return yT(function(t,n){return e(n)})},Tte=NP(B),Ite={URI:di,map:jo,of:fi,ap:iu,chain:Fl,fromIO:gT,chainRec:AP},Ote=Ut(Uo),wte=Cr(kP);const Ete=Object.freeze(Object.defineProperty({__proto__:null,map:Yi,ap:cte,of:fi,chain:vT,flatten:lte,URI:di,Functor:rt,flap:fte,Pointed:Zi,Apply:Uo,apFirst:dte,apSecond:pte,Applicative:kP,Chain:Bv,Monad:jn,chainFirst:hte,fromIO:gT,MonadIO:mte,ChainRec:vte,FromIO:gte,Do:yte,bindTo:bte,bind:$te,apS:_te,ApT:WP,traverseReadonlyNonEmptyArrayWithIndex:zv,traverseReadonlyArrayWithIndex:yT,traverseArrayWithIndex:Ste,traverseArray:NP,sequenceArray:Tte,io:Ite,getSemigroup:Ote,getMonoid:wte},Symbol.toStringTag,{value:"Module"}));var PP=Sl(Zi),FP=gs(Zi),DP=Tl(rt),Rte=Il(rt),LP=fi,vp=DP,jP=rp(rt),Mte=jP,bT=xl(jn),xte=bT,UP=bT,Cte=UP,BP=Cl(jn),Ate=BP,zP=function(e,t){return function(){return as(e,t)}},kte=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return zP(function(){return e.apply(void 0,n)},t)}},Wte=ap(rt),qP=bs(jn),Nte=qP,$T=ip(jn),Pte=$T,Fte=function(e){return $T(tF(e))},Dte=op(jn),Lte=Al(rt),Un=function(e,t){return m(e,TT(t))},Is=function(e,t){return m(e,IT(t))},jte=function(e,t){return m(e,qv(function(n){return m(t,TT(n))}))},Dl=function(e,t){return m(e,qv(t))},_T=function(e,t,n){return m(e,VP(t,n))},ST=function(e,t){return m(e,HP(t))},KP=function(e,t){return m(e,OT(t))},TT=Ol(rt),VP=Rl(rt),HP=Ml(rt),IT=wl(Uo),Ute=IT,Pr=FP,qv=ys(jn),Kv=qv,JP=Kv(B),Bte=JP,OT=El(jn),zte=OT,Vv=PP,At="IOEither";function GP(e){var t=To(Uo,za(e));return{URI:At,_E:void 0,map:Un,ap:function(n,r){return m(n,t(r))},of:Pr}}function YP(e){var t=np(jn,e);return{URI:At,_E:void 0,map:Un,alt:function(n,r){return m(n,t(r))}}}var ZP=function(e){var t=rs(e);return{URI:At,_E:void 0,compact:Vi(rt,t),separate:Ao(rt,t,qa)}};function qte(e){var t=zc(e),n=ZP(e),r=ko(rt,t),i=Wo(rt,t),o=tu(rt,t),a=nu(rt,t);return{URI:At,_E:void 0,map:Un,compact:n.compact,separate:n.separate,filter:function(u,s){return m(u,r(s))},filterMap:function(u,s){return m(u,i(s))},partition:function(u,s){return m(u,o(s))},partitionMap:function(u,s){return m(u,a(s))}}}var wT={URI:At,map:Un},Kte=De(wT),Vte={URI:At,of:Pr},Hte={URI:At,bimap:_T,mapLeft:ST},gp={URI:At,map:Un,ap:Is},XP=_t(gp),Jte=XP,QP=St(gp),Gte=QP,ET={URI:At,map:Un,ap:Is,of:Pr},Yte={URI:At,map:Un,ap:jte,of:Pr},Bo={URI:At,map:Un,ap:Is,chain:Dl},Zte={URI:At,map:Un,ap:Is,of:Pr,chain:Dl},eF=at(Bo),Xte=eF,Qte={URI:At,map:Un,alt:KP},ene={URI:At,map:Un,ap:Is,of:Pr,chain:Dl,fromIO:vp},tne={URI:At,map:Un,ap:Is,of:Pr,chain:Dl,throwError:Vv},Hv={URI:At,fromIO:vp},tF=Hi(Hv),nne=No(Hv,Bo),rne=Po(Hv,Bo),zo={URI:At,fromEither:LP},ine=Di(zo),one=Li(zo),ane=es(zo,Bo),nF=Io(zo,Bo),une=nF,rF=Oo(zo,Bo),sne=rF,cne=Ba(zo),iF=ts(zo,Bo),lne=iF,fne=ar(zo),dne=function(e,t,n){return oF(e,t,n)},oF=function(e,t,n){return m(e,Kv(function(r){return m(t(r),vT(function(i){return m(n(r,i),Kv(function(){return fi(i)}))}))}))},pne=Pr(jt),hne=It(wT),aF=Ot(Bo),mne=aF,uF=Tt(gp),vne=uF,RT=Pr(Yt),sF=function(e){return H(zv(e),Yi(Id(Dn)))},MT=function(e){var t=sF(e);return function(n){return ft(n)?t(n):RT}},cF=function(e){return function(t){return function(){var n=e(0,or(t))();if(Lt(n))return n;for(var r=[n.right],i=1;i<t.length;i++){var o=e(i,t[i])();if(Lt(o))return o;r.push(o.right)}return Ua(r)}}},xT=function(e){var t=cF(e);return function(n){return ft(n)?t(n):RT}},gne=MT,lF=function(e){return MT(function(t,n){return e(n)})},yne=lF(B),bne=xT,fF=function(e){return xT(function(t,n){return e(n)})},$ne=fF(B),_ne=ET,Sne={URI:At,bimap:_T,mapLeft:ST,map:Un,of:Pr,ap:Is,chain:Dl,alt:KP,fromIO:vp,throwError:Vv},Tne=Ut(gp),Ine=Cr(ET),One=function(e){return Ut(Uo)($d(e))};function wne(e){var t=GP(e),n=YP(e);return{URI:At,_E:void 0,map:Un,ap:t.ap,of:Pr,chain:Dl,bimap:_T,mapLeft:ST,alt:n.alt,fromIO:vp,throwError:Vv}}const Ene=Object.freeze(Object.defineProperty({__proto__:null,left:PP,right:FP,rightIO:DP,leftIO:Rte,fromEither:LP,fromIO:vp,match:jP,matchW:Mte,matchE:bT,fold:xte,matchEW:UP,foldW:Cte,getOrElse:BP,getOrElseW:Ate,tryCatch:zP,tryCatchK:kte,toUnion:Wte,orElse:qP,orElseW:Nte,orElseFirst:$T,orElseFirstW:Pte,orElseFirstIOK:Fte,orLeft:Dte,swap:Lte,map:TT,bimap:VP,mapLeft:HP,ap:IT,apW:Ute,of:Pr,chain:qv,chainW:Kv,flattenW:JP,flatten:Bte,alt:OT,altW:zte,throwError:Vv,URI:At,getApplicativeIOValidation:GP,getAltIOValidation:YP,getCompactable:ZP,getFilterable:qte,Functor:wT,flap:Kte,Pointed:Vte,Bifunctor:Hte,ApplyPar:gp,apFirst:XP,apFirstW:Jte,apSecond:QP,apSecondW:Gte,ApplicativePar:ET,ApplicativeSeq:Yte,Chain:Bo,Monad:Zte,chainFirst:eF,chainFirstW:Xte,Alt:Qte,MonadIO:ene,MonadThrow:tne,FromIO:Hv,fromIOK:tF,chainIOK:nne,chainFirstIOK:rne,FromEither:zo,fromOption:ine,fromOptionK:one,chainOptionK:ane,chainEitherK:nF,chainEitherKW:une,chainFirstEitherK:rF,chainFirstEitherKW:sne,fromPredicate:cne,filterOrElse:iF,filterOrElseW:lne,fromEitherK:fne,bracket:dne,bracketW:oF,Do:pne,bindTo:hne,bind:aF,bindW:mne,apS:uF,apSW:vne,ApT:RT,traverseReadonlyNonEmptyArrayWithIndex:sF,traverseReadonlyArrayWithIndex:MT,traverseReadonlyNonEmptyArrayWithIndexSeq:cF,traverseReadonlyArrayWithIndexSeq:xT,traverseArrayWithIndex:gne,traverseArray:lF,sequenceArray:yne,traverseSeqArrayWithIndex:bne,traverseSeqArray:fF,sequenceSeqArray:$ne,Applicative:_ne,ioEither:Sne,getApplySemigroup:Tne,getApplyMonoid:Ine,getSemigroup:One,getIOValidation:wne},Symbol.toStringTag,{value:"Module"}));function yp(e){return H(mt,e.of)}function bp(e){return Fn(e.of(et))}function Jv(e){return function(t){return e.map(t,mt)}}function Gv(e){return H(ms,e.of)}function Yv(e){var t=Gv(e);return function(n){return H(n,t)}}function CT(e){var t=Ll(e),n=Yv(e);return function(r){return t(n(r))}}function Zv(e){return function(t){return H(t,e.of)}}function AT(e){var t=Ll(e),n=Zv(e);return function(r){return t(n(r))}}function kT(e){return function(t){return function(n){return e.of(Iv(t)(n))}}}function WT(e){return H($l,e.of)}function NT(e){return function(t,n){return function(r){return e.map(r,Co(t,n))}}}function Xv(e){return function(t,n){return function(r){return e.chain(r,Co(t,n))}}}function Qv(e){return function(t){return function(n){return e.chain(n,Co(t,e.of))}}}function eg(e){return jc(e,vl)}function tg(e){return To(e,gl)}function Ll(e){var t=bp(e);return function(n){return function(r){return e.chain(r,Co(function(){return t()},n))}}}function ng(e){var t=yp(e);return function(n){return function(r){return e.chain(r,Co(n,t))}}}function Rne(e){var t=tg(e),n=eg(e),r=Ll(e),i=ng(e),o=Xv(e),a=Qv(e),u=bp(e);return{map:function(s,c){return m(s,n(c))},ap:function(s,c){return m(s,t(c))},of:yp(e),chain:function(s,c){return m(s,r(c))},alt:function(s,c){return m(s,i(c))},fold:function(s,c,l){return m(s,o(c,l))},getOrElse:function(s,c){return m(s,a(c))},fromM:Jv(e),none:function(){return u()}}}const Mne=Object.freeze(Object.defineProperty({__proto__:null,some:yp,zero:bp,fromF:Jv,fromNullable:Gv,fromNullableK:Yv,chainNullableK:CT,fromOptionK:Zv,chainOptionK:AT,fromPredicate:kT,fromEither:WT,match:NT,matchE:Xv,getOrElse:Qv,map:eg,ap:tg,chain:Ll,alt:ng,getOptionM:Rne},Symbol.toStringTag,{value:"Module"}));var dF=yp(Zi),xne=kT(Zi),Cne=fi,pF=WT(Zi),PT=Jv(rt),Ane=Yi($l),hF=NT(rt),kne=hF,FT=Xv(Bv),Wne=FT,Nne=FT,mF=Qv(jn),Pne=mF,Fne=Yi(hN),Dne=Yi(U0),Lne=Gv(Zi),jne=Yv(Zi),Une=CT(jn),Bne=Zv(Zi),zne=AT(jn),vF=eg(rt),gF=tg(Uo),ou=dF,DT=Ll(jn),qne=DT(B),LT=ng(jn),Kne=LT,rg=bp(Zi),Vne=rg(),jT=Vi(rt,hs),UT=Ao(rt,hs,vl),yF=ko(rt,xo),bF=Wo(rt,xo),$F=tu(rt,xo),_F=nu(rt,xo),qo=function(e,t){return m(e,vF(t))},jl=function(e,t){return m(e,gF(t))},BT=function(e,t){return m(e,DT(t))},SF=function(e,t){return m(e,LT(t))},Hne=function(e,t){return m(e,yF(t))},Jne=function(e,t){return m(e,bF(t))},Gne=function(e,t){return m(e,$F(t))},Yne=function(e,t){return m(e,_F(t))},Bn="IOOption",zT={URI:Bn,map:qo},Zne=De(zT),TF={URI:Bn,of:ou},ig={URI:Bn,map:qo,ap:jl},Xne=_t(ig),Qne=St(ig),ere={URI:Bn,map:qo,ap:jl,of:ou},Os={URI:Bn,map:qo,ap:jl,chain:BT},tre=at(Os),nre={URI:Bn,map:qo,alt:SF},IF={URI:Bn,zero:rg},rre=rl(IF,TF),ire={URI:Bn,map:qo,ap:jl,of:ou,alt:SF,zero:rg},ore={URI:Bn,map:qo,ap:jl,of:ou,chain:BT},are={URI:Bn,map:qo,ap:jl,of:ou,chain:BT,fromIO:PT},ure={URI:Bn,compact:jT,separate:UT},sre={URI:Bn,map:qo,compact:jT,separate:UT,filter:Hne,filterMap:Jne,partition:Gne,partitionMap:Yne},og={URI:Bn,fromIO:PT},cre=Hi(og),lre=No(og,Os),fre=Po(og,Os),ag={URI:Bn,fromEither:pF},dre=ar(ag),pre=Io(ag,Os),hre=Oo(ag,Os),mre=ou(jt),vre=It(zT),gre=Ot(Os),yre=Tt(ig),OF=ou(Yt),wF=function(e){return H(zv(e),Yi(Wv(Dn)))},bre=function(e){var t=wF(e);return function(n){return ft(n)?t(n):OF}};const $re=Object.freeze(Object.defineProperty({__proto__:null,some:dF,fromPredicate:xne,fromOption:Cne,fromEither:pF,fromIO:PT,fromIOEither:Ane,match:hF,matchW:kne,matchE:FT,fold:Wne,matchEW:Nne,getOrElse:mF,getOrElseW:Pne,toUndefined:Fne,toNullable:Dne,fromNullable:Lne,fromNullableK:jne,chainNullableK:Une,fromOptionK:Bne,chainOptionK:zne,map:vF,ap:gF,of:ou,chain:DT,flatten:qne,alt:LT,altW:Kne,zero:rg,none:Vne,compact:jT,separate:UT,filter:yF,filterMap:bF,partition:$F,partitionMap:_F,Functor:zT,flap:Zne,Pointed:TF,Apply:ig,apFirst:Xne,apSecond:Qne,Applicative:ere,Chain:Os,chainFirst:tre,Alt:nre,Zero:IF,guard:rre,Alternative:ire,Monad:ore,MonadIO:are,Compactable:ure,Filterable:sre,FromIO:og,fromIOK:cre,chainIOK:lre,chainFirstIOK:fre,FromEither:ag,fromEitherK:dre,chainEitherK:pre,chainFirstEitherK:hre,Do:mre,bindTo:vre,bind:gre,apS:yre,ApT:OF,traverseReadonlyNonEmptyArrayWithIndex:wF,traverseReadonlyArrayWithIndex:bre},Symbol.toStringTag,{value:"Module"}));var EF=function(){function e(t){var n=this;this.value=t,this.read=function(){return n.value},this.write=this.write.bind(this),this.modify=this.modify.bind(this)}return e.prototype.write=function(t){var n=this;return function(){n.value=t}},e.prototype.modify=function(t){var n=this;return function(){n.value=t(n.value)}},e}();function _re(e){return function(){return new EF(e)}}const Sre=Object.freeze(Object.defineProperty({__proto__:null,IORef:EF,newIORef:_re},Symbol.toStringTag,{value:"Module"})),Tre=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Ire=function(e){return as(function(){return JSON.parse(e)},B)},Ore=function(e){return as(function(){var t=JSON.stringify(e);if(typeof t!="string")throw new Error("Converting unsupported structure to JSON");return t},B)};const wre=Object.freeze(Object.defineProperty({__proto__:null,parse:Ire,stringify:Ore},Symbol.toStringTag,{value:"Module"})),Ere=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Rre=function(e){return new Map(e)};function Mre(e){return new Map(e)}function RF(e,t){return{show:function(n){var r=[];return n.forEach(function(i,o){r.push("[".concat(e.show(o),", ").concat(t.show(i),"]"))}),"new Map([".concat(r.sort().join(", "),"])")}}}var MF=function(e){return e.size},Xi=function(e){return e.size===0};function ug(e){var t=ws(e);return function(n,r){if(r===void 0){var i=ug(e);return function(o){return i(n,o)}}return ht(t(n,r))}}function qT(e){return function(t,n){if(n===void 0){var r=qT(e);return function(u){return r(t,u)}}for(var i=n.values(),o;!(o=i.next()).done;){var a=o.value;if(e.equals(t,a))return!0}return!1}}var Ul=function(e){return function(t){return Array.from(t.keys()).sort(e.compare)}},xre=function(e){return function(t){return Array.from(t.values()).sort(e.compare)}};function xF(e){var t=Ul(e);return function(n){return function(r){for(var i=[],o=t(r),a=0,u=o;a<u.length;a++){var s=u[a];i.push(n(s,r.get(s)))}return i}}}var CF=function(e){return xF(e)(function(t,n){return[t,n]})};function Cre(e,t){var n=CF(e);return function(r){var i=n(r),o=i.length;return t.unfold(0,function(a){return a<o?le([i[a],a+1]):me})}}var AF=function(e){var t=Ko(e);return function(n,r){var i=t(n);return function(o){var a=i(o);if(xt(a)){var u=new Map(o);return u.set(n,r),u}else if(a.value[1]!==r){var u=new Map(o);return u.set(a.value[0],r),u}return o}}},kF=function(e){var t=Ko(e);return function(n){return function(r){var i=t(n,r);if(ht(i)){var o=new Map(r);return o.delete(i.value[0]),o}return r}}},Are=function(e){var t=WF(e);return function(n,r){return t(n,function(){return r})}},WF=function(e){var t=Ko(e);return function(n,r){return function(i){var o=t(n,i);if(xt(o))return me;var a=o.value,u=a[0],s=a[1],c=r(s);if(c===s)return le(i);var l=new Map(i);return l.set(u,c),le(l)}}};function kre(e){var t=ws(e),n=kF(e);return function(r){var i=n(r);return function(o){return m(t(r,o),qi(function(a){return[a,i(o)]}))}}}function Ko(e){return function(t,n){if(n===void 0){var r=Ko(e);return function(c){return r(t,c)}}for(var i=n.entries(),o;!(o=i.next()).done;){var a=o.value,u=a[0],s=a[1];if(e.equals(u,t))return le([u,s])}return me}}function ws(e){var t=Ko(e);return function(n,r){if(r===void 0){var i=ws(e);return function(o){return i(n,o)}}return m(t(n,r),qi(function(o){o[0];var a=o[1];return a}))}}function sg(e,t){var n=Ko(e);return function(r,i){if(i===void 0){var o=sg(e,t);return function(d){return o(d,r)}}for(var a=r.entries(),u;!(u=a.next()).done;){var s=u.value,c=s[0],l=s[1],f=n(c,i);if(xt(f)||!e.equals(c,f.value[0])||!t.equals(l,f.value[1]))return!1}return!0}}var cg=new Map;function NF(e,t){var n=sg(e,t);return kr(function(r,i){return n(r,i)&&n(i,r)})}function Wre(e,t){var n=Ko(e);return{concat:function(r,i){if(Xi(r))return i;if(Xi(i))return r;for(var o=new Map(r),a=i.entries(),u;!(u=a.next()).done;){var s=u.value,c=s[0],l=s[1],f=n(c,r);ht(f)?o.set(f.value[0],t.concat(f.value[1],l)):o.set(c,l)}return o},empty:cg}}var Nre=function(e,t){return new Map([[e,t]])};function Pre(e,t,n){return function(r){var i=Ko(e);return n.reduce(r,new Map,function(o,a){var u=a[0],s=a[1],c=i(u,o);return ht(c)?o.set(c.value[0],t.concat(c.value[1],s)):o.set(u,s),o})}}var Bl=function(e,t){for(var n=new Map,r=e.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],u=o[1];n.set(a,t(a,u))}return n},PF=function(e){return function(t){for(var n=new Map,r=new Map,i=t.entries(),o;!(o=i.next()).done;){var a=o.value,u=a[0],s=a[1],c=e(u,s);Lt(c)?n.set(u,c.left):r.set(u,c.right)}return Oe(n,r)}};function FF(e){return function(t){for(var n=new Map,r=new Map,i=t.entries(),o;!(o=i.next()).done;){var a=o.value,u=a[0],s=a[1];e(u,s)?r.set(u,s):n.set(u,s)}return Oe(n,r)}}var DF=function(e){return function(t){for(var n=new Map,r=t.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],u=o[1],s=e(a,u);ht(s)&&n.set(a,s.value)}return n}};function LF(e){return function(t){for(var n=new Map,r=t.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],u=o[1];e(a,u)&&n.set(a,u)}return n}}var Vo=function(e,t){return Bl(e,function(n,r){return t(r)})},$p=function(e,t){return jF(e,function(n,r){return t(r)})},_p=function(e,t){return UF(e,function(n,r){return t(r)})},Sp=function(e,t){return BF(e,function(n,r){return t(r)})},Tp=function(e,t){return zF(e,function(n,r){return t(r)})},jF=function(e,t){return m(e,LF(t))},UF=function(e,t){return m(e,DF(t))},BF=function(e,t){return m(e,FF(t))},zF=function(e,t){return m(e,PF(t))},zl=function(e){for(var t=new Map,n=e.entries(),r;!(r=n.next()).done;){var i=r.value,o=i[0],a=i[1];ht(a)&&t.set(o,a.value)}return t},Fre=function(e){return function(t){return $p(t,e)}},Dre=function(e){return function(t){return _p(t,e)}},Lre=function(e){return function(t){return Vo(t,e)}},jre=function(e){return function(t){return Bl(t,e)}},Ure=function(e){return function(t){return Sp(t,e)}},Bre=function(e){return function(t){return Tp(t,e)}},ql=function(e){for(var t=new Map,n=new Map,r=e.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],u=o[1];Lt(u)?t.set(a,u.left):n.set(a,u.right)}return Oe(t,n)},Fr="ReadonlyMap",qF=function(e,t){var n=ZT(e,t);return{concat:function(r,i){return n(i)(r)}}},zre=function(e,t){return{concat:qF(e,t).concat,empty:cg}},qre=function(e,t){var n=XT(e,t);return{concat:function(r,i){return n(i)(r)}}},Kre=function(e){return function(){var t=QT(e);return{concat:function(n,r){return t(r)(n)}}}};function Vre(){return{URI:Fr,_E:void 0,map:Vo,mapWithIndex:Bl,compact:zl,separate:ql,filter:$p,filterMap:_p,partition:Sp,partitionMap:Tp,partitionMapWithIndex:zF,partitionWithIndex:BF,filterMapWithIndex:UF,filterWithIndex:jF}}var KF={URI:Fr,map:Vo},Hre=De(KF),Jre=function(){return{URI:Fr,_E:void 0,map:Vo,mapWithIndex:Bl}},KT={URI:Fr,compact:zl,separate:ql},Gre={URI:Fr,map:Vo,compact:zl,separate:ql,filter:$p,filterMap:_p,partition:Sp,partitionMap:Tp},VT=function(e){var t=fg(e);return function(n,r){return t(n,function(i,o,a){return r(o,a)})}},HT=function(e){var t=dg(e);return function(n){var r=t(n);return function(i){return r(function(o,a){return i(a)})}}},JT=function(e){var t=pg(e);return function(n,r){return t(n,function(i,o,a){return r(o,a)})}},lg=function(e){var t=VT(e),n=HT(e),r=JT(e);return{URI:Fr,_E:void 0,reduce:function(i,o,a){return m(i,t(o,a))},foldMap:function(i){var o=n(i);return function(a,u){return m(a,o(u))}},reduceRight:function(i,o,a){return m(i,r(o,a))}}},fg=function(e){var t=Ul(e);return function(n,r){return function(i){for(var o=n,a=0,u=t(i);a<u.length;a++){var s=u[a];o=r(s,o,i.get(s))}return o}}},dg=function(e){var t=Ul(e);return function(n){return function(r){return function(i){for(var o=n.empty,a=0,u=t(i);a<u.length;a++){var s=u[a];o=n.concat(o,r(s,i.get(s)))}return o}}}},pg=function(e){var t=Ul(e);return function(n,r){return function(i){for(var o=n,a=t(i),u=a.length,s=u-1;s>=0;s--){var c=a[s];o=r(c,i.get(c),o)}return o}}},GT=function(e){var t=lg(e),n=fg(e),r=dg(e),i=pg(e);return{URI:Fr,_E:void 0,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,reduceWithIndex:function(o,a,u){return m(o,n(a,u))},foldMapWithIndex:function(o){var a=r(o);return function(u,s){return m(u,a(s))}},reduceRightWithIndex:function(o,a,u){return m(o,i(a,u))}}},Yre=function(e){var t=YT(e),n=lg(e);return{URI:Fr,_E:void 0,map:Vo,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,traverse:t.traverse,sequence:t.sequence}},YT=function(e){var t=GT(e),n=Ul(e),r=function(a){return function(u,s){for(var c=a.of(new Map),l=n(u),f=l.length,d=function(h){var v=l[h],y=u.get(v);c=a.ap(a.map(c,function(b){return function(w){return b.set(v,w)}}),s(v,y))},p=0;p<f;p++)d(p);return c}},i=function(a){var u=r(a);return function(s,c){return u(s,function(l,f){return c(f)})}},o=function(a){var u=r(a);return function(s){return u(s,Dn)}};return{URI:Fr,_E:void 0,map:Vo,mapWithIndex:Bl,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,reduceWithIndex:t.reduceWithIndex,foldMapWithIndex:t.foldMapWithIndex,reduceRightWithIndex:t.reduceRightWithIndex,traverse:i,sequence:o,traverseWithIndex:r}};function Zre(e){var t=YT(e);return{URI:Fr,_E:void 0,map:Vo,compact:zl,separate:ql,filter:$p,filterMap:_p,partition:Sp,partitionMap:Tp,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,traverse:t.traverse,sequence:t.sequence,mapWithIndex:Bl,reduceWithIndex:t.reduceWithIndex,foldMapWithIndex:t.foldMapWithIndex,reduceRightWithIndex:t.reduceRightWithIndex,traverseWithIndex:t.traverseWithIndex,wilt:ni(t,KT),wither:ri(t,KT)}}var ZT=function(e,t){var n=ws(e);return function(r){return function(i){if(Xi(i))return r;if(Xi(r))return i;for(var o=new Map,a=i.entries(),u;!(u=a.next()).done;){var s=u.value,c=s[0],l=s[1],f=n(c)(r);ht(f)?o.set(c,t.concat(l,f.value)):o.set(c,l)}for(var d=r.entries();!(u=d.next()).done;){var p=u.value,c=p[0],l=p[1],f=n(c)(o);xt(f)&&o.set(c,l)}return o}}},XT=function(e,t){var n=ws(e);return function(r){return function(i){if(Xi(i)||Xi(r))return cg;for(var o=new Map,a=i.entries(),u;!(u=a.next()).done;){var s=u.value,c=s[0],l=s[1],f=n(c)(r);ht(f)&&o.set(c,t.concat(l,f.value))}return o}}},QT=function(e){var t=ug(e);return function(n){return function(r){if(Xi(r))return n;if(Xi(n))return r;for(var i=new Map,o=r.entries(),a;!(a=o.next()).done;){var u=a.value,s=u[0],c=u[1];t(s)(n)||i.set(s,c)}for(var l=n.entries();!(a=l.next()).done;){var f=a.value,s=f[0],c=f[1];t(s)(r)||i.set(s,c)}return i}}},Xre=AF,Qre={URI:Fr,map:Vo,compact:zl,separate:ql,filter:$p,filterMap:_p,partition:Sp,partitionMap:Tp};const eie=Object.freeze(Object.defineProperty({__proto__:null,fromMap:Rre,toMap:Mre,getShow:RF,size:MF,isEmpty:Xi,member:ug,elem:qT,keys:Ul,values:xre,collect:xF,toReadonlyArray:CF,toUnfoldable:Cre,upsertAt:AF,deleteAt:kF,updateAt:Are,modifyAt:WF,pop:kre,lookupWithKey:Ko,lookup:ws,isSubmap:sg,empty:cg,getEq:NF,getMonoid:Wre,singleton:Nre,fromFoldable:Pre,partitionMapWithIndex:PF,partitionWithIndex:FF,filterMapWithIndex:DF,filterWithIndex:LF,compact:zl,filter:Fre,filterMap:Dre,map:Lre,mapWithIndex:jre,partition:Ure,partitionMap:Bre,separate:ql,URI:Fr,getUnionSemigroup:qF,getUnionMonoid:zre,getIntersectionSemigroup:qre,getDifferenceMagma:Kre,getFilterableWithIndex:Vre,Functor:KF,flap:Hre,getFunctorWithIndex:Jre,Compactable:KT,Filterable:Gre,reduce:VT,foldMap:HT,reduceRight:JT,getFoldable:lg,reduceWithIndex:fg,foldMapWithIndex:dg,reduceRightWithIndex:pg,getFoldableWithIndex:GT,getTraversable:Yre,getTraversableWithIndex:YT,getWitherable:Zre,union:ZT,intersection:XT,difference:QT,insertAt:Xre,readonlyMap:Qre},Symbol.toStringTag,{value:"Module"}));var Kl=globalThis&&globalThis.__assign||function(){return Kl=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Kl.apply(this,arguments)},tie=RF,nie=MF,Ho=Xi,rie=ug,iie=qT,eI=function(e){return function(t){return Array.from(t.keys()).sort(e.compare)}},oie=function(e){return function(t){return Array.from(t.values()).sort(e.compare)}};function VF(e){var t=eI(e);return function(n){return function(r){for(var i=[],o=t(r),a=0,u=o;a<u.length;a++){var s=u[a];i.push(n(s,r.get(s)))}return i}}}function HF(e){return VF(e)(function(t,n){return[t,n]})}function aie(e,t){var n=HF(e);return function(r){var i=n(r),o=i.length;return t.unfold(0,function(a){return a<o?le([i[a],a+1]):me})}}var JF=function(e){var t=Es(e);return function(n,r){var i=t(n);return function(o){var a=i(o);if(xt(a)){var u=new Map(o);return u.set(n,r),u}else if(a.value[1]!==r){var u=new Map(o);return u.set(a.value[0],r),u}return o}}},GF=function(e){var t=Es(e);return function(n){return function(r){var i=t(n,r);if(ht(i)){var o=new Map(r);return o.delete(i.value[0]),o}return r}}},uie=function(e){var t=YF(e);return function(n,r){return t(n,function(){return r})}},YF=function(e){var t=Es(e);return function(n,r){return function(i){var o=t(n,i);if(xt(o))return me;var a=new Map(i);return a.set(o.value[0],r(o.value[1])),le(a)}}};function sie(e){var t=ZF(e),n=GF(e);return function(r){var i=n(r);return function(o){return m(t(r,o),qi(function(a){return[a,i(o)]}))}}}function Es(e){return function(t,n){if(n===void 0){var r=Es(e);return function(c){return r(t,c)}}for(var i=n.entries(),o;!(o=i.next()).done;){var a=o.value,u=a[0],s=a[1];if(e.equals(u,t))return le([u,s])}return me}}var ZF=ws,cie=sg,lie=NF;function fie(e,t){var n=Es(e);return{concat:function(r,i){if(Ho(r))return i;if(Ho(i))return r;for(var o=new Map(r),a=i.entries(),u;!(u=a.next()).done;){var s=u.value,c=s[0],l=s[1],f=n(c,r);ht(f)?o.set(f.value[0],t.concat(f.value[1],l)):o.set(c,l)}return o},empty:new Map}}var die=function(e,t){return new Map([[e,t]])};function pie(e,t,n){return function(r){var i=Es(e);return n.reduce(r,new Map,function(o,a){var u=a[0],s=a[1],c=i(u,o);return ht(c)?o.set(c.value[0],t.concat(c.value[1],s)):o.set(u,s),o})}}var Ip=function(e,t){for(var n=new Map,r=e.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],u=o[1];n.set(a,t(a,u))}return n},XF=function(e){return function(t){for(var n=new Map,r=new Map,i=t.entries(),o;!(o=i.next()).done;){var a=o.value,u=a[0],s=a[1],c=e(u,s);Lt(c)?n.set(u,c.left):r.set(u,c.right)}return Oe(n,r)}};function QF(e){return function(t){for(var n=new Map,r=new Map,i=t.entries(),o;!(o=i.next()).done;){var a=o.value,u=a[0],s=a[1];e(u,s)?r.set(u,s):n.set(u,s)}return Oe(n,r)}}var eD=function(e){return function(t){for(var n=new Map,r=t.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],u=o[1],s=e(a,u);ht(s)&&n.set(a,s.value)}return n}};function tD(e){return function(t){for(var n=new Map,r=t.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],u=o[1];e(a,u)&&n.set(a,u)}return n}}var Vl=function(e,t){return Ip(e,function(n,r){return t(r)})},hg=function(e,t){return nD(e,function(n,r){return t(r)})},mg=function(e,t){return rD(e,function(n,r){return t(r)})},vg=function(e,t){return iD(e,function(n,r){return t(r)})},gg=function(e,t){return oD(e,function(n,r){return t(r)})},nD=function(e,t){return m(e,tD(t))},rD=function(e,t){return m(e,eD(t))},iD=function(e,t){return m(e,QF(t))},oD=function(e,t){return m(e,XF(t))},Op=function(e){for(var t=new Map,n=e.entries(),r;!(r=n.next()).done;){var i=r.value,o=i[0],a=i[1];ht(a)&&t.set(o,a.value)}return t},hie=function(e){return function(t){return hg(t,e)}},mie=function(e){return function(t){return mg(t,e)}},vie=function(e){return function(t){return Vl(t,e)}},gie=function(e){return function(t){return Ip(t,e)}},yie=function(e){return function(t){return vg(t,e)}},bie=function(e){return function(t){return gg(t,e)}},wp=function(e){for(var t=new Map,n=new Map,r=e.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],u=o[1];Lt(u)?t.set(a,u.left):n.set(a,u.right)}return Oe(t,n)},Jo="Map",aD=function(e,t){var n=fD(e,t);return{concat:function(r,i){return n(i)(r)}}},$ie=function(e,t){return{concat:aD(e,t).concat,empty:new Map}},_ie=function(e,t){var n=dD(e,t);return{concat:function(r,i){return n(i)(r)}}},Sie=function(e){return function(){var t=pD(e);return{concat:function(n,r){return t(r)(n)}}}};function Tie(){return{URI:Jo,_E:void 0,map:Vl,mapWithIndex:Ip,compact:Op,separate:wp,filter:hg,filterMap:mg,partition:vg,partitionMap:gg,partitionMapWithIndex:oD,partitionWithIndex:iD,filterMapWithIndex:rD,filterWithIndex:nD}}function Iie(e){var t=sD(e);return{URI:Jo,_E:void 0,map:Vl,compact:Op,separate:wp,filter:hg,filterMap:mg,partition:vg,partitionMap:gg,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,traverse:t.traverse,sequence:t.sequence,mapWithIndex:Ip,reduceWithIndex:t.reduceWithIndex,foldMapWithIndex:t.foldMapWithIndex,reduceRightWithIndex:t.reduceRightWithIndex,traverseWithIndex:t.traverseWithIndex,wilt:ni(t,tI),wither:ri(t,tI)}}var Oie=VT,wie=HT,Eie=JT,Rie=function(e){return Kl(Kl({},lg(e)),{URI:Jo})},Mie=fg,xie=dg,Cie=pg,uD=function(e){return Kl(Kl({},GT(e)),{URI:Jo})},sD=function(e){var t=uD(e),n=eI(e),r=function(a){return function(u,s){for(var c=a.of(new Map),l=n(u),f=l.length,d=function(h){var v=l[h],y=u.get(v);c=a.ap(a.map(c,function(b){return function(w){return b.set(v,w)}}),s(v,y))},p=0;p<f;p++)d(p);return c}},i=function(a){var u=r(a);return function(s,c){return u(s,function(l,f){return c(f)})}},o=function(a){var u=r(a);return function(s){return u(s,function(c,l){return l})}};return{URI:Jo,_E:void 0,map:Vl,mapWithIndex:Ip,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,reduceWithIndex:t.reduceWithIndex,foldMapWithIndex:t.foldMapWithIndex,reduceRightWithIndex:t.reduceRightWithIndex,traverse:i,sequence:o,traverseWithIndex:r}},cD={URI:Jo,map:Vl},Aie=De(cD),tI={URI:Jo,compact:Op,separate:wp},lD={URI:Jo,map:Vl,compact:Op,separate:wp,filter:hg,filterMap:mg,partition:vg,partitionMap:gg},yg=function(e){return new Map(e)},fD=function(e,t){var n=ZT(e,t);return function(r){return function(i){return Ho(i)?yg(r):Ho(r)?yg(i):n(r)(i)}}},dD=function(e,t){var n=XT(e,t);return function(r){return function(i){return Ho(i)||Ho(r)?new Map:n(r)(i)}}},pD=function(e){var t=QT(e);return function(n){return function(r){return Ho(r)?yg(n):Ho(n)?yg(r):t(n)(r)}}},kie=new Map,Wie=JF,Nie=lD;const Pie=Object.freeze(Object.defineProperty({__proto__:null,getShow:tie,size:nie,isEmpty:Ho,member:rie,elem:iie,keys:eI,values:oie,collect:VF,toArray:HF,toUnfoldable:aie,upsertAt:JF,deleteAt:GF,updateAt:uie,modifyAt:YF,pop:sie,lookupWithKey:Es,lookup:ZF,isSubmap:cie,getEq:lie,getMonoid:fie,singleton:die,fromFoldable:pie,partitionMapWithIndex:XF,partitionWithIndex:QF,filterMapWithIndex:eD,filterWithIndex:tD,compact:Op,filter:hie,filterMap:mie,map:vie,mapWithIndex:gie,partition:yie,partitionMap:bie,separate:wp,URI:Jo,getUnionSemigroup:aD,getUnionMonoid:$ie,getIntersectionSemigroup:_ie,getDifferenceMagma:Sie,getFilterableWithIndex:Tie,getWitherable:Iie,reduce:Oie,foldMap:wie,reduceRight:Eie,getFoldable:Rie,reduceWithIndex:Mie,foldMapWithIndex:xie,reduceRightWithIndex:Cie,getFoldableWithIndex:uD,getTraversableWithIndex:sD,Functor:cD,flap:Aie,Compactable:tI,Filterable:lD,union:fD,intersection:dD,difference:pD,empty:kie,insertAt:Wie,map_:Nie},Symbol.toStringTag,{value:"Module"})),Fie=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Die=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Lie=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),jie=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Uie=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var hD=function(e){return{concat:wm(e).concat,empty:e.top}},mD=function(e){return{concat:Em(e).concat,empty:e.bottom}},nI=function(e){return{concat:I_(e).concat,empty:e.empty}},vD=function(e){var t={};for(var n in e)ot.call(e,n)&&(t[n]=e[n].empty);return{concat:O_(e).concat,empty:t}},gD=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return{concat:w_.apply(zC,e).concat,empty:e.map(function(n){return n.empty})}},yD=function(e){return R_(e)(e.empty)},Bie={concat:FC.concat,empty:void 0},zie=gD,qie=vD,Kie=nI,Vie=mD,Hie=hD,Jie=yD,bD={concat:DC.concat,empty:!0},$D={concat:LC.concat,empty:!1},Gie=HM,Yie=function(){return nI(AN())},Zie={concat:jC.concat,empty:""},Xie={concat:UC.concat,empty:0},Qie={concat:BC.concat,empty:1};const eoe=Object.freeze(Object.defineProperty({__proto__:null,min:hD,max:mD,reverse:nI,struct:vD,tuple:gD,concatAll:yD,monoidVoid:Bie,getTupleMonoid:zie,getStructMonoid:qie,getDualMonoid:Kie,getJoinMonoid:Vie,getMeetMonoid:Hie,fold:Jie,monoidAll:bD,monoidAny:$D,getFunctionMonoid:Gie,getEndomorphismMonoid:Yie,monoidString:Zie,monoidSum:Xie,monoidProduct:Qie},Symbol.toStringTag,{value:"Module"})),toe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var _D=function(e,t,n){return function(r){return r===-1?e():r===0?t():n()}},noe=_D,SD=function(e){return e===-1?1:e===1?-1:0},TD={equals:function(e,t){return e===t}},rI={concat:function(e,t){return e!==0?e:t}},ID={concat:rI.concat,empty:0},roe=function(e){return e<=-1?-1:e>=1?1:0},ioe=SD,ooe=rI,aoe=TD,uoe=ID;const soe=Object.freeze(Object.defineProperty({__proto__:null,matchW:_D,match:noe,reverse:SD,Eq:TD,Semigroup:rI,Monoid:ID,sign:roe,invert:ioe,semigroupOrdering:ooe,eqOrdering:aoe,monoidOrdering:uoe},Symbol.toStringTag,{value:"Module"}));var coe=function(e){return typeof e.map=="function"},loe=function(e){return typeof e.contramap=="function"},foe=function(e){return typeof e.mapWithIndex=="function"},doe=function(e){return typeof e.ap=="function"},poe=function(e){return typeof e.chain=="function"},hoe=function(e){return typeof e.bimap=="function"},moe=function(e){return typeof e.extend=="function"},voe=function(e){return typeof e.reduce=="function"},goe=function(e){return typeof e.reduceWithIndex=="function"},yoe=function(e){return typeof e.alt=="function"},boe=function(e){return typeof e.compact=="function"},$oe=function(e){return typeof e.filter=="function"},_oe=function(e){return typeof e.filterWithIndex=="function"},Soe=function(e){return typeof e.promap=="function"},Toe=function(e){return typeof e.compose=="function"},Ioe=function(e){return typeof e.throwError=="function"};function Ooe(e){var t={};if(coe(e)){var n=function(S){return function(_){return e.map(_,S)}};t.map=n}if(loe(e)){var r=function(S){return function(_){return e.contramap(_,S)}};t.contramap=r}if(foe(e)){var i=function(S){return function(_){return e.mapWithIndex(_,S)}};t.mapWithIndex=i}if(doe(e)){var o=function(S){return function(_){return e.ap(_,S)}},a=function(S){return function(_){return e.ap(e.map(_,function(U){return function(){return U}}),S)}};t.ap=o,t.apFirst=a,t.apSecond=function(S){return function(_){return e.ap(e.map(_,function(){return function(U){return U}}),S)}}}if(poe(e)){var u=function(S){return function(_){return e.chain(_,S)}},s=function(S){return function(_){return e.chain(_,function(U){return e.map(S(U),function(){return U})})}},c=function(S){return e.chain(S,B)};t.chain=u,t.chainFirst=s,t.flatten=c}if(hoe(e)){var l=function(S,_){return function(U){return e.bimap(U,S,_)}},f=function(S){return function(_){return e.mapLeft(_,S)}};t.bimap=l,t.mapLeft=f}if(moe(e)){var d=function(S){return function(_){return e.extend(_,S)}},p=function(S){return e.extend(S,B)};t.extend=d,t.duplicate=p}if(voe(e)){var h=function(S,_){return function(U){return e.reduce(U,S,_)}},v=function(S){var _=e.foldMap(S);return function(U){return function(G){return _(G,U)}}},y=function(S,_){return function(U){return e.reduceRight(U,S,_)}};t.reduce=h,t.foldMap=v,t.reduceRight=y}if(goe(e)){var b=function(S,_){return function(U){return e.reduceWithIndex(U,S,_)}},w=function(S){var _=e.foldMapWithIndex(S);return function(U){return function(G){return _(G,U)}}},F=function(S,_){return function(U){return e.reduceRightWithIndex(U,S,_)}};t.reduceWithIndex=b,t.foldMapWithIndex=w,t.reduceRightWithIndex=F}if(yoe(e)){var g=function(S){return function(_){return e.alt(_,S)}};t.alt=g}if(boe(e)&&(t.compact=e.compact,t.separate=e.separate),$oe(e)){var I=function(S){return function(_){return e.filter(_,S)}},T=function(S){return function(_){return e.filterMap(_,S)}},k=function(S){return function(_){return e.partition(_,S)}},E=function(S){return function(_){return e.partitionMap(_,S)}};t.filter=I,t.filterMap=T,t.partition=k,t.partitionMap=E}if(_oe(e)){var Y=function(S){return function(_){return e.filterWithIndex(_,S)}},K=function(S){return function(_){return e.filterMapWithIndex(_,S)}},x=function(S){return function(_){return e.partitionWithIndex(_,S)}},X=function(S){return function(_){return e.partitionMapWithIndex(_,S)}};t.filterWithIndex=Y,t.filterMapWithIndex=K,t.partitionWithIndex=x,t.partitionMapWithIndex=X}if(Soe(e)){var O=function(S,_){return function(U){return e.promap(U,S,_)}};t.promap=O}if(Toe(e)){var R=function(S){return function(_){return e.compose(_,S)}};t.compose=R}if(Ioe(e)){var W=function(S){return function(_){return _._tag==="None"?e.throwError(S()):e.of(_.value)}},L=function(S){return S._tag==="Left"?e.throwError(S.left):e.of(S.right)},z=function(S,_){return function(U){return S(U)?e.of(U):e.throwError(_(U))}},j=function(S,_){return function(U){return e.chain(U,function(G){return S(G)?e.of(G):e.throwError(_(G))})}};t.fromOption=W,t.fromEither=L,t.fromPredicate=z,t.filterOrElse=j}return t}var ce=m;const woe=Object.freeze(Object.defineProperty({__proto__:null,pipeable:Ooe,pipe:ce},Symbol.toStringTag,{value:"Module"})),Eoe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Roe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var bg=function(){return Math.random()};function OD(e,t){return m(bg,Yi(function(n){return Math.floor((t-e+1)*n+e)}))}function Moe(e,t){return m(bg,Yi(function(n){return(t-e)*n+e}))}var xoe=m(bg,Yi(function(e){return e<.5})),Coe=function(e){return m(OD(0,e.length-1),Yi(function(t){return e[t]}))};const Aoe=Object.freeze(Object.defineProperty({__proto__:null,random:bg,randomInt:OD,randomRange:Moe,randomBool:xoe,randomElem:Coe},Symbol.toStringTag,{value:"Module"}));var iI=Sl(Q0),wD=gs(Q0),ED=Tl(Qt),koe=Il(Qt),RD=Ji,MD=ED,xD=rp(Qt),Woe=xD,oI=xl(Lo),Noe=oI,CD=oI,Poe=CD,AD=Cl(Lo),Foe=AD,Doe=ap(Qt),Loe=up,kD=sp,joe=kD,WD=bs(Lo),Uoe=WD,ND=ip(Lo),Boe=ND,zoe=op(Lo),qoe=Al(Qt),Dr=function(e,t){return m(e,FD(t))},aI=function(e,t,n){return m(e,DD(t,n))},uI=function(e,t){return m(e,LD(t))},Hl=function(e,t){return m(e,sI(t))},Ep=function(e,t){return m(e,cI(t))},PD=function(e,t){return m(e,lI(t))},FD=Ol(Qt),DD=Rl(Qt),LD=Ml(Qt),sI=wl(Do),Koe=sI,Qi=wD,cI=ys(Lo),jD=cI,UD=jD(B),Voe=UD,lI=El(Lo),Hoe=lI,fI=iI,Bt="ReaderEither",BD=function(e){var t=rs(e);return{URI:Bt,_E:void 0,compact:Vi(Qt,t),separate:Ao(Qt,t,qa)}};function Joe(e){var t=zc(e),n=BD(e),r=ko(Qt,t),i=Wo(Qt,t),o=tu(Qt,t),a=nu(Qt,t);return{URI:Bt,_E:void 0,map:Dr,compact:n.compact,separate:n.separate,filter:function(u,s){return m(u,r(s))},filterMap:function(u,s){return m(u,i(s))},partition:function(u,s){return m(u,o(s))},partitionMap:function(u,s){return m(u,a(s))}}}function zD(e){var t=To(Do,za(e));return{URI:Bt,_E:void 0,map:Dr,ap:function(n,r){return m(n,t(r))},of:Qi}}function qD(e){var t=np(Lo,e);return{URI:Bt,_E:void 0,map:Dr,alt:function(n,r){return m(n,t(r))}}}var dI={URI:Bt,map:Dr},Goe=De(dI),Yoe={URI:Bt,of:Qi},Rp={URI:Bt,map:Dr,ap:Hl},KD=_t(Rp),Zoe=KD,VD=St(Rp),Xoe=VD,HD={URI:Bt,map:Dr,ap:Hl,of:Qi},Go={URI:Bt,map:Dr,ap:Hl,chain:Ep},Qoe={URI:Bt,map:Dr,ap:Hl,of:Qi,chain:Ep},JD=at(Go),eae=JD,tae={URI:Bt,bimap:aI,mapLeft:uI},nae={URI:Bt,map:Dr,alt:PD},Jl={URI:Bt,fromReader:MD},rae=lp(Jl),iae=fp(Jl),oae=Ss(Jl),GD=dp(Jl,Go),aae=GD,YD=pp(Jl,Go),uae=YD,sae={URI:Bt,map:Dr,ap:Hl,of:Qi,chain:Ep,throwError:fI},Yo={URI:Bt,fromEither:RD},cae=Di(Yo),lae=Li(Yo),fae=es(Yo,Go),ZD=Io(Yo,Go),dae=ZD,XD=Oo(Yo,Go),pae=XD,hae=Ba(Yo),QD=ts(Yo,Go),mae=QD,vae=ar(Yo),gae=Qi(jt),yae=It(dI),eL=Ot(Go),bae=eL,tL=Tt(Rp),$ae=tL,nL=Qi(Yt),rL=function(e){return H(_s(e),$s(Id(Dn)))},pI=function(e){var t=rL(e);return function(n){return ft(n)?t(n):nL}},_ae=pI,iL=function(e){return pI(function(t,n){return e(n)})},Sae=iL(B),Tae={URI:Bt,bimap:aI,mapLeft:uI,map:Dr,of:Qi,ap:Hl,chain:Ep,alt:PD,throwError:iI},Iae=Ut(Rp),Oae=Cr(HD),wae=function(e){return Ut(Do)($d(e))};function Eae(e){var t=zD(e),n=qD(e);return{URI:Bt,_E:void 0,map:Dr,ap:t.ap,of:Qi,chain:Ep,bimap:aI,mapLeft:uI,alt:n.alt,throwError:fI}}const Rae=Object.freeze(Object.defineProperty({__proto__:null,left:iI,right:wD,rightReader:ED,leftReader:koe,fromEither:RD,fromReader:MD,match:xD,matchW:Woe,matchE:oI,fold:Noe,matchEW:CD,foldW:Poe,getOrElse:AD,getOrElseW:Foe,toUnion:Doe,local:Loe,asksReaderEitherW:kD,asksReaderEither:joe,orElse:WD,orElseW:Uoe,orElseFirst:ND,orElseFirstW:Boe,orLeft:zoe,swap:qoe,map:FD,bimap:DD,mapLeft:LD,ap:sI,apW:Koe,of:Qi,chain:cI,chainW:jD,flattenW:UD,flatten:Voe,alt:lI,altW:Hoe,throwError:fI,URI:Bt,getCompactable:BD,getFilterable:Joe,getApplicativeReaderValidation:zD,getAltReaderValidation:qD,Functor:dI,flap:Goe,Pointed:Yoe,Apply:Rp,apFirst:KD,apFirstW:Zoe,apSecond:VD,apSecondW:Xoe,Applicative:HD,Chain:Go,Monad:Qoe,chainFirst:JD,chainFirstW:eae,Bifunctor:tae,Alt:nae,FromReader:Jl,ask:rae,asks:iae,fromReaderK:oae,chainReaderK:GD,chainReaderKW:aae,chainFirstReaderK:YD,chainFirstReaderKW:uae,MonadThrow:sae,FromEither:Yo,fromOption:cae,fromOptionK:lae,chainOptionK:fae,chainEitherK:ZD,chainEitherKW:dae,chainFirstEitherK:XD,chainFirstEitherKW:pae,fromPredicate:hae,filterOrElse:QD,filterOrElseW:mae,fromEitherK:vae,Do:gae,bindTo:yae,bind:eL,bindW:bae,apS:tL,apSW:$ae,ApT:nL,traverseReadonlyNonEmptyArrayWithIndex:rL,traverseReadonlyArrayWithIndex:pI,traverseArrayWithIndex:_ae,traverseArray:iL,sequenceArray:Sae,readerEither:Tae,getApplySemigroup:Iae,getApplyMonoid:Oae,getSemigroup:wae,getReaderValidation:Eae},Symbol.toStringTag,{value:"Module"}));function hI(e){return function(t){return function(){return e.of(t)}}}function mI(e){return function(t){return function(n){return function(r){return e.map(n(r),t)}}}}function vI(e){return function(t){return function(n){return function(r){return e.ap(n(r),t(r))}}}}function gI(e){return function(t){return function(n){return function(r){return e.chain(n(r),function(i){return t(i)(r)})}}}}function yI(e){return function(t){return H(t,e.of)}}function Mae(e){return function(t){return H(t,e)}}function xae(e){var t=vI(e),n=mI(e),r=gI(e);return{map:function(i,o){return m(i,n(o))},ap:function(i,o){return m(i,t(o))},of:hI(e),chain:function(i,o){return m(i,r(o))},ask:function(){return e.of},asks:function(i){return H(i,e.of)},local:function(i,o){return function(a){return i(o(a))}},fromReader:yI(e),fromM:function(i){return function(){return i}}}}const Cae=Object.freeze(Object.defineProperty({__proto__:null,of:hI,map:mI,ap:vI,chain:gI,fromReader:yI,fromNaturalTransformation:Mae,getReaderM:xae},Symbol.toStringTag,{value:"Module"}));var wn=function(e){return function(){return Promise.resolve().then(e)}};function Aae(e){return function(t){return function(){return new Promise(function(n){setTimeout(function(){Promise.resolve().then(t).then(n)},e)})}}}var pi=function(e,t){return m(e,au(t))},Rs=function(e,t){return m(e,oL(t))},bI=function(e,t){return m(e,Mp(function(n){return m(t,au(n))}))},Gl=function(e,t){return m(e,Mp(t))},au=function(e){return function(t){return function(){return Promise.resolve().then(t).then(e)}}},oL=function(e){return function(t){return function(){return Promise.all([Promise.resolve().then(t),Promise.resolve().then(e)]).then(function(n){var r=n[0],i=n[1];return r(i)})}}},vn=function(e){return function(){return Promise.resolve(e)}},Mp=function(e){return function(t){return function(){return Promise.resolve().then(t).then(function(n){return e(n)()})}}},kae=Mp(B),En="Task";function Wae(){return{concat:function(e,t){return function(){return Promise.race([Promise.resolve().then(e),Promise.resolve().then(t)])}},empty:uL}}var Pe={URI:En,map:pi},Nae=De(Pe),en={URI:En,of:vn},Ms={URI:En,map:pi,ap:Rs},Pae=_t(Ms),Fae=St(Ms),xp={URI:En,map:pi,ap:Rs,of:vn},$g={URI:En,map:pi,ap:bI},aL={URI:En,map:pi,ap:bI,of:vn},Yl={URI:En,map:pi,ap:Rs,chain:Gl},zt={URI:En,map:pi,of:vn,ap:Rs,chain:Gl},Dae={URI:En,map:pi,of:vn,ap:Rs,chain:Gl,fromIO:wn},Cp=B,Lae={URI:En,map:pi,of:vn,ap:Rs,chain:Gl,fromIO:wn,fromTask:Cp},jae=at(Yl),_g={URI:En,fromIO:wn},Uae=Hi(_g),Bae=No(_g,Yl),zae=Po(_g,Yl),qae={URI:En,fromIO:wn,fromTask:Cp},uL=function(){return new Promise(function(e){})},Kae=vn(jt),Vae=It(Pe),Hae=Ot(Yl),Jae=Tt(Ms),$I=vn(Yt),Zl=function(e){return function(t){return function(){return Promise.all(t.map(function(n,r){return Promise.resolve().then(function(){return e(r,n)()})}))}}},_I=function(e){var t=Zl(e);return function(n){return ft(n)?t(n):$I}},SI=function(e){return function(t){return function(){return Lc(t).reduce(function(n,r,i){return n.then(function(o){return Promise.resolve().then(e(i+1,r)).then(function(a){return o.push(a),o})})},Promise.resolve().then(e(0,or(t))).then(hd))}}},TI=function(e){var t=SI(e);return function(n){return ft(n)?t(n):$I}},Gae=_I,sL=function(e){return _I(function(t,n){return e(n)})},Yae=sL(B),Zae=TI,cL=function(e){return TI(function(t,n){return e(n)})},Xae=cL(B),Qae={URI:En,map:pi,of:vn,ap:Rs,chain:Gl,fromIO:wn,fromTask:Cp},eue={URI:En,map:pi,of:vn,ap:bI,chain:Gl,fromIO:wn,fromTask:Cp},tue=Ut($g),nue=Cr(aL);const rue=Object.freeze(Object.defineProperty({__proto__:null,fromIO:wn,delay:Aae,map:au,ap:oL,of:vn,chain:Mp,flatten:kae,URI:En,getRaceMonoid:Wae,Functor:Pe,flap:Nae,Pointed:en,ApplyPar:Ms,apFirst:Pae,apSecond:Fae,ApplicativePar:xp,ApplySeq:$g,ApplicativeSeq:aL,Chain:Yl,Monad:zt,MonadIO:Dae,fromTask:Cp,MonadTask:Lae,chainFirst:jae,FromIO:_g,fromIOK:Uae,chainIOK:Bae,chainFirstIOK:zae,FromTask:qae,never:uL,Do:Kae,bindTo:Vae,bind:Hae,apS:Jae,ApT:$I,traverseReadonlyNonEmptyArrayWithIndex:Zl,traverseReadonlyArrayWithIndex:_I,traverseReadonlyNonEmptyArrayWithIndexSeq:SI,traverseReadonlyArrayWithIndexSeq:TI,traverseArrayWithIndex:Gae,traverseArray:sL,sequenceArray:Yae,traverseSeqArrayWithIndex:Zae,traverseSeqArray:cL,sequenceSeqArray:Xae,task:Qae,taskSeq:eue,getSemigroup:tue,getMonoid:nue},Symbol.toStringTag,{value:"Module"}));var lL=yI(en),Xl=Ji,xs=H(wn,Xl),iue=up,fL=sp,oue=fL,hi=function(e,t){return m(e,OI(t))},Cs=function(e,t){return m(e,wI(t))},II=function(e,t){return m(e,Sg(function(n){return m(t,OI(n))}))},Ql=function(e,t){return m(e,Sg(t))},OI=mI(Pe),wI=vI(Ms),aue=wI,Lr=hI(en),Sg=gI(zt),dL=Sg,pL=dL(B),uue=pL,gn="ReaderTask",tn={URI:gn,map:hi},sue=De(tn),Ap={URI:gn,of:Lr},kp={URI:gn,map:hi,ap:Cs},cue=_t(kp),lue=St(kp),fue={URI:gn,map:hi,ap:Cs,of:Lr},EI={URI:gn,map:hi,ap:II},hL={URI:gn,map:hi,ap:II,of:Lr},eo={URI:gn,map:hi,ap:Cs,chain:Ql},Zo={URI:gn,map:hi,of:Lr,ap:Cs,chain:Ql},due={URI:gn,map:hi,of:Lr,ap:Cs,chain:Ql,fromIO:xs},pue={URI:gn,map:hi,of:Lr,ap:Cs,chain:Ql,fromIO:xs,fromTask:Xl},mL=at(eo),hue=mL,Tg={URI:gn,fromIO:xs},mue=Hi(Tg),vue=No(Tg,eo),gue=Po(Tg,eo),ef={URI:gn,fromReader:lL},yue=lp(ef),bue=fp(ef),$ue=Ss(ef),vL=dp(ef,eo),_ue=vL,gL=pp(ef,eo),Sue=gL,Ig={URI:gn,fromIO:xs,fromTask:Xl},Tue=Ts(Ig),Iue=kl(Ig,eo),Oue=Wl(Ig,eo),wue=Lr(jt),Eue=It(tn),yL=Ot(eo),Rue=yL,bL=Tt(kp),Mue=bL,RI=Lr(Yt),$L=function(e){return H(_s(e),$s(Zl(Dn)))},MI=function(e){var t=$L(e);return function(n){return ft(n)?t(n):RI}},_L=function(e){return H(_s(e),$s(SI(Dn)))},xI=function(e){var t=_L(e);return function(n){return ft(n)?t(n):RI}},xue=MI,SL=function(e){return MI(function(t,n){return e(n)})},Cue=SL(B),Aue=xI,TL=function(e){return xI(function(t,n){return e(n)})},kue=TL(B),Wue={URI:gn,map:hi,of:Lr,ap:Cs,chain:Ql,fromIO:xs,fromTask:Xl},Nue={URI:gn,map:hi,of:Lr,ap:II,chain:Ql,fromIO:xs,fromTask:Xl},Pue=Ut(EI),Fue=Cr(hL);function Due(e,t){return e(t)()}const Lue=Object.freeze(Object.defineProperty({__proto__:null,fromReader:lL,fromTask:Xl,fromIO:xs,local:iue,asksReaderTaskW:fL,asksReaderTask:oue,map:OI,ap:wI,apW:aue,of:Lr,chain:Sg,chainW:dL,flattenW:pL,flatten:uue,URI:gn,Functor:tn,flap:sue,Pointed:Ap,ApplyPar:kp,apFirst:cue,apSecond:lue,ApplicativePar:fue,ApplySeq:EI,ApplicativeSeq:hL,Chain:eo,Monad:Zo,MonadIO:due,MonadTask:pue,chainFirst:mL,chainFirstW:hue,FromIO:Tg,fromIOK:mue,chainIOK:vue,chainFirstIOK:gue,FromReader:ef,ask:yue,asks:bue,fromReaderK:$ue,chainReaderK:vL,chainReaderKW:_ue,chainFirstReaderK:gL,chainFirstReaderKW:Sue,FromTask:Ig,fromTaskK:Tue,chainTaskK:Iue,chainFirstTaskK:Oue,Do:wue,bindTo:Eue,bind:yL,bindW:Rue,apS:bL,apSW:Mue,ApT:RI,traverseReadonlyNonEmptyArrayWithIndex:$L,traverseReadonlyArrayWithIndex:MI,traverseReadonlyNonEmptyArrayWithIndexSeq:_L,traverseReadonlyArrayWithIndexSeq:xI,traverseArrayWithIndex:xue,traverseArray:SL,sequenceArray:Cue,traverseSeqArrayWithIndex:Aue,traverseSeqArray:TL,sequenceSeqArray:kue,readerTask:Wue,readerTaskSeq:Nue,getSemigroup:Pue,getMonoid:Fue,run:Due},Symbol.toStringTag,{value:"Module"}));var jue=globalThis&&globalThis.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function u(l){try{c(r.next(l))}catch(f){a(f)}}function s(l){try{c(r.throw(l))}catch(f){a(f)}}function c(l){l.done?o(l.value):i(l.value).then(u,s)}c((r=r.apply(e,t||[])).next())})},Uue=globalThis&&globalThis.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(c){return function(l){return s([c,l])}}function s(c){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1],o=c;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(c);break}o[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(l){c=[6,l],i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},CI=Sl(en),AI=gs(en),Og=Tl(Pe),kI=Il(Pe),WI=H(wn,Og),IL=H(wn,kI),uu=WI,tf=Og,NI=vn,PI=wn,OL=function(e){return au(mx(e))},wL=rp(Pe),Bue=wL,FI=xl(zt),zue=FI,EL=FI,que=EL,RL=Cl(zt),Kue=RL,ML=function(e,t){return function(){return jue(void 0,void 0,void 0,function(){var n;return Uue(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e().then(Ua)];case 1:return[2,r.sent()];case 2:return n=r.sent(),[2,So(t(n))];case 3:return[2]}})})}},Vue=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return ML(function(){return e.apply(void 0,n)},t)}},Hue=ap(Pe),Jue=Nv(en),Gue=Pv(en),Yue=q0(zt),xL=bs(zt),Zue=xL,wg=ip(zt),Xue=wg,Que=function(e){return wg(JL(e))},ese=function(e){return wg(GL(e))},tse=op(zt),nse=Al(Pe),CL=function(e){var t=OL(e);return function(n){return H(n,t)}},AL=function(e){return function(t){return function(n){return m(n,Wp(CL(e)(t)))}}},rse=AL,kL=function(e){return H(e,PI)},WL=function(e){return Np(kL(e))},ise=WL,nn=function(e,t){return m(e,jI(t))},su=function(e,t){return m(e,UI(t))},DI=function(e,t){return m(e,Wp(function(n){return m(t,jI(n))}))},cu=function(e,t){return m(e,Wp(t))},Eg=function(e,t,n){return m(e,NL(t,n))},Rg=function(e,t){return m(e,PL(t))},LI=function(e,t){return m(e,BI(t))},jI=Ol(Pe),NL=Rl(Pe),PL=Ml(Pe),UI=wl(Ms),ose=UI,Wp=ys(zt),Np=Wp,FL=Np(B),ase=FL,BI=El(zt),use=BI,zn=AI,Pp=CI,dt="TaskEither";function zI(e,t){var n=To(e,za(t));return{URI:dt,_E:void 0,map:nn,ap:function(r,i){return m(r,n(i))},of:zn}}function DL(e){var t=np(zt,e);return{URI:dt,_E:void 0,map:nn,alt:function(n,r){return m(n,t(r))}}}var LL=function(e){var t=rs(e);return{URI:dt,_E:void 0,compact:Vi(Pe,t),separate:Ao(Pe,t,qa)}};function sse(e){var t=zc(e),n=LL(e),r=ko(Pe,t),i=Wo(Pe,t),o=tu(Pe,t),a=nu(Pe,t);return{URI:dt,_E:void 0,map:nn,compact:n.compact,separate:n.separate,filter:function(u,s){return m(u,r(s))},filterMap:function(u,s){return m(u,i(s))},partition:function(u,s){return m(u,o(s))},partitionMap:function(u,s){return m(u,a(s))}}}var qI={URI:dt,map:nn},cse=De(qI),lse={URI:dt,of:zn},Mg={URI:dt,map:nn,ap:su},jL=_t(Mg),fse=jL,UL=St(Mg),dse=UL,pse={URI:dt,map:nn,ap:su,of:zn},BL={URI:dt,map:nn,ap:DI},zL={URI:dt,map:nn,ap:DI,of:zn},mi={URI:dt,map:nn,ap:su,chain:cu},hse={URI:dt,map:nn,ap:su,chain:cu,of:zn},mse={URI:dt,map:nn,ap:su,chain:cu,of:zn,fromIO:uu},vse={URI:dt,map:nn,ap:su,chain:cu,of:zn,fromIO:uu,fromTask:tf},gse={URI:dt,map:nn,ap:su,chain:cu,of:zn,throwError:Pp},qL=at(mi),yse=qL,bse={URI:dt,bimap:Eg,mapLeft:Rg},$se={URI:dt,map:nn,alt:LI},Xo={URI:dt,fromEither:NI},_se=Di(Xo),Sse=Li(Xo),Tse=es(Xo,mi),KL=Io(Xo,mi),Ise=KL,VL=Oo(Xo,mi),Ose=VL,wse=Ba(Xo),HL=ts(Xo,mi),Ese=HL,Rse=ar(Xo),xg={URI:dt,fromIO:uu},JL=Hi(xg),Mse=No(xg,mi),xse=Po(xg,mi),Cg={URI:dt,fromIO:uu,fromTask:tf},GL=Ts(Cg),Cse=kl(Cg,mi),Ase=Wl(Cg,mi);function kse(e){return function(){var t=Array.prototype.slice.call(arguments);return function(){return new Promise(function(n){var r=function(i,o){return i!=null?n(So(i)):n(Ua(o))};e.apply(null,t.concat(r))})}}}var Wse=function(e,t,n){return KI(e,t,n)},KI=function(e,t,n){return m(e,Np(function(r){return m(t(r),Mp(function(i){return m(n(r,i),Np(function(){return vn(i)}))}))}))},Nse=zn(jt),Pse=It(qI),YL=Ot(mi),Fse=YL,ZL=Tt(Mg),Dse=ZL,VI=zn(Yt),HI=function(e){return H(Zl(e),au(Id(Dn)))},JI=function(e){var t=HI(e);return function(n){return ft(n)?t(n):VI}},GI=function(e){return function(t){return function(){return Lc(t).reduce(function(n,r,i){return n.then(function(o){return Lt(o)?n:e(i+1,r)().then(function(a){return Lt(a)?a:(o.right.push(a.right),o)})})},e(0,or(t))().then(is(hd)))}}},YI=function(e){var t=GI(e);return function(n){return ft(n)?t(n):VI}},Lse=JI,XL=function(e){return JI(function(t,n){return e(n)})},jse=XL(B),Use=YI,QL=function(e){return YI(function(t,n){return e(n)})},Bse=QL(B),zse={URI:dt,bimap:Eg,mapLeft:Rg,map:nn,of:zn,ap:su,chain:cu,alt:LI,fromIO:uu,fromTask:tf,throwError:Pp},qse={URI:dt,bimap:Eg,mapLeft:Rg,map:nn,of:zn,ap:DI,chain:cu,alt:LI,fromIO:uu,fromTask:tf,throwError:Pp},Kse=Ut(BL),Vse=Cr(zL),Hse=function(e){return Ut($g)($d(e))};function Jse(e){var t=zI(xp,e),n=DL(e);return{URI:dt,_E:void 0,map:nn,ap:t.ap,of:zn,chain:cu,bimap:Eg,mapLeft:Rg,alt:n.alt,fromIO:uu,fromTask:tf,throwError:Pp}}const Gse=Object.freeze(Object.defineProperty({__proto__:null,left:CI,right:AI,rightTask:Og,leftTask:kI,rightIO:WI,leftIO:IL,fromIO:uu,fromTask:tf,fromEither:NI,fromIOEither:PI,fromTaskOption:OL,match:wL,matchW:Bue,matchE:FI,fold:zue,matchEW:EL,foldW:que,getOrElse:RL,getOrElseW:Kue,tryCatch:ML,tryCatchK:Vue,toUnion:Hue,fromNullable:Jue,fromNullableK:Gue,chainNullableK:Yue,orElse:xL,orElseW:Zue,orElseFirst:wg,orElseFirstW:Xue,orElseFirstIOK:Que,orElseFirstTaskK:ese,orLeft:tse,swap:nse,fromTaskOptionK:CL,chainTaskOptionKW:AL,chainTaskOptionK:rse,fromIOEitherK:kL,chainIOEitherKW:WL,chainIOEitherK:ise,map:jI,bimap:NL,mapLeft:PL,ap:UI,apW:ose,chain:Wp,chainW:Np,flattenW:FL,flatten:ase,alt:BI,altW:use,of:zn,throwError:Pp,URI:dt,getApplicativeTaskValidation:zI,getAltTaskValidation:DL,getCompactable:LL,getFilterable:sse,Functor:qI,flap:cse,Pointed:lse,ApplyPar:Mg,apFirst:jL,apFirstW:fse,apSecond:UL,apSecondW:dse,ApplicativePar:pse,ApplySeq:BL,ApplicativeSeq:zL,Chain:mi,Monad:hse,MonadIO:mse,MonadTask:vse,MonadThrow:gse,chainFirst:qL,chainFirstW:yse,Bifunctor:bse,Alt:$se,FromEither:Xo,fromOption:_se,fromOptionK:Sse,chainOptionK:Tse,chainEitherK:KL,chainEitherKW:Ise,chainFirstEitherK:VL,chainFirstEitherKW:Ose,fromPredicate:wse,filterOrElse:HL,filterOrElseW:Ese,fromEitherK:Rse,FromIO:xg,fromIOK:JL,chainIOK:Mse,chainFirstIOK:xse,FromTask:Cg,fromTaskK:GL,chainTaskK:Cse,chainFirstTaskK:Ase,taskify:kse,bracket:Wse,bracketW:KI,Do:Nse,bindTo:Pse,bind:YL,bindW:Fse,apS:ZL,apSW:Dse,ApT:VI,traverseReadonlyNonEmptyArrayWithIndex:HI,traverseReadonlyArrayWithIndex:JI,traverseReadonlyNonEmptyArrayWithIndexSeq:GI,traverseReadonlyArrayWithIndexSeq:YI,traverseArrayWithIndex:Lse,traverseArray:XL,sequenceArray:jse,traverseSeqArrayWithIndex:Use,traverseSeqArray:QL,sequenceSeqArray:Bse,taskEither:zse,taskEitherSeq:qse,getApplySemigroup:Kse,getApplyMonoid:Vse,getSemigroup:Hse,getTaskValidation:Jse},Symbol.toStringTag,{value:"Module"}));var lu=Ji,Ag=Sl(Ap),ZI=gs(Ap),XI=H(Og,lu),ej=H(kI,lu),QI=function(e){return H(e,AI)},tj=function(e){return H(e,CI)},nj=Tl(tn),Yse=Il(tn),eO=H(WI,lu),rj=H(IL,lu),ij=Lr,oj=QI,fu=eO,nf=XI,tO=H(PI,lu),nO=function(e){return H(e,NI)},aj=rp(tn),Zse=aj,rO=xl(eo),Xse=rO,uj=rO,Qse=uj,sj=Cl(Zo),ece=sj,tce=ap(tn),nce=Nv(Ap),rce=Pv(Ap),ice=q0(Zo),oce=up,cj=sp,ace=cj,lj=bs(Zo),uce=lj,fj=ip(Zo),sce=fj,cce=op(Zo),lce=Al(tn),dj=function(e){return H(e,tO)},pj=function(e){return rf(dj(e))},fce=pj,iO=function(e){return H(e,lu)},hj=function(e){return rf(iO(e))},dce=hj,mj=function(e){return Dg(iO(e))},pce=mj,oO=function(e){return H(e,nO)},vj=function(e){return rf(oO(e))},hce=vj,gj=function(e){return Dg(oO(e))},mce=gj,rn=function(e,t){return m(e,Fp(t))},du=function(e,t){return m(e,lO(t))},aO=function(e,t){return m(e,Ng(function(n){return m(t,Fp(n))}))},pu=function(e,t){return m(e,Ng(t))},uO=function(e,t){return m(e,Pg(t))},kg=function(e,t,n){return m(e,sO(t,n))},Wg=function(e,t){return m(e,cO(t))},Fp=Ol(tn),sO=Rl(tn),cO=Ml(tn),lO=wl(kp),vce=lO,qn=ZI,Ng=ys(Zo),rf=Ng,yj=rf(B),gce=yj,Pg=El(Zo),bj=Pg,Dp=Ag,ct="ReaderTaskEither",$j=function(e){var t=rs(e);return{URI:ct,_E:void 0,compact:Vi(tn,t),separate:Ao(tn,t,qa)}};function yce(e){var t=zc(e),n=$j(e),r=ko(tn,t),i=Wo(tn,t),o=tu(tn,t),a=nu(tn,t);return{URI:ct,_E:void 0,map:rn,compact:n.compact,separate:n.separate,filter:function(u,s){return m(u,r(s))},filterMap:function(u,s){return m(u,i(s))},partition:function(u,s){return m(u,o(s))},partitionMap:function(u,s){return m(u,a(s))}}}function _j(e,t){var n=To(Do,zI(e,t));return{URI:ct,_E:void 0,map:rn,ap:function(r,i){return m(r,n(i))},of:qn}}function Sj(e){var t=np(Zo,e);return{URI:ct,_E:void 0,map:rn,alt:function(n,r){return m(n,t(r))}}}var As={URI:ct,map:rn},bce=De(As),fO={URI:ct,of:qn},Fg={URI:ct,map:rn,ap:du},Tj=_t(Fg),$ce=Tj,Ij=St(Fg),_ce=Ij,Sce={URI:ct,map:rn,ap:du,of:qn},Oj={URI:ct,map:rn,ap:aO},wj={URI:ct,map:rn,ap:aO,of:qn},Rn={URI:ct,map:rn,ap:du,chain:pu},Tce={URI:ct,map:rn,ap:du,chain:pu,of:qn},Ice={URI:ct,map:rn,ap:du,chain:pu,of:qn,fromIO:fu},Oce={URI:ct,map:rn,ap:du,chain:pu,of:qn,fromIO:fu,fromTask:nf},wce={URI:ct,map:rn,ap:du,chain:pu,of:qn,throwError:Dp},Ej=at(Rn),Dg=Ej,Ece={URI:ct,bimap:kg,mapLeft:Wg},Rce={URI:ct,map:rn,alt:uO},of={URI:ct,fromReader:oj},Mce=lp(of),xce=fp(of),Cce=Ss(of),Rj=dp(of,Rn),Ace=Rj,Mj=pp(of,Rn),kce=Mj,dO=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return nj(e.apply(void 0,t))}},xj=function(e){return rf(dO(e))},Wce=xj,Cj=function(e){return Dg(dO(e))},Nce=Cj,Qo={URI:ct,fromEither:ij},Pce=Di(Qo),Fce=Li(Qo),Dce=es(Qo,Rn),Aj=Io(Qo,Rn),Lce=Aj,kj=Oo(Qo,Rn),jce=kj,Uce=Ba(Qo),Wj=ts(Qo,Rn),Bce=Wj,zce=ar(Qo),Lg={URI:ct,fromIO:fu},qce=Hi(Lg),Kce=No(Lg,Rn),Vce=Po(Lg,Rn),jg={URI:ct,fromIO:fu,fromTask:nf},Hce=Ts(jg),Jce=kl(jg,Rn),Gce=Wl(jg,Rn);function Yce(e,t,n){return Nj(e,t,n)}function Nj(e,t,n){return function(r){return KI(e(r),function(i){return t(i)(r)},function(i,o){return n(i,o)(r)})}}var Zce=qn(jt),Xce=It(As),Pj=Ot(Rn),Qce=Pj,Fj=Tt(Fg),ele=Fj,pO=qn(Yt),Dj=function(e){return H(_s(e),$s(HI(Dn)))},hO=function(e){var t=Dj(e);return function(n){return ft(n)?t(n):pO}},Lj=function(e){return H(_s(e),$s(GI(Dn)))},mO=function(e){var t=Lj(e);return function(n){return ft(n)?t(n):pO}},tle=hO,jj=function(e){return hO(function(t,n){return e(n)})},nle=jj(B),rle=mO,Uj=function(e){return mO(function(t,n){return e(n)})},ile=Uj(B),ole={URI:ct,map:rn,of:qn,ap:du,chain:pu,alt:uO,bimap:kg,mapLeft:Wg,fromIO:fu,fromTask:nf,throwError:Dp},ale={URI:ct,map:rn,of:qn,ap:aO,chain:pu,alt:uO,bimap:kg,mapLeft:Wg,fromIO:fu,fromTask:nf,throwError:Dp},ule=Ut(Oj),sle=Cr(wj),cle=function(e){return Ut(EI)($d(e))};function lle(e){var t=_j(xp,e),n=Sj(e);return{URI:ct,_E:void 0,map:rn,of:qn,chain:pu,bimap:kg,mapLeft:Wg,ap:t.ap,alt:n.alt,fromIO:fu,fromTask:nf,throwError:Dp}}function fle(e,t){return e(t)()}const dle=Object.freeze(Object.defineProperty({__proto__:null,fromTaskEither:lu,left:Ag,right:ZI,rightTask:XI,leftTask:ej,rightReader:QI,leftReader:tj,rightReaderTask:nj,leftReaderTask:Yse,rightIO:eO,leftIO:rj,fromEither:ij,fromReader:oj,fromIO:fu,fromTask:nf,fromIOEither:tO,fromReaderEither:nO,match:aj,matchW:Zse,matchE:rO,fold:Xse,matchEW:uj,foldW:Qse,getOrElse:sj,getOrElseW:ece,toUnion:tce,fromNullable:nce,fromNullableK:rce,chainNullableK:ice,local:oce,asksReaderTaskEitherW:cj,asksReaderTaskEither:ace,orElse:lj,orElseW:uce,orElseFirst:fj,orElseFirstW:sce,orLeft:cce,swap:lce,fromIOEitherK:dj,chainIOEitherKW:pj,chainIOEitherK:fce,fromTaskEitherK:iO,chainTaskEitherKW:hj,chainTaskEitherK:dce,chainFirstTaskEitherKW:mj,chainFirstTaskEitherK:pce,fromReaderEitherK:oO,chainReaderEitherKW:vj,chainReaderEitherK:hce,chainFirstReaderEitherKW:gj,chainFirstReaderEitherK:mce,map:Fp,bimap:sO,mapLeft:cO,ap:lO,apW:vce,of:qn,chain:Ng,chainW:rf,flattenW:yj,flatten:gce,alt:Pg,altW:bj,throwError:Dp,URI:ct,getCompactable:$j,getFilterable:yce,getApplicativeReaderTaskValidation:_j,getAltReaderTaskValidation:Sj,Functor:As,flap:bce,Pointed:fO,ApplyPar:Fg,apFirst:Tj,apFirstW:$ce,apSecond:Ij,apSecondW:_ce,ApplicativePar:Sce,ApplySeq:Oj,ApplicativeSeq:wj,Chain:Rn,Monad:Tce,MonadIO:Ice,MonadTask:Oce,MonadThrow:wce,chainFirst:Ej,chainFirstW:Dg,Bifunctor:Ece,Alt:Rce,FromReader:of,ask:Mce,asks:xce,fromReaderK:Cce,chainReaderK:Rj,chainReaderKW:Ace,chainFirstReaderK:Mj,chainFirstReaderKW:kce,fromReaderTaskK:dO,chainReaderTaskKW:xj,chainReaderTaskK:Wce,chainFirstReaderTaskKW:Cj,chainFirstReaderTaskK:Nce,FromEither:Qo,fromOption:Pce,fromOptionK:Fce,chainOptionK:Dce,chainEitherK:Aj,chainEitherKW:Lce,chainFirstEitherK:kj,chainFirstEitherKW:jce,fromPredicate:Uce,filterOrElse:Wj,filterOrElseW:Bce,fromEitherK:zce,FromIO:Lg,fromIOK:qce,chainIOK:Kce,chainFirstIOK:Vce,FromTask:jg,fromTaskK:Hce,chainTaskK:Jce,chainFirstTaskK:Gce,bracket:Yce,bracketW:Nj,Do:Zce,bindTo:Xce,bind:Pj,bindW:Qce,apS:Fj,apSW:ele,ApT:pO,traverseReadonlyNonEmptyArrayWithIndex:Dj,traverseReadonlyArrayWithIndex:hO,traverseReadonlyNonEmptyArrayWithIndexSeq:Lj,traverseReadonlyArrayWithIndexSeq:mO,traverseArrayWithIndex:tle,traverseArray:jj,sequenceArray:nle,traverseSeqArrayWithIndex:rle,traverseSeqArray:Uj,sequenceSeqArray:ile,readerTaskEither:ole,readerTaskEitherSeq:ale,getApplySemigroup:ule,getApplyMonoid:sle,getSemigroup:cle,getReaderTaskValidation:lle,run:fle},Symbol.toStringTag,{value:"Module"}));var Bj={equals:function(e,t){return e===t}},zj={concat:function(e,t){return e+t}},qj="",ple={concat:zj.concat,empty:qj},J={equals:Bj.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},hle={show:function(e){return JSON.stringify(e)}},mle=function(e){return typeof e=="string"},vle=function(e){return e.toUpperCase()},gle=function(e){return e.toLowerCase()},yle=function(e,t){return function(n){return n.replace(e,t)}},ble=function(e){return e.trim()},$le=function(e){return e.trimLeft()},_le=function(e){return e.trimRight()},Sle=function(e,t){return function(n){return n.slice(e,t)}},Tle=function(e){return e.length===0},Ile=function(e){return e.length},Ole=function(e){return function(t){var n=t.split(e);return Bi(n)?n:[t]}},wle=function(e,t){return function(n){return n.includes(e,t)}},Ele=function(e,t){return function(n){return n.startsWith(e,t)}},Rle=function(e,t){return function(n){return n.endsWith(e,t)}};const Mle=Object.freeze(Object.defineProperty({__proto__:null,Eq:Bj,Semigroup:zj,empty:qj,Monoid:ple,Ord:J,Show:hle,isString:mle,toUpperCase:vle,toLowerCase:gle,replace:yle,trim:ble,trimLeft:$le,trimRight:_le,slice:Sle,isEmpty:Tle,size:Ile,split:Ole,includes:wle,startsWith:Ele,endsWith:Rle},Symbol.toStringTag,{value:"Module"}));var xle=function(e){return Object.assign({},e)},Cle=function(e){return Object.assign({},e)},Kj=function(e){return Object.keys(e).length},vi=function(e){for(var t in e)if(ot.call(e,t))return!1;return!0},af=function(e){return function(t){return Object.keys(t).sort(e.compare)}},Ale=af(J);function Ug(e){if(typeof e=="function")return Ug(J)(e);var t=af(e);return function(n){return function(r){for(var i=[],o=0,a=t(r);o<a.length;o++){var u=a[o];i.push(n(u,r[u]))}return i}}}var Lp=Ug(J)(function(e,t){return[e,t]});function kle(e){return function(t){var n=Lp(t),r=n.length;return e.unfold(0,function(i){return i<r?le([n[i],i+1]):me})}}var vO=function(e,t){return function(n){if(ot.call(n,e)&&n[e]===t)return n;var r=Object.assign({},n);return r[e]=t,r}},ea=function(e,t){return ot.call(t,e)};function Bg(e){return function(t){if(!ot.call(t,e))return t;var n=Object.assign({},t);return delete n[e],n}}var Wle=function(e,t){return function(n){if(!ea(e,n))return me;if(n[e]===t)return le(n);var r=Object.assign({},n);return r[e]=t,le(r)}},Nle=function(e,t){return function(n){if(!ea(e,n))return me;var r=t(n[e]);if(r===n[e])return le(n);var i=Object.assign({},n);return i[e]=r,le(i)}};function Ple(e){var t=Bg(e);return function(n){var r=ks(e,n);return xt(r)?me:le([r.value,t(n)])}}function zg(e){return function(t,n){if(n===void 0){var r=zg(e);return function(o){return r(o,t)}}for(var i in t)if(!ot.call(n,i)||!e.equals(t[i],n[i]))return!1;return!0}}function ks(e,t){return t===void 0?function(n){return ks(e,n)}:ot.call(t,e)?le(t[e]):me}var jp={};function qg(e){return function(t){var n={};for(var r in t)ot.call(t,r)&&(n[r]=e(r,t[r]));return n}}function gO(e){return qg(function(t,n){return e(n)})}function uf(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===2)return uf(J).apply(void 0,e);var n=af(e[0]);return function(r,i){return function(o){for(var a=r,u=n(o),s=u.length,c=0;c<s;c++){var l=u[c];a=i(l,a,o[l])}return a}}}function sf(e){if("compare"in e){var t=af(e);return function(n){return function(r){return function(i){for(var o=n.empty,a=t(i),u=a.length,s=0;s<u;s++){var c=a[s];o=n.concat(o,r(c,i[c]))}return o}}}}return sf(J)(e)}function cf(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===2)return cf(J).apply(void 0,e);var n=af(e[0]);return function(r,i){return function(o){for(var a=r,u=n(o),s=u.length,c=s-1;c>=0;c--){var l=u[c];a=i(l,o[l],a)}return a}}}var Vj=function(e,t){var n;return n={},n[e]=t,n};function Hj(e){var t=Bp(J)(e);return function(n){return function(r){return t(r,n)}}}function Kg(e){var t=to(J)(e);return function(n){return function(r){return t(r,n)}}}function lf(e){return Up(J)(e)}var Fle=function(e){var t=Kg(e);return function(n){return function(r){return e.map(m(r,t(n)),ta)}}},Dle=function(e){var t=Kg(e);return function(n){return function(r){return e.map(m(r,t(n)),na)}}};function Vg(e){return function(t){var n={},r={};for(var i in t)if(ot.call(t,i)){var o=e(i,t[i]);switch(o._tag){case"Left":n[i]=o.left;break;case"Right":r[i]=o.right;break}}return Oe(n,r)}}function Hg(e){return function(t){var n={},r={};for(var i in t)if(ot.call(t,i)){var o=t[i];e(i,o)?r[i]=o:n[i]=o}return Oe(n,r)}}function Jg(e){return function(t){var n={};for(var r in t)if(ot.call(t,r)){var i=e(r,t[r]);ht(i)&&(n[r]=i.value)}return n}}function ff(e){return function(t){var n={},r=!1;for(var i in t)if(ot.call(t,i)){var o=t[i];e(i,o)?n[i]=o:r=!0}return r?n:t}}function Jj(e,t){var n=yO(e,t);return function(r){return n(r,B)}}function yO(e,t){return function(n,r){return t.reduce(n,{},function(i,o){var a=r(o),u=a[0],s=a[1];return i[u]=ot.call(i,u)?e.concat(i[u],s):s,i})}}var Lle=Lp,jle=function(e){for(var t={},n=0,r=e;n<r.length;n++){var i=r[n];t[i[0]]=i[1]}return t};function Gj(e){return function(t){for(var n in t)if(!e(t[n]))return!1;return!0}}function Yj(e){return function(t){for(var n in t)if(e(t[n]))return!0;return!1}}function bO(e){return function(t,n){if(n===void 0){var r=bO(e);return function(o){return r(t,o)}}for(var i in n)if(e.equals(n[i],t))return!0;return!1}}var $O=function(e){return function(t){return function(n){if(vi(n))return t;if(vi(t))return n;var r={};for(var i in n)ea(i,t)?r[i]=e.concat(n[i],t[i]):r[i]=n[i];for(var i in t)ea(i,r)||(r[i]=t[i]);return r}}},_O=function(e){return function(t){return function(n){if(vi(n)||vi(t))return jp;var r={};for(var i in n)ea(i,t)&&(r[i]=e.concat(n[i],t[i]));return r}}},SO=function(e){return function(t){if(vi(t))return e;if(vi(e))return t;var n={};for(var r in t)ea(r,e)||(n[r]=t[r]);for(var r in e)ea(r,t)||(n[r]=e[r]);return n}},lr=function(e,t){return m(e,gO(t))},Ws=function(e,t){return m(e,qg(t))},fr=function(e){var t=zp(e);return function(n,r,i){return m(n,t(r,i))}},dr=function(e){return function(t){var n=qp(e)(t);return function(r,i){return m(r,n(i))}}},pr=function(e){var t=Kp(e);return function(n,r,i){return m(n,t(r,i))}},Ns=function(e,t){return m(e,Qg(t))},Ps=function(e,t){return m(e,TO(t))},Fs=function(e,t){return m(e,ey(t))},Ds=function(e,t){return m(e,IO(t))},Ls=function(e){var t=uf(e);return function(n,r,i){return m(n,t(r,i))}},js=function(e){var t=sf(e);return function(n){var r=t(n);return function(i,o){return m(i,r(o))}}},Us=function(e){var t=cf(e);return function(n,r,i){return m(n,t(r,i))}},Gg=function(e,t){return m(e,Vg(t))},Yg=function(e,t){return m(e,Hg(t))},Zg=function(e,t){return m(e,Jg(t))},Xg=function(e,t){return m(e,ff(t))},to=function(e){var t=Bp(e);return function(n){var r=t(n);return function(i,o){return r(i,H(Dn,o))}}},Up=function(e){var t=to(e);return function(n){var r=t(n);return function(i){return r(i,B)}}},Bp=function(e){return function(t){var n=af(e);return function(r,i){var o=n(r);if(o.length===0)return t.of(jp);for(var a=t.of({}),u=function(f){a=t.ap(t.map(a,function(d){return function(p){var h;return Object.assign({},d,(h={},h[f]=p,h))}}),i(f,r[f]))},s=0,c=o;s<c.length;s++){var l=c[s];u(l)}return a}}},Qg=function(e){return ff(function(t,n){return e(n)})},TO=function(e){return Jg(function(t,n){return e(n)})},ey=function(e){return Hg(function(t,n){return e(n)})},IO=function(e){return Vg(function(t,n){return e(n)})};function zp(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===1){var n=uf(e[0]);return function(r,i){return n(r,function(o,a,u){return i(a,u)})}}return zp(J).apply(void 0,e)}function qp(e){if("compare"in e){var t=sf(e);return function(n){var r=t(n);return function(i){return r(function(o,a){return i(a)})}}}return qp(J)(e)}function Kp(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===1){var n=cf(e[0]);return function(r,i){return n(r,function(o,a,u){return i(a,u)})}}return Kp(J).apply(void 0,e)}var ta=function(e){var t={};for(var n in e)if(ot.call(e,n)){var r=e[n];ht(r)&&(t[n]=r.value)}return t},na=function(e){var t={},n={};for(var r in e)if(ot.call(e,r)){var i=e[r];Lt(i)?t[r]=i.left:n[r]=i.right}return Oe(t,n)},on="ReadonlyRecord";function ty(e){return"compare"in e?function(t){return{show:function(n){var r=Ug(e)(function(i,o){return"".concat(JSON.stringify(i),": ").concat(t.show(o))})(n).join(", ");return r===""?"{}":"{ ".concat(r," }")}}}:ty(J)(e)}function Zj(e){var t=zg(e);return kr(function(n,r){return t(n)(r)&&t(r)(n)})}function Xj(e){return{concat:function(t,n){if(vi(t))return n;if(vi(n))return t;var r=Object.assign({},t);for(var i in n)ot.call(n,i)&&(r[i]=ot.call(t,i)?e.concat(t[i],n[i]):n[i]);return r},empty:jp}}var Qj={URI:on,map:lr},Ule=De(Qj),Ble={URI:on,map:lr,mapWithIndex:Ws},zle=function(e){return{URI:on,reduce:fr(e),foldMap:dr(e),reduceRight:pr(e)}},qle=function(e){return{URI:on,reduce:fr(e),foldMap:dr(e),reduceRight:pr(e),reduceWithIndex:Ls(e),foldMapWithIndex:js(e),reduceRightWithIndex:Us(e)}},Vp={URI:on,compact:ta,separate:na},Kle={URI:on,map:lr,compact:ta,separate:na,filter:Ns,filterMap:Ps,partition:Fs,partitionMap:Ds},Vle={URI:on,map:lr,mapWithIndex:Ws,compact:ta,separate:na,filter:Ns,filterMap:Ps,partition:Fs,partitionMap:Ds,filterMapWithIndex:Zg,filterWithIndex:Xg,partitionMapWithIndex:Gg,partitionWithIndex:Yg},eU=function(e){return{URI:on,map:lr,reduce:fr(e),foldMap:dr(e),reduceRight:pr(e),traverse:to(e),sequence:Up(e)}},Hle=function(e){return{URI:on,map:lr,mapWithIndex:Ws,reduce:fr(e),foldMap:dr(e),reduceRight:pr(e),reduceWithIndex:Ls(e),foldMapWithIndex:js(e),reduceRightWithIndex:Us(e),traverse:to(e),sequence:Up(e),traverseWithIndex:Bp(e)}},Jle=function(e){var t=eU(e);return{URI:on,map:lr,reduce:fr(e),foldMap:dr(e),reduceRight:pr(e),traverse:t.traverse,sequence:t.sequence,compact:ta,separate:na,filter:Ns,filterMap:Ps,partition:Fs,partitionMap:Ds,wither:ri(t,Vp),wilt:ni(t,Vp)}},tU=function(e){var t=$O(e);return{concat:function(n,r){return t(r)(n)}}},Gle=function(e){return{concat:tU(e).concat,empty:jp}},Yle=function(e){var t=_O(e);return{concat:function(n,r){return t(r)(n)}}},Zle=function(){return{concat:function(e,t){return SO(t)(e)}}},Xle={URI:on,reduce:fr(J),foldMap:dr(J),reduceRight:pr(J)},Qle={URI:on,reduce:fr(J),foldMap:dr(J),reduceRight:pr(J),reduceWithIndex:Ls(J),foldMapWithIndex:js(J),reduceRightWithIndex:Us(J)},OO={URI:on,map:lr,reduce:fr(J),foldMap:dr(J),reduceRight:pr(J),traverse:to(J),sequence:lf},efe={URI:on,map:lr,mapWithIndex:Ws,reduce:fr(J),foldMap:dr(J),reduceRight:pr(J),reduceWithIndex:Ls(J),foldMapWithIndex:js(J),reduceRightWithIndex:Us(J),traverse:to(J),sequence:lf,traverseWithIndex:Bp(J)},nU=ri(OO,Vp),rU=ni(OO,Vp),tfe={URI:on,map:lr,reduce:fr(J),foldMap:dr(J),reduceRight:pr(J),traverse:to(J),sequence:lf,compact:ta,separate:na,filter:Ns,filterMap:Ps,partition:Fs,partitionMap:Ds,wither:nU,wilt:rU},wO=vO;function iU(e,t){return ot.call(t===void 0?this:t,e)}var nfe={URI:on,map:lr,reduce:fr(J),foldMap:dr(J),reduceRight:pr(J),traverse:to(J),sequence:lf,compact:ta,separate:na,filter:Ns,filterMap:Ps,partition:Fs,partitionMap:Ds,mapWithIndex:Ws,reduceWithIndex:Ls(J),foldMapWithIndex:js(J),reduceRightWithIndex:Us(J),filterMapWithIndex:Zg,filterWithIndex:Xg,partitionMapWithIndex:Gg,partitionWithIndex:Yg,traverseWithIndex:Bp(J),wither:nU,wilt:rU};const rfe=Object.freeze(Object.defineProperty({__proto__:null,fromRecord:xle,toRecord:Cle,size:Kj,isEmpty:vi,keys:Ale,collect:Ug,toReadonlyArray:Lp,toUnfoldable:kle,upsertAt:vO,has:ea,deleteAt:Bg,updateAt:Wle,modifyAt:Nle,pop:Ple,isSubrecord:zg,lookup:ks,empty:jp,mapWithIndex:qg,map:gO,reduceWithIndex:uf,foldMapWithIndex:sf,reduceRightWithIndex:cf,singleton:Vj,traverseWithIndex:Hj,traverse:Kg,sequence:lf,wither:Fle,wilt:Dle,partitionMapWithIndex:Vg,partitionWithIndex:Hg,filterMapWithIndex:Jg,filterWithIndex:ff,fromFoldable:Jj,fromFoldableMap:yO,toEntries:Lle,fromEntries:jle,every:Gj,some:Yj,elem:bO,union:$O,intersection:_O,difference:SO,_map:lr,_mapWithIndex:Ws,_reduce:fr,_foldMap:dr,_reduceRight:pr,_filter:Ns,_filterMap:Ps,_partition:Fs,_partitionMap:Ds,_reduceWithIndex:Ls,_foldMapWithIndex:js,_reduceRightWithIndex:Us,_partitionMapWithIndex:Gg,_partitionWithIndex:Yg,_filterMapWithIndex:Zg,_filterWithIndex:Xg,_traverse:to,_sequence:Up,filter:Qg,filterMap:TO,partition:ey,partitionMap:IO,reduce:zp,foldMap:qp,reduceRight:Kp,compact:ta,separate:na,URI:on,getShow:ty,getEq:Zj,getMonoid:Xj,Functor:Qj,flap:Ule,FunctorWithIndex:Ble,getFoldable:zle,getFoldableWithIndex:qle,Compactable:Vp,Filterable:Kle,FilterableWithIndex:Vle,getTraversable:eU,getTraversableWithIndex:Hle,getWitherable:Jle,getUnionSemigroup:tU,getUnionMonoid:Gle,getIntersectionSemigroup:Yle,getDifferenceMagma:Zle,Foldable:Xle,FoldableWithIndex:Qle,Traversable:OO,TraversableWithIndex:efe,Witherable:tfe,insertAt:wO,hasOwnProperty:iU,readonlyRecord:nfe},Symbol.toStringTag,{value:"Module"}));var ife=function(e){return new Set(e)},ofe=function(e){return new Set([e])},oU=function(e){return function(t){for(var n=t.length,r=new Set,i=an(e),o=0;o<n;o++){var a=t[o];i(a,r)||r.add(a)}return r}};function afe(e){return new Set(e)}function ufe(e){var t=an(e);return function(n){return function(r){var i=new Set;return r.forEach(function(o){var a=n(o);t(a,i)||i.add(a)}),i}}}function sfe(e){var t=an(e);return function(n){return function(r){var i=new Set;return r.forEach(function(o){n(o).forEach(function(a){t(a,i)||i.add(a)})}),i}}}function EO(e){return function(t){for(var n=t.values(),r,i=new Set;!(r=n.next()).done;){var o=r.value;e(o)&&i.add(o)}return i}}function cfe(e){return function(t){for(var n=t.values(),r,i=new Set,o=new Set;!(r=n.next()).done;){var a=r.value;e(a)?i.add(a):o.add(a)}return Oe(o,i)}}function RO(e){var t=an(e);return function(n,r){if(r===void 0){var i=RO(e);return function(a){return i(n,a)}}if(Hp(n))return r;if(Hp(r))return n;var o=new Set(n);return r.forEach(function(a){t(a,o)||o.add(a)}),o}}function MO(e){var t=an(e);return function(n,r){if(r===void 0){var i=MO(e);return function(a){return i(a,n)}}if(Hp(n)||Hp(r))return CO;var o=new Set;return n.forEach(function(a){t(a,r)&&o.add(a)}),o}}function lfe(e,t){return function(n){return function(r){for(var i=r.values(),o,a=new Set,u=new Set,s=an(e),c=an(t);!(o=i.next()).done;){var l=n(o.value);switch(l._tag){case"Left":s(l.left,a)||a.add(l.left);break;case"Right":c(l.right,u)||u.add(l.right);break}}return Oe(a,u)}}}function xO(e){var t=an(e);return function(n,r){if(r===void 0){var i=xO(e);return function(o){return i(o,n)}}return EO(function(o){return!t(o,r)})(n)}}function aU(e){var t=ny(e);return function(n,r){return function(i){return t(i).reduce(r,n)}}}function uU(e,t){var n=ny(e);return function(r){return function(i){return n(i).reduce(function(o,a){return t.concat(o,r(a))},t.empty)}}}var sU=function(e){var t=ny(e);return function(n,r){return function(i){return t(i).reduceRight(function(o,a){return r(a,o)},n)}}};function cU(e){var t=an(e);return function(n){return function(r){if(t(n)(r))return r;var i=new Set(r);return i.add(n),i}}}var lU=function(e){return function(t){return function(n){return EO(function(r){return!e.equals(t,r)})(n)}}},ffe=function(e){var t=an(e),n=lU(e),r=cU(e);return function(i){return function(o){return(t(i,o)?n:r)(i)(o)}}},dfe=function(e){return fU(e)(B)};function pfe(e,t){return function(n){var r=an(e),i=an(t),o=new Set,a=new Set;return n.forEach(function(u){switch(u._tag){case"Left":r(u.left,o)||o.add(u.left);break;case"Right":i(u.right,a)||a.add(u.right);break}}),Oe(o,a)}}function fU(e){var t=an(e);return function(n){return function(r){var i=new Set;return r.forEach(function(o){var a=n(o);a._tag==="Some"&&!t(a.value,i)&&i.add(a.value)}),i}}}var CO=new Set,Hp=function(e){return e.size===0},hfe=function(e){return e.size},AO=function(e){return function(t){for(var n=t.values(),r,i=!1;!i&&!(r=n.next()).done;)i=e(r.value);return i}};function kO(e){return Xd(AO(Xd(e)))}function Jp(e){var t=an(e);return function(n,r){if(r===void 0){var i=Jp(e);return function(o){return i(o,n)}}return kO(function(o){return t(o,r)})(n)}}function an(e){return function(t,n){if(n===void 0){var r=an(e);return function(u){return r(t,u)}}for(var i=n.values(),o,a=!1;!a&&!(o=i.next()).done;)a=e.equals(t,o.value);return a}}var ny=function(e){return function(t){var n=[];return t.forEach(function(r){return n.push(r)}),n.sort(e.compare)}},mfe="ReadonlySet";function dU(e){return{show:function(t){var n=[];return t.forEach(function(r){n.push(e.show(r))}),"new Set([".concat(n.sort().join(", "),"])")}}}function pU(e){var t=Jp(e);return kr(function(n,r){return t(n,r)&&t(r,n)})}var hU=function(e){return{concat:RO(e)}},vfe=function(e){return{concat:hU(e).concat,empty:CO}},gfe=function(e){return{concat:MO(e)}},yfe=function(e){return{concat:xO(e)}},bfe=oU;const $fe=Object.freeze(Object.defineProperty({__proto__:null,fromSet:ife,singleton:ofe,fromReadonlyArray:oU,toSet:afe,map:ufe,chain:sfe,filter:EO,partition:cfe,union:RO,intersection:MO,partitionMap:lfe,difference:xO,reduce:aU,foldMap:uU,reduceRight:sU,insert:cU,remove:lU,toggle:ffe,compact:dfe,separate:pfe,filterMap:fU,empty:CO,isEmpty:Hp,size:hfe,some:AO,every:kO,isSubset:Jp,elem:an,toReadonlyArray:ny,URI:mfe,getShow:dU,getEq:pU,getUnionSemigroup:hU,getUnionMonoid:vfe,getIntersectionSemigroup:gfe,getDifferenceMagma:yfe,fromArray:bfe},Symbol.toStringTag,{value:"Module"}));function qt(e){return e[0]}function yn(e){return e[1]}var _fe=function(e){return[yn(e),qt(e)]};function WO(e){return{URI:hr,_E:void 0,map:Gp,ap:function(t,n){return[qt(t)(qt(n)),e.concat(yn(t),yn(n))]}}}var mU=function(e){return function(t){return[t,e.empty]}};function Sfe(e){var t=WO(e);return{URI:hr,_E:void 0,map:t.map,ap:t.ap,of:mU(e)}}function NO(e){var t=WO(e);return{URI:hr,_E:void 0,map:t.map,ap:t.ap,chain:function(n,r){var i=r(qt(n)),o=i[0],a=i[1];return[o,e.concat(yn(n),a)]}}}function Tfe(e){var t=NO(e);return{URI:hr,_E:void 0,map:t.map,ap:t.ap,chain:t.chain,of:mU(e)}}function Ife(e){var t=function(r,i){for(var o=i(r),a=e.empty,u=qt(o);u._tag==="Left";)a=e.concat(a,yn(o)),o=i(u.left),u=qt(o);return[u.right,e.concat(a,yn(o))]},n=NO(e);return{URI:hr,_E:void 0,map:n.map,ap:n.ap,chain:n.chain,chainRec:t}}var vU=function(e,t){return m(e,SU(t))},Gp=function(e,t){return m(e,LO(t))},gU=function(e,t,n){return m(e,_U(t,n))},yU=function(e,t){return m(e,jO(t))},bU=function(e,t){return m(e,UO(t))},PO=function(e,t,n){return m(e,BO(t,n))},FO=function(e){var t=zO();return function(n,r){return m(n,t(r))}},DO=function(e,t,n){return m(e,qO(t,n))},$U=function(e){var t=TU(e);return function(n,r){return m(n,t(r))}},_U=function(e,t){return function(n){return[t(qt(n)),e(yn(n))]}},LO=function(e){return function(t){return[e(qt(t)),yn(t)]}},jO=function(e){return function(t){return[qt(t),e(yn(t))]}},SU=function(e){return function(t){return[qt(t),yn(e)]}},UO=function(e){return function(t){return[e(t),yn(t)]}},ry=qt,Ofe=UO(B),BO=function(e,t){return function(n){return t(e,qt(n))}},zO=function(){return function(e){return function(t){return e(qt(t))}}},qO=function(e,t){return function(n){return t(qt(n),e)}},TU=function(e){return function(t){return function(n){return e.map(t(qt(n)),function(r){return[r,yn(n)]})}}},KO=function(e){return function(t){return e.map(qt(t),function(n){return[n,yn(t)]})}},hr="ReadonlyTuple",IU={URI:hr,map:Gp},wfe=De(IU),Efe={URI:hr,bimap:gU,mapLeft:yU},Rfe={URI:hr,compose:vU},Mfe={URI:hr,map:Gp,extend:bU,extract:ry},xfe={URI:hr,reduce:PO,foldMap:FO,reduceRight:DO},Cfe={URI:hr,map:Gp,reduce:PO,foldMap:FO,reduceRight:DO,traverse:$U,sequence:KO},Afe=LO,kfe=jO,Wfe={URI:hr,compose:vU,map:Gp,bimap:gU,mapLeft:yU,extract:ry,extend:bU,reduce:PO,foldMap:FO,reduceRight:DO,traverse:$U,sequence:KO};const Nfe=Object.freeze(Object.defineProperty({__proto__:null,fst:qt,snd:yn,swap:_fe,getApply:WO,getApplicative:Sfe,getChain:NO,getMonad:Tfe,getChainRec:Ife,bimap:_U,mapFst:LO,mapSnd:jO,compose:SU,extend:UO,extract:ry,duplicate:Ofe,reduce:BO,foldMap:zO,reduceRight:qO,traverse:TU,sequence:KO,URI:hr,Functor:IU,flap:wfe,Bifunctor:Efe,Semigroupoid:Rfe,Comonad:Mfe,Foldable:xfe,Traversable:Cfe,map:Afe,mapLeft:kfe,readonlyTuple:Wfe},Symbol.toStringTag,{value:"Module"}));var df=globalThis&&globalThis.__assign||function(){return df=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},df.apply(this,arguments)},Pfe=Kj,Bs=vi,VO=function(e){return function(t){return Object.keys(t).sort(e.compare)}},Ffe=VO(J);function HO(e){if(typeof e=="function")return HO(J)(e);var t=VO(e);return function(n){return function(r){for(var i=[],o=0,a=t(r);o<a.length;o++){var u=a[o];i.push(n(u,r[u]))}return i}}}var JO=HO(J)(function(e,t){return[e,t]});function Dfe(e){return function(t){var n=JO(t),r=n.length;return e.unfold(0,function(i){return i<r?le([n[i],i+1]):me})}}var OU=vO,wU=ea;function EU(e){return function(t){if(!ot.call(t,e))return t;var n=Object.assign({},t);return delete n[e],n}}var Lfe=function(e,t){return RU(e,function(){return t})},RU=function(e,t){return function(n){if(!wU(e,n))return me;var r=Object.assign({},n);return r[e]=t(n[e]),le(r)}};function jfe(e){var t=EU(e);return function(n){var r=MU(e,n);return xt(r)?me:le([r.value,t(n)])}}var Ufe=zg,MU=ks,Bfe=qg,zfe=gO;function qfe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===1?uf(e[0]):uf(J).apply(void 0,e)}function Kfe(e){return"compare"in e?sf(e):sf(J)(e)}function Vfe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===1?cf(e[0]):cf(J).apply(void 0,e)}var Hfe=Vj;function Jfe(e){return Hj(e)}function GO(e){return Kg(e)}function Yp(e){return lf(e)}var Gfe=function(e){var t=GO(e);return function(n){return function(r){return e.map(m(r,t(n)),hu)}}},Yfe=function(e){var t=GO(e);return function(n){return function(r){return e.map(m(r,t(n)),mu)}}},Zfe=Vg;function Xfe(e){return Hg(e)}var Qfe=Jg;function ede(e){return ff(e)}function xU(e,t){return Jj(e,t)}var tde=JO,nde=function(e){return xU(Rm(),EW)(e)};function rde(e,t){return yO(e,t)}var ide=Gj,ode=Yj,ade=bO,CU=function(e){var t=$O(e);return function(n){return function(r){return Bs(r)?df({},n):Bs(n)?df({},r):t(n)(r)}}},AU=function(e){return function(t){return function(n){return Bs(n)||Bs(t)?{}:_O(e)(t)(n)}}},kU=function(e){return function(t){return Bs(t)?df({},e):Bs(e)?df({},t):SO(e)(t)}},gi=lr,Zp=Ws,yi=fr,bi=dr,$i=pr,Xp=Ns,Qp=Ps,eh=Fs,th=Ds,nh=Ls,rh=js,ih=Us,WU=Gg,NU=Yg,PU=Zg,FU=Xg,pf=to,DU=Up,YO=function(e){return function(t){var n=VO(e);return function(r,i){var o=n(r);if(o.length===0)return t.of({});for(var a=t.of({}),u=function(f){a=t.ap(t.map(a,function(d){return function(p){return d[f]=p,d}}),i(f,r[f]))},s=0,c=o;s<c.length;s++){var l=c[s];u(l)}return a}}},ude=Qg,sde=TO,cde=ey,lde=IO;function fde(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===1?zp(e[0]):zp(J).apply(void 0,e)}function dde(e){return"compare"in e?qp(e):qp(J)(e)}function pde(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===1?Kp(e[0]):Kp(J).apply(void 0,e)}var hu=ta,mu=na,un="Record";function hde(e){return"compare"in e?ty(e):ty(J)(e)}var mde=Zj,vde=Xj,LU={URI:un,map:gi},gde=De(LU),yde={URI:un,map:gi,mapWithIndex:Zp},bde=function(e){return{URI:un,reduce:yi(e),foldMap:bi(e),reduceRight:$i(e)}},$de=function(e){return{URI:un,reduce:yi(e),foldMap:bi(e),reduceRight:$i(e),reduceWithIndex:nh(e),foldMapWithIndex:rh(e),reduceRightWithIndex:ih(e)}},oh={URI:un,compact:hu,separate:mu},_de={URI:un,map:gi,compact:hu,separate:mu,filter:Xp,filterMap:Qp,partition:eh,partitionMap:th},Sde={URI:un,map:gi,mapWithIndex:Zp,compact:hu,separate:mu,filter:Xp,filterMap:Qp,partition:eh,partitionMap:th,filterMapWithIndex:PU,filterWithIndex:FU,partitionMapWithIndex:WU,partitionWithIndex:NU},jU=function(e){return{URI:un,map:gi,reduce:yi(e),foldMap:bi(e),reduceRight:$i(e),traverse:pf(e),sequence:DU(e)}},Tde=function(e){return{URI:un,map:gi,mapWithIndex:Zp,reduce:yi(e),foldMap:bi(e),reduceRight:$i(e),reduceWithIndex:nh(e),foldMapWithIndex:rh(e),reduceRightWithIndex:ih(e),traverse:pf(e),sequence:DU(e),traverseWithIndex:YO(e)}},Ide=function(e){var t=jU(e);return{URI:un,map:gi,reduce:yi(e),foldMap:bi(e),reduceRight:$i(e),traverse:t.traverse,sequence:t.sequence,compact:hu,separate:mu,filter:Xp,filterMap:Qp,partition:eh,partitionMap:th,wither:ri(t,oh),wilt:ni(t,oh)}},UU=function(e){var t=CU(e);return{concat:function(n,r){return t(r)(n)}}},Ode=function(e){return{concat:UU(e).concat,empty:{}}},wde=function(e){var t=AU(e);return{concat:function(n,r){return t(r)(n)}}},Ede=function(){return{concat:function(e,t){return kU(t)(e)}}},Rde={URI:un,reduce:yi(J),foldMap:bi(J),reduceRight:$i(J)},Mde={URI:un,reduce:yi(J),foldMap:bi(J),reduceRight:$i(J),reduceWithIndex:nh(J),foldMapWithIndex:rh(J),reduceRightWithIndex:ih(J)},ZO={URI:un,map:gi,reduce:yi(J),foldMap:bi(J),reduceRight:$i(J),traverse:pf(J),sequence:Yp},xde={URI:un,map:gi,mapWithIndex:Zp,reduce:yi(J),foldMap:bi(J),reduceRight:$i(J),reduceWithIndex:nh(J),foldMapWithIndex:rh(J),reduceRightWithIndex:ih(J),traverse:pf(J),sequence:Yp,traverseWithIndex:YO(J)},BU=ri(ZO,oh),zU=ni(ZO,oh),Cde={URI:un,map:gi,reduce:yi(J),foldMap:bi(J),reduceRight:$i(J),traverse:pf(J),sequence:Yp,compact:hu,separate:mu,filter:Xp,filterMap:Qp,partition:eh,partitionMap:th,wither:BU,wilt:zU},Ade={},kde=OU,Wde=iU,Nde={URI:un,map:gi,reduce:yi(J),foldMap:bi(J),reduceRight:$i(J),traverse:pf(J),sequence:Yp,compact:hu,separate:mu,filter:Xp,filterMap:Qp,partition:eh,partitionMap:th,mapWithIndex:Zp,reduceWithIndex:nh(J),foldMapWithIndex:rh(J),reduceRightWithIndex:ih(J),filterMapWithIndex:PU,filterWithIndex:FU,partitionMapWithIndex:WU,partitionWithIndex:NU,traverseWithIndex:YO(J),wither:BU,wilt:zU};const Pde=Object.freeze(Object.defineProperty({__proto__:null,size:Pfe,isEmpty:Bs,keys:Ffe,collect:HO,toArray:JO,toUnfoldable:Dfe,upsertAt:OU,has:wU,deleteAt:EU,updateAt:Lfe,modifyAt:RU,pop:jfe,isSubrecord:Ufe,lookup:MU,mapWithIndex:Bfe,map:zfe,reduceWithIndex:qfe,foldMapWithIndex:Kfe,reduceRightWithIndex:Vfe,singleton:Hfe,traverseWithIndex:Jfe,traverse:GO,sequence:Yp,wither:Gfe,wilt:Yfe,partitionMapWithIndex:Zfe,partitionWithIndex:Xfe,filterMapWithIndex:Qfe,filterWithIndex:ede,fromFoldable:xU,toEntries:tde,fromEntries:nde,fromFoldableMap:rde,every:ide,some:ode,elem:ade,union:CU,intersection:AU,difference:kU,filter:ude,filterMap:sde,partition:cde,partitionMap:lde,reduce:fde,foldMap:dde,reduceRight:pde,compact:hu,separate:mu,URI:un,getShow:hde,getEq:mde,getMonoid:vde,Functor:LU,flap:gde,FunctorWithIndex:yde,getFoldable:bde,getFoldableWithIndex:$de,Compactable:oh,Filterable:_de,FilterableWithIndex:Sde,getTraversable:jU,getTraversableWithIndex:Tde,getWitherable:Ide,getUnionSemigroup:UU,getUnionMonoid:Ode,getIntersectionSemigroup:wde,getDifferenceMagma:Ede,Foldable:Rde,FoldableWithIndex:Mde,Traversable:ZO,TraversableWithIndex:xde,Witherable:Cde,empty:Ade,insertAt:kde,hasOwnProperty:Wde,record:Nde},Symbol.toStringTag,{value:"Module"}));var Fde=function(e){return function(t){return ht(e(t))}},Dde=function(e){return function(t){return F$(e(t))}},Lde=function(){return function(e){return!0}},jde=function(e){return function(t){return!e(t)}},Ude=function(e){return function(t){return function(n){return t(n)||e(n)}}},Bde=function(e){return function(t){return function(n){return t(n)&&e(n)}}},zde=function(){return function(e){return!1}},qde=function(e){return function(t){return function(n){return t(n)&&e(n)}}};const Kde=Object.freeze(Object.defineProperty({__proto__:null,fromOptionK:Fde,fromEitherK:Dde,id:Lde,not:jde,or:Ude,and:Bde,zero:zde,compose:qde},Symbol.toStringTag,{value:"Module"}));var qU=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return{add:function(n,r){return e.map(function(i,o){return i.add(n[o],r[o])})},zero:e.map(function(n){return n.zero}),mul:function(n,r){return e.map(function(i,o){return i.mul(n[o],r[o])})},one:e.map(function(n){return n.one}),sub:function(n,r){return e.map(function(i,o){return i.sub(n[o],r[o])})}}},Vde=function(e){return function(t){return e.sub(e.zero,t)}},Hde=qU,Jde=JM;const Gde=Object.freeze(Object.defineProperty({__proto__:null,tuple:qU,negate:Vde,getTupleRing:Hde,getFunctionRing:Jde},Symbol.toStringTag,{value:"Module"})),Yde=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Zde=W$;const Xde=Object.freeze(Object.defineProperty({__proto__:null,getFunctionSemiring:Zde},Symbol.toStringTag,{value:"Module"}));var Qde=dU,epe=pU;function tpe(e){var t=Kn(e);return function(n){return function(r){var i=new Set;return r.forEach(function(o){var a=n(o);t(a,i)||i.add(a)}),i}}}function npe(e){var t=Kn(e);return function(n){return function(r){var i=new Set;return r.forEach(function(o){n(o).forEach(function(a){t(a,i)||i.add(a)})}),i}}}function XO(e){return function(t){for(var n=t.values(),r,i=new Set;!(r=n.next()).done;){var o=r.value;e(o)&&i.add(o)}return i}}function rpe(e){return function(t){for(var n=t.values(),r,i=new Set,o=new Set;!(r=n.next()).done;){var a=r.value;e(a)?i.add(a):o.add(a)}return Oe(o,i)}}function QO(e){var t=Kn(e);return function(n,r){if(r===void 0){var i=QO(e);return function(a){return i(n,a)}}if(ah(n))return r;if(ah(r))return n;var o=new Set(n);return r.forEach(function(a){t(a,o)||o.add(a)}),o}}function ew(e){var t=Kn(e);return function(n,r){if(r===void 0){var i=ew(e);return function(a){return i(a,n)}}if(ah(n)||ah(r))return new Set;var o=new Set;return n.forEach(function(a){t(a,r)&&o.add(a)}),o}}function ipe(e,t){return function(n){return function(r){for(var i=r.values(),o,a=new Set,u=new Set,s=Kn(e),c=Kn(t);!(o=i.next()).done;){var l=n(o.value);switch(l._tag){case"Left":s(l.left,a)||a.add(l.left);break;case"Right":c(l.right,u)||u.add(l.right);break}}return Oe(a,u)}}}function tw(e){var t=Kn(e);return function(n,r){if(r===void 0){var i=tw(e);return function(o){return i(o,n)}}return XO(function(o){return!t(o,r)})(n)}}var KU=function(e){return{concat:QO(e)}},ope=function(e){return{concat:KU(e).concat,empty:new Set}},ape=function(e){return{concat:ew(e)}},upe=function(e){return{concat:tw(e)}},spe=aU,cpe=uU,lpe=sU,fpe=function(e){return new Set([e])};function VU(e){var t=Kn(e);return function(n){return function(r){if(t(n)(r))return r;var i=new Set(r);return i.add(n),i}}}var HU=function(e){return function(t){return function(n){return XO(function(r){return!e.equals(t,r)})(n)}}},dpe=function(e){var t=Kn(e),n=HU(e),r=VU(e);return function(i){return function(o){return(t(i,o)?n:r)(i)(o)}}},JU=function(e){return function(t){for(var n=t.length,r=new Set,i=Kn(e),o=0;o<n;o++){var a=t[o];i(a,r)||r.add(a)}return r}},ppe=function(e){return GU(e)(B)};function hpe(e,t){return function(n){var r=Kn(e),i=Kn(t),o=new Set,a=new Set;return n.forEach(function(u){switch(u._tag){case"Left":r(u.left,o)||o.add(u.left);break;case"Right":i(u.right,a)||a.add(u.right);break}}),Oe(o,a)}}function GU(e){var t=Kn(e);return function(n){return function(r){var i=new Set;return r.forEach(function(o){var a=n(o);a._tag==="Some"&&!t(a.value,i)&&i.add(a.value)}),i}}}var mpe=new Set,ah=function(e){return e.size===0},vpe=function(e){return e.size},gpe=AO,YU=kO,ype=Jp,Kn=an,ZU=function(e){return function(t){var n=[];return t.forEach(function(r){return n.push(r)}),n.sort(e.compare)}},bpe=Jp;const $pe=Object.freeze(Object.defineProperty({__proto__:null,getShow:Qde,getEq:epe,map:tpe,chain:npe,filter:XO,partition:rpe,union:QO,intersection:ew,partitionMap:ipe,difference:tw,getUnionSemigroup:KU,getUnionMonoid:ope,getIntersectionSemigroup:ape,getDifferenceMagma:upe,reduce:spe,foldMap:cpe,reduceRight:lpe,singleton:fpe,insert:VU,remove:HU,toggle:dpe,fromArray:JU,compact:ppe,separate:hpe,filterMap:GU,empty:mpe,isEmpty:ah,size:vpe,some:gpe,every:YU,isSubset:ype,elem:Kn,toArray:ZU,subset:bpe},Symbol.toStringTag,{value:"Module"}));var XU=function(e){return{show:function(t){var n="{";for(var r in e)ot.call(e,r)&&(n+=" ".concat(r,": ").concat(e[r].show(t[r]),","));return n.length>1&&(n=n.slice(0,-1)+" "),n+="}",n}}},QU=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return{show:function(n){return"[".concat(n.map(function(r,i){return e[i].show(r)}).join(", "),"]")}}},_pe=QU,Spe=XU,Tpe={show:function(e){return JSON.stringify(e)}},Ipe={show:function(e){return JSON.stringify(e)}},Ope={show:function(e){return JSON.stringify(e)}};const wpe=Object.freeze(Object.defineProperty({__proto__:null,struct:XU,tuple:QU,getTupleShow:_pe,getStructShow:Spe,showBoolean:Tpe,showString:Ipe,showNumber:Ope},Symbol.toStringTag,{value:"Module"}));function nw(e){return function(t){return function(n){return e.of([t,n])}}}function rw(e){return function(t){return function(n){return function(r){return e.map(n(r),function(i){var o=i[0],a=i[1];return[t(o),a]})}}}}function iw(e){return function(t){return function(n){return function(r){return e.chain(n(r),function(i){var o=i[0],a=i[1];return e.map(t(a),function(u){var s=u[0],c=u[1];return[o(s),c]})})}}}}function ow(e){return function(t){return function(n){return function(r){return e.chain(n(r),function(i){var o=i[0],a=i[1];return t(o)(a)})}}}}function aw(e){return function(t){return function(n){return e.of(t(n))}}}function uw(e){return function(t){return function(n){return e.map(t,function(r){return[r,n]})}}}function sw(e){return function(t){return function(n){return e.map(n(t),function(r){var i=r[0];return i})}}}function cw(e){return function(t){return function(n){return e.map(n(t),yn)}}}function Epe(e){var t=iw(e),n=rw(e),r=ow(e),i=sw(e),o=cw(e);return{map:function(a,u){return m(a,n(u))},ap:function(a,u){return m(a,t(u))},of:nw(e),chain:function(a,u){return m(a,r(u))},get:function(){return function(a){return e.of([a,a])}},put:function(a){return function(){return e.of([void 0,a])}},modify:function(a){return function(u){return e.of([void 0,a(u)])}},gets:function(a){return function(u){return e.of([a(u),u])}},fromState:aw(e),fromM:uw(e),evalState:function(a,u){return m(a,i(u))},execState:function(a,u){return m(a,o(u))}}}const Rpe=Object.freeze(Object.defineProperty({__proto__:null,of:nw,map:rw,ap:iw,chain:ow,fromState:aw,fromF:uw,evaluate:sw,execute:cw,getStateM:Epe},Symbol.toStringTag,{value:"Module"}));var lw=function(e){return function(){return Ag(e)}},fw=nw(fO);function eB(e){return _i(XI(e))}function Mpe(e){return _i(ej(e))}function tB(e){return _i(QI(e))}function xpe(e){return _i(tj(e))}function nB(e){return _i(eO(e))}function Cpe(e){return _i(rj(e))}var Ape=function(e){return H(e,ZI)},kpe=function(e){return function(t){return Ag(e(t)[0])}},rB=Ka(function(e){return lw(e)},fw),iB=tB,zs=nB,uh=eB,oB=aw(fO),aB=function(e){return _i(lu(e))},uB=function(e){return _i(tO(e))},Wpe=function(e){return _i(nO(e))},_i=uw(As),Npe=function(e){return function(t){return H(t,up(e))}},sB=function(e){return function(t){return function(n){return e(n)(t)(n)}}},Ppe=sB,cB=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return uB(e.apply(void 0,t))}},lB=function(e){return function(t){return m(t,sh(cB(e)))}},Fpe=lB,fB=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return aB(e.apply(void 0,t))}},dB=function(e){return function(t){return m(t,sh(fB(e)))}},Dpe=dB,pB=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return _i(e.apply(void 0,t))}},hB=function(e){return function(t){return m(t,sh(pB(e)))}},Lpe=hB,Si=function(e,t){return m(e,mB(t))},ra=function(e,t){return m(e,pw(t))},qs=function(e,t){return m(e,hw(t))},dw=function(e,t){return function(n){return m(e(n),Pg(function(){return t()(n)}))}},iy=function(e,t,n){return function(r){return m(e(r),sO(t,function(i){var o=i[0],a=i[1];return[n(o),a]}))}},oy=function(e,t){return function(n){return m(e(n),cO(t))}},mB=rw(As),jpe=function(e,t){return function(n){return iy(n,e,t)}},Upe=function(e){return function(t){return oy(t,e)}},pw=iw(Rn),Bpe=pw,no=fw,hw=ow(Rn),sh=hw,vB=sh(B),zpe=vB,gB=function(e){return function(t){return function(n){return m(t(n),bj(function(){return e()(n)}))}}},qpe=gB,ay=lw,Nt="StateReaderTaskEither",mw={URI:Nt,map:Si},Kpe=De(mw),Vpe={URI:Nt,of:no},uy={URI:Nt,map:Si,ap:ra},yB=_t(uy),Hpe=yB,bB=St(uy),Jpe=bB,Gpe={URI:Nt,map:Si,ap:ra,of:no},Vn={URI:Nt,map:Si,ap:ra,chain:qs},Ks={URI:Nt,fromState:oB},Ype=pP(Ks),Zpe=hP(Ks),Xpe=mP(Ks),Qpe=vP(Ks),ehe=aT(Ks),the=gP(Ks,Vn),nhe={URI:Nt,map:Si,ap:ra,of:no,chain:qs},rhe={URI:Nt,map:Si,ap:ra,of:no,chain:qs,fromIO:zs},ihe={URI:Nt,map:Si,ap:ra,of:no,chain:qs,fromIO:zs,fromTask:uh},ohe={URI:Nt,map:Si,ap:ra,of:no,chain:qs,throwError:ay},$B=at(Vn),ahe=$B,uhe={URI:Nt,bimap:iy,mapLeft:oy},she={URI:Nt,map:Si,alt:dw},hf={URI:Nt,fromReader:iB},che=lp(hf),lhe=fp(hf),fhe=Ss(hf),_B=dp(hf,Vn),dhe=_B,SB=pp(hf,Vn),phe=SB,ia={URI:Nt,fromEither:rB},hhe=Di(ia),mhe=Li(ia),vhe=es(ia,Vn),TB=Io(ia,Vn),ghe=TB,IB=Oo(ia,Vn),yhe=IB,bhe=Ba(ia),OB=ts(ia,Vn),$he=OB,_he=ar(ia),sy={URI:Nt,fromIO:zs},She=Hi(sy),The=No(sy,Vn),Ihe=Po(sy,Vn),cy={URI:Nt,fromIO:zs,fromTask:uh},Ohe=Ts(cy),whe=kl(cy,Vn),Ehe=Wl(cy,Vn),Rhe=sw(As),Mhe=cw(As),xhe=It(mw),wB=Ot(Vn),Che=wB,EB=Tt(uy),Ahe=EB,RB=function(e){return function(t){return function(n){return function(r){return function(){return Lc(t).reduce(function(i,o,a){return i.then(function(u){return Lt(u)?i:e(a+1,o)(u.right[1])(r)().then(function(s){if(Lt(s))return s;var c=s.right,l=c[0],f=c[1];return u.right[0].push(l),u.right[1]=f,u})})},e(0,or(t))(n)(r)().then(is(function(i){var o=i[0],a=i[1];return[[o],a]})))}}}}},vw=function(e){var t=RB(e);return function(n){return ft(n)?t(n):no(Yt)}},khe=vw,MB=function(e){return vw(function(t,n){return e(n)})},Whe=MB(B),Nhe={URI:Nt,map:Si,of:no,ap:ra,chain:qs,bimap:iy,mapLeft:oy,alt:dw,fromIO:zs,fromTask:uh,throwError:ay},Phe={URI:Nt,map:Si,of:no,ap:ra,chain:qs,bimap:iy,mapLeft:oy,alt:dw,fromIO:zs,fromTask:uh,throwError:ay},Fhe=function(e,t){return m(e(t),Fp(function(n){var r=n[0];return r}))},Dhe=function(e,t){return m(e(t),Fp(function(n){n[0];var r=n[1];return r}))};function Lhe(e,t,n){return e(t)(n)()}const jhe=Object.freeze(Object.defineProperty({__proto__:null,left:lw,right:fw,rightTask:eB,leftTask:Mpe,rightReader:tB,leftReader:xpe,rightIO:nB,leftIO:Cpe,rightState:Ape,leftState:kpe,fromEither:rB,fromReader:iB,fromIO:zs,fromTask:uh,fromState:oB,fromTaskEither:aB,fromIOEither:uB,fromReaderEither:Wpe,fromReaderTaskEither:_i,local:Npe,asksStateReaderTaskEitherW:sB,asksStateReaderTaskEither:Ppe,fromIOEitherK:cB,chainIOEitherKW:lB,chainIOEitherK:Fpe,fromTaskEitherK:fB,chainTaskEitherKW:dB,chainTaskEitherK:Dpe,fromReaderTaskEitherK:pB,chainReaderTaskEitherKW:hB,chainReaderTaskEitherK:Lpe,map:mB,bimap:jpe,mapLeft:Upe,ap:pw,apW:Bpe,of:no,chain:hw,chainW:sh,flattenW:vB,flatten:zpe,altW:gB,alt:qpe,throwError:ay,URI:Nt,Functor:mw,flap:Kpe,Pointed:Vpe,Apply:uy,apFirst:yB,apFirstW:Hpe,apSecond:bB,apSecondW:Jpe,Applicative:Gpe,Chain:Vn,FromState:Ks,get:Ype,put:Zpe,modify:Xpe,gets:Qpe,fromStateK:ehe,chainStateK:the,Monad:nhe,MonadIO:rhe,MonadTask:ihe,MonadThrow:ohe,chainFirst:$B,chainFirstW:ahe,Bifunctor:uhe,Alt:she,FromReader:hf,ask:che,asks:lhe,fromReaderK:fhe,chainReaderK:_B,chainReaderKW:dhe,chainFirstReaderK:SB,chainFirstReaderKW:phe,FromEither:ia,fromOption:hhe,fromOptionK:mhe,chainOptionK:vhe,chainEitherK:TB,chainEitherKW:ghe,chainFirstEitherK:IB,chainFirstEitherKW:yhe,fromPredicate:bhe,filterOrElse:OB,filterOrElseW:$he,fromEitherK:_he,FromIO:sy,fromIOK:She,chainIOK:The,chainFirstIOK:Ihe,FromTask:cy,fromTaskK:Ohe,chainTaskK:whe,chainFirstTaskK:Ehe,evaluate:Rhe,execute:Mhe,bindTo:xhe,bind:wB,bindW:Che,apS:EB,apSW:Ahe,traverseReadonlyNonEmptyArrayWithIndex:RB,traverseReadonlyArrayWithIndex:vw,traverseArrayWithIndex:khe,traverseArray:MB,sequenceArray:Whe,stateReaderTaskEither:Nhe,stateReaderTaskEitherSeq:Phe,evalState:Fhe,execState:Dhe,run:Lhe},Symbol.toStringTag,{value:"Module"}));function Uhe(e){return function(t){return{peek:t.peek,pos:e}}}function Bhe(e){return function(t){return{peek:t.peek,pos:e(t.pos)}}}function zhe(e){return function(t){return t.peek(e(t.pos))}}function qhe(e){return function(t){return function(n){return e.map(t(n.pos),function(r){return n.peek(r)})}}}var xB=function(e,t){return m(e,AB(t))},Khe=function(e,t){return m(e,gw(t))},gw=function(e){return function(t){return{peek:function(n){return e({peek:t.peek,pos:n})},pos:t.pos}}},CB=function(e){return e.peek(e.pos)},Vhe=gw(B),AB=function(e){return function(t){return{peek:function(n){return e(t.peek(n))},pos:t.pos}}},yw="Store",kB={URI:yw,map:xB},Hhe=De(kB),WB={URI:yw,map:xB,extend:Khe,extract:CB},Jhe=WB;const Ghe=Object.freeze(Object.defineProperty({__proto__:null,seek:Uhe,seeks:Bhe,peeks:zhe,experiment:qhe,extend:gw,extract:CB,duplicate:Vhe,map:AB,URI:yw,Functor:kB,flap:Hhe,Comonad:WB,store:Jhe},Symbol.toStringTag,{value:"Module"}));function bw(e,t){return function(n,r){return t.compose(e.second(r),e.first(n))}}function NB(e,t){var n=bw(e,t);return function(r,i){return t.compose(n(r,i),e.promap(t.id(),B,function(o){return[o,o]}))}}function Yhe(e){return bw(e,e)}function Zhe(e){return NB(e,e)}const Xhe=Object.freeze(Object.defineProperty({__proto__:null,split:bw,fanOut:NB,splitStrong:Yhe,fanout:Zhe},Symbol.toStringTag,{value:"Module"}));var Qhe=function(){return{concat:function(e,t){return Object.assign({},e,t)}}},eme=function(e){return function(t){var n={};for(var r in t)ot.call(t,r)&&(n[r]=e[r](t[r]));return n}};const tme=Object.freeze(Object.defineProperty({__proto__:null,getAssignSemigroup:Qhe,evolve:eme},Symbol.toStringTag,{value:"Module"}));var nme=globalThis&&globalThis.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function u(l){try{c(r.next(l))}catch(f){a(f)}}function s(l){try{c(r.throw(l))}catch(f){a(f)}}function c(l){l.done?o(l.value):i(l.value).then(u,s)}c((r=r.apply(e,t||[])).next())})},rme=globalThis&&globalThis.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(c){return function(l){return s([c,l])}}function s(c){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1],o=c;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(c);break}o[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(l){c=[6,l],i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},PB=yp(en),ime=kT(en),ome=vn,FB=WT(en),ch=function(e){return ly(wn(e))},ly=Jv(Pe),ame=au($l),DB=NT(Pe),ume=DB,$w=Xv(Yl),sme=$w,LB=$w,cme=LB,jB=Qv(zt),lme=jB,fme=Gv(en),UB=function(e){return function(){return nme(void 0,void 0,void 0,function(){return rme(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,e().then(le)];case 1:return[2,t.sent()];case 2:return t.sent(),[2,me];case 3:return[2]}})})}},dme=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return UB(function(){return e.apply(void 0,t)})}},pme=Yv(en),hme=CT(zt),mme=Zv(en),vme=AT(zt),_w=eg(Pe),BB=tg(Ms),ro=PB,fy=Ll(zt),gme=fy(B),Sw=ng(zt),yme=Sw,dy=bp(en),bme=dy(),Tw=Vi(Pe,hs),Iw=Ao(Pe,hs,vl),zB=ko(Pe,xo),qB=Wo(Pe,xo),KB=tu(Pe,xo),VB=nu(Pe,xo),jr=function(e,t){return m(e,_w(t))},Vs=function(e,t){return m(e,BB(t))},py=function(e,t){return m(e,fy(t))},HB=function(e,t){return m(e,Sw(t))},$me=function(e,t){return m(e,zB(t))},_me=function(e,t){return m(e,qB(t))},Sme=function(e,t){return m(e,KB(t))},Tme=function(e,t){return m(e,VB(t))},Kt="TaskOption",Ow={URI:Kt,map:jr},Ime=De(Ow),JB={URI:Kt,of:ro},hy={URI:Kt,map:jr,ap:Vs},Ome=_t(hy),wme=St(hy),Eme={URI:Kt,map:jr,ap:Vs,of:ro},GB=function(e,t){return m(e,fy(function(n){return m(t,_w(n))}))},Rme={URI:Kt,map:jr,ap:GB},Mme={URI:Kt,map:jr,ap:GB,of:ro},oa={URI:Kt,map:jr,ap:Vs,chain:py},xme=at(oa),Cme={URI:Kt,map:jr,alt:HB},YB={URI:Kt,zero:dy},Ame=rl(YB,JB),kme={URI:Kt,map:jr,ap:Vs,of:ro,alt:HB,zero:dy},Wme={URI:Kt,map:jr,ap:Vs,of:ro,chain:py},Nme={URI:Kt,map:jr,ap:Vs,of:ro,chain:py,fromIO:ch},Pme={URI:Kt,map:jr,ap:Vs,of:ro,chain:py,fromIO:ch,fromTask:ly},Fme={URI:Kt,compact:Tw,separate:Iw},Dme={URI:Kt,map:jr,compact:Tw,separate:Iw,filter:$me,filterMap:_me,partition:Sme,partitionMap:Tme},my={URI:Kt,fromIO:ch},Lme=Hi(my),jme=No(my,oa),Ume=Po(my,oa),vy={URI:Kt,fromEither:FB},Bme=ar(vy),zme=Io(vy,oa),qme=Oo(vy,oa),gy={URI:Kt,fromIO:ch,fromTask:ly},Kme=Ts(gy),Vme=kl(gy,oa),Hme=Wl(gy,oa),Jme=ro(jt),Gme=It(Ow),Yme=Ot(oa),Zme=Tt(hy),ww=ro(Yt),ZB=function(e){return H(Zl(e),au(Wv(Dn)))},Ew=function(e){var t=ZB(e);return function(n){return ft(n)?t(n):ww}},XB=function(e){return function(t){return function(){return Lc(t).reduce(function(n,r,i){return n.then(function(o){return xt(o)?n:e(i+1,r)().then(function(a){return xt(a)?a:(o.value.push(a.value),o)})})},e(0,or(t))().then(qi(hd)))}}},Rw=function(e){var t=XB(e);return function(n){return ft(n)?t(n):ww}},Xme=Ew,QB=function(e){return Ew(function(t,n){return e(n)})},Qme=QB(B),eve=Rw,ez=function(e){return Rw(function(t,n){return e(n)})},tve=ez(B);const nve=Object.freeze(Object.defineProperty({__proto__:null,some:PB,fromPredicate:ime,fromOption:ome,fromEither:FB,fromIO:ch,fromTask:ly,fromTaskEither:ame,match:DB,matchW:ume,matchE:$w,fold:sme,matchEW:LB,foldW:cme,getOrElse:jB,getOrElseW:lme,fromNullable:fme,tryCatch:UB,tryCatchK:dme,fromNullableK:pme,chainNullableK:hme,fromOptionK:mme,chainOptionK:vme,map:_w,ap:BB,of:ro,chain:fy,flatten:gme,alt:Sw,altW:yme,zero:dy,none:bme,compact:Tw,separate:Iw,filter:zB,filterMap:qB,partition:KB,partitionMap:VB,Functor:Ow,flap:Ime,Pointed:JB,ApplyPar:hy,apFirst:Ome,apSecond:wme,ApplicativePar:Eme,ApplySeq:Rme,ApplicativeSeq:Mme,Chain:oa,chainFirst:xme,Alt:Cme,Zero:YB,guard:Ame,Alternative:kme,Monad:Wme,MonadIO:Nme,MonadTask:Pme,Compactable:Fme,Filterable:Dme,FromIO:my,fromIOK:Lme,chainIOK:jme,chainFirstIOK:Ume,FromEither:vy,fromEitherK:Bme,chainEitherK:zme,chainFirstEitherK:qme,FromTask:gy,fromTaskK:Kme,chainTaskK:Vme,chainFirstTaskK:Hme,Do:Jme,bindTo:Gme,bind:Yme,apS:Zme,ApT:ww,traverseReadonlyNonEmptyArrayWithIndex:ZB,traverseReadonlyArrayWithIndex:Ew,traverseReadonlyNonEmptyArrayWithIndexSeq:XB,traverseReadonlyArrayWithIndexSeq:Rw,traverseArrayWithIndex:Xme,traverseArray:QB,sequenceArray:Qme,traverseSeqArrayWithIndex:eve,traverseSeqArray:ez,sequenceSeqArray:tve},Symbol.toStringTag,{value:"Module"}));var qe=function(e){return e._tag==="Left"},Et=function(e){return e._tag==="Right"};function Hs(e){return e._tag==="Both"}function sn(e){return{_tag:"Left",left:e}}function Hn(e){return{_tag:"Right",right:e}}function Xe(e,t){return{_tag:"Both",left:e,right:t}}var Mw=function(e,t,n){return function(r){switch(r._tag){case"Left":return e(r.left);case"Right":return t(r.right);case"Both":return n(r.left,r.right)}}},rve=Mw,vu=Mw,ive=vu,tz=vu(Hn,sn,function(e,t){return Xe(t,e)});function ove(e,t){return{show:vu(function(n){return"left(".concat(e.show(n),")")},function(n){return"right(".concat(t.show(n),")")},function(n,r){return"both(".concat(e.show(n),", ").concat(t.show(r),")")})}}function ave(e,t){return kr(function(n,r){return qe(n)?qe(r)&&e.equals(n.left,r.left):Et(n)?Et(r)&&t.equals(n.right,r.right):Hs(r)&&e.equals(n.left,r.left)&&t.equals(n.right,r.right)})}function nz(e,t){return{concat:function(n,r){return qe(n)?qe(r)?sn(e.concat(n.left,r.left)):Et(r)?Xe(n.left,r.right):Xe(e.concat(n.left,r.left),r.right):Et(n)?qe(r)?Xe(r.left,n.right):Et(r)?Hn(t.concat(n.right,r.right)):Xe(r.left,t.concat(n.right,r.right)):qe(r)?Xe(e.concat(n.left,r.left),n.right):Et(r)?Xe(n.left,t.concat(n.right,r.right)):Xe(e.concat(n.left,r.left),t.concat(n.right,r.right))}}}var yy=function(e){return{URI:mr,_E:void 0,map:Js,ap:function(t,n){return qe(t)?qe(n)?sn(e.concat(t.left,n.left)):Et(n)?sn(t.left):sn(e.concat(t.left,n.left)):Et(t)?qe(n)?sn(n.left):Et(n)?Hn(t.right(n.right)):Xe(n.left,t.right(n.right)):qe(n)?sn(e.concat(t.left,n.left)):Et(n)?Xe(t.left,t.right(n.right)):Xe(e.concat(t.left,n.left),t.right(n.right))}}};function uve(e){var t=yy(e);return{URI:mr,_E:void 0,map:Js,ap:t.ap,of:lh}}function rz(e){var t=yy(e),n=function(r,i){if(qe(r))return r;if(Et(r))return i(r.right);var o=i(r.right);return qe(o)?sn(e.concat(r.left,o.left)):Et(o)?Xe(r.left,o.right):Xe(e.concat(r.left,o.left),o.right)};return{URI:mr,_E:void 0,map:Js,ap:t.ap,chain:n}}function sve(e){var t=rz(e);return{URI:mr,_E:void 0,map:Js,of:lh,ap:t.ap,chain:t.chain,throwError:sn}}function cve(e){return qe(e)?le(e.left):Et(e)?me:le(e.left)}function lve(e){return qe(e)?me:(Et(e),le(e.right))}function fve(e){return function(t){return xt(t)?sn(e):Xe(e,t.value)}}function dve(e){return function(t){return xt(t)?Hn(e):Xe(t.value,e)}}function pve(e){return qe(e)?le(e.left):me}function hve(e){return Et(e)?le(e.right):me}var mve=function(e,t){return xt(e)?xt(t)?me:le(Hn(t.value)):xt(t)?le(sn(e.value)):le(Xe(e.value,t.value))},Js=function(e,t){return m(e,Nw(t))},iz=function(e,t,n){return m(e,kw(t,n))},oz=function(e,t){return m(e,Ww(t))},xw=function(e,t,n){return m(e,uz(t,n))},Cw=function(e){var t=sz(e);return function(n,r){return m(n,t(r))}},Aw=function(e,t,n){return m(e,cz(t,n))},az=function(e){var t=lz(e);return function(n,r){return m(n,t(r))}},kw=function(e,t){return function(n){return qe(n)?sn(e(n.left)):Et(n)?Hn(t(n.right)):Xe(e(n.left),t(n.right))}},Ww=function(e){return function(t){return qe(t)?sn(e(t.left)):Hs(t)?Xe(e(t.left),t.right):t}},Nw=function(e){return function(t){return qe(t)?t:Et(t)?Hn(e(t.right)):Xe(t.left,e(t.right))}},uz=function(e,t){return function(n){return qe(n)?e:t(e,n.right)}},sz=function(e){return function(t){return function(n){return qe(n)?e.empty:t(n.right)}}},cz=function(e,t){return function(n){return qe(n)?e:t(n.right,e)}},lz=function(e){return function(t){return function(n){return qe(n)?e.of(n):Et(n)?e.map(t(n.right),Hn):e.map(t(n.right),function(r){return Xe(n.left,r)})}}},Pw=function(e){return function(t){return qe(t)?e.of(t):Et(t)?e.map(t.right,Hn):e.map(t.right,function(n){return Xe(t.left,n)})}},lh=Hn,mr="These",Fw={URI:mr,map:Js},vve=De(Fw),gve={URI:mr,of:lh},yve={URI:mr,bimap:iz,mapLeft:oz},bve={URI:mr,fromThese:B},$ve={URI:mr,reduce:xw,foldMap:Cw,reduceRight:Aw},_ve={URI:mr,map:Js,reduce:xw,foldMap:Cw,reduceRight:Aw,traverse:az,sequence:Pw},Dw={URI:mr,fromEither:B},Sve=Di(Dw),Tve=Li(Dw),Ive=function(e){return function(t){return function(n){return qe(n)?!1:e.equals(t,n.right)}}},Ove=function(e){return function(t){return qe(t)?!1:e(t.right)}},Lw=function(e,t){return function(n){return qe(n)?[n.left,t()]:Et(n)?[e(),n.right]:[n.left,n.right]}},wve=function(e,t){return Lw(function(){return e},function(){return t})},fz=lh(Yt),jw=function(e){return function(t){return function(n){var r=me,i=t(0,or(n));if(qe(i))return i;Hs(i)&&(r=le(i.left));for(var o=[i.right],a=1;a<n.length;a++){var u=t(a,n[a]);if(qe(u))return u;Hs(u)&&(r=xt(r)?le(u.left):le(e.concat(r.value,u.left))),o.push(u.right)}return xt(r)?Hn(o):Xe(r.value,o)}}},Eve=function(e){return function(t){var n=jw(e)(t);return function(r){return ft(r)?n(r):fz}}},Rve={URI:mr,map:Js,bimap:iz,mapLeft:oz,reduce:xw,foldMap:Cw,reduceRight:Aw,traverse:az,sequence:Pw};const Mve=Object.freeze(Object.defineProperty({__proto__:null,isLeft:qe,isRight:Et,isBoth:Hs,left:sn,right:Hn,both:Xe,matchW:Mw,foldW:rve,match:vu,fold:ive,swap:tz,getShow:ove,getEq:ave,getSemigroup:nz,getApply:yy,getApplicative:uve,getChain:rz,getMonad:sve,getLeft:cve,getRight:lve,leftOrBoth:fve,rightOrBoth:dve,getLeftOnly:pve,getRightOnly:hve,fromOptions:mve,bimap:kw,mapLeft:Ww,map:Nw,reduce:uz,foldMap:sz,reduceRight:cz,traverse:lz,sequence:Pw,of:lh,URI:mr,Functor:Fw,flap:vve,Pointed:gve,Bifunctor:yve,FromThese:bve,Foldable:$ve,Traversable:_ve,FromEither:Dw,fromOption:Sve,fromOptionK:Tve,elem:Ive,exists:Ove,toTuple2:Lw,toTuple:wve,ApT:fz,traverseReadonlyNonEmptyArrayWithIndex:jw,traverseReadonlyArrayWithIndex:Eve,these:Rve},Symbol.toStringTag,{value:"Module"}));function by(e){return H(Hn,e.of)}function $y(e){return H(sn,e.of)}function Uw(e){return H(Xe,e.of)}function Bw(e){return function(t){return e.map(t,Hn)}}function zw(e){return function(t){return e.map(t,sn)}}function qw(e){return jc(e,Fw)}function Kw(e,t){return To(e,yy(t))}function Vw(e,t){var n=$y(e);return function(r){return function(i){return e.chain(i,vu(n,r,function(o,a){return e.map(r(a),vu(function(u){return sn(t.concat(o,u))},function(u){return Xe(o,u)},function(u,s){return Xe(t.concat(o,u),s)}))}))}}}function Hw(e){return function(t,n){return function(r){return e.map(r,kw(t,n))}}}function Jw(e){return function(t){return function(n){return e.map(n,Ww(t))}}}function dz(e){return function(t,n,r){return function(i){return e.map(i,vu(t,n,r))}}}function Gw(e){return function(t,n,r){return function(i){return e.chain(i,vu(t,n,r))}}}function Yw(e){return function(t){return e.map(t,tz)}}function Zw(e){return function(t,n){return function(r){return e.map(r,Lw(t,n))}}}function xve(e){var t=qw(e),n=Hw(e),r=Jw(e),i=Gw(e),o=Zw(e),a=by(e),u=function(s,c){return m(s,t(c))};return{map:u,bimap:function(s,c,l){return m(s,n(c,l))},mapLeft:function(s,c){return m(s,r(c))},fold:function(s,c,l,f){return m(s,i(c,l,f))},swap:Yw(e),rightM:Bw(e),leftM:zw(e),left:$y(e),right:by(e),both:Uw(e),toTuple:function(s,c,l){return m(s,o(function(){return c},function(){return l}))},getMonad:function(s){var c=Kw(e,s),l=Vw(e,s);return{_E:void 0,map:u,of:a,ap:function(f,d){return m(f,c(d))},chain:function(f,d){return m(f,l(d))}}}}}const Cve=Object.freeze(Object.defineProperty({__proto__:null,right:by,left:$y,both:Uw,rightF:Bw,leftF:zw,map:qw,ap:Kw,chain:Vw,bimap:Hw,mapLeft:Jw,match:dz,matchE:Gw,swap:Yw,toTuple2:Zw,getTheseM:xve},Symbol.toStringTag,{value:"Module"}));var Ave=$y(en),pz=by(en),kve=Uw(en),Xw=Bw(Pe),hz=zw(Pe),mz=H(wn,Xw),Wve=H(wn,hz),vz=vn,gz=vn,_y=mz,Nve=wn,Qw=Xw,yz=dz(Pe),Pve=yz,bz=Gw(zt),$z=bz,_z=$z,Fve=_z,Dve=Yw(Pe),Gs=function(e,t){return m(e,Sz(t))},e1=function(e,t,n){return m(e,Tz(t,n))},t1=function(e,t){return m(e,Iz(t))},Sz=qw(Pe),Tz=Hw(Pe),Iz=Jw(Pe),fh=pz,Mn="TaskThese",n1=function(e,t){var n=Kw(e,t);return{URI:Mn,_E:void 0,map:Gs,ap:function(r,i){return m(r,n(i))}}};function Oz(e,t){var n=n1(e,t).ap;return{URI:Mn,_E:void 0,map:Gs,ap:n,of:fh}}function wz(e){var t=n1(xp,e),n=Vw(zt,e);return{URI:Mn,_E:void 0,map:Gs,ap:t.ap,chain:function(r,i){return m(r,n(i))}}}function Lve(e){var t=Oz(xp,e),n=wz(e);return{URI:Mn,_E:void 0,map:Gs,ap:t.ap,of:fh,chain:n.chain,fromIO:_y,fromTask:Qw}}var Ez={URI:Mn,map:Gs},jve=De(Ez),Uve={URI:Mn,of:fh},Bve={URI:Mn,bimap:e1,mapLeft:t1},Sy={URI:Mn,fromEither:vz},zve=Di(Sy),qve=Li(Sy),Kve=Ba(Sy),Rz={URI:Mn,fromThese:gz},Vve=yP(Rz),Mz={URI:Mn,fromIO:_y},Hve=Hi(Mz),xz={URI:Mn,fromIO:_y,fromTask:Qw},Jve=Ts(xz),Cz=Zw(Pe),r1=fh(Yt),Az=function(e){var t=jw(e);return function(n){return H(Zl(n),au(t(Dn)))}},Gve=function(e){return function(t){var n=Az(e)(t);return function(r){return ft(r)?n(r):r1}}},kz=function(e){return function(t){return function(n){return function(){return Lc(n).reduce(function(r,i,o){return r.then(function(a){return qe(a)?r:t(o+1,i)().then(function(u){if(qe(u))return u;if(Hs(u)){var s=a.right;return s.push(u.right),Hs(a)?Xe(e.concat(a.left,u.left),s):Xe(u.left,s)}return a.right.push(u.right),a})})},t(0,or(n))().then(Nw(hd)))}}}},Yve=function(e){return function(t){var n=kz(e)(t);return function(r){return ft(r)?n(r):r1}}},Zve={URI:Mn,map:Gs},Xve={URI:Mn,bimap:e1,mapLeft:t1},Qve=function(e,t){return Cz(function(){return e},function(){return t})},ege={URI:Mn,map:Gs,bimap:e1,mapLeft:t1},tge=function(e,t){return Ut($g)(nz(e,t))};const nge=Object.freeze(Object.defineProperty({__proto__:null,left:Ave,right:pz,both:kve,rightTask:Xw,leftTask:hz,rightIO:mz,leftIO:Wve,fromEither:vz,fromThese:gz,fromIO:_y,fromIOEither:Nve,fromTask:Qw,match:yz,matchW:Pve,matchE:bz,fold:$z,matchEW:_z,foldW:Fve,swap:Dve,map:Sz,bimap:Tz,mapLeft:Iz,of:fh,URI:Mn,getApply:n1,getApplicative:Oz,getChain:wz,getMonad:Lve,Functor:Ez,flap:jve,Pointed:Uve,Bifunctor:Bve,FromEither:Sy,fromOption:zve,fromOptionK:qve,fromPredicate:Kve,FromThese:Rz,fromTheseK:Vve,FromIO:Mz,fromIOK:Hve,FromTask:xz,fromTaskK:Jve,toTuple2:Cz,ApT:r1,traverseReadonlyNonEmptyArrayWithIndex:Az,traverseReadonlyArrayWithIndex:Gve,traverseReadonlyNonEmptyArrayWithIndexSeq:kz,traverseReadonlyArrayWithIndexSeq:Yve,functorTaskThese:Zve,bifunctorTaskThese:Xve,toTuple:Qve,taskThese:ege,getSemigroup:tge},Symbol.toStringTag,{value:"Module"}));function rge(e,t){return function(n){return n(t(n(e.empty)))}}function ige(e){return function(t){return[e(t),t]}}function oge(e){return function(t){return function(n){return[t(n),e(n)]}}}function age(e){return function(t){return function(n){return t(e(n))}}}function uge(e){function t(r,i){return function(o){return i(function(a){return r(e.concat(o,a))})}}function n(r){return r(e.empty)}return{URI:i1,_E:void 0,map:Wz,extend:t,extract:n}}var Wz=function(e,t){return m(e,Nz(t))},Nz=function(e){return function(t){return function(n){return e(t(n))}}},i1="Traced",o1={URI:i1,map:Wz},sge=De(o1),cge=o1;const lge=Object.freeze(Object.defineProperty({__proto__:null,tracks:rge,listen:ige,listens:oge,censor:age,getComonad:uge,map:Nz,URI:i1,Functor:o1,flap:sge,traced:cge},Symbol.toStringTag,{value:"Module"}));function Pz(e,t){return function(n){var r=e.traverse(n),i=t.traverse(n);return function(o){return function(a){return r(a,function(u){return i(u,o)})}}}}function Fz(e,t){return function(n){var r=e.sequence(n),i=t.sequence(n);return function(o){return r(e.map(o,i))}}}function fge(e,t){var n=Uc(e,t).map,r=K0(e,t),i=Pz(e,t),o=Fz(e,t);return{map:n,reduce:r.reduce,foldMap:r.foldMap,reduceRight:r.reduceRight,traverse:function(a){var u=i(a);return function(s,c){return m(s,u(c))}},sequence:function(a){var u=o(a);return function(s){return m(s,u)}}}}const dge=Object.freeze(Object.defineProperty({__proto__:null,traverse:Pz,sequence:Fz,getTraversableComposition:fge},Symbol.toStringTag,{value:"Module"})),pge=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function Dz(e,t){return t===void 0&&(t=[]),{value:e,forest:t}}function hge(e){var t=function(n){return Za(n.forest)?"make(".concat(e.show(n.value),")"):"make(".concat(e.show(n.value),", [").concat(n.forest.map(t).join(", "),"])")};return{show:t}}function mge(e){var t,n=kr(function(r,i){return e.equals(r.value,i.value)&&t.equals(r.forest,i.forest)});return t=TW(n),n}var Lz=function(e,t){for(var n="",r=t.length,i,o=0;o<r;o++){i=t[o];var a=o===r-1;n+=e+(a?"\u2514":"\u251C")+"\u2500 "+i.value,n+=Lz(e+(r>1&&!a?"\u2502 ":" "),i.forest)}return n};function jz(e){return Lz(`
2
- `,e)}function vge(e){return e.value+jz(e.forest)}function Uz(e,t){var n=t(e),r=n[0],i=n[1];return{value:r,forest:Bz(i,t)}}function Bz(e,t){return e.map(function(n){return Uz(n,t)})}function zz(e){var t=qz(e);return function(n,r){return e.chain(r(n),function(i){var o=i[0],a=i[1];return e.map(t(a,r),function(u){return{value:o,forest:u}})})}}function qz(e){var t=Sv(e);return function(n,r){return m(n,t(function(i){return zz(e)(i,r)}))}}function gge(e){var t=function(n){return e(n.value,n.forest.map(t))};return t}var gu=function(e,t){return m(e,Iy(t))},mf=function(e,t){return m(e,dh(function(n){return m(t,Iy(n))}))},a1=function(e,t){return m(e,dh(t))},u1=function(e,t,n){return m(e,Oy(t,n))},s1=function(e){var t=Hz(e);return function(n,r){return m(n,t(r))}},c1=function(e,t,n){return m(e,l1(t,n))},Kz=function(e,t){return m(e,Ty(t))},Vz=function(e){var t=d1(e);return function(n,r){return m(n,t(r))}},yge=function(e){return function(t){return mf(t,e)}},dh=function(e){return function(t){var n=e(t.value),r=n.value,i=n.forest,o=b0().concat;return{value:r,forest:o(i,t.forest.map(dh(e)))}}},Ty=function(e){return function(t){return{value:e(t),forest:t.forest.map(Ty(e))}}},bge=Ty(B),$ge=dh(B),Iy=function(e){return function(t){return{value:e(t.value),forest:t.forest.map(Iy(e))}}},Oy=function(e,t){return function(n){for(var r=t(e,n.value),i=n.forest.length,o=0;o<i;o++)r=m(n.forest[o],Oy(r,t));return r}},Hz=function(e){return function(t){return Oy(e.empty,function(n,r){return e.concat(n,t(r))})}},l1=function(e,t){return function(n){for(var r=e,i=n.forest.length,o=i-1;o>=0;o--)r=m(n.forest[o],l1(r,t));return t(n.value,r)}},f1=function(e){return e.value},d1=function(e){var t=Sv(e),n=function(r){return function(i){return e.ap(e.map(r(i.value),function(o){return function(a){return{value:o,forest:a}}}),m(i.forest,t(n(r))))}};return n},p1=function(e){return d1(e)(B)},vf=function(e){return Dz(e)},Ti="Tree",h1={URI:Ti,map:gu},_ge=De(h1),Sge={URI:Ti,of:vf},wy={URI:Ti,map:gu,ap:mf},Tge=_t(wy),Ige=St(wy),Oge={URI:Ti,map:gu,ap:mf,of:vf},m1={URI:Ti,map:gu,ap:mf,chain:a1},wge={URI:Ti,map:gu,ap:mf,of:vf,chain:a1},Ege=at(m1),Rge={URI:Ti,reduce:u1,foldMap:s1,reduceRight:c1},Mge={URI:Ti,map:gu,reduce:u1,foldMap:s1,reduceRight:c1,traverse:Vz,sequence:p1},xge={URI:Ti,map:gu,extend:Kz,extract:f1},Cge=vf(jt),Age=It(h1),kge=Ot(m1),Wge=Tt(wy);function Nge(e){var t=function(n,r){return e.equals(n,r.value)||r.forest.some(function(i){return t(n,i)})};return t}var Jz=function(e){return function(t){return e(t.value)||t.forest.some(Jz(e))}},Pge={URI:Ti,map:gu,of:vf,ap:mf,chain:a1,reduce:u1,foldMap:s1,reduceRight:c1,traverse:Vz,sequence:p1,extract:f1,extend:Kz};const Fge=Object.freeze(Object.defineProperty({__proto__:null,make:Dz,getShow:hge,getEq:mge,drawForest:jz,drawTree:vge,unfoldTree:Uz,unfoldForest:Bz,unfoldTreeM:zz,unfoldForestM:qz,fold:gge,ap:yge,chain:dh,extend:Ty,duplicate:bge,flatten:$ge,map:Iy,reduce:Oy,foldMap:Hz,reduceRight:l1,extract:f1,traverse:d1,sequence:p1,of:vf,URI:Ti,Functor:h1,flap:_ge,Pointed:Sge,Apply:wy,apFirst:Tge,apSecond:Ige,Applicative:Oge,Chain:m1,Monad:wge,chainFirst:Ege,Foldable:Rge,Traversable:Mge,Comonad:xge,Do:Cge,bindTo:Age,bind:kge,apS:Wge,elem:Nge,exists:Jz,tree:Pge},Symbol.toStringTag,{value:"Module"}));var vr=qt,Jn=yn,Dge=function(e){return[Jn(e),vr(e)]};function v1(e){return{URI:gr,_E:void 0,map:ph,ap:function(t,n){return[vr(t)(vr(n)),e.concat(Jn(t),Jn(n))]}}}var Gz=function(e){return function(t){return[t,e.empty]}};function Lge(e){var t=v1(e);return{URI:gr,_E:void 0,map:t.map,ap:t.ap,of:Gz(e)}}function g1(e){var t=v1(e);return{URI:gr,_E:void 0,map:t.map,ap:t.ap,chain:function(n,r){var i=r(vr(n)),o=i[0],a=i[1];return[o,e.concat(Jn(n),a)]}}}function jge(e){var t=g1(e);return{URI:gr,_E:void 0,map:t.map,ap:t.ap,chain:t.chain,of:Gz(e)}}function Uge(e){var t=function(r,i){for(var o=i(r),a=e.empty,u=vr(o);u._tag==="Left";)a=e.concat(a,Jn(o)),o=i(u.left),u=vr(o);return[u.right,e.concat(a,Jn(o))]},n=g1(e);return{URI:gr,_E:void 0,map:n.map,ap:n.ap,chain:n.chain,chainRec:t}}var Yz=function(e,t){return m(e,nq(t))},ph=function(e,t){return m(e,_1(t))},Zz=function(e,t,n){return m(e,tq(t,n))},Xz=function(e,t){return m(e,S1(t))},Qz=function(e,t){return m(e,T1(t))},y1=function(e,t,n){return m(e,iq(t,n))},b1=function(e){var t=rq();return function(n,r){return m(n,t(r))}},$1=function(e,t,n){return m(e,oq(t,n))};function eq(e){var t=aq(e);return function(n,r){return m(n,t(r))}}var tq=function(e,t){return function(n){return[t(vr(n)),e(Jn(n))]}},_1=function(e){return function(t){return[e(vr(t)),Jn(t)]}},S1=function(e){return function(t){return[vr(t),e(Jn(t))]}},nq=function(e){return function(t){return[vr(t),Jn(e)]}},T1=function(e){return function(t){return[e(t),Jn(t)]}},Bge=T1(B),I1=ry,rq=zO,iq=BO,oq=qO,aq=function(e){return function(t){return function(n){return e.map(t(vr(n)),function(r){return[r,Jn(n)]})}}},O1=function(e){return function(t){return e.map(vr(t),function(n){return[n,Jn(t)]})}},gr="Tuple",uq={URI:gr,map:ph},zge=De(uq),qge={URI:gr,bimap:Zz,mapLeft:Xz},Kge={URI:gr,compose:Yz},Vge={URI:gr,map:ph,extend:Qz,extract:I1},Hge={URI:gr,reduce:y1,foldMap:b1,reduceRight:$1},Jge={URI:gr,map:ph,reduce:y1,foldMap:b1,reduceRight:$1,traverse:eq,sequence:O1},Gge=_1,Yge=S1,Zge={URI:gr,compose:Yz,map:ph,bimap:Zz,mapLeft:Xz,extract:I1,extend:Qz,reduce:y1,foldMap:b1,reduceRight:$1,traverse:eq,sequence:O1};const Xge=Object.freeze(Object.defineProperty({__proto__:null,fst:vr,snd:Jn,swap:Dge,getApply:v1,getApplicative:Lge,getChain:g1,getMonad:jge,getChainRec:Uge,bimap:tq,mapFst:_1,mapSnd:S1,compose:nq,extend:T1,duplicate:Bge,extract:I1,foldMap:rq,reduce:iq,reduceRight:oq,traverse:aq,sequence:O1,URI:gr,Functor:uq,flap:zge,Bifunctor:qge,Semigroupoid:Kge,Comonad:Vge,Foldable:Hge,Traversable:Jge,map:Gge,mapLeft:Yge,tuple:Zge},Symbol.toStringTag,{value:"Module"})),Qge=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function eye(e,t){var n=ex(t,za(e));return{map:n.map,ap:n.ap,of:n.of,chain:function(r,i){return t.chain(r,function(o){return Lt(o)?t.of(So(o.left)):i(o.right)})},alt:function(r,i){return t.chain(r,function(o){return F$(o)?t.of(o):t.map(i(),function(a){return Lt(a)?So(e.concat(o.left,a.left)):a})})}}}const tye=Object.freeze(Object.defineProperty({__proto__:null,getValidationM:eye},Symbol.toStringTag,{value:"Module"}));var sq=T_(void 0),nye={concat:sq.concat,empty:void 0};const rye=Object.freeze(Object.defineProperty({__proto__:null,Semigroup:sq,Monoid:nye},Symbol.toStringTag,{value:"Module"}));var iye=function(e){return function(){return[void 0,e]}},oye=function(e){return function(){var t=e(),n=t[0],r=t[1];return[[n,r],r]}},aye=function(e){return function(){var t=e(),n=t[0],r=n[0],i=n[1],o=t[1];return[r,i(o)]}},uye=function(e){return function(t){return function(){var n=t(),r=n[0],i=n[1];return[[r,e(i)],i]}}},sye=function(e){return function(t){return function(){var n=t(),r=n[0],i=n[1];return[r,e(i)]}}},hh=function(e,t){return m(e,cq(t))},cq=function(e){return function(t){return function(){var n=t(),r=n[0],i=n[1];return[e(r),i]}}},Ys="Writer",lq=function(e){return{URI:Ys,_E:void 0,of:function(t){return function(){return[t,e.empty]}}}},w1=function(e){return{URI:Ys,_E:void 0,map:hh,ap:function(t,n){return function(){var r=t(),i=r[0],o=r[1],a=n(),u=a[0],s=a[1];return[i(u),e.concat(o,s)]}}}},fq=function(e){var t=w1(e),n=lq(e);return{URI:Ys,_E:void 0,map:hh,ap:t.ap,of:n.of}};function dq(e){var t=w1(e);return{URI:Ys,_E:void 0,map:hh,ap:t.ap,chain:function(n,r){return function(){var i=n(),o=i[0],a=i[1],u=r(o)(),s=u[0],c=u[1];return[s,e.concat(a,c)]}}}}function cye(e){var t=fq(e),n=dq(e);return{URI:Ys,_E:void 0,map:hh,ap:t.ap,of:t.of,chain:n.chain}}var E1={URI:Ys,map:hh},lye=De(E1),fye=function(e){return e()[0]},dye=function(e){return e()[1]},pye=function(e){return e()[0]},hye=function(e){return e()[1]},mye=E1;const vye=Object.freeze(Object.defineProperty({__proto__:null,tell:iye,listen:oye,pass:aye,listens:uye,censor:sye,map:cq,URI:Ys,getPointed:lq,getApply:w1,getApplicative:fq,getChain:dq,getMonad:cye,Functor:E1,flap:lye,evaluate:fye,execute:dye,evalWriter:pye,execWriter:hye,writer:mye},Symbol.toStringTag,{value:"Module"}));function gye(e){var t=function(n,r){return function(){return e.map(n(),function(i){var o=i[0],a=i[1];return[r(o),a]})}};return{map:t,evalWriter:function(n){return e.map(n(),function(r){var i=r[0];return i})},execWriter:function(n){return e.map(n(),function(r){r[0];var i=r[1];return i})},tell:function(n){return function(){return e.of([void 0,n])}},listen:function(n){return function(){return e.map(n(),function(r){var i=r[0],o=r[1];return[[i,o],o]})}},pass:function(n){return function(){return e.map(n(),function(r){var i=r[0],o=i[0],a=i[1],u=r[1];return[o,a(u)]})}},listens:function(n,r){return function(){return e.map(n(),function(i){var o=i[0],a=i[1];return[[o,r(a)],a]})}},censor:function(n,r){return function(){return e.map(n(),function(i){var o=i[0],a=i[1];return[o,r(a)]})}},getMonad:function(n){return{_E:void 0,map:t,of:function(r){return function(){return e.of([r,n.empty])}},ap:function(r,i){return function(){return e.chain(r(),function(o){var a=o[0],u=o[1];return e.map(i(),function(s){var c=s[0],l=s[1];return[a(c),n.concat(u,l)]})})}},chain:function(r,i){return function(){return e.chain(r(),function(o){var a=o[0],u=o[1];return e.map(i(a)(),function(s){var c=s[0],l=s[1];return[c,n.concat(u,l)]})})}}}}}}const pq=Da(Object.freeze(Object.defineProperty({__proto__:null,alt:HJ,alternative:GJ,applicative:HH,apply:KH,array:WW,bifunctor:CZ,boolean:LZ,booleanAlgebra:qZ,bounded:JZ,boundedDistributiveLattice:ZZ,boundedJoinSemilattice:XZ,boundedLattice:QZ,boundedMeetSemilattice:eX,category:tX,chain:JH,chainRec:GH,choice:iX,comonad:oX,compactable:GX,console:eQ,const:mQ,contravariant:vQ,date:IQ,distributiveLattice:GZ,either:Ax,eitherT:wQ,endomorphism:RQ,extend:MQ,field:AQ,filterable:WQ,filterableWithIndex:NQ,foldable:UQ,foldableWithIndex:zQ,fromEither:YH,fromIO:qQ,fromReader:dee,fromState:Aee,fromTask:kee,fromThese:Wee,function:QM,functor:VH,functorWithIndex:Pee,group:Fee,heytingAlgebra:Dee,hkt:Lee,identity:ute,invariant:ste,io:Ete,ioEither:Ene,ioOption:$re,ioRef:Sre,joinSemilattice:Tre,json:wre,lattice:Ere,magma:O7,map:Pie,meetSemilattice:Fie,monad:Die,monadIO:Lie,monadTask:jie,monadThrow:Uie,monoid:eoe,naturalTransformation:toe,nonEmptyArray:mG,number:SG,option:$N,optionT:Mne,ord:_7,ordering:soe,pipeable:woe,pointed:Eoe,predicate:lX,profunctor:Roe,random:Aoe,reader:fee,readerEither:Rae,readerT:Cae,readerTaskEither:dle,readonlyArray:H9,readonlyMap:eie,readonlyNonEmptyArray:T8,readonlyRecord:rfe,readonlySet:$fe,readonlyTuple:Nfe,readerTask:Lue,record:Pde,refinement:Kde,ring:Gde,semigroup:zC,semigroupoid:Yde,semiring:Xde,separated:n6,set:$pe,eq:u7,show:wpe,state:Cee,stateReaderTaskEither:jhe,stateT:Rpe,store:Ghe,string:Mle,strong:Xhe,struct:tme,task:rue,taskEither:Gse,taskOption:nve,taskThese:nge,these:Mve,theseT:Cve,traced:lge,traversable:dge,traversableWithIndex:pge,tree:Fge,tuple:Xge,unfoldable:Qge,validationT:tye,void:rye,witherable:r6,writer:vye,writerT:Object.freeze(Object.defineProperty({__proto__:null,getWriterM:gye},Symbol.toStringTag,{value:"Module"})),zero:TG},Symbol.toStringTag,{value:"Module"})));function hq(e,t,n){return n===void 0&&(n=e.name),new ye(n,e.is,e.validate,function(r){return t(e.encode(r))})}const yye=Da(Object.freeze(Object.defineProperty({__proto__:null,mapOutput:hq},Symbol.toStringTag,{value:"Module"})));Object.defineProperty(je,"__esModule",{value:!0}),je.addType=je.isEmpty=je.objectToMap=je.grouped=je.formatDate=je.formatDateTime=je.filterDouble=je.refineType=je.nullable=void 0;const bye=ee.exports,$ye=pq,_ye=ur,gf=(0,bye.__importStar)(ie),Sye=yye;function Tye(e){return gf.union([e,gf.null,gf.undefined])}je.nullable=Tye;function Iye(e,t,n){return new gf.Type(t,e.is,(r,i)=>(0,_ye.pipe)(e.validate(r,i),$ye.either.chain(o=>n(o)?gf.success(o):gf.failure(r,i))),e.encode)}je.refineType=Iye;function Oye(e){if(e==="")return null;const t=Number(e);return Number.isNaN(t)?null:t}je.filterDouble=Oye;function wye(e){return e.toISOString().replace(/\.\d{3}Z$/,"+0000")}je.formatDateTime=wye;function Eye(e){return e.toISOString().replace(/T.*/,"")}je.formatDate=Eye;function Rye(e,t){return e.reduce((n,r,i)=>(i%t===0?n.push([r]):n[Math.floor(i/t)].push(r),n),new Array)}je.grouped=Rye;function Mye(e){return new Map(Object.entries(e))}je.objectToMap=Mye;function xye(e){for(const t in e)return!1;return!0}je.isEmpty=xye;function Cye(e,t){return(0,Sye.mapOutput)(e,n=>({...n,__TYPE__:t}))}je.addType=Cye;var R1={};Object.defineProperty(R1,"__esModule",{value:!0});const Aye=ee.exports,kye=Sn,Wye=ur,Zs=(0,Aye.__importStar)(ie);R1.default=new Zs.Type("IntFromNumber",Zs.Int.is,(e,t)=>(0,Wye.pipe)(Zs.number.validate(e,t),(0,kye.chain)(n=>Zs.Int.is(n)?Zs.success(n):Zs.success(Math.round(n)))),Zs.Int.encode);var M1={};Object.defineProperty(M1,"__esModule",{value:!0});const Nye=ee.exports,Pye=Sn,Fye=ur,yf=(0,Nye.__importStar)(ie),Dye=/^([0-9]+)px$/;M1.default=new yf.Type("IntFromPixels",yf.Int.is,(e,t)=>(0,Fye.pipe)(yf.string.validate(e,t),(0,Pye.chain)(n=>{try{const r=n.match(Dye);if(!r)return yf.failure(e,t);const i=parseInt(r[1]);return yf.success(i)}catch{return yf.failure(e,t)}})),String);var x1={};Object.defineProperty(x1,"__esModule",{value:!0});const Lye=ee.exports,jye=(0,Lye.__importStar)(ie),Uye=je;x1.default=(0,Uye.refineType)(jye.string,"nonEmptyString",e=>e.trim().length>0);var C1={},Ey={};Object.defineProperty(Ey,"__esModule",{value:!0});const Bye=ee.exports,zye=(0,Bye.__importStar)(ie),qye=je;Ey.default=(0,qye.nullable)(zye.string),Object.defineProperty(C1,"__esModule",{value:!0});const Kye=ee.exports,Vye=Sn,Hye=ur,A1=ie,Jye=(0,Kye.__importDefault)(Ey);C1.default=new A1.Type("nonEmptyStringOrNull",e=>typeof e=="string"||e===null,(e,t)=>(0,Hye.pipe)(Jye.default.validate(e,t),(0,Vye.chain)(n=>typeof n=="string"&&n.length>0?(0,A1.success)(n):(0,A1.success)(null))),e=>e);var k1={};Object.defineProperty(k1,"__esModule",{value:!0});const Gye=ee.exports,Yye=(0,Gye.__importStar)(ie),Zye=je;k1.default=(0,Zye.nullable)(Yye.number);var W1={};Object.defineProperty(W1,"__esModule",{value:!0});const Xye=ee.exports,Qye=Sn,ebe=ur,Ry=(0,Xye.__importStar)(ie);W1.default=new Ry.Type("StringFromInt",Ry.string.is,(e,t)=>(0,ebe.pipe)(Ry.boolean.validate(e,t),(0,Qye.chain)(n=>Ry.success(n.toString()))),e=>e);var N1={};Object.defineProperty(N1,"__esModule",{value:!0});const tbe=ee.exports,nbe=Sn,rbe=ur,My=(0,tbe.__importStar)(ie);N1.default=new My.Type("StringFromInt",My.string.is,(e,t)=>(0,rbe.pipe)(My.number.validate(e,t),(0,nbe.chain)(n=>My.success(n.toString()))),e=>e),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.StringOrNull=e.StringFromNumber=e.StringFromBoolean=e.NumberOrNull=e.NonEmptyStringOrNull=e.NonEmptyString=e.IntFromPixels=e.IntFromNumber=e.Function=e.DateFromTsMs=e.DateFromStringOrNumber=e.DateFromString=void 0;const t=ee.exports;var n=g_;Object.defineProperty(e,"DateFromString",{enumerable:!0,get:function(){return(0,t.__importDefault)(n).default}});var r=y_;Object.defineProperty(e,"DateFromStringOrNumber",{enumerable:!0,get:function(){return(0,t.__importDefault)(r).default}});var i=b_;Object.defineProperty(e,"DateFromTsMs",{enumerable:!0,get:function(){return(0,t.__importDefault)(i).default}}),e.Function=(0,t.__importStar)(je);var o=R1;Object.defineProperty(e,"IntFromNumber",{enumerable:!0,get:function(){return(0,t.__importDefault)(o).default}});var a=M1;Object.defineProperty(e,"IntFromPixels",{enumerable:!0,get:function(){return(0,t.__importDefault)(a).default}});var u=x1;Object.defineProperty(e,"NonEmptyString",{enumerable:!0,get:function(){return(0,t.__importDefault)(u).default}});var s=C1;Object.defineProperty(e,"NonEmptyStringOrNull",{enumerable:!0,get:function(){return(0,t.__importDefault)(s).default}});var c=k1;Object.defineProperty(e,"NumberOrNull",{enumerable:!0,get:function(){return(0,t.__importDefault)(c).default}});var l=W1;Object.defineProperty(e,"StringFromBoolean",{enumerable:!0,get:function(){return(0,t.__importDefault)(l).default}});var f=N1;Object.defineProperty(e,"StringFromNumber",{enumerable:!0,get:function(){return(0,t.__importDefault)(f).default}});var d=Ey;Object.defineProperty(e,"StringOrNull",{enumerable:!0,get:function(){return(0,t.__importDefault)(d).default}})}(Ze);var Ii={},P1={},F1={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EmptyContent=e.EmptyContentType=void 0,e.EmptyContentType="EmptyContent",e.EmptyContent={is:t=>t.__TYPE__===e.EmptyContentType}})(F1);var xy={};const mq=Da(WW),yu=Da($N);var Cy={},Ay={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.BooleanContentType=void 0;const t=ee.exports,n=Sn,r=(0,t.__importStar)(ie);e.BooleanContentType="BooleanContent";const i=new r.Type("BooleanContent",o=>{var a;return((a=o)===null||a===void 0?void 0:a.__TYPE__)===e.BooleanContentType},(o,a)=>n.Chain.chain(r.boolean.validate(o,a),u=>r.success({value:u,__TYPE__:e.BooleanContentType})),o=>r.boolean.encode(o.value));e.default=i})(Ay);var mh={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EmbedContent=e.EmbedContentType=void 0;const t=ee.exports,n=pq,r=ur,i=(0,t.__importStar)(ie),o=Ze,a=je;e.EmbedContentType="EmbedContent",e.EmbedContent=new i.Type("EmbedContent",s=>s.__TYPE__===e.EmbedContentType,s=>(0,r.pipe)(u.decode(s),n.either.map(c=>({...u.encode(c),all:s}))),s=>u.encode(s));const u=(0,a.addType)(i.exact(i.intersection([i.type({embed_url:i.string,type:i.string}),i.partial({version:i.union([i.string,i.number,i.null]),title:o.StringOrNull,author_name:o.StringOrNull,author_url:o.StringOrNull,provider_name:o.StringOrNull,provider_url:o.StringOrNull,cache_age:i.union([i.string,i.number,i.null]),thumbnail_url:o.StringOrNull,thumbnail_width:o.NumberOrNull,thumbnail_height:o.NumberOrNull,html:o.StringOrNull})])),e.EmbedContentType)})(mh);var Xs={};Object.defineProperty(Xs,"__esModule",{value:!0}),Xs.FieldContentType=void 0;const vq=ee.exports,ibe=ur,gq=(0,vq.__importStar)(yu),obe=(0,vq.__importStar)(ie);Xs.FieldContentType="FieldContent";function abe(e){let t=0;for(;t<e.length&&e[t]<=" ";)t++;let n=e.length;for(;t<n&&e[n-1]<=" ";)n--;return e.substring(t,n)}const ube={types:["Text","Date","Timestamp","Color","Number","Range","Select"],forType:(e,t)=>(0,ibe.pipe)(gq.fromEither(obe.string.decode(t)),gq.map(n=>({value:abe(n),type:e,__TYPE__:"FieldContent"})))};Xs.default=ube;var ky={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.GeoPointContent=e.GeoPointContentType=void 0;const t=ee.exports,n=(0,t.__importStar)(ie),r=je;e.GeoPointContentType="GeoPointContent",e.GeoPointContent=(0,r.addType)(n.strict({position:n.strict({lat:n.number,lng:n.number})}),e.GeoPointContentType)})(ky);var vh={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ImageContent=e.ImageContentType=e.ImageContentView=void 0;const t=ee.exports,n=(0,t.__importStar)(ie),r=Ze,i=je,o=n.exact(n.type({id:n.string,url:n.string,width:n.number,height:n.number}));e.ImageContentView=n.exact(n.intersection([n.type({origin:o,width:n.number,height:n.number,edit:n.type({zoom:n.number,crop:n.type({x:n.number,y:n.number}),background:n.string})}),n.partial({url:n.string,credits:r.NonEmptyStringOrNull,alt:r.NonEmptyStringOrNull,provider:r.StringOrNull})])),e.ImageContentType="ImageContent",e.ImageContent=(0,i.addType)(n.intersection([e.ImageContentView,n.partial({thumbnails:n.record(n.string,e.ImageContentView)})]),e.ImageContentType)})(vh);var Wy={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.IntegrationFieldsContentType=void 0;const t=ee.exports,n=Sn,r=(0,t.__importStar)(ie);e.IntegrationFieldsContentType="IntegrationFieldsContent";const i=new r.Type("IntegrationFieldsContent",o=>{var a;return((a=o)===null||a===void 0?void 0:a.__TYPE__)===e.IntegrationFieldsContentType},(o,a)=>n.Chain.chain(r.string.validate(o,a),u=>r.success({value:u,__TYPE__:e.IntegrationFieldsContentType})),()=>{throw new Error("Not implemented - Not used - Not relevant")});e.default=i})(Wy);var D1={},L1={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isDocumentLink=e.DocumentLink=e.DocumentLinkType=void 0;const t=ee.exports,n=(0,t.__importStar)(ie),r=Ze,i=je;e.DocumentLinkType="DocumentLink",e.DocumentLink=(0,i.addType)(n.strict({id:r.NonEmptyString}),e.DocumentLinkType);function o(a){return a.__TYPE__===e.DocumentLinkType}e.isDocumentLink=o})(L1);var j1={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isExternalLink=e.ExternalLink=e.ExternalLinkType=void 0;const t=ee.exports,n=(0,t.__importStar)(ie),r=Ze,i=je;e.ExternalLinkType="ExternalLink",e.ExternalLink=(0,i.addType)(n.exact(n.intersection([n.type({url:n.string}),n.partial({kind:n.literal("web"),target:r.StringOrNull,preview:(0,i.nullable)(n.partial({title:n.string}))})])),e.ExternalLinkType);function o(a){return a.__TYPE__===e.ExternalLinkType}e.isExternalLink=o})(j1);var U1={},Ny={},sbe=se&&se.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),cbe=se&&se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),lbe=se&&se.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.hasOwnProperty.call(e,n)&&sbe(t,e,n);return cbe(t,e),t};Object.defineProperty(Ny,"__esModule",{value:!0}),Ny.mapOutput=void 0;var fbe=lbe(ie);function dbe(e,t,n){return n===void 0&&(n=e.name),new fbe.Type(n,e.is,e.validate,function(r){return t(e.encode(r))})}Ny.mapOutput=dbe,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isFileLink=e.FileLink=e.FileLinkType=void 0;const t=ee.exports,n=(0,t.__importStar)(ie),r=Ny,i=je;e.FileLinkType="FileLink",e.FileLink=(0,r.mapOutput)(n.exact(n.intersection([n.type({id:n.string,url:n.string,name:n.string,kind:n.string}),n.partial({date:(0,i.nullable)(n.string),size:(0,i.nullable)(n.string)})])),a=>({...a,size:a.size||"0",__TYPE__:e.FileLinkType}));function o(a){return a.__TYPE__===e.FileLinkType}e.isFileLink=o}(U1);var B1={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isImageLink=e.ImageLink=e.ImageLinkType=void 0;const t=ee.exports,n=(0,t.__importStar)(ie),r=Ze,i=je;e.ImageLinkType="ImageLink",e.ImageLink=(0,i.addType)(n.exact(n.intersection([n.type({id:n.string,url:n.string,height:n.string,width:n.string,size:n.string,name:n.string,kind:n.string}),n.partial({date:r.StringOrNull})])),e.ImageLinkType);function o(a){return a.__TYPE__===e.ImageLinkType}e.isImageLink=o})(B1);var z1={},yq;function bq(){return yq||(yq=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.LinkContent=e.LinkContentType=void 0;const t=ee.exports,n=Sn,r=(0,t.__importStar)(ie),i=bf();e.LinkContentType="LinkContent",e.LinkContent=new r.Type("LinkContent",o=>{var a;return i.Link.is((a=o)===null||a===void 0?void 0:a.value)},(o,a)=>n.Chain.chain(i.Link.validate(o,a),u=>r.success({value:u,__TYPE__:e.LinkContentType})),o=>i.Link.encode(o.value))}(z1)),z1}var $q;function bf(){return $q||($q=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.LinksTypes=e.is=e.BROKEN_CUSTOM_TYPE=e.LinkContent=e.ImageLink=e.FileLink=e.ExternalLink=e.DocumentLink=e.Link=void 0;const t=ee.exports,n=(0,t.__importStar)(ie),r=L1,i=j1,o=U1,a=B1,u=bq();e.Link=n.union([a.ImageLink,o.FileLink,r.DocumentLink,i.ExternalLink]);var s=L1;Object.defineProperty(e,"DocumentLink",{enumerable:!0,get:function(){return s.DocumentLink}});var c=j1;Object.defineProperty(e,"ExternalLink",{enumerable:!0,get:function(){return c.ExternalLink}});var l=U1;Object.defineProperty(e,"FileLink",{enumerable:!0,get:function(){return l.FileLink}});var f=B1;Object.defineProperty(e,"ImageLink",{enumerable:!0,get:function(){return f.ImageLink}});var d=bq();Object.defineProperty(e,"LinkContent",{enumerable:!0,get:function(){return d.LinkContent}}),e.BROKEN_CUSTOM_TYPE="broken_type",e.is={documentLink:r.isDocumentLink,fileLink:o.isFileLink,externalLink:i.isExternalLink,imageLink:a.isImageLink},e.LinksTypes={DocumentLink:r.DocumentLinkType,FileLink:o.FileLinkType,ExternalLink:i.ExternalLinkType,ImageLink:a.ImageLinkType,LinkContent:u.LinkContentType}}(D1)),D1}var Py={},Qs={},xe={},Fy={},pt={};Object.defineProperty(pt,"__esModule",{value:!0}),pt.WidgetTypes=void 0,pt.WidgetTypes={Text:"Text",RichText:"StructuredText",Color:"Color",Image:"Image",Date:"Date",Timestamp:"Timestamp",Number:"Number",Range:"Range",Select:"Select",Link:"Link",Embed:"Embed",GeoPoint:"GeoPoint",Separator:"Separator",UID:"UID",BooleanField:"Boolean",IntegrationField:"IntegrationFields",Group:"Group",Slices:"Slices",LegacySlices:"Choice"},Object.defineProperty(Fy,"__esModule",{value:!0});const pbe=ee.exports,io=(0,pbe.__importStar)(ie),hbe=Ze,mbe=pt,vbe=io.exact(io.partial({label:hbe.StringOrNull,default_value:io.boolean,placeholder_true:io.string,placeholder_false:io.string})),gbe=io.exact(io.intersection([io.type({type:io.literal(mbe.WidgetTypes.BooleanField)}),io.partial({config:vbe})]));Fy.default=gbe;var Dy={};Object.defineProperty(Dy,"__esModule",{value:!0});const ybe=ee.exports,bu=(0,ybe.__importStar)(ie),_q=Ze,bbe=pt,$be=bu.exact(bu.partial({label:_q.StringOrNull,placeholder:bu.string})),_be=bu.exact(bu.intersection([bu.type({type:bu.literal(bbe.WidgetTypes.Color)}),bu.partial({fieldset:_q.StringOrNull,config:$be})]));Dy.default=_be;var Ly={};Object.defineProperty(Ly,"__esModule",{value:!0});const Sbe=ee.exports,aa=(0,Sbe.__importStar)(ie),Sq=Ze,Tbe=pt,Ibe=aa.exact(aa.partial({label:Sq.StringOrNull,placeholder:aa.string,default:aa.string})),Obe=aa.exact(aa.intersection([aa.type({type:aa.literal(Tbe.WidgetTypes.Date)}),aa.partial({fieldset:Sq.StringOrNull,config:Ibe})]));Ly.default=Obe;var jy={};Object.defineProperty(jy,"__esModule",{value:!0});const wbe=ee.exports,ua=(0,wbe.__importStar)(ie),Tq=Ze,Ebe=pt,Rbe=ua.exact(ua.partial({label:Tq.StringOrNull,placeholder:ua.string,useAsTitle:ua.boolean})),Mbe=ua.exact(ua.intersection([ua.type({type:ua.literal(Ebe.WidgetTypes.Embed)}),ua.partial({fieldset:Tq.StringOrNull,config:Rbe})]));jy.default=Mbe;var Uy={};Object.defineProperty(Uy,"__esModule",{value:!0});const xbe=ee.exports,ec=(0,xbe.__importStar)(ie),Iq=Ze,Cbe=pt,Abe=ec.exact(ec.partial({label:Iq.StringOrNull})),kbe=ec.exact(ec.intersection([ec.type({type:ec.literal(Cbe.WidgetTypes.GeoPoint)}),ec.partial({fieldset:Iq.StringOrNull,config:Abe})]));Uy.default=kbe;var By={},gh={},zy={},$f={},tc={};Object.defineProperty(tc,"__esModule",{value:!0}),tc.pipe=tc.pipeable=void 0;var q1=La,Wbe=function(e){return typeof e.map=="function"},Nbe=function(e){return typeof e.contramap=="function"},Pbe=function(e){return typeof e.mapWithIndex=="function"},Fbe=function(e){return typeof e.ap=="function"},Dbe=function(e){return typeof e.chain=="function"},Lbe=function(e){return typeof e.bimap=="function"},jbe=function(e){return typeof e.extend=="function"},Ube=function(e){return typeof e.reduce=="function"},Bbe=function(e){return typeof e.reduceWithIndex=="function"},zbe=function(e){return typeof e.alt=="function"},qbe=function(e){return typeof e.compact=="function"},Kbe=function(e){return typeof e.filter=="function"},Vbe=function(e){return typeof e.filterWithIndex=="function"},Hbe=function(e){return typeof e.promap=="function"},Jbe=function(e){return typeof e.compose=="function"},Gbe=function(e){return typeof e.throwError=="function"};function Ybe(e){var t={};if(Wbe(e)){var n=function(S){return function(_){return e.map(_,S)}};t.map=n}if(Nbe(e)){var r=function(S){return function(_){return e.contramap(_,S)}};t.contramap=r}if(Pbe(e)){var i=function(S){return function(_){return e.mapWithIndex(_,S)}};t.mapWithIndex=i}if(Fbe(e)){var o=function(S){return function(_){return e.ap(_,S)}},a=function(S){return function(_){return e.ap(e.map(_,function(U){return function(){return U}}),S)}};t.ap=o,t.apFirst=a,t.apSecond=function(S){return function(_){return e.ap(e.map(_,function(){return function(U){return U}}),S)}}}if(Dbe(e)){var u=function(S){return function(_){return e.chain(_,S)}},s=function(S){return function(_){return e.chain(_,function(U){return e.map(S(U),function(){return U})})}},c=function(S){return e.chain(S,q1.identity)};t.chain=u,t.chainFirst=s,t.flatten=c}if(Lbe(e)){var l=function(S,_){return function(U){return e.bimap(U,S,_)}},f=function(S){return function(_){return e.mapLeft(_,S)}};t.bimap=l,t.mapLeft=f}if(jbe(e)){var d=function(S){return function(_){return e.extend(_,S)}},p=function(S){return e.extend(S,q1.identity)};t.extend=d,t.duplicate=p}if(Ube(e)){var h=function(S,_){return function(U){return e.reduce(U,S,_)}},v=function(S){var _=e.foldMap(S);return function(U){return function(G){return _(G,U)}}},y=function(S,_){return function(U){return e.reduceRight(U,S,_)}};t.reduce=h,t.foldMap=v,t.reduceRight=y}if(Bbe(e)){var b=function(S,_){return function(U){return e.reduceWithIndex(U,S,_)}},w=function(S){var _=e.foldMapWithIndex(S);return function(U){return function(G){return _(G,U)}}},F=function(S,_){return function(U){return e.reduceRightWithIndex(U,S,_)}};t.reduceWithIndex=b,t.foldMapWithIndex=w,t.reduceRightWithIndex=F}if(zbe(e)){var g=function(S){return function(_){return e.alt(_,S)}};t.alt=g}if(qbe(e)&&(t.compact=e.compact,t.separate=e.separate),Kbe(e)){var I=function(S){return function(_){return e.filter(_,S)}},T=function(S){return function(_){return e.filterMap(_,S)}},k=function(S){return function(_){return e.partition(_,S)}},E=function(S){return function(_){return e.partitionMap(_,S)}};t.filter=I,t.filterMap=T,t.partition=k,t.partitionMap=E}if(Vbe(e)){var Y=function(S){return function(_){return e.filterWithIndex(_,S)}},K=function(S){return function(_){return e.filterMapWithIndex(_,S)}},x=function(S){return function(_){return e.partitionWithIndex(_,S)}},X=function(S){return function(_){return e.partitionMapWithIndex(_,S)}};t.filterWithIndex=Y,t.filterMapWithIndex=K,t.partitionWithIndex=x,t.partitionMapWithIndex=X}if(Hbe(e)){var O=function(S,_){return function(U){return e.promap(U,S,_)}};t.promap=O}if(Jbe(e)){var R=function(S){return function(_){return e.compose(_,S)}};t.compose=R}if(Gbe(e)){var W=function(S){return function(_){return _._tag==="None"?e.throwError(S()):e.of(_.value)}},L=function(S){return S._tag==="Left"?e.throwError(S.left):e.of(S.right)},z=function(S,_){return function(U){return S(U)?e.of(U):e.throwError(_(U))}},j=function(S,_){return function(U){return e.chain(U,function(G){return S(G)?e.of(G):e.throwError(_(G))})}};t.fromOption=W,t.fromEither=L,t.fromPredicate=z,t.filterOrElse=j}return t}tc.pipeable=Ybe,tc.pipe=q1.pipe;var Zbe=se&&se.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),Xbe=se&&se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Qbe=se&&se.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.hasOwnProperty.call(e,n)&&Zbe(t,e,n);return Xbe(t,e),t};Object.defineProperty($f,"__esModule",{value:!0}),$f.NumberFromString=void 0;var yh=Qbe(ie),e$e=tc,t$e=_o;$f.NumberFromString=new yh.Type("NumberFromString",yh.number.is,function(e,t){return e$e.pipe(yh.string.validate(e,t),t$e.chain(function(n){var r=+n;return isNaN(r)||n.trim()===""?yh.failure(e,t):yh.success(r)}))},String);var n$e=se&&se.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),r$e=se&&se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i$e=se&&se.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.hasOwnProperty.call(e,n)&&n$e(t,e,n);return r$e(t,e),t};Object.defineProperty(zy,"__esModule",{value:!0}),zy.IntFromString=void 0;var bh=i$e(ie),Oq=$f,o$e=tc,a$e=_o;zy.IntFromString=new bh.Type("IntFromString",bh.Int.is,function(e,t){return o$e.pipe(Oq.NumberFromString.validate(e,t),a$e.chain(function(n){return bh.Int.is(n)?bh.success(n):bh.failure(e,t)}))},Oq.NumberFromString.encode),Object.defineProperty(gh,"__esModule",{value:!0});const u$e=ee.exports,s$e=_o,sa=(0,u$e.__importStar)(ie),c$e=zy,wq=Ze,Eq=new sa.Type("SideConstraints",e=>!e||typeof e=="number",(e,t)=>s$e.either.chain(sa.union([sa.literal("auto"),sa.literal(""),sa.Int,c$e.IntFromString,wq.IntFromNumber,wq.IntFromPixels,sa.null]).validate(e,t),n=>n==="auto"||n===""?sa.success(null):sa.success(n)),e=>e),l$e=sa.partial({width:Eq,height:Eq});gh.default=l$e,Object.defineProperty(By,"__esModule",{value:!0});const Rq=ee.exports,yr=(0,Rq.__importStar)(ie),Mq=Ze,xq=(0,Rq.__importDefault)(gh),f$e=pt,d$e=yr.exact(yr.intersection([yr.type({name:yr.string}),xq.default])),p$e=yr.exact(yr.partial({label:Mq.StringOrNull,placeholder:yr.string,constraint:xq.default,thumbnails:yr.readonlyArray(d$e)})),h$e=yr.exact(yr.intersection([yr.type({type:yr.literal(f$e.WidgetTypes.Image)}),yr.partial({fieldset:Mq.StringOrNull,config:p$e})]));By.default=h$e;var qy={};Object.defineProperty(qy,"__esModule",{value:!0});const m$e=ee.exports,ca=(0,m$e.__importStar)(ie),Cq=Ze,v$e=pt,g$e=ca.exact(ca.partial({label:Cq.StringOrNull,placeholder:ca.string,catalog:ca.string})),y$e=ca.exact(ca.intersection([ca.type({type:ca.literal(v$e.WidgetTypes.IntegrationField)}),ca.partial({fieldset:Cq.StringOrNull,config:g$e})]));qy.default=y$e;var Ky={};Object.defineProperty(Ky,"__esModule",{value:!0});const b$e=ee.exports,$$e=_o,lt=(0,b$e.__importStar)(ie),_$e=Jc,Aq=Ze,S$e=pt,T$e=e=>{if(e instanceof Array&&e.reduce((n,r)=>n&&typeof r=="string",!0))return lt.success(e)},I$e=e=>{if(typeof e=="string")return lt.success([e])},kq=new lt.Type("MasksArrayString",e=>e instanceof Array,(e,t)=>$$e.either.chain(lt.union([lt.array(lt.string),lt.string]).validate(e,t),n=>T$e(n)||I$e(n)||lt.failure(e,t)),e=>e),O$e=lt.exact(lt.partial({label:Aq.StringOrNull,useAsTitle:lt.boolean,placeholder:lt.string,select:(0,_$e.withFallback)(lt.union([lt.literal("media"),lt.literal("document"),lt.literal("web"),lt.null]),null),customtypes:lt.readonlyArray(lt.string),masks:kq,tags:kq,allowTargetBlank:lt.boolean})),w$e=lt.exact(lt.intersection([lt.type({type:lt.literal(S$e.WidgetTypes.Link)}),lt.partial({fieldset:Aq.StringOrNull,config:O$e})]));Ky.default=w$e;var $u={},Vy={};Object.defineProperty(Vy,"__esModule",{value:!0});const E$e=ee.exports,Gn=(0,E$e.__importStar)(ie),K1=$f,Wq=Ze,R$e=pt,M$e=Gn.exact(Gn.partial({label:Wq.StringOrNull,placeholder:Gn.string,min:Gn.union([Gn.number,K1.NumberFromString]),max:Gn.union([Gn.number,K1.NumberFromString]),step:Gn.union([Gn.number,K1.NumberFromString])})),x$e=Gn.exact(Gn.intersection([Gn.type({type:Gn.literal(R$e.WidgetTypes.Number)}),Gn.partial({fieldset:Wq.StringOrNull,config:M$e})]));Vy.default=x$e;var Hy={};Object.defineProperty(Hy,"__esModule",{value:!0});const C$e=ee.exports,Yn=(0,C$e.__importStar)(ie),V1=$f,Nq=Ze,A$e=pt,k$e=Yn.exact(Yn.partial({label:Nq.StringOrNull,placeholder:Yn.string,min:Yn.union([Yn.number,V1.NumberFromString]),max:Yn.union([Yn.number,V1.NumberFromString]),step:Yn.union([Yn.number,V1.NumberFromString])})),W$e=Yn.exact(Yn.intersection([Yn.type({type:Yn.literal(A$e.WidgetTypes.Range)}),Yn.partial({fieldset:Nq.StringOrNull,config:k$e})]));Hy.default=W$e;var Jy={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RichText=e.RichTextConfig=e.RichTextNodeTypeCodec=e.RichTextNodeType=e.DEFAULT_OPTION=void 0;const t=ee.exports,n=_o,r=(0,t.__importStar)(ie),i=Ze,o=(0,t.__importDefault)(gh),a=pt;e.DEFAULT_OPTION="paragraph",e.RichTextNodeType={heading1:"heading1",heading2:"heading2",heading3:"heading3",heading4:"heading4",heading5:"heading5",heading6:"heading6",paragraph:"paragraph",strong:"strong",em:"em",preformatted:"preformatted",hyperlink:"hyperlink",image:"image",embed:"embed",list:"list-item",orderedList:"o-list-item",rtl:"rtl"},e.RichTextNodeTypeCodec=r.keyof({[e.RichTextNodeType.heading1]:null,[e.RichTextNodeType.heading2]:null,[e.RichTextNodeType.heading3]:null,[e.RichTextNodeType.heading4]:null,[e.RichTextNodeType.heading5]:null,[e.RichTextNodeType.heading6]:null,[e.RichTextNodeType.paragraph]:null,[e.RichTextNodeType.strong]:null,[e.RichTextNodeType.em]:null,[e.RichTextNodeType.preformatted]:null,[e.RichTextNodeType.hyperlink]:null,[e.RichTextNodeType.image]:null,[e.RichTextNodeType.embed]:null,[e.RichTextNodeType.list]:null,[e.RichTextNodeType.orderedList]:null,[e.RichTextNodeType.rtl]:null});const u=new r.Type("RichTextOptions",p=>typeof p=="string",(p,h)=>n.either.chain(r.union([r.string,r.null]).validate(p,h),v=>{if(!v)return r.success(e.DEFAULT_OPTION);const b=v.split(",").map(w=>w.trim()).filter(w=>(0,n.getOrElseW)(()=>{})(e.RichTextNodeTypeCodec.decode(w)));return b.length?r.success(b.join(",")):r.success(e.DEFAULT_OPTION)}),p=>p),s=p=>{if(!p)return r.success([])},c=p=>{if(p instanceof Object){const h=p;if(!Object.entries(h).length)return r.success([]);if(h[""])return r.success(h[""].map(y=>y.name));const v=Object.entries(h).reduce((y,[,b])=>y.concat(b.map(w=>w.name)),[]).filter(Boolean);return r.success(v)}},l=p=>{if(p instanceof Array&&p.reduce((v,y)=>v&&typeof y=="string",!0))return r.success(p)},f=p=>{if(typeof p=="string")return r.success([p])},d=new r.Type("RichTextLabels",p=>p instanceof Array,(p,h)=>{const v=r.record(r.string,r.readonlyArray(r.record(r.literal("name"),r.string))),y=r.readonlyArray(r.string);return n.either.chain(r.union([v,y,r.string,r.null]).validate(p,h),b=>s(b)||l(b)||c(b)||f(b)||r.failure(p,h))},p=>p);e.RichTextConfig=r.exact(r.partial({label:i.StringOrNull,placeholder:r.string,useAsTitle:r.boolean,single:u,multi:u,imageConstraint:o.default,labels:d,allowTargetBlank:r.boolean})),e.RichText=r.exact(r.intersection([r.type({type:r.literal(a.WidgetTypes.RichText)}),r.partial({fieldset:i.StringOrNull,config:e.RichTextConfig})]))})(Jy);var Gy={};Object.defineProperty(Gy,"__esModule",{value:!0});const N$e=ee.exports,Ur=(0,N$e.__importStar)(ie),Yy=Ze,P$e=pt,F$e=Ur.exact(Ur.partial({label:Yy.StringOrNull,placeholder:Ur.string,default_value:Ur.string,options:Ur.readonlyArray(Ur.union([Ur.string,Yy.StringFromNumber,Yy.StringFromBoolean]))})),D$e=Ur.exact(Ur.intersection([Ur.type({type:Ur.literal(P$e.WidgetTypes.Select)}),Ur.partial({fieldset:Yy.StringOrNull,config:F$e})]));Gy.default=D$e;var Zy={};Object.defineProperty(Zy,"__esModule",{value:!0});const L$e=ee.exports,nc=(0,L$e.__importStar)(ie),j$e=Ze,U$e=pt,B$e=nc.exact(nc.partial({label:j$e.StringOrNull})),z$e=nc.exact(nc.intersection([nc.type({type:nc.literal(U$e.WidgetTypes.Separator)}),nc.partial({config:B$e})]));Zy.default=z$e;var Xy={};Object.defineProperty(Xy,"__esModule",{value:!0});const q$e=ee.exports,la=(0,q$e.__importStar)(ie),Pq=Ze,K$e=pt,V$e=la.exact(la.partial({label:Pq.StringOrNull,useAsTitle:la.boolean,placeholder:la.string})),H$e=la.exact(la.intersection([la.type({type:la.literal(K$e.WidgetTypes.Text)}),la.partial({fieldset:Pq.StringOrNull,config:V$e})]));Xy.default=H$e;var Qy={};Object.defineProperty(Qy,"__esModule",{value:!0});const J$e=ee.exports,fa=(0,J$e.__importStar)(ie),Fq=Ze,G$e=pt,Y$e=fa.exact(fa.partial({label:Fq.StringOrNull,placeholder:fa.string,default:fa.string})),Z$e=fa.exact(fa.intersection([fa.type({type:fa.literal(G$e.WidgetTypes.Timestamp)}),fa.partial({fieldset:Fq.StringOrNull,config:Y$e})]));Qy.default=Z$e,Object.defineProperty($u,"__esModule",{value:!0});const xn=ee.exports,X$e=(0,xn.__importStar)(ie),Q$e=(0,xn.__importDefault)(Fy),e_e=(0,xn.__importDefault)(Dy),t_e=(0,xn.__importDefault)(Ly),n_e=(0,xn.__importDefault)(jy),r_e=(0,xn.__importDefault)(Uy),i_e=(0,xn.__importDefault)(By),o_e=(0,xn.__importDefault)(qy),a_e=(0,xn.__importDefault)(Ky),u_e=(0,xn.__importDefault)(Vy),s_e=(0,xn.__importDefault)(Hy),c_e=Jy,l_e=(0,xn.__importDefault)(Gy),f_e=(0,xn.__importDefault)(Zy),d_e=(0,xn.__importDefault)(Xy),p_e=(0,xn.__importDefault)(Qy),h_e=X$e.union([e_e.default,Q$e.default,n_e.default,r_e.default,t_e.default,u_e.default,s_e.default,c_e.RichText,l_e.default,f_e.default,d_e.default,p_e.default,a_e.default,i_e.default,o_e.default]);$u.default=h_e,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Timestamp=e.Text=e.Separator=e.Select=e.Range=e.Number=e.NestableWidget=e.Link=e.IntegrationField=e.Image=e.GeoPoint=e.Embed=e.Date=e.Color=e.BooleanField=void 0;const t=ee.exports;var n=Fy;Object.defineProperty(e,"BooleanField",{enumerable:!0,get:function(){return(0,t.__importDefault)(n).default}});var r=Dy;Object.defineProperty(e,"Color",{enumerable:!0,get:function(){return(0,t.__importDefault)(r).default}});var i=Ly;Object.defineProperty(e,"Date",{enumerable:!0,get:function(){return(0,t.__importDefault)(i).default}});var o=jy;Object.defineProperty(e,"Embed",{enumerable:!0,get:function(){return(0,t.__importDefault)(o).default}});var a=Uy;Object.defineProperty(e,"GeoPoint",{enumerable:!0,get:function(){return(0,t.__importDefault)(a).default}});var u=By;Object.defineProperty(e,"Image",{enumerable:!0,get:function(){return(0,t.__importDefault)(u).default}});var s=qy;Object.defineProperty(e,"IntegrationField",{enumerable:!0,get:function(){return(0,t.__importDefault)(s).default}});var c=Ky;Object.defineProperty(e,"Link",{enumerable:!0,get:function(){return(0,t.__importDefault)(c).default}});var l=$u;Object.defineProperty(e,"NestableWidget",{enumerable:!0,get:function(){return(0,t.__importDefault)(l).default}});var f=Vy;Object.defineProperty(e,"Number",{enumerable:!0,get:function(){return(0,t.__importDefault)(f).default}});var d=Hy;Object.defineProperty(e,"Range",{enumerable:!0,get:function(){return(0,t.__importDefault)(d).default}}),(0,t.__exportStar)(Jy,e);var p=Gy;Object.defineProperty(e,"Select",{enumerable:!0,get:function(){return(0,t.__importDefault)(p).default}});var h=Zy;Object.defineProperty(e,"Separator",{enumerable:!0,get:function(){return(0,t.__importDefault)(h).default}});var v=Xy;Object.defineProperty(e,"Text",{enumerable:!0,get:function(){return(0,t.__importDefault)(v).default}});var y=Qy;Object.defineProperty(e,"Timestamp",{enumerable:!0,get:function(){return(0,t.__importDefault)(y).default}})}(xe),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Block=e.TextBlock=e.checkEmbedBlock=e.EmbedBlock=e.checkImageBlock=e.ImageBlock=e.ValidatedMetas=e.Span=e.Meta=void 0;const t=ee.exports,n=(0,t.__importStar)(_o),r=(0,t.__importStar)(ie),i=xe,o=Ze,a=je,u=mh,s=vh,c=bf();e.Meta=r.exact(r.intersection([r.partial({data:r.unknown}),r.type({start:r.number,end:r.number,type:r.union([i.RichTextNodeTypeCodec,r.literal("label")])})])),e.Span=e.Meta,e.ValidatedMetas=new r.Type("ValidatedMetas",d=>Array.isArray(d)&&d.every(e.Meta.is),(d,p)=>{if(Array.isArray(d)){const h=d.reduce((v,y)=>{const b=e.Meta.decode(y);if(n.isRight(b)){const w=b.right;if(w.data&&w.type==="hyperlink"&&n.isRight(c.Link.validate(w.data,p))||w.type!=="hyperlink")return[...v,w]}return v},[]).sort((v,y)=>v.start-y.start);return r.success(h)}else return r.failure(d,p)},d=>r.array(e.Meta).encode(d)),e.ImageBlock=r.exact(r.intersection([r.type({type:r.literal(i.RichTextNodeType.image),data:r.intersection([s.ImageContentView,r.partial({linkTo:(0,a.nullable)(c.Link)})])}),r.partial({label:o.StringOrNull,direction:o.StringOrNull})]));function l(d){return d.type===i.RichTextNodeType.image}e.checkImageBlock=l,e.EmbedBlock=r.exact(r.intersection([r.type({type:r.literal(i.RichTextNodeType.embed),data:u.EmbedContent}),r.partial({label:o.StringOrNull,direction:o.StringOrNull})]));function f(d){return d.type===i.RichTextNodeType.embed}e.checkEmbedBlock=f,e.TextBlock=r.exact(r.intersection([r.type({type:(0,a.refineType)(i.RichTextNodeTypeCodec,`string which isn't ${i.RichTextNodeType.image} ${i.RichTextNodeType.embed}`,d=>d!==i.RichTextNodeType.image&&d!==i.RichTextNodeType.embed),content:r.intersection([r.type({text:r.string}),r.partial({spans:e.ValidatedMetas})])}),r.partial({label:r.string,direction:r.string})])),e.Block=r.union([e.ImageBlock,e.EmbedBlock,e.TextBlock])}(Qs),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Blocks=e.StructuredTextContent=e.StructuredTextContentType=void 0;const t=ee.exports,n=Sn,r=(0,t.__importStar)(ie),i=Qs;e.StructuredTextContentType="StructuredTextContent",e.StructuredTextContent=new r.Type(e.StructuredTextContentType,o=>{var a;return((a=o)===null||a===void 0?void 0:a.__TYPE__)===e.StructuredTextContentType},(o,a)=>n.Chain.chain(r.array(i.Block).validate(o,a),u=>r.success({value:u,__TYPE__:e.StructuredTextContentType})),()=>{throw new Error("NotImplementedError: Not relevant method")}),e.Blocks=(0,t.__importStar)(Qs)}(Py);var eb={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.UIDContent=e.UIDContentType=void 0;const t=ee.exports,n=Sn,r=(0,t.__importStar)(ie);e.UIDContentType="UIDContent",e.UIDContent=new r.Type("UIDContent",i=>{var o;return((o=i)===null||o===void 0?void 0:o.__TYPE__)===e.UIDContentType},(i,o)=>n.Chain.chain(r.string.validate(i,o),a=>r.success({value:a,__TYPE__:"UIDContent"})),i=>i.value)})(eb),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SimpleWidgetContent=e.is=e.SimpleWidgetContentType=void 0;const t=ee.exports,n=ur,r=(0,t.__importStar)(yu),i=(0,t.__importStar)(ie),o=(0,t.__importDefault)(Ay),a=mh,u=(0,t.__importDefault)(Xs),s=ky,c=vh,l=(0,t.__importDefault)(Wy),f=bf(),d=Py,p=eb;e.SimpleWidgetContentType=["EmptyContent","ImageContent","GeoPointContent","EmbedContent","BooleanContent","IntegrationFieldsContent","StructuredTextContent","LinkContent","UIDContent","SeparatorContent","FieldContent"];function h(y){const b=y;return e.SimpleWidgetContentType.includes(b.__TYPE__)}e.is=h;const v=i.type({value:i.null});e.SimpleWidgetContent={from:(y,b)=>{if(b===null||v.is(b)){const w={type:y,__TYPE__:"EmptyContent"};return r.some(w)}switch(y){case"StructuredText":return r.fromEither(d.StructuredTextContent.decode(b));case"IntegrationFields":return r.fromEither(l.default.decode(b));case"Image":return(0,n.pipe)(r.fromEither(c.ImageContent.decode(b)),r.map(w=>c.ImageContent.encode(w)));case"GeoPoint":return(0,n.pipe)(r.fromEither(s.GeoPointContent.decode(b)),r.map(w=>s.GeoPointContent.encode(w)));case"Embed":return r.fromEither(a.EmbedContent.decode(b));case"Link":return r.fromEither(f.LinkContent.decode(b));case"UID":return r.fromEither(p.UIDContent.decode(b));case"Separator":return r.some({__TYPE__:"SeparatorContent"});case"Boolean":return r.fromEither(o.default.decode(b));default:return u.default.types.includes(y)?u.default.forType(y,b):r.none}},is:y=>e.SimpleWidgetContentType.includes(y.__TYPE__)}}(Cy),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.GroupContent=e.GroupContentType=e.GroupItemContentType=void 0;const t=ee.exports,n=(0,t.__importStar)(mq),r=(0,t.__importStar)(yu),i=(0,t.__importStar)(ie),o=Cy;e.GroupItemContentType="GroupItemContent",e.GroupContentType="GroupContentType",e.GroupContent=Object.freeze({itemsContentsFromJson:(a,u,s,c)=>u?u.map(l=>{if(typeof l=="object"&&l!==null){const d=Object.entries(l).sort(([p],[h])=>{var v,y;const b=(v=c.get(`${a}.${p}`))!==null&&v!==void 0?v:1e4,w=(y=c.get(`${a}.${h}`))!==null&&y!==void 0?y:1e4;return b-w}).map(([p,h])=>{const v=s.get(`${a}.${p}`);return v?r.map(y=>[p,y])(o.SimpleWidgetContent.from(v,h)):r.none});return{__TYPE__:"GroupItemContent",value:n.compact(d)}}else return{__TYPE__:"GroupItemContent",value:[]}}):[],fromJson:(a,u,s,c,l)=>{const f=Array.of(a,[u]).flat().join("."),d=r.fromEither(i.array(i.unknown).decode(s));return r.map(p=>({value:e.GroupContent.itemsContentsFromJson(f,p,c,l),__TYPE__:e.GroupContentType}))(d)}})}(xy);var da={},rc={};Object.defineProperty(rc,"__esModule",{value:!0}),rc.SeparatorContent=rc.SeparatorContentType=void 0,rc.SeparatorContentType="SeparatorContent",rc.SeparatorContent={is(e){return e.__TYPE__==="SeparatorContent"}},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.NestableTypes=e.Links=e.IntegrationFieldsContent=e.ImageContentView=e.ImageContent=e.GeoPointContent=e.FieldContent=e.BooleanContent=void 0;const t=ee.exports,n=Ay,r=mh,i=Xs,o=ky,a=vh,u=Wy,s=bf(),c=rc,l=Py;var f=Ay;Object.defineProperty(e,"BooleanContent",{enumerable:!0,get:function(){return(0,t.__importDefault)(f).default}}),(0,t.__exportStar)(mh,e);var d=Xs;Object.defineProperty(e,"FieldContent",{enumerable:!0,get:function(){return(0,t.__importDefault)(d).default}});var p=ky;Object.defineProperty(e,"GeoPointContent",{enumerable:!0,get:function(){return p.GeoPointContent}});var h=vh;Object.defineProperty(e,"ImageContent",{enumerable:!0,get:function(){return h.ImageContent}}),Object.defineProperty(e,"ImageContentView",{enumerable:!0,get:function(){return h.ImageContentView}});var v=Wy;Object.defineProperty(e,"IntegrationFieldsContent",{enumerable:!0,get:function(){return(0,t.__importDefault)(v).default}}),e.Links=(0,t.__importStar)(bf()),(0,t.__exportStar)(rc,e),(0,t.__exportStar)(Py,e),e.NestableTypes={Links:s.LinksTypes,StructuredText:l.StructuredTextContentType,Boolean:n.BooleanContentType,Embed:r.EmbedContentType,Field:i.FieldContentType,GeoPoint:o.GeoPointContentType,Image:a.ImageContentType,IntegrationFields:u.IntegrationFieldsContentType,Separator:c.SeparatorContentType}}(da);var H1={},ic={},Dq;function Lq(){if(Dq)return ic;Dq=1,Object.defineProperty(ic,"__esModule",{value:!0}),ic.CompositeSliceContent=ic.CompositeSliceContentType=void 0;const e=ee.exports,t=Sn,n=(0,e.__importStar)(yu),r=(0,e.__importStar)(ie),i=Tu();ic.CompositeSliceContentType="CompositeSliceContent";const o=r.exact(r.partial({repeat:r.array(r.unknown),"non-repeat":r.UnknownRecord}));return ic.CompositeSliceContent={fromJson:(a,u,s,c,l)=>{var f;const d=Array.of(a,[u,"repeat"]).flat().join("."),p=o.decode(s);if((0,t.isRight)(p)){const h=p.right.repeat,v=(f=p.right["non-repeat"])!==null&&f!==void 0?f:{},y=i.GroupContent.itemsContentsFromJson(d,h,c,l),w=Object.entries(v).sort(([F],[g])=>{var I,T;const k=(I=l.get(`${Array.of(a,[u]).flat().join(".")}.${F}`))!==null&&I!==void 0?I:1e4,E=(T=l.get(`${Array.of(a,[u]).flat().join(".")}.${g}`))!==null&&T!==void 0?T:1e4;return k-E}).reduce((F,[g,I])=>{const T=Array.of(a,[u,"non-repeat",g]).flat().join("."),k=c.get(T);if(k){const E=i.SimpleWidgetContent.from(k,I);n.isSome(E)&&(F[g]=E.value)}return F},{});return n.some({repeat:y,nonRepeat:w,__TYPE__:"CompositeSliceContent"})}else return n.none}},ic}var oc={},jq=hm(oi,function(e){return e.length>0},"NonEmptyString");function Uq(e,t){t===void 0&&(t="NonEmptyArray<"+e.name+">");var n=vm(e);return new ye(t,function(r){return n.is(r)&&Ct(r)},function(r,i){return ce(n.validate(r,i),Ar(function(o){var a=uS(o);return Ne(a)?Ye(r,i):Ie(a.value)}))},function(r){return n.encode(r)})}function Bq(e,t,n){n===void 0&&(n="Set<"+e.name+">");var r=vm(e),i=ZU(t),o=JU(t);return new ye(n,function(a){return a instanceof Set&&YU(e.is)(a)},function(a,u){return ce(r.validate(a,u),Ar(function(s){var c=o(s);return c.size!==s.length?Ye(a,u):Ie(c)}))},function(a){return r.encode(i(a))})}function m_e(e,t,n){return n===void 0&&(n="ReadonlySet<"+e.name+">"),Bq(e,t,n)}function J1(e,t){return new ye(e,t,function(n,r){return t(n)?Ie(n):Ye(n,r)},We)}var v_e=function(e){return e instanceof Date},g_e=J1("Date",v_e),y_e=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},b_e=function(e,t){return{get:e,reverseGet:t}},zq=function(e){return _u(e.get,H(e.reverseGet,Fn))},$_e=function(e){return ac(H(e.get,mt),e.reverseGet)},__e=function(e){return pa(H(e.get,mt),H(e.reverseGet,Fn))},S_e=function(e){return _f(function(t){return function(n){return function(r){return t.map(n(e.get(r)),function(i){return e.reverseGet(i)})}}})},_u=function(e,t){return{get:e,set:t}},G1=function(e){return pa(H(e.get,mt),e.set)},T_e=function(e){return _f(function(t){return function(n){return function(r){return t.map(n(e.get(r)),function(i){return e.set(i)(r)})}}})},qq=function(e){return function(t){return _u(function(n){return e.get(t.get(n))},function(n){return function(r){return t.set(e.set(n)(t.get(r)))(r)}})}},I_e=function(e){return function(t){return ac(H(t.getOption,eu(e.getOption)),H(e.reverseGet,t.reverseGet))}},O_e=function(e){return function(t){return uc(Y1(e))(G1(t))}},w_e=function(){return _u(B,Fn)},E_e=function(e){return function(t){return _u(function(n){return t.get(n)[e]},function(n){return function(r){var i,o=t.get(r);return n===o[e]?r:t.set(Object.assign({},o,(i={},i[e]=n,i)))(r)}})}},R_e=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(n){return _u(function(r){for(var i=n.get(r),o={},a=0,u=e;a<u.length;a++){var s=u[a];o[s]=i[s]}return o},function(r){return function(i){for(var o=n.get(i),a=0,u=e;a<u.length;a++){var s=u[a];if(r[s]!==o[s])return n.set(Object.assign({},o,r))(i)}return i}})}},M_e=function(e){return function(t){return _u(function(n){return t.get(n)[e]},function(n){return function(r){var i=t.get(r);if(n===i[e])return r;var o=i.slice();return o[e]=n,t.set(o)(r)}})}},x_e=function(e){return function(t){return ce(t,qq(X_e().at(e)))}},ac=function(e,t){return{getOption:e,reverseGet:t}},Y1=function(e){return pa(e.getOption,function(t){return Vq(t)(e)})},Kq=function(e){return _f(function(t){return function(n){return function(r){return ce(e.getOption(r),Ki(function(){return t.of(r)},function(i){return t.map(n(i),function(o){return Vq(o)(e)(r)})}))}}})},C_e=function(e){return function(t){return function(n){return ce(t.getOption(n),qi(function(r){var i=e(r);return i===r?n:t.reverseGet(i)}))}}},A_e=function(e){return function(t){var n=C_e(e)(t);return function(r){return ce(n(r),j0(function(){return r}))}}},Vq=function(e){return A_e(function(){return e})},k_e=function(e){return function(t){return uc(G1(e))(Y1(t))}},W_e=function(){return ac(ms,B)},Z1=function(e){return ac(Iv(e),B)},N_e=function(){return ac(B,mt)},P_e=function(){return ac($l,Be)},F_e=function(){return ac(function(e){return re(e)?mt(e.left):et},yt)},pa=function(e,t){return{getOption:e,set:t}},D_e=function(e){return _f(function(t){return function(n){return function(r){return ce(e.getOption(r),Ki(function(){return t.of(r)},function(i){return t.map(n(i),function(o){return e.set(o)(r)})}))}}})},Hq=function(e){return function(t){return function(n){return ce(t.getOption(n),qi(function(r){var i=e(r);return i===r?n:t.set(i)(n)}))}}},Jq=function(e){return function(t){var n=Hq(e)(t);return function(r){return ce(n(r),j0(function(){return r}))}}},uc=function(e){return function(t){return pa(H(t.getOption,eu(e.getOption)),function(n){return Jq(e.set(n))(t)})}},L_e=function(e){return function(t){return ce(t,uc(J_e().index(e)))}},j_e=function(e){return function(t){return ce(t,uc(G_e().index(e)))}},U_e=function(e){return function(t){return ce(t,uc(Y_e().index(e)))}},B_e=function(e){return pa(nv(e),function(t){return function(n){return ce(tv(e)(n),Ki(function(){return n},function(r){return hv(r,t,n)}))}})},Gq=function(e,t,n){if(n[e]===t)return n;var r=y_e([n[0]],n.slice(1),!0);return r[e]=t,r},z_e=function(e){return pa(nv(e),function(t){return function(n){return ce(tv(e)(n),Ki(function(){return n},function(r){return Gq(r,t,n)}))}})},_f=function(e){return{modifyF:e}};function X1(e){return function(t){return _f(function(n){return function(r){return t.modifyF(n)(e.modifyF(n)(r))}})}}var q_e={URI:"Identity",map:function(e,t){return t(e)},of:B,ap:function(e,t){return e(t)}},K_e=function(e){return e.URI==="Identity"};function V_e(e){return function(){return _f(function(t){var n=K_e(t)?e.map:e.traverse(t);return function(r){return function(i){return n(i,r)}}})}}function H_e(e){return X1(V_e(e)())}var Q1=function(e){return{index:e}},J_e=function(){return Q1(function(e){return pa(function(t){return Ro(e,t)},function(t){return function(n){return ce(Ro(e,n),Ki(function(){return n},function(){return hv(e,t,n)}))}})})},G_e=function(){return Q1(function(e){return pa(function(t){return Ro(e,t)},function(t){return function(n){return ce(Ro(e,n),Ki(function(){return n},function(){return Gq(e,t,n)}))}})})},Y_e=function(){return Q1(function(e){return pa(function(t){return ks(e,t)},function(t){return function(n){return n[e]===t||Ne(ks(e,n))?n:wO(e,t)(n)}})})},Z_e=function(e){return{at:e}};function X_e(){return Z_e(function(e){return _u(function(t){return ks(e,t)},Ki(function(){return Bg(e)},function(t){return wO(e,t)}))})}var Yq=b_e,eE=zq,tE=$_e,nE=__e,rE=S_e,Q_e=function(e){return function(t){return Yq(H(t.get,e.get),H(e.reverseGet,t.reverseGet))}},eSe=function(e){return Yq(e.reverseGet,e.get)},tSe=function(e){return function(t){return function(n){return t.reverseGet(e(t.get(n)))}}},Zq=_u,tb=w_e,Su=G1,Sf=T_e,sc=qq,nSe=sc,rSe=H(zq,sc),cc=O_e,iE=function(e){return H(Su,uc(e))},iSe=function(e){return H(Sf,X1(e))},Xq=function(e){return function(t){return function(n){var r=t.get(n),i=e(r);return r===i?n:t.set(i)(n)}}};function oSe(e){return function(t){return function(n){return function(r){return ce(n.get(r),t,function(i){return e.map(i,function(o){return n.set(o)(r)})})}}}}var aSe=function(e){return cc(W_e())(e)};function uSe(e){return cc(Z1(e))}var Qq=E_e,e2=R_e,sSe=M_e,cSe=function(e){return H(Su,L_e(e))},lSe=function(e){return H(Su,j_e(e))},fSe=function(e){return H(Su,U_e(e))},dSe=x_e,pSe=cc(N_e()),hSe=cc(P_e()),mSe=cc(F_e());function vSe(e){return H(Sf,H_e(e))}function gSe(e){return iE(B_e(e))}function ySe(e){return iE(z_e(e))}var bSe=function(e,t){return function(n){return t2(n,e,t)}},t2=function(e,t,n){return Zq(H(e.get,t),H(n,e.set))},nb="monocle-ts/Lens",$Se={URI:nb,imap:t2},n2={URI:nb,compose:function(e,t){return sc(e)(t)}},_Se={URI:nb,compose:n2.compose,id:tb};const SSe=Object.freeze(Object.defineProperty({__proto__:null,lens:Zq,id:tb,asOptional:Su,asTraversal:Sf,compose:sc,composeLens:nSe,composeIso:rSe,composePrism:cc,composeOptional:iE,composeTraversal:iSe,modify:Xq,modifyF:oSe,fromNullable:aSe,filter:uSe,prop:Qq,props:e2,component:sSe,index:cSe,indexNonEmpty:lSe,key:fSe,atKey:dSe,some:pSe,right:hSe,left:mSe,traverse:vSe,findFirst:gSe,findFirstNonEmpty:ySe,imap:bSe,URI:nb,Invariant:$Se,Semigroupoid:n2,Category:_Se},Symbol.toStringTag,{value:"Module"}));var r2=D_e,lc=uc,TSe=Hq,ISe=Jq,OSe=Z1,oE=Y1,aE=Kq,uE=I_e,wSe=k_e,ha=X1,i2=function(e){return function(t){return t.modifyF(q_e)(e)}},ESe=function(e){return i2(function(){return e})};function RSe(e){return ha(Kq(Z1(e)))}var o2=function(e){return new u2(e.get,e.reverseGet)},Tf=function(e){return new sE(e.get,e.set)},$h=function(e){return new s2(e.getOption,e.reverseGet)},Br=function(e){return new MSe(e.getOption,e.set)},br=function(e){return new xSe(e.modifyF)},a2=function(e,t,n){var r;return n===e[t]?e:Object.assign({},e,(r={},r[t]=n,r))},u2=function(){function e(t,n){this.get=t,this.reverseGet=n,this._tag="Iso",this.unwrap=this.get,this.to=this.get,this.wrap=this.reverseGet,this.from=this.reverseGet}return e.prototype.reverse=function(){return o2(eSe(this))},e.prototype.modify=function(t){return tSe(t)(this)},e.prototype.asLens=function(){return Tf(eE(this))},e.prototype.asPrism=function(){return $h(tE(this))},e.prototype.asOptional=function(){return Br(nE(this))},e.prototype.asTraversal=function(){return br(rE(this))},e.prototype.asFold=function(){var t=this;return new If(function(){return function(n){return function(r){return n(t.get(r))}}})},e.prototype.asGetter=function(){var t=this;return new l2(function(n){return t.get(n)})},e.prototype.asSetter=function(){var t=this;return new _h(function(n){return t.modify(n)})},e.prototype.compose=function(t){return o2(Q_e(t)(this))},e.prototype.composeIso=function(t){return this.compose(t)},e.prototype.composeLens=function(t){return Tf(ce(this,eE,sc(t)))},e.prototype.composePrism=function(t){return $h(ce(this,tE,uE(t)))},e.prototype.composeOptional=function(t){return Br(ce(this,nE,lc(t)))},e.prototype.composeTraversal=function(t){return br(ce(this,rE,ha(t)))},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeGetter=function(t){return this.asGetter().compose(t)},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e}(),sE=function(){function e(t,n){this.get=t,this.set=n,this._tag="Lens"}return e.fromPath=function(){var t=e.fromProp();return function(n){var r=t(n[0]);return n.slice(1).reduce(function(i,o){return i.compose(t(o))},r)}},e.fromProp=function(){return function(t){return Tf(ce(tb(),Qq(t)))}},e.fromProps=function(){return function(t){return Tf(ce(tb(),e2.apply(SSe,t)))}},e.fromNullableProp=function(){return function(t,n){return new e(function(r){var i=ms(r[t]);return Ne(i)?n:i.value},function(r){return function(i){return a2(i,t,r)}})}},e.prototype.modify=function(t){return Xq(t)(this)},e.prototype.asOptional=function(){return Br(Su(this))},e.prototype.asTraversal=function(){return br(Sf(this))},e.prototype.asSetter=function(){var t=this;return new _h(function(n){return t.modify(n)})},e.prototype.asGetter=function(){var t=this;return new l2(function(n){return t.get(n)})},e.prototype.asFold=function(){var t=this;return new If(function(){return function(n){return function(r){return n(t.get(r))}}})},e.prototype.compose=function(t){return Tf(sc(t)(this))},e.prototype.composeLens=function(t){return this.compose(t)},e.prototype.composeGetter=function(t){return this.asGetter().compose(t)},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeOptional=function(t){return Br(ce(this,Su,lc(t)))},e.prototype.composeTraversal=function(t){return br(ce(this,Sf,ha(t)))},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e.prototype.composeIso=function(t){return Tf(ce(this,sc(ce(t,eE))))},e.prototype.composePrism=function(t){return Br(cc(t)(this))},e}(),s2=function(){function e(t,n){this.getOption=t,this.reverseGet=n,this._tag="Prism"}return e.fromPredicate=function(t){return $h(OSe(t))},e.some=function(){return c2},e.prototype.modify=function(t){var n=this;return function(r){var i=n.modifyOption(t)(r);return Ne(i)?r:i.value}},e.prototype.modifyOption=function(t){var n=this;return function(r){return yN.map(n.getOption(r),function(i){var o=t(i);return o===i?r:n.reverseGet(o)})}},e.prototype.set=function(t){return this.modify(function(){return t})},e.prototype.asOptional=function(){return Br(oE(this))},e.prototype.asTraversal=function(){return br(aE(this))},e.prototype.asSetter=function(){var t=this;return new _h(function(n){return t.modify(n)})},e.prototype.asFold=function(){var t=this;return new If(function(n){return function(r){return function(i){var o=t.getOption(i);return Ne(o)?n.empty:r(o.value)}}})},e.prototype.compose=function(t){return $h(uE(t)(this))},e.prototype.composePrism=function(t){return this.compose(t)},e.prototype.composeOptional=function(t){return Br(ce(this,oE,lc(t)))},e.prototype.composeTraversal=function(t){return br(ce(this,aE,ha(t)))},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e.prototype.composeIso=function(t){return $h(ce(this,uE(ce(t,tE))))},e.prototype.composeLens=function(t){return Br(wSe(t)(this))},e.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},e}(),c2=new s2(B,mt),MSe=function(){function e(t,n){this.getOption=t,this.set=n,this._tag="Optional"}return e.fromPath=function(){var t=e.fromNullableProp();return function(n){var r=t(n[0]);return n.slice(1).reduce(function(i,o){return i.compose(t(o))},r)}},e.fromNullableProp=function(){return function(t){return new e(function(n){return ms(n[t])},function(n){return function(r){return r[t]==null?r:a2(r,t,n)}})}},e.fromOptionProp=function(){var t=sE.fromProp();return function(n){return t(n).composePrism(c2)}},e.prototype.modify=function(t){return ISe(t)(this)},e.prototype.modifyOption=function(t){return TSe(t)(this)},e.prototype.asTraversal=function(){return br(r2(this))},e.prototype.asFold=function(){var t=this;return new If(function(n){return function(r){return function(i){var o=t.getOption(i);return Ne(o)?n.empty:r(o.value)}}})},e.prototype.asSetter=function(){var t=this;return new _h(function(n){return t.modify(n)})},e.prototype.compose=function(t){return Br(lc(t)(this))},e.prototype.composeOptional=function(t){return this.compose(t)},e.prototype.composeTraversal=function(t){return br(ce(this,r2,ha(t)))},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e.prototype.composeLens=function(t){return Br(ce(this,lc(ce(t,Su))))},e.prototype.composePrism=function(t){return Br(ce(this,lc(ce(t,oE))))},e.prototype.composeIso=function(t){return Br(ce(this,lc(ce(t,nE))))},e.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},e}(),xSe=function(){function e(t){this.modifyF=t,this._tag="Traversal"}return e.prototype.modify=function(t){return i2(t)(this)},e.prototype.set=function(t){return ESe(t)(this)},e.prototype.filter=function(t){return br(RSe(t)(this))},e.prototype.asFold=function(){var t=this;return new If(function(n){return function(r){return t.modifyF(SN(n))(function(i){return _l(r(i))})}})},e.prototype.asSetter=function(){var t=this;return new _h(function(n){return t.modify(n)})},e.prototype.compose=function(t){return br(ha(t)(this))},e.prototype.composeTraversal=function(t){return this.compose(t)},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e.prototype.composeOptional=function(t){return this.compose(t.asTraversal())},e.prototype.composeLens=function(t){return br(ce(this,ha(ce(t,Sf))))},e.prototype.composePrism=function(t){return br(ce(this,ha(ce(t,aE))))},e.prototype.composeIso=function(t){return br(ce(this,ha(ce(t,rE))))},e.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},e}(),l2=function(){function e(t){this.get=t,this._tag="Getter"}return e.prototype.asFold=function(){var t=this;return new If(function(){return function(n){return function(r){return n(t.get(r))}}})},e.prototype.compose=function(t){var n=this;return new e(function(r){return t.get(n.get(r))})},e.prototype.composeGetter=function(t){return this.compose(t)},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeLens=function(t){return this.compose(t.asGetter())},e.prototype.composeIso=function(t){return this.compose(t.asGetter())},e.prototype.composeTraversal=function(t){return this.asFold().compose(t.asFold())},e.prototype.composeOptional=function(t){return this.asFold().compose(t.asFold())},e.prototype.composePrism=function(t){return this.asFold().compose(t.asFold())},e}(),If=function(){function e(t){this.foldMap=t,this._tag="Fold",this.getAll=t(b0())(Qa),this.exist=t($D),this.all=t(bD),this.foldMapFirst=t(bN())}return e.prototype.compose=function(t){var n=this;return new e(function(r){return function(i){return n.foldMap(r)(t.foldMap(r)(i))}})},e.prototype.composeFold=function(t){return this.compose(t)},e.prototype.composeGetter=function(t){return this.compose(t.asFold())},e.prototype.composeTraversal=function(t){return this.compose(t.asFold())},e.prototype.composeOptional=function(t){return this.compose(t.asFold())},e.prototype.composeLens=function(t){return this.compose(t.asFold())},e.prototype.composePrism=function(t){return this.compose(t.asFold())},e.prototype.composeIso=function(t){return this.compose(t.asFold())},e.prototype.find=function(t){return this.foldMapFirst(Iv(t))},e.prototype.headOption=function(t){return this.find(function(){return!0})(t)},e}(),_h=function(){function e(t){this.modify=t,this._tag="Setter"}return e.prototype.set=function(t){return this.modify(Fn(t))},e.prototype.compose=function(t){var n=this;return new e(function(r){return n.modify(t.modify(r))})},e.prototype.composeSetter=function(t){return this.compose(t)},e.prototype.composeTraversal=function(t){return this.compose(t.asSetter())},e.prototype.composeOptional=function(t){return this.compose(t.asSetter())},e.prototype.composeLens=function(t){return this.compose(t.asSetter())},e.prototype.composePrism=function(t){return this.compose(t.asSetter())},e.prototype.composeIso=function(t){return this.compose(t.asSetter())},e}(),CSe=new u2(Dc,Dc);function ASe(){return CSe}function kSe(e,t){t===void 0&&(t="fromNewtype("+e.name+")");var n=ASe();return new ye(t,function(r){return e.is(r)},function(r,i){return ce(e.validate(r,i),is(n.wrap))},function(r){return e.encode(n.unwrap(r))})}var WSe=Rd({_tag:wd("None")}),NSe=wd("Some");function f2(e,t){return t===void 0&&(t="Option<"+e.name+">"),Ed([WSe,Rd({_tag:NSe,value:e},"Some<"+e.name+">")],t)}function PSe(e,t){return t===void 0&&(t="Option<"+e.name+">"),new ye(t,f2(e).is,function(n,r){return n==null?Ie(et):ce(e.validate(n,r),is(mt))},function(n){return U0(ce(n,qi(e.encode)))})}var FSe=new ye("DateFromISOString",function(e){return e instanceof Date},function(e,t){return ce(oi.validate(e,t),Ar(function(n){var r=new Date(n);return isNaN(r.getTime())?Ye(e,t):Ie(r)}))},function(e){return e.toISOString()});function DSe(e,t){return t===void 0&&(t="ReadonlyNonEmptyArray<"+e.name+">"),Uq(e,t)}function d2(e){var t=Object.create(Object.getPrototypeOf(e));return Object.assign(t,e),t}var LSe=new ye("DateFromNumber",function(e){return e instanceof Date},function(e,t){return ce(ss.validate(e,t),Ar(function(n){var r=new Date(n);return isNaN(r.getTime())?Ye(e,t):Ie(r)}))},function(e){return e.getTime()});function rb(e,t,n){n===void 0&&(n=e.name);var r=d2(e);return r.validate=t,r.decode=function(i){return t(i,mC(r))},r.name=n,r}function jSe(e,t,n){return n===void 0&&(n="withFallback("+e.name+")"),rb(e,function(r,i){return Ix(function(){return Ie(t)})(e.validate(r,i))},n)}var USe=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,BSe=hm(oi,function(e){return USe.test(e)},"UUID");function zSe(e,t,n){return n===void 0&&(n="fromNullable("+e.name+")"),rb(e,function(r,i){return r==null?Ie(t):e.validate(r,i)},n)}var qSe=new ye("BooleanFromString",pm.is,function(e,t){return ce(oi.validate(e,t),Ar(function(n){return n==="true"?Ie(!0):n==="false"?Ie(!1):Ye(e,t)}))},String);function KSe(e,t){return rb(e,function(n,r){return Td(function(){return[{value:n,context:r,message:t(n,r),actual:n}]})(e.validate(n,r))})}function p2(e){switch(e._tag){case"InterfaceType":return e.props;case"ExactType":return p2(e.type)}}var VSe=sE.fromProp();function HSe(e){var t={};for(var n in p2(e))t[n]=VSe(n);return t}var JSe=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},GSe=J1("RegExp",JSe),YSe=new ye("DateFromUnixTime",function(e){return e instanceof Date},function(e,t){return ce(mm.validate(e,t),Ar(function(n){var r=new Date(n*1e3);return isNaN(r.getTime())?Ye(e,t):Ie(r)}))},function(e){return Math.floor(e.getTime()/1e3)}),cE=new ye("NumberFromString",ss.is,function(e,t){return ce(oi.validate(e,t),Ar(function(n){var r=+n;return isNaN(r)||n.trim()===""?Ye(e,t):Ie(r)}))},String),ZSe=new ye("IntFromString",mm.is,function(e,t){return ce(cE.validate(e,t),Ar(function(n){return mm.is(n)?Ie(n):Ye(e,t)}))},cE.encode),h2=f_("JsonArray",function(){return fC(ib)}),m2=f_("JsonRecord",function(){return h_(oi,ib)}),ib=Ed([pm,ss,oi,c_,h2,m2],"Json"),XSe=new ye("JsonFromString",ib.is,function(e,t){try{return Ie(JSON.parse(e))}catch{return Ye(e,t)}},function(e){return JSON.stringify(e)}),QSe=wd("Left"),e0e=wd("Right");function t0e(e,t,n){return n===void 0&&(n="Either<"+e.name+", "+t.name+">"),Ed([Rd({_tag:QSe,left:e},"Left<"+e.name+">"),Rd({_tag:e0e,right:t},"Right<"+e.name+">")],n)}var n0e=new ye("BigIntFromString",function(e){return typeof e=="bigint"},function(e,t){return ce(oi.validate(e,t),Ar(function(n){if(!jq.is(n.trim()))return Ye(e,t);try{return Ie(BigInt(n))}catch{return Ye(e,t)}}))},String);function r0e(e,t,n){return n===void 0&&(n=e.name),new ye(n,e.is,e.validate,t)}var i0e=new ye("BooleanFromNumber",pm.is,function(e,t){return ce(ss.validate(e,t),is(function(n){return n!==0}))},Number);const o0e=Da(Object.freeze(Object.defineProperty({__proto__:null,mapOutput:hq,NonEmptyString:jq,nonEmptyArray:Uq,readonlySetFromArray:m_e,fromRefinement:J1,date:g_e,fromNewtype:kSe,optionFromNullable:PSe,DateFromISOString:FSe,readonlyNonEmptyArray:DSe,clone:d2,DateFromNumber:LSe,withFallback:jSe,UUID:BSe,fromNullable:zSe,BooleanFromString:qSe,withMessage:KSe,withValidate:rb,getLenses:HSe,regexp:GSe,option:f2,DateFromUnixTime:YSe,NumberFromString:cE,setFromArray:Bq,IntFromString:ZSe,JsonArray:h2,JsonRecord:m2,Json:ib,JsonFromString:XSe,either:t0e,BigIntFromString:n0e,withEncode:r0e,BooleanFromNumber:i0e},Symbol.toStringTag,{value:"Module"})));var v2;function g2(){if(v2)return oc;v2=1,Object.defineProperty(oc,"__esModule",{value:!0}),oc.SharedSliceContent=oc.SharedSliceContentType=void 0;const e=ee.exports,t=Sn,n=(0,e.__importStar)(yu),r=(0,e.__importStar)(ie),i=o0e,o=Tu();oc.SharedSliceContentType="SharedSliceContent";const a=r.exact(r.type({variation:r.string,items:(0,i.withFallback)(r.array(r.unknown),[]),primary:(0,i.withFallback)(r.UnknownRecord,{})}));return oc.SharedSliceContent={fromJson:(u,s,c,l,f)=>{const d=(0,t.map)(p=>{const h=Array.of(u,[s,"variations",p.variation,"items"]).flat().join("."),v=o.GroupContent.itemsContentsFromJson(h,p.items,l,f),b=Object.entries(p.primary).sort(([F],[g])=>{var I,T;const k=(I=f.get(`${Array.of(u,[s]).flat().join(".")}.${F}`))!==null&&I!==void 0?I:1e4,E=(T=f.get(`${Array.of(u,[s]).flat().join(".")}.${g}`))!==null&&T!==void 0?T:1e4;return k-E}).reduce((F,[g,I])=>{const T=Array.of(u,[s,"variations",p.variation,"primary",g]).flat().join("."),k=l.get(T);if(k){const E=o.SimpleWidgetContent.from(k,I);n.isSome(E)&&(F[g]=E.value)}return F},{});return{variation:p.variation,primary:b,items:v,__TYPE__:"SharedSliceContent"}})(a.decode(c));return n.fromEither(d)}},oc}var ob={},Of={};Object.defineProperty(Of,"__esModule",{value:!0});const a0e=ee.exports,u0e=(0,a0e.__importStar)(yu),y2=xy,b2=Cy,s0e={fromJson:(e,t,n,r,i)=>{const o=Array.of(e,[t]).flat().join("."),a=r.get(o);return a==="Group"?y2.GroupContent.fromJson(e,t,n,r,i):a?b2.SimpleWidgetContent.from(a,n):u0e.none},is:e=>b2.SimpleWidgetContent.is(e)||y2.GroupContentType===e.__TYPE__};Of.default=s0e,Object.defineProperty(ob,"__esModule",{value:!0}),ob.SimpleSliceContent=void 0;const c0e=ee.exports,l0e=(0,c0e.__importDefault)(Of);ob.SimpleSliceContent=l0e.default;var lE={},Sh={},$2;function _2(){if($2)return Sh;$2=1,Object.defineProperty(Sh,"__esModule",{value:!0}),Sh.SliceWidgetContent=void 0;const e=ee.exports,t=(0,e.__importStar)(yu),n=(0,e.__importDefault)(Of),r=Lq(),i=g2();return Sh.SliceWidgetContent={fromJson:(o,a,u,s,c)=>{const l=Array.of(o,[a]).flat().join("."),f=s.get(l);return f==="SharedSlice"?i.SharedSliceContent.fromJson(o,a,u,s,c):f==="Slice"?r.CompositeSliceContent.fromJson(o,a,u,s,c):f?n.default.fromJson(o,a,u,s,c):t.none}},Sh}var S2;function f0e(){return S2||(S2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SlicesContent=e.SlicesContentType=void 0;const t=ee.exports,n=(0,t.__importStar)(mq),r=ur,i=(0,t.__importStar)(yu),o=(0,t.__importStar)(ie),a=je,u=_2();e.SlicesContentType="SliceContentType";const s=o.exact(o.intersection([o.type({key:o.string,value:o.unknown}),o.partial({label:(0,a.nullable)(o.string)})]));e.SlicesContent={itemsCodec:(c,l)=>(0,r.pipe)(s.decode(c),i.fromEither,i.chain(f=>{const d=f.key.indexOf("$"),p=f.key.substring(0,d>0?d:void 0),h=l(p,f.value);return i.map(v=>{var y;return{key:f.key,name:p,maybeLabel:(y=f.label)!==null&&y!==void 0?y:void 0,widget:v}})(h)})),fromJson:(c,l,f,d)=>{if(f.get(c)==="Slices"){const p=i.getOrElse(()=>new Array)(i.fromEither(o.array(o.unknown).decode(l))),h=(v,y)=>u.SliceWidgetContent.fromJson([c],v,y,f,d);return i.some({value:n.compact(p.map(v=>e.SlicesContent.itemsCodec(v,h))),__TYPE__:e.SlicesContentType})}else return console.error("fieldTypes.get(key) !== 'Slices'"),i.none}}}(lE)),lE}var T2;function I2(){return T2||(T2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=ee.exports;(0,t.__exportStar)(Lq(),e),(0,t.__exportStar)(g2(),e),(0,t.__exportStar)(ob,e),(0,t.__exportStar)(f0e(),e),(0,t.__exportStar)(_2(),e)}(H1)),H1}var O2;function Tu(){return O2||(O2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Widget=e.WidgetKey=e.WidgetTypes=e.StaticWidgetContent=e.Slices=e.Nestable=void 0;const t=ee.exports,n=(0,t.__importStar)(ie),r=je,i=F1,o=xy,a=da,u=I2(),s=(0,t.__importDefault)(Of),c=eb;(0,t.__exportStar)(F1,e),(0,t.__exportStar)(xy,e),e.Nestable=(0,t.__importStar)(da),(0,t.__exportStar)(Cy,e),e.Slices=(0,t.__importStar)(I2());var l=Of;Object.defineProperty(e,"StaticWidgetContent",{enumerable:!0,get:function(){return(0,t.__importDefault)(l).default}}),(0,t.__exportStar)(eb,e),e.WidgetTypes={...a.NestableTypes,Empty:i.EmptyContentType,UID:c.UIDContentType,Group:o.GroupContentType,slices:u.SlicesContentType};const f=new RegExp("^[^<>]+$");e.WidgetKey=(0,r.refineType)(n.string,"WidgetKey",d=>d.length===0||f.test(d)),e.Widget={fromJson(d,p,h,v){return h.get(d)==="Slices"?u.SlicesContent.fromJson(d,p,h,v):s.default.fromJson([],d,p,h,v)}}}(P1)),P1}var Oi={},Th={};Object.defineProperty(Th,"__esModule",{value:!0});const w2=ee.exports,wi=(0,w2.__importStar)(ie),d0e=Tu(),E2=Ze,p0e=(0,w2.__importDefault)($u),h0e=pt,m0e=wi.exact(wi.partial({label:E2.StringOrNull,repeat:wi.boolean,fields:wi.record(d0e.WidgetKey,p0e.default)})),v0e=wi.exact(wi.intersection([wi.type({type:wi.literal(h0e.WidgetTypes.Group)}),wi.partial({fieldset:E2.StringOrNull,icon:wi.string,description:wi.string,config:m0e})]));Th.default=v0e;var fE={},ab={},ma={};Object.defineProperty(ma,"__esModule",{value:!0}),ma.SlicesTypes=void 0,ma.SlicesTypes={Slice:"Slice",SharedSlice:"SharedSlice"},Object.defineProperty(ab,"__esModule",{value:!0});const R2=ee.exports,zr=(0,R2.__importStar)(ie),M2=Tu(),x2=Ze,C2=(0,R2.__importDefault)($u),g0e=ma,y0e=zr.exact(zr.partial({label:x2.StringOrNull})),b0e=zr.exact(zr.intersection([zr.type({type:zr.literal(g0e.SlicesTypes.Slice)}),zr.partial({fieldset:x2.StringOrNull,description:zr.string,icon:zr.string,display:zr.string,"non-repeat":zr.record(M2.WidgetKey,C2.default),repeat:zr.record(M2.WidgetKey,C2.default),config:y0e})]));ab.default=b0e;var ub={};Object.defineProperty(ub,"__esModule",{value:!0});const dE=ee.exports,$0e=(0,dE.__importStar)(ie),_0e=(0,dE.__importDefault)(Th),S0e=(0,dE.__importDefault)($u),T0e=$0e.union([S0e.default,_0e.default]);ub.default=T0e;var pE={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SharedSlice=e.Variation=void 0;const t=ee.exports,n=(0,t.__importStar)(ie),r=Jc,i=Tu(),o=(0,t.__importDefault)($u),a=ma,u="https://images.prismic.io/slice-machine/621a5ec4-0387-4bc5-9860-2dd46cbc07cd_default_ss.png?auto=compress,format";e.Variation=n.exact(n.intersection([n.type({id:n.string,name:n.string,description:n.string,imageUrl:(0,r.withFallback)(n.string,u),docURL:n.string,version:n.string}),n.partial({display:n.string,primary:n.record(i.WidgetKey,o.default),items:n.record(i.WidgetKey,o.default)})])),e.SharedSlice=n.exact(n.intersection([n.type({id:n.string,type:n.literal(a.SlicesTypes.SharedSlice),name:n.string,variations:n.readonlyArray(e.Variation)}),n.partial({description:n.string})]))})(pE);var sb={};Object.defineProperty(sb,"__esModule",{value:!0});const I0e=ee.exports,hE=(0,I0e.__importStar)(ie),O0e=ma,w0e=hE.exact(hE.type({type:hE.literal(O0e.SlicesTypes.SharedSlice)}));sb.default=w0e,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Slices=e.DynamicSlices=e.StaticSlices=e.slicesReader=e.DynamicSlicesConfig=e.StaticSlicesConfig=e.slicesConfigReader=e.SlicesLabels=void 0;const t=ee.exports,n=(0,t.__importStar)(ie),r=Tu(),i=Ze,o=pt,a=(0,t.__importDefault)(ab),u=(0,t.__importDefault)(ub),s=pE,c=(0,t.__importDefault)(sb),l=ma;e.SlicesLabels=n.union([n.record(n.string,n.readonlyArray(n.exact(n.intersection([n.type({name:n.string}),n.partial({display:n.string})])))),n.null]);function f(h){return n.exact(n.partial({label:i.StringOrNull,labels:e.SlicesLabels,choices:n.record(r.WidgetKey,n.union([u.default,a.default,h]))}))}e.slicesConfigReader=f,e.StaticSlicesConfig=f(s.SharedSlice),e.DynamicSlicesConfig=f(c.default);const d={toStatic(h,v){const y=Object.entries(h.choices||{}).reduce((b,[w,F])=>{if(F.type===l.SlicesTypes.SharedSlice){const g=v.get(w);return g?{...b,[w]:g}:b}else return{...b,[w]:F}},{});return{...h,choices:y}}};function p(h){return n.exact(n.intersection([n.type({type:n.union([n.literal(o.WidgetTypes.Slices),n.literal(o.WidgetTypes.LegacySlices)])}),n.partial({fieldset:i.StringOrNull,config:h})]))}e.slicesReader=p,e.StaticSlices=p(e.StaticSlicesConfig),e.DynamicSlices=p(e.DynamicSlicesConfig),e.Slices={toStatic(h,v){return h.config?{...h,config:d.toStatic(h.config,v)}:h}}}(fE);var cb={};Object.defineProperty(cb,"__esModule",{value:!0});const E0e=ee.exports,va=(0,E0e.__importStar)(ie),A2=Ze,R0e=pt,M0e=va.exact(va.partial({label:A2.StringOrNull,useAsTitle:va.boolean,placeholder:va.string})),x0e=va.exact(va.intersection([va.type({type:va.literal(R0e.WidgetTypes.UID)}),va.partial({fieldset:A2.StringOrNull,config:M0e})]));cb.default=x0e,Object.defineProperty(Oi,"__esModule",{value:!0}),Oi.Widgets=Oi.DynamicWidget=Oi.StaticWidget=Oi.widgetReader=void 0;const lb=ee.exports,C0e=(0,lb.__importStar)(ie),A0e=(0,lb.__importDefault)(Th),k0e=(0,lb.__importDefault)($u),mE=fE,W0e=(0,lb.__importDefault)(cb),k2=pt;function vE(e){return C0e.union([W0e.default,k0e.default,A0e.default,e])}Oi.widgetReader=vE,Oi.StaticWidget=vE(mE.StaticSlices),Oi.DynamicWidget=vE(mE.DynamicSlices),Oi.Widgets={toStatic(e,t){switch(e.type){case k2.WidgetTypes.LegacySlices:case k2.WidgetTypes.Slices:return mE.Slices.toStatic(e,t);default:return e}}},Object.defineProperty(Ii,"__esModule",{value:!0}),Ii.Sections=Ii.DynamicSection=Ii.StaticSection=Ii.sectionReader=void 0;const N0e=ee.exports,P0e=(0,N0e.__importStar)(ie),F0e=Tu(),gE=Oi;function yE(e){return P0e.record(F0e.WidgetKey,e)}Ii.sectionReader=yE,Ii.StaticSection=yE(gE.StaticWidget),Ii.DynamicSection=yE(gE.DynamicWidget),Ii.Sections={toStatic(e,t){return Object.entries(e).reduce((r,[i,o])=>({...r,[i]:gE.Widgets.toStatic(o,t)}),{})}},Object.defineProperty(pn,"__esModule",{value:!0}),pn.filterMissingSharedSlices=pn.collectWidgets=pn.validateSlices=pn.toStatic=pn.flattenWidgets=pn.CustomType=pn.StaticCustomType=void 0;const D0e=ee.exports,W2=_o,oo=(0,D0e.__importStar)(ie),N2=Jc,L0e=Ze,bE=Ii,P2=ma,F2=pt;class j0e 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:
1
+ (function(ti,ae){typeof exports=="object"&&typeof module<"u"?ae(exports,require("react"),require("@prismicio/editor-ui"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","@prismicio/editor-ui","react-dom"],ae):(ti=typeof globalThis<"u"?globalThis:ti||self,ae(ti.EditorFields={},ti.React,ti.EditorUi,ti.ReactDOM))})(this,function(ti,ae,P,sm){"use strict";const NM=e=>e&&typeof e=="object"&&"default"in e?e:{default:e};function PM(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const Nc=NM(ae),ye=PM(ae),N5=NM(sm),P5=PM(sm);var se=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Fa(e){var t=e.default;if(typeof t=="function"){var n=function(){return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var FM={},ee={exports:{}};(function(e){var t,n,r,i,o,a,u,s,c,l,f,d,p,h,v,y,b,w,F,g,I,T,k,E,H;(function(q){var x=typeof se=="object"?se:typeof self=="object"?self:typeof this=="object"?this:{};q(J(x,J(e.exports)));function J(O,R){return O!==x&&(typeof Object.create=="function"?Object.defineProperty(O,"__esModule",{value:!0}):O.__esModule=!0),function(C,L){return O[C]=R?R(C,L):L}}})(function(q){var x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(O,R){O.__proto__=R}||function(O,R){for(var C in R)Object.prototype.hasOwnProperty.call(R,C)&&(O[C]=R[C])};t=function(O,R){if(typeof R!="function"&&R!==null)throw new TypeError("Class extends value "+String(R)+" is not a constructor or null");x(O,R);function C(){this.constructor=O}O.prototype=R===null?Object.create(R):(C.prototype=R.prototype,new C)},n=Object.assign||function(O){for(var R,C=1,L=arguments.length;C<L;C++){R=arguments[C];for(var z in R)Object.prototype.hasOwnProperty.call(R,z)&&(O[z]=R[z])}return O},r=function(O,R){var C={};for(var L in O)Object.prototype.hasOwnProperty.call(O,L)&&R.indexOf(L)<0&&(C[L]=O[L]);if(O!=null&&typeof Object.getOwnPropertySymbols=="function")for(var z=0,L=Object.getOwnPropertySymbols(O);z<L.length;z++)R.indexOf(L[z])<0&&Object.prototype.propertyIsEnumerable.call(O,L[z])&&(C[L[z]]=O[L[z]]);return C},i=function(O,R,C,L){var z=arguments.length,j=z<3?R:L===null?L=Object.getOwnPropertyDescriptor(R,C):L,S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(O,R,C,L);else for(var _=O.length-1;_>=0;_--)(S=O[_])&&(j=(z<3?S(j):z>3?S(R,C,j):S(R,C))||j);return z>3&&j&&Object.defineProperty(R,C,j),j},o=function(O,R){return function(C,L){R(C,L,O)}},a=function(O,R){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(O,R)},u=function(O,R,C,L){function z(j){return j instanceof C?j:new C(function(S){S(j)})}return new(C||(C=Promise))(function(j,S){function _(ge){try{Y(L.next(ge))}catch(he){S(he)}}function U(ge){try{Y(L.throw(ge))}catch(he){S(he)}}function Y(ge){ge.done?j(ge.value):z(ge.value).then(_,U)}Y((L=L.apply(O,R||[])).next())})},s=function(O,R){var C={label:0,sent:function(){if(j[0]&1)throw j[1];return j[1]},trys:[],ops:[]},L,z,j,S;return S={next:_(0),throw:_(1),return:_(2)},typeof Symbol=="function"&&(S[Symbol.iterator]=function(){return this}),S;function _(Y){return function(ge){return U([Y,ge])}}function U(Y){if(L)throw new TypeError("Generator is already executing.");for(;C;)try{if(L=1,z&&(j=Y[0]&2?z.return:Y[0]?z.throw||((j=z.return)&&j.call(z),0):z.next)&&!(j=j.call(z,Y[1])).done)return j;switch(z=0,j&&(Y=[Y[0]&2,j.value]),Y[0]){case 0:case 1:j=Y;break;case 4:return C.label++,{value:Y[1],done:!1};case 5:C.label++,z=Y[1],Y=[0];continue;case 7:Y=C.ops.pop(),C.trys.pop();continue;default:if(j=C.trys,!(j=j.length>0&&j[j.length-1])&&(Y[0]===6||Y[0]===2)){C=0;continue}if(Y[0]===3&&(!j||Y[1]>j[0]&&Y[1]<j[3])){C.label=Y[1];break}if(Y[0]===6&&C.label<j[1]){C.label=j[1],j=Y;break}if(j&&C.label<j[2]){C.label=j[2],C.ops.push(Y);break}j[2]&&C.ops.pop(),C.trys.pop();continue}Y=R.call(O,C)}catch(ge){Y=[6,ge],z=0}finally{L=j=0}if(Y[0]&5)throw Y[1];return{value:Y[0]?Y[1]:void 0,done:!0}}},c=function(O,R){for(var C in O)C!=="default"&&!Object.prototype.hasOwnProperty.call(R,C)&&H(R,O,C)},H=Object.create?function(O,R,C,L){L===void 0&&(L=C);var z=Object.getOwnPropertyDescriptor(R,C);(!z||("get"in z?!R.__esModule:z.writable||z.configurable))&&(z={enumerable:!0,get:function(){return R[C]}}),Object.defineProperty(O,L,z)}:function(O,R,C,L){L===void 0&&(L=C),O[L]=R[C]},l=function(O){var R=typeof Symbol=="function"&&Symbol.iterator,C=R&&O[R],L=0;if(C)return C.call(O);if(O&&typeof O.length=="number")return{next:function(){return O&&L>=O.length&&(O=void 0),{value:O&&O[L++],done:!O}}};throw new TypeError(R?"Object is not iterable.":"Symbol.iterator is not defined.")},f=function(O,R){var C=typeof Symbol=="function"&&O[Symbol.iterator];if(!C)return O;var L=C.call(O),z,j=[],S;try{for(;(R===void 0||R-- >0)&&!(z=L.next()).done;)j.push(z.value)}catch(_){S={error:_}}finally{try{z&&!z.done&&(C=L.return)&&C.call(L)}finally{if(S)throw S.error}}return j},d=function(){for(var O=[],R=0;R<arguments.length;R++)O=O.concat(f(arguments[R]));return O},p=function(){for(var O=0,R=0,C=arguments.length;R<C;R++)O+=arguments[R].length;for(var L=Array(O),z=0,R=0;R<C;R++)for(var j=arguments[R],S=0,_=j.length;S<_;S++,z++)L[z]=j[S];return L},h=function(O,R,C){if(C||arguments.length===2)for(var L=0,z=R.length,j;L<z;L++)(j||!(L in R))&&(j||(j=Array.prototype.slice.call(R,0,L)),j[L]=R[L]);return O.concat(j||Array.prototype.slice.call(R))},v=function(O){return this instanceof v?(this.v=O,this):new v(O)},y=function(O,R,C){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var L=C.apply(O,R||[]),z,j=[];return z={},S("next"),S("throw"),S("return"),z[Symbol.asyncIterator]=function(){return this},z;function S(Te){L[Te]&&(z[Te]=function(Qe){return new Promise(function(Ft,Jt){j.push([Te,Qe,Ft,Jt])>1||_(Te,Qe)})})}function _(Te,Qe){try{U(L[Te](Qe))}catch(Ft){he(j[0][3],Ft)}}function U(Te){Te.value instanceof v?Promise.resolve(Te.value.v).then(Y,ge):he(j[0][2],Te)}function Y(Te){_("next",Te)}function ge(Te){_("throw",Te)}function he(Te,Qe){Te(Qe),j.shift(),j.length&&_(j[0][0],j[0][1])}},b=function(O){var R,C;return R={},L("next"),L("throw",function(z){throw z}),L("return"),R[Symbol.iterator]=function(){return this},R;function L(z,j){R[z]=O[z]?function(S){return(C=!C)?{value:v(O[z](S)),done:z==="return"}:j?j(S):S}:j}},w=function(O){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var R=O[Symbol.asyncIterator],C;return R?R.call(O):(O=typeof l=="function"?l(O):O[Symbol.iterator](),C={},L("next"),L("throw"),L("return"),C[Symbol.asyncIterator]=function(){return this},C);function L(j){C[j]=O[j]&&function(S){return new Promise(function(_,U){S=O[j](S),z(_,U,S.done,S.value)})}}function z(j,S,_,U){Promise.resolve(U).then(function(Y){j({value:Y,done:_})},S)}},F=function(O,R){return Object.defineProperty?Object.defineProperty(O,"raw",{value:R}):O.raw=R,O};var J=Object.create?function(O,R){Object.defineProperty(O,"default",{enumerable:!0,value:R})}:function(O,R){O.default=R};g=function(O){if(O&&O.__esModule)return O;var R={};if(O!=null)for(var C in O)C!=="default"&&Object.prototype.hasOwnProperty.call(O,C)&&H(R,O,C);return J(R,O),R},I=function(O){return O&&O.__esModule?O:{default:O}},T=function(O,R,C,L){if(C==="a"&&!L)throw new TypeError("Private accessor was defined without a getter");if(typeof R=="function"?O!==R||!L:!R.has(O))throw new TypeError("Cannot read private member from an object whose class did not declare it");return C==="m"?L:C==="a"?L.call(O):L?L.value:R.get(O)},k=function(O,R,C,L,z){if(L==="m")throw new TypeError("Private method is not writable");if(L==="a"&&!z)throw new TypeError("Private accessor was defined without a setter");if(typeof R=="function"?O!==R||!z:!R.has(O))throw new TypeError("Cannot write private member to an object whose class did not declare it");return L==="a"?z.call(O,C):z?z.value=C:R.set(O,C),C},E=function(O,R){if(R===null||typeof R!="object"&&typeof R!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof O=="function"?R===O:O.has(R)},q("__extends",t),q("__assign",n),q("__rest",r),q("__decorate",i),q("__param",o),q("__metadata",a),q("__awaiter",u),q("__generator",s),q("__exportStar",c),q("__createBinding",H),q("__values",l),q("__read",f),q("__spread",d),q("__spreadArrays",p),q("__spreadArray",h),q("__await",v),q("__asyncGenerator",y),q("__asyncDelegator",b),q("__asyncValues",w),q("__makeTemplateObject",F),q("__importStar",g),q("__importDefault",I),q("__classPrivateFieldGet",T),q("__classPrivateFieldSet",k),q("__classPrivateFieldIn",E)})})(ee);var pn={},$o={},Pc={},Gt={},Da={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getEndomorphismMonoid=e.not=e.SK=e.hole=e.pipe=e.untupled=e.tupled=e.absurd=e.decrement=e.increment=e.tuple=e.flow=e.flip=e.constVoid=e.constUndefined=e.constNull=e.constFalse=e.constTrue=e.constant=e.unsafeCoerce=e.identity=e.apply=e.getRing=e.getSemiring=e.getMonoid=e.getSemigroup=e.getBooleanAlgebra=void 0;var t=function(I){return function(){return{meet:function(T,k){return function(E){return I.meet(T(E),k(E))}},join:function(T,k){return function(E){return I.join(T(E),k(E))}},zero:function(){return I.zero},one:function(){return I.one},implies:function(T,k){return function(E){return I.implies(T(E),k(E))}},not:function(T){return function(k){return I.not(T(k))}}}}};e.getBooleanAlgebra=t;var n=function(I){return function(){return{concat:function(T,k){return function(E){return I.concat(T(E),k(E))}}}}};e.getSemigroup=n;var r=function(I){var T=(0,e.getSemigroup)(I);return function(){return{concat:T().concat,empty:function(){return I.empty}}}};e.getMonoid=r;var i=function(I){return{add:function(T,k){return function(E){return I.add(T(E),k(E))}},zero:function(){return I.zero},mul:function(T,k){return function(E){return I.mul(T(E),k(E))}},one:function(){return I.one}}};e.getSemiring=i;var o=function(I){var T=(0,e.getSemiring)(I);return{add:T.add,mul:T.mul,one:T.one,zero:T.zero,sub:function(k,E){return function(H){return I.sub(k(H),E(H))}}}};e.getRing=o;var a=function(I){return function(T){return T(I)}};e.apply=a;function u(I){return I}e.identity=u,e.unsafeCoerce=u;function s(I){return function(){return I}}e.constant=s,e.constTrue=s(!0),e.constFalse=s(!1),e.constNull=s(null),e.constUndefined=s(void 0),e.constVoid=e.constUndefined;function c(I){return function(T,k){return I(k,T)}}e.flip=c;function l(I,T,k,E,H,q,x,J,O){switch(arguments.length){case 1:return I;case 2:return function(){return T(I.apply(this,arguments))};case 3:return function(){return k(T(I.apply(this,arguments)))};case 4:return function(){return E(k(T(I.apply(this,arguments))))};case 5:return function(){return H(E(k(T(I.apply(this,arguments)))))};case 6:return function(){return q(H(E(k(T(I.apply(this,arguments))))))};case 7:return function(){return x(q(H(E(k(T(I.apply(this,arguments)))))))};case 8:return function(){return J(x(q(H(E(k(T(I.apply(this,arguments))))))))};case 9:return function(){return O(J(x(q(H(E(k(T(I.apply(this,arguments)))))))))}}}e.flow=l;function f(){for(var I=[],T=0;T<arguments.length;T++)I[T]=arguments[T];return I}e.tuple=f;function d(I){return I+1}e.increment=d;function p(I){return I-1}e.decrement=p;function h(I){throw new Error("Called `absurd` function which should be uncallable")}e.absurd=h;function v(I){return function(T){return I.apply(void 0,T)}}e.tupled=v;function y(I){return function(){for(var T=[],k=0;k<arguments.length;k++)T[k]=arguments[k];return I(T)}}e.untupled=y;function b(I,T,k,E,H,q,x,J,O){switch(arguments.length){case 1:return I;case 2:return T(I);case 3:return k(T(I));case 4:return E(k(T(I)));case 5:return H(E(k(T(I))));case 6:return q(H(E(k(T(I)))));case 7:return x(q(H(E(k(T(I))))));case 8:return J(x(q(H(E(k(T(I)))))));case 9:return O(J(x(q(H(E(k(T(I))))))));default:{for(var R=arguments[0],C=1;C<arguments.length;C++)R=arguments[C](R);return R}}}e.pipe=b,e.hole=h;var w=function(I,T){return T};e.SK=w;function F(I){return function(T){return!I(T)}}e.not=F;var g=function(){return{concat:function(I,T){return l(I,T)},empty:u}};e.getEndomorphismMonoid=g})(Da);var Re={},F5=se&&se.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))};Object.defineProperty(Re,"__esModule",{value:!0}),Re.fromReadonlyNonEmptyArray=Re.has=Re.emptyRecord=Re.emptyReadonlyArray=Re.tail=Re.head=Re.isNonEmpty=Re.singleton=Re.right=Re.left=Re.isRight=Re.isLeft=Re.some=Re.none=Re.isSome=Re.isNone=void 0;var D5=function(e){return e._tag==="None"};Re.isNone=D5;var L5=function(e){return e._tag==="Some"};Re.isSome=L5,Re.none={_tag:"None"};var j5=function(e){return{_tag:"Some",value:e}};Re.some=j5;var U5=function(e){return e._tag==="Left"};Re.isLeft=U5;var B5=function(e){return e._tag==="Right"};Re.isRight=B5;var z5=function(e){return{_tag:"Left",left:e}};Re.left=z5;var q5=function(e){return{_tag:"Right",right:e}};Re.right=q5;var K5=function(e){return[e]};Re.singleton=K5;var V5=function(e){return e.length>0};Re.isNonEmpty=V5;var H5=function(e){return e[0]};Re.head=H5;var J5=function(e){return e.slice(1)};Re.tail=J5,Re.emptyReadonlyArray=[],Re.emptyRecord={},Re.has=Object.prototype.hasOwnProperty;var G5=function(e){return F5([e[0]],e.slice(1),!0)};Re.fromReadonlyNonEmptyArray=G5;var Y5=se&&se.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),Z5=se&&se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),X5=se&&se.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&Y5(t,e,n);return Z5(t,e),t};Object.defineProperty(Gt,"__esModule",{value:!0}),Gt.sequenceS=Gt.sequenceT=Gt.getApplySemigroup=Gt.apS=Gt.apSecond=Gt.apFirst=Gt.ap=void 0;var Q5=Da,eH=X5(Re);function tH(e,t){return function(n){return function(r){return e.ap(e.map(r,function(i){return function(o){return t.ap(i,o)}}),n)}}}Gt.ap=tH;function nH(e){return function(t){return function(n){return e.ap(e.map(n,function(r){return function(){return r}}),t)}}}Gt.apFirst=nH;function rH(e){return function(t){return function(n){return e.ap(e.map(n,function(){return function(r){return r}}),t)}}}Gt.apSecond=rH;function iH(e){return function(t,n){return function(r){return e.ap(e.map(r,function(i){return function(o){var a;return Object.assign({},i,(a={},a[t]=o,a))}}),n)}}}Gt.apS=iH;function oH(e){return function(t){return{concat:function(n,r){return e.ap(e.map(n,function(i){return function(o){return t.concat(i,o)}}),r)}}}}Gt.getApplySemigroup=oH;function R$(e,t,n){return function(r){for(var i=Array(n.length+1),o=0;o<n.length;o++)i[o]=n[o];return i[n.length]=r,t===0?e.apply(null,i):R$(e,t-1,i)}}var M$={1:function(e){return[e]},2:function(e){return function(t){return[e,t]}},3:function(e){return function(t){return function(n){return[e,t,n]}}},4:function(e){return function(t){return function(n){return function(r){return[e,t,n,r]}}}},5:function(e){return function(t){return function(n){return function(r){return function(i){return[e,t,n,r,i]}}}}}};function aH(e){return eH.has.call(M$,e)||(M$[e]=R$(Q5.tuple,e-1,[])),M$[e]}function uH(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r=t.length,i=aH(r),o=e.map(t[0],i),a=1;a<r;a++)o=e.ap(o,t[a]);return o}}Gt.sequenceT=uH;function sH(e){var t=e.length;switch(t){case 1:return function(n){var r;return r={},r[e[0]]=n,r};case 2:return function(n){return function(r){var i;return i={},i[e[0]]=n,i[e[1]]=r,i}};case 3:return function(n){return function(r){return function(i){var o;return o={},o[e[0]]=n,o[e[1]]=r,o[e[2]]=i,o}}};case 4:return function(n){return function(r){return function(i){return function(o){var a;return a={},a[e[0]]=n,a[e[1]]=r,a[e[2]]=i,a[e[3]]=o,a}}}};case 5:return function(n){return function(r){return function(i){return function(o){return function(a){var u;return u={},u[e[0]]=n,u[e[1]]=r,u[e[2]]=i,u[e[3]]=o,u[e[4]]=a,u}}}}};default:return R$(function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i={},o=0;o<t;o++)i[e[o]]=n[o];return i},t-1,[])}}function cH(e){return function(t){for(var n=Object.keys(t),r=n.length,i=sH(n),o=e.map(t[n[0]],i),a=1;a<r;a++)o=e.ap(o,t[n[a]]);return o}}Gt.sequenceS=cH;var xr={};Object.defineProperty(xr,"__esModule",{value:!0}),xr.getFunctorComposition=xr.bindTo=xr.flap=xr.map=void 0;var lH=Da;function DM(e,t){return function(n){return function(r){return e.map(r,function(i){return t.map(i,n)})}}}xr.map=DM;function fH(e){return function(t){return function(n){return e.map(n,function(r){return r(t)})}}}xr.flap=fH;function dH(e){return function(t){return function(n){return e.map(n,function(r){var i;return i={},i[t]=r,i})}}}xr.bindTo=dH;function pH(e,t){var n=DM(e,t);return{map:function(r,i){return(0,lH.pipe)(r,n(i))}}}xr.getFunctorComposition=pH,Object.defineProperty(Pc,"__esModule",{value:!0}),Pc.getApplicativeComposition=Pc.getApplicativeMonoid=void 0;var LM=Gt,hH=Da,mH=xr;function vH(e){var t=(0,LM.getApplySemigroup)(e);return function(n){return{concat:t(n).concat,empty:e.of(n.empty)}}}Pc.getApplicativeMonoid=vH;function gH(e,t){var n=(0,mH.getFunctorComposition)(e,t).map,r=(0,LM.ap)(e,t);return{map:n,of:function(i){return e.of(t.of(i))},ap:function(i,o){return(0,hH.pipe)(i,r(o))}}}Pc.getApplicativeComposition=gH;var Yu={};Object.defineProperty(Yu,"__esModule",{value:!0}),Yu.bind=Yu.chainFirst=void 0;function yH(e){return function(t){return function(n){return e.chain(n,function(r){return e.map(t(r),function(){return r})})}}}Yu.chainFirst=yH;function bH(e){return function(t,n){return function(r){return e.chain(r,function(i){return e.map(n(i),function(o){var a;return Object.assign({},i,(a={},a[t]=o,a))})})}}}Yu.bind=bH;var cm={};Object.defineProperty(cm,"__esModule",{value:!0}),cm.tailRec=void 0;var $H=function(e,t){for(var n=t(e);n._tag==="Left";)n=t(n.left);return n.right};cm.tailRec=$H;var Dt={},_H=se&&se.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),SH=se&&se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),TH=se&&se.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&_H(t,e,n);return SH(t,e),t};Object.defineProperty(Dt,"__esModule",{value:!0}),Dt.filterOrElse=Dt.chainFirstEitherK=Dt.chainEitherK=Dt.fromEitherK=Dt.chainOptionK=Dt.fromOptionK=Dt.fromPredicate=Dt.fromOption=void 0;var IH=Yu,x$=Da,Zu=TH(Re);function jM(e){return function(t){return function(n){return e.fromEither(Zu.isNone(n)?Zu.left(t()):Zu.right(n.value))}}}Dt.fromOption=jM;function OH(e){return function(t,n){return function(r){return e.fromEither(t(r)?Zu.right(r):Zu.left(n(r)))}}}Dt.fromPredicate=OH;function UM(e){var t=jM(e);return function(n){var r=t(n);return function(i){return(0,x$.flow)(i,r)}}}Dt.fromOptionK=UM;function wH(e,t){var n=UM(e);return function(r){var i=n(r);return function(o){return function(a){return t.chain(a,i(o))}}}}Dt.chainOptionK=wH;function C$(e){return function(t){return(0,x$.flow)(t,e.fromEither)}}Dt.fromEitherK=C$;function EH(e,t){var n=C$(e);return function(r){return function(i){return t.chain(i,n(r))}}}Dt.chainEitherK=EH;function RH(e,t){return(0,x$.flow)(C$(e),(0,IH.chainFirst)(t))}Dt.chainFirstEitherK=RH;function MH(e,t){return function(n,r){return function(i){return t.chain(i,function(o){return e.fromEither(n(o)?Zu.right(o):Zu.left(r(o)))})}}}Dt.filterOrElse=MH;var BM={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.right=e.left=e.flap=e.Functor=e.Bifunctor=e.URI=e.bimap=e.mapLeft=e.map=e.separated=void 0;var t=Da,n=xr,r=function(d,p){return{left:d,right:p}};e.separated=r;var i=function(d,p){return(0,t.pipe)(d,(0,e.map)(p))},o=function(d,p){return(0,t.pipe)(d,(0,e.mapLeft)(p))},a=function(d,p,h){return(0,t.pipe)(d,(0,e.bimap)(p,h))},u=function(d){return function(p){return(0,e.separated)((0,e.left)(p),d((0,e.right)(p)))}};e.map=u;var s=function(d){return function(p){return(0,e.separated)(d((0,e.left)(p)),(0,e.right)(p))}};e.mapLeft=s;var c=function(d,p){return function(h){return(0,e.separated)(d((0,e.left)(h)),p((0,e.right)(h)))}};e.bimap=c,e.URI="Separated",e.Bifunctor={URI:e.URI,mapLeft:o,bimap:a},e.Functor={URI:e.URI,map:i},e.flap=(0,n.flap)(e.Functor);var l=function(d){return d.left};e.left=l;var f=function(d){return d.right};e.right=f})(BM);var La={},xH=se&&se.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),CH=se&&se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),AH=se&&se.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&xH(t,e,n);return CH(t,e),t};Object.defineProperty(La,"__esModule",{value:!0}),La.filterE=La.witherDefault=La.wiltDefault=void 0;var zM=AH(Re);function kH(e,t){return function(n){var r=e.traverse(n);return function(i,o){return n.map(r(i,o),t.separate)}}}La.wiltDefault=kH;function WH(e,t){return function(n){var r=e.traverse(n);return function(i,o){return n.map(r(i,o),t.compact)}}}La.witherDefault=WH;function NH(e){return function(t){var n=e.wither(t);return function(r){return function(i){return n(i,function(o){return t.map(r(o),function(a){return a?zM.some(o):zM.none})})}}}}La.filterE=NH,function(e){var t=se&&se.__createBinding||(Object.create?function(W,M,D,Me){Me===void 0&&(Me=D);var N=Object.getOwnPropertyDescriptor(M,D);(!N||("get"in N?!M.__esModule:N.writable||N.configurable))&&(N={enumerable:!0,get:function(){return M[D]}}),Object.defineProperty(W,Me,N)}:function(W,M,D,Me){Me===void 0&&(Me=D),W[Me]=M[D]}),n=se&&se.__setModuleDefault||(Object.create?function(W,M){Object.defineProperty(W,"default",{enumerable:!0,value:M})}:function(W,M){W.default=M}),r=se&&se.__importStar||function(W){if(W&&W.__esModule)return W;var M={};if(W!=null)for(var D in W)D!=="default"&&Object.prototype.hasOwnProperty.call(W,D)&&t(M,W,D);return n(M,W),M};Object.defineProperty(e,"__esModule",{value:!0}),e.fold=e.match=e.foldW=e.matchW=e.isRight=e.isLeft=e.fromOption=e.fromPredicate=e.FromEither=e.MonadThrow=e.throwError=e.ChainRec=e.Extend=e.extend=e.Alt=e.alt=e.altW=e.Bifunctor=e.mapLeft=e.bimap=e.Traversable=e.sequence=e.traverse=e.Foldable=e.reduceRight=e.foldMap=e.reduce=e.Monad=e.Chain=e.chain=e.chainW=e.Applicative=e.Apply=e.ap=e.apW=e.Pointed=e.of=e.Functor=e.map=e.getAltValidation=e.getApplicativeValidation=e.getWitherable=e.getFilterable=e.getCompactable=e.getSemigroup=e.getEq=e.getShow=e.URI=e.right=e.left=void 0,e.getValidation=e.getValidationMonoid=e.getValidationSemigroup=e.getApplyMonoid=e.getApplySemigroup=e.either=e.stringifyJSON=e.parseJSON=e.sequenceArray=e.traverseArray=e.traverseArrayWithIndex=e.traverseReadonlyArrayWithIndex=e.traverseReadonlyNonEmptyArrayWithIndex=e.ApT=e.apSW=e.apS=e.bindW=e.bind=e.bindTo=e.Do=e.exists=e.elem=e.toError=e.toUnion=e.chainNullableK=e.fromNullableK=e.tryCatchK=e.tryCatch=e.fromNullable=e.orElse=e.orElseW=e.swap=e.filterOrElseW=e.filterOrElse=e.chainOptionK=e.fromOptionK=e.duplicate=e.flatten=e.flattenW=e.chainFirstW=e.chainFirst=e.apSecondW=e.apSecond=e.apFirstW=e.apFirst=e.flap=e.getOrElse=e.getOrElseW=void 0;var i=Pc,o=Gt,a=Yu,u=cm,s=Dt,c=Da,l=xr,f=r(Re),d=BM,p=La;e.left=f.left,e.right=f.right;var h=function(W,M){return(0,c.pipe)(W,(0,e.map)(M))},v=function(W,M){return(0,c.pipe)(W,(0,e.ap)(M))},y=function(W,M){return(0,c.pipe)(W,(0,e.chain)(M))},b=function(W,M,D){return(0,c.pipe)(W,(0,e.reduce)(M,D))},w=function(W){return function(M,D){var Me=(0,e.foldMap)(W);return(0,c.pipe)(M,Me(D))}},F=function(W,M,D){return(0,c.pipe)(W,(0,e.reduceRight)(M,D))},g=function(W){var M=(0,e.traverse)(W);return function(D,Me){return(0,c.pipe)(D,M(Me))}},I=function(W,M,D){return(0,c.pipe)(W,(0,e.bimap)(M,D))},T=function(W,M){return(0,c.pipe)(W,(0,e.mapLeft)(M))},k=function(W,M){return(0,c.pipe)(W,(0,e.alt)(M))},E=function(W,M){return(0,c.pipe)(W,(0,e.extend)(M))},H=function(W,M){return(0,u.tailRec)(M(W),function(D){return(0,e.isLeft)(D)?(0,e.right)((0,e.left)(D.left)):(0,e.isLeft)(D.right)?(0,e.left)(M(D.right.left)):(0,e.right)((0,e.right)(D.right.right))})};e.URI="Either";var q=function(W,M){return{show:function(D){return(0,e.isLeft)(D)?"left(".concat(W.show(D.left),")"):"right(".concat(M.show(D.right),")")}}};e.getShow=q;var x=function(W,M){return{equals:function(D,Me){return D===Me||((0,e.isLeft)(D)?(0,e.isLeft)(Me)&&W.equals(D.left,Me.left):(0,e.isRight)(Me)&&M.equals(D.right,Me.right))}}};e.getEq=x;var J=function(W){return{concat:function(M,D){return(0,e.isLeft)(D)?M:(0,e.isLeft)(M)?D:(0,e.right)(W.concat(M.right,D.right))}}};e.getSemigroup=J;var O=function(W){var M=(0,e.left)(W.empty);return{URI:e.URI,_E:void 0,compact:function(D){return(0,e.isLeft)(D)?D:D.right._tag==="None"?M:(0,e.right)(D.right.value)},separate:function(D){return(0,e.isLeft)(D)?(0,d.separated)(D,D):(0,e.isLeft)(D.right)?(0,d.separated)((0,e.right)(D.right.left),M):(0,d.separated)(M,(0,e.right)(D.right.right))}}};e.getCompactable=O;var R=function(W){var M=(0,e.left)(W.empty),D=(0,e.getCompactable)(W),Me=D.compact,N=D.separate,ne=function(de,_e){return(0,e.isLeft)(de)||_e(de.right)?de:M},pe=function(de,_e){return(0,e.isLeft)(de)?(0,d.separated)(de,de):_e(de.right)?(0,d.separated)(M,(0,e.right)(de.right)):(0,d.separated)((0,e.right)(de.right),M)};return{URI:e.URI,_E:void 0,map:h,compact:Me,separate:N,filter:ne,filterMap:function(de,_e){if((0,e.isLeft)(de))return de;var it=_e(de.right);return it._tag==="None"?M:(0,e.right)(it.value)},partition:pe,partitionMap:function(de,_e){if((0,e.isLeft)(de))return(0,d.separated)(de,de);var it=_e(de.right);return(0,e.isLeft)(it)?(0,d.separated)((0,e.right)(it.left),M):(0,d.separated)(M,(0,e.right)(it.right))}}};e.getFilterable=R;var C=function(W){var M=(0,e.getFilterable)(W),D=(0,e.getCompactable)(W);return{URI:e.URI,_E:void 0,map:h,compact:M.compact,separate:M.separate,filter:M.filter,filterMap:M.filterMap,partition:M.partition,partitionMap:M.partitionMap,traverse:g,sequence:e.sequence,reduce:b,foldMap:w,reduceRight:F,wither:(0,p.witherDefault)(e.Traversable,D),wilt:(0,p.wiltDefault)(e.Traversable,D)}};e.getWitherable=C;var L=function(W){return{URI:e.URI,_E:void 0,map:h,ap:function(M,D){return(0,e.isLeft)(M)?(0,e.isLeft)(D)?(0,e.left)(W.concat(M.left,D.left)):M:(0,e.isLeft)(D)?D:(0,e.right)(M.right(D.right))},of:e.of}};e.getApplicativeValidation=L;var z=function(W){return{URI:e.URI,_E:void 0,map:h,alt:function(M,D){if((0,e.isRight)(M))return M;var Me=D();return(0,e.isLeft)(Me)?(0,e.left)(W.concat(M.left,Me.left)):Me}}};e.getAltValidation=z;var j=function(W){return function(M){return(0,e.isLeft)(M)?M:(0,e.right)(W(M.right))}};e.map=j,e.Functor={URI:e.URI,map:h},e.of=e.right,e.Pointed={URI:e.URI,of:e.of};var S=function(W){return function(M){return(0,e.isLeft)(M)?M:(0,e.isLeft)(W)?W:(0,e.right)(M.right(W.right))}};e.apW=S,e.ap=e.apW,e.Apply={URI:e.URI,map:h,ap:v},e.Applicative={URI:e.URI,map:h,ap:v,of:e.of};var _=function(W){return function(M){return(0,e.isLeft)(M)?M:W(M.right)}};e.chainW=_,e.chain=e.chainW,e.Chain={URI:e.URI,map:h,ap:v,chain:y},e.Monad={URI:e.URI,map:h,ap:v,of:e.of,chain:y};var U=function(W,M){return function(D){return(0,e.isLeft)(D)?W:M(W,D.right)}};e.reduce=U;var Y=function(W){return function(M){return function(D){return(0,e.isLeft)(D)?W.empty:M(D.right)}}};e.foldMap=Y;var ge=function(W,M){return function(D){return(0,e.isLeft)(D)?W:M(D.right,W)}};e.reduceRight=ge,e.Foldable={URI:e.URI,reduce:b,foldMap:w,reduceRight:F};var he=function(W){return function(M){return function(D){return(0,e.isLeft)(D)?W.of((0,e.left)(D.left)):W.map(M(D.right),e.right)}}};e.traverse=he;var Te=function(W){return function(M){return(0,e.isLeft)(M)?W.of((0,e.left)(M.left)):W.map(M.right,e.right)}};e.sequence=Te,e.Traversable={URI:e.URI,map:h,reduce:b,foldMap:w,reduceRight:F,traverse:g,sequence:e.sequence};var Qe=function(W,M){return function(D){return(0,e.isLeft)(D)?(0,e.left)(W(D.left)):(0,e.right)(M(D.right))}};e.bimap=Qe;var Ft=function(W){return function(M){return(0,e.isLeft)(M)?(0,e.left)(W(M.left)):M}};e.mapLeft=Ft,e.Bifunctor={URI:e.URI,bimap:I,mapLeft:T};var Jt=function(W){return function(M){return(0,e.isLeft)(M)?W():M}};e.altW=Jt,e.alt=e.altW,e.Alt={URI:e.URI,map:h,alt:k};var Yr=function(W){return function(M){return(0,e.isLeft)(M)?M:(0,e.right)(W(M))}};e.extend=Yr,e.Extend={URI:e.URI,map:h,extend:E},e.ChainRec={URI:e.URI,map:h,ap:v,chain:y,chainRec:H},e.throwError=e.left,e.MonadThrow={URI:e.URI,map:h,ap:v,of:e.of,chain:y,throwError:e.throwError},e.FromEither={URI:e.URI,fromEither:c.identity},e.fromPredicate=(0,s.fromPredicate)(e.FromEither),e.fromOption=(0,s.fromOption)(e.FromEither),e.isLeft=f.isLeft,e.isRight=f.isRight;var Wn=function(W,M){return function(D){return(0,e.isLeft)(D)?W(D.left):M(D.right)}};e.matchW=Wn,e.foldW=e.matchW,e.match=e.matchW,e.fold=e.match;var yo=function(W){return function(M){return(0,e.isLeft)(M)?W(M.left):M.right}};e.getOrElseW=yo,e.getOrElse=e.getOrElseW,e.flap=(0,l.flap)(e.Functor),e.apFirst=(0,o.apFirst)(e.Apply),e.apFirstW=e.apFirst,e.apSecond=(0,o.apSecond)(e.Apply),e.apSecondW=e.apSecond,e.chainFirst=(0,a.chainFirst)(e.Chain),e.chainFirstW=e.chainFirst,e.flattenW=(0,e.chainW)(c.identity),e.flatten=e.flattenW,e.duplicate=(0,e.extend)(c.identity),e.fromOptionK=(0,s.fromOptionK)(e.FromEither),e.chainOptionK=(0,s.chainOptionK)(e.FromEither,e.Chain),e.filterOrElse=(0,s.filterOrElse)(e.FromEither,e.Chain),e.filterOrElseW=e.filterOrElse;var Ma=function(W){return(0,e.isLeft)(W)?(0,e.right)(W.left):(0,e.left)(W.right)};e.swap=Ma;var xa=function(W){return function(M){return(0,e.isLeft)(M)?W(M.left):M}};e.orElseW=xa,e.orElse=e.orElseW;var Ju=function(W){return function(M){return M==null?(0,e.left)(W):(0,e.right)(M)}};e.fromNullable=Ju;var ki=function(W,M){try{return(0,e.right)(W())}catch(D){return(0,e.left)(M(D))}};e.tryCatch=ki;var Zr=function(W,M){return function(){for(var D=[],Me=0;Me<arguments.length;Me++)D[Me]=arguments[Me];return(0,e.tryCatch)(function(){return W.apply(void 0,D)},M)}};e.tryCatchK=Zr;var bo=function(W){var M=(0,e.fromNullable)(W);return function(D){return(0,c.flow)(D,M)}};e.fromNullableK=bo;var Ca=function(W){var M=(0,e.fromNullableK)(W);return function(D){return(0,e.chain)(M(D))}};e.chainNullableK=Ca,e.toUnion=(0,e.foldW)(c.identity,c.identity);function Wi(W){return W instanceof Error?W:new Error(String(W))}e.toError=Wi;function ir(W){return function(M,D){if(D===void 0){var Me=ir(W);return function(N){return Me(M,N)}}return(0,e.isLeft)(D)?!1:W.equals(M,D.right)}}e.elem=ir;var Xr=function(W){return function(M){return(0,e.isLeft)(M)?!1:W(M.right)}};e.exists=Xr,e.Do=(0,e.of)(f.emptyRecord),e.bindTo=(0,l.bindTo)(e.Functor),e.bind=(0,a.bind)(e.Chain),e.bindW=e.bind,e.apS=(0,o.apS)(e.Apply),e.apSW=e.apS,e.ApT=(0,e.of)(f.emptyReadonlyArray);var Ni=function(W){return function(M){var D=W(0,f.head(M));if((0,e.isLeft)(D))return D;for(var Me=[D.right],N=1;N<M.length;N++){var ne=W(N,M[N]);if((0,e.isLeft)(ne))return ne;Me.push(ne.right)}return(0,e.right)(Me)}};e.traverseReadonlyNonEmptyArrayWithIndex=Ni;var Pi=function(W){var M=(0,e.traverseReadonlyNonEmptyArrayWithIndex)(W);return function(D){return f.isNonEmpty(D)?M(D):e.ApT}};e.traverseReadonlyArrayWithIndex=Pi,e.traverseArrayWithIndex=e.traverseReadonlyArrayWithIndex;var Aa=function(W){return(0,e.traverseReadonlyArrayWithIndex)(function(M,D){return W(D)})};e.traverseArray=Aa,e.sequenceArray=(0,e.traverseArray)(c.identity);function ka(W,M){return(0,e.tryCatch)(function(){return JSON.parse(W)},M)}e.parseJSON=ka;var Wa=function(W,M){return(0,e.tryCatch)(function(){var D=JSON.stringify(W);if(typeof D!="string")throw new Error("Converting unsupported structure to JSON");return D},M)};e.stringifyJSON=Wa,e.either={URI:e.URI,map:h,of:e.of,ap:v,chain:y,reduce:b,foldMap:w,reduceRight:F,traverse:g,sequence:e.sequence,bimap:I,mapLeft:T,alt:k,extend:E,chainRec:H,throwError:e.throwError},e.getApplySemigroup=(0,o.getApplySemigroup)(e.Apply),e.getApplyMonoid=(0,i.getApplicativeMonoid)(e.Applicative);var Qr=function(W,M){return(0,o.getApplySemigroup)((0,e.getApplicativeValidation)(W))(M)};e.getValidationSemigroup=Qr;var Gu=function(W,M){return(0,i.getApplicativeMonoid)((0,e.getApplicativeValidation)(W))(M)};e.getValidationMonoid=Gu;function ad(W){var M=(0,e.getApplicativeValidation)(W).ap,D=(0,e.getAltValidation)(W).alt;return{URI:e.URI,_E:void 0,map:h,of:e.of,chain:y,bimap:I,mapLeft:T,reduce:b,foldMap:w,reduceRight:F,extend:E,traverse:g,sequence:e.sequence,chainRec:H,throwError:e.throwError,ap:M,alt:D}}e.getValidation=ad}($o);var qM=function(e){return function(){return{meet:function(t,n){return function(r){return e.meet(t(r),n(r))}},join:function(t,n){return function(r){return e.join(t(r),n(r))}},zero:function(){return e.zero},one:function(){return e.one},implies:function(t,n){return function(r){return e.implies(t(r),n(r))}},not:function(t){return function(n){return e.not(t(n))}}}}},A$=function(e){return function(){return{concat:function(t,n){return function(r){return e.concat(t(r),n(r))}}}}},KM=function(e){var t=A$(e);return function(){return{concat:t().concat,empty:function(){return e.empty}}}},k$=function(e){return{add:function(t,n){return function(r){return e.add(t(r),n(r))}},zero:function(){return e.zero},mul:function(t,n){return function(r){return e.mul(t(r),n(r))}},one:function(){return e.one}}},VM=function(e){var t=k$(e);return{add:t.add,mul:t.mul,one:t.one,zero:t.zero,sub:function(n,r){return function(i){return e.sub(n(i),r(i))}}}},PH=function(e){return function(t){return t(e)}};function B(e){return e}var Fc=B;function Fn(e){return function(){return e}}var W$=Fn(!0),HM=Fn(!1),JM=Fn(null),N$=Fn(void 0),FH=N$;function DH(e){return function(t,n){return e(n,t)}}function Z(e,t,n,r,i,o,a,u,s){switch(arguments.length){case 1:return e;case 2:return function(){return t(e.apply(this,arguments))};case 3:return function(){return n(t(e.apply(this,arguments)))};case 4:return function(){return r(n(t(e.apply(this,arguments))))};case 5:return function(){return i(r(n(t(e.apply(this,arguments)))))};case 6:return function(){return o(i(r(n(t(e.apply(this,arguments))))))};case 7:return function(){return a(o(i(r(n(t(e.apply(this,arguments)))))))};case 8:return function(){return u(a(o(i(r(n(t(e.apply(this,arguments))))))))};case 9:return function(){return s(u(a(o(i(r(n(t(e.apply(this,arguments)))))))))}}}function GM(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e}function LH(e){return e+1}function jH(e){return e-1}function YM(e){throw new Error("Called `absurd` function which should be uncallable")}function UH(e){return function(t){return e.apply(void 0,t)}}function BH(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e(t)}}function m(e,t,n,r,i,o,a,u,s){switch(arguments.length){case 1:return e;case 2:return t(e);case 3:return n(t(e));case 4:return r(n(t(e)));case 5:return i(r(n(t(e))));case 6:return o(i(r(n(t(e)))));case 7:return a(o(i(r(n(t(e))))));case 8:return u(a(o(i(r(n(t(e)))))));case 9:return s(u(a(o(i(r(n(t(e))))))));default:{for(var c=arguments[0],l=1;l<arguments.length;l++)c=arguments[l](c);return c}}}var zH=YM,Dn=function(e,t){return t};function qH(e){return function(t){return!e(t)}}var KH=function(){return{concat:function(e,t){return Z(e,t)},empty:B}};const ZM=Object.freeze(Object.defineProperty({__proto__:null,getBooleanAlgebra:qM,getSemigroup:A$,getMonoid:KM,getSemiring:k$,getRing:VM,apply:PH,identity:B,unsafeCoerce:Fc,constant:Fn,constTrue:W$,constFalse:HM,constNull:JM,constUndefined:N$,constVoid:FH,flip:DH,flow:Z,tuple:GM,increment:LH,decrement:jH,absurd:YM,tupled:UH,untupled:BH,pipe:m,hole:zH,SK:Dn,not:qH,getEndomorphismMonoid:KH},Symbol.toStringTag,{value:"Module"}));var VH=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},xt=function(e){return e._tag==="None"},ht=function(e){return e._tag==="Some"},me={_tag:"None"},le=function(e){return{_tag:"Some",value:e}},Lt=function(e){return e._tag==="Left"},P$=function(e){return e._tag==="Right"},_o=function(e){return{_tag:"Left",left:e}},ja=function(e){return{_tag:"Right",right:e}},dd=function(e){return[e]},ft=function(e){return e.length>0},or=function(e){return e[0]},Dc=function(e){return e.slice(1)},Yt=[],jt={},ot=Object.prototype.hasOwnProperty,lm=function(e){return VH([e[0]],e.slice(1),!0)};function So(e,t){return function(n){return function(r){return e.ap(e.map(r,function(i){return function(o){return t.ap(i,o)}}),n)}}}function _t(e){return function(t){return function(n){return e.ap(e.map(n,function(r){return function(){return r}}),t)}}}function St(e){return function(t){return function(n){return e.ap(e.map(n,function(){return function(r){return r}}),t)}}}function Tt(e){return function(t,n){return function(r){return e.ap(e.map(r,function(i){return function(o){var a;return Object.assign({},i,(a={},a[t]=o,a))}}),n)}}}function Ut(e){return function(t){return{concat:function(n,r){return e.ap(e.map(n,function(i){return function(o){return t.concat(i,o)}}),r)}}}}function F$(e,t,n){return function(r){for(var i=Array(n.length+1),o=0;o<n.length;o++)i[o]=n[o];return i[n.length]=r,t===0?e.apply(null,i):F$(e,t-1,i)}}var D$={1:function(e){return[e]},2:function(e){return function(t){return[e,t]}},3:function(e){return function(t){return function(n){return[e,t,n]}}},4:function(e){return function(t){return function(n){return function(r){return[e,t,n,r]}}}},5:function(e){return function(t){return function(n){return function(r){return function(i){return[e,t,n,r,i]}}}}}};function HH(e){return ot.call(D$,e)||(D$[e]=F$(GM,e-1,[])),D$[e]}function JH(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r=t.length,i=HH(r),o=e.map(t[0],i),a=1;a<r;a++)o=e.ap(o,t[a]);return o}}function GH(e){var t=e.length;switch(t){case 1:return function(n){var r;return r={},r[e[0]]=n,r};case 2:return function(n){return function(r){var i;return i={},i[e[0]]=n,i[e[1]]=r,i}};case 3:return function(n){return function(r){return function(i){var o;return o={},o[e[0]]=n,o[e[1]]=r,o[e[2]]=i,o}}};case 4:return function(n){return function(r){return function(i){return function(o){var a;return a={},a[e[0]]=n,a[e[1]]=r,a[e[2]]=i,a[e[3]]=o,a}}}};case 5:return function(n){return function(r){return function(i){return function(o){return function(a){var u;return u={},u[e[0]]=n,u[e[1]]=r,u[e[2]]=i,u[e[3]]=o,u[e[4]]=a,u}}}}};default:return F$(function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i={},o=0;o<t;o++)i[e[o]]=n[o];return i},t-1,[])}}function YH(e){return function(t){for(var n=Object.keys(t),r=n.length,i=GH(n),o=e.map(t[n[0]],i),a=1;a<r;a++)o=e.ap(o,t[n[a]]);return o}}const ZH=Object.freeze(Object.defineProperty({__proto__:null,ap:So,apFirst:_t,apSecond:St,apS:Tt,getApplySemigroup:Ut,sequenceT:JH,sequenceS:YH},Symbol.toStringTag,{value:"Module"}));function Lc(e,t){return function(n){return function(r){return e.map(r,function(i){return t.map(i,n)})}}}function De(e){return function(t){return function(n){return e.map(n,function(r){return r(t)})}}}function It(e){return function(t){return function(n){return e.map(n,function(r){var i;return i={},i[t]=r,i})}}}function jc(e,t){var n=Lc(e,t);return{map:function(r,i){return m(r,n(i))}}}const XH=Object.freeze(Object.defineProperty({__proto__:null,map:Lc,flap:De,bindTo:It,getFunctorComposition:jc},Symbol.toStringTag,{value:"Module"}));function Cr(e){var t=Ut(e);return function(n){return{concat:t(n).concat,empty:e.of(n.empty)}}}function XM(e,t){var n=jc(e,t).map,r=So(e,t);return{map:n,of:function(i){return e.of(t.of(i))},ap:function(i,o){return m(i,r(o))}}}const QH=Object.freeze(Object.defineProperty({__proto__:null,getApplicativeMonoid:Cr,getApplicativeComposition:XM},Symbol.toStringTag,{value:"Module"}));function at(e){return function(t){return function(n){return e.chain(n,function(r){return e.map(t(r),function(){return r})})}}}function Ot(e){return function(t,n){return function(r){return e.chain(r,function(i){return e.map(n(i),function(o){var a;return Object.assign({},i,(a={},a[t]=o,a))})})}}}const e6=Object.freeze(Object.defineProperty({__proto__:null,chainFirst:at,bind:Ot},Symbol.toStringTag,{value:"Module"}));var L$=function(e,t){for(var n=t(e);n._tag==="Left";)n=t(n.left);return n.right};const t6=Object.freeze(Object.defineProperty({__proto__:null,tailRec:L$},Symbol.toStringTag,{value:"Module"}));function Di(e){return function(t){return function(n){return e.fromEither(xt(n)?_o(t()):ja(n.value))}}}function Ua(e){return function(t,n){return function(r){return e.fromEither(t(r)?ja(r):_o(n(r)))}}}function Li(e){var t=Di(e);return function(n){var r=t(n);return function(i){return Z(i,r)}}}function Xu(e,t){var n=Li(e);return function(r){var i=n(r);return function(o){return function(a){return t.chain(a,i(o))}}}}function ar(e){return function(t){return Z(t,e.fromEither)}}function To(e,t){var n=ar(e);return function(r){return function(i){return t.chain(i,n(r))}}}function Io(e,t){return Z(ar(e),at(t))}function Qu(e,t){return function(n,r){return function(i){return t.chain(i,function(o){return e.fromEither(n(o)?ja(o):_o(r(o)))})}}}const n6=Object.freeze(Object.defineProperty({__proto__:null,fromOption:Di,fromPredicate:Ua,fromOptionK:Li,chainOptionK:Xu,fromEitherK:ar,chainEitherK:To,chainFirstEitherK:Io,filterOrElse:Qu},Symbol.toStringTag,{value:"Module"}));var Oe=function(e,t){return{left:e,right:t}},r6=function(e,t){return m(e,j$(t))},i6=function(e,t){return m(e,QM(t))},o6=function(e,t,n){return m(e,ex(t,n))},j$=function(e){return function(t){return Oe(pd(t),e(hd(t)))}},QM=function(e){return function(t){return Oe(e(pd(t)),hd(t))}},ex=function(e,t){return function(n){return Oe(e(pd(n)),t(hd(n)))}},U$="Separated",a6={URI:U$,mapLeft:i6,bimap:o6},tx={URI:U$,map:r6},u6=De(tx),pd=function(e){return e.left},hd=function(e){return e.right};const s6=Object.freeze(Object.defineProperty({__proto__:null,separated:Oe,map:j$,mapLeft:QM,bimap:ex,URI:U$,Bifunctor:a6,Functor:tx,flap:u6,left:pd,right:hd},Symbol.toStringTag,{value:"Module"}));function ni(e,t){return function(n){var r=e.traverse(n);return function(i,o){return n.map(r(i,o),t.separate)}}}function ri(e,t){return function(n){var r=e.traverse(n);return function(i,o){return n.map(r(i,o),t.compact)}}}function B$(e){return function(t){var n=e.wither(t);return function(r){return function(i){return n(i,function(o){return t.map(r(o),function(a){return a?le(o):me})})}}}}const c6=Object.freeze(Object.defineProperty({__proto__:null,wiltDefault:ni,witherDefault:ri,filterE:B$},Symbol.toStringTag,{value:"Module"}));var yt=_o,ze=ja,hn=function(e,t){return m(e,ns(t))},es=function(e,t){return m(e,ox(t))},Uc=function(e,t){return m(e,Ar(t))},md=function(e,t,n){return m(e,ux(t,n))},vd=function(e){return function(t,n){var r=sx(e);return m(t,r(n))}},gd=function(e,t,n){return m(e,cx(t,n))},fm=function(e){var t=lx(e);return function(n,r){return m(n,t(r))}},z$=function(e,t,n){return m(e,G$(t,n))},q$=function(e,t){return m(e,_d(t))},nx=function(e,t){return m(e,dx(t))},K$=function(e,t){return m(e,Y$(t))},V$=function(e,t){return L$(t(e),function(n){return re(n)?ze(yt(n.left)):re(n.right)?yt(t(n.right.left)):ze(ze(n.right.right))})},bt="Either",l6=function(e,t){return{show:function(n){return re(n)?"left(".concat(e.show(n.left),")"):"right(".concat(t.show(n.right),")")}}},f6=function(e,t){return{equals:function(n,r){return n===r||(re(n)?re(r)&&e.equals(n.left,r.left):Z$(r)&&t.equals(n.right,r.right))}}},yd=function(e){return{concat:function(t,n){return re(n)?t:re(t)?n:ze(e.concat(t.right,n.right))}}},ts=function(e){var t=yt(e.empty);return{URI:bt,_E:void 0,compact:function(n){return re(n)?n:n.right._tag==="None"?t:ze(n.right.value)},separate:function(n){return re(n)?Oe(n,n):re(n.right)?Oe(ze(n.right.left),t):Oe(t,ze(n.right.right))}}},Bc=function(e){var t=yt(e.empty),n=ts(e),r=n.compact,i=n.separate,o=function(u,s){return re(u)||s(u.right)?u:t},a=function(u,s){return re(u)?Oe(u,u):s(u.right)?Oe(t,ze(u.right)):Oe(ze(u.right),t)};return{URI:bt,_E:void 0,map:hn,compact:r,separate:i,filter:o,filterMap:function(u,s){if(re(u))return u;var c=s(u.right);return c._tag==="None"?t:ze(c.value)},partition:a,partitionMap:function(u,s){if(re(u))return Oe(u,u);var c=s(u.right);return re(c)?Oe(ze(c.left),t):Oe(t,ze(c.right))}}},d6=function(e){var t=Bc(e),n=ts(e);return{URI:bt,_E:void 0,map:hn,compact:t.compact,separate:t.separate,filter:t.filter,filterMap:t.filterMap,partition:t.partition,partitionMap:t.partitionMap,traverse:fm,sequence:$d,reduce:md,foldMap:vd,reduceRight:gd,wither:ri(J$,n),wilt:ni(J$,n)}},Ba=function(e){return{URI:bt,_E:void 0,map:hn,ap:function(t,n){return re(t)?re(n)?yt(e.concat(t.left,n.left)):t:re(n)?n:ze(t.right(n.right))},of:ji}},rx=function(e){return{URI:bt,_E:void 0,map:hn,alt:function(t,n){if(Z$(t))return t;var r=n();return re(r)?yt(e.concat(t.left,r.left)):r}}},ns=function(e){return function(t){return re(t)?t:ze(e(t.right))}},za={URI:bt,map:hn},ji=ze,p6={URI:bt,of:ji},ix=function(e){return function(t){return re(t)?t:re(e)?e:ze(t.right(e.right))}},ox=ix,zc={URI:bt,map:hn,ap:es},ax={URI:bt,map:hn,ap:es,of:ji},H$=function(e){return function(t){return re(t)?t:e(t.right)}},Ar=H$,bd={URI:bt,map:hn,ap:es,chain:Uc},h6={URI:bt,map:hn,ap:es,of:ji,chain:Uc},ux=function(e,t){return function(n){return re(n)?e:t(e,n.right)}},sx=function(e){return function(t){return function(n){return re(n)?e.empty:t(n.right)}}},cx=function(e,t){return function(n){return re(n)?e:t(n.right,e)}},m6={URI:bt,reduce:md,foldMap:vd,reduceRight:gd},lx=function(e){return function(t){return function(n){return re(n)?e.of(yt(n.left)):e.map(t(n.right),ze)}}},$d=function(e){return function(t){return re(t)?e.of(yt(t.left)):e.map(t.right,ze)}},J$={URI:bt,map:hn,reduce:md,foldMap:vd,reduceRight:gd,traverse:fm,sequence:$d},G$=function(e,t){return function(n){return re(n)?yt(e(n.left)):ze(t(n.right))}},_d=function(e){return function(t){return re(t)?yt(e(t.left)):t}},v6={URI:bt,bimap:z$,mapLeft:q$},fx=function(e){return function(t){return re(t)?e():t}},dx=fx,g6={URI:bt,map:hn,alt:nx},Y$=function(e){return function(t){return re(t)?t:ze(e(t))}},y6={URI:bt,map:hn,extend:K$},b6={URI:bt,map:hn,ap:es,chain:Uc,chainRec:V$},dm=yt,$6={URI:bt,map:hn,ap:es,of:ji,chain:Uc,throwError:dm},qc={URI:bt,fromEither:B},_6=Ua(qc),px=Di(qc),re=Lt,Z$=P$,X$=function(e,t){return function(n){return re(n)?e(n.left):t(n.right)}},hx=X$,qa=X$,Q$=qa,e_=function(e){return function(t){return re(t)?e(t.left):t.right}},S6=e_,T6=De(za),mx=_t(zc),I6=mx,vx=St(zc),O6=vx,gx=at(bd),w6=gx,yx=H$(B),E6=yx,R6=Y$(B),M6=Li(qc),x6=Xu(qc,bd),bx=Qu(qc,bd),C6=bx,$x=function(e){return re(e)?ze(e.left):yt(e.right)},_x=function(e){return function(t){return re(t)?e(t.left):t}},Sx=_x,t_=function(e){return function(t){return t==null?yt(e):ze(t)}},rs=function(e,t){try{return ze(e())}catch(n){return yt(t(n))}},A6=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return rs(function(){return e.apply(void 0,n)},t)}},Tx=function(e){var t=t_(e);return function(n){return Z(n,t)}},k6=function(e){var t=Tx(e);return function(n){return Ar(t(n))}},Ix=hx(B,B);function W6(e){return e instanceof Error?e:new Error(String(e))}function Ox(e){return function(t,n){if(n===void 0){var r=Ox(e);return function(i){return r(t,i)}}return re(n)?!1:e.equals(t,n.right)}}var N6=function(e){return function(t){return re(t)?!1:e(t.right)}},P6=ji(jt),F6=It(za),wx=Ot(bd),D6=wx,Ex=Tt(zc),L6=Ex,Rx=ji(Yt),Sd=function(e){return function(t){var n=e(0,or(t));if(re(n))return n;for(var r=[n.right],i=1;i<t.length;i++){var o=e(i,t[i]);if(re(o))return o;r.push(o.right)}return ze(r)}},n_=function(e){var t=Sd(e);return function(n){return ft(n)?t(n):Rx}},j6=n_,Mx=function(e){return n_(function(t,n){return e(n)})},U6=Mx(B);function B6(e,t){return rs(function(){return JSON.parse(e)},t)}var z6=function(e,t){return rs(function(){var n=JSON.stringify(e);if(typeof n!="string")throw new Error("Converting unsupported structure to JSON");return n},t)},q6={URI:bt,map:hn,of:ji,ap:es,chain:Uc,reduce:md,foldMap:vd,reduceRight:gd,traverse:fm,sequence:$d,bimap:z$,mapLeft:q$,alt:nx,extend:K$,chainRec:V$,throwError:dm},K6=Ut(zc),V6=Cr(ax),H6=function(e,t){return Ut(Ba(e))(t)},J6=function(e,t){return Cr(Ba(e))(t)};function G6(e){var t=Ba(e).ap,n=rx(e).alt;return{URI:bt,_E:void 0,map:hn,of:ji,chain:Uc,bimap:z$,mapLeft:q$,reduce:md,foldMap:vd,reduceRight:gd,extend:K$,traverse:fm,sequence:$d,chainRec:V$,throwError:dm,ap:t,alt:n}}const xx=Object.freeze(Object.defineProperty({__proto__:null,left:yt,right:ze,URI:bt,getShow:l6,getEq:f6,getSemigroup:yd,getCompactable:ts,getFilterable:Bc,getWitherable:d6,getApplicativeValidation:Ba,getAltValidation:rx,map:ns,Functor:za,of:ji,Pointed:p6,apW:ix,ap:ox,Apply:zc,Applicative:ax,chainW:H$,chain:Ar,Chain:bd,Monad:h6,reduce:ux,foldMap:sx,reduceRight:cx,Foldable:m6,traverse:lx,sequence:$d,Traversable:J$,bimap:G$,mapLeft:_d,Bifunctor:v6,altW:fx,alt:dx,Alt:g6,extend:Y$,Extend:y6,ChainRec:b6,throwError:dm,MonadThrow:$6,FromEither:qc,fromPredicate:_6,fromOption:px,isLeft:re,isRight:Z$,matchW:X$,foldW:hx,match:qa,fold:Q$,getOrElseW:e_,getOrElse:S6,flap:T6,apFirst:mx,apFirstW:I6,apSecond:vx,apSecondW:O6,chainFirst:gx,chainFirstW:w6,flattenW:yx,flatten:E6,duplicate:R6,fromOptionK:M6,chainOptionK:x6,filterOrElse:bx,filterOrElseW:C6,swap:$x,orElseW:_x,orElse:Sx,fromNullable:t_,tryCatch:rs,tryCatchK:A6,fromNullableK:Tx,chainNullableK:k6,toUnion:Ix,toError:W6,elem:Ox,exists:N6,Do:P6,bindTo:F6,bind:wx,bindW:D6,apS:Ex,apSW:L6,ApT:Rx,traverseReadonlyNonEmptyArrayWithIndex:Sd,traverseReadonlyArrayWithIndex:n_,traverseArrayWithIndex:j6,traverseArray:Mx,sequenceArray:U6,parseJSON:B6,stringifyJSON:z6,either:q6,getApplySemigroup:K6,getApplyMonoid:V6,getValidationSemigroup:H6,getValidationMonoid:J6,getValidation:G6},Symbol.toStringTag,{value:"Module"}));var He=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Kc=globalThis&&globalThis.__assign||function(){return Kc=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Kc.apply(this,arguments)},Y6=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},Ui=yt,Ye=function(e,t,n){return Ui([{value:e,context:t,message:n}])},Ie=ze,be=function(){function e(t,n,r,i){this.name=t,this.is=n,this.validate=r,this.encode=i,this.decode=this.decode.bind(this)}return e.prototype.pipe=function(t,n){var r=this;return n===void 0&&(n="pipe(".concat(this.name,", ").concat(t.name,")")),new e(n,t.is,function(i,o){var a=r.validate(i,o);return re(a)?a:t.validate(a.right,o)},this.encode===We&&t.encode===We?We:function(i){return r.encode(t.encode(i))})},e.prototype.asDecoder=function(){return this},e.prototype.asEncoder=function(){return this},e.prototype.decode=function(t){return this.validate(t,[{key:"",type:this,actual:t}])},e}(),We=function(e){return e};function Cx(e){return e.displayName||e.name||"<function".concat(e.length,">")}function Z6(e,t){return{key:e,type:t}}function ii(e,t,n,r){for(var i=e.length,o=Array(i+1),a=0;a<i;a++)o[a]=e[a];return o[i]={key:t,type:n,actual:r},o}function Oo(e,t){for(var n=t.length,r=0;r<n;r++)e.push(t[r])}var is=Object.prototype.hasOwnProperty;function r_(e){return Object.keys(e).map(function(t){return"".concat(t,": ").concat(e[t].name)}).join(", ")}function Td(e){for(var t=0;t<e.length;t++)if(e[t].encode!==We)return!1;return!0}function Ax(e){return"{ ".concat(r_(e)," }")}function kx(e){return"Partial<".concat(e,">")}function X6(e,t,n,r){r===void 0&&(r="{ [K in ".concat(t.name,"]: ").concat(n.name," }"));var i=e.length;return new d_(r,function(o){return _n.is(o)&&e.every(function(a){return n.is(o[a])})},function(o,a){var u=_n.validate(o,a);if(re(u))return u;for(var s=u.right,c={},l=[],f=!1,d=0;d<i;d++){var p=e[d],h=s[p],v=n.validate(h,ii(a,p,n,h));if(re(v))Oo(l,v.left);else{var y=v.right;f=f||y!==h,c[p]=y}}return l.length>0?Ui(l):Ie(f||Object.keys(s).length!==i?c:s)},n.encode===We?We:function(o){for(var a={},u=0;u<i;u++){var s=e[u];a[s]=n.encode(o[s])}return a},t,n)}function i_(e){var t;if(Dx(e)){var n=e.value;if(oi.is(n))return t={},t[n]=null,t}else{if(iJ(e))return e.keys;if(jx(e)){var r=e.types.map(function(i){return i_(i)});return r.some(pm.is)?void 0:Object.assign.apply(Object,Y6([{}],r,!1))}}}function Q6(e,t,n){return n===void 0&&(n="{ [K in ".concat(e.name,"]: ").concat(t.name," }")),new d_(n,function(r){return _n.is(r)?Object.keys(r).every(function(i){return e.is(i)&&t.is(r[i])}):Fx(t)&&Array.isArray(r)},function(r,i){if(_n.is(r)){for(var o={},a=[],u=Object.keys(r),s=u.length,c=!1,l=0;l<s;l++){var f=u[l],d=r[f],p=e.validate(f,ii(i,f,e,f));if(re(p))Oo(a,p.left);else{var h=p.right;c=c||h!==f,f=h;var v=t.validate(d,ii(i,f,t,d));if(re(v))Oo(a,v.left);else{var y=v.right;c=c||y!==d,o[f]=y}}}return a.length>0?Ui(a):Ie(c?o:r)}return Fx(t)&&Array.isArray(r)?Ie(r):Ye(r,i)},e.encode===We&&t.encode===We?We:function(r){for(var i={},o=Object.keys(r),a=o.length,u=0;u<a;u++){var s=o[u];i[String(e.encode(s))]=t.encode(r[s])}return i},e,t)}function Wx(e){return"("+e.map(function(t){return t.name}).join(" | ")+")"}function o_(e,t){for(var n=!0,r=!0,i=!_n.is(e),o=0,a=t;o<a.length;o++){var u=a[o];u!==e&&(n=!1),_n.is(u)&&(r=!1)}if(n)return e;if(r)return t[t.length-1];for(var s={},c=0,l=t;c<l.length;c++){var u=l[c];for(var f in u)(!is.call(s,f)||i||u[f]!==e[f])&&(s[f]=u[f])}return s}function a_(e){switch(e._tag){case"RefinementType":case"ReadonlyType":return a_(e.type);case"InterfaceType":case"StrictType":case"PartialType":return e.props;case"IntersectionType":return e.types.reduce(function(t,n){return Object.assign(t,a_(n))},{})}}function Nx(e,t){for(var n=Object.getOwnPropertyNames(e),r=!1,i={},o=0;o<n.length;o++){var a=n[o];is.call(t,a)?i[a]=e[a]:r=!0}return r?i:e}function eJ(e){return Lx(e)?"{| ".concat(r_(e.props)," |}"):oJ(e)?kx("{| ".concat(r_(e.props)," |}")):"Exact<".concat(e.name,">")}function tJ(e){return e.length>0}var Ln={};function Px(e,t){for(var n=[],r=0,i=e;r<i.length;r++){var o=i[r];t.indexOf(o)!==-1&&n.push(o)}return n}function nJ(e,t){if(e===Ln)return t;if(t===Ln)return e;var n=Object.assign({},e);for(var r in t)if(is.call(e,r)){var i=Px(e[r],t[r]);if(tJ(i))n[r]=i;else{n=Ln;break}}else n[r]=t[r];return n}function rJ(e,t){if(e===Ln||t===Ln)return Ln;var n=Ln;for(var r in e)if(is.call(t,r)){var i=Px(e[r],t[r]);i.length===0&&(n===Ln&&(n={}),n[r]=e[r].concat(t[r]))}return n}function Fx(e){return e._tag==="AnyType"}function Dx(e){return e._tag==="LiteralType"}function iJ(e){return e._tag==="KeyofType"}function Lx(e){return e._tag==="InterfaceType"}function oJ(e){return e._tag==="PartialType"}function aJ(e){return e._tag==="StrictType"}function uJ(e){return e._tag==="ExactType"}function sJ(e){return e._tag==="RefinementType"}function cJ(e){return e._tag==="IntersectionType"}function jx(e){return e._tag==="UnionType"}function lJ(e){return e._tag==="RecursiveType"}var u_=[];function Ka(e){if(u_.indexOf(e)!==-1)return Ln;if(Lx(e)||aJ(e)){var t=Ln;for(var n in e.props){var r=e.props[n];Dx(r)&&(t===Ln&&(t={}),t[n]=[r.value])}return t}else{if(uJ(e)||sJ(e))return Ka(e.type);if(cJ(e))return e.types.reduce(function(o,a){return nJ(o,Ka(a))},Ln);if(jx(e))return e.types.slice(1).reduce(function(o,a){return rJ(o,Ka(a))},Ka(e.types[0]));if(lJ(e)){u_.push(e);var i=Ka(e.type);return u_.pop(),i}}return Ln}function Ux(e){var t=Ka(e[0]),n=Object.keys(t),r=e.length,i=function(c){for(var l=t[c].slice(),f=[t[c]],d=1;d<r;d++){var p=e[d],h=Ka(p),v=h[c];if(v===void 0)return"continue-keys";if(v.some(function(y){return l.indexOf(y)!==-1}))return"continue-keys";l.push.apply(l,v),f.push(v)}return{value:[c,f]}};e:for(var o=0,a=n;o<a.length;o++){var u=a[o],s=i(u);if(typeof s=="object")return s.value;switch(s){case"continue-keys":continue e}}}var Bx=function(e){He(t,e);function t(){var n=e.call(this,"null",function(r){return r===null},function(r,i){return n.is(r)?Ie(r):Ye(r,i)},We)||this;return n._tag="NullType",n}return t}(be),s_=new Bx,zx=function(e){He(t,e);function t(){var n=e.call(this,"undefined",function(r){return r===void 0},function(r,i){return n.is(r)?Ie(r):Ye(r,i)},We)||this;return n._tag="UndefinedType",n}return t}(be),pm=new zx,qx=function(e){He(t,e);function t(){var n=e.call(this,"void",pm.is,pm.validate,We)||this;return n._tag="VoidType",n}return t}(be),Kx=new qx,Vx=function(e){He(t,e);function t(){var n=e.call(this,"unknown",function(r){return!0},Ie,We)||this;return n._tag="UnknownType",n}return t}(be),fJ=new Vx,Hx=function(e){He(t,e);function t(){var n=e.call(this,"string",function(r){return typeof r=="string"},function(r,i){return n.is(r)?Ie(r):Ye(r,i)},We)||this;return n._tag="StringType",n}return t}(be),oi=new Hx,Jx=function(e){He(t,e);function t(){var n=e.call(this,"number",function(r){return typeof r=="number"},function(r,i){return n.is(r)?Ie(r):Ye(r,i)},We)||this;return n._tag="NumberType",n}return t}(be),as=new Jx,Gx=function(e){He(t,e);function t(){var n=e.call(this,"bigint",function(r){return typeof r=="bigint"},function(r,i){return n.is(r)?Ie(r):Ye(r,i)},We)||this;return n._tag="BigIntType",n}return t}(be),dJ=new Gx,Yx=function(e){He(t,e);function t(){var n=e.call(this,"boolean",function(r){return typeof r=="boolean"},function(r,i){return n.is(r)?Ie(r):Ye(r,i)},We)||this;return n._tag="BooleanType",n}return t}(be),hm=new Yx,Zx=function(e){He(t,e);function t(){var n=e.call(this,"UnknownArray",Array.isArray,function(r,i){return n.is(r)?Ie(r):Ye(r,i)},We)||this;return n._tag="AnyArrayType",n}return t}(be),Vc=new Zx,Xx=function(e){He(t,e);function t(){var n=e.call(this,"UnknownRecord",function(r){var i=Object.prototype.toString.call(r);return i==="[object Object]"||i==="[object Window]"},function(r,i){return n.is(r)?Ie(r):Ye(r,i)},We)||this;return n._tag="AnyDictionaryType",n}return t}(be),_n=new Xx,Qx=function(e){He(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.value=a,u._tag="LiteralType",u}return t}(be);function Id(e,t){t===void 0&&(t=JSON.stringify(e));var n=function(r){return r===e};return new Qx(t,n,function(r,i){return n(r)?Ie(e):Ye(r,i)},We,e)}var eC=function(e){He(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.keys=a,u._tag="KeyofType",u}return t}(be);function pJ(e,t){t===void 0&&(t=Object.keys(e).map(function(r){return JSON.stringify(r)}).join(" | "));var n=function(r){return oi.is(r)&&is.call(e,r)};return new eC(t,n,function(r,i){return n(r)?Ie(r):Ye(r,i)},We,e)}var tC=function(e){He(t,e);function t(n,r,i,o,a,u){var s=e.call(this,n,r,i,o)||this;return s.type=a,s.predicate=u,s._tag="RefinementType",s}return t}(be);function mm(e,t,n){return m_(e,t,n)}var vm=mm(as,function(e){return Number.isInteger(e)},"Int"),c_=function(e){He(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.runDefinition=a,u._tag="RecursiveType",u}return t}(be);Object.defineProperty(c_.prototype,"type",{get:function(){return this.runDefinition()},enumerable:!0,configurable:!0});function l_(e,t){var n,r=function(){return n||(n=t(i),n.name=e),n},i=new c_(e,function(o){return r().is(o)},function(o,a){return r().validate(o,a)},function(o){return r().encode(o)},r);return i}var nC=function(e){He(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.type=a,u._tag="ArrayType",u}return t}(be);function gm(e,t){return t===void 0&&(t="Array<".concat(e.name,">")),new nC(t,function(n){return Vc.is(n)&&n.every(e.is)},function(n,r){var i=Vc.validate(n,r);if(re(i))return i;for(var o=i.right,a=o.length,u=o,s=[],c=0;c<a;c++){var l=o[c],f=e.validate(l,ii(r,String(c),e,l));if(re(f))Oo(s,f.left);else{var d=f.right;d!==l&&(u===o&&(u=o.slice()),u[c]=d)}}return s.length>0?Ui(s):Ie(u)},e.encode===We?We:function(n){return n.map(e.encode)},e)}var rC=function(e){He(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.props=a,u._tag="InterfaceType",u}return t}(be);function f_(e,t){t===void 0&&(t=Ax(e));var n=Object.keys(e),r=n.map(function(o){return e[o]}),i=n.length;return new rC(t,function(o){if(_n.is(o)){for(var a=0;a<i;a++){var u=n[a],s=o[u];if(s===void 0&&!is.call(o,u)||!r[a].is(s))return!1}return!0}return!1},function(o,a){var u=_n.validate(o,a);if(re(u))return u;for(var s=u.right,c=s,l=[],f=0;f<i;f++){var d=n[f],p=c[d],h=r[f],v=h.validate(p,ii(a,d,h,p));if(re(v))Oo(l,v.left);else{var y=v.right;(y!==p||y===void 0&&!is.call(c,d))&&(c===s&&(c=Kc({},s)),c[d]=y)}}return l.length>0?Ui(l):Ie(c)},Td(r)?We:function(o){for(var a=Kc({},o),u=0;u<i;u++){var s=n[u],c=r[u].encode;c!==We&&(a[s]=c(o[s]))}return a},e)}var iC=function(e){He(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.props=a,u._tag="PartialType",u}return t}(be);function hJ(e,t){t===void 0&&(t=kx(Ax(e)));var n=Object.keys(e),r=n.map(function(o){return e[o]}),i=n.length;return new iC(t,function(o){if(_n.is(o)){for(var a=0;a<i;a++){var u=n[a],s=o[u];if(s!==void 0&&!e[u].is(s))return!1}return!0}return!1},function(o,a){var u=_n.validate(o,a);if(re(u))return u;for(var s=u.right,c=s,l=[],f=0;f<i;f++){var d=n[f],p=c[d],h=e[d],v=h.validate(p,ii(a,d,h,p));if(re(v))p!==void 0&&Oo(l,v.left);else{var y=v.right;y!==p&&(c===s&&(c=Kc({},s)),c[d]=y)}}return l.length>0?Ui(l):Ie(c)},Td(r)?We:function(o){for(var a=Kc({},o),u=0;u<i;u++){var s=n[u],c=o[s];c!==void 0&&(a[s]=r[u].encode(c))}return a},e)}var d_=function(e){He(t,e);function t(n,r,i,o,a,u){var s=e.call(this,n,r,i,o)||this;return s.domain=a,s.codomain=u,s._tag="DictionaryType",s}return t}(be);function p_(e,t,n){var r=i_(e);return r?X6(Object.keys(r),e,t,n):Q6(e,t,n)}var h_=function(e){He(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.types=a,u._tag="UnionType",u}return t}(be);function Od(e,t){t===void 0&&(t=Wx(e));var n=Ux(e);if(n!==void 0&&e.length>0){var r=n[0],i=n[1],o=i.length,a=function(u){for(var s=0;s<o;s++)if(i[s].indexOf(u)!==-1)return s};return new ym(t,function(u){if(_n.is(u)){var s=a(u[r]);return s!==void 0?e[s].is(u):!1}return!1},function(u,s){var c=_n.validate(u,s);if(re(c))return c;var l=c.right,f=a(l[r]);if(f===void 0)return Ye(u,s);var d=e[f];return d.validate(l,ii(s,String(f),d,l))},Td(e)?We:function(u){var s=a(u[r]);if(s===void 0)throw new Error("no codec found to encode value in union codec ".concat(t));return e[s].encode(u)},e,r)}else return new h_(t,function(u){return e.some(function(s){return s.is(u)})},function(u,s){for(var c=[],l=0;l<e.length;l++){var f=e[l],d=f.validate(u,ii(s,String(l),f,u));if(re(d))Oo(c,d.left);else return Ie(d.right)}return Ui(c)},Td(e)?We:function(u){for(var s=0,c=e;s<c.length;s++){var l=c[s];if(l.is(u))return l.encode(u)}throw new Error("no codec found to encode value in union type ".concat(t))},e)}var oC=function(e){He(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.types=a,u._tag="IntersectionType",u}return t}(be);function mJ(e,t){t===void 0&&(t="(".concat(e.map(function(r){return r.name}).join(" & "),")"));var n=e.length;return new oC(t,function(r){return e.every(function(i){return i.is(r)})},e.length===0?Ie:function(r,i){for(var o=[],a=[],u=0;u<n;u++){var s=e[u],c=s.validate(r,ii(i,String(u),s,r));re(c)?Oo(a,c.left):o.push(c.right)}return a.length>0?Ui(a):Ie(o_(r,o))},e.length===0?We:function(r){return o_(r,e.map(function(i){return i.encode(r)}))},e)}var aC=function(e){He(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.types=a,u._tag="TupleType",u}return t}(be);function vJ(e,t){t===void 0&&(t="[".concat(e.map(function(r){return r.name}).join(", "),"]"));var n=e.length;return new aC(t,function(r){return Vc.is(r)&&r.length===n&&e.every(function(i,o){return i.is(r[o])})},function(r,i){var o=Vc.validate(r,i);if(re(o))return o;for(var a=o.right,u=a.length>n?a.slice(0,n):a,s=[],c=0;c<n;c++){var l=a[c],f=e[c],d=f.validate(l,ii(i,String(c),f,l));if(re(d))Oo(s,d.left);else{var p=d.right;p!==l&&(u===a&&(u=a.slice()),u[c]=p)}}return s.length>0?Ui(s):Ie(u)},Td(e)?We:function(r){return e.map(function(i,o){return i.encode(r[o])})},e)}var uC=function(e){He(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.type=a,u._tag="ReadonlyType",u}return t}(be);function gJ(e,t){return t===void 0&&(t="Readonly<".concat(e.name,">")),new uC(t,e.is,e.validate,e.encode,e)}var sC=function(e){He(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.type=a,u._tag="ReadonlyArrayType",u}return t}(be);function cC(e,t){t===void 0&&(t="ReadonlyArray<".concat(e.name,">"));var n=gm(e);return new sC(t,n.is,n.validate,n.encode,e)}var wd=function(e,t){return fC(f_(e),t)},lC=function(e){He(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.type=a,u._tag="ExactType",u}return t}(be);function fC(e,t){t===void 0&&(t=eJ(e));var n=a_(e);return new lC(t,e.is,function(r,i){var o=_n.validate(r,i);if(re(o))return o;var a=e.validate(r,i);return re(a)?a:ze(Nx(a.right,n))},function(r){return e.encode(Nx(r,n))},e)}var dC=function(e){He(t,e);function t(){var n=e.call(this,"Function",function(r){return typeof r=="function"},function(r,i){return n.is(r)?Ie(r):Ye(r,i)},We)||this;return n._tag="FunctionType",n}return t}(be),yJ=new dC,ym=function(e){He(t,e);function t(n,r,i,o,a,u){var s=e.call(this,n,r,i,o,a)||this;return s.tag=u,s}return t}(h_),bJ=function(e,t,n){n===void 0&&(n=Wx(t));var r=Od(t,n);return r instanceof ym?r:(console.warn("[io-ts] Cannot build a tagged union for ".concat(n,", returning a de-optimized union")),new ym(n,r.is,r.validate,r.encode,t,e))},$J=function(e,t){return{value:e,context:t}},pC=function(e){return[{key:"",type:e}]},hC=function(e){He(t,e);function t(){var n=e.call(this,"never",function(r){return!1},function(r,i){return Ye(r,i)},function(){throw new Error("cannot encode never")})||this;return n._tag="NeverType",n}return t}(be),_J=new hC,mC=function(e){He(t,e);function t(){var n=e.call(this,"any",function(r){return!0},Ie,We)||this;return n._tag="AnyType",n}return t}(be),SJ=new mC,TJ=_n,vC=function(e){He(t,e);function t(){var n=e.call(this,"object",function(r){return r!==null&&typeof r=="object"},function(r,i){return n.is(r)?Ie(r):Ye(r,i)},We)||this;return n._tag="ObjectType",n}return t}(be),IJ=new vC;function m_(e,t,n){return n===void 0&&(n="(".concat(e.name," | ").concat(Cx(t),")")),new tC(n,function(r){return e.is(r)&&t(r)},function(r,i){var o=e.validate(r,i);if(re(o))return o;var a=o.right;return t(a)?Ie(a):Ye(a,i)},e.encode,e,t)}var OJ=m_(as,Number.isInteger,"Integer"),wJ=p_,EJ=function(e){He(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.props=a,u._tag="StrictType",u}return t}(be);function RJ(e){return e}function MJ(e){return function(){return e}}const ie=Fa(Object.freeze(Object.defineProperty({__proto__:null,failures:Ui,failure:Ye,success:Ie,Type:be,identity:We,getFunctionName:Cx,getContextEntry:Z6,appendContext:ii,getDomainKeys:i_,mergeAll:o_,emptyTags:Ln,getTags:Ka,getIndex:Ux,NullType:Bx,nullType:s_,UndefinedType:zx,VoidType:qx,voidType:Kx,UnknownType:Vx,unknown:fJ,StringType:Hx,string:oi,NumberType:Jx,number:as,BigIntType:Gx,bigint:dJ,BooleanType:Yx,boolean:hm,AnyArrayType:Zx,UnknownArray:Vc,AnyDictionaryType:Xx,UnknownRecord:_n,null:s_,undefined:pm,void:Kx,LiteralType:Qx,literal:Id,KeyofType:eC,keyof:pJ,RefinementType:tC,brand:mm,Int:vm,RecursiveType:c_,recursion:l_,ArrayType:nC,array:gm,InterfaceType:rC,type:f_,PartialType:iC,partial:hJ,DictionaryType:d_,record:p_,UnionType:h_,union:Od,IntersectionType:oC,intersection:mJ,TupleType:aC,tuple:vJ,ReadonlyType:uC,readonly:gJ,ReadonlyArrayType:sC,readonlyArray:cC,strict:wd,ExactType:lC,exact:fC,FunctionType:dC,Function:yJ,TaggedUnionType:ym,taggedUnion:bJ,Array:Vc,interface:f_,getValidationError:$J,getDefaultContext:pC,NeverType:hC,never:_J,AnyType:mC,any:SJ,Dictionary:TJ,ObjectType:vC,object:IJ,refinement:m_,Integer:OJ,dictionary:wJ,StrictType:EJ,clean:RJ,alias:MJ},Symbol.toStringTag,{value:"Module"})));var Hc={},bm={},$m={};Object.defineProperty($m,"__esModule",{value:!0}),$m.clone=void 0;function xJ(e){var t=Object.create(Object.getPrototypeOf(e));return Object.assign(t,e),t}$m.clone=xJ;var CJ=se&&se.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),AJ=se&&se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),kJ=se&&se.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.hasOwnProperty.call(e,n)&&CJ(t,e,n);return AJ(t,e),t};Object.defineProperty(bm,"__esModule",{value:!0}),bm.withValidate=void 0;var WJ=kJ(ie),NJ=$m;function PJ(e,t,n){n===void 0&&(n=e.name);var r=NJ.clone(e);return r.validate=t,r.decode=function(i){return t(i,WJ.getDefaultContext(r))},r.name=n,r}bm.withValidate=PJ;var FJ=se&&se.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),DJ=se&&se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),LJ=se&&se.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.hasOwnProperty.call(e,n)&&FJ(t,e,n);return DJ(t,e),t};Object.defineProperty(Hc,"__esModule",{value:!0}),Hc.withFallback=void 0;var jJ=LJ(ie),UJ=bm,BJ=$o;function zJ(e,t,n){return n===void 0&&(n="withFallback("+e.name+")"),UJ.withValidate(e,function(r,i){return BJ.orElse(function(){return jJ.success(t)})(e.validate(r,i))},n)}Hc.withFallback=zJ;var Ze={},v_={};const Sn=Fa(xx),ur=Fa(ZM);Object.defineProperty(v_,"__esModule",{value:!0});const qJ=ee.exports,KJ=Sn,VJ=ur,_m=(0,qJ.__importStar)(ie);v_.default=new _m.Type("dateFromString",e=>e instanceof Date,(e,t)=>(0,VJ.pipe)(_m.string.validate(e,t),(0,KJ.chain)(n=>{const r=new Date(n);return isNaN(r.getTime())?_m.failure(e,t):_m.success(r)})),e=>e.toISOString());var g_={};Object.defineProperty(g_,"__esModule",{value:!0});const HJ=ee.exports,JJ=Sn,GJ=ur,Jc=(0,HJ.__importStar)(ie);g_.default=new Jc.Type("dateFromStringOrNumber",e=>e instanceof Date,(e,t)=>(0,GJ.pipe)(Jc.union([Jc.number,Jc.string]).validate(e,t),(0,JJ.chain)(n=>{const r=new Date(n);return isNaN(r.getTime())?Jc.failure(e,t):Jc.success(r)})),e=>e);var y_={};Object.defineProperty(y_,"__esModule",{value:!0});const YJ=ee.exports,ZJ=Sn,XJ=ur,Sm=(0,YJ.__importStar)(ie);y_.default=new Sm.Type("dateFromTsMs",e=>e instanceof Date,(e,t)=>(0,XJ.pipe)(Sm.number.validate(e,t),(0,ZJ.chain)(n=>{const r=new Date(n);return isNaN(r.getTime())?Sm.failure(e,t):Sm.success(r)})),e=>e.getTime());var je={};function gC(e){return function(t){return function(n){return n.reduce(function(r,i){return e.alt(r,function(){return i})},t)}}}const QJ=Object.freeze(Object.defineProperty({__proto__:null,altAll:gC},Symbol.toStringTag,{value:"Module"}));function e7(e){return gC(e)(e.zero())}const t7=Object.freeze(Object.defineProperty({__proto__:null,altAll:e7},Symbol.toStringTag,{value:"Module"}));var kr=function(e){return{equals:function(t,n){return t===n||e(t,n)}}},yC=function(e){return kr(function(t,n){for(var r in e)if(!e[r].equals(t[r],n[r]))return!1;return!0})},bC=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return kr(function(n,r){return e.every(function(i,o){return i.equals(n[o],r[o])})})},n7=function(e,t){return m(e,$C(t))},$C=function(e){return function(t){return kr(function(n,r){return t.equals(e(n),e(r))})}},_C="Eq",Gc={equals:function(e,t){return e===t}},r7={equals:function(){return!0}},SC=function(){return{concat:function(e,t){return kr(function(n,r){return e.equals(n,r)&&t.equals(n,r)})}}},i7=function(){return{concat:SC().concat,empty:r7}},TC={URI:_C,contramap:n7},o7=bC,a7=yC,u7=Gc.equals,s7=TC,c7=Gc,l7=Gc,f7=Gc,d7={equals:function(e,t){return e.valueOf()===t.valueOf()}};const p7=Object.freeze(Object.defineProperty({__proto__:null,fromEquals:kr,struct:yC,tuple:bC,contramap:$C,URI:_C,eqStrict:Gc,getSemigroup:SC,getMonoid:i7,Contravariant:TC,getTupleEq:o7,getStructEq:a7,strictEqual:u7,eq:s7,eqBoolean:c7,eqString:l7,eqNumber:f7,eqDate:d7},Symbol.toStringTag,{value:"Module"}));var IC=function(e){return function(t,n){return t===n||e(t,n)===0}},us=function(e){return{equals:IC(e),compare:function(t,n){return t===n?0:e(t,n)}}},OC=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return us(function(n,r){for(var i=0;i<e.length-1;i++){var o=e[i].compare(n[i],r[i]);if(o!==0)return o}return e[i].compare(n[i],r[i])})},b_=function(e){return us(function(t,n){return e.compare(n,t)})},h7=function(e,t){return m(e,Tm(t))},Tm=function(e){return function(t){return us(function(n,r){return t.compare(e(n),e(r))})}},wC="Ord",EC=function(){return{concat:function(e,t){return us(function(n,r){var i=e.compare(n,r);return i!==0?i:t.compare(n,r)})}}},$_=function(){return{concat:EC().concat,empty:us(function(){return 0})}},RC={URI:wC,contramap:h7},m7={equals:W$,compare:Fn(0)},v7=function(e){return function(t){return function(n){return n===t||e.compare(n,t)===0}}},MC=function(e){return function(t,n){return e.compare(t,n)===-1}},xC=function(e){return function(t,n){return e.compare(t,n)===1}},g7=function(e){return function(t,n){return e.compare(t,n)!==1}},y7=function(e){return function(t,n){return e.compare(t,n)!==-1}},Im=function(e){return function(t,n){return t===n||e.compare(t,n)<1?t:n}},Om=function(e){return function(t,n){return t===n||e.compare(t,n)>-1?t:n}},CC=function(e){var t=Im(e),n=Om(e);return function(r,i){return function(o){return n(t(o,i),r)}}},b7=function(e){var t=MC(e),n=xC(e);return function(r,i){return function(o){return!(t(o,r)||n(o,i))}}},$7=OC,_7=b_,S7=RC;function T7(e,t){return e<t?-1:e>t?1:0}var __={equals:Gc.equals,compare:T7},I7=__,O7=__,wm=__,w7=m(wm,Tm(function(e){return e.valueOf()}));const E7=Object.freeze(Object.defineProperty({__proto__:null,equalsDefault:IC,fromCompare:us,tuple:OC,reverse:b_,contramap:Tm,URI:wC,getSemigroup:EC,getMonoid:$_,Contravariant:RC,trivial:m7,equals:v7,lt:MC,gt:xC,leq:g7,geq:y7,min:Im,max:Om,clamp:CC,between:b7,getTupleOrd:$7,getDualOrd:_7,ord:S7,ordBoolean:I7,ordString:O7,ordNumber:wm,ordDate:w7},Symbol.toStringTag,{value:"Module"}));var AC=function(e){return{concat:function(t,n){return e.concat(n,t)}}},R7=function(e){return function(t){return{concat:function(n,r){return e(n)?t.concat(n,r):r}}}},M7=function(e){return function(t){return{concat:function(n,r){return e(r)?t.concat(n,r):n}}}},x7=function(e){return function(t){return{concat:function(n,r){return t.concat(e(n),e(r))}}}},kC=function(e){return function(t){return function(n){return n.reduce(function(r,i){return e.concat(r,i)},t)}}};const C7=Object.freeze(Object.defineProperty({__proto__:null,reverse:AC,filterFirst:R7,filterSecond:M7,endo:x7,concatAll:kC},Symbol.toStringTag,{value:"Module"}));var Em=function(e){return{concat:Im(e)}},Rm=function(e){return{concat:Om(e)}},S_=function(e){return{concat:function(){return e}}},T_=AC,I_=function(e){return{concat:function(t,n){var r={};for(var i in e)ot.call(e,i)&&(r[i]=e[i].concat(t[i],n[i]));return r}}},O_=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return{concat:function(n,r){return e.map(function(i,o){return i.concat(n[o],r[o])})}}},WC=function(e){return function(t){return{concat:function(n,r){return t.concat(n,t.concat(e,r))}}}},w_=function(){return{concat:B}},Mm=function(){return{concat:function(e,t){return t}}},E_=kC,NC=S_(void 0),A7=function(){return{concat:function(e,t){return Object.assign({},e,t)}}},k7=Mm,W7=w_,N7=O_,P7=I_,F7=T_,D7=Rm,L7=Em,j7=WC;function U7(e){var t=E_(e);return function(n,r){return r===void 0?t(n):t(n)(r)}}var PC={concat:function(e,t){return e&&t}},FC={concat:function(e,t){return e||t}},B7=A$,DC={concat:function(e,t){return e+t}},LC={concat:function(e,t){return e+t}},jC={concat:function(e,t){return e*t}};const UC=Object.freeze(Object.defineProperty({__proto__:null,min:Em,max:Rm,constant:S_,reverse:T_,struct:I_,tuple:O_,intercalate:WC,first:w_,last:Mm,concatAll:E_,semigroupVoid:NC,getObjectSemigroup:A7,getLastSemigroup:k7,getFirstSemigroup:W7,getTupleSemigroup:N7,getStructSemigroup:P7,getDualSemigroup:F7,getJoinSemigroup:D7,getMeetSemigroup:L7,getIntercalateSemigroup:j7,fold:U7,semigroupAll:PC,semigroupAny:FC,getFunctionSemigroup:B7,semigroupString:DC,semigroupSum:LC,semigroupProduct:jC},Symbol.toStringTag,{value:"Module"}));var Ed=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},Rd=Yt,Bi=ft,xm=function(e,t){return e<0||e>=t.length},R_=function(e){return function(t){return Ed([e],t,!0)}},Yc=R_,M_=function(e){return function(t){return Ed(Ed([],t,!0),[e],!1)}},Cm=M_,Am=function(e,t,n){if(Bi(n)){var r=lm(n);return r.splice(e,0,t),r}return[t]},x_=function(e,t,n){if(n[e]===t)return n;var r=lm(n);return r[e]=t,r},C_=function(e){return function(t){if(t.length===1)return t;for(var n=[In(t)],r=ui(t),i=function(s){n.every(function(c){return!e.equals(c,s)})&&n.push(s)},o=0,a=r;o<a.length;o++){var u=a[o];i(u)}return n}},BC=function(e){if(Bi(e)){var t=$_();return W_(e.reduce(t.concat,t.empty))}return B},A_=function(e){var t=C_(e);return function(n){return function(r){return t(m(r,xd(n)))}}},k_=function(e){return function(t){var n=t.length,r=Math.round(e)%n;if(xm(Math.abs(r),t)||r===0)return t;if(r<0){var i=Nm(-r)(t),o=i[0],a=i[1];return m(a,xd(o))}else return k_(r-n)(t)}},Md=function(e){return Bi(e)?le(e):me},km=function(e){return function(t){for(var n=Math.max(0,Math.floor(t)),r=[e(0)],i=1;i<n;i++)r.push(e(i));return r}},z7=function(e){return km(function(){return e})},zC=function(e,t){return e<=t?km(function(n){return e+n})(t-e+1):[e]},qC=function(e){return[In(e),ui(e)]},KC=function(e){return[Zc(e),Ha(e)]},q7=function(e){return Md(e.slice())};function VC(e){return function(t){return t.concat(e)}}function xd(e,t){return t?e.concat(t):function(n){return n.concat(e)}}var K7=function(e){return e.length===1?e:Ed([Ha(e)],e.slice(0,-1).reverse(),!0)};function HC(e){return function(t){var n=t.length;if(n===0)return Rd;for(var r=[],i=t[0],o=[i],a=1;a<n;a++){var u=t[a];e.equals(u,i)?o.push(u):(r.push(o),i=u,o=[i])}return r.push(o),r}}var V7=function(e){return function(t){for(var n={},r=0,i=t;r<i.length;r++){var o=i[r],a=e(o);ot.call(n,a)?n[a].push(o):n[a]=[o]}return n}},W_=function(e){return function(t){return t.length===1?t:t.slice().sort(e.compare)}},H7=function(e,t){return JC(e,function(){return t})},JC=function(e,t){return function(n){return xm(e,n)?me:le(x_(e,t(n[e]),n))}},GC=function(e,t,n){for(var r=[n(e[0],t[0])],i=Math.min(e.length,t.length),o=1;o<i;o++)r[o]=n(e[o],t[o]);return r};function YC(e,t){return t===void 0?function(n){return YC(n,e)}:GC(e,t,function(n,r){return[n,r]})}var J7=function(e){for(var t=[e[0][0]],n=[e[0][1]],r=1;r<e.length;r++)t[r]=e[r][0],n[r]=e[r][1];return[t,n]},Wm=function(e){return function(t){for(var n=[e,t[0]],r=1;r<t.length;r++)n.push(e,t[r]);return n}},N_=function(e){return function(t){var n=ui(t);return Bi(n)?m(n,Wm(e),Yc(In(t))):t}},ZC=function(e){return function(t){for(var n=lm(e(0,In(t))),r=1;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},P_=function(e){return function(t){for(var n=e(t),r=n[0],i=n[1],o=[r],a=i;Bi(a);){var u=e(a),s=u[0],c=u[1];o.push(s),a=c}return o}},Nm=function(e){return function(t){var n=Math.max(1,e);return n>=t.length?[t,Rd]:[m(t.slice(1,n),Yc(In(t))),t.slice(n)]}},XC=function(e){return P_(Nm(e))},ai=function(e,t){return m(e,q_(t))},F_=function(e,t){return m(e,K_(t))},Cd=function(e,t){return m(e,iA(t))},D_=function(e,t){return m(e,Pm(t))},QC=function(e,t){return m(e,z_(t))},Ad=function(e,t,n){return m(e,V_(t,n))},kd=function(e){var t=H_(e);return function(n,r){return m(n,t(r))}},Wd=function(e,t,n){return m(e,J_(t,n))},L_=function(e){var t=oA(e);return function(n,r){return m(n,t(r))}},eA=function(e,t){return m(e,rA(t))},j_=function(e,t,n){return m(e,Fm(t,n))},U_=function(e){var t=G_(e);return function(n,r){return m(n,t(r))}},B_=function(e,t,n){return m(e,Dm(t,n))},tA=function(e){var t=jm(e);return function(n,r){return m(n,t(r))}},Va=dd,nA=function(e){return function(t){return m(t,VC(e()))}},rA=nA,iA=function(e){return Pm(function(t){return m(e,q_(t))})},Pm=function(e){return ZC(function(t,n){return e(n)})},z_=function(e){return function(t){for(var n=ui(t),r=[e(t)];Bi(n);)r.push(e(n)),n=ui(n);return r}},G7=z_(B),Y7=Pm(B),q_=function(e){return K_(function(t,n){return e(n)})},K_=function(e){return function(t){for(var n=[e(0,In(t))],r=1;r<t.length;r++)n.push(e(r,t[r]));return n}},V_=function(e,t){return Fm(e,function(n,r,i){return t(r,i)})},H_=function(e){return function(t){return function(n){return n.slice(1).reduce(function(r,i){return e.concat(r,t(i))},t(n[0]))}}},J_=function(e,t){return Dm(e,function(n,r,i){return t(r,i)})},Fm=function(e,t){return function(n){return n.reduce(function(r,i,o){return t(o,r,i)},e)}},G_=function(e){return function(t){return function(n){return n.slice(1).reduce(function(r,i,o){return e.concat(r,t(o+1,i))},t(0,n[0]))}}},Dm=function(e,t){return function(n){return n.reduceRight(function(r,i,o){return t(o,i,r)},e)}},oA=function(e){var t=jm(e);return function(n){return t(function(r,i){return n(i)})}},Lm=function(e){return jm(e)(Dn)},jm=function(e){return function(t){return function(n){for(var r=e.map(t(0,In(n)),Va),i=1;i<n.length;i++)r=e.ap(e.map(r,function(o){return function(a){return m(o,Cm(a))}}),t(i,n[i]));return r}}},Um=or,Tn="ReadonlyNonEmptyArray",aA=function(e){return{show:function(t){return"[".concat(t.map(e.show).join(", "),"]")}}},Z7=function(){return{concat:xd}},uA=function(e){return kr(function(t,n){return t.length===n.length&&t.every(function(r,i){return e.equals(r,n[i])})})},X7=function(e){var t=A_(e);return{concat:function(n,r){return t(r)(n)}}},Y_={URI:Tn,map:ai},Q7=De(Y_),e8={URI:Tn,of:Va},t8={URI:Tn,map:ai,mapWithIndex:F_},Bm={URI:Tn,map:ai,ap:Cd},n8=_t(Bm),r8=St(Bm),i8={URI:Tn,map:ai,ap:Cd,of:Va},Z_={URI:Tn,map:ai,ap:Cd,chain:D_},o8=at(Z_),a8={URI:Tn,map:ai,ap:Cd,of:Va,chain:D_},u8={URI:Tn,reduce:Ad,foldMap:kd,reduceRight:Wd},s8={URI:Tn,reduce:Ad,foldMap:kd,reduceRight:Wd,reduceWithIndex:j_,foldMapWithIndex:U_,reduceRightWithIndex:B_},c8={URI:Tn,map:ai,reduce:Ad,foldMap:kd,reduceRight:Wd,traverse:L_,sequence:Lm},l8={URI:Tn,map:ai,mapWithIndex:F_,reduce:Ad,foldMap:kd,reduceRight:Wd,traverse:L_,sequence:Lm,reduceWithIndex:j_,foldMapWithIndex:U_,reduceRightWithIndex:B_,traverseWithIndex:tA},f8={URI:Tn,map:ai,alt:eA},d8={URI:Tn,map:ai,extend:QC,extract:Um},p8=Va(jt),h8=It(Y_),m8=Ot(Z_),v8=Tt(Bm),In=Um,ui=Dc,Ha=function(e){return e[e.length-1]},Zc=function(e){return e.slice(0,-1)},sA=function(e){var t=Em(e);return function(n){return n.reduce(t.concat)}},cA=function(e){var t=Rm(e);return function(n){return n.reduce(t.concat)}},zm=function(e){return function(t){return t.reduce(e.concat)}},g8=function(e){return function(t){return e(In(t),ui(t))}},y8=function(e){return function(t){return e(Zc(t),Ha(t))}},lA=function(e){return function(t){return Ed([e(In(t))],ui(t),!0)}},b8=function(e){return lA(function(){return e})},fA=function(e){return function(t){return m(Zc(t),Cm(e(Ha(t))))}},$8=function(e){return fA(function(){return e})},X_=function(e){var t=zm(e);return function(n){return Z(N_(n),t)}};function _8(e){var t=W_(e),n=HC(e);return function(r){return Bi(r)?n(t(r)):Rd}}function S8(e){return dA(function(t,n){return e(n)})}var dA=function(e){return function(t){return Md(t.filter(function(n,r){return e(r,n)}))}},T8=qC,I8=KC;function pA(e,t){return t===void 0?Yc(e):m(t,Yc(e))}var hA=function(e,t){return m(e,xd([t]))},O8=function(e,t){return function(n){return e<0||e>n.length?me:le(Am(e,t,n))}},w8=Wm,E8=zm,R8={URI:Tn,of:Va,map:ai,mapWithIndex:F_,ap:Cd,chain:D_,extend:QC,extract:Um,reduce:Ad,foldMap:kd,reduceRight:Wd,traverse:L_,sequence:Lm,reduceWithIndex:j_,foldMapWithIndex:U_,reduceRightWithIndex:B_,traverseWithIndex:tA,alt:eA};const M8=Object.freeze(Object.defineProperty({__proto__:null,empty:Rd,isNonEmpty:Bi,isOutOfBound:xm,prependW:R_,prepend:Yc,appendW:M_,append:Cm,unsafeInsertAt:Am,unsafeUpdateAt:x_,uniq:C_,sortBy:BC,union:A_,rotate:k_,fromReadonlyArray:Md,makeBy:km,replicate:z7,range:zC,unprepend:qC,unappend:KC,fromArray:q7,concatW:VC,concat:xd,reverse:K7,group:HC,groupBy:V7,sort:W_,updateAt:H7,modifyAt:JC,zipWith:GC,zip:YC,unzip:J7,prependAll:Wm,intersperse:N_,chainWithIndex:ZC,chop:P_,splitAt:Nm,chunksOf:XC,of:Va,altW:nA,alt:rA,ap:iA,chain:Pm,extend:z_,duplicate:G7,flatten:Y7,map:q_,mapWithIndex:K_,reduce:V_,foldMap:H_,reduceRight:J_,reduceWithIndex:Fm,foldMapWithIndex:G_,reduceRightWithIndex:Dm,traverse:oA,sequence:Lm,traverseWithIndex:jm,extract:Um,URI:Tn,getShow:aA,getSemigroup:Z7,getEq:uA,getUnionSemigroup:X7,Functor:Y_,flap:Q7,Pointed:e8,FunctorWithIndex:t8,Apply:Bm,apFirst:n8,apSecond:r8,Applicative:i8,Chain:Z_,chainFirst:o8,Monad:a8,Foldable:u8,FoldableWithIndex:s8,Traversable:c8,TraversableWithIndex:l8,Alt:f8,Comonad:d8,Do:p8,bindTo:h8,bind:m8,apS:v8,head:In,tail:ui,last:Ha,init:Zc,min:sA,max:cA,concatAll:zm,matchLeft:g8,matchRight:y8,modifyHead:lA,updateHead:b8,modifyLast:fA,updateLast:$8,intercalate:X_,groupSort:_8,filter:S8,filterWithIndex:dA,uncons:T8,unsnoc:I8,cons:pA,snoc:hA,insertAt:O8,prependToAll:w8,fold:E8,readonlyNonEmptyArray:R8},Symbol.toStringTag,{value:"Module"}));var Nd=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},wo=function(e){return e.length>0},qm=function(e,t){return e<0||e>=t.length},Q_=function(e){return function(t){return Nd([e],t,!0)}},Xc=Q_,eS=function(e){return function(t){return Nd(Nd([],t,!0),[e],!1)}},Pd=eS,tS=function(e,t,n){if(wo(n)){var r=Fd(n);return r.splice(e,0,t),r}return[t]},nS=function(e,t,n){var r=Fd(n);return r[e]=t,r},rS=function(e){return function(t){if(t.length===1)return Qc(t);for(var n=[Wr(t)],r=ci(t),i=function(s){n.every(function(c){return!e.equals(c,s)})&&n.push(s)},o=0,a=r;o<a.length;o++){var u=a[o];i(u)}return n}},mA=function(e){if(wo(e)){var t=$_();return uS(e.reduce(t.concat,t.empty))}return Qc},iS=function(e){var t=rS(e);return function(n){return function(r){return t(m(r,Vm(n)))}}},oS=function(e){return function(t){var n=t.length,r=Math.round(e)%n;if(qm(Math.abs(r),t)||r===0)return Qc(t);if(r<0){var i=Jm(-r)(t),o=i[0],a=i[1];return m(a,Vm(o))}else return oS(r-n)(t)}},Fd=lm,aS=function(e){return wo(e)?le(e):me},Km=function(e){return function(t){for(var n=Math.max(0,Math.floor(t)),r=[e(0)],i=1;i<n;i++)r.push(e(i));return r}},x8=function(e){return Km(function(){return e})},vA=function(e,t){return e<=t?Km(function(n){return e+n})(t-e+1):[e]},gA=function(e){return[Wr(e),ci(e)]},yA=function(e){return[tl(e),el(e)]};function bA(e){return function(t){return t.concat(e)}}function Vm(e,t){return t?e.concat(t):function(n){return n.concat(e)}}var C8=function(e){return Nd([el(e)],e.slice(0,-1).reverse(),!0)};function $A(e){return function(t){var n=t.length;if(n===0)return[];for(var r=[],i=t[0],o=[i],a=1;a<n;a++){var u=t[a];e.equals(u,i)?o.push(u):(r.push(o),i=u,o=[i])}return r.push(o),r}}var A8=function(e){return function(t){for(var n={},r=0,i=t;r<i.length;r++){var o=i[r],a=e(o);ot.call(n,a)?n[a].push(o):n[a]=[o]}return n}},uS=function(e){return function(t){return t.slice().sort(e.compare)}},k8=function(e,t){return function(n){return e<0||e>n.length?me:le(tS(e,t,n))}},W8=function(e,t){return _A(e,function(){return t})},_A=function(e,t){return function(n){return qm(e,n)?me:le(nS(e,t(n[e]),n))}},Qc=Fd,Ja=function(e){return[e]},SA=function(e,t,n){for(var r=[n(e[0],t[0])],i=Math.min(e.length,t.length),o=1;o<i;o++)r[o]=n(e[o],t[o]);return r};function TA(e,t){return t===void 0?function(n){return TA(n,e)}:SA(e,t,function(n,r){return[n,r]})}var N8=function(e){for(var t=[e[0][0]],n=[e[0][1]],r=1;r<e.length;r++)t[r]=e[r][0],n[r]=e[r][1];return[t,n]},Hm=function(e){return function(t){for(var n=[e,t[0]],r=1;r<t.length;r++)n.push(e,t[r]);return n}},IA=function(e){return function(t){var n=ci(t);return wo(n)?m(n,Hm(e),Xc(Wr(t))):Qc(t)}},OA=G_,wA=H_,EA=function(e){return function(t){for(var n=Fd(e(0,Wr(t))),r=1;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},sS=function(e){return function(t){for(var n=e(t),r=n[0],i=n[1],o=[r],a=i;wo(a);){var u=e(a),s=u[0],c=u[1];o.push(s),a=c}return o}},Jm=function(e){return function(t){var n=Math.max(1,e);return n>=t.length?[Qc(t),[]]:[m(t.slice(1,n),Xc(Wr(t))),t.slice(n)]}},RA=function(e){return sS(Jm(e))},si=function(e,t){return m(e,vS(t))},cS=function(e,t){return m(e,gS(t))},Dd=function(e,t){return m(e,WA(t))},lS=function(e,t){return m(e,Gm(t))},MA=function(e,t){return m(e,mS(t))},Ld=function(e,t,n){return m(e,NA(t,n))},jd=function(e){var t=wA(e);return function(n,r){return m(n,t(r))}},Ud=function(e,t,n){return m(e,FA(t,n))},fS=function(e){var t=LA(e);return function(n,r){return m(n,t(r))}},xA=function(e,t){return m(e,kA(t))},dS=function(e,t,n){return m(e,PA(t,n))},pS=function(e){var t=OA(e);return function(n,r){return m(n,t(r))}},hS=function(e,t,n){return m(e,DA(t,n))},CA=function(e){var t=Zm(e);return function(n,r){return m(n,t(r))}},AA=function(e){return function(t){return m(t,bA(e()))}},kA=AA,WA=function(e){return Gm(function(t){return m(e,vS(t))})},Gm=function(e){return EA(function(t,n){return e(n)})},mS=function(e){return function(t){for(var n=ci(t),r=[e(t)];wo(n);)r.push(e(n)),n=ci(n);return r}},P8=mS(B),F8=Gm(B),vS=function(e){return gS(function(t,n){return e(n)})},gS=function(e){return function(t){for(var n=[e(0,Wr(t))],r=1;r<t.length;r++)n.push(e(r,t[r]));return n}},NA=V_,PA=Fm,FA=J_,DA=Dm,LA=function(e){var t=Zm(e);return function(n){return t(function(r,i){return n(i)})}},Ym=function(e){return Zm(e)(function(t,n){return n})},Zm=function(e){return function(t){return function(n){for(var r=e.map(t(0,Wr(n)),Ja),i=1;i<n.length;i++)r=e.ap(e.map(r,function(o){return function(a){return m(o,Pd(a))}}),t(i,n[i]));return r}}},yS=In,On="NonEmptyArray",D8=aA,L8=function(){return{concat:Vm}},j8=uA,U8=function(e){var t=iS(e);return{concat:function(n,r){return t(r)(n)}}},bS={URI:On,map:si},B8=De(bS),z8={URI:On,of:Ja},q8={URI:On,map:si,mapWithIndex:cS},Xm={URI:On,map:si,ap:Dd},K8=_t(Xm),V8=St(Xm),H8={URI:On,map:si,ap:Dd,of:Ja},$S={URI:On,map:si,ap:Dd,chain:lS},J8=at($S),G8={URI:On,map:si,ap:Dd,of:Ja,chain:lS},Y8={URI:On,reduce:Ld,foldMap:jd,reduceRight:Ud},Z8={URI:On,reduce:Ld,foldMap:jd,reduceRight:Ud,reduceWithIndex:dS,foldMapWithIndex:pS,reduceRightWithIndex:hS},X8={URI:On,map:si,reduce:Ld,foldMap:jd,reduceRight:Ud,traverse:fS,sequence:Ym},Q8={URI:On,map:si,mapWithIndex:cS,reduce:Ld,foldMap:jd,reduceRight:Ud,traverse:fS,sequence:Ym,reduceWithIndex:dS,foldMapWithIndex:pS,reduceRightWithIndex:hS,traverseWithIndex:CA},e9={URI:On,map:si,alt:xA},t9={URI:On,map:si,extend:MA,extract:yS},n9=Ja(jt),r9=It(bS),i9=Ot($S),o9=Tt(Xm),Wr=In,ci=function(e){return e.slice(1)},el=Ha,tl=function(e){return e.slice(0,-1)},a9=sA,u9=cA,s9=function(e){return function(t){return t.reduce(e.concat)}},c9=function(e){return function(t){return e(Wr(t),ci(t))}},l9=function(e){return function(t){return e(tl(t),el(t))}},jA=function(e){return function(t){return Nd([e(Wr(t))],ci(t),!0)}},f9=function(e){return jA(function(){return e})},UA=function(e){return function(t){return m(tl(t),Pd(e(el(t))))}},d9=function(e){return UA(function(){return e})},p9=X_;function h9(e){var t=uS(e),n=$A(e);return function(r){return wo(r)?n(t(r)):[]}}function m9(e){return BA(function(t,n){return e(n)})}var BA=function(e){return function(t){return aS(t.filter(function(n,r){return e(r,n)}))}},v9=gA,g9=yA;function zA(e,t){return t===void 0?Xc(e):m(t,Xc(e))}var qA=function(e,t){return m(e,Pd(t))},y9=Hm,b9=zm,$9={URI:On,of:Ja,map:si,mapWithIndex:cS,ap:Dd,chain:lS,extend:MA,extract:yS,reduce:Ld,foldMap:jd,reduceRight:Ud,traverse:fS,sequence:Ym,reduceWithIndex:dS,foldMapWithIndex:pS,reduceRightWithIndex:hS,traverseWithIndex:CA,alt:xA};const _9=Object.freeze(Object.defineProperty({__proto__:null,isNonEmpty:wo,isOutOfBound:qm,prependW:Q_,prepend:Xc,appendW:eS,append:Pd,unsafeInsertAt:tS,unsafeUpdateAt:nS,uniq:rS,sortBy:mA,union:iS,rotate:oS,fromReadonlyNonEmptyArray:Fd,fromArray:aS,makeBy:Km,replicate:x8,range:vA,unprepend:gA,unappend:yA,concatW:bA,concat:Vm,reverse:C8,group:$A,groupBy:A8,sort:uS,insertAt:k8,updateAt:W8,modifyAt:_A,copy:Qc,of:Ja,zipWith:SA,zip:TA,unzip:N8,prependAll:Hm,intersperse:IA,foldMapWithIndex:OA,foldMap:wA,chainWithIndex:EA,chop:sS,splitAt:Jm,chunksOf:RA,altW:AA,alt:kA,ap:WA,chain:Gm,extend:mS,duplicate:P8,flatten:F8,map:vS,mapWithIndex:gS,reduce:NA,reduceWithIndex:PA,reduceRight:FA,reduceRightWithIndex:DA,traverse:LA,sequence:Ym,traverseWithIndex:Zm,extract:yS,URI:On,getShow:D8,getSemigroup:L8,getEq:j8,getUnionSemigroup:U8,Functor:bS,flap:B8,Pointed:z8,FunctorWithIndex:q8,Apply:Xm,apFirst:K8,apSecond:V8,Applicative:H8,Chain:$S,chainFirst:J8,Monad:G8,Foldable:Y8,FoldableWithIndex:Z8,Traversable:X8,TraversableWithIndex:Q8,Alt:e9,Comonad:t9,Do:n9,bindTo:r9,bind:i9,apS:o9,head:Wr,tail:ci,last:el,init:tl,min:a9,max:u9,concatAll:s9,matchLeft:c9,matchRight:l9,modifyHead:jA,updateHead:f9,modifyLast:UA,updateLast:d9,intercalate:p9,groupSort:h9,filter:m9,filterWithIndex:BA,uncons:v9,unsnoc:g9,cons:zA,snoc:qA,prependToAll:y9,fold:b9,nonEmptyArray:$9},Symbol.toStringTag,{value:"Module"}));var S9=function(e){return typeof e=="number"},_S={equals:function(e,t){return e===t}},Qm={equals:_S.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},T9={equals:_S.equals,compare:Qm.compare,top:1/0,bottom:-1/0},I9={show:function(e){return JSON.stringify(e)}},KA={concat:function(e,t){return e-t}},SS={concat:function(e,t){return e+t}},TS={concat:function(e,t){return e*t}},O9={concat:SS.concat,empty:0},w9={concat:TS.concat,empty:1},E9={add:SS.concat,zero:0,mul:TS.concat,one:1,sub:KA.concat,degree:function(e){return 1},div:function(e,t){return e/t},mod:function(e,t){return e%t}};const R9=Object.freeze(Object.defineProperty({__proto__:null,isNumber:S9,Eq:_S,Ord:Qm,Bounded:T9,Show:I9,MagmaSub:KA,SemigroupSum:SS,SemigroupProduct:TS,MonoidSum:O9,MonoidProduct:w9,Field:E9},Symbol.toStringTag,{value:"Module"}));function nl(e,t){return function(n){return n?t.of(void 0):e.zero()}}const M9=Object.freeze(Object.defineProperty({__proto__:null,guard:nl},Symbol.toStringTag,{value:"Module"}));var x9=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},zi=function(e){return e.length===0},wt=Bi,C9=Yc,A9=R_,ev=Cm,k9=M_,VA=function(e,t){return e<=0?$t:km(t)(e)},W9=function(e,t){return VA(e,function(){return t})};function N9(e){return function(t){return e(t)?[t]:$t}}var HA=function(e){return xt(e)?$t:[e.value]},JA=function(e){return Lt(e)?$t:[e.right]},GA=function(e,t){return function(n){return wt(n)?t(n):e()}},YA=GA,ZA=function(e,t){return function(n){return wt(n)?t(In(n),ui(n)):e()}},XA=ZA,P9=XA,QA=function(e,t){return function(n){return wt(n)?t(Zc(n),Ha(n)):e()}},ek=QA,F9=ek,tk=function(e){return function(t){if(zi(t))return $t;for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},D9=function(e,t){return function(n){var r=n.length,i=new Array(r+1);i[0]=e;for(var o=0;o<r;o++)i[o+1]=t(i[o],n[o]);return i}},L9=function(e,t){return function(n){var r=n.length,i=new Array(r+1);i[r]=e;for(var o=r-1;o>=0;o--)i[o]=t(n[o],i[o+1]);return i}},j9=function(e){return e.length},rl=xm;function ss(e,t){return t===void 0?function(n){return ss(e,n)}:rl(e,t)?me:le(t[e])}var nk=function(e){return wt(e)?le(In(e)):me},IS=function(e){return wt(e)?le(Ha(e)):me},U9=function(e){return wt(e)?le(ui(e)):me},B9=function(e){return wt(e)?le(Zc(e)):me},z9=function(e){return function(t){return rl(e,t)?t:e===0?$t:t.slice(0,e)}},q9=function(e){return function(t){return rl(e,t)?t:e===0?$t:t.slice(-e)}};function K9(e){return function(t){for(var n=[],r=0,i=t;r<i.length;r++){var o=i[r];if(!e(o))break;n.push(o)}var a=n.length;return a===t.length?t:a===0?$t:n}}var rk=function(e,t){for(var n=e.length,r=0;r<n&&t(e[r]);r++);return r};function V9(e){return function(t){var n=OS(rk(t,e))(t),r=n[0],i=n[1];return{init:r,rest:i}}}var H9=function(e){return function(t){return e<=0||zi(t)?t:e>=t.length?$t:t.slice(e,t.length)}},J9=function(e){return function(t){return e<=0||zi(t)?t:e>=t.length?$t:t.slice(0,t.length-e)}};function G9(e){return function(t){var n=rk(t,e);return n===0?t:n===t.length?$t:t.slice(n)}}var tv=function(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return le(n);return me}};function nv(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return le(t[n]);return me}}var ik=function(e){return function(t){for(var n=0;n<t.length;n++){var r=e(t[n]);if(ht(r))return r}return me}};function ok(e){return function(t){for(var n=t.length-1;n>=0;n--)if(e(t[n]))return le(t[n]);return me}}var ak=function(e){return function(t){for(var n=t.length-1;n>=0;n--){var r=e(t[n]);if(ht(r))return r}return me}},uk=function(e){return function(t){for(var n=t.length-1;n>=0;n--)if(e(t[n]))return le(n);return me}},Y9=function(e,t){return function(n){return e<0||e>n.length?me:le(Am(e,t,n))}},Z9=function(e,t){return sk(e,function(){return t})},X9=function(e){return function(t){return rl(e,t)?me:le(Pk(e,t))}},sk=function(e,t){return function(n){return rl(e,n)?me:le(hv(e,t(n[e]),n))}},Q9=function(e){return e.length<=1?e:e.slice().reverse()},eG=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Right"&&t.push(r.right)}return t},tG=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Left"&&t.push(r.left)}return t},nG=function(e){return function(t){return t.length<=1?t:t.slice().sort(e.compare)}},ck=function(e,t,n){for(var r=[],i=Math.min(e.length,t.length),o=0;o<i;o++)r[o]=n(e[o],t[o]);return r};function lk(e,t){return t===void 0?function(n){return lk(n,e)}:ck(e,t,function(n,r){return[n,r]})}var rG=function(e){for(var t=[],n=[],r=0;r<e.length;r++)t[r]=e[r][0],n[r]=e[r][1];return[t,n]},fk=function(e){var t=Wm(e);return function(n){return wt(n)?t(n):n}},iG=function(e){var t=N_(e);return function(n){return wt(n)?t(n):n}},oG=function(e){var t=k_(e);return function(n){return wt(n)?t(n):n}};function Bd(e){return function(t,n){if(n===void 0){var r=Bd(e);return function(a){return r(t,a)}}for(var i=function(a){return e.equals(a,t)},o=0;o<n.length;o++)if(i(n[o]))return!0;return!1}}var aG=function(e){var t=C_(e);return function(n){return wt(n)?t(n):n}},uG=function(e){var t=BC(e);return function(n){return wt(n)?t(n):n}},sG=function(e){var t=P_(e);return function(n){return wt(n)?t(n):$t}},OS=function(e){return function(t){return e>=1&&wt(t)?Nm(e)(t):zi(t)?[t,$t]:[$t,t]}},cG=function(e){var t=XC(e);return function(n){return wt(n)?t(n):$t}},lG=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return HA(e.apply(void 0,t))}};function fG(e,t,n){n===void 0&&(n=function(){return!0});var r=function(i,o){return wt(o)?m(In(o),qd(function(a){return r(m(i,ev(a)),ui(o))})):n.apply(void 0,i)?[t.apply(void 0,i)]:$t};return r($t,e)}var dk=function(e){return function(t){return zi(t)?e:zi(e)?t:t.concat(e)}},dG=dk;function wS(e){var t=A_(e);return function(n,r){if(r===void 0){var i=wS(e);return function(o){return i(o,n)}}return wt(n)&&wt(r)?t(r)(n):wt(n)?n:r}}function ES(e){var t=Bd(e);return function(n,r){if(r===void 0){var i=ES(e);return function(o){return i(o,n)}}return n.filter(function(o){return t(o,r)})}}function RS(e){var t=Bd(e);return function(n,r){if(r===void 0){var i=RS(e);return function(o){return i(o,n)}}return n.filter(function(o){return!t(o,r)})}}var Zt=function(e,t){return m(e,cv(t))},rv=function(e,t){return m(e,Sk(t))},Ga=function(e,t){return m(e,_k(t))},zd=function(e,t){return m(e,qd(t))},iv=function(e,t){return m(e,li(t))},ov=function(e,t){return m(e,FS(t))},av=function(e,t){return m(e,Tk(t))},uv=function(e,t){return m(e,Ik(t))},pk=function(e,t){return m(e,DS(t))},hk=function(e,t){return m(e,LS(t))},MS=function(e,t){return m(e,$k(t))},cs=function(e,t,n){return m(e,fv(t,n))},il=function(e){var t=US(e);return function(n,r){return m(n,t(r))}},ol=function(e,t,n){return m(e,BS(t,n))},xS=function(e,t,n){return m(e,Kd(t,n))},CS=function(e){var t=lv(e);return function(n,r){return m(n,t(r))}},AS=function(e,t,n){return m(e,dv(t,n))},mk=function(e,t){return m(e,PS(t))},vk=function(e,t){return m(e,Ok(t))},gk=function(e,t){return m(e,jS(t))},sv=function(e){var t=wk(e);return function(n,r){return m(n,t(r))}},yk=function(e){var t=zS(e);return function(n,r){return m(n,t(r))}},kS=function(e,t){return m(e,GS(t))},WS=function(e,t){return m(e,YS(t))},ls=Va,al=function(){return $t},bk=function(e){return function(t){return t.concat(e())}},$k=bk,_k=function(e){return qd(function(t){return m(e,cv(t))})},qd=function(e){return function(t){return m(t,tk(function(n,r){return e(r)}))}},NS=qd(B),cv=function(e){return function(t){return t.map(function(n){return e(n)})}},Sk=function(e){return function(t){return t.map(function(n,r){return e(r,n)})}},ul=function(e){for(var t=[],n=[],r=0,i=e;r<i.length;r++){var o=i[r];o._tag==="Left"?t.push(o.left):n.push(o.right)}return Oe(t,n)},li=function(e){return function(t){return t.filter(e)}},PS=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);ht(i)&&n.push(i.value)}return n}},FS=function(e){return PS(function(t,n){return e(n)})},sl=FS(B),Tk=function(e){return DS(function(t,n){return e(n)})},DS=function(e){return function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=t[i];e(i,o)?r.push(o):n.push(o)}return Oe(n,r)}},Ik=function(e){return LS(function(t,n){return e(n)})},LS=function(e){return function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=e(i,t[i]);o._tag==="Left"?n.push(o.left):r.push(o.right)}return Oe(n,r)}},Ok=function(e){return function(t){return t.filter(function(n,r){return e(r,n)})}},jS=function(e){return function(t){return t.map(function(n,r){return e(t.slice(r))})}},pG=jS(B),lv=function(e){return function(t){return function(n){return n.reduce(function(r,i,o){return e.concat(r,t(o,i))},e.empty)}}},fv=function(e,t){return Kd(e,function(n,r,i){return t(r,i)})},US=function(e){var t=lv(e);return function(n){return t(function(r,i){return n(i)})}},Kd=function(e,t){return function(n){for(var r=n.length,i=e,o=0;o<r;o++)i=t(o,i,n[o]);return i}},BS=function(e,t){return dv(e,function(n,r,i){return t(r,i)})},dv=function(e,t){return function(n){return n.reduceRight(function(r,i,o){return t(o,i,r)},e)}},wk=function(e){var t=zS(e);return function(n){return t(function(r,i){return n(i)})}},Vd=function(e){return function(t){return cs(t,e.of(al()),function(n,r){return e.ap(e.map(n,function(i){return function(o){return m(i,ev(o))}}),r)})}},zS=function(e){return function(t){return Kd(e.of(al()),function(n,r,i){return e.ap(e.map(r,function(o){return function(a){return m(o,ev(a))}}),t(n,i))})}},hG=function(e){var t=ZS(e);return function(n){return function(r){return t(r,n)}}},mG=function(e){var t=XS(e);return function(n){return function(r){return t(r,n)}}},qS=function(e,t){for(var n=[],r=e;;){var i=t(r);if(ht(i)){var o=i.value,a=o[0],u=o[1];n.push(a),r=u}else break}return n},ut="ReadonlyArray",Ek=function(e){return{show:function(t){return"[".concat(t.map(e.show).join(", "),"]")}}},Rk=function(){return{concat:function(e,t){return zi(e)?t:zi(t)?e:e.concat(t)}}},vG=function(){return{concat:Rk().concat,empty:$t}},Mk=function(e){return kr(function(t,n){return t.length===n.length&&t.every(function(r,i){return e.equals(r,n[i])})})},xk=function(e){return us(function(t,n){for(var r=t.length,i=n.length,o=Math.min(r,i),a=0;a<o;a++){var u=e.compare(t[a],n[a]);if(u!==0)return u}return Qm.compare(r,i)})},Ck=function(e){var t=wS(e);return{concat:function(n,r){return t(r)(n)}}},gG=function(e){return{concat:Ck(e).concat,empty:$t}},yG=function(e){var t=ES(e);return{concat:function(n,r){return t(r)(n)}}},bG=function(e){var t=RS(e);return{concat:function(n,r){return t(r)(n)}}},KS={URI:ut,map:Zt},$G=De(KS),Ak={URI:ut,of:ls},_G={URI:ut,map:Zt,mapWithIndex:rv},pv={URI:ut,map:Zt,ap:Ga},SG=_t(pv),TG=St(pv),IG={URI:ut,map:Zt,ap:Ga,of:ls},VS={URI:ut,map:Zt,ap:Ga,chain:zd},OG={URI:ut,map:Zt,ap:Ga,of:ls,chain:zd},wG=at(VS),EG={URI:ut,unfold:qS},RG={URI:ut,map:Zt,alt:MS},kk={URI:ut,zero:al},MG=nl(kk,Ak),xG={URI:ut,map:Zt,ap:Ga,of:ls,alt:MS,zero:al},CG={URI:ut,map:Zt,extend:gk},HS={URI:ut,compact:sl,separate:ul},AG={URI:ut,map:Zt,compact:sl,separate:ul,filter:iv,filterMap:ov,partition:av,partitionMap:uv},kG={URI:ut,map:Zt,mapWithIndex:rv,compact:sl,separate:ul,filter:iv,filterMap:ov,partition:av,partitionMap:uv,partitionMapWithIndex:hk,partitionWithIndex:pk,filterMapWithIndex:mk,filterWithIndex:vk},WG={URI:ut,reduce:cs,foldMap:il,reduceRight:ol},NG={URI:ut,reduce:cs,foldMap:il,reduceRight:ol,reduceWithIndex:xS,foldMapWithIndex:CS,reduceRightWithIndex:AS},JS={URI:ut,map:Zt,reduce:cs,foldMap:il,reduceRight:ol,traverse:sv,sequence:Vd},PG={URI:ut,map:Zt,mapWithIndex:rv,reduce:cs,foldMap:il,reduceRight:ol,reduceWithIndex:xS,foldMapWithIndex:CS,reduceRightWithIndex:AS,traverse:sv,sequence:Vd,traverseWithIndex:yk},GS=function(e){return function(t){for(var n=x9([],e(t),!0),r=[];n.length>0;){var i=n.shift();Lt(i)?n.unshift.apply(n,e(i.left)):r.push(i.right)}return r}},FG={URI:ut,map:Zt,ap:Ga,chain:zd,chainRec:kS},YS=function(e){return function(t){var n=e(t),r=[],i=[];function o(c){Lt(c)?e(c.left).forEach(function(l){return r.push(l)}):i.push(c.right)}for(var a=0,u=n;a<u.length;a++){var s=u[a];o(s)}for(;r.length>0;)o(r.shift());return i}},DG={URI:ut,map:Zt,ap:Ga,chain:zd,chainRec:WS},ZS=ri(JS,HS),XS=ni(JS,HS),Wk={URI:ut,map:Zt,compact:sl,separate:ul,filter:iv,filterMap:ov,partition:av,partitionMap:uv,reduce:cs,foldMap:il,reduceRight:ol,traverse:sv,sequence:Vd,wither:ZS,wilt:XS},LG=B$(Wk),Nk={URI:ut,fromEither:JA},jG=ar(Nk),UG=Am,hv=function(e,t,n){return wt(n)?x_(e,t,n):n},Pk=function(e,t){var n=t.slice();return n.splice(e,1),n},BG=function(e){return e.slice()},zG=function(e){return zi(e)?$t:e.slice()},$t=Rd;function Fk(e){return function(t){return t.every(e)}}var Dk=function(e){return function(t){return t.some(e)}},qG=Dk,Lk=function(e){var t=X_(e);return function(n){return YA(function(){return e.empty},t(n))}},KG=ls(jt),VG=It(KS),HG=Ot(VS),JG=Tt(pv),GG=zC,YG=pA,ZG=hA,XG=fk,QG={URI:ut,compact:sl,separate:ul,map:Zt,ap:Ga,of:ls,chain:zd,filter:iv,filterMap:ov,partition:av,partitionMap:uv,mapWithIndex:rv,partitionMapWithIndex:hk,partitionWithIndex:pk,filterMapWithIndex:mk,filterWithIndex:vk,alt:MS,zero:al,unfold:qS,reduce:cs,foldMap:il,reduceRight:ol,traverse:sv,sequence:Vd,reduceWithIndex:xS,foldMapWithIndex:CS,reduceRightWithIndex:AS,traverseWithIndex:yk,extend:gk,wither:ZS,wilt:XS};const eY=Object.freeze(Object.defineProperty({__proto__:null,isEmpty:zi,isNonEmpty:wt,prepend:C9,prependW:A9,append:ev,appendW:k9,makeBy:VA,replicate:W9,fromPredicate:N9,fromOption:HA,fromEither:JA,matchW:GA,match:YA,matchLeftW:ZA,matchLeft:XA,foldLeft:P9,matchRightW:QA,matchRight:ek,foldRight:F9,chainWithIndex:tk,scanLeft:D9,scanRight:L9,size:j9,isOutOfBound:rl,lookup:ss,head:nk,last:IS,tail:U9,init:B9,takeLeft:z9,takeRight:q9,takeLeftWhile:K9,spanLeft:V9,dropLeft:H9,dropRight:J9,dropLeftWhile:G9,findIndex:tv,findFirst:nv,findFirstMap:ik,findLast:ok,findLastMap:ak,findLastIndex:uk,insertAt:Y9,updateAt:Z9,deleteAt:X9,modifyAt:sk,reverse:Q9,rights:eG,lefts:tG,sort:nG,zipWith:ck,zip:lk,unzip:rG,prependAll:fk,intersperse:iG,rotate:oG,elem:Bd,uniq:aG,sortBy:uG,chop:sG,splitAt:OS,chunksOf:cG,fromOptionK:lG,comprehension:fG,concatW:dk,concat:dG,union:wS,intersection:ES,difference:RS,_chainRecDepthFirst:kS,_chainRecBreadthFirst:WS,of:ls,zero:al,altW:bk,alt:$k,ap:_k,chain:qd,flatten:NS,map:cv,mapWithIndex:Sk,separate:ul,filter:li,filterMapWithIndex:PS,filterMap:FS,compact:sl,partition:Tk,partitionWithIndex:DS,partitionMap:Ik,partitionMapWithIndex:LS,filterWithIndex:Ok,extend:jS,duplicate:pG,foldMapWithIndex:lv,reduce:fv,foldMap:US,reduceWithIndex:Kd,reduceRight:BS,reduceRightWithIndex:dv,traverse:wk,sequence:Vd,traverseWithIndex:zS,wither:hG,wilt:mG,unfold:qS,URI:ut,getShow:Ek,getSemigroup:Rk,getMonoid:vG,getEq:Mk,getOrd:xk,getUnionSemigroup:Ck,getUnionMonoid:gG,getIntersectionSemigroup:yG,getDifferenceMagma:bG,Functor:KS,flap:$G,Pointed:Ak,FunctorWithIndex:_G,Apply:pv,apFirst:SG,apSecond:TG,Applicative:IG,Chain:VS,Monad:OG,chainFirst:wG,Unfoldable:EG,Alt:RG,Zero:kk,guard:MG,Alternative:xG,Extend:CG,Compactable:HS,Filterable:AG,FilterableWithIndex:kG,Foldable:WG,FoldableWithIndex:NG,Traversable:JS,TraversableWithIndex:PG,chainRecDepthFirst:GS,ChainRecDepthFirst:FG,chainRecBreadthFirst:YS,ChainRecBreadthFirst:DG,Witherable:Wk,filterE:LG,FromEither:Nk,fromEitherK:jG,unsafeInsertAt:UG,unsafeUpdateAt:hv,unsafeDeleteAt:Pk,toArray:BG,fromArray:zG,empty:$t,every:Fk,some:Dk,exists:qG,intercalate:Lk,Do:KG,bindTo:VG,bind:HG,apS:JG,range:GG,cons:YG,snoc:ZG,prependToAll:XG,readonlyArray:QG},Symbol.toStringTag,{value:"Module"}));var Ya=function(e){return e.length===0},Ct=wo,tY=Xc,nY=Q_,mv=Pd,rY=eS,jk=function(e,t){return e<=0?[]:Km(t)(e)},iY=function(e,t){return jk(e,function(){return t})};function oY(e){return function(t){return e(t)?[t]:[]}}var Uk=function(e){return xt(e)?[]:[e.value]},Bk=function(e){return Lt(e)?[]:[e.right]},zk=function(e,t){return function(n){return Ct(n)?t(n):e()}},aY=zk,qk=function(e,t){return function(n){return Ct(n)?t(Wr(n),ci(n)):e()}},Kk=qk,uY=Kk,Vk=function(e,t){return function(n){return Ct(n)?t(tl(n),el(n)):e()}},Hk=Vk,sY=Hk,Jk=function(e){return function(t){for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},cY=function(e,t){return function(n){var r=n.length,i=new Array(r+1);i[0]=e;for(var o=0;o<r;o++)i[o+1]=t(i[o],n[o]);return i}},lY=function(e,t){return function(n){var r=n.length,i=new Array(r+1);i[r]=e;for(var o=r-1;o>=0;o--)i[o]=t(n[o],i[o+1]);return i}},fY=function(e){return e.length},Hd=qm,dY=ss,pY=nk,hY=IS,mY=function(e){return Ct(e)?le(ci(e)):me},vY=function(e){return Ct(e)?le(tl(e)):me},gY=function(e){return function(t){return Hd(e,t)?mn(t):t.slice(0,e)}},yY=function(e){return function(t){return Hd(e,t)?mn(t):e===0?[]:t.slice(-e)}};function bY(e){return function(t){for(var n=[],r=0,i=t;r<i.length;r++){var o=i[r];if(!e(o))break;n.push(o)}return n}}var Gk=function(e,t){for(var n=e.length,r=0;r<n&&t(e[r]);r++);return r};function $Y(e){return function(t){var n=eW(Gk(t,e))(t),r=n[0],i=n[1];return{init:r,rest:i}}}var _Y=function(e){return function(t){return e<=0||Ya(t)?mn(t):e>=t.length?[]:t.slice(e,t.length)}},SY=function(e){return function(t){return e<=0||Ya(t)?mn(t):e>=t.length?[]:t.slice(0,t.length-e)}};function TY(e){return function(t){return t.slice(Gk(t,e))}}var IY=tv;function OY(e){return nv(e)}var wY=ik;function EY(e){return ok(e)}var RY=ak,MY=uk,mn=function(e){return e.slice()},xY=function(e,t){return function(n){return e<0||e>n.length?me:le(MW(e,t,n))}},CY=function(e,t){return Yk(e,function(){return t})},AY=function(e){return function(t){return Hd(e,t)?me:le(CW(e,t))}},Yk=function(e,t){return function(n){return Hd(e,n)?me:le(xW(e,t(n[e]),n))}},kY=function(e){return Ya(e)?[]:e.slice().reverse()},WY=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Right"&&t.push(r.right)}return t},NY=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Left"&&t.push(r.left)}return t},PY=function(e){return function(t){return t.length<=1?mn(t):t.slice().sort(e.compare)}},Zk=function(e,t,n){for(var r=[],i=Math.min(e.length,t.length),o=0;o<i;o++)r[o]=n(e[o],t[o]);return r};function Xk(e,t){return t===void 0?function(n){return Xk(n,e)}:Zk(e,t,function(n,r){return[n,r]})}var FY=function(e){for(var t=[],n=[],r=0;r<e.length;r++)t[r]=e[r][0],n[r]=e[r][1];return[t,n]},Qk=function(e){var t=Hm(e);return function(n){return Ct(n)?t(n):[]}},DY=function(e){var t=IA(e);return function(n){return Ct(n)?t(n):mn(n)}},LY=function(e){var t=oS(e);return function(n){return Ct(n)?t(n):mn(n)}},QS=Bd,jY=function(e){var t=rS(e);return function(n){return Ct(n)?t(n):mn(n)}},UY=function(e){var t=mA(e);return function(n){return Ct(n)?t(n):mn(n)}},BY=function(e){var t=sS(e);return function(n){return Ct(n)?t(n):[]}},eW=function(e){return function(t){return e>=1&&Ct(t)?Jm(e)(t):Ya(t)?[mn(t),[]]:[[],mn(t)]}},zY=function(e){var t=RA(e);return function(n){return Ct(n)?t(n):[]}},qY=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Uk(e.apply(void 0,t))}};function KY(e,t,n){n===void 0&&(n=function(){return!0});var r=function(i,o){return Ct(o)?m(Wr(o),Gd(function(a){return r(m(i,mv(a)),ci(o))})):n.apply(void 0,i)?[t.apply(void 0,i)]:[]};return r([],e)}var tW=function(e){return function(t){return Ya(t)?mn(e):Ya(e)?mn(t):t.concat(e)}},VY=tW;function e0(e){var t=iS(e);return function(n,r){if(r===void 0){var i=e0(e);return function(o){return i(o,n)}}return Ct(n)&&Ct(r)?t(r)(n):Ct(n)?mn(n):mn(r)}}function t0(e){var t=QS(e);return function(n,r){if(r===void 0){var i=t0(e);return function(o){return i(o,n)}}return n.filter(function(o){return t(o,r)})}}function n0(e){var t=QS(e);return function(n,r){if(r===void 0){var i=n0(e);return function(o){return i(o,n)}}return n.filter(function(o){return!t(o,r)})}}var Xt=function(e,t){return m(e,u0(t))},vv=function(e,t){return m(e,cW(t))},Za=function(e,t){return m(e,sW(t))},Jd=function(e,t){return m(e,Gd(t))},gv=function(e,t){return m(e,lW(t))},yv=function(e,t){return m(e,l0(t))},bv=function(e,t){return m(e,fW(t))},$v=function(e,t){return m(e,dW(t))},nW=function(e,t){return m(e,f0(t))},rW=function(e,t){return m(e,d0(t))},r0=function(e,t){return m(e,hW(t))},fs=function(e,t,n){return m(e,yW(t,n))},cl=function(e){var t=vW(e);return function(n,r){return m(n,t(r))}},ll=function(e,t,n){return m(e,bW(t,n))},i0=function(e,t,n){return m(e,h0(t,n))},o0=function(e){var t=gW(e);return function(n,r){return m(n,t(r))}},a0=function(e,t,n){return m(e,$W(t,n))},iW=function(e,t){return m(e,c0(t))},oW=function(e,t){return m(e,mW(t))},aW=function(e,t){return m(e,p0(t))},_v=function(e){var t=Sv(e);return function(n,r){return m(n,t(r))}},uW=function(e){var t=m0(e);return function(n,r){return m(n,t(r))}},HY=kS,JY=WS,Xa=Ja,fl=function(){return[]},u0=function(e){return function(t){return t.map(function(n){return e(n)})}},sW=function(e){return Gd(function(t){return m(e,u0(t))})},Gd=function(e){return function(t){return m(t,Jk(function(n,r){return e(r)}))}},s0=Gd(B),cW=function(e){return function(t){return t.map(function(n,r){return e(r,n)})}},c0=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);ht(i)&&n.push(i.value)}return n}},l0=function(e){return c0(function(t,n){return e(n)})},dl=l0(B),pl=function(e){for(var t=[],n=[],r=0,i=e;r<i.length;r++){var o=i[r];o._tag==="Left"?t.push(o.left):n.push(o.right)}return Oe(t,n)},lW=function(e){return function(t){return t.filter(e)}},fW=function(e){return f0(function(t,n){return e(n)})},f0=function(e){return function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=t[i];e(i,o)?r.push(o):n.push(o)}return Oe(n,r)}},dW=function(e){return d0(function(t,n){return e(n)})},d0=function(e){return function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=e(i,t[i]);o._tag==="Left"?n.push(o.left):r.push(o.right)}return Oe(n,r)}},pW=function(e){return function(t){return t.concat(e())}},hW=pW,mW=function(e){return function(t){return t.filter(function(n,r){return e(r,n)})}},p0=function(e){return function(t){return t.map(function(n,r){return e(t.slice(r))})}},GY=p0(B),vW=US,gW=lv,yW=fv,h0=Kd,bW=BS,$W=dv,Sv=function(e){var t=m0(e);return function(n){return t(function(r,i){return n(i)})}},Yd=function(e){return function(t){return fs(t,e.of(fl()),function(n,r){return e.ap(e.map(n,function(i){return function(o){return m(i,mv(o))}}),r)})}},m0=function(e){return function(t){return h0(e.of(fl()),function(n,r,i){return e.ap(e.map(r,function(o){return function(a){return m(o,mv(a))}}),t(n,i))})}},YY=function(e){var t=S0(e);return function(n){return function(r){return t(r,n)}}},ZY=function(e){var t=T0(e);return function(n){return function(r){return t(r,n)}}},v0=function(e,t){for(var n=[],r=e;;){var i=t(r);if(ht(i)){var o=i.value,a=o[0],u=o[1];n.push(a),r=u}else break}return n},st="Array",XY=Ek,_W=function(){return{concat:function(e,t){return e.concat(t)}}},g0=function(){return{concat:_W().concat,empty:[]}},SW=Mk,QY=xk,TW=function(e){var t=e0(e);return{concat:function(n,r){return t(r)(n)}}},eZ=function(e){return{concat:TW(e).concat,empty:[]}},tZ=function(e){var t=t0(e);return{concat:function(n,r){return t(r)(n)}}},nZ=function(e){var t=n0(e);return{concat:function(n,r){return t(r)(n)}}},y0={URI:st,map:Xt},rZ=De(y0),IW={URI:st,of:Xa},iZ={URI:st,map:Xt,mapWithIndex:vv},Tv={URI:st,map:Xt,ap:Za},oZ=_t(Tv),aZ=St(Tv),uZ={URI:st,map:Xt,ap:Za,of:Xa},b0={URI:st,map:Xt,ap:Za,chain:Jd},sZ=at(b0),cZ={URI:st,map:Xt,ap:Za,of:Xa,chain:Jd},lZ={URI:st,unfold:v0},fZ={URI:st,map:Xt,alt:r0},OW={URI:st,zero:fl},dZ=nl(OW,IW),pZ={URI:st,map:Xt,ap:Za,of:Xa,alt:r0,zero:fl},hZ={URI:st,map:Xt,extend:aW},$0={URI:st,compact:dl,separate:pl},mZ={URI:st,map:Xt,compact:dl,separate:pl,filter:gv,filterMap:yv,partition:bv,partitionMap:$v},vZ={URI:st,map:Xt,mapWithIndex:vv,compact:dl,separate:pl,filter:gv,filterMap:yv,partition:bv,partitionMap:$v,partitionMapWithIndex:rW,partitionWithIndex:nW,filterMapWithIndex:iW,filterWithIndex:oW},wW={URI:st,reduce:fs,foldMap:cl,reduceRight:ll},gZ={URI:st,reduce:fs,foldMap:cl,reduceRight:ll,reduceWithIndex:i0,foldMapWithIndex:o0,reduceRightWithIndex:a0},_0={URI:st,map:Xt,reduce:fs,foldMap:cl,reduceRight:ll,traverse:_v,sequence:Yd},yZ={URI:st,map:Xt,mapWithIndex:vv,reduce:fs,foldMap:cl,reduceRight:ll,reduceWithIndex:i0,foldMapWithIndex:o0,reduceRightWithIndex:a0,traverse:_v,sequence:Yd,traverseWithIndex:uW},S0=ri(_0,$0),T0=ni(_0,$0),EW={URI:st,map:Xt,compact:dl,separate:pl,filter:gv,filterMap:yv,partition:bv,partitionMap:$v,reduce:fs,foldMap:cl,reduceRight:ll,traverse:_v,sequence:Yd,wither:S0,wilt:T0},bZ=GS,$Z={URI:st,map:Xt,ap:Za,chain:Jd,chainRec:HY},_Z=YS,SZ={URI:st,map:Xt,ap:Za,chain:Jd,chainRec:JY},TZ=B$(EW),RW={URI:st,fromEither:Bk},IZ=ar(RW),MW=tS,xW=function(e,t,n){return Ct(n)?nS(e,t,n):[]},CW=function(e,t){var n=t.slice();return n.splice(e,1),n},OZ=Fk,AW=function(e){return function(t){return t.some(e)}},wZ=AW,EZ=Lk,RZ=Xa(jt),MZ=It(y0),xZ=Ot(b0),CZ=Tt(Tv),AZ=vA,kZ=[],WZ=zA,NZ=qA,PZ=Qk,FZ={URI:st,compact:dl,separate:pl,map:Xt,ap:Za,of:Xa,chain:Jd,filter:gv,filterMap:yv,partition:bv,partitionMap:$v,mapWithIndex:vv,partitionMapWithIndex:rW,partitionWithIndex:nW,filterMapWithIndex:iW,filterWithIndex:oW,alt:r0,zero:fl,unfold:v0,reduce:fs,foldMap:cl,reduceRight:ll,traverse:_v,sequence:Yd,reduceWithIndex:i0,foldMapWithIndex:o0,reduceRightWithIndex:a0,traverseWithIndex:uW,extend:aW,wither:S0,wilt:T0};const kW=Object.freeze(Object.defineProperty({__proto__:null,isEmpty:Ya,isNonEmpty:Ct,prepend:tY,prependW:nY,append:mv,appendW:rY,makeBy:jk,replicate:iY,fromPredicate:oY,fromOption:Uk,fromEither:Bk,matchW:zk,match:aY,matchLeftW:qk,matchLeft:Kk,foldLeft:uY,matchRightW:Vk,matchRight:Hk,foldRight:sY,chainWithIndex:Jk,scanLeft:cY,scanRight:lY,size:fY,isOutOfBound:Hd,lookup:dY,head:pY,last:hY,tail:mY,init:vY,takeLeft:gY,takeRight:yY,takeLeftWhile:bY,spanLeft:$Y,dropLeft:_Y,dropRight:SY,dropLeftWhile:TY,findIndex:IY,findFirst:OY,findFirstMap:wY,findLast:EY,findLastMap:RY,findLastIndex:MY,copy:mn,insertAt:xY,updateAt:CY,deleteAt:AY,modifyAt:Yk,reverse:kY,rights:WY,lefts:NY,sort:PY,zipWith:Zk,zip:Xk,unzip:FY,prependAll:Qk,intersperse:DY,rotate:LY,elem:QS,uniq:jY,sortBy:UY,chop:BY,splitAt:eW,chunksOf:zY,fromOptionK:qY,comprehension:KY,concatW:tW,concat:VY,union:e0,intersection:t0,difference:n0,of:Xa,zero:fl,map:u0,ap:sW,chain:Gd,flatten:s0,mapWithIndex:cW,filterMapWithIndex:c0,filterMap:l0,compact:dl,separate:pl,filter:lW,partition:fW,partitionWithIndex:f0,partitionMap:dW,partitionMapWithIndex:d0,altW:pW,alt:hW,filterWithIndex:mW,extend:p0,duplicate:GY,foldMap:vW,foldMapWithIndex:gW,reduce:yW,reduceWithIndex:h0,reduceRight:bW,reduceRightWithIndex:$W,traverse:Sv,sequence:Yd,traverseWithIndex:m0,wither:YY,wilt:ZY,unfold:v0,URI:st,getShow:XY,getSemigroup:_W,getMonoid:g0,getEq:SW,getOrd:QY,getUnionSemigroup:TW,getUnionMonoid:eZ,getIntersectionSemigroup:tZ,getDifferenceMagma:nZ,Functor:y0,flap:rZ,Pointed:IW,FunctorWithIndex:iZ,Apply:Tv,apFirst:oZ,apSecond:aZ,Applicative:uZ,Chain:b0,chainFirst:sZ,Monad:cZ,Unfoldable:lZ,Alt:fZ,Zero:OW,guard:dZ,Alternative:pZ,Extend:hZ,Compactable:$0,Filterable:mZ,FilterableWithIndex:vZ,Foldable:wW,FoldableWithIndex:gZ,Traversable:_0,TraversableWithIndex:yZ,Witherable:EW,chainRecDepthFirst:bZ,ChainRecDepthFirst:$Z,chainRecBreadthFirst:_Z,ChainRecBreadthFirst:SZ,filterE:TZ,FromEither:RW,fromEitherK:IZ,unsafeInsertAt:MW,unsafeUpdateAt:xW,unsafeDeleteAt:CW,every:OZ,some:AW,exists:wZ,intercalate:EZ,Do:RZ,bindTo:MZ,bind:xZ,apS:CZ,range:AZ,empty:kZ,cons:WZ,snoc:NZ,prependToAll:PZ,array:FZ},Symbol.toStringTag,{value:"Module"})),DZ=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var LZ=function(e){return typeof e=="boolean"},WW=function(e,t){return function(n){return n?t():e()}},NW=WW,PW=NW,jZ=PW,FW={equals:function(e,t){return e===t}},UZ={meet:function(e,t){return e&&t},join:function(e,t){return e||t},zero:!1,one:!0,implies:function(e,t){return!e||t},not:function(e){return!e}},DW={concat:function(e,t){return e&&t}},LW={concat:function(e,t){return e||t}},BZ={concat:DW.concat,empty:!0},zZ={concat:LW.concat,empty:!1},qZ={equals:FW.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},KZ={show:function(e){return JSON.stringify(e)}};const VZ=Object.freeze(Object.defineProperty({__proto__:null,isBoolean:LZ,matchW:WW,foldW:NW,match:PW,fold:jZ,Eq:FW,BooleanAlgebra:UZ,SemigroupAll:DW,SemigroupAny:LW,MonoidAll:BZ,MonoidAny:zZ,Ord:qZ,Show:KZ},Symbol.toStringTag,{value:"Module"}));var jW=function(e){return{meet:function(t,n){return e.join(t,n)},join:function(t,n){return e.meet(t,n)},zero:e.one,one:e.zero,implies:function(t,n){return e.join(e.not(t),n)},not:e.not}},HZ={meet:function(){},join:function(){},zero:void 0,one:void 0,implies:function(){},not:function(){}},JZ=jW,GZ={meet:function(e,t){return e&&t},join:function(e,t){return e||t},zero:!1,one:!0,implies:function(e,t){return!e||t},not:function(e){return!e}},YZ=qM;const ZZ=Object.freeze(Object.defineProperty({__proto__:null,reverse:jW,booleanAlgebraVoid:HZ,getDualBooleanAlgebra:JZ,booleanAlgebraBoolean:GZ,getFunctionBooleanAlgebra:YZ},Symbol.toStringTag,{value:"Module"}));var XZ=function(e){return CC(e)(e.bottom,e.top)},QZ=function(e){var t=b_(e);return{equals:t.equals,compare:t.compare,top:e.bottom,bottom:e.top}},eX={equals:wm.equals,compare:wm.compare,top:1/0,bottom:-1/0};const tX=Object.freeze(Object.defineProperty({__proto__:null,clamp:XZ,reverse:QZ,boundedNumber:eX},Symbol.toStringTag,{value:"Module"}));function UW(e){return{meet:Im(e),join:Om(e)}}const nX=Object.freeze(Object.defineProperty({__proto__:null,getMinMaxDistributiveLattice:UW},Symbol.toStringTag,{value:"Module"}));function rX(e){var t=UW(e);return function(n,r){return{join:t.join,meet:t.meet,zero:n,one:r}}}const iX=Object.freeze(Object.defineProperty({__proto__:null,getMinMaxBoundedDistributiveLattice:rX},Symbol.toStringTag,{value:"Module"})),oX=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),aX=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),uX=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),sX=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function I0(e,t){return function(n,r){return t.compose(e.right(r),e.left(n))}}function BW(e,t){var n=I0(e,t);return function(r,i){return t.compose(e.promap(t.id(),function(o){return o._tag==="Left"?o.left:o.right},B),n(r,i))}}function cX(e){return I0(e,e)}function lX(e){return BW(e,e)}const fX=Object.freeze(Object.defineProperty({__proto__:null,split:I0,fanIn:BW,splitChoice:cX,fanin:lX},Symbol.toStringTag,{value:"Module"})),dX=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var pX=function(e,t){return m(e,zW(t))},zW=function(e){return function(t){return Z(e,t)}},qW="Predicate",KW=function(){return{concat:function(e,t){return m(e,HW(t))}}},hX=function(){return{concat:KW().concat,empty:HM}},VW=function(){return{concat:function(e,t){return m(e,JW(t))}}},mX=function(){return{concat:VW().concat,empty:W$}},vX={URI:qW,contramap:pX},Zd=function(e){return function(t){return!e(t)}},HW=function(e){return function(t){return function(n){return t(n)||e(n)}}},JW=function(e){return function(t){return function(n){return t(n)&&e(n)}}};const gX=Object.freeze(Object.defineProperty({__proto__:null,contramap:zW,URI:qW,getSemigroupAny:KW,getMonoidAny:hX,getSemigroupAll:VW,getMonoidAll:mX,Contravariant:vX,not:Zd,or:HW,and:JW},Symbol.toStringTag,{value:"Module"}));var et=me,mt=le;function Iv(e){return function(t){return e(t)?mt(t):et}}var Ov=function(e){return e._tag==="Right"?et:mt(e.left)},Xd=function(e){return e._tag==="Left"?et:mt(e.right)},sr=function(e,t){return m(e,qi(t))},ds=function(e,t){return m(e,XW(t))},wv=function(e,t){return m(e,ep(t))},Ev=function(e,t,n){return m(e,eN(t,n))},Rv=function(e){var t=tN(e);return function(n,r){return m(n,t(r))}},Mv=function(e,t,n){return m(e,nN(t,n))},O0=function(e){var t=lN(e);return function(n,r){return m(n,t(r))}},w0=function(e,t){return m(e,iN(t))},Qd=function(e,t){return m(e,aN(t))},E0=function(e,t){return m(e,uN(t))},GW=function(e,t){return m(e,C0(t))},R0=function(e,t){return m(e,sN(t))},M0=function(e,t){return m(e,cN(t))},Wt="Option",yX=function(e){return{show:function(t){return Ne(t)?"none":"some(".concat(e.show(t.value),")")}}},YW=function(e){return{equals:function(t,n){return t===n||(Ne(t)?Ne(n):Ne(n)?!1:e.equals(t.value,n.value))}}},bX=function(e){return{equals:YW(e).equals,compare:function(t,n){return t===n?0:kv(t)?kv(n)?e.compare(t.value,n.value):1:-1}}},x0=function(e){return{concat:function(t,n){return Ne(t)?n:Ne(n)?t:mt(e.concat(t.value,n.value))},empty:et}},qi=function(e){return function(t){return Ne(t)?et:mt(e(t.value))}},hl={URI:Wt,map:sr},Eo=mt,ZW={URI:Wt,of:Eo},XW=function(e){return function(t){return Ne(t)||Ne(e)?et:mt(t.value(e.value))}},ml={URI:Wt,map:sr,ap:ds},QW={URI:Wt,map:sr,ap:ds,of:Eo},ep=function(e){return function(t){return Ne(t)?et:e(t.value)}},tp={URI:Wt,map:sr,ap:ds,chain:wv},$X={URI:Wt,map:sr,ap:ds,of:Eo,chain:wv},eN=function(e,t){return function(n){return Ne(n)?e:t(e,n.value)}},tN=function(e){return function(t){return function(n){return Ne(n)?e.empty:t(n.value)}}},nN=function(e,t){return function(n){return Ne(n)?e:t(n.value,e)}},_X={URI:Wt,reduce:Ev,foldMap:Rv,reduceRight:Mv},rN=function(e){return function(t){return Ne(t)?e():t}},iN=rN,SX={URI:Wt,map:sr,alt:w0},xv=function(){return et},oN={URI:Wt,zero:xv},TX=nl(oN,ZW),IX={URI:Wt,map:sr,ap:ds,of:Eo,alt:w0,zero:xv},C0=function(e){return function(t){return Ne(t)?et:mt(e(t))}},OX={URI:Wt,map:sr,extend:GW},vl=ep(B),wX=Oe(et,et),gl=function(e){return Ne(e)?wX:Oe(Ov(e.value),Xd(e.value))},ps={URI:Wt,compact:vl,separate:gl},aN=function(e){return function(t){return Ne(t)?et:e(t.value)?t:et}},uN=function(e){return function(t){return Ne(t)?et:e(t.value)}},sN=function(e){return function(t){return Oe(Qd(t,Zd(e)),Qd(t,e))}},cN=function(e){return Z(qi(e),gl)},Ro={URI:Wt,map:sr,compact:vl,separate:gl,filter:Qd,filterMap:E0,partition:R0,partitionMap:M0},lN=function(e){return function(t){return function(n){return Ne(n)?e.of(et):e.map(t(n.value),mt)}}},Cv=function(e){return function(t){return Ne(t)?e.of(et):e.map(t.value,mt)}},A0={URI:Wt,map:sr,reduce:Ev,foldMap:Rv,reduceRight:Mv,traverse:O0,sequence:Cv},k0=ri(A0,ps),W0=ni(A0,ps),EX=function(e){var t=k0(e);return function(n){return function(r){return t(r,n)}}},RX=function(e){var t=W0(e);return function(n){return function(r){return t(r,n)}}},MX={URI:Wt,map:sr,reduce:Ev,foldMap:Rv,reduceRight:Mv,traverse:O0,sequence:Cv,compact:vl,separate:gl,filter:Qd,filterMap:E0,partition:R0,partitionMap:M0,wither:k0,wilt:W0},N0=function(){return et},xX={URI:Wt,map:sr,ap:ds,of:Eo,chain:wv,throwError:N0},yl=Xd,Av={URI:Wt,fromEither:yl},kv=ht,Ne=function(e){return e._tag==="None"},P0=function(e,t){return function(n){return Ne(n)?e():t(n.value)}},CX=P0,Mo=P0,xo=Mo,F0=function(e){return function(t){return Ne(t)?e():t.value}},D0=F0,AX=De(hl),kX=_t(ml),WX=St(ml),NX=vl,PX=at(tp),FX=C0(B),DX=ar(Av),LX=To(Av,tp),jX=Io(Av,tp),hs=function(e){return e==null?et:mt(e)},fN=function(e){try{return mt(e())}catch{return et}},UX=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return fN(function(){return e.apply(void 0,t)})}},BX=function(e){return Z(e,hs)},dN=function(e){return function(t){return Ne(t)?et:hs(e(t.value))}},L0=Mo(JM,B),pN=Mo(N$,B);function hN(e){return function(t,n){if(n===void 0){var r=hN(e);return function(i){return r(t,i)}}return Ne(n)?!1:e.equals(t,n.value)}}var zX=function(e){return function(t){return Ne(t)?!1:e(t.value)}},qX=Eo(jt),KX=It(hl),VX=Ot(tp),HX=Tt(ml),mN=Eo(Yt),Wv=function(e){return function(t){var n=e(0,or(t));if(Ne(n))return et;for(var r=[n.value],i=1;i<t.length;i++){var o=e(i,t[i]);if(Ne(o))return et;r.push(o.value)}return mt(r)}},j0=function(e){var t=Wv(e);return function(n){return ft(n)?t(n):mN}},JX=j0,vN=function(e){return j0(function(t,n){return e(n)})},GX=vN(B);function YX(e){return function(t){return kv(e(t))}}var ZX=dN,gN={URI:Wt,map:sr,of:Eo,ap:ds,chain:wv,reduce:Ev,foldMap:Rv,reduceRight:Mv,traverse:O0,sequence:Cv,zero:xv,alt:w0,extend:GW,compact:vl,separate:gl,filter:Qd,filterMap:E0,partition:R0,partitionMap:M0,wither:k0,wilt:W0,throwError:N0},XX=Ut(ml),QX=Cr(QW),yN=function(){return x0(w_())},eQ=function(){return x0(Mm())};const bN=Object.freeze(Object.defineProperty({__proto__:null,none:et,some:mt,fromPredicate:Iv,getLeft:Ov,getRight:Xd,URI:Wt,getShow:yX,getEq:YW,getOrd:bX,getMonoid:x0,map:qi,Functor:hl,of:Eo,Pointed:ZW,ap:XW,Apply:ml,Applicative:QW,chain:ep,Chain:tp,Monad:$X,reduce:eN,foldMap:tN,reduceRight:nN,Foldable:_X,altW:rN,alt:iN,Alt:SX,zero:xv,Zero:oN,guard:TX,Alternative:IX,extend:C0,Extend:OX,compact:vl,separate:gl,Compactable:ps,filter:aN,filterMap:uN,partition:sN,partitionMap:cN,Filterable:Ro,traverse:lN,sequence:Cv,Traversable:A0,wither:EX,wilt:RX,Witherable:MX,throwError:N0,MonadThrow:xX,fromEither:yl,FromEither:Av,isSome:kv,isNone:Ne,matchW:P0,foldW:CX,match:Mo,fold:xo,getOrElseW:F0,getOrElse:D0,flap:AX,apFirst:kX,apSecond:WX,flatten:NX,chainFirst:PX,duplicate:FX,fromEitherK:DX,chainEitherK:LX,chainFirstEitherK:jX,fromNullable:hs,tryCatch:fN,tryCatchK:UX,fromNullableK:BX,chainNullableK:dN,toNullable:L0,toUndefined:pN,elem:hN,exists:zX,Do:qX,bindTo:KX,bind:VX,apS:HX,ApT:mN,traverseReadonlyNonEmptyArrayWithIndex:Wv,traverseReadonlyArrayWithIndex:j0,traverseArrayWithIndex:JX,traverseArray:vN,sequenceArray:GX,getRefinement:YX,mapNullable:ZX,option:gN,getApplySemigroup:XX,getApplyMonoid:QX,getFirstMonoid:yN,getLastMonoid:eQ},Symbol.toStringTag,{value:"Module"}));function Ki(e,t){return function(n){return e.map(n,t.compact)}}function Co(e,t,n){var r=Ki(e,t),i=Lc(e,n);return function(o){return Oe(r(m(o,i(Ov))),r(m(o,i(Xd))))}}function tQ(e,t){var n=jc(e,t).map;return{map:n,compact:Ki(e,t),separate:Co(e,t,t)}}const nQ=Object.freeze(Object.defineProperty({__proto__:null,compact:Ki,separate:Co,getCompactableComposition:tQ},Symbol.toStringTag,{value:"Module"}));var rQ=function(e){return function(){return console.log(e)}},iQ=function(e){return function(){return console.warn(e)}},oQ=function(e){return function(){return console.error(e)}},aQ=function(e){return function(){return console.info(e)}};const uQ=Object.freeze(Object.defineProperty({__proto__:null,log:rQ,warn:iQ,error:oQ,info:aQ},Symbol.toStringTag,{value:"Module"}));var bl=Fc;function sQ(e){return{show:function(t){return"make(".concat(e.show(t),")")}}}var cQ=B,lQ=B,fQ=B,dQ=B,pQ=B,hQ=B,mQ=B,vQ=B,gQ=B;function $N(e){return{URI:ms,_E:void 0,map:U0,ap:function(t,n){return bl(e.concat(t,n))}}}function _N(e){var t=$N(e);return{URI:ms,_E:void 0,map:t.map,ap:t.ap,of:function(){return bl(e.empty)}}}var SN=function(e,t){return m(e,ON())},U0=function(e,t){return m(e,wN())},TN=function(e,t,n){return m(e,EN(t))},IN=function(e,t){return m(e,RN(t))},ON=function(){return Fc},wN=function(){return Fc},EN=function(e){return function(t){return bl(e(t))}},RN=function(e){return function(t){return bl(e(t))}},ms="Const",MN={URI:ms,map:U0},yQ=De(MN),bQ={URI:ms,contramap:SN},$Q={URI:ms,bimap:TN,mapLeft:IN},_Q={URI:ms,map:U0,contramap:SN,bimap:TN,mapLeft:IN};const SQ=Object.freeze(Object.defineProperty({__proto__:null,make:bl,getShow:sQ,getEq:cQ,getOrd:lQ,getBounded:fQ,getSemigroup:dQ,getMonoid:pQ,getSemiring:hQ,getRing:mQ,getHeytingAlgebra:vQ,getBooleanAlgebra:gQ,getApply:$N,getApplicative:_N,contramap:ON,map:wN,bimap:EN,mapLeft:RN,URI:ms,Functor:MN,flap:yQ,Contravariant:bQ,Bifunctor:$Q,const_:_Q},Symbol.toStringTag,{value:"Module"})),TQ=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var IQ={equals:function(e,t){return e.valueOf()===t.valueOf()}},OQ={equals:function(e,t){return e.getDate()===t.getDate()}},wQ={equals:function(e,t){return e.getMonth()===t.getMonth()}},EQ={equals:function(e,t){return e.getFullYear()===t.getFullYear()}},RQ=m(Qm,Tm(function(e){return e.valueOf()})),MQ=function(){return new Date},xQ=function(){return new Date().getTime()};const CQ=Object.freeze(Object.defineProperty({__proto__:null,Eq:IQ,eqDate:OQ,eqMonth:wQ,eqYear:EQ,Ord:RQ,create:MQ,now:xQ},Symbol.toStringTag,{value:"Module"}));function vs(e){return Z(ze,e.of)}function $l(e){return Z(yt,e.of)}function _l(e){return function(t){return e.map(t,ze)}}function Sl(e){return function(t){return e.map(t,yt)}}function Nv(e){return function(t){return Z(t_(t),e.of)}}function Pv(e){var t=Nv(e);return function(n){var r=t(n);return function(i){return Z(i,r)}}}function B0(e){var t=gs(e),n=Pv(e);return function(r){var i=n(r);return function(o){return t(i(o))}}}function Tl(e){return Lc(e,za)}function Il(e){return So(e,zc)}function gs(e){return function(t){return function(n){return e.chain(n,function(r){return re(r)?e.of(r):t(r.right)})}}}function Ol(e){return function(t){return function(n){return e.chain(n,function(r){return re(r)?t():e.of(r)})}}}function wl(e){return function(t,n){return function(r){return e.map(r,G$(t,n))}}}function El(e){return function(t){return function(n){return e.map(n,_d(t))}}}function np(e,t){return function(n){return function(r){return e.chain(r,qa(function(i){return e.map(n(),_d(function(o){return t.concat(i,o)}))},vs(e)))}}}function rp(e){return function(t,n){return function(r){return e.map(r,qa(t,n))}}}function Rl(e){return function(t,n){return function(r){return e.chain(r,qa(t,n))}}}function Ml(e){return function(t){return function(n){return e.chain(n,qa(t,e.of))}}}function ys(e){return function(t){return function(n){return e.chain(n,function(r){return re(r)?t(r.left):e.of(r)})}}}function ip(e){var t=ys(e);return function(n){return t(function(r){return e.map(n(r),function(i){return re(i)?i:yt(r)})})}}function op(e){return function(t){return function(n){return e.chain(n,qa(function(r){return e.map(t(r),yt)},function(r){return e.of(ze(r))}))}}}function xl(e){return function(t){return e.map(t,$x)}}function ap(e){return function(t){return e.map(t,Ix)}}function AQ(e){var t=Il(e),n=Tl(e),r=gs(e),i=Ol(e),o=wl(e),a=El(e),u=Rl(e),s=Ml(e),c=ys(e);return{map:function(l,f){return m(l,n(f))},ap:function(l,f){return m(l,t(f))},of:vs(e),chain:function(l,f){return m(l,r(f))},alt:function(l,f){return m(l,i(f))},bimap:function(l,f,d){return m(l,o(f,d))},mapLeft:function(l,f){return m(l,a(f))},fold:function(l,f,d){return m(l,u(f,d))},getOrElse:function(l,f){return m(l,s(f))},orElse:function(l,f){return m(l,c(f))},swap:xl(e),rightM:_l(e),leftM:Sl(e),left:$l(e)}}const kQ=Object.freeze(Object.defineProperty({__proto__:null,right:vs,left:$l,rightF:_l,leftF:Sl,fromNullable:Nv,fromNullableK:Pv,chainNullableK:B0,map:Tl,ap:Il,chain:gs,alt:Ol,bimap:wl,mapLeft:El,altValidation:np,match:rp,matchE:Rl,getOrElse:Ml,orElse:ys,orElseFirst:ip,orLeft:op,swap:xl,toUnion:ap,getEitherM:AQ},Symbol.toStringTag,{value:"Module"}));var WQ="Endomorphism",xN=function(){return{concat:function(e,t){return Z(e,t)}}},CN=function(){return{concat:xN().concat,empty:B}};const NQ=Object.freeze(Object.defineProperty({__proto__:null,URI:WQ,getSemigroup:xN,getMonoid:CN},Symbol.toStringTag,{value:"Module"})),PQ=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function AN(e,t){var n=t.zero,r=function(i,o){return e.equals(o,n)?i:r(o,t.mod(i,o))};return r}function FQ(e,t){var n=t.zero,r=AN(e,t);return function(i,o){return e.equals(i,n)||e.equals(o,n)?n:t.div(t.mul(i,o),r(i,o))}}var DQ={add:function(e,t){return e+t},zero:0,mul:function(e,t){return e*t},one:1,sub:function(e,t){return e-t},degree:function(e){return 1},div:function(e,t){return e/t},mod:function(e,t){return e%t}};const LQ=Object.freeze(Object.defineProperty({__proto__:null,gcd:AN,lcm:FQ,fieldNumber:DQ},Symbol.toStringTag,{value:"Module"}));function Ao(e,t){return function(n){return function(r){return e.map(r,function(i){return t.filter(i,n)})}}}function ko(e,t){return function(n){return function(r){return e.map(r,function(i){return t.filterMap(i,n)})}}}function Qa(e,t){var n=Ao(e,t);return function(r){var i=n(Zd(r)),o=n(r);return function(a){return Oe(i(a),o(a))}}}function eu(e,t){var n=ko(e,t);return function(r){return function(i){return Oe(m(i,n(function(o){return Ov(r(o))})),m(i,n(function(o){return Xd(r(o))})))}}}function jQ(e,t){var n=jc(e,t).map,r=Ki(e,t),i=Co(e,t,t),o=Ao(e,t),a=ko(e,t),u=Qa(e,t),s=eu(e,t);return{map:n,compact:r,separate:i,filter:function(c,l){return m(c,o(l))},filterMap:function(c,l){return m(c,a(l))},partition:function(c,l){return m(c,u(l))},partitionMap:function(c,l){return m(c,s(l))}}}const UQ=Object.freeze(Object.defineProperty({__proto__:null,filter:Ao,filterMap:ko,partition:Qa,partitionMap:eu,getFilterableComposition:jQ},Symbol.toStringTag,{value:"Module"})),BQ=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function kN(e,t){return function(n,r){return function(i){return e.reduce(i,n,function(o,a){return t.reduce(a,o,r)})}}}function WN(e,t){return function(n){var r=e.foldMap(n),i=t.foldMap(n);return function(o){return function(a){return r(a,function(u){return i(u,o)})}}}}function NN(e,t){return function(n,r){return function(i){return e.reduceRight(i,n,function(o,a){return t.reduceRight(o,a,r)})}}}function zQ(e,t){return function(n,r){return function(i){return t.reduce(i,e.of(n),function(o,a){return e.chain(o,function(u){return r(u,a)})})}}}function qQ(e,t){return function(n,r){var i=function(o,a){var u=o.init,s=o.acc;return u?{init:!1,acc:a}:{init:!1,acc:e.concat(e.concat(s,n),a)}};return t.reduce(r,{init:!0,acc:e.empty},i).acc}}function PN(e){return function(t){return e.reduce(t,[],function(n,r){return n.push(r),n})}}function KQ(e,t){var n=function(i,o){return e.ap(e.map(i,Fn),o)},r=e.of(void 0);return function(i,o){return t.reduce(i,r,function(a,u){return n(a,o(u))})}}function VQ(e,t){return function(n,r,i){return t.reduce(n,e.of(r),function(o,a){return e.chain(o,function(u){return i(u,a)})})}}var HQ=PN;function z0(e,t){var n=kN(e,t),r=WN(e,t),i=NN(e,t);return{reduce:function(o,a,u){return m(o,n(a,u))},foldMap:function(o){var a=r(o);return function(u,s){return m(u,a(s))}},reduceRight:function(o,a,u){return m(o,i(a,u))}}}const JQ=Object.freeze(Object.defineProperty({__proto__:null,reduce:kN,foldMap:WN,reduceRight:NN,reduceM:zQ,intercalate:qQ,toReadonlyArray:PN,traverse_:KQ,foldM:VQ,toArray:HQ,getFoldableComposition:z0},Symbol.toStringTag,{value:"Module"}));function FN(e,t){return function(n,r){return function(i){return e.reduceWithIndex(i,n,function(o,a,u){return t.reduceWithIndex(u,a,function(s,c,l){return r([o,s],c,l)})})}}}function DN(e,t){return function(n){var r=e.foldMapWithIndex(n),i=t.foldMapWithIndex(n);return function(o){return function(a){return r(a,function(u,s){return i(s,function(c,l){return o([u,c],l)})})}}}}function LN(e,t){return function(n,r){return function(i){return e.reduceRightWithIndex(i,n,function(o,a,u){return t.reduceRightWithIndex(a,u,function(s,c,l){return r([o,s],c,l)})})}}}function GQ(e,t){var n=z0(e,t),r=FN(e,t),i=DN(e,t),o=LN(e,t);return{reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,reduceWithIndex:function(a,u,s){return m(a,r(u,s))},foldMapWithIndex:function(a){var u=i(a);return function(s,c){return m(s,u(c))}},reduceRightWithIndex:function(a,u,s){return m(a,o(u,s))}}}const YQ=Object.freeze(Object.defineProperty({__proto__:null,reduceWithIndex:FN,foldMapWithIndex:DN,reduceRightWithIndex:LN,getFoldableWithIndexComposition:GQ},Symbol.toStringTag,{value:"Module"}));function Vi(e){return function(t){return Z(t,e.fromIO)}}function Wo(e,t){return function(n){var r=Z(n,e.fromIO);return function(i){return t.chain(i,r)}}}function No(e,t){var n=at(t);return function(r){return n(Z(r,e.fromIO))}}const ZQ=Object.freeze(Object.defineProperty({__proto__:null,fromIOK:Vi,chainIOK:Wo,chainFirstIOK:No},Symbol.toStringTag,{value:"Module"}));var jN=function(){return B},XQ=B,up=function(e){return function(t){return function(n){return t(e(n))}}},sp=function(e){return function(t){return e(t)(t)}},QQ=sp,Po=function(e,t){return m(e,bs(t))},cp=function(e,t){return m(e,zN(t))},q0=function(e,t){return m(e,qN(t))},UN=function(e,t){return m(e,VN(t))},Fv=function(e,t,n){return m(e,HN(t,n))},bs=function(e){return function(t){return function(n){return e(t(n))}}},BN=function(e){return function(t){return function(n){return t(n)(e(n))}}},zN=BN,Hi=Fn,K0=function(e){return function(t){return function(n){return e(t(n))(n)}}},qN=K0,KN=K0(B),eee=KN,VN=function(e){return function(t){return Z(e,t)}},HN=function(e,t){return function(n){return function(r){return t(n(e(r)))}}},V0=function(){return B},H0=function(e){return function(t){var n=t[0],r=t[1];return[e(n),r]}},J0=function(e){return function(t){var n=t[0],r=t[1];return[n,e(r)]}},G0=function(e){return Q$(function(t){return _o(e(t))},ze)},Y0=function(e){return Q$(yt,function(t){return ja(e(t))})},Nr="Reader",Qt={URI:Nr,map:Po},tee=De(Qt),Z0={URI:Nr,of:Hi},Fo={URI:Nr,map:Po,ap:cp},JN=_t(Fo),nee=JN,GN=St(Fo),ree=GN,YN={URI:Nr,map:Po,ap:cp,of:Hi},X0={URI:Nr,map:Po,ap:cp,chain:q0},Do={URI:Nr,map:Po,of:Hi,ap:cp,chain:q0},ZN=at(X0),iee=ZN,oee={URI:Nr,map:Po,promap:Fv},aee={URI:Nr,compose:UN,id:V0},uee={URI:Nr,map:Po,promap:Fv,first:H0,second:J0},see={URI:Nr,map:Po,promap:Fv,left:G0,right:Y0},cee=It(Qt),XN=Ot(X0),lee=XN,fee=Hi(jt),QN=Tt(Fo),dee=QN,eP=Hi(Yt),$s=function(e){return function(t){return function(n){for(var r=[e(0,or(t))(n)],i=1;i<t.length;i++)r.push(e(i,t[i])(n));return r}}},Q0=function(e){var t=$s(e);return function(n){return ft(n)?t(n):eP}},pee=Q0,tP=function(e){return Q0(function(t,n){return e(n)})},hee=tP(B),mee={URI:Nr,map:Po,of:Hi,ap:cp,chain:q0,promap:Fv,compose:UN,id:V0,first:H0,second:J0,left:G0,right:Y0},vee=Ut(Fo),gee=Cr(YN);const yee=Object.freeze(Object.defineProperty({__proto__:null,ask:jN,asks:XQ,local:up,asksReaderW:sp,asksReader:QQ,map:bs,apW:BN,ap:zN,of:Hi,chainW:K0,chain:qN,flattenW:KN,flatten:eee,compose:VN,promap:HN,id:V0,first:H0,second:J0,left:G0,right:Y0,URI:Nr,Functor:Qt,flap:tee,Pointed:Z0,Apply:Fo,apFirst:JN,apFirstW:nee,apSecond:GN,apSecondW:ree,Applicative:YN,Chain:X0,Monad:Do,chainFirst:ZN,chainFirstW:iee,Profunctor:oee,Category:aee,Strong:uee,Choice:see,bindTo:cee,bind:XN,bindW:lee,Do:fee,apS:QN,apSW:dee,ApT:eP,traverseReadonlyNonEmptyArrayWithIndex:$s,traverseReadonlyArrayWithIndex:Q0,traverseArrayWithIndex:pee,traverseArray:tP,sequenceArray:hee,reader:mee,getSemigroup:vee,getMonoid:gee},Symbol.toStringTag,{value:"Module"}));function lp(e){return function(){return e.fromReader(jN())}}function fp(e){return e.fromReader}function _s(e){return function(t){return Z(t,e.fromReader)}}function dp(e,t){var n=_s(e);return function(r){return function(i){return t.chain(i,n(r))}}}function pp(e,t){return Z(_s(e),at(t))}const bee=Object.freeze(Object.defineProperty({__proto__:null,ask:lp,asks:fp,fromReaderK:_s,chainReaderK:dp,chainFirstReaderK:pp},Symbol.toStringTag,{value:"Module"}));var nP=function(){return function(e){return[e,e]}},rP=function(e){return function(){return[void 0,e]}},iP=function(e){return function(t){return[void 0,e(t)]}},oP=function(e){return function(t){return[e(t),t]}},hp=function(e,t){return m(e,uP(t))},Dv=function(e,t){return m(e,sP(t))},aP=function(e,t){return m(e,eT(t))},uP=function(e){return function(t){return function(n){var r=t(n),i=r[0],o=r[1];return[e(i),o]}}},sP=function(e){return function(t){return function(n){var r=t(n),i=r[0],o=r[1],a=e(o),u=a[0],s=a[1];return[i(u),s]}}},mp=function(e){return function(t){return[e,t]}},eT=function(e){return function(t){return function(n){var r=t(n),i=r[0],o=r[1];return e(i)(o)}}},$ee=eT(B),tu="State",tT={URI:tu,map:hp},_ee=De(tT),See={URI:tu,of:mp},Lv={URI:tu,map:hp,ap:Dv},Tee=_t(Lv),Iee=St(Lv),Oee={URI:tu,map:hp,ap:Dv,of:mp},nT={URI:tu,map:hp,ap:Dv,chain:aP},cP={URI:tu,map:hp,ap:Dv,of:mp,chain:aP},wee=at(nT),Eee={URI:tu,fromState:B},Ree=function(e){return function(t){return t(e)[0]}},Mee=function(e){return function(t){return t(e)[1]}},xee=It(tT),Cee=Ot(nT),Aee=Tt(Lv),lP=function(e){return function(t){return function(n){for(var r=e(0,or(t))(n),i=r[0],o=r[1],a=[i],u=o,s=1;s<t.length;s++){var c=e(s,t[s])(u),l=c[0],f=c[1];a.push(l),u=f}return[a,u]}}},rT=function(e){var t=lP(e);return function(n){return ft(n)?t(n):mp(Yt)}},kee=rT,fP=function(e){return rT(function(t,n){return e(n)})},Wee=fP(B),Nee=function(e,t){return e(t)[0]},Pee=function(e,t){return e(t)[1]},Fee=cP;const Dee=Object.freeze(Object.defineProperty({__proto__:null,get:nP,put:rP,modify:iP,gets:oP,map:uP,ap:sP,of:mp,chain:eT,flatten:$ee,URI:tu,Functor:tT,flap:_ee,Pointed:See,Apply:Lv,apFirst:Tee,apSecond:Iee,Applicative:Oee,Chain:nT,Monad:cP,chainFirst:wee,FromState:Eee,evaluate:Ree,execute:Mee,bindTo:xee,bind:Cee,apS:Aee,traverseReadonlyNonEmptyArrayWithIndex:lP,traverseReadonlyArrayWithIndex:rT,traverseArrayWithIndex:kee,traverseArray:fP,sequenceArray:Wee,evalState:Nee,execState:Pee,state:Fee},Symbol.toStringTag,{value:"Module"}));function dP(e){return function(){return e.fromState(nP())}}function pP(e){return function(t){return e.fromState(rP(t))}}function hP(e){return Z(iP,e.fromState)}function mP(e){return Z(oP,e.fromState)}function iT(e){return function(t){return Z(t,e.fromState)}}function vP(e,t){var n=iT(e);return function(r){return function(i){return t.chain(i,n(r))}}}const Lee=Object.freeze(Object.defineProperty({__proto__:null,get:dP,put:pP,modify:hP,gets:mP,fromStateK:iT,chainStateK:vP},Symbol.toStringTag,{value:"Module"}));function Ss(e){return function(t){return Z(t,e.fromTask)}}function Cl(e,t){return function(n){var r=Z(n,e.fromTask);return function(i){return t.chain(i,r)}}}function Al(e,t){var n=at(t);return function(r){return n(Z(r,e.fromTask))}}const jee=Object.freeze(Object.defineProperty({__proto__:null,fromTaskK:Ss,chainTaskK:Cl,chainFirstTaskK:Al},Symbol.toStringTag,{value:"Module"}));function gP(e){return function(t){return Z(t,e.fromThese)}}const Uee=Object.freeze(Object.defineProperty({__proto__:null,fromTheseK:gP},Symbol.toStringTag,{value:"Module"}));function yP(e,t){return function(n){return function(r){return e.mapWithIndex(r,function(i,o){return t.mapWithIndex(o,function(a,u){return n([i,a],u)})})}}}function Bee(e,t){var n=jc(e,t).map,r=yP(e,t);return{map:n,mapWithIndex:function(i,o){return m(i,r(o))}}}const zee=Object.freeze(Object.defineProperty({__proto__:null,mapWithIndex:yP,getFunctorWithIndexComposition:Bee},Symbol.toStringTag,{value:"Module"})),qee=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Kee=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Vee=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Ji=function(e,t){return m(e,TP(t))},kl=function(e,t){return m(e,IP(t))},jv=function(e,t){return m(e,sT(t))},oT=function(e,t,n){return m(e,OP(t,n))},aT=function(e){return function(t,n){return m(t,wP()(n))}},uT=function(e,t,n){return m(e,EP(t,n))},bP=function(e,t){return m(e,xP())},$P=function(e,t){return m(e,cT(t))},_P=function(e){var t=RP(e);return function(n,r){return m(n,t(r))}},SP=L$,TP=function(e){return function(t){return e(t)}},IP=function(e){return function(t){return t(e)}},Wl=B,sT=function(e){return function(t){return e(t)}},cT=function(e){return function(t){return e(t)}},lT=B,Hee=cT(B),Jee=sT(B),OP=function(e,t){return function(n){return t(e,n)}},wP=function(){return function(e){return function(t){return e(t)}}},EP=function(e,t){return function(n){return t(n,e)}},RP=function(e){return function(t){return function(n){return e.map(t(n),B)}}},fT=function(e){return function(t){return e.map(t,B)}},MP=function(){return B},xP=MP,cr="Identity",Gee=B,Yee=B,dT={URI:cr,map:Ji},Zee=De(dT),Xee={URI:cr,of:Wl},Uv={URI:cr,map:Ji,ap:kl},Qee=_t(Uv),ete=St(Uv),tte={URI:cr,map:Ji,ap:kl,of:Wl},pT={URI:cr,map:Ji,ap:kl,chain:jv},nte={URI:cr,map:Ji,ap:kl,of:Wl,chain:jv},rte=at(pT),ite={URI:cr,reduce:oT,foldMap:aT,reduceRight:uT},ote={URI:cr,map:Ji,reduce:oT,foldMap:aT,reduceRight:uT,traverse:_P,sequence:fT},ate={URI:cr,map:Ji,alt:bP},ute={URI:cr,map:Ji,extend:$P,extract:lT},ste={URI:cr,map:Ji,ap:kl,chain:jv,chainRec:SP},cte=Wl(jt),lte=It(dT),fte=Ot(pT),dte=Tt(Uv),pte={URI:cr,map:Ji,ap:kl,of:Wl,chain:jv,reduce:oT,foldMap:aT,reduceRight:uT,traverse:_P,sequence:fT,alt:bP,extract:lT,extend:$P,chainRec:SP};const hte=Object.freeze(Object.defineProperty({__proto__:null,map:TP,ap:IP,of:Wl,chain:sT,extend:cT,extract:lT,duplicate:Hee,flatten:Jee,reduce:OP,foldMap:wP,reduceRight:EP,traverse:RP,sequence:fT,altW:MP,alt:xP,URI:cr,getShow:Gee,getEq:Yee,Functor:dT,flap:Zee,Pointed:Xee,Apply:Uv,apFirst:Qee,apSecond:ete,Applicative:tte,Chain:pT,Monad:nte,chainFirst:rte,Foldable:ite,Traversable:ote,Alt:ate,Comonad:ute,ChainRec:ste,Do:cte,bindTo:lte,bind:fte,apS:dte,identity:pte},Symbol.toStringTag,{value:"Module"})),mte=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Lo=function(e,t){return function(){return t(e())}},nu=function(e,t){return function(){return e()(t())}},Nl=function(e,t){return function(){return t(e())()}},CP=function(e,t){return function(){for(var n=t(e)();n._tag==="Left";)n=t(n.left)();return n.right}},Gi=function(e){return function(t){return Lo(t,e)}},vte=function(e){return function(t){return nu(t,e)}},fi=Fn,hT=function(e){return function(t){return Nl(t,e)}},gte=hT(B),di="IO",rt={URI:di,map:Lo},yte=De(rt),Yi={URI:di,of:fi},jo={URI:di,map:Lo,ap:nu},bte=_t(jo),$te=St(jo),AP={URI:di,map:Lo,ap:nu,of:fi},Bv={URI:di,map:Lo,ap:nu,chain:Nl},jn={URI:di,map:Lo,ap:nu,of:fi,chain:Nl},_te=at(Bv),mT=B,Ste={URI:di,map:Lo,ap:nu,of:fi,chain:Nl,fromIO:mT},Tte={URI:di,map:Lo,ap:nu,chain:Nl,chainRec:CP},Ite={URI:di,fromIO:B},Ote=fi(jt),wte=It(rt),Ete=Ot(Bv),Rte=Tt(jo),kP=fi(Yt),zv=function(e){return function(t){return function(){for(var n=[e(0,or(t))()],r=1;r<t.length;r++)n.push(e(r,t[r])());return n}}},vT=function(e){var t=zv(e);return function(n){return ft(n)?t(n):kP}},Mte=vT,WP=function(e){return vT(function(t,n){return e(n)})},xte=WP(B),Cte={URI:di,map:Lo,of:fi,ap:nu,chain:Nl,fromIO:mT,chainRec:CP},Ate=Ut(jo),kte=Cr(AP);const Wte=Object.freeze(Object.defineProperty({__proto__:null,map:Gi,ap:vte,of:fi,chain:hT,flatten:gte,URI:di,Functor:rt,flap:yte,Pointed:Yi,Apply:jo,apFirst:bte,apSecond:$te,Applicative:AP,Chain:Bv,Monad:jn,chainFirst:_te,fromIO:mT,MonadIO:Ste,ChainRec:Tte,FromIO:Ite,Do:Ote,bindTo:wte,bind:Ete,apS:Rte,ApT:kP,traverseReadonlyNonEmptyArrayWithIndex:zv,traverseReadonlyArrayWithIndex:vT,traverseArrayWithIndex:Mte,traverseArray:WP,sequenceArray:xte,io:Cte,getSemigroup:Ate,getMonoid:kte},Symbol.toStringTag,{value:"Module"}));var NP=$l(Yi),PP=vs(Yi),FP=_l(rt),Nte=Sl(rt),DP=fi,vp=FP,LP=rp(rt),Pte=LP,gT=Rl(jn),Fte=gT,jP=gT,Dte=jP,UP=Ml(jn),Lte=UP,BP=function(e,t){return function(){return rs(e,t)}},jte=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return BP(function(){return e.apply(void 0,n)},t)}},Ute=ap(rt),zP=ys(jn),Bte=zP,yT=ip(jn),zte=yT,qte=function(e){return yT(eF(e))},Kte=op(jn),Vte=xl(rt),Un=function(e,t){return m(e,_T(t))},Ts=function(e,t){return m(e,ST(t))},Hte=function(e,t){return m(e,qv(function(n){return m(t,_T(n))}))},Pl=function(e,t){return m(e,qv(t))},bT=function(e,t,n){return m(e,KP(t,n))},$T=function(e,t){return m(e,VP(t))},qP=function(e,t){return m(e,TT(t))},_T=Tl(rt),KP=wl(rt),VP=El(rt),ST=Il(jo),Jte=ST,Pr=PP,qv=gs(jn),Kv=qv,HP=Kv(B),Gte=HP,TT=Ol(jn),Yte=TT,Vv=NP,At="IOEither";function JP(e){var t=So(jo,Ba(e));return{URI:At,_E:void 0,map:Un,ap:function(n,r){return m(n,t(r))},of:Pr}}function GP(e){var t=np(jn,e);return{URI:At,_E:void 0,map:Un,alt:function(n,r){return m(n,t(r))}}}var YP=function(e){var t=ts(e);return{URI:At,_E:void 0,compact:Ki(rt,t),separate:Co(rt,t,za)}};function Zte(e){var t=Bc(e),n=YP(e),r=Ao(rt,t),i=ko(rt,t),o=Qa(rt,t),a=eu(rt,t);return{URI:At,_E:void 0,map:Un,compact:n.compact,separate:n.separate,filter:function(u,s){return m(u,r(s))},filterMap:function(u,s){return m(u,i(s))},partition:function(u,s){return m(u,o(s))},partitionMap:function(u,s){return m(u,a(s))}}}var IT={URI:At,map:Un},Xte=De(IT),Qte={URI:At,of:Pr},ene={URI:At,bimap:bT,mapLeft:$T},gp={URI:At,map:Un,ap:Ts},ZP=_t(gp),tne=ZP,XP=St(gp),nne=XP,OT={URI:At,map:Un,ap:Ts,of:Pr},rne={URI:At,map:Un,ap:Hte,of:Pr},Uo={URI:At,map:Un,ap:Ts,chain:Pl},ine={URI:At,map:Un,ap:Ts,of:Pr,chain:Pl},QP=at(Uo),one=QP,ane={URI:At,map:Un,alt:qP},une={URI:At,map:Un,ap:Ts,of:Pr,chain:Pl,fromIO:vp},sne={URI:At,map:Un,ap:Ts,of:Pr,chain:Pl,throwError:Vv},Hv={URI:At,fromIO:vp},eF=Vi(Hv),cne=Wo(Hv,Uo),lne=No(Hv,Uo),Bo={URI:At,fromEither:DP},fne=Di(Bo),dne=Li(Bo),pne=Xu(Bo,Uo),tF=To(Bo,Uo),hne=tF,nF=Io(Bo,Uo),mne=nF,vne=Ua(Bo),rF=Qu(Bo,Uo),gne=rF,yne=ar(Bo),bne=function(e,t,n){return iF(e,t,n)},iF=function(e,t,n){return m(e,Kv(function(r){return m(t(r),hT(function(i){return m(n(r,i),Kv(function(){return fi(i)}))}))}))},$ne=Pr(jt),_ne=It(IT),oF=Ot(Uo),Sne=oF,aF=Tt(gp),Tne=aF,wT=Pr(Yt),uF=function(e){return Z(zv(e),Gi(Sd(Dn)))},ET=function(e){var t=uF(e);return function(n){return ft(n)?t(n):wT}},sF=function(e){return function(t){return function(){var n=e(0,or(t))();if(Lt(n))return n;for(var r=[n.right],i=1;i<t.length;i++){var o=e(i,t[i])();if(Lt(o))return o;r.push(o.right)}return ja(r)}}},RT=function(e){var t=sF(e);return function(n){return ft(n)?t(n):wT}},Ine=ET,cF=function(e){return ET(function(t,n){return e(n)})},One=cF(B),wne=RT,lF=function(e){return RT(function(t,n){return e(n)})},Ene=lF(B),Rne=OT,Mne={URI:At,bimap:bT,mapLeft:$T,map:Un,of:Pr,ap:Ts,chain:Pl,alt:qP,fromIO:vp,throwError:Vv},xne=Ut(gp),Cne=Cr(OT),Ane=function(e){return Ut(jo)(yd(e))};function kne(e){var t=JP(e),n=GP(e);return{URI:At,_E:void 0,map:Un,ap:t.ap,of:Pr,chain:Pl,bimap:bT,mapLeft:$T,alt:n.alt,fromIO:vp,throwError:Vv}}const Wne=Object.freeze(Object.defineProperty({__proto__:null,left:NP,right:PP,rightIO:FP,leftIO:Nte,fromEither:DP,fromIO:vp,match:LP,matchW:Pte,matchE:gT,fold:Fte,matchEW:jP,foldW:Dte,getOrElse:UP,getOrElseW:Lte,tryCatch:BP,tryCatchK:jte,toUnion:Ute,orElse:zP,orElseW:Bte,orElseFirst:yT,orElseFirstW:zte,orElseFirstIOK:qte,orLeft:Kte,swap:Vte,map:_T,bimap:KP,mapLeft:VP,ap:ST,apW:Jte,of:Pr,chain:qv,chainW:Kv,flattenW:HP,flatten:Gte,alt:TT,altW:Yte,throwError:Vv,URI:At,getApplicativeIOValidation:JP,getAltIOValidation:GP,getCompactable:YP,getFilterable:Zte,Functor:IT,flap:Xte,Pointed:Qte,Bifunctor:ene,ApplyPar:gp,apFirst:ZP,apFirstW:tne,apSecond:XP,apSecondW:nne,ApplicativePar:OT,ApplicativeSeq:rne,Chain:Uo,Monad:ine,chainFirst:QP,chainFirstW:one,Alt:ane,MonadIO:une,MonadThrow:sne,FromIO:Hv,fromIOK:eF,chainIOK:cne,chainFirstIOK:lne,FromEither:Bo,fromOption:fne,fromOptionK:dne,chainOptionK:pne,chainEitherK:tF,chainEitherKW:hne,chainFirstEitherK:nF,chainFirstEitherKW:mne,fromPredicate:vne,filterOrElse:rF,filterOrElseW:gne,fromEitherK:yne,bracket:bne,bracketW:iF,Do:$ne,bindTo:_ne,bind:oF,bindW:Sne,apS:aF,apSW:Tne,ApT:wT,traverseReadonlyNonEmptyArrayWithIndex:uF,traverseReadonlyArrayWithIndex:ET,traverseReadonlyNonEmptyArrayWithIndexSeq:sF,traverseReadonlyArrayWithIndexSeq:RT,traverseArrayWithIndex:Ine,traverseArray:cF,sequenceArray:One,traverseSeqArrayWithIndex:wne,traverseSeqArray:lF,sequenceSeqArray:Ene,Applicative:Rne,ioEither:Mne,getApplySemigroup:xne,getApplyMonoid:Cne,getSemigroup:Ane,getIOValidation:kne},Symbol.toStringTag,{value:"Module"}));function yp(e){return Z(mt,e.of)}function bp(e){return Fn(e.of(et))}function Jv(e){return function(t){return e.map(t,mt)}}function Gv(e){return Z(hs,e.of)}function Yv(e){var t=Gv(e);return function(n){return Z(n,t)}}function MT(e){var t=Fl(e),n=Yv(e);return function(r){return t(n(r))}}function Zv(e){return function(t){return Z(t,e.of)}}function xT(e){var t=Fl(e),n=Zv(e);return function(r){return t(n(r))}}function CT(e){return function(t){return function(n){return e.of(Iv(t)(n))}}}function AT(e){return Z(yl,e.of)}function kT(e){return function(t,n){return function(r){return e.map(r,Mo(t,n))}}}function Xv(e){return function(t,n){return function(r){return e.chain(r,Mo(t,n))}}}function Qv(e){return function(t){return function(n){return e.chain(n,Mo(t,e.of))}}}function eg(e){return Lc(e,hl)}function tg(e){return So(e,ml)}function Fl(e){var t=bp(e);return function(n){return function(r){return e.chain(r,Mo(function(){return t()},n))}}}function ng(e){var t=yp(e);return function(n){return function(r){return e.chain(r,Mo(n,t))}}}function Nne(e){var t=tg(e),n=eg(e),r=Fl(e),i=ng(e),o=Xv(e),a=Qv(e),u=bp(e);return{map:function(s,c){return m(s,n(c))},ap:function(s,c){return m(s,t(c))},of:yp(e),chain:function(s,c){return m(s,r(c))},alt:function(s,c){return m(s,i(c))},fold:function(s,c,l){return m(s,o(c,l))},getOrElse:function(s,c){return m(s,a(c))},fromM:Jv(e),none:function(){return u()}}}const Pne=Object.freeze(Object.defineProperty({__proto__:null,some:yp,zero:bp,fromF:Jv,fromNullable:Gv,fromNullableK:Yv,chainNullableK:MT,fromOptionK:Zv,chainOptionK:xT,fromPredicate:CT,fromEither:AT,match:kT,matchE:Xv,getOrElse:Qv,map:eg,ap:tg,chain:Fl,alt:ng,getOptionM:Nne},Symbol.toStringTag,{value:"Module"}));var fF=yp(Yi),Fne=CT(Yi),Dne=fi,dF=AT(Yi),WT=Jv(rt),Lne=Gi(yl),pF=kT(rt),jne=pF,NT=Xv(Bv),Une=NT,Bne=NT,hF=Qv(jn),zne=hF,qne=Gi(pN),Kne=Gi(L0),Vne=Gv(Yi),Hne=Yv(Yi),Jne=MT(jn),Gne=Zv(Yi),Yne=xT(jn),mF=eg(rt),vF=tg(jo),ru=fF,PT=Fl(jn),Zne=PT(B),FT=ng(jn),Xne=FT,rg=bp(Yi),Qne=rg(),DT=Ki(rt,ps),LT=Co(rt,ps,hl),gF=Ao(rt,Ro),yF=ko(rt,Ro),bF=Qa(rt,Ro),$F=eu(rt,Ro),zo=function(e,t){return m(e,mF(t))},Dl=function(e,t){return m(e,vF(t))},jT=function(e,t){return m(e,PT(t))},_F=function(e,t){return m(e,FT(t))},ere=function(e,t){return m(e,gF(t))},tre=function(e,t){return m(e,yF(t))},nre=function(e,t){return m(e,bF(t))},rre=function(e,t){return m(e,$F(t))},Bn="IOOption",UT={URI:Bn,map:zo},ire=De(UT),SF={URI:Bn,of:ru},ig={URI:Bn,map:zo,ap:Dl},ore=_t(ig),are=St(ig),ure={URI:Bn,map:zo,ap:Dl,of:ru},Is={URI:Bn,map:zo,ap:Dl,chain:jT},sre=at(Is),cre={URI:Bn,map:zo,alt:_F},TF={URI:Bn,zero:rg},lre=nl(TF,SF),fre={URI:Bn,map:zo,ap:Dl,of:ru,alt:_F,zero:rg},dre={URI:Bn,map:zo,ap:Dl,of:ru,chain:jT},pre={URI:Bn,map:zo,ap:Dl,of:ru,chain:jT,fromIO:WT},hre={URI:Bn,compact:DT,separate:LT},mre={URI:Bn,map:zo,compact:DT,separate:LT,filter:ere,filterMap:tre,partition:nre,partitionMap:rre},og={URI:Bn,fromIO:WT},vre=Vi(og),gre=Wo(og,Is),yre=No(og,Is),ag={URI:Bn,fromEither:dF},bre=ar(ag),$re=To(ag,Is),_re=Io(ag,Is),Sre=ru(jt),Tre=It(UT),Ire=Ot(Is),Ore=Tt(ig),IF=ru(Yt),OF=function(e){return Z(zv(e),Gi(Wv(Dn)))},wre=function(e){var t=OF(e);return function(n){return ft(n)?t(n):IF}};const Ere=Object.freeze(Object.defineProperty({__proto__:null,some:fF,fromPredicate:Fne,fromOption:Dne,fromEither:dF,fromIO:WT,fromIOEither:Lne,match:pF,matchW:jne,matchE:NT,fold:Une,matchEW:Bne,getOrElse:hF,getOrElseW:zne,toUndefined:qne,toNullable:Kne,fromNullable:Vne,fromNullableK:Hne,chainNullableK:Jne,fromOptionK:Gne,chainOptionK:Yne,map:mF,ap:vF,of:ru,chain:PT,flatten:Zne,alt:FT,altW:Xne,zero:rg,none:Qne,compact:DT,separate:LT,filter:gF,filterMap:yF,partition:bF,partitionMap:$F,Functor:UT,flap:ire,Pointed:SF,Apply:ig,apFirst:ore,apSecond:are,Applicative:ure,Chain:Is,chainFirst:sre,Alt:cre,Zero:TF,guard:lre,Alternative:fre,Monad:dre,MonadIO:pre,Compactable:hre,Filterable:mre,FromIO:og,fromIOK:vre,chainIOK:gre,chainFirstIOK:yre,FromEither:ag,fromEitherK:bre,chainEitherK:$re,chainFirstEitherK:_re,Do:Sre,bindTo:Tre,bind:Ire,apS:Ore,ApT:IF,traverseReadonlyNonEmptyArrayWithIndex:OF,traverseReadonlyArrayWithIndex:wre},Symbol.toStringTag,{value:"Module"}));var wF=function(){function e(t){var n=this;this.value=t,this.read=function(){return n.value},this.write=this.write.bind(this),this.modify=this.modify.bind(this)}return e.prototype.write=function(t){var n=this;return function(){n.value=t}},e.prototype.modify=function(t){var n=this;return function(){n.value=t(n.value)}},e}();function Rre(e){return function(){return new wF(e)}}const Mre=Object.freeze(Object.defineProperty({__proto__:null,IORef:wF,newIORef:Rre},Symbol.toStringTag,{value:"Module"})),xre=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Cre=function(e){return rs(function(){return JSON.parse(e)},B)},Are=function(e){return rs(function(){var t=JSON.stringify(e);if(typeof t!="string")throw new Error("Converting unsupported structure to JSON");return t},B)};const kre=Object.freeze(Object.defineProperty({__proto__:null,parse:Cre,stringify:Are},Symbol.toStringTag,{value:"Module"})),Wre=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Nre=function(e){return new Map(e)};function Pre(e){return new Map(e)}function EF(e,t){return{show:function(n){var r=[];return n.forEach(function(i,o){r.push("[".concat(e.show(o),", ").concat(t.show(i),"]"))}),"new Map([".concat(r.sort().join(", "),"])")}}}var RF=function(e){return e.size},Zi=function(e){return e.size===0};function ug(e){var t=Os(e);return function(n,r){if(r===void 0){var i=ug(e);return function(o){return i(n,o)}}return ht(t(n,r))}}function BT(e){return function(t,n){if(n===void 0){var r=BT(e);return function(u){return r(t,u)}}for(var i=n.values(),o;!(o=i.next()).done;){var a=o.value;if(e.equals(t,a))return!0}return!1}}var Ll=function(e){return function(t){return Array.from(t.keys()).sort(e.compare)}},Fre=function(e){return function(t){return Array.from(t.values()).sort(e.compare)}};function MF(e){var t=Ll(e);return function(n){return function(r){for(var i=[],o=t(r),a=0,u=o;a<u.length;a++){var s=u[a];i.push(n(s,r.get(s)))}return i}}}var xF=function(e){return MF(e)(function(t,n){return[t,n]})};function Dre(e,t){var n=xF(e);return function(r){var i=n(r),o=i.length;return t.unfold(0,function(a){return a<o?le([i[a],a+1]):me})}}var CF=function(e){var t=qo(e);return function(n,r){var i=t(n);return function(o){var a=i(o);if(xt(a)){var u=new Map(o);return u.set(n,r),u}else if(a.value[1]!==r){var u=new Map(o);return u.set(a.value[0],r),u}return o}}},AF=function(e){var t=qo(e);return function(n){return function(r){var i=t(n,r);if(ht(i)){var o=new Map(r);return o.delete(i.value[0]),o}return r}}},Lre=function(e){var t=kF(e);return function(n,r){return t(n,function(){return r})}},kF=function(e){var t=qo(e);return function(n,r){return function(i){var o=t(n,i);if(xt(o))return me;var a=o.value,u=a[0],s=a[1],c=r(s);if(c===s)return le(i);var l=new Map(i);return l.set(u,c),le(l)}}};function jre(e){var t=Os(e),n=AF(e);return function(r){var i=n(r);return function(o){return m(t(r,o),qi(function(a){return[a,i(o)]}))}}}function qo(e){return function(t,n){if(n===void 0){var r=qo(e);return function(c){return r(t,c)}}for(var i=n.entries(),o;!(o=i.next()).done;){var a=o.value,u=a[0],s=a[1];if(e.equals(u,t))return le([u,s])}return me}}function Os(e){var t=qo(e);return function(n,r){if(r===void 0){var i=Os(e);return function(o){return i(n,o)}}return m(t(n,r),qi(function(o){o[0];var a=o[1];return a}))}}function sg(e,t){var n=qo(e);return function(r,i){if(i===void 0){var o=sg(e,t);return function(d){return o(d,r)}}for(var a=r.entries(),u;!(u=a.next()).done;){var s=u.value,c=s[0],l=s[1],f=n(c,i);if(xt(f)||!e.equals(c,f.value[0])||!t.equals(l,f.value[1]))return!1}return!0}}var cg=new Map;function WF(e,t){var n=sg(e,t);return kr(function(r,i){return n(r,i)&&n(i,r)})}function Ure(e,t){var n=qo(e);return{concat:function(r,i){if(Zi(r))return i;if(Zi(i))return r;for(var o=new Map(r),a=i.entries(),u;!(u=a.next()).done;){var s=u.value,c=s[0],l=s[1],f=n(c,r);ht(f)?o.set(f.value[0],t.concat(f.value[1],l)):o.set(c,l)}return o},empty:cg}}var Bre=function(e,t){return new Map([[e,t]])};function zre(e,t,n){return function(r){var i=qo(e);return n.reduce(r,new Map,function(o,a){var u=a[0],s=a[1],c=i(u,o);return ht(c)?o.set(c.value[0],t.concat(c.value[1],s)):o.set(u,s),o})}}var jl=function(e,t){for(var n=new Map,r=e.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],u=o[1];n.set(a,t(a,u))}return n},NF=function(e){return function(t){for(var n=new Map,r=new Map,i=t.entries(),o;!(o=i.next()).done;){var a=o.value,u=a[0],s=a[1],c=e(u,s);Lt(c)?n.set(u,c.left):r.set(u,c.right)}return Oe(n,r)}};function PF(e){return function(t){for(var n=new Map,r=new Map,i=t.entries(),o;!(o=i.next()).done;){var a=o.value,u=a[0],s=a[1];e(u,s)?r.set(u,s):n.set(u,s)}return Oe(n,r)}}var FF=function(e){return function(t){for(var n=new Map,r=t.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],u=o[1],s=e(a,u);ht(s)&&n.set(a,s.value)}return n}};function DF(e){return function(t){for(var n=new Map,r=t.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],u=o[1];e(a,u)&&n.set(a,u)}return n}}var Ko=function(e,t){return jl(e,function(n,r){return t(r)})},$p=function(e,t){return LF(e,function(n,r){return t(r)})},_p=function(e,t){return jF(e,function(n,r){return t(r)})},Sp=function(e,t){return UF(e,function(n,r){return t(r)})},Tp=function(e,t){return BF(e,function(n,r){return t(r)})},LF=function(e,t){return m(e,DF(t))},jF=function(e,t){return m(e,FF(t))},UF=function(e,t){return m(e,PF(t))},BF=function(e,t){return m(e,NF(t))},Ul=function(e){for(var t=new Map,n=e.entries(),r;!(r=n.next()).done;){var i=r.value,o=i[0],a=i[1];ht(a)&&t.set(o,a.value)}return t},qre=function(e){return function(t){return $p(t,e)}},Kre=function(e){return function(t){return _p(t,e)}},Vre=function(e){return function(t){return Ko(t,e)}},Hre=function(e){return function(t){return jl(t,e)}},Jre=function(e){return function(t){return Sp(t,e)}},Gre=function(e){return function(t){return Tp(t,e)}},Bl=function(e){for(var t=new Map,n=new Map,r=e.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],u=o[1];Lt(u)?t.set(a,u.left):n.set(a,u.right)}return Oe(t,n)},Fr="ReadonlyMap",zF=function(e,t){var n=GT(e,t);return{concat:function(r,i){return n(i)(r)}}},Yre=function(e,t){return{concat:zF(e,t).concat,empty:cg}},Zre=function(e,t){var n=YT(e,t);return{concat:function(r,i){return n(i)(r)}}},Xre=function(e){return function(){var t=ZT(e);return{concat:function(n,r){return t(r)(n)}}}};function Qre(){return{URI:Fr,_E:void 0,map:Ko,mapWithIndex:jl,compact:Ul,separate:Bl,filter:$p,filterMap:_p,partition:Sp,partitionMap:Tp,partitionMapWithIndex:BF,partitionWithIndex:UF,filterMapWithIndex:jF,filterWithIndex:LF}}var qF={URI:Fr,map:Ko},eie=De(qF),tie=function(){return{URI:Fr,_E:void 0,map:Ko,mapWithIndex:jl}},zT={URI:Fr,compact:Ul,separate:Bl},nie={URI:Fr,map:Ko,compact:Ul,separate:Bl,filter:$p,filterMap:_p,partition:Sp,partitionMap:Tp},qT=function(e){var t=fg(e);return function(n,r){return t(n,function(i,o,a){return r(o,a)})}},KT=function(e){var t=dg(e);return function(n){var r=t(n);return function(i){return r(function(o,a){return i(a)})}}},VT=function(e){var t=pg(e);return function(n,r){return t(n,function(i,o,a){return r(o,a)})}},lg=function(e){var t=qT(e),n=KT(e),r=VT(e);return{URI:Fr,_E:void 0,reduce:function(i,o,a){return m(i,t(o,a))},foldMap:function(i){var o=n(i);return function(a,u){return m(a,o(u))}},reduceRight:function(i,o,a){return m(i,r(o,a))}}},fg=function(e){var t=Ll(e);return function(n,r){return function(i){for(var o=n,a=0,u=t(i);a<u.length;a++){var s=u[a];o=r(s,o,i.get(s))}return o}}},dg=function(e){var t=Ll(e);return function(n){return function(r){return function(i){for(var o=n.empty,a=0,u=t(i);a<u.length;a++){var s=u[a];o=n.concat(o,r(s,i.get(s)))}return o}}}},pg=function(e){var t=Ll(e);return function(n,r){return function(i){for(var o=n,a=t(i),u=a.length,s=u-1;s>=0;s--){var c=a[s];o=r(c,i.get(c),o)}return o}}},HT=function(e){var t=lg(e),n=fg(e),r=dg(e),i=pg(e);return{URI:Fr,_E:void 0,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,reduceWithIndex:function(o,a,u){return m(o,n(a,u))},foldMapWithIndex:function(o){var a=r(o);return function(u,s){return m(u,a(s))}},reduceRightWithIndex:function(o,a,u){return m(o,i(a,u))}}},rie=function(e){var t=JT(e),n=lg(e);return{URI:Fr,_E:void 0,map:Ko,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,traverse:t.traverse,sequence:t.sequence}},JT=function(e){var t=HT(e),n=Ll(e),r=function(a){return function(u,s){for(var c=a.of(new Map),l=n(u),f=l.length,d=function(h){var v=l[h],y=u.get(v);c=a.ap(a.map(c,function(b){return function(w){return b.set(v,w)}}),s(v,y))},p=0;p<f;p++)d(p);return c}},i=function(a){var u=r(a);return function(s,c){return u(s,function(l,f){return c(f)})}},o=function(a){var u=r(a);return function(s){return u(s,Dn)}};return{URI:Fr,_E:void 0,map:Ko,mapWithIndex:jl,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,reduceWithIndex:t.reduceWithIndex,foldMapWithIndex:t.foldMapWithIndex,reduceRightWithIndex:t.reduceRightWithIndex,traverse:i,sequence:o,traverseWithIndex:r}};function iie(e){var t=JT(e);return{URI:Fr,_E:void 0,map:Ko,compact:Ul,separate:Bl,filter:$p,filterMap:_p,partition:Sp,partitionMap:Tp,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,traverse:t.traverse,sequence:t.sequence,mapWithIndex:jl,reduceWithIndex:t.reduceWithIndex,foldMapWithIndex:t.foldMapWithIndex,reduceRightWithIndex:t.reduceRightWithIndex,traverseWithIndex:t.traverseWithIndex,wilt:ni(t,zT),wither:ri(t,zT)}}var GT=function(e,t){var n=Os(e);return function(r){return function(i){if(Zi(i))return r;if(Zi(r))return i;for(var o=new Map,a=i.entries(),u;!(u=a.next()).done;){var s=u.value,c=s[0],l=s[1],f=n(c)(r);ht(f)?o.set(c,t.concat(l,f.value)):o.set(c,l)}for(var d=r.entries();!(u=d.next()).done;){var p=u.value,c=p[0],l=p[1],f=n(c)(o);xt(f)&&o.set(c,l)}return o}}},YT=function(e,t){var n=Os(e);return function(r){return function(i){if(Zi(i)||Zi(r))return cg;for(var o=new Map,a=i.entries(),u;!(u=a.next()).done;){var s=u.value,c=s[0],l=s[1],f=n(c)(r);ht(f)&&o.set(c,t.concat(l,f.value))}return o}}},ZT=function(e){var t=ug(e);return function(n){return function(r){if(Zi(r))return n;if(Zi(n))return r;for(var i=new Map,o=r.entries(),a;!(a=o.next()).done;){var u=a.value,s=u[0],c=u[1];t(s)(n)||i.set(s,c)}for(var l=n.entries();!(a=l.next()).done;){var f=a.value,s=f[0],c=f[1];t(s)(r)||i.set(s,c)}return i}}},oie=CF,aie={URI:Fr,map:Ko,compact:Ul,separate:Bl,filter:$p,filterMap:_p,partition:Sp,partitionMap:Tp};const uie=Object.freeze(Object.defineProperty({__proto__:null,fromMap:Nre,toMap:Pre,getShow:EF,size:RF,isEmpty:Zi,member:ug,elem:BT,keys:Ll,values:Fre,collect:MF,toReadonlyArray:xF,toUnfoldable:Dre,upsertAt:CF,deleteAt:AF,updateAt:Lre,modifyAt:kF,pop:jre,lookupWithKey:qo,lookup:Os,isSubmap:sg,empty:cg,getEq:WF,getMonoid:Ure,singleton:Bre,fromFoldable:zre,partitionMapWithIndex:NF,partitionWithIndex:PF,filterMapWithIndex:FF,filterWithIndex:DF,compact:Ul,filter:qre,filterMap:Kre,map:Vre,mapWithIndex:Hre,partition:Jre,partitionMap:Gre,separate:Bl,URI:Fr,getUnionSemigroup:zF,getUnionMonoid:Yre,getIntersectionSemigroup:Zre,getDifferenceMagma:Xre,getFilterableWithIndex:Qre,Functor:qF,flap:eie,getFunctorWithIndex:tie,Compactable:zT,Filterable:nie,reduce:qT,foldMap:KT,reduceRight:VT,getFoldable:lg,reduceWithIndex:fg,foldMapWithIndex:dg,reduceRightWithIndex:pg,getFoldableWithIndex:HT,getTraversable:rie,getTraversableWithIndex:JT,getWitherable:iie,union:GT,intersection:YT,difference:ZT,insertAt:oie,readonlyMap:aie},Symbol.toStringTag,{value:"Module"}));var zl=globalThis&&globalThis.__assign||function(){return zl=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},zl.apply(this,arguments)},sie=EF,cie=RF,Vo=Zi,lie=ug,fie=BT,XT=function(e){return function(t){return Array.from(t.keys()).sort(e.compare)}},die=function(e){return function(t){return Array.from(t.values()).sort(e.compare)}};function KF(e){var t=XT(e);return function(n){return function(r){for(var i=[],o=t(r),a=0,u=o;a<u.length;a++){var s=u[a];i.push(n(s,r.get(s)))}return i}}}function VF(e){return KF(e)(function(t,n){return[t,n]})}function pie(e,t){var n=VF(e);return function(r){var i=n(r),o=i.length;return t.unfold(0,function(a){return a<o?le([i[a],a+1]):me})}}var HF=function(e){var t=ws(e);return function(n,r){var i=t(n);return function(o){var a=i(o);if(xt(a)){var u=new Map(o);return u.set(n,r),u}else if(a.value[1]!==r){var u=new Map(o);return u.set(a.value[0],r),u}return o}}},JF=function(e){var t=ws(e);return function(n){return function(r){var i=t(n,r);if(ht(i)){var o=new Map(r);return o.delete(i.value[0]),o}return r}}},hie=function(e){var t=GF(e);return function(n,r){return t(n,function(){return r})}},GF=function(e){var t=ws(e);return function(n,r){return function(i){var o=t(n,i);if(xt(o))return me;var a=new Map(i);return a.set(o.value[0],r(o.value[1])),le(a)}}};function mie(e){var t=YF(e),n=JF(e);return function(r){var i=n(r);return function(o){return m(t(r,o),qi(function(a){return[a,i(o)]}))}}}function ws(e){return function(t,n){if(n===void 0){var r=ws(e);return function(c){return r(t,c)}}for(var i=n.entries(),o;!(o=i.next()).done;){var a=o.value,u=a[0],s=a[1];if(e.equals(u,t))return le([u,s])}return me}}var YF=Os,vie=sg,gie=WF;function yie(e,t){var n=ws(e);return{concat:function(r,i){if(Vo(r))return i;if(Vo(i))return r;for(var o=new Map(r),a=i.entries(),u;!(u=a.next()).done;){var s=u.value,c=s[0],l=s[1],f=n(c,r);ht(f)?o.set(f.value[0],t.concat(f.value[1],l)):o.set(c,l)}return o},empty:new Map}}var bie=function(e,t){return new Map([[e,t]])};function $ie(e,t,n){return function(r){var i=ws(e);return n.reduce(r,new Map,function(o,a){var u=a[0],s=a[1],c=i(u,o);return ht(c)?o.set(c.value[0],t.concat(c.value[1],s)):o.set(u,s),o})}}var Ip=function(e,t){for(var n=new Map,r=e.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],u=o[1];n.set(a,t(a,u))}return n},ZF=function(e){return function(t){for(var n=new Map,r=new Map,i=t.entries(),o;!(o=i.next()).done;){var a=o.value,u=a[0],s=a[1],c=e(u,s);Lt(c)?n.set(u,c.left):r.set(u,c.right)}return Oe(n,r)}};function XF(e){return function(t){for(var n=new Map,r=new Map,i=t.entries(),o;!(o=i.next()).done;){var a=o.value,u=a[0],s=a[1];e(u,s)?r.set(u,s):n.set(u,s)}return Oe(n,r)}}var QF=function(e){return function(t){for(var n=new Map,r=t.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],u=o[1],s=e(a,u);ht(s)&&n.set(a,s.value)}return n}};function eD(e){return function(t){for(var n=new Map,r=t.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],u=o[1];e(a,u)&&n.set(a,u)}return n}}var ql=function(e,t){return Ip(e,function(n,r){return t(r)})},hg=function(e,t){return tD(e,function(n,r){return t(r)})},mg=function(e,t){return nD(e,function(n,r){return t(r)})},vg=function(e,t){return rD(e,function(n,r){return t(r)})},gg=function(e,t){return iD(e,function(n,r){return t(r)})},tD=function(e,t){return m(e,eD(t))},nD=function(e,t){return m(e,QF(t))},rD=function(e,t){return m(e,XF(t))},iD=function(e,t){return m(e,ZF(t))},Op=function(e){for(var t=new Map,n=e.entries(),r;!(r=n.next()).done;){var i=r.value,o=i[0],a=i[1];ht(a)&&t.set(o,a.value)}return t},_ie=function(e){return function(t){return hg(t,e)}},Sie=function(e){return function(t){return mg(t,e)}},Tie=function(e){return function(t){return ql(t,e)}},Iie=function(e){return function(t){return Ip(t,e)}},Oie=function(e){return function(t){return vg(t,e)}},wie=function(e){return function(t){return gg(t,e)}},wp=function(e){for(var t=new Map,n=new Map,r=e.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],u=o[1];Lt(u)?t.set(a,u.left):n.set(a,u.right)}return Oe(t,n)},Ho="Map",oD=function(e,t){var n=lD(e,t);return{concat:function(r,i){return n(i)(r)}}},Eie=function(e,t){return{concat:oD(e,t).concat,empty:new Map}},Rie=function(e,t){var n=fD(e,t);return{concat:function(r,i){return n(i)(r)}}},Mie=function(e){return function(){var t=dD(e);return{concat:function(n,r){return t(r)(n)}}}};function xie(){return{URI:Ho,_E:void 0,map:ql,mapWithIndex:Ip,compact:Op,separate:wp,filter:hg,filterMap:mg,partition:vg,partitionMap:gg,partitionMapWithIndex:iD,partitionWithIndex:rD,filterMapWithIndex:nD,filterWithIndex:tD}}function Cie(e){var t=uD(e);return{URI:Ho,_E:void 0,map:ql,compact:Op,separate:wp,filter:hg,filterMap:mg,partition:vg,partitionMap:gg,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,traverse:t.traverse,sequence:t.sequence,mapWithIndex:Ip,reduceWithIndex:t.reduceWithIndex,foldMapWithIndex:t.foldMapWithIndex,reduceRightWithIndex:t.reduceRightWithIndex,traverseWithIndex:t.traverseWithIndex,wilt:ni(t,QT),wither:ri(t,QT)}}var Aie=qT,kie=KT,Wie=VT,Nie=function(e){return zl(zl({},lg(e)),{URI:Ho})},Pie=fg,Fie=dg,Die=pg,aD=function(e){return zl(zl({},HT(e)),{URI:Ho})},uD=function(e){var t=aD(e),n=XT(e),r=function(a){return function(u,s){for(var c=a.of(new Map),l=n(u),f=l.length,d=function(h){var v=l[h],y=u.get(v);c=a.ap(a.map(c,function(b){return function(w){return b.set(v,w)}}),s(v,y))},p=0;p<f;p++)d(p);return c}},i=function(a){var u=r(a);return function(s,c){return u(s,function(l,f){return c(f)})}},o=function(a){var u=r(a);return function(s){return u(s,function(c,l){return l})}};return{URI:Ho,_E:void 0,map:ql,mapWithIndex:Ip,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,reduceWithIndex:t.reduceWithIndex,foldMapWithIndex:t.foldMapWithIndex,reduceRightWithIndex:t.reduceRightWithIndex,traverse:i,sequence:o,traverseWithIndex:r}},sD={URI:Ho,map:ql},Lie=De(sD),QT={URI:Ho,compact:Op,separate:wp},cD={URI:Ho,map:ql,compact:Op,separate:wp,filter:hg,filterMap:mg,partition:vg,partitionMap:gg},yg=function(e){return new Map(e)},lD=function(e,t){var n=GT(e,t);return function(r){return function(i){return Vo(i)?yg(r):Vo(r)?yg(i):n(r)(i)}}},fD=function(e,t){var n=YT(e,t);return function(r){return function(i){return Vo(i)||Vo(r)?new Map:n(r)(i)}}},dD=function(e){var t=ZT(e);return function(n){return function(r){return Vo(r)?yg(n):Vo(n)?yg(r):t(n)(r)}}},jie=new Map,Uie=HF,Bie=cD;const zie=Object.freeze(Object.defineProperty({__proto__:null,getShow:sie,size:cie,isEmpty:Vo,member:lie,elem:fie,keys:XT,values:die,collect:KF,toArray:VF,toUnfoldable:pie,upsertAt:HF,deleteAt:JF,updateAt:hie,modifyAt:GF,pop:mie,lookupWithKey:ws,lookup:YF,isSubmap:vie,getEq:gie,getMonoid:yie,singleton:bie,fromFoldable:$ie,partitionMapWithIndex:ZF,partitionWithIndex:XF,filterMapWithIndex:QF,filterWithIndex:eD,compact:Op,filter:_ie,filterMap:Sie,map:Tie,mapWithIndex:Iie,partition:Oie,partitionMap:wie,separate:wp,URI:Ho,getUnionSemigroup:oD,getUnionMonoid:Eie,getIntersectionSemigroup:Rie,getDifferenceMagma:Mie,getFilterableWithIndex:xie,getWitherable:Cie,reduce:Aie,foldMap:kie,reduceRight:Wie,getFoldable:Nie,reduceWithIndex:Pie,foldMapWithIndex:Fie,reduceRightWithIndex:Die,getFoldableWithIndex:aD,getTraversableWithIndex:uD,Functor:sD,flap:Lie,Compactable:QT,Filterable:cD,union:lD,intersection:fD,difference:dD,empty:jie,insertAt:Uie,map_:Bie},Symbol.toStringTag,{value:"Module"})),qie=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Kie=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Vie=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Hie=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Jie=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var pD=function(e){return{concat:Em(e).concat,empty:e.top}},hD=function(e){return{concat:Rm(e).concat,empty:e.bottom}},eI=function(e){return{concat:T_(e).concat,empty:e.empty}},mD=function(e){var t={};for(var n in e)ot.call(e,n)&&(t[n]=e[n].empty);return{concat:I_(e).concat,empty:t}},vD=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return{concat:O_.apply(UC,e).concat,empty:e.map(function(n){return n.empty})}},gD=function(e){return E_(e)(e.empty)},Gie={concat:NC.concat,empty:void 0},Yie=vD,Zie=mD,Xie=eI,Qie=hD,eoe=pD,toe=gD,yD={concat:PC.concat,empty:!0},bD={concat:FC.concat,empty:!1},noe=KM,roe=function(){return eI(CN())},ioe={concat:DC.concat,empty:""},ooe={concat:LC.concat,empty:0},aoe={concat:jC.concat,empty:1};const uoe=Object.freeze(Object.defineProperty({__proto__:null,min:pD,max:hD,reverse:eI,struct:mD,tuple:vD,concatAll:gD,monoidVoid:Gie,getTupleMonoid:Yie,getStructMonoid:Zie,getDualMonoid:Xie,getJoinMonoid:Qie,getMeetMonoid:eoe,fold:toe,monoidAll:yD,monoidAny:bD,getFunctionMonoid:noe,getEndomorphismMonoid:roe,monoidString:ioe,monoidSum:ooe,monoidProduct:aoe},Symbol.toStringTag,{value:"Module"})),soe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var $D=function(e,t,n){return function(r){return r===-1?e():r===0?t():n()}},coe=$D,_D=function(e){return e===-1?1:e===1?-1:0},SD={equals:function(e,t){return e===t}},tI={concat:function(e,t){return e!==0?e:t}},TD={concat:tI.concat,empty:0},loe=function(e){return e<=-1?-1:e>=1?1:0},foe=_D,doe=tI,poe=SD,hoe=TD;const moe=Object.freeze(Object.defineProperty({__proto__:null,matchW:$D,match:coe,reverse:_D,Eq:SD,Semigroup:tI,Monoid:TD,sign:loe,invert:foe,semigroupOrdering:doe,eqOrdering:poe,monoidOrdering:hoe},Symbol.toStringTag,{value:"Module"}));var voe=function(e){return typeof e.map=="function"},goe=function(e){return typeof e.contramap=="function"},yoe=function(e){return typeof e.mapWithIndex=="function"},boe=function(e){return typeof e.ap=="function"},$oe=function(e){return typeof e.chain=="function"},_oe=function(e){return typeof e.bimap=="function"},Soe=function(e){return typeof e.extend=="function"},Toe=function(e){return typeof e.reduce=="function"},Ioe=function(e){return typeof e.reduceWithIndex=="function"},Ooe=function(e){return typeof e.alt=="function"},woe=function(e){return typeof e.compact=="function"},Eoe=function(e){return typeof e.filter=="function"},Roe=function(e){return typeof e.filterWithIndex=="function"},Moe=function(e){return typeof e.promap=="function"},xoe=function(e){return typeof e.compose=="function"},Coe=function(e){return typeof e.throwError=="function"};function Aoe(e){var t={};if(voe(e)){var n=function(S){return function(_){return e.map(_,S)}};t.map=n}if(goe(e)){var r=function(S){return function(_){return e.contramap(_,S)}};t.contramap=r}if(yoe(e)){var i=function(S){return function(_){return e.mapWithIndex(_,S)}};t.mapWithIndex=i}if(boe(e)){var o=function(S){return function(_){return e.ap(_,S)}},a=function(S){return function(_){return e.ap(e.map(_,function(U){return function(){return U}}),S)}};t.ap=o,t.apFirst=a,t.apSecond=function(S){return function(_){return e.ap(e.map(_,function(){return function(U){return U}}),S)}}}if($oe(e)){var u=function(S){return function(_){return e.chain(_,S)}},s=function(S){return function(_){return e.chain(_,function(U){return e.map(S(U),function(){return U})})}},c=function(S){return e.chain(S,B)};t.chain=u,t.chainFirst=s,t.flatten=c}if(_oe(e)){var l=function(S,_){return function(U){return e.bimap(U,S,_)}},f=function(S){return function(_){return e.mapLeft(_,S)}};t.bimap=l,t.mapLeft=f}if(Soe(e)){var d=function(S){return function(_){return e.extend(_,S)}},p=function(S){return e.extend(S,B)};t.extend=d,t.duplicate=p}if(Toe(e)){var h=function(S,_){return function(U){return e.reduce(U,S,_)}},v=function(S){var _=e.foldMap(S);return function(U){return function(Y){return _(Y,U)}}},y=function(S,_){return function(U){return e.reduceRight(U,S,_)}};t.reduce=h,t.foldMap=v,t.reduceRight=y}if(Ioe(e)){var b=function(S,_){return function(U){return e.reduceWithIndex(U,S,_)}},w=function(S){var _=e.foldMapWithIndex(S);return function(U){return function(Y){return _(Y,U)}}},F=function(S,_){return function(U){return e.reduceRightWithIndex(U,S,_)}};t.reduceWithIndex=b,t.foldMapWithIndex=w,t.reduceRightWithIndex=F}if(Ooe(e)){var g=function(S){return function(_){return e.alt(_,S)}};t.alt=g}if(woe(e)&&(t.compact=e.compact,t.separate=e.separate),Eoe(e)){var I=function(S){return function(_){return e.filter(_,S)}},T=function(S){return function(_){return e.filterMap(_,S)}},k=function(S){return function(_){return e.partition(_,S)}},E=function(S){return function(_){return e.partitionMap(_,S)}};t.filter=I,t.filterMap=T,t.partition=k,t.partitionMap=E}if(Roe(e)){var H=function(S){return function(_){return e.filterWithIndex(_,S)}},q=function(S){return function(_){return e.filterMapWithIndex(_,S)}},x=function(S){return function(_){return e.partitionWithIndex(_,S)}},J=function(S){return function(_){return e.partitionMapWithIndex(_,S)}};t.filterWithIndex=H,t.filterMapWithIndex=q,t.partitionWithIndex=x,t.partitionMapWithIndex=J}if(Moe(e)){var O=function(S,_){return function(U){return e.promap(U,S,_)}};t.promap=O}if(xoe(e)){var R=function(S){return function(_){return e.compose(_,S)}};t.compose=R}if(Coe(e)){var C=function(S){return function(_){return _._tag==="None"?e.throwError(S()):e.of(_.value)}},L=function(S){return S._tag==="Left"?e.throwError(S.left):e.of(S.right)},z=function(S,_){return function(U){return S(U)?e.of(U):e.throwError(_(U))}},j=function(S,_){return function(U){return e.chain(U,function(Y){return S(Y)?e.of(Y):e.throwError(_(Y))})}};t.fromOption=C,t.fromEither=L,t.fromPredicate=z,t.filterOrElse=j}return t}var ce=m;const koe=Object.freeze(Object.defineProperty({__proto__:null,pipeable:Aoe,pipe:ce},Symbol.toStringTag,{value:"Module"})),Woe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Noe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var bg=function(){return Math.random()};function ID(e,t){return m(bg,Gi(function(n){return Math.floor((t-e+1)*n+e)}))}function Poe(e,t){return m(bg,Gi(function(n){return(t-e)*n+e}))}var Foe=m(bg,Gi(function(e){return e<.5})),Doe=function(e){return m(ID(0,e.length-1),Gi(function(t){return e[t]}))};const Loe=Object.freeze(Object.defineProperty({__proto__:null,random:bg,randomInt:ID,randomRange:Poe,randomBool:Foe,randomElem:Doe},Symbol.toStringTag,{value:"Module"}));var nI=$l(Z0),OD=vs(Z0),wD=_l(Qt),joe=Sl(Qt),ED=Hi,RD=wD,MD=rp(Qt),Uoe=MD,rI=Rl(Do),Boe=rI,xD=rI,zoe=xD,CD=Ml(Do),qoe=CD,Koe=ap(Qt),Voe=up,AD=sp,Hoe=AD,kD=ys(Do),Joe=kD,WD=ip(Do),Goe=WD,Yoe=op(Do),Zoe=xl(Qt),Dr=function(e,t){return m(e,PD(t))},iI=function(e,t,n){return m(e,FD(t,n))},oI=function(e,t){return m(e,DD(t))},Kl=function(e,t){return m(e,aI(t))},Ep=function(e,t){return m(e,uI(t))},ND=function(e,t){return m(e,sI(t))},PD=Tl(Qt),FD=wl(Qt),DD=El(Qt),aI=Il(Fo),Xoe=aI,Xi=OD,uI=gs(Do),LD=uI,jD=LD(B),Qoe=jD,sI=Ol(Do),eae=sI,cI=nI,Bt="ReaderEither",UD=function(e){var t=ts(e);return{URI:Bt,_E:void 0,compact:Ki(Qt,t),separate:Co(Qt,t,za)}};function tae(e){var t=Bc(e),n=UD(e),r=Ao(Qt,t),i=ko(Qt,t),o=Qa(Qt,t),a=eu(Qt,t);return{URI:Bt,_E:void 0,map:Dr,compact:n.compact,separate:n.separate,filter:function(u,s){return m(u,r(s))},filterMap:function(u,s){return m(u,i(s))},partition:function(u,s){return m(u,o(s))},partitionMap:function(u,s){return m(u,a(s))}}}function BD(e){var t=So(Fo,Ba(e));return{URI:Bt,_E:void 0,map:Dr,ap:function(n,r){return m(n,t(r))},of:Xi}}function zD(e){var t=np(Do,e);return{URI:Bt,_E:void 0,map:Dr,alt:function(n,r){return m(n,t(r))}}}var lI={URI:Bt,map:Dr},nae=De(lI),rae={URI:Bt,of:Xi},Rp={URI:Bt,map:Dr,ap:Kl},qD=_t(Rp),iae=qD,KD=St(Rp),oae=KD,VD={URI:Bt,map:Dr,ap:Kl,of:Xi},Jo={URI:Bt,map:Dr,ap:Kl,chain:Ep},aae={URI:Bt,map:Dr,ap:Kl,of:Xi,chain:Ep},HD=at(Jo),uae=HD,sae={URI:Bt,bimap:iI,mapLeft:oI},cae={URI:Bt,map:Dr,alt:ND},Vl={URI:Bt,fromReader:RD},lae=lp(Vl),fae=fp(Vl),dae=_s(Vl),JD=dp(Vl,Jo),pae=JD,GD=pp(Vl,Jo),hae=GD,mae={URI:Bt,map:Dr,ap:Kl,of:Xi,chain:Ep,throwError:cI},Go={URI:Bt,fromEither:ED},vae=Di(Go),gae=Li(Go),yae=Xu(Go,Jo),YD=To(Go,Jo),bae=YD,ZD=Io(Go,Jo),$ae=ZD,_ae=Ua(Go),XD=Qu(Go,Jo),Sae=XD,Tae=ar(Go),Iae=Xi(jt),Oae=It(lI),QD=Ot(Jo),wae=QD,eL=Tt(Rp),Eae=eL,tL=Xi(Yt),nL=function(e){return Z($s(e),bs(Sd(Dn)))},fI=function(e){var t=nL(e);return function(n){return ft(n)?t(n):tL}},Rae=fI,rL=function(e){return fI(function(t,n){return e(n)})},Mae=rL(B),xae={URI:Bt,bimap:iI,mapLeft:oI,map:Dr,of:Xi,ap:Kl,chain:Ep,alt:ND,throwError:nI},Cae=Ut(Rp),Aae=Cr(VD),kae=function(e){return Ut(Fo)(yd(e))};function Wae(e){var t=BD(e),n=zD(e);return{URI:Bt,_E:void 0,map:Dr,ap:t.ap,of:Xi,chain:Ep,bimap:iI,mapLeft:oI,alt:n.alt,throwError:cI}}const Nae=Object.freeze(Object.defineProperty({__proto__:null,left:nI,right:OD,rightReader:wD,leftReader:joe,fromEither:ED,fromReader:RD,match:MD,matchW:Uoe,matchE:rI,fold:Boe,matchEW:xD,foldW:zoe,getOrElse:CD,getOrElseW:qoe,toUnion:Koe,local:Voe,asksReaderEitherW:AD,asksReaderEither:Hoe,orElse:kD,orElseW:Joe,orElseFirst:WD,orElseFirstW:Goe,orLeft:Yoe,swap:Zoe,map:PD,bimap:FD,mapLeft:DD,ap:aI,apW:Xoe,of:Xi,chain:uI,chainW:LD,flattenW:jD,flatten:Qoe,alt:sI,altW:eae,throwError:cI,URI:Bt,getCompactable:UD,getFilterable:tae,getApplicativeReaderValidation:BD,getAltReaderValidation:zD,Functor:lI,flap:nae,Pointed:rae,Apply:Rp,apFirst:qD,apFirstW:iae,apSecond:KD,apSecondW:oae,Applicative:VD,Chain:Jo,Monad:aae,chainFirst:HD,chainFirstW:uae,Bifunctor:sae,Alt:cae,FromReader:Vl,ask:lae,asks:fae,fromReaderK:dae,chainReaderK:JD,chainReaderKW:pae,chainFirstReaderK:GD,chainFirstReaderKW:hae,MonadThrow:mae,FromEither:Go,fromOption:vae,fromOptionK:gae,chainOptionK:yae,chainEitherK:YD,chainEitherKW:bae,chainFirstEitherK:ZD,chainFirstEitherKW:$ae,fromPredicate:_ae,filterOrElse:XD,filterOrElseW:Sae,fromEitherK:Tae,Do:Iae,bindTo:Oae,bind:QD,bindW:wae,apS:eL,apSW:Eae,ApT:tL,traverseReadonlyNonEmptyArrayWithIndex:nL,traverseReadonlyArrayWithIndex:fI,traverseArrayWithIndex:Rae,traverseArray:rL,sequenceArray:Mae,readerEither:xae,getApplySemigroup:Cae,getApplyMonoid:Aae,getSemigroup:kae,getReaderValidation:Wae},Symbol.toStringTag,{value:"Module"}));function dI(e){return function(t){return function(){return e.of(t)}}}function pI(e){return function(t){return function(n){return function(r){return e.map(n(r),t)}}}}function hI(e){return function(t){return function(n){return function(r){return e.ap(n(r),t(r))}}}}function mI(e){return function(t){return function(n){return function(r){return e.chain(n(r),function(i){return t(i)(r)})}}}}function vI(e){return function(t){return Z(t,e.of)}}function Pae(e){return function(t){return Z(t,e)}}function Fae(e){var t=hI(e),n=pI(e),r=mI(e);return{map:function(i,o){return m(i,n(o))},ap:function(i,o){return m(i,t(o))},of:dI(e),chain:function(i,o){return m(i,r(o))},ask:function(){return e.of},asks:function(i){return Z(i,e.of)},local:function(i,o){return function(a){return i(o(a))}},fromReader:vI(e),fromM:function(i){return function(){return i}}}}const Dae=Object.freeze(Object.defineProperty({__proto__:null,of:dI,map:pI,ap:hI,chain:mI,fromReader:vI,fromNaturalTransformation:Pae,getReaderM:Fae},Symbol.toStringTag,{value:"Module"}));var wn=function(e){return function(){return Promise.resolve().then(e)}};function Lae(e){return function(t){return function(){return new Promise(function(n){setTimeout(function(){Promise.resolve().then(t).then(n)},e)})}}}var pi=function(e,t){return m(e,iu(t))},Es=function(e,t){return m(e,iL(t))},gI=function(e,t){return m(e,Mp(function(n){return m(t,iu(n))}))},Hl=function(e,t){return m(e,Mp(t))},iu=function(e){return function(t){return function(){return Promise.resolve().then(t).then(e)}}},iL=function(e){return function(t){return function(){return Promise.all([Promise.resolve().then(t),Promise.resolve().then(e)]).then(function(n){var r=n[0],i=n[1];return r(i)})}}},vn=function(e){return function(){return Promise.resolve(e)}},Mp=function(e){return function(t){return function(){return Promise.resolve().then(t).then(function(n){return e(n)()})}}},jae=Mp(B),En="Task";function Uae(){return{concat:function(e,t){return function(){return Promise.race([Promise.resolve().then(e),Promise.resolve().then(t)])}},empty:aL}}var Pe={URI:En,map:pi},Bae=De(Pe),en={URI:En,of:vn},Rs={URI:En,map:pi,ap:Es},zae=_t(Rs),qae=St(Rs),xp={URI:En,map:pi,ap:Es,of:vn},$g={URI:En,map:pi,ap:gI},oL={URI:En,map:pi,ap:gI,of:vn},Jl={URI:En,map:pi,ap:Es,chain:Hl},zt={URI:En,map:pi,of:vn,ap:Es,chain:Hl},Kae={URI:En,map:pi,of:vn,ap:Es,chain:Hl,fromIO:wn},Cp=B,Vae={URI:En,map:pi,of:vn,ap:Es,chain:Hl,fromIO:wn,fromTask:Cp},Hae=at(Jl),_g={URI:En,fromIO:wn},Jae=Vi(_g),Gae=Wo(_g,Jl),Yae=No(_g,Jl),Zae={URI:En,fromIO:wn,fromTask:Cp},aL=function(){return new Promise(function(e){})},Xae=vn(jt),Qae=It(Pe),eue=Ot(Jl),tue=Tt(Rs),yI=vn(Yt),Gl=function(e){return function(t){return function(){return Promise.all(t.map(function(n,r){return Promise.resolve().then(function(){return e(r,n)()})}))}}},bI=function(e){var t=Gl(e);return function(n){return ft(n)?t(n):yI}},$I=function(e){return function(t){return function(){return Dc(t).reduce(function(n,r,i){return n.then(function(o){return Promise.resolve().then(e(i+1,r)).then(function(a){return o.push(a),o})})},Promise.resolve().then(e(0,or(t))).then(dd))}}},_I=function(e){var t=$I(e);return function(n){return ft(n)?t(n):yI}},nue=bI,uL=function(e){return bI(function(t,n){return e(n)})},rue=uL(B),iue=_I,sL=function(e){return _I(function(t,n){return e(n)})},oue=sL(B),aue={URI:En,map:pi,of:vn,ap:Es,chain:Hl,fromIO:wn,fromTask:Cp},uue={URI:En,map:pi,of:vn,ap:gI,chain:Hl,fromIO:wn,fromTask:Cp},sue=Ut($g),cue=Cr(oL);const lue=Object.freeze(Object.defineProperty({__proto__:null,fromIO:wn,delay:Lae,map:iu,ap:iL,of:vn,chain:Mp,flatten:jae,URI:En,getRaceMonoid:Uae,Functor:Pe,flap:Bae,Pointed:en,ApplyPar:Rs,apFirst:zae,apSecond:qae,ApplicativePar:xp,ApplySeq:$g,ApplicativeSeq:oL,Chain:Jl,Monad:zt,MonadIO:Kae,fromTask:Cp,MonadTask:Vae,chainFirst:Hae,FromIO:_g,fromIOK:Jae,chainIOK:Gae,chainFirstIOK:Yae,FromTask:Zae,never:aL,Do:Xae,bindTo:Qae,bind:eue,apS:tue,ApT:yI,traverseReadonlyNonEmptyArrayWithIndex:Gl,traverseReadonlyArrayWithIndex:bI,traverseReadonlyNonEmptyArrayWithIndexSeq:$I,traverseReadonlyArrayWithIndexSeq:_I,traverseArrayWithIndex:nue,traverseArray:uL,sequenceArray:rue,traverseSeqArrayWithIndex:iue,traverseSeqArray:sL,sequenceSeqArray:oue,task:aue,taskSeq:uue,getSemigroup:sue,getMonoid:cue},Symbol.toStringTag,{value:"Module"}));var cL=vI(en),Yl=Hi,Ms=Z(wn,Yl),fue=up,lL=sp,due=lL,hi=function(e,t){return m(e,TI(t))},xs=function(e,t){return m(e,II(t))},SI=function(e,t){return m(e,Sg(function(n){return m(t,TI(n))}))},Zl=function(e,t){return m(e,Sg(t))},TI=pI(Pe),II=hI(Rs),pue=II,Lr=dI(en),Sg=mI(zt),fL=Sg,dL=fL(B),hue=dL,gn="ReaderTask",tn={URI:gn,map:hi},mue=De(tn),Ap={URI:gn,of:Lr},kp={URI:gn,map:hi,ap:xs},vue=_t(kp),gue=St(kp),yue={URI:gn,map:hi,ap:xs,of:Lr},OI={URI:gn,map:hi,ap:SI},pL={URI:gn,map:hi,ap:SI,of:Lr},Qi={URI:gn,map:hi,ap:xs,chain:Zl},Yo={URI:gn,map:hi,of:Lr,ap:xs,chain:Zl},bue={URI:gn,map:hi,of:Lr,ap:xs,chain:Zl,fromIO:Ms},$ue={URI:gn,map:hi,of:Lr,ap:xs,chain:Zl,fromIO:Ms,fromTask:Yl},hL=at(Qi),_ue=hL,Tg={URI:gn,fromIO:Ms},Sue=Vi(Tg),Tue=Wo(Tg,Qi),Iue=No(Tg,Qi),Xl={URI:gn,fromReader:cL},Oue=lp(Xl),wue=fp(Xl),Eue=_s(Xl),mL=dp(Xl,Qi),Rue=mL,vL=pp(Xl,Qi),Mue=vL,Ig={URI:gn,fromIO:Ms,fromTask:Yl},xue=Ss(Ig),Cue=Cl(Ig,Qi),Aue=Al(Ig,Qi),kue=Lr(jt),Wue=It(tn),gL=Ot(Qi),Nue=gL,yL=Tt(kp),Pue=yL,wI=Lr(Yt),bL=function(e){return Z($s(e),bs(Gl(Dn)))},EI=function(e){var t=bL(e);return function(n){return ft(n)?t(n):wI}},$L=function(e){return Z($s(e),bs($I(Dn)))},RI=function(e){var t=$L(e);return function(n){return ft(n)?t(n):wI}},Fue=EI,_L=function(e){return EI(function(t,n){return e(n)})},Due=_L(B),Lue=RI,SL=function(e){return RI(function(t,n){return e(n)})},jue=SL(B),Uue={URI:gn,map:hi,of:Lr,ap:xs,chain:Zl,fromIO:Ms,fromTask:Yl},Bue={URI:gn,map:hi,of:Lr,ap:SI,chain:Zl,fromIO:Ms,fromTask:Yl},zue=Ut(OI),que=Cr(pL);function Kue(e,t){return e(t)()}const Vue=Object.freeze(Object.defineProperty({__proto__:null,fromReader:cL,fromTask:Yl,fromIO:Ms,local:fue,asksReaderTaskW:lL,asksReaderTask:due,map:TI,ap:II,apW:pue,of:Lr,chain:Sg,chainW:fL,flattenW:dL,flatten:hue,URI:gn,Functor:tn,flap:mue,Pointed:Ap,ApplyPar:kp,apFirst:vue,apSecond:gue,ApplicativePar:yue,ApplySeq:OI,ApplicativeSeq:pL,Chain:Qi,Monad:Yo,MonadIO:bue,MonadTask:$ue,chainFirst:hL,chainFirstW:_ue,FromIO:Tg,fromIOK:Sue,chainIOK:Tue,chainFirstIOK:Iue,FromReader:Xl,ask:Oue,asks:wue,fromReaderK:Eue,chainReaderK:mL,chainReaderKW:Rue,chainFirstReaderK:vL,chainFirstReaderKW:Mue,FromTask:Ig,fromTaskK:xue,chainTaskK:Cue,chainFirstTaskK:Aue,Do:kue,bindTo:Wue,bind:gL,bindW:Nue,apS:yL,apSW:Pue,ApT:wI,traverseReadonlyNonEmptyArrayWithIndex:bL,traverseReadonlyArrayWithIndex:EI,traverseReadonlyNonEmptyArrayWithIndexSeq:$L,traverseReadonlyArrayWithIndexSeq:RI,traverseArrayWithIndex:Fue,traverseArray:_L,sequenceArray:Due,traverseSeqArrayWithIndex:Lue,traverseSeqArray:SL,sequenceSeqArray:jue,readerTask:Uue,readerTaskSeq:Bue,getSemigroup:zue,getMonoid:que,run:Kue},Symbol.toStringTag,{value:"Module"}));var Hue=globalThis&&globalThis.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function u(l){try{c(r.next(l))}catch(f){a(f)}}function s(l){try{c(r.throw(l))}catch(f){a(f)}}function c(l){l.done?o(l.value):i(l.value).then(u,s)}c((r=r.apply(e,t||[])).next())})},Jue=globalThis&&globalThis.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(c){return function(l){return s([c,l])}}function s(c){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1],o=c;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(c);break}o[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(l){c=[6,l],i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},MI=$l(en),xI=vs(en),Og=_l(Pe),CI=Sl(Pe),AI=Z(wn,Og),TL=Z(wn,CI),ou=AI,Ql=Og,kI=vn,WI=wn,IL=function(e){return iu(px(e))},OL=rp(Pe),Gue=OL,NI=Rl(zt),Yue=NI,wL=NI,Zue=wL,EL=Ml(zt),Xue=EL,RL=function(e,t){return function(){return Hue(void 0,void 0,void 0,function(){var n;return Jue(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e().then(ja)];case 1:return[2,r.sent()];case 2:return n=r.sent(),[2,_o(t(n))];case 3:return[2]}})})}},Que=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return RL(function(){return e.apply(void 0,n)},t)}},ese=ap(Pe),tse=Nv(en),nse=Pv(en),rse=B0(zt),ML=ys(zt),ise=ML,wg=ip(zt),ose=wg,ase=function(e){return wg(HL(e))},use=function(e){return wg(JL(e))},sse=op(zt),cse=xl(Pe),xL=function(e){var t=IL(e);return function(n){return Z(n,t)}},CL=function(e){return function(t){return function(n){return m(n,Wp(xL(e)(t)))}}},lse=CL,AL=function(e){return Z(e,WI)},kL=function(e){return Np(AL(e))},fse=kL,nn=function(e,t){return m(e,DI(t))},au=function(e,t){return m(e,LI(t))},PI=function(e,t){return m(e,Wp(function(n){return m(t,DI(n))}))},uu=function(e,t){return m(e,Wp(t))},Eg=function(e,t,n){return m(e,WL(t,n))},Rg=function(e,t){return m(e,NL(t))},FI=function(e,t){return m(e,jI(t))},DI=Tl(Pe),WL=wl(Pe),NL=El(Pe),LI=Il(Rs),dse=LI,Wp=gs(zt),Np=Wp,PL=Np(B),pse=PL,jI=Ol(zt),hse=jI,zn=xI,Pp=MI,dt="TaskEither";function UI(e,t){var n=So(e,Ba(t));return{URI:dt,_E:void 0,map:nn,ap:function(r,i){return m(r,n(i))},of:zn}}function FL(e){var t=np(zt,e);return{URI:dt,_E:void 0,map:nn,alt:function(n,r){return m(n,t(r))}}}var DL=function(e){var t=ts(e);return{URI:dt,_E:void 0,compact:Ki(Pe,t),separate:Co(Pe,t,za)}};function mse(e){var t=Bc(e),n=DL(e),r=Ao(Pe,t),i=ko(Pe,t),o=Qa(Pe,t),a=eu(Pe,t);return{URI:dt,_E:void 0,map:nn,compact:n.compact,separate:n.separate,filter:function(u,s){return m(u,r(s))},filterMap:function(u,s){return m(u,i(s))},partition:function(u,s){return m(u,o(s))},partitionMap:function(u,s){return m(u,a(s))}}}var BI={URI:dt,map:nn},vse=De(BI),gse={URI:dt,of:zn},Mg={URI:dt,map:nn,ap:au},LL=_t(Mg),yse=LL,jL=St(Mg),bse=jL,$se={URI:dt,map:nn,ap:au,of:zn},UL={URI:dt,map:nn,ap:PI},BL={URI:dt,map:nn,ap:PI,of:zn},mi={URI:dt,map:nn,ap:au,chain:uu},_se={URI:dt,map:nn,ap:au,chain:uu,of:zn},Sse={URI:dt,map:nn,ap:au,chain:uu,of:zn,fromIO:ou},Tse={URI:dt,map:nn,ap:au,chain:uu,of:zn,fromIO:ou,fromTask:Ql},Ise={URI:dt,map:nn,ap:au,chain:uu,of:zn,throwError:Pp},zL=at(mi),Ose=zL,wse={URI:dt,bimap:Eg,mapLeft:Rg},Ese={URI:dt,map:nn,alt:FI},Zo={URI:dt,fromEither:kI},Rse=Di(Zo),Mse=Li(Zo),xse=Xu(Zo,mi),qL=To(Zo,mi),Cse=qL,KL=Io(Zo,mi),Ase=KL,kse=Ua(Zo),VL=Qu(Zo,mi),Wse=VL,Nse=ar(Zo),xg={URI:dt,fromIO:ou},HL=Vi(xg),Pse=Wo(xg,mi),Fse=No(xg,mi),Cg={URI:dt,fromIO:ou,fromTask:Ql},JL=Ss(Cg),Dse=Cl(Cg,mi),Lse=Al(Cg,mi);function jse(e){return function(){var t=Array.prototype.slice.call(arguments);return function(){return new Promise(function(n){var r=function(i,o){return i!=null?n(_o(i)):n(ja(o))};e.apply(null,t.concat(r))})}}}var Use=function(e,t,n){return zI(e,t,n)},zI=function(e,t,n){return m(e,Np(function(r){return m(t(r),Mp(function(i){return m(n(r,i),Np(function(){return vn(i)}))}))}))},Bse=zn(jt),zse=It(BI),GL=Ot(mi),qse=GL,YL=Tt(Mg),Kse=YL,qI=zn(Yt),KI=function(e){return Z(Gl(e),iu(Sd(Dn)))},VI=function(e){var t=KI(e);return function(n){return ft(n)?t(n):qI}},HI=function(e){return function(t){return function(){return Dc(t).reduce(function(n,r,i){return n.then(function(o){return Lt(o)?n:e(i+1,r)().then(function(a){return Lt(a)?a:(o.right.push(a.right),o)})})},e(0,or(t))().then(ns(dd)))}}},JI=function(e){var t=HI(e);return function(n){return ft(n)?t(n):qI}},Vse=VI,ZL=function(e){return VI(function(t,n){return e(n)})},Hse=ZL(B),Jse=JI,XL=function(e){return JI(function(t,n){return e(n)})},Gse=XL(B),Yse={URI:dt,bimap:Eg,mapLeft:Rg,map:nn,of:zn,ap:au,chain:uu,alt:FI,fromIO:ou,fromTask:Ql,throwError:Pp},Zse={URI:dt,bimap:Eg,mapLeft:Rg,map:nn,of:zn,ap:PI,chain:uu,alt:FI,fromIO:ou,fromTask:Ql,throwError:Pp},Xse=Ut(UL),Qse=Cr(BL),ece=function(e){return Ut($g)(yd(e))};function tce(e){var t=UI(xp,e),n=FL(e);return{URI:dt,_E:void 0,map:nn,ap:t.ap,of:zn,chain:uu,bimap:Eg,mapLeft:Rg,alt:n.alt,fromIO:ou,fromTask:Ql,throwError:Pp}}const nce=Object.freeze(Object.defineProperty({__proto__:null,left:MI,right:xI,rightTask:Og,leftTask:CI,rightIO:AI,leftIO:TL,fromIO:ou,fromTask:Ql,fromEither:kI,fromIOEither:WI,fromTaskOption:IL,match:OL,matchW:Gue,matchE:NI,fold:Yue,matchEW:wL,foldW:Zue,getOrElse:EL,getOrElseW:Xue,tryCatch:RL,tryCatchK:Que,toUnion:ese,fromNullable:tse,fromNullableK:nse,chainNullableK:rse,orElse:ML,orElseW:ise,orElseFirst:wg,orElseFirstW:ose,orElseFirstIOK:ase,orElseFirstTaskK:use,orLeft:sse,swap:cse,fromTaskOptionK:xL,chainTaskOptionKW:CL,chainTaskOptionK:lse,fromIOEitherK:AL,chainIOEitherKW:kL,chainIOEitherK:fse,map:DI,bimap:WL,mapLeft:NL,ap:LI,apW:dse,chain:Wp,chainW:Np,flattenW:PL,flatten:pse,alt:jI,altW:hse,of:zn,throwError:Pp,URI:dt,getApplicativeTaskValidation:UI,getAltTaskValidation:FL,getCompactable:DL,getFilterable:mse,Functor:BI,flap:vse,Pointed:gse,ApplyPar:Mg,apFirst:LL,apFirstW:yse,apSecond:jL,apSecondW:bse,ApplicativePar:$se,ApplySeq:UL,ApplicativeSeq:BL,Chain:mi,Monad:_se,MonadIO:Sse,MonadTask:Tse,MonadThrow:Ise,chainFirst:zL,chainFirstW:Ose,Bifunctor:wse,Alt:Ese,FromEither:Zo,fromOption:Rse,fromOptionK:Mse,chainOptionK:xse,chainEitherK:qL,chainEitherKW:Cse,chainFirstEitherK:KL,chainFirstEitherKW:Ase,fromPredicate:kse,filterOrElse:VL,filterOrElseW:Wse,fromEitherK:Nse,FromIO:xg,fromIOK:HL,chainIOK:Pse,chainFirstIOK:Fse,FromTask:Cg,fromTaskK:JL,chainTaskK:Dse,chainFirstTaskK:Lse,taskify:jse,bracket:Use,bracketW:zI,Do:Bse,bindTo:zse,bind:GL,bindW:qse,apS:YL,apSW:Kse,ApT:qI,traverseReadonlyNonEmptyArrayWithIndex:KI,traverseReadonlyArrayWithIndex:VI,traverseReadonlyNonEmptyArrayWithIndexSeq:HI,traverseReadonlyArrayWithIndexSeq:JI,traverseArrayWithIndex:Vse,traverseArray:ZL,sequenceArray:Hse,traverseSeqArrayWithIndex:Jse,traverseSeqArray:XL,sequenceSeqArray:Gse,taskEither:Yse,taskEitherSeq:Zse,getApplySemigroup:Xse,getApplyMonoid:Qse,getSemigroup:ece,getTaskValidation:tce},Symbol.toStringTag,{value:"Module"}));var su=Hi,Ag=$l(Ap),GI=vs(Ap),YI=Z(Og,su),QL=Z(CI,su),ZI=function(e){return Z(e,xI)},ej=function(e){return Z(e,MI)},tj=_l(tn),rce=Sl(tn),XI=Z(AI,su),nj=Z(TL,su),rj=Lr,ij=ZI,cu=XI,ef=YI,QI=Z(WI,su),eO=function(e){return Z(e,kI)},oj=rp(tn),ice=oj,tO=Rl(Qi),oce=tO,aj=tO,ace=aj,uj=Ml(Yo),uce=uj,sce=ap(tn),cce=Nv(Ap),lce=Pv(Ap),fce=B0(Yo),dce=up,sj=sp,pce=sj,cj=ys(Yo),hce=cj,lj=ip(Yo),mce=lj,vce=op(Yo),gce=xl(tn),fj=function(e){return Z(e,QI)},dj=function(e){return tf(fj(e))},yce=dj,nO=function(e){return Z(e,su)},pj=function(e){return tf(nO(e))},bce=pj,hj=function(e){return Dg(nO(e))},$ce=hj,rO=function(e){return Z(e,eO)},mj=function(e){return tf(rO(e))},_ce=mj,vj=function(e){return Dg(rO(e))},Sce=vj,rn=function(e,t){return m(e,Fp(t))},lu=function(e,t){return m(e,sO(t))},iO=function(e,t){return m(e,Ng(function(n){return m(t,Fp(n))}))},fu=function(e,t){return m(e,Ng(t))},oO=function(e,t){return m(e,Pg(t))},kg=function(e,t,n){return m(e,aO(t,n))},Wg=function(e,t){return m(e,uO(t))},Fp=Tl(tn),aO=wl(tn),uO=El(tn),sO=Il(kp),Tce=sO,qn=GI,Ng=gs(Yo),tf=Ng,gj=tf(B),Ice=gj,Pg=Ol(Yo),yj=Pg,Dp=Ag,ct="ReaderTaskEither",bj=function(e){var t=ts(e);return{URI:ct,_E:void 0,compact:Ki(tn,t),separate:Co(tn,t,za)}};function Oce(e){var t=Bc(e),n=bj(e),r=Ao(tn,t),i=ko(tn,t),o=Qa(tn,t),a=eu(tn,t);return{URI:ct,_E:void 0,map:rn,compact:n.compact,separate:n.separate,filter:function(u,s){return m(u,r(s))},filterMap:function(u,s){return m(u,i(s))},partition:function(u,s){return m(u,o(s))},partitionMap:function(u,s){return m(u,a(s))}}}function $j(e,t){var n=So(Fo,UI(e,t));return{URI:ct,_E:void 0,map:rn,ap:function(r,i){return m(r,n(i))},of:qn}}function _j(e){var t=np(Yo,e);return{URI:ct,_E:void 0,map:rn,alt:function(n,r){return m(n,t(r))}}}var Cs={URI:ct,map:rn},wce=De(Cs),cO={URI:ct,of:qn},Fg={URI:ct,map:rn,ap:lu},Sj=_t(Fg),Ece=Sj,Tj=St(Fg),Rce=Tj,Mce={URI:ct,map:rn,ap:lu,of:qn},Ij={URI:ct,map:rn,ap:iO},Oj={URI:ct,map:rn,ap:iO,of:qn},Rn={URI:ct,map:rn,ap:lu,chain:fu},xce={URI:ct,map:rn,ap:lu,chain:fu,of:qn},Cce={URI:ct,map:rn,ap:lu,chain:fu,of:qn,fromIO:cu},Ace={URI:ct,map:rn,ap:lu,chain:fu,of:qn,fromIO:cu,fromTask:ef},kce={URI:ct,map:rn,ap:lu,chain:fu,of:qn,throwError:Dp},wj=at(Rn),Dg=wj,Wce={URI:ct,bimap:kg,mapLeft:Wg},Nce={URI:ct,map:rn,alt:oO},nf={URI:ct,fromReader:ij},Pce=lp(nf),Fce=fp(nf),Dce=_s(nf),Ej=dp(nf,Rn),Lce=Ej,Rj=pp(nf,Rn),jce=Rj,lO=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return tj(e.apply(void 0,t))}},Mj=function(e){return tf(lO(e))},Uce=Mj,xj=function(e){return Dg(lO(e))},Bce=xj,Xo={URI:ct,fromEither:rj},zce=Di(Xo),qce=Li(Xo),Kce=Xu(Xo,Rn),Cj=To(Xo,Rn),Vce=Cj,Aj=Io(Xo,Rn),Hce=Aj,Jce=Ua(Xo),kj=Qu(Xo,Rn),Gce=kj,Yce=ar(Xo),Lg={URI:ct,fromIO:cu},Zce=Vi(Lg),Xce=Wo(Lg,Rn),Qce=No(Lg,Rn),jg={URI:ct,fromIO:cu,fromTask:ef},ele=Ss(jg),tle=Cl(jg,Rn),nle=Al(jg,Rn);function rle(e,t,n){return Wj(e,t,n)}function Wj(e,t,n){return function(r){return zI(e(r),function(i){return t(i)(r)},function(i,o){return n(i,o)(r)})}}var ile=qn(jt),ole=It(Cs),Nj=Ot(Rn),ale=Nj,Pj=Tt(Fg),ule=Pj,fO=qn(Yt),Fj=function(e){return Z($s(e),bs(KI(Dn)))},dO=function(e){var t=Fj(e);return function(n){return ft(n)?t(n):fO}},Dj=function(e){return Z($s(e),bs(HI(Dn)))},pO=function(e){var t=Dj(e);return function(n){return ft(n)?t(n):fO}},sle=dO,Lj=function(e){return dO(function(t,n){return e(n)})},cle=Lj(B),lle=pO,jj=function(e){return pO(function(t,n){return e(n)})},fle=jj(B),dle={URI:ct,map:rn,of:qn,ap:lu,chain:fu,alt:oO,bimap:kg,mapLeft:Wg,fromIO:cu,fromTask:ef,throwError:Dp},ple={URI:ct,map:rn,of:qn,ap:iO,chain:fu,alt:oO,bimap:kg,mapLeft:Wg,fromIO:cu,fromTask:ef,throwError:Dp},hle=Ut(Ij),mle=Cr(Oj),vle=function(e){return Ut(OI)(yd(e))};function gle(e){var t=$j(xp,e),n=_j(e);return{URI:ct,_E:void 0,map:rn,of:qn,chain:fu,bimap:kg,mapLeft:Wg,ap:t.ap,alt:n.alt,fromIO:cu,fromTask:ef,throwError:Dp}}function yle(e,t){return e(t)()}const ble=Object.freeze(Object.defineProperty({__proto__:null,fromTaskEither:su,left:Ag,right:GI,rightTask:YI,leftTask:QL,rightReader:ZI,leftReader:ej,rightReaderTask:tj,leftReaderTask:rce,rightIO:XI,leftIO:nj,fromEither:rj,fromReader:ij,fromIO:cu,fromTask:ef,fromIOEither:QI,fromReaderEither:eO,match:oj,matchW:ice,matchE:tO,fold:oce,matchEW:aj,foldW:ace,getOrElse:uj,getOrElseW:uce,toUnion:sce,fromNullable:cce,fromNullableK:lce,chainNullableK:fce,local:dce,asksReaderTaskEitherW:sj,asksReaderTaskEither:pce,orElse:cj,orElseW:hce,orElseFirst:lj,orElseFirstW:mce,orLeft:vce,swap:gce,fromIOEitherK:fj,chainIOEitherKW:dj,chainIOEitherK:yce,fromTaskEitherK:nO,chainTaskEitherKW:pj,chainTaskEitherK:bce,chainFirstTaskEitherKW:hj,chainFirstTaskEitherK:$ce,fromReaderEitherK:rO,chainReaderEitherKW:mj,chainReaderEitherK:_ce,chainFirstReaderEitherKW:vj,chainFirstReaderEitherK:Sce,map:Fp,bimap:aO,mapLeft:uO,ap:sO,apW:Tce,of:qn,chain:Ng,chainW:tf,flattenW:gj,flatten:Ice,alt:Pg,altW:yj,throwError:Dp,URI:ct,getCompactable:bj,getFilterable:Oce,getApplicativeReaderTaskValidation:$j,getAltReaderTaskValidation:_j,Functor:Cs,flap:wce,Pointed:cO,ApplyPar:Fg,apFirst:Sj,apFirstW:Ece,apSecond:Tj,apSecondW:Rce,ApplicativePar:Mce,ApplySeq:Ij,ApplicativeSeq:Oj,Chain:Rn,Monad:xce,MonadIO:Cce,MonadTask:Ace,MonadThrow:kce,chainFirst:wj,chainFirstW:Dg,Bifunctor:Wce,Alt:Nce,FromReader:nf,ask:Pce,asks:Fce,fromReaderK:Dce,chainReaderK:Ej,chainReaderKW:Lce,chainFirstReaderK:Rj,chainFirstReaderKW:jce,fromReaderTaskK:lO,chainReaderTaskKW:Mj,chainReaderTaskK:Uce,chainFirstReaderTaskKW:xj,chainFirstReaderTaskK:Bce,FromEither:Xo,fromOption:zce,fromOptionK:qce,chainOptionK:Kce,chainEitherK:Cj,chainEitherKW:Vce,chainFirstEitherK:Aj,chainFirstEitherKW:Hce,fromPredicate:Jce,filterOrElse:kj,filterOrElseW:Gce,fromEitherK:Yce,FromIO:Lg,fromIOK:Zce,chainIOK:Xce,chainFirstIOK:Qce,FromTask:jg,fromTaskK:ele,chainTaskK:tle,chainFirstTaskK:nle,bracket:rle,bracketW:Wj,Do:ile,bindTo:ole,bind:Nj,bindW:ale,apS:Pj,apSW:ule,ApT:fO,traverseReadonlyNonEmptyArrayWithIndex:Fj,traverseReadonlyArrayWithIndex:dO,traverseReadonlyNonEmptyArrayWithIndexSeq:Dj,traverseReadonlyArrayWithIndexSeq:pO,traverseArrayWithIndex:sle,traverseArray:Lj,sequenceArray:cle,traverseSeqArrayWithIndex:lle,traverseSeqArray:jj,sequenceSeqArray:fle,readerTaskEither:dle,readerTaskEitherSeq:ple,getApplySemigroup:hle,getApplyMonoid:mle,getSemigroup:vle,getReaderTaskValidation:gle,run:yle},Symbol.toStringTag,{value:"Module"}));var Uj={equals:function(e,t){return e===t}},Bj={concat:function(e,t){return e+t}},zj="",$le={concat:Bj.concat,empty:zj},G={equals:Uj.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},_le={show:function(e){return JSON.stringify(e)}},Sle=function(e){return typeof e=="string"},Tle=function(e){return e.toUpperCase()},Ile=function(e){return e.toLowerCase()},Ole=function(e,t){return function(n){return n.replace(e,t)}},wle=function(e){return e.trim()},Ele=function(e){return e.trimLeft()},Rle=function(e){return e.trimRight()},Mle=function(e,t){return function(n){return n.slice(e,t)}},xle=function(e){return e.length===0},Cle=function(e){return e.length},Ale=function(e){return function(t){var n=t.split(e);return Bi(n)?n:[t]}},kle=function(e,t){return function(n){return n.includes(e,t)}},Wle=function(e,t){return function(n){return n.startsWith(e,t)}},Nle=function(e,t){return function(n){return n.endsWith(e,t)}};const Ple=Object.freeze(Object.defineProperty({__proto__:null,Eq:Uj,Semigroup:Bj,empty:zj,Monoid:$le,Ord:G,Show:_le,isString:Sle,toUpperCase:Tle,toLowerCase:Ile,replace:Ole,trim:wle,trimLeft:Ele,trimRight:Rle,slice:Mle,isEmpty:xle,size:Cle,split:Ale,includes:kle,startsWith:Wle,endsWith:Nle},Symbol.toStringTag,{value:"Module"}));var Fle=function(e){return Object.assign({},e)},Dle=function(e){return Object.assign({},e)},qj=function(e){return Object.keys(e).length},vi=function(e){for(var t in e)if(ot.call(e,t))return!1;return!0},rf=function(e){return function(t){return Object.keys(t).sort(e.compare)}},Lle=rf(G);function Ug(e){if(typeof e=="function")return Ug(G)(e);var t=rf(e);return function(n){return function(r){for(var i=[],o=0,a=t(r);o<a.length;o++){var u=a[o];i.push(n(u,r[u]))}return i}}}var Lp=Ug(G)(function(e,t){return[e,t]});function jle(e){return function(t){var n=Lp(t),r=n.length;return e.unfold(0,function(i){return i<r?le([n[i],i+1]):me})}}var hO=function(e,t){return function(n){if(ot.call(n,e)&&n[e]===t)return n;var r=Object.assign({},n);return r[e]=t,r}},Qo=function(e,t){return ot.call(t,e)};function Bg(e){return function(t){if(!ot.call(t,e))return t;var n=Object.assign({},t);return delete n[e],n}}var Ule=function(e,t){return function(n){if(!Qo(e,n))return me;if(n[e]===t)return le(n);var r=Object.assign({},n);return r[e]=t,le(r)}},Ble=function(e,t){return function(n){if(!Qo(e,n))return me;var r=t(n[e]);if(r===n[e])return le(n);var i=Object.assign({},n);return i[e]=r,le(i)}};function zle(e){var t=Bg(e);return function(n){var r=As(e,n);return xt(r)?me:le([r.value,t(n)])}}function zg(e){return function(t,n){if(n===void 0){var r=zg(e);return function(o){return r(o,t)}}for(var i in t)if(!ot.call(n,i)||!e.equals(t[i],n[i]))return!1;return!0}}function As(e,t){return t===void 0?function(n){return As(e,n)}:ot.call(t,e)?le(t[e]):me}var jp={};function qg(e){return function(t){var n={};for(var r in t)ot.call(t,r)&&(n[r]=e(r,t[r]));return n}}function mO(e){return qg(function(t,n){return e(n)})}function of(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===2)return of(G).apply(void 0,e);var n=rf(e[0]);return function(r,i){return function(o){for(var a=r,u=n(o),s=u.length,c=0;c<s;c++){var l=u[c];a=i(l,a,o[l])}return a}}}function af(e){if("compare"in e){var t=rf(e);return function(n){return function(r){return function(i){for(var o=n.empty,a=t(i),u=a.length,s=0;s<u;s++){var c=a[s];o=n.concat(o,r(c,i[c]))}return o}}}}return af(G)(e)}function uf(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===2)return uf(G).apply(void 0,e);var n=rf(e[0]);return function(r,i){return function(o){for(var a=r,u=n(o),s=u.length,c=s-1;c>=0;c--){var l=u[c];a=i(l,o[l],a)}return a}}}var Kj=function(e,t){var n;return n={},n[e]=t,n};function Vj(e){var t=Bp(G)(e);return function(n){return function(r){return t(r,n)}}}function Kg(e){var t=eo(G)(e);return function(n){return function(r){return t(r,n)}}}function sf(e){return Up(G)(e)}var qle=function(e){var t=Kg(e);return function(n){return function(r){return e.map(m(r,t(n)),ea)}}},Kle=function(e){var t=Kg(e);return function(n){return function(r){return e.map(m(r,t(n)),ta)}}};function Vg(e){return function(t){var n={},r={};for(var i in t)if(ot.call(t,i)){var o=e(i,t[i]);switch(o._tag){case"Left":n[i]=o.left;break;case"Right":r[i]=o.right;break}}return Oe(n,r)}}function Hg(e){return function(t){var n={},r={};for(var i in t)if(ot.call(t,i)){var o=t[i];e(i,o)?r[i]=o:n[i]=o}return Oe(n,r)}}function Jg(e){return function(t){var n={};for(var r in t)if(ot.call(t,r)){var i=e(r,t[r]);ht(i)&&(n[r]=i.value)}return n}}function cf(e){return function(t){var n={},r=!1;for(var i in t)if(ot.call(t,i)){var o=t[i];e(i,o)?n[i]=o:r=!0}return r?n:t}}function Hj(e,t){var n=vO(e,t);return function(r){return n(r,B)}}function vO(e,t){return function(n,r){return t.reduce(n,{},function(i,o){var a=r(o),u=a[0],s=a[1];return i[u]=ot.call(i,u)?e.concat(i[u],s):s,i})}}var Vle=Lp,Hle=function(e){for(var t={},n=0,r=e;n<r.length;n++){var i=r[n];t[i[0]]=i[1]}return t};function Jj(e){return function(t){for(var n in t)if(!e(t[n]))return!1;return!0}}function Gj(e){return function(t){for(var n in t)if(e(t[n]))return!0;return!1}}function gO(e){return function(t,n){if(n===void 0){var r=gO(e);return function(o){return r(t,o)}}for(var i in n)if(e.equals(n[i],t))return!0;return!1}}var yO=function(e){return function(t){return function(n){if(vi(n))return t;if(vi(t))return n;var r={};for(var i in n)Qo(i,t)?r[i]=e.concat(n[i],t[i]):r[i]=n[i];for(var i in t)Qo(i,r)||(r[i]=t[i]);return r}}},bO=function(e){return function(t){return function(n){if(vi(n)||vi(t))return jp;var r={};for(var i in n)Qo(i,t)&&(r[i]=e.concat(n[i],t[i]));return r}}},$O=function(e){return function(t){if(vi(t))return e;if(vi(e))return t;var n={};for(var r in t)Qo(r,e)||(n[r]=t[r]);for(var r in e)Qo(r,t)||(n[r]=e[r]);return n}},lr=function(e,t){return m(e,mO(t))},ks=function(e,t){return m(e,qg(t))},fr=function(e){var t=zp(e);return function(n,r,i){return m(n,t(r,i))}},dr=function(e){return function(t){var n=qp(e)(t);return function(r,i){return m(r,n(i))}}},pr=function(e){var t=Kp(e);return function(n,r,i){return m(n,t(r,i))}},Ws=function(e,t){return m(e,Qg(t))},Ns=function(e,t){return m(e,_O(t))},Ps=function(e,t){return m(e,ey(t))},Fs=function(e,t){return m(e,SO(t))},Ds=function(e){var t=of(e);return function(n,r,i){return m(n,t(r,i))}},Ls=function(e){var t=af(e);return function(n){var r=t(n);return function(i,o){return m(i,r(o))}}},js=function(e){var t=uf(e);return function(n,r,i){return m(n,t(r,i))}},Gg=function(e,t){return m(e,Vg(t))},Yg=function(e,t){return m(e,Hg(t))},Zg=function(e,t){return m(e,Jg(t))},Xg=function(e,t){return m(e,cf(t))},eo=function(e){var t=Bp(e);return function(n){var r=t(n);return function(i,o){return r(i,Z(Dn,o))}}},Up=function(e){var t=eo(e);return function(n){var r=t(n);return function(i){return r(i,B)}}},Bp=function(e){return function(t){var n=rf(e);return function(r,i){var o=n(r);if(o.length===0)return t.of(jp);for(var a=t.of({}),u=function(f){a=t.ap(t.map(a,function(d){return function(p){var h;return Object.assign({},d,(h={},h[f]=p,h))}}),i(f,r[f]))},s=0,c=o;s<c.length;s++){var l=c[s];u(l)}return a}}},Qg=function(e){return cf(function(t,n){return e(n)})},_O=function(e){return Jg(function(t,n){return e(n)})},ey=function(e){return Hg(function(t,n){return e(n)})},SO=function(e){return Vg(function(t,n){return e(n)})};function zp(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===1){var n=of(e[0]);return function(r,i){return n(r,function(o,a,u){return i(a,u)})}}return zp(G).apply(void 0,e)}function qp(e){if("compare"in e){var t=af(e);return function(n){var r=t(n);return function(i){return r(function(o,a){return i(a)})}}}return qp(G)(e)}function Kp(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===1){var n=uf(e[0]);return function(r,i){return n(r,function(o,a,u){return i(a,u)})}}return Kp(G).apply(void 0,e)}var ea=function(e){var t={};for(var n in e)if(ot.call(e,n)){var r=e[n];ht(r)&&(t[n]=r.value)}return t},ta=function(e){var t={},n={};for(var r in e)if(ot.call(e,r)){var i=e[r];Lt(i)?t[r]=i.left:n[r]=i.right}return Oe(t,n)},on="ReadonlyRecord";function ty(e){return"compare"in e?function(t){return{show:function(n){var r=Ug(e)(function(i,o){return"".concat(JSON.stringify(i),": ").concat(t.show(o))})(n).join(", ");return r===""?"{}":"{ ".concat(r," }")}}}:ty(G)(e)}function Yj(e){var t=zg(e);return kr(function(n,r){return t(n)(r)&&t(r)(n)})}function Zj(e){return{concat:function(t,n){if(vi(t))return n;if(vi(n))return t;var r=Object.assign({},t);for(var i in n)ot.call(n,i)&&(r[i]=ot.call(t,i)?e.concat(t[i],n[i]):n[i]);return r},empty:jp}}var Xj={URI:on,map:lr},Jle=De(Xj),Gle={URI:on,map:lr,mapWithIndex:ks},Yle=function(e){return{URI:on,reduce:fr(e),foldMap:dr(e),reduceRight:pr(e)}},Zle=function(e){return{URI:on,reduce:fr(e),foldMap:dr(e),reduceRight:pr(e),reduceWithIndex:Ds(e),foldMapWithIndex:Ls(e),reduceRightWithIndex:js(e)}},Vp={URI:on,compact:ea,separate:ta},Xle={URI:on,map:lr,compact:ea,separate:ta,filter:Ws,filterMap:Ns,partition:Ps,partitionMap:Fs},Qle={URI:on,map:lr,mapWithIndex:ks,compact:ea,separate:ta,filter:Ws,filterMap:Ns,partition:Ps,partitionMap:Fs,filterMapWithIndex:Zg,filterWithIndex:Xg,partitionMapWithIndex:Gg,partitionWithIndex:Yg},Qj=function(e){return{URI:on,map:lr,reduce:fr(e),foldMap:dr(e),reduceRight:pr(e),traverse:eo(e),sequence:Up(e)}},efe=function(e){return{URI:on,map:lr,mapWithIndex:ks,reduce:fr(e),foldMap:dr(e),reduceRight:pr(e),reduceWithIndex:Ds(e),foldMapWithIndex:Ls(e),reduceRightWithIndex:js(e),traverse:eo(e),sequence:Up(e),traverseWithIndex:Bp(e)}},tfe=function(e){var t=Qj(e);return{URI:on,map:lr,reduce:fr(e),foldMap:dr(e),reduceRight:pr(e),traverse:t.traverse,sequence:t.sequence,compact:ea,separate:ta,filter:Ws,filterMap:Ns,partition:Ps,partitionMap:Fs,wither:ri(t,Vp),wilt:ni(t,Vp)}},eU=function(e){var t=yO(e);return{concat:function(n,r){return t(r)(n)}}},nfe=function(e){return{concat:eU(e).concat,empty:jp}},rfe=function(e){var t=bO(e);return{concat:function(n,r){return t(r)(n)}}},ife=function(){return{concat:function(e,t){return $O(t)(e)}}},ofe={URI:on,reduce:fr(G),foldMap:dr(G),reduceRight:pr(G)},afe={URI:on,reduce:fr(G),foldMap:dr(G),reduceRight:pr(G),reduceWithIndex:Ds(G),foldMapWithIndex:Ls(G),reduceRightWithIndex:js(G)},TO={URI:on,map:lr,reduce:fr(G),foldMap:dr(G),reduceRight:pr(G),traverse:eo(G),sequence:sf},ufe={URI:on,map:lr,mapWithIndex:ks,reduce:fr(G),foldMap:dr(G),reduceRight:pr(G),reduceWithIndex:Ds(G),foldMapWithIndex:Ls(G),reduceRightWithIndex:js(G),traverse:eo(G),sequence:sf,traverseWithIndex:Bp(G)},tU=ri(TO,Vp),nU=ni(TO,Vp),sfe={URI:on,map:lr,reduce:fr(G),foldMap:dr(G),reduceRight:pr(G),traverse:eo(G),sequence:sf,compact:ea,separate:ta,filter:Ws,filterMap:Ns,partition:Ps,partitionMap:Fs,wither:tU,wilt:nU},IO=hO;function rU(e,t){return ot.call(t===void 0?this:t,e)}var cfe={URI:on,map:lr,reduce:fr(G),foldMap:dr(G),reduceRight:pr(G),traverse:eo(G),sequence:sf,compact:ea,separate:ta,filter:Ws,filterMap:Ns,partition:Ps,partitionMap:Fs,mapWithIndex:ks,reduceWithIndex:Ds(G),foldMapWithIndex:Ls(G),reduceRightWithIndex:js(G),filterMapWithIndex:Zg,filterWithIndex:Xg,partitionMapWithIndex:Gg,partitionWithIndex:Yg,traverseWithIndex:Bp(G),wither:tU,wilt:nU};const lfe=Object.freeze(Object.defineProperty({__proto__:null,fromRecord:Fle,toRecord:Dle,size:qj,isEmpty:vi,keys:Lle,collect:Ug,toReadonlyArray:Lp,toUnfoldable:jle,upsertAt:hO,has:Qo,deleteAt:Bg,updateAt:Ule,modifyAt:Ble,pop:zle,isSubrecord:zg,lookup:As,empty:jp,mapWithIndex:qg,map:mO,reduceWithIndex:of,foldMapWithIndex:af,reduceRightWithIndex:uf,singleton:Kj,traverseWithIndex:Vj,traverse:Kg,sequence:sf,wither:qle,wilt:Kle,partitionMapWithIndex:Vg,partitionWithIndex:Hg,filterMapWithIndex:Jg,filterWithIndex:cf,fromFoldable:Hj,fromFoldableMap:vO,toEntries:Vle,fromEntries:Hle,every:Jj,some:Gj,elem:gO,union:yO,intersection:bO,difference:$O,_map:lr,_mapWithIndex:ks,_reduce:fr,_foldMap:dr,_reduceRight:pr,_filter:Ws,_filterMap:Ns,_partition:Ps,_partitionMap:Fs,_reduceWithIndex:Ds,_foldMapWithIndex:Ls,_reduceRightWithIndex:js,_partitionMapWithIndex:Gg,_partitionWithIndex:Yg,_filterMapWithIndex:Zg,_filterWithIndex:Xg,_traverse:eo,_sequence:Up,filter:Qg,filterMap:_O,partition:ey,partitionMap:SO,reduce:zp,foldMap:qp,reduceRight:Kp,compact:ea,separate:ta,URI:on,getShow:ty,getEq:Yj,getMonoid:Zj,Functor:Xj,flap:Jle,FunctorWithIndex:Gle,getFoldable:Yle,getFoldableWithIndex:Zle,Compactable:Vp,Filterable:Xle,FilterableWithIndex:Qle,getTraversable:Qj,getTraversableWithIndex:efe,getWitherable:tfe,getUnionSemigroup:eU,getUnionMonoid:nfe,getIntersectionSemigroup:rfe,getDifferenceMagma:ife,Foldable:ofe,FoldableWithIndex:afe,Traversable:TO,TraversableWithIndex:ufe,Witherable:sfe,insertAt:IO,hasOwnProperty:rU,readonlyRecord:cfe},Symbol.toStringTag,{value:"Module"}));var ffe=function(e){return new Set(e)},dfe=function(e){return new Set([e])},iU=function(e){return function(t){for(var n=t.length,r=new Set,i=an(e),o=0;o<n;o++){var a=t[o];i(a,r)||r.add(a)}return r}};function pfe(e){return new Set(e)}function hfe(e){var t=an(e);return function(n){return function(r){var i=new Set;return r.forEach(function(o){var a=n(o);t(a,i)||i.add(a)}),i}}}function mfe(e){var t=an(e);return function(n){return function(r){var i=new Set;return r.forEach(function(o){n(o).forEach(function(a){t(a,i)||i.add(a)})}),i}}}function OO(e){return function(t){for(var n=t.values(),r,i=new Set;!(r=n.next()).done;){var o=r.value;e(o)&&i.add(o)}return i}}function vfe(e){return function(t){for(var n=t.values(),r,i=new Set,o=new Set;!(r=n.next()).done;){var a=r.value;e(a)?i.add(a):o.add(a)}return Oe(o,i)}}function wO(e){var t=an(e);return function(n,r){if(r===void 0){var i=wO(e);return function(a){return i(n,a)}}if(Hp(n))return r;if(Hp(r))return n;var o=new Set(n);return r.forEach(function(a){t(a,o)||o.add(a)}),o}}function EO(e){var t=an(e);return function(n,r){if(r===void 0){var i=EO(e);return function(a){return i(a,n)}}if(Hp(n)||Hp(r))return MO;var o=new Set;return n.forEach(function(a){t(a,r)&&o.add(a)}),o}}function gfe(e,t){return function(n){return function(r){for(var i=r.values(),o,a=new Set,u=new Set,s=an(e),c=an(t);!(o=i.next()).done;){var l=n(o.value);switch(l._tag){case"Left":s(l.left,a)||a.add(l.left);break;case"Right":c(l.right,u)||u.add(l.right);break}}return Oe(a,u)}}}function RO(e){var t=an(e);return function(n,r){if(r===void 0){var i=RO(e);return function(o){return i(o,n)}}return OO(function(o){return!t(o,r)})(n)}}function oU(e){var t=ny(e);return function(n,r){return function(i){return t(i).reduce(r,n)}}}function aU(e,t){var n=ny(e);return function(r){return function(i){return n(i).reduce(function(o,a){return t.concat(o,r(a))},t.empty)}}}var uU=function(e){var t=ny(e);return function(n,r){return function(i){return t(i).reduceRight(function(o,a){return r(a,o)},n)}}};function sU(e){var t=an(e);return function(n){return function(r){if(t(n)(r))return r;var i=new Set(r);return i.add(n),i}}}var cU=function(e){return function(t){return function(n){return OO(function(r){return!e.equals(t,r)})(n)}}},yfe=function(e){var t=an(e),n=cU(e),r=sU(e);return function(i){return function(o){return(t(i,o)?n:r)(i)(o)}}},bfe=function(e){return lU(e)(B)};function $fe(e,t){return function(n){var r=an(e),i=an(t),o=new Set,a=new Set;return n.forEach(function(u){switch(u._tag){case"Left":r(u.left,o)||o.add(u.left);break;case"Right":i(u.right,a)||a.add(u.right);break}}),Oe(o,a)}}function lU(e){var t=an(e);return function(n){return function(r){var i=new Set;return r.forEach(function(o){var a=n(o);a._tag==="Some"&&!t(a.value,i)&&i.add(a.value)}),i}}}var MO=new Set,Hp=function(e){return e.size===0},_fe=function(e){return e.size},xO=function(e){return function(t){for(var n=t.values(),r,i=!1;!i&&!(r=n.next()).done;)i=e(r.value);return i}};function CO(e){return Zd(xO(Zd(e)))}function Jp(e){var t=an(e);return function(n,r){if(r===void 0){var i=Jp(e);return function(o){return i(o,n)}}return CO(function(o){return t(o,r)})(n)}}function an(e){return function(t,n){if(n===void 0){var r=an(e);return function(u){return r(t,u)}}for(var i=n.values(),o,a=!1;!a&&!(o=i.next()).done;)a=e.equals(t,o.value);return a}}var ny=function(e){return function(t){var n=[];return t.forEach(function(r){return n.push(r)}),n.sort(e.compare)}},Sfe="ReadonlySet";function fU(e){return{show:function(t){var n=[];return t.forEach(function(r){n.push(e.show(r))}),"new Set([".concat(n.sort().join(", "),"])")}}}function dU(e){var t=Jp(e);return kr(function(n,r){return t(n,r)&&t(r,n)})}var pU=function(e){return{concat:wO(e)}},Tfe=function(e){return{concat:pU(e).concat,empty:MO}},Ife=function(e){return{concat:EO(e)}},Ofe=function(e){return{concat:RO(e)}},wfe=iU;const Efe=Object.freeze(Object.defineProperty({__proto__:null,fromSet:ffe,singleton:dfe,fromReadonlyArray:iU,toSet:pfe,map:hfe,chain:mfe,filter:OO,partition:vfe,union:wO,intersection:EO,partitionMap:gfe,difference:RO,reduce:oU,foldMap:aU,reduceRight:uU,insert:sU,remove:cU,toggle:yfe,compact:bfe,separate:$fe,filterMap:lU,empty:MO,isEmpty:Hp,size:_fe,some:xO,every:CO,isSubset:Jp,elem:an,toReadonlyArray:ny,URI:Sfe,getShow:fU,getEq:dU,getUnionSemigroup:pU,getUnionMonoid:Tfe,getIntersectionSemigroup:Ife,getDifferenceMagma:Ofe,fromArray:wfe},Symbol.toStringTag,{value:"Module"}));function qt(e){return e[0]}function yn(e){return e[1]}var Rfe=function(e){return[yn(e),qt(e)]};function AO(e){return{URI:hr,_E:void 0,map:Gp,ap:function(t,n){return[qt(t)(qt(n)),e.concat(yn(t),yn(n))]}}}var hU=function(e){return function(t){return[t,e.empty]}};function Mfe(e){var t=AO(e);return{URI:hr,_E:void 0,map:t.map,ap:t.ap,of:hU(e)}}function kO(e){var t=AO(e);return{URI:hr,_E:void 0,map:t.map,ap:t.ap,chain:function(n,r){var i=r(qt(n)),o=i[0],a=i[1];return[o,e.concat(yn(n),a)]}}}function xfe(e){var t=kO(e);return{URI:hr,_E:void 0,map:t.map,ap:t.ap,chain:t.chain,of:hU(e)}}function Cfe(e){var t=function(r,i){for(var o=i(r),a=e.empty,u=qt(o);u._tag==="Left";)a=e.concat(a,yn(o)),o=i(u.left),u=qt(o);return[u.right,e.concat(a,yn(o))]},n=kO(e);return{URI:hr,_E:void 0,map:n.map,ap:n.ap,chain:n.chain,chainRec:t}}var mU=function(e,t){return m(e,_U(t))},Gp=function(e,t){return m(e,FO(t))},vU=function(e,t,n){return m(e,$U(t,n))},gU=function(e,t){return m(e,DO(t))},yU=function(e,t){return m(e,LO(t))},WO=function(e,t,n){return m(e,jO(t,n))},NO=function(e){var t=UO();return function(n,r){return m(n,t(r))}},PO=function(e,t,n){return m(e,BO(t,n))},bU=function(e){var t=SU(e);return function(n,r){return m(n,t(r))}},$U=function(e,t){return function(n){return[t(qt(n)),e(yn(n))]}},FO=function(e){return function(t){return[e(qt(t)),yn(t)]}},DO=function(e){return function(t){return[qt(t),e(yn(t))]}},_U=function(e){return function(t){return[qt(t),yn(e)]}},LO=function(e){return function(t){return[e(t),yn(t)]}},ry=qt,Afe=LO(B),jO=function(e,t){return function(n){return t(e,qt(n))}},UO=function(){return function(e){return function(t){return e(qt(t))}}},BO=function(e,t){return function(n){return t(qt(n),e)}},SU=function(e){return function(t){return function(n){return e.map(t(qt(n)),function(r){return[r,yn(n)]})}}},zO=function(e){return function(t){return e.map(qt(t),function(n){return[n,yn(t)]})}},hr="ReadonlyTuple",TU={URI:hr,map:Gp},kfe=De(TU),Wfe={URI:hr,bimap:vU,mapLeft:gU},Nfe={URI:hr,compose:mU},Pfe={URI:hr,map:Gp,extend:yU,extract:ry},Ffe={URI:hr,reduce:WO,foldMap:NO,reduceRight:PO},Dfe={URI:hr,map:Gp,reduce:WO,foldMap:NO,reduceRight:PO,traverse:bU,sequence:zO},Lfe=FO,jfe=DO,Ufe={URI:hr,compose:mU,map:Gp,bimap:vU,mapLeft:gU,extract:ry,extend:yU,reduce:WO,foldMap:NO,reduceRight:PO,traverse:bU,sequence:zO};const Bfe=Object.freeze(Object.defineProperty({__proto__:null,fst:qt,snd:yn,swap:Rfe,getApply:AO,getApplicative:Mfe,getChain:kO,getMonad:xfe,getChainRec:Cfe,bimap:$U,mapFst:FO,mapSnd:DO,compose:_U,extend:LO,extract:ry,duplicate:Afe,reduce:jO,foldMap:UO,reduceRight:BO,traverse:SU,sequence:zO,URI:hr,Functor:TU,flap:kfe,Bifunctor:Wfe,Semigroupoid:Nfe,Comonad:Pfe,Foldable:Ffe,Traversable:Dfe,map:Lfe,mapLeft:jfe,readonlyTuple:Ufe},Symbol.toStringTag,{value:"Module"}));var lf=globalThis&&globalThis.__assign||function(){return lf=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},lf.apply(this,arguments)},zfe=qj,Us=vi,qO=function(e){return function(t){return Object.keys(t).sort(e.compare)}},qfe=qO(G);function KO(e){if(typeof e=="function")return KO(G)(e);var t=qO(e);return function(n){return function(r){for(var i=[],o=0,a=t(r);o<a.length;o++){var u=a[o];i.push(n(u,r[u]))}return i}}}var VO=KO(G)(function(e,t){return[e,t]});function Kfe(e){return function(t){var n=VO(t),r=n.length;return e.unfold(0,function(i){return i<r?le([n[i],i+1]):me})}}var IU=hO,OU=Qo;function wU(e){return function(t){if(!ot.call(t,e))return t;var n=Object.assign({},t);return delete n[e],n}}var Vfe=function(e,t){return EU(e,function(){return t})},EU=function(e,t){return function(n){if(!OU(e,n))return me;var r=Object.assign({},n);return r[e]=t(n[e]),le(r)}};function Hfe(e){var t=wU(e);return function(n){var r=RU(e,n);return xt(r)?me:le([r.value,t(n)])}}var Jfe=zg,RU=As,Gfe=qg,Yfe=mO;function Zfe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===1?of(e[0]):of(G).apply(void 0,e)}function Xfe(e){return"compare"in e?af(e):af(G)(e)}function Qfe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===1?uf(e[0]):uf(G).apply(void 0,e)}var ede=Kj;function tde(e){return Vj(e)}function HO(e){return Kg(e)}function Yp(e){return sf(e)}var nde=function(e){var t=HO(e);return function(n){return function(r){return e.map(m(r,t(n)),du)}}},rde=function(e){var t=HO(e);return function(n){return function(r){return e.map(m(r,t(n)),pu)}}},ide=Vg;function ode(e){return Hg(e)}var ade=Jg;function ude(e){return cf(e)}function MU(e,t){return Hj(e,t)}var sde=VO,cde=function(e){return MU(Mm(),wW)(e)};function lde(e,t){return vO(e,t)}var fde=Jj,dde=Gj,pde=gO,xU=function(e){var t=yO(e);return function(n){return function(r){return Us(r)?lf({},n):Us(n)?lf({},r):t(n)(r)}}},CU=function(e){return function(t){return function(n){return Us(n)||Us(t)?{}:bO(e)(t)(n)}}},AU=function(e){return function(t){return Us(t)?lf({},e):Us(e)?lf({},t):$O(e)(t)}},gi=lr,Zp=ks,yi=fr,bi=dr,$i=pr,Xp=Ws,Qp=Ns,eh=Ps,th=Fs,nh=Ds,rh=Ls,ih=js,kU=Gg,WU=Yg,NU=Zg,PU=Xg,ff=eo,FU=Up,JO=function(e){return function(t){var n=qO(e);return function(r,i){var o=n(r);if(o.length===0)return t.of({});for(var a=t.of({}),u=function(f){a=t.ap(t.map(a,function(d){return function(p){return d[f]=p,d}}),i(f,r[f]))},s=0,c=o;s<c.length;s++){var l=c[s];u(l)}return a}}},hde=Qg,mde=_O,vde=ey,gde=SO;function yde(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===1?zp(e[0]):zp(G).apply(void 0,e)}function bde(e){return"compare"in e?qp(e):qp(G)(e)}function $de(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===1?Kp(e[0]):Kp(G).apply(void 0,e)}var du=ea,pu=ta,un="Record";function _de(e){return"compare"in e?ty(e):ty(G)(e)}var Sde=Yj,Tde=Zj,DU={URI:un,map:gi},Ide=De(DU),Ode={URI:un,map:gi,mapWithIndex:Zp},wde=function(e){return{URI:un,reduce:yi(e),foldMap:bi(e),reduceRight:$i(e)}},Ede=function(e){return{URI:un,reduce:yi(e),foldMap:bi(e),reduceRight:$i(e),reduceWithIndex:nh(e),foldMapWithIndex:rh(e),reduceRightWithIndex:ih(e)}},oh={URI:un,compact:du,separate:pu},Rde={URI:un,map:gi,compact:du,separate:pu,filter:Xp,filterMap:Qp,partition:eh,partitionMap:th},Mde={URI:un,map:gi,mapWithIndex:Zp,compact:du,separate:pu,filter:Xp,filterMap:Qp,partition:eh,partitionMap:th,filterMapWithIndex:NU,filterWithIndex:PU,partitionMapWithIndex:kU,partitionWithIndex:WU},LU=function(e){return{URI:un,map:gi,reduce:yi(e),foldMap:bi(e),reduceRight:$i(e),traverse:ff(e),sequence:FU(e)}},xde=function(e){return{URI:un,map:gi,mapWithIndex:Zp,reduce:yi(e),foldMap:bi(e),reduceRight:$i(e),reduceWithIndex:nh(e),foldMapWithIndex:rh(e),reduceRightWithIndex:ih(e),traverse:ff(e),sequence:FU(e),traverseWithIndex:JO(e)}},Cde=function(e){var t=LU(e);return{URI:un,map:gi,reduce:yi(e),foldMap:bi(e),reduceRight:$i(e),traverse:t.traverse,sequence:t.sequence,compact:du,separate:pu,filter:Xp,filterMap:Qp,partition:eh,partitionMap:th,wither:ri(t,oh),wilt:ni(t,oh)}},jU=function(e){var t=xU(e);return{concat:function(n,r){return t(r)(n)}}},Ade=function(e){return{concat:jU(e).concat,empty:{}}},kde=function(e){var t=CU(e);return{concat:function(n,r){return t(r)(n)}}},Wde=function(){return{concat:function(e,t){return AU(t)(e)}}},Nde={URI:un,reduce:yi(G),foldMap:bi(G),reduceRight:$i(G)},Pde={URI:un,reduce:yi(G),foldMap:bi(G),reduceRight:$i(G),reduceWithIndex:nh(G),foldMapWithIndex:rh(G),reduceRightWithIndex:ih(G)},GO={URI:un,map:gi,reduce:yi(G),foldMap:bi(G),reduceRight:$i(G),traverse:ff(G),sequence:Yp},Fde={URI:un,map:gi,mapWithIndex:Zp,reduce:yi(G),foldMap:bi(G),reduceRight:$i(G),reduceWithIndex:nh(G),foldMapWithIndex:rh(G),reduceRightWithIndex:ih(G),traverse:ff(G),sequence:Yp,traverseWithIndex:JO(G)},UU=ri(GO,oh),BU=ni(GO,oh),Dde={URI:un,map:gi,reduce:yi(G),foldMap:bi(G),reduceRight:$i(G),traverse:ff(G),sequence:Yp,compact:du,separate:pu,filter:Xp,filterMap:Qp,partition:eh,partitionMap:th,wither:UU,wilt:BU},Lde={},jde=IU,Ude=rU,Bde={URI:un,map:gi,reduce:yi(G),foldMap:bi(G),reduceRight:$i(G),traverse:ff(G),sequence:Yp,compact:du,separate:pu,filter:Xp,filterMap:Qp,partition:eh,partitionMap:th,mapWithIndex:Zp,reduceWithIndex:nh(G),foldMapWithIndex:rh(G),reduceRightWithIndex:ih(G),filterMapWithIndex:NU,filterWithIndex:PU,partitionMapWithIndex:kU,partitionWithIndex:WU,traverseWithIndex:JO(G),wither:UU,wilt:BU};const zde=Object.freeze(Object.defineProperty({__proto__:null,size:zfe,isEmpty:Us,keys:qfe,collect:KO,toArray:VO,toUnfoldable:Kfe,upsertAt:IU,has:OU,deleteAt:wU,updateAt:Vfe,modifyAt:EU,pop:Hfe,isSubrecord:Jfe,lookup:RU,mapWithIndex:Gfe,map:Yfe,reduceWithIndex:Zfe,foldMapWithIndex:Xfe,reduceRightWithIndex:Qfe,singleton:ede,traverseWithIndex:tde,traverse:HO,sequence:Yp,wither:nde,wilt:rde,partitionMapWithIndex:ide,partitionWithIndex:ode,filterMapWithIndex:ade,filterWithIndex:ude,fromFoldable:MU,toEntries:sde,fromEntries:cde,fromFoldableMap:lde,every:fde,some:dde,elem:pde,union:xU,intersection:CU,difference:AU,filter:hde,filterMap:mde,partition:vde,partitionMap:gde,reduce:yde,foldMap:bde,reduceRight:$de,compact:du,separate:pu,URI:un,getShow:_de,getEq:Sde,getMonoid:Tde,Functor:DU,flap:Ide,FunctorWithIndex:Ode,getFoldable:wde,getFoldableWithIndex:Ede,Compactable:oh,Filterable:Rde,FilterableWithIndex:Mde,getTraversable:LU,getTraversableWithIndex:xde,getWitherable:Cde,getUnionSemigroup:jU,getUnionMonoid:Ade,getIntersectionSemigroup:kde,getDifferenceMagma:Wde,Foldable:Nde,FoldableWithIndex:Pde,Traversable:GO,TraversableWithIndex:Fde,Witherable:Dde,empty:Lde,insertAt:jde,hasOwnProperty:Ude,record:Bde},Symbol.toStringTag,{value:"Module"}));var qde=function(e){return function(t){return ht(e(t))}},Kde=function(e){return function(t){return P$(e(t))}},Vde=function(){return function(e){return!0}},Hde=function(e){return function(t){return!e(t)}},Jde=function(e){return function(t){return function(n){return t(n)||e(n)}}},Gde=function(e){return function(t){return function(n){return t(n)&&e(n)}}},Yde=function(){return function(e){return!1}},Zde=function(e){return function(t){return function(n){return t(n)&&e(n)}}};const Xde=Object.freeze(Object.defineProperty({__proto__:null,fromOptionK:qde,fromEitherK:Kde,id:Vde,not:Hde,or:Jde,and:Gde,zero:Yde,compose:Zde},Symbol.toStringTag,{value:"Module"}));var zU=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return{add:function(n,r){return e.map(function(i,o){return i.add(n[o],r[o])})},zero:e.map(function(n){return n.zero}),mul:function(n,r){return e.map(function(i,o){return i.mul(n[o],r[o])})},one:e.map(function(n){return n.one}),sub:function(n,r){return e.map(function(i,o){return i.sub(n[o],r[o])})}}},Qde=function(e){return function(t){return e.sub(e.zero,t)}},epe=zU,tpe=VM;const npe=Object.freeze(Object.defineProperty({__proto__:null,tuple:zU,negate:Qde,getTupleRing:epe,getFunctionRing:tpe},Symbol.toStringTag,{value:"Module"})),rpe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var ipe=k$;const ope=Object.freeze(Object.defineProperty({__proto__:null,getFunctionSemiring:ipe},Symbol.toStringTag,{value:"Module"}));var ape=fU,upe=dU;function spe(e){var t=Kn(e);return function(n){return function(r){var i=new Set;return r.forEach(function(o){var a=n(o);t(a,i)||i.add(a)}),i}}}function cpe(e){var t=Kn(e);return function(n){return function(r){var i=new Set;return r.forEach(function(o){n(o).forEach(function(a){t(a,i)||i.add(a)})}),i}}}function YO(e){return function(t){for(var n=t.values(),r,i=new Set;!(r=n.next()).done;){var o=r.value;e(o)&&i.add(o)}return i}}function lpe(e){return function(t){for(var n=t.values(),r,i=new Set,o=new Set;!(r=n.next()).done;){var a=r.value;e(a)?i.add(a):o.add(a)}return Oe(o,i)}}function ZO(e){var t=Kn(e);return function(n,r){if(r===void 0){var i=ZO(e);return function(a){return i(n,a)}}if(ah(n))return r;if(ah(r))return n;var o=new Set(n);return r.forEach(function(a){t(a,o)||o.add(a)}),o}}function XO(e){var t=Kn(e);return function(n,r){if(r===void 0){var i=XO(e);return function(a){return i(a,n)}}if(ah(n)||ah(r))return new Set;var o=new Set;return n.forEach(function(a){t(a,r)&&o.add(a)}),o}}function fpe(e,t){return function(n){return function(r){for(var i=r.values(),o,a=new Set,u=new Set,s=Kn(e),c=Kn(t);!(o=i.next()).done;){var l=n(o.value);switch(l._tag){case"Left":s(l.left,a)||a.add(l.left);break;case"Right":c(l.right,u)||u.add(l.right);break}}return Oe(a,u)}}}function QO(e){var t=Kn(e);return function(n,r){if(r===void 0){var i=QO(e);return function(o){return i(o,n)}}return YO(function(o){return!t(o,r)})(n)}}var qU=function(e){return{concat:ZO(e)}},dpe=function(e){return{concat:qU(e).concat,empty:new Set}},ppe=function(e){return{concat:XO(e)}},hpe=function(e){return{concat:QO(e)}},mpe=oU,vpe=aU,gpe=uU,ype=function(e){return new Set([e])};function KU(e){var t=Kn(e);return function(n){return function(r){if(t(n)(r))return r;var i=new Set(r);return i.add(n),i}}}var VU=function(e){return function(t){return function(n){return YO(function(r){return!e.equals(t,r)})(n)}}},bpe=function(e){var t=Kn(e),n=VU(e),r=KU(e);return function(i){return function(o){return(t(i,o)?n:r)(i)(o)}}},HU=function(e){return function(t){for(var n=t.length,r=new Set,i=Kn(e),o=0;o<n;o++){var a=t[o];i(a,r)||r.add(a)}return r}},$pe=function(e){return JU(e)(B)};function _pe(e,t){return function(n){var r=Kn(e),i=Kn(t),o=new Set,a=new Set;return n.forEach(function(u){switch(u._tag){case"Left":r(u.left,o)||o.add(u.left);break;case"Right":i(u.right,a)||a.add(u.right);break}}),Oe(o,a)}}function JU(e){var t=Kn(e);return function(n){return function(r){var i=new Set;return r.forEach(function(o){var a=n(o);a._tag==="Some"&&!t(a.value,i)&&i.add(a.value)}),i}}}var Spe=new Set,ah=function(e){return e.size===0},Tpe=function(e){return e.size},Ipe=xO,GU=CO,Ope=Jp,Kn=an,YU=function(e){return function(t){var n=[];return t.forEach(function(r){return n.push(r)}),n.sort(e.compare)}},wpe=Jp;const Epe=Object.freeze(Object.defineProperty({__proto__:null,getShow:ape,getEq:upe,map:spe,chain:cpe,filter:YO,partition:lpe,union:ZO,intersection:XO,partitionMap:fpe,difference:QO,getUnionSemigroup:qU,getUnionMonoid:dpe,getIntersectionSemigroup:ppe,getDifferenceMagma:hpe,reduce:mpe,foldMap:vpe,reduceRight:gpe,singleton:ype,insert:KU,remove:VU,toggle:bpe,fromArray:HU,compact:$pe,separate:_pe,filterMap:JU,empty:Spe,isEmpty:ah,size:Tpe,some:Ipe,every:GU,isSubset:Ope,elem:Kn,toArray:YU,subset:wpe},Symbol.toStringTag,{value:"Module"}));var ZU=function(e){return{show:function(t){var n="{";for(var r in e)ot.call(e,r)&&(n+=" ".concat(r,": ").concat(e[r].show(t[r]),","));return n.length>1&&(n=n.slice(0,-1)+" "),n+="}",n}}},XU=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return{show:function(n){return"[".concat(n.map(function(r,i){return e[i].show(r)}).join(", "),"]")}}},Rpe=XU,Mpe=ZU,xpe={show:function(e){return JSON.stringify(e)}},Cpe={show:function(e){return JSON.stringify(e)}},Ape={show:function(e){return JSON.stringify(e)}};const kpe=Object.freeze(Object.defineProperty({__proto__:null,struct:ZU,tuple:XU,getTupleShow:Rpe,getStructShow:Mpe,showBoolean:xpe,showString:Cpe,showNumber:Ape},Symbol.toStringTag,{value:"Module"}));function ew(e){return function(t){return function(n){return e.of([t,n])}}}function tw(e){return function(t){return function(n){return function(r){return e.map(n(r),function(i){var o=i[0],a=i[1];return[t(o),a]})}}}}function nw(e){return function(t){return function(n){return function(r){return e.chain(n(r),function(i){var o=i[0],a=i[1];return e.map(t(a),function(u){var s=u[0],c=u[1];return[o(s),c]})})}}}}function rw(e){return function(t){return function(n){return function(r){return e.chain(n(r),function(i){var o=i[0],a=i[1];return t(o)(a)})}}}}function iw(e){return function(t){return function(n){return e.of(t(n))}}}function ow(e){return function(t){return function(n){return e.map(t,function(r){return[r,n]})}}}function aw(e){return function(t){return function(n){return e.map(n(t),function(r){var i=r[0];return i})}}}function uw(e){return function(t){return function(n){return e.map(n(t),yn)}}}function Wpe(e){var t=nw(e),n=tw(e),r=rw(e),i=aw(e),o=uw(e);return{map:function(a,u){return m(a,n(u))},ap:function(a,u){return m(a,t(u))},of:ew(e),chain:function(a,u){return m(a,r(u))},get:function(){return function(a){return e.of([a,a])}},put:function(a){return function(){return e.of([void 0,a])}},modify:function(a){return function(u){return e.of([void 0,a(u)])}},gets:function(a){return function(u){return e.of([a(u),u])}},fromState:iw(e),fromM:ow(e),evalState:function(a,u){return m(a,i(u))},execState:function(a,u){return m(a,o(u))}}}const Npe=Object.freeze(Object.defineProperty({__proto__:null,of:ew,map:tw,ap:nw,chain:rw,fromState:iw,fromF:ow,evaluate:aw,execute:uw,getStateM:Wpe},Symbol.toStringTag,{value:"Module"}));var sw=function(e){return function(){return Ag(e)}},cw=ew(cO);function QU(e){return _i(YI(e))}function Ppe(e){return _i(QL(e))}function eB(e){return _i(ZI(e))}function Fpe(e){return _i(ej(e))}function tB(e){return _i(XI(e))}function Dpe(e){return _i(nj(e))}var Lpe=function(e){return Z(e,GI)},jpe=function(e){return function(t){return Ag(e(t)[0])}},nB=qa(function(e){return sw(e)},cw),rB=eB,Bs=tB,uh=QU,iB=iw(cO),oB=function(e){return _i(su(e))},aB=function(e){return _i(QI(e))},Upe=function(e){return _i(eO(e))},_i=ow(Cs),Bpe=function(e){return function(t){return Z(t,up(e))}},uB=function(e){return function(t){return function(n){return e(n)(t)(n)}}},zpe=uB,sB=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return aB(e.apply(void 0,t))}},cB=function(e){return function(t){return m(t,sh(sB(e)))}},qpe=cB,lB=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return oB(e.apply(void 0,t))}},fB=function(e){return function(t){return m(t,sh(lB(e)))}},Kpe=fB,dB=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return _i(e.apply(void 0,t))}},pB=function(e){return function(t){return m(t,sh(dB(e)))}},Vpe=pB,Si=function(e,t){return m(e,hB(t))},na=function(e,t){return m(e,fw(t))},zs=function(e,t){return m(e,dw(t))},lw=function(e,t){return function(n){return m(e(n),Pg(function(){return t()(n)}))}},iy=function(e,t,n){return function(r){return m(e(r),aO(t,function(i){var o=i[0],a=i[1];return[n(o),a]}))}},oy=function(e,t){return function(n){return m(e(n),uO(t))}},hB=tw(Cs),Hpe=function(e,t){return function(n){return iy(n,e,t)}},Jpe=function(e){return function(t){return oy(t,e)}},fw=nw(Rn),Gpe=fw,to=cw,dw=rw(Rn),sh=dw,mB=sh(B),Ype=mB,vB=function(e){return function(t){return function(n){return m(t(n),yj(function(){return e()(n)}))}}},Zpe=vB,ay=sw,Nt="StateReaderTaskEither",pw={URI:Nt,map:Si},Xpe=De(pw),Qpe={URI:Nt,of:to},uy={URI:Nt,map:Si,ap:na},gB=_t(uy),ehe=gB,yB=St(uy),the=yB,nhe={URI:Nt,map:Si,ap:na,of:to},Vn={URI:Nt,map:Si,ap:na,chain:zs},qs={URI:Nt,fromState:iB},rhe=dP(qs),ihe=pP(qs),ohe=hP(qs),ahe=mP(qs),uhe=iT(qs),she=vP(qs,Vn),che={URI:Nt,map:Si,ap:na,of:to,chain:zs},lhe={URI:Nt,map:Si,ap:na,of:to,chain:zs,fromIO:Bs},fhe={URI:Nt,map:Si,ap:na,of:to,chain:zs,fromIO:Bs,fromTask:uh},dhe={URI:Nt,map:Si,ap:na,of:to,chain:zs,throwError:ay},bB=at(Vn),phe=bB,hhe={URI:Nt,bimap:iy,mapLeft:oy},mhe={URI:Nt,map:Si,alt:lw},df={URI:Nt,fromReader:rB},vhe=lp(df),ghe=fp(df),yhe=_s(df),$B=dp(df,Vn),bhe=$B,_B=pp(df,Vn),$he=_B,ra={URI:Nt,fromEither:nB},_he=Di(ra),She=Li(ra),The=Xu(ra,Vn),SB=To(ra,Vn),Ihe=SB,TB=Io(ra,Vn),Ohe=TB,whe=Ua(ra),IB=Qu(ra,Vn),Ehe=IB,Rhe=ar(ra),sy={URI:Nt,fromIO:Bs},Mhe=Vi(sy),xhe=Wo(sy,Vn),Che=No(sy,Vn),cy={URI:Nt,fromIO:Bs,fromTask:uh},Ahe=Ss(cy),khe=Cl(cy,Vn),Whe=Al(cy,Vn),Nhe=aw(Cs),Phe=uw(Cs),Fhe=It(pw),OB=Ot(Vn),Dhe=OB,wB=Tt(uy),Lhe=wB,EB=function(e){return function(t){return function(n){return function(r){return function(){return Dc(t).reduce(function(i,o,a){return i.then(function(u){return Lt(u)?i:e(a+1,o)(u.right[1])(r)().then(function(s){if(Lt(s))return s;var c=s.right,l=c[0],f=c[1];return u.right[0].push(l),u.right[1]=f,u})})},e(0,or(t))(n)(r)().then(ns(function(i){var o=i[0],a=i[1];return[[o],a]})))}}}}},hw=function(e){var t=EB(e);return function(n){return ft(n)?t(n):to(Yt)}},jhe=hw,RB=function(e){return hw(function(t,n){return e(n)})},Uhe=RB(B),Bhe={URI:Nt,map:Si,of:to,ap:na,chain:zs,bimap:iy,mapLeft:oy,alt:lw,fromIO:Bs,fromTask:uh,throwError:ay},zhe={URI:Nt,map:Si,of:to,ap:na,chain:zs,bimap:iy,mapLeft:oy,alt:lw,fromIO:Bs,fromTask:uh,throwError:ay},qhe=function(e,t){return m(e(t),Fp(function(n){var r=n[0];return r}))},Khe=function(e,t){return m(e(t),Fp(function(n){n[0];var r=n[1];return r}))};function Vhe(e,t,n){return e(t)(n)()}const Hhe=Object.freeze(Object.defineProperty({__proto__:null,left:sw,right:cw,rightTask:QU,leftTask:Ppe,rightReader:eB,leftReader:Fpe,rightIO:tB,leftIO:Dpe,rightState:Lpe,leftState:jpe,fromEither:nB,fromReader:rB,fromIO:Bs,fromTask:uh,fromState:iB,fromTaskEither:oB,fromIOEither:aB,fromReaderEither:Upe,fromReaderTaskEither:_i,local:Bpe,asksStateReaderTaskEitherW:uB,asksStateReaderTaskEither:zpe,fromIOEitherK:sB,chainIOEitherKW:cB,chainIOEitherK:qpe,fromTaskEitherK:lB,chainTaskEitherKW:fB,chainTaskEitherK:Kpe,fromReaderTaskEitherK:dB,chainReaderTaskEitherKW:pB,chainReaderTaskEitherK:Vpe,map:hB,bimap:Hpe,mapLeft:Jpe,ap:fw,apW:Gpe,of:to,chain:dw,chainW:sh,flattenW:mB,flatten:Ype,altW:vB,alt:Zpe,throwError:ay,URI:Nt,Functor:pw,flap:Xpe,Pointed:Qpe,Apply:uy,apFirst:gB,apFirstW:ehe,apSecond:yB,apSecondW:the,Applicative:nhe,Chain:Vn,FromState:qs,get:rhe,put:ihe,modify:ohe,gets:ahe,fromStateK:uhe,chainStateK:she,Monad:che,MonadIO:lhe,MonadTask:fhe,MonadThrow:dhe,chainFirst:bB,chainFirstW:phe,Bifunctor:hhe,Alt:mhe,FromReader:df,ask:vhe,asks:ghe,fromReaderK:yhe,chainReaderK:$B,chainReaderKW:bhe,chainFirstReaderK:_B,chainFirstReaderKW:$he,FromEither:ra,fromOption:_he,fromOptionK:She,chainOptionK:The,chainEitherK:SB,chainEitherKW:Ihe,chainFirstEitherK:TB,chainFirstEitherKW:Ohe,fromPredicate:whe,filterOrElse:IB,filterOrElseW:Ehe,fromEitherK:Rhe,FromIO:sy,fromIOK:Mhe,chainIOK:xhe,chainFirstIOK:Che,FromTask:cy,fromTaskK:Ahe,chainTaskK:khe,chainFirstTaskK:Whe,evaluate:Nhe,execute:Phe,bindTo:Fhe,bind:OB,bindW:Dhe,apS:wB,apSW:Lhe,traverseReadonlyNonEmptyArrayWithIndex:EB,traverseReadonlyArrayWithIndex:hw,traverseArrayWithIndex:jhe,traverseArray:RB,sequenceArray:Uhe,stateReaderTaskEither:Bhe,stateReaderTaskEitherSeq:zhe,evalState:qhe,execState:Khe,run:Vhe},Symbol.toStringTag,{value:"Module"}));function Jhe(e){return function(t){return{peek:t.peek,pos:e}}}function Ghe(e){return function(t){return{peek:t.peek,pos:e(t.pos)}}}function Yhe(e){return function(t){return t.peek(e(t.pos))}}function Zhe(e){return function(t){return function(n){return e.map(t(n.pos),function(r){return n.peek(r)})}}}var MB=function(e,t){return m(e,CB(t))},Xhe=function(e,t){return m(e,mw(t))},mw=function(e){return function(t){return{peek:function(n){return e({peek:t.peek,pos:n})},pos:t.pos}}},xB=function(e){return e.peek(e.pos)},Qhe=mw(B),CB=function(e){return function(t){return{peek:function(n){return e(t.peek(n))},pos:t.pos}}},vw="Store",AB={URI:vw,map:MB},eme=De(AB),kB={URI:vw,map:MB,extend:Xhe,extract:xB},tme=kB;const nme=Object.freeze(Object.defineProperty({__proto__:null,seek:Jhe,seeks:Ghe,peeks:Yhe,experiment:Zhe,extend:mw,extract:xB,duplicate:Qhe,map:CB,URI:vw,Functor:AB,flap:eme,Comonad:kB,store:tme},Symbol.toStringTag,{value:"Module"}));function gw(e,t){return function(n,r){return t.compose(e.second(r),e.first(n))}}function WB(e,t){var n=gw(e,t);return function(r,i){return t.compose(n(r,i),e.promap(t.id(),B,function(o){return[o,o]}))}}function rme(e){return gw(e,e)}function ime(e){return WB(e,e)}const ome=Object.freeze(Object.defineProperty({__proto__:null,split:gw,fanOut:WB,splitStrong:rme,fanout:ime},Symbol.toStringTag,{value:"Module"}));var ame=function(){return{concat:function(e,t){return Object.assign({},e,t)}}},ume=function(e){return function(t){var n={};for(var r in t)ot.call(t,r)&&(n[r]=e[r](t[r]));return n}};const sme=Object.freeze(Object.defineProperty({__proto__:null,getAssignSemigroup:ame,evolve:ume},Symbol.toStringTag,{value:"Module"}));var cme=globalThis&&globalThis.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function u(l){try{c(r.next(l))}catch(f){a(f)}}function s(l){try{c(r.throw(l))}catch(f){a(f)}}function c(l){l.done?o(l.value):i(l.value).then(u,s)}c((r=r.apply(e,t||[])).next())})},lme=globalThis&&globalThis.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(c){return function(l){return s([c,l])}}function s(c){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1],o=c;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(c);break}o[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(l){c=[6,l],i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},NB=yp(en),fme=CT(en),dme=vn,PB=AT(en),ch=function(e){return ly(wn(e))},ly=Jv(Pe),pme=iu(yl),FB=kT(Pe),hme=FB,yw=Xv(Jl),mme=yw,DB=yw,vme=DB,LB=Qv(zt),gme=LB,yme=Gv(en),jB=function(e){return function(){return cme(void 0,void 0,void 0,function(){return lme(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,e().then(le)];case 1:return[2,t.sent()];case 2:return t.sent(),[2,me];case 3:return[2]}})})}},bme=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return jB(function(){return e.apply(void 0,t)})}},$me=Yv(en),_me=MT(zt),Sme=Zv(en),Tme=xT(zt),bw=eg(Pe),UB=tg(Rs),no=NB,fy=Fl(zt),Ime=fy(B),$w=ng(zt),Ome=$w,dy=bp(en),wme=dy(),_w=Ki(Pe,ps),Sw=Co(Pe,ps,hl),BB=Ao(Pe,Ro),zB=ko(Pe,Ro),qB=Qa(Pe,Ro),KB=eu(Pe,Ro),jr=function(e,t){return m(e,bw(t))},Ks=function(e,t){return m(e,UB(t))},py=function(e,t){return m(e,fy(t))},VB=function(e,t){return m(e,$w(t))},Eme=function(e,t){return m(e,BB(t))},Rme=function(e,t){return m(e,zB(t))},Mme=function(e,t){return m(e,qB(t))},xme=function(e,t){return m(e,KB(t))},Kt="TaskOption",Tw={URI:Kt,map:jr},Cme=De(Tw),HB={URI:Kt,of:no},hy={URI:Kt,map:jr,ap:Ks},Ame=_t(hy),kme=St(hy),Wme={URI:Kt,map:jr,ap:Ks,of:no},JB=function(e,t){return m(e,fy(function(n){return m(t,bw(n))}))},Nme={URI:Kt,map:jr,ap:JB},Pme={URI:Kt,map:jr,ap:JB,of:no},ia={URI:Kt,map:jr,ap:Ks,chain:py},Fme=at(ia),Dme={URI:Kt,map:jr,alt:VB},GB={URI:Kt,zero:dy},Lme=nl(GB,HB),jme={URI:Kt,map:jr,ap:Ks,of:no,alt:VB,zero:dy},Ume={URI:Kt,map:jr,ap:Ks,of:no,chain:py},Bme={URI:Kt,map:jr,ap:Ks,of:no,chain:py,fromIO:ch},zme={URI:Kt,map:jr,ap:Ks,of:no,chain:py,fromIO:ch,fromTask:ly},qme={URI:Kt,compact:_w,separate:Sw},Kme={URI:Kt,map:jr,compact:_w,separate:Sw,filter:Eme,filterMap:Rme,partition:Mme,partitionMap:xme},my={URI:Kt,fromIO:ch},Vme=Vi(my),Hme=Wo(my,ia),Jme=No(my,ia),vy={URI:Kt,fromEither:PB},Gme=ar(vy),Yme=To(vy,ia),Zme=Io(vy,ia),gy={URI:Kt,fromIO:ch,fromTask:ly},Xme=Ss(gy),Qme=Cl(gy,ia),eve=Al(gy,ia),tve=no(jt),nve=It(Tw),rve=Ot(ia),ive=Tt(hy),Iw=no(Yt),YB=function(e){return Z(Gl(e),iu(Wv(Dn)))},Ow=function(e){var t=YB(e);return function(n){return ft(n)?t(n):Iw}},ZB=function(e){return function(t){return function(){return Dc(t).reduce(function(n,r,i){return n.then(function(o){return xt(o)?n:e(i+1,r)().then(function(a){return xt(a)?a:(o.value.push(a.value),o)})})},e(0,or(t))().then(qi(dd)))}}},ww=function(e){var t=ZB(e);return function(n){return ft(n)?t(n):Iw}},ove=Ow,XB=function(e){return Ow(function(t,n){return e(n)})},ave=XB(B),uve=ww,QB=function(e){return ww(function(t,n){return e(n)})},sve=QB(B);const cve=Object.freeze(Object.defineProperty({__proto__:null,some:NB,fromPredicate:fme,fromOption:dme,fromEither:PB,fromIO:ch,fromTask:ly,fromTaskEither:pme,match:FB,matchW:hme,matchE:yw,fold:mme,matchEW:DB,foldW:vme,getOrElse:LB,getOrElseW:gme,fromNullable:yme,tryCatch:jB,tryCatchK:bme,fromNullableK:$me,chainNullableK:_me,fromOptionK:Sme,chainOptionK:Tme,map:bw,ap:UB,of:no,chain:fy,flatten:Ime,alt:$w,altW:Ome,zero:dy,none:wme,compact:_w,separate:Sw,filter:BB,filterMap:zB,partition:qB,partitionMap:KB,Functor:Tw,flap:Cme,Pointed:HB,ApplyPar:hy,apFirst:Ame,apSecond:kme,ApplicativePar:Wme,ApplySeq:Nme,ApplicativeSeq:Pme,Chain:ia,chainFirst:Fme,Alt:Dme,Zero:GB,guard:Lme,Alternative:jme,Monad:Ume,MonadIO:Bme,MonadTask:zme,Compactable:qme,Filterable:Kme,FromIO:my,fromIOK:Vme,chainIOK:Hme,chainFirstIOK:Jme,FromEither:vy,fromEitherK:Gme,chainEitherK:Yme,chainFirstEitherK:Zme,FromTask:gy,fromTaskK:Xme,chainTaskK:Qme,chainFirstTaskK:eve,Do:tve,bindTo:nve,bind:rve,apS:ive,ApT:Iw,traverseReadonlyNonEmptyArrayWithIndex:YB,traverseReadonlyArrayWithIndex:Ow,traverseReadonlyNonEmptyArrayWithIndexSeq:ZB,traverseReadonlyArrayWithIndexSeq:ww,traverseArrayWithIndex:ove,traverseArray:XB,sequenceArray:ave,traverseSeqArrayWithIndex:uve,traverseSeqArray:QB,sequenceSeqArray:sve},Symbol.toStringTag,{value:"Module"}));var Ke=function(e){return e._tag==="Left"},Et=function(e){return e._tag==="Right"};function Vs(e){return e._tag==="Both"}function sn(e){return{_tag:"Left",left:e}}function Hn(e){return{_tag:"Right",right:e}}function Xe(e,t){return{_tag:"Both",left:e,right:t}}var Ew=function(e,t,n){return function(r){switch(r._tag){case"Left":return e(r.left);case"Right":return t(r.right);case"Both":return n(r.left,r.right)}}},lve=Ew,hu=Ew,fve=hu,ez=hu(Hn,sn,function(e,t){return Xe(t,e)});function dve(e,t){return{show:hu(function(n){return"left(".concat(e.show(n),")")},function(n){return"right(".concat(t.show(n),")")},function(n,r){return"both(".concat(e.show(n),", ").concat(t.show(r),")")})}}function pve(e,t){return kr(function(n,r){return Ke(n)?Ke(r)&&e.equals(n.left,r.left):Et(n)?Et(r)&&t.equals(n.right,r.right):Vs(r)&&e.equals(n.left,r.left)&&t.equals(n.right,r.right)})}function tz(e,t){return{concat:function(n,r){return Ke(n)?Ke(r)?sn(e.concat(n.left,r.left)):Et(r)?Xe(n.left,r.right):Xe(e.concat(n.left,r.left),r.right):Et(n)?Ke(r)?Xe(r.left,n.right):Et(r)?Hn(t.concat(n.right,r.right)):Xe(r.left,t.concat(n.right,r.right)):Ke(r)?Xe(e.concat(n.left,r.left),n.right):Et(r)?Xe(n.left,t.concat(n.right,r.right)):Xe(e.concat(n.left,r.left),t.concat(n.right,r.right))}}}var yy=function(e){return{URI:mr,_E:void 0,map:Hs,ap:function(t,n){return Ke(t)?Ke(n)?sn(e.concat(t.left,n.left)):Et(n)?sn(t.left):sn(e.concat(t.left,n.left)):Et(t)?Ke(n)?sn(n.left):Et(n)?Hn(t.right(n.right)):Xe(n.left,t.right(n.right)):Ke(n)?sn(e.concat(t.left,n.left)):Et(n)?Xe(t.left,t.right(n.right)):Xe(e.concat(t.left,n.left),t.right(n.right))}}};function hve(e){var t=yy(e);return{URI:mr,_E:void 0,map:Hs,ap:t.ap,of:lh}}function nz(e){var t=yy(e),n=function(r,i){if(Ke(r))return r;if(Et(r))return i(r.right);var o=i(r.right);return Ke(o)?sn(e.concat(r.left,o.left)):Et(o)?Xe(r.left,o.right):Xe(e.concat(r.left,o.left),o.right)};return{URI:mr,_E:void 0,map:Hs,ap:t.ap,chain:n}}function mve(e){var t=nz(e);return{URI:mr,_E:void 0,map:Hs,of:lh,ap:t.ap,chain:t.chain,throwError:sn}}function vve(e){return Ke(e)?le(e.left):Et(e)?me:le(e.left)}function gve(e){return Ke(e)?me:(Et(e),le(e.right))}function yve(e){return function(t){return xt(t)?sn(e):Xe(e,t.value)}}function bve(e){return function(t){return xt(t)?Hn(e):Xe(t.value,e)}}function $ve(e){return Ke(e)?le(e.left):me}function _ve(e){return Et(e)?le(e.right):me}var Sve=function(e,t){return xt(e)?xt(t)?me:le(Hn(t.value)):xt(t)?le(sn(e.value)):le(Xe(e.value,t.value))},Hs=function(e,t){return m(e,kw(t))},rz=function(e,t,n){return m(e,Cw(t,n))},iz=function(e,t){return m(e,Aw(t))},Rw=function(e,t,n){return m(e,az(t,n))},Mw=function(e){var t=uz(e);return function(n,r){return m(n,t(r))}},xw=function(e,t,n){return m(e,sz(t,n))},oz=function(e){var t=cz(e);return function(n,r){return m(n,t(r))}},Cw=function(e,t){return function(n){return Ke(n)?sn(e(n.left)):Et(n)?Hn(t(n.right)):Xe(e(n.left),t(n.right))}},Aw=function(e){return function(t){return Ke(t)?sn(e(t.left)):Vs(t)?Xe(e(t.left),t.right):t}},kw=function(e){return function(t){return Ke(t)?t:Et(t)?Hn(e(t.right)):Xe(t.left,e(t.right))}},az=function(e,t){return function(n){return Ke(n)?e:t(e,n.right)}},uz=function(e){return function(t){return function(n){return Ke(n)?e.empty:t(n.right)}}},sz=function(e,t){return function(n){return Ke(n)?e:t(n.right,e)}},cz=function(e){return function(t){return function(n){return Ke(n)?e.of(n):Et(n)?e.map(t(n.right),Hn):e.map(t(n.right),function(r){return Xe(n.left,r)})}}},Ww=function(e){return function(t){return Ke(t)?e.of(t):Et(t)?e.map(t.right,Hn):e.map(t.right,function(n){return Xe(t.left,n)})}},lh=Hn,mr="These",Nw={URI:mr,map:Hs},Tve=De(Nw),Ive={URI:mr,of:lh},Ove={URI:mr,bimap:rz,mapLeft:iz},wve={URI:mr,fromThese:B},Eve={URI:mr,reduce:Rw,foldMap:Mw,reduceRight:xw},Rve={URI:mr,map:Hs,reduce:Rw,foldMap:Mw,reduceRight:xw,traverse:oz,sequence:Ww},Pw={URI:mr,fromEither:B},Mve=Di(Pw),xve=Li(Pw),Cve=function(e){return function(t){return function(n){return Ke(n)?!1:e.equals(t,n.right)}}},Ave=function(e){return function(t){return Ke(t)?!1:e(t.right)}},Fw=function(e,t){return function(n){return Ke(n)?[n.left,t()]:Et(n)?[e(),n.right]:[n.left,n.right]}},kve=function(e,t){return Fw(function(){return e},function(){return t})},lz=lh(Yt),Dw=function(e){return function(t){return function(n){var r=me,i=t(0,or(n));if(Ke(i))return i;Vs(i)&&(r=le(i.left));for(var o=[i.right],a=1;a<n.length;a++){var u=t(a,n[a]);if(Ke(u))return u;Vs(u)&&(r=xt(r)?le(u.left):le(e.concat(r.value,u.left))),o.push(u.right)}return xt(r)?Hn(o):Xe(r.value,o)}}},Wve=function(e){return function(t){var n=Dw(e)(t);return function(r){return ft(r)?n(r):lz}}},Nve={URI:mr,map:Hs,bimap:rz,mapLeft:iz,reduce:Rw,foldMap:Mw,reduceRight:xw,traverse:oz,sequence:Ww};const Pve=Object.freeze(Object.defineProperty({__proto__:null,isLeft:Ke,isRight:Et,isBoth:Vs,left:sn,right:Hn,both:Xe,matchW:Ew,foldW:lve,match:hu,fold:fve,swap:ez,getShow:dve,getEq:pve,getSemigroup:tz,getApply:yy,getApplicative:hve,getChain:nz,getMonad:mve,getLeft:vve,getRight:gve,leftOrBoth:yve,rightOrBoth:bve,getLeftOnly:$ve,getRightOnly:_ve,fromOptions:Sve,bimap:Cw,mapLeft:Aw,map:kw,reduce:az,foldMap:uz,reduceRight:sz,traverse:cz,sequence:Ww,of:lh,URI:mr,Functor:Nw,flap:Tve,Pointed:Ive,Bifunctor:Ove,FromThese:wve,Foldable:Eve,Traversable:Rve,FromEither:Pw,fromOption:Mve,fromOptionK:xve,elem:Cve,exists:Ave,toTuple2:Fw,toTuple:kve,ApT:lz,traverseReadonlyNonEmptyArrayWithIndex:Dw,traverseReadonlyArrayWithIndex:Wve,these:Nve},Symbol.toStringTag,{value:"Module"}));function by(e){return Z(Hn,e.of)}function $y(e){return Z(sn,e.of)}function Lw(e){return Z(Xe,e.of)}function jw(e){return function(t){return e.map(t,Hn)}}function Uw(e){return function(t){return e.map(t,sn)}}function Bw(e){return Lc(e,Nw)}function zw(e,t){return So(e,yy(t))}function qw(e,t){var n=$y(e);return function(r){return function(i){return e.chain(i,hu(n,r,function(o,a){return e.map(r(a),hu(function(u){return sn(t.concat(o,u))},function(u){return Xe(o,u)},function(u,s){return Xe(t.concat(o,u),s)}))}))}}}function Kw(e){return function(t,n){return function(r){return e.map(r,Cw(t,n))}}}function Vw(e){return function(t){return function(n){return e.map(n,Aw(t))}}}function fz(e){return function(t,n,r){return function(i){return e.map(i,hu(t,n,r))}}}function Hw(e){return function(t,n,r){return function(i){return e.chain(i,hu(t,n,r))}}}function Jw(e){return function(t){return e.map(t,ez)}}function Gw(e){return function(t,n){return function(r){return e.map(r,Fw(t,n))}}}function Fve(e){var t=Bw(e),n=Kw(e),r=Vw(e),i=Hw(e),o=Gw(e),a=by(e),u=function(s,c){return m(s,t(c))};return{map:u,bimap:function(s,c,l){return m(s,n(c,l))},mapLeft:function(s,c){return m(s,r(c))},fold:function(s,c,l,f){return m(s,i(c,l,f))},swap:Jw(e),rightM:jw(e),leftM:Uw(e),left:$y(e),right:by(e),both:Lw(e),toTuple:function(s,c,l){return m(s,o(function(){return c},function(){return l}))},getMonad:function(s){var c=zw(e,s),l=qw(e,s);return{_E:void 0,map:u,of:a,ap:function(f,d){return m(f,c(d))},chain:function(f,d){return m(f,l(d))}}}}}const Dve=Object.freeze(Object.defineProperty({__proto__:null,right:by,left:$y,both:Lw,rightF:jw,leftF:Uw,map:Bw,ap:zw,chain:qw,bimap:Kw,mapLeft:Vw,match:fz,matchE:Hw,swap:Jw,toTuple2:Gw,getTheseM:Fve},Symbol.toStringTag,{value:"Module"}));var Lve=$y(en),dz=by(en),jve=Lw(en),Yw=jw(Pe),pz=Uw(Pe),hz=Z(wn,Yw),Uve=Z(wn,pz),mz=vn,vz=vn,_y=hz,Bve=wn,Zw=Yw,gz=fz(Pe),zve=gz,yz=Hw(zt),bz=yz,$z=bz,qve=$z,Kve=Jw(Pe),Js=function(e,t){return m(e,_z(t))},Xw=function(e,t,n){return m(e,Sz(t,n))},Qw=function(e,t){return m(e,Tz(t))},_z=Bw(Pe),Sz=Kw(Pe),Tz=Vw(Pe),fh=dz,Mn="TaskThese",e1=function(e,t){var n=zw(e,t);return{URI:Mn,_E:void 0,map:Js,ap:function(r,i){return m(r,n(i))}}};function Iz(e,t){var n=e1(e,t).ap;return{URI:Mn,_E:void 0,map:Js,ap:n,of:fh}}function Oz(e){var t=e1(xp,e),n=qw(zt,e);return{URI:Mn,_E:void 0,map:Js,ap:t.ap,chain:function(r,i){return m(r,n(i))}}}function Vve(e){var t=Iz(xp,e),n=Oz(e);return{URI:Mn,_E:void 0,map:Js,ap:t.ap,of:fh,chain:n.chain,fromIO:_y,fromTask:Zw}}var wz={URI:Mn,map:Js},Hve=De(wz),Jve={URI:Mn,of:fh},Gve={URI:Mn,bimap:Xw,mapLeft:Qw},Sy={URI:Mn,fromEither:mz},Yve=Di(Sy),Zve=Li(Sy),Xve=Ua(Sy),Ez={URI:Mn,fromThese:vz},Qve=gP(Ez),Rz={URI:Mn,fromIO:_y},ege=Vi(Rz),Mz={URI:Mn,fromIO:_y,fromTask:Zw},tge=Ss(Mz),xz=Gw(Pe),t1=fh(Yt),Cz=function(e){var t=Dw(e);return function(n){return Z(Gl(n),iu(t(Dn)))}},nge=function(e){return function(t){var n=Cz(e)(t);return function(r){return ft(r)?n(r):t1}}},Az=function(e){return function(t){return function(n){return function(){return Dc(n).reduce(function(r,i,o){return r.then(function(a){return Ke(a)?r:t(o+1,i)().then(function(u){if(Ke(u))return u;if(Vs(u)){var s=a.right;return s.push(u.right),Vs(a)?Xe(e.concat(a.left,u.left),s):Xe(u.left,s)}return a.right.push(u.right),a})})},t(0,or(n))().then(kw(dd)))}}}},rge=function(e){return function(t){var n=Az(e)(t);return function(r){return ft(r)?n(r):t1}}},ige={URI:Mn,map:Js},oge={URI:Mn,bimap:Xw,mapLeft:Qw},age=function(e,t){return xz(function(){return e},function(){return t})},uge={URI:Mn,map:Js,bimap:Xw,mapLeft:Qw},sge=function(e,t){return Ut($g)(tz(e,t))};const cge=Object.freeze(Object.defineProperty({__proto__:null,left:Lve,right:dz,both:jve,rightTask:Yw,leftTask:pz,rightIO:hz,leftIO:Uve,fromEither:mz,fromThese:vz,fromIO:_y,fromIOEither:Bve,fromTask:Zw,match:gz,matchW:zve,matchE:yz,fold:bz,matchEW:$z,foldW:qve,swap:Kve,map:_z,bimap:Sz,mapLeft:Tz,of:fh,URI:Mn,getApply:e1,getApplicative:Iz,getChain:Oz,getMonad:Vve,Functor:wz,flap:Hve,Pointed:Jve,Bifunctor:Gve,FromEither:Sy,fromOption:Yve,fromOptionK:Zve,fromPredicate:Xve,FromThese:Ez,fromTheseK:Qve,FromIO:Rz,fromIOK:ege,FromTask:Mz,fromTaskK:tge,toTuple2:xz,ApT:t1,traverseReadonlyNonEmptyArrayWithIndex:Cz,traverseReadonlyArrayWithIndex:nge,traverseReadonlyNonEmptyArrayWithIndexSeq:Az,traverseReadonlyArrayWithIndexSeq:rge,functorTaskThese:ige,bifunctorTaskThese:oge,toTuple:age,taskThese:uge,getSemigroup:sge},Symbol.toStringTag,{value:"Module"}));function lge(e,t){return function(n){return n(t(n(e.empty)))}}function fge(e){return function(t){return[e(t),t]}}function dge(e){return function(t){return function(n){return[t(n),e(n)]}}}function pge(e){return function(t){return function(n){return t(e(n))}}}function hge(e){function t(r,i){return function(o){return i(function(a){return r(e.concat(o,a))})}}function n(r){return r(e.empty)}return{URI:n1,_E:void 0,map:kz,extend:t,extract:n}}var kz=function(e,t){return m(e,Wz(t))},Wz=function(e){return function(t){return function(n){return e(t(n))}}},n1="Traced",r1={URI:n1,map:kz},mge=De(r1),vge=r1;const gge=Object.freeze(Object.defineProperty({__proto__:null,tracks:lge,listen:fge,listens:dge,censor:pge,getComonad:hge,map:Wz,URI:n1,Functor:r1,flap:mge,traced:vge},Symbol.toStringTag,{value:"Module"}));function Nz(e,t){return function(n){var r=e.traverse(n),i=t.traverse(n);return function(o){return function(a){return r(a,function(u){return i(u,o)})}}}}function Pz(e,t){return function(n){var r=e.sequence(n),i=t.sequence(n);return function(o){return r(e.map(o,i))}}}function yge(e,t){var n=jc(e,t).map,r=z0(e,t),i=Nz(e,t),o=Pz(e,t);return{map:n,reduce:r.reduce,foldMap:r.foldMap,reduceRight:r.reduceRight,traverse:function(a){var u=i(a);return function(s,c){return m(s,u(c))}},sequence:function(a){var u=o(a);return function(s){return m(s,u)}}}}const bge=Object.freeze(Object.defineProperty({__proto__:null,traverse:Nz,sequence:Pz,getTraversableComposition:yge},Symbol.toStringTag,{value:"Module"})),$ge=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function Fz(e,t){return t===void 0&&(t=[]),{value:e,forest:t}}function _ge(e){var t=function(n){return Ya(n.forest)?"make(".concat(e.show(n.value),")"):"make(".concat(e.show(n.value),", [").concat(n.forest.map(t).join(", "),"])")};return{show:t}}function Sge(e){var t,n=kr(function(r,i){return e.equals(r.value,i.value)&&t.equals(r.forest,i.forest)});return t=SW(n),n}var Dz=function(e,t){for(var n="",r=t.length,i,o=0;o<r;o++){i=t[o];var a=o===r-1;n+=e+(a?"\u2514":"\u251C")+"\u2500 "+i.value,n+=Dz(e+(r>1&&!a?"\u2502 ":" "),i.forest)}return n};function Lz(e){return Dz(`
2
+ `,e)}function Tge(e){return e.value+Lz(e.forest)}function jz(e,t){var n=t(e),r=n[0],i=n[1];return{value:r,forest:Uz(i,t)}}function Uz(e,t){return e.map(function(n){return jz(n,t)})}function Bz(e){var t=zz(e);return function(n,r){return e.chain(r(n),function(i){var o=i[0],a=i[1];return e.map(t(a,r),function(u){return{value:o,forest:u}})})}}function zz(e){var t=Sv(e);return function(n,r){return m(n,t(function(i){return Bz(e)(i,r)}))}}function Ige(e){var t=function(n){return e(n.value,n.forest.map(t))};return t}var mu=function(e,t){return m(e,Iy(t))},pf=function(e,t){return m(e,dh(function(n){return m(t,Iy(n))}))},i1=function(e,t){return m(e,dh(t))},o1=function(e,t,n){return m(e,Oy(t,n))},a1=function(e){var t=Vz(e);return function(n,r){return m(n,t(r))}},u1=function(e,t,n){return m(e,s1(t,n))},qz=function(e,t){return m(e,Ty(t))},Kz=function(e){var t=l1(e);return function(n,r){return m(n,t(r))}},Oge=function(e){return function(t){return pf(t,e)}},dh=function(e){return function(t){var n=e(t.value),r=n.value,i=n.forest,o=g0().concat;return{value:r,forest:o(i,t.forest.map(dh(e)))}}},Ty=function(e){return function(t){return{value:e(t),forest:t.forest.map(Ty(e))}}},wge=Ty(B),Ege=dh(B),Iy=function(e){return function(t){return{value:e(t.value),forest:t.forest.map(Iy(e))}}},Oy=function(e,t){return function(n){for(var r=t(e,n.value),i=n.forest.length,o=0;o<i;o++)r=m(n.forest[o],Oy(r,t));return r}},Vz=function(e){return function(t){return Oy(e.empty,function(n,r){return e.concat(n,t(r))})}},s1=function(e,t){return function(n){for(var r=e,i=n.forest.length,o=i-1;o>=0;o--)r=m(n.forest[o],s1(r,t));return t(n.value,r)}},c1=function(e){return e.value},l1=function(e){var t=Sv(e),n=function(r){return function(i){return e.ap(e.map(r(i.value),function(o){return function(a){return{value:o,forest:a}}}),m(i.forest,t(n(r))))}};return n},f1=function(e){return l1(e)(B)},hf=function(e){return Fz(e)},Ti="Tree",d1={URI:Ti,map:mu},Rge=De(d1),Mge={URI:Ti,of:hf},wy={URI:Ti,map:mu,ap:pf},xge=_t(wy),Cge=St(wy),Age={URI:Ti,map:mu,ap:pf,of:hf},p1={URI:Ti,map:mu,ap:pf,chain:i1},kge={URI:Ti,map:mu,ap:pf,of:hf,chain:i1},Wge=at(p1),Nge={URI:Ti,reduce:o1,foldMap:a1,reduceRight:u1},Pge={URI:Ti,map:mu,reduce:o1,foldMap:a1,reduceRight:u1,traverse:Kz,sequence:f1},Fge={URI:Ti,map:mu,extend:qz,extract:c1},Dge=hf(jt),Lge=It(d1),jge=Ot(p1),Uge=Tt(wy);function Bge(e){var t=function(n,r){return e.equals(n,r.value)||r.forest.some(function(i){return t(n,i)})};return t}var Hz=function(e){return function(t){return e(t.value)||t.forest.some(Hz(e))}},zge={URI:Ti,map:mu,of:hf,ap:pf,chain:i1,reduce:o1,foldMap:a1,reduceRight:u1,traverse:Kz,sequence:f1,extract:c1,extend:qz};const qge=Object.freeze(Object.defineProperty({__proto__:null,make:Fz,getShow:_ge,getEq:Sge,drawForest:Lz,drawTree:Tge,unfoldTree:jz,unfoldForest:Uz,unfoldTreeM:Bz,unfoldForestM:zz,fold:Ige,ap:Oge,chain:dh,extend:Ty,duplicate:wge,flatten:Ege,map:Iy,reduce:Oy,foldMap:Vz,reduceRight:s1,extract:c1,traverse:l1,sequence:f1,of:hf,URI:Ti,Functor:d1,flap:Rge,Pointed:Mge,Apply:wy,apFirst:xge,apSecond:Cge,Applicative:Age,Chain:p1,Monad:kge,chainFirst:Wge,Foldable:Nge,Traversable:Pge,Comonad:Fge,Do:Dge,bindTo:Lge,bind:jge,apS:Uge,elem:Bge,exists:Hz,tree:zge},Symbol.toStringTag,{value:"Module"}));var vr=qt,Jn=yn,Kge=function(e){return[Jn(e),vr(e)]};function h1(e){return{URI:gr,_E:void 0,map:ph,ap:function(t,n){return[vr(t)(vr(n)),e.concat(Jn(t),Jn(n))]}}}var Jz=function(e){return function(t){return[t,e.empty]}};function Vge(e){var t=h1(e);return{URI:gr,_E:void 0,map:t.map,ap:t.ap,of:Jz(e)}}function m1(e){var t=h1(e);return{URI:gr,_E:void 0,map:t.map,ap:t.ap,chain:function(n,r){var i=r(vr(n)),o=i[0],a=i[1];return[o,e.concat(Jn(n),a)]}}}function Hge(e){var t=m1(e);return{URI:gr,_E:void 0,map:t.map,ap:t.ap,chain:t.chain,of:Jz(e)}}function Jge(e){var t=function(r,i){for(var o=i(r),a=e.empty,u=vr(o);u._tag==="Left";)a=e.concat(a,Jn(o)),o=i(u.left),u=vr(o);return[u.right,e.concat(a,Jn(o))]},n=m1(e);return{URI:gr,_E:void 0,map:n.map,ap:n.ap,chain:n.chain,chainRec:t}}var Gz=function(e,t){return m(e,tq(t))},ph=function(e,t){return m(e,b1(t))},Yz=function(e,t,n){return m(e,eq(t,n))},Zz=function(e,t){return m(e,$1(t))},Xz=function(e,t){return m(e,_1(t))},v1=function(e,t,n){return m(e,rq(t,n))},g1=function(e){var t=nq();return function(n,r){return m(n,t(r))}},y1=function(e,t,n){return m(e,iq(t,n))};function Qz(e){var t=oq(e);return function(n,r){return m(n,t(r))}}var eq=function(e,t){return function(n){return[t(vr(n)),e(Jn(n))]}},b1=function(e){return function(t){return[e(vr(t)),Jn(t)]}},$1=function(e){return function(t){return[vr(t),e(Jn(t))]}},tq=function(e){return function(t){return[vr(t),Jn(e)]}},_1=function(e){return function(t){return[e(t),Jn(t)]}},Gge=_1(B),S1=ry,nq=UO,rq=jO,iq=BO,oq=function(e){return function(t){return function(n){return e.map(t(vr(n)),function(r){return[r,Jn(n)]})}}},T1=function(e){return function(t){return e.map(vr(t),function(n){return[n,Jn(t)]})}},gr="Tuple",aq={URI:gr,map:ph},Yge=De(aq),Zge={URI:gr,bimap:Yz,mapLeft:Zz},Xge={URI:gr,compose:Gz},Qge={URI:gr,map:ph,extend:Xz,extract:S1},eye={URI:gr,reduce:v1,foldMap:g1,reduceRight:y1},tye={URI:gr,map:ph,reduce:v1,foldMap:g1,reduceRight:y1,traverse:Qz,sequence:T1},nye=b1,rye=$1,iye={URI:gr,compose:Gz,map:ph,bimap:Yz,mapLeft:Zz,extract:S1,extend:Xz,reduce:v1,foldMap:g1,reduceRight:y1,traverse:Qz,sequence:T1};const oye=Object.freeze(Object.defineProperty({__proto__:null,fst:vr,snd:Jn,swap:Kge,getApply:h1,getApplicative:Vge,getChain:m1,getMonad:Hge,getChainRec:Jge,bimap:eq,mapFst:b1,mapSnd:$1,compose:tq,extend:_1,duplicate:Gge,extract:S1,foldMap:nq,reduce:rq,reduceRight:iq,traverse:oq,sequence:T1,URI:gr,Functor:aq,flap:Yge,Bifunctor:Zge,Semigroupoid:Xge,Comonad:Qge,Foldable:eye,Traversable:tye,map:nye,mapLeft:rye,tuple:iye},Symbol.toStringTag,{value:"Module"})),aye=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function uye(e,t){var n=XM(t,Ba(e));return{map:n.map,ap:n.ap,of:n.of,chain:function(r,i){return t.chain(r,function(o){return Lt(o)?t.of(_o(o.left)):i(o.right)})},alt:function(r,i){return t.chain(r,function(o){return P$(o)?t.of(o):t.map(i(),function(a){return Lt(a)?_o(e.concat(o.left,a.left)):a})})}}}const sye=Object.freeze(Object.defineProperty({__proto__:null,getValidationM:uye},Symbol.toStringTag,{value:"Module"}));var uq=S_(void 0),cye={concat:uq.concat,empty:void 0};const lye=Object.freeze(Object.defineProperty({__proto__:null,Semigroup:uq,Monoid:cye},Symbol.toStringTag,{value:"Module"}));var fye=function(e){return function(){return[void 0,e]}},dye=function(e){return function(){var t=e(),n=t[0],r=t[1];return[[n,r],r]}},pye=function(e){return function(){var t=e(),n=t[0],r=n[0],i=n[1],o=t[1];return[r,i(o)]}},hye=function(e){return function(t){return function(){var n=t(),r=n[0],i=n[1];return[[r,e(i)],i]}}},mye=function(e){return function(t){return function(){var n=t(),r=n[0],i=n[1];return[r,e(i)]}}},hh=function(e,t){return m(e,sq(t))},sq=function(e){return function(t){return function(){var n=t(),r=n[0],i=n[1];return[e(r),i]}}},Gs="Writer",cq=function(e){return{URI:Gs,_E:void 0,of:function(t){return function(){return[t,e.empty]}}}},I1=function(e){return{URI:Gs,_E:void 0,map:hh,ap:function(t,n){return function(){var r=t(),i=r[0],o=r[1],a=n(),u=a[0],s=a[1];return[i(u),e.concat(o,s)]}}}},lq=function(e){var t=I1(e),n=cq(e);return{URI:Gs,_E:void 0,map:hh,ap:t.ap,of:n.of}};function fq(e){var t=I1(e);return{URI:Gs,_E:void 0,map:hh,ap:t.ap,chain:function(n,r){return function(){var i=n(),o=i[0],a=i[1],u=r(o)(),s=u[0],c=u[1];return[s,e.concat(a,c)]}}}}function vye(e){var t=lq(e),n=fq(e);return{URI:Gs,_E:void 0,map:hh,ap:t.ap,of:t.of,chain:n.chain}}var O1={URI:Gs,map:hh},gye=De(O1),yye=function(e){return e()[0]},bye=function(e){return e()[1]},$ye=function(e){return e()[0]},_ye=function(e){return e()[1]},Sye=O1;const Tye=Object.freeze(Object.defineProperty({__proto__:null,tell:fye,listen:dye,pass:pye,listens:hye,censor:mye,map:sq,URI:Gs,getPointed:cq,getApply:I1,getApplicative:lq,getChain:fq,getMonad:vye,Functor:O1,flap:gye,evaluate:yye,execute:bye,evalWriter:$ye,execWriter:_ye,writer:Sye},Symbol.toStringTag,{value:"Module"}));function Iye(e){var t=function(n,r){return function(){return e.map(n(),function(i){var o=i[0],a=i[1];return[r(o),a]})}};return{map:t,evalWriter:function(n){return e.map(n(),function(r){var i=r[0];return i})},execWriter:function(n){return e.map(n(),function(r){r[0];var i=r[1];return i})},tell:function(n){return function(){return e.of([void 0,n])}},listen:function(n){return function(){return e.map(n(),function(r){var i=r[0],o=r[1];return[[i,o],o]})}},pass:function(n){return function(){return e.map(n(),function(r){var i=r[0],o=i[0],a=i[1],u=r[1];return[o,a(u)]})}},listens:function(n,r){return function(){return e.map(n(),function(i){var o=i[0],a=i[1];return[[o,r(a)],a]})}},censor:function(n,r){return function(){return e.map(n(),function(i){var o=i[0],a=i[1];return[o,r(a)]})}},getMonad:function(n){return{_E:void 0,map:t,of:function(r){return function(){return e.of([r,n.empty])}},ap:function(r,i){return function(){return e.chain(r(),function(o){var a=o[0],u=o[1];return e.map(i(),function(s){var c=s[0],l=s[1];return[a(c),n.concat(u,l)]})})}},chain:function(r,i){return function(){return e.chain(r(),function(o){var a=o[0],u=o[1];return e.map(i(a)(),function(s){var c=s[0],l=s[1];return[c,n.concat(u,l)]})})}}}}}}const dq=Fa(Object.freeze(Object.defineProperty({__proto__:null,alt:QJ,alternative:t7,applicative:QH,apply:ZH,array:kW,bifunctor:DZ,boolean:VZ,booleanAlgebra:ZZ,bounded:tX,boundedDistributiveLattice:iX,boundedJoinSemilattice:oX,boundedLattice:aX,boundedMeetSemilattice:uX,category:sX,chain:e6,chainRec:t6,choice:fX,comonad:dX,compactable:nQ,console:uQ,const:SQ,contravariant:TQ,date:CQ,distributiveLattice:nX,either:xx,eitherT:kQ,endomorphism:NQ,extend:PQ,field:LQ,filterable:UQ,filterableWithIndex:BQ,foldable:JQ,foldableWithIndex:YQ,fromEither:n6,fromIO:ZQ,fromReader:bee,fromState:Lee,fromTask:jee,fromThese:Uee,function:ZM,functor:XH,functorWithIndex:zee,group:qee,heytingAlgebra:Kee,hkt:Vee,identity:hte,invariant:mte,io:Wte,ioEither:Wne,ioOption:Ere,ioRef:Mre,joinSemilattice:xre,json:kre,lattice:Wre,magma:C7,map:zie,meetSemilattice:qie,monad:Kie,monadIO:Vie,monadTask:Hie,monadThrow:Jie,monoid:uoe,naturalTransformation:soe,nonEmptyArray:_9,number:R9,option:bN,optionT:Pne,ord:E7,ordering:moe,pipeable:koe,pointed:Woe,predicate:gX,profunctor:Noe,random:Loe,reader:yee,readerEither:Nae,readerT:Dae,readerTaskEither:ble,readonlyArray:eY,readonlyMap:uie,readonlyNonEmptyArray:M8,readonlyRecord:lfe,readonlySet:Efe,readonlyTuple:Bfe,readerTask:Vue,record:zde,refinement:Xde,ring:npe,semigroup:UC,semigroupoid:rpe,semiring:ope,separated:s6,set:Epe,eq:p7,show:kpe,state:Dee,stateReaderTaskEither:Hhe,stateT:Npe,store:nme,string:Ple,strong:ome,struct:sme,task:lue,taskEither:nce,taskOption:cve,taskThese:cge,these:Pve,theseT:Dve,traced:gge,traversable:bge,traversableWithIndex:$ge,tree:qge,tuple:oye,unfoldable:aye,validationT:sye,void:lye,witherable:c6,writer:Tye,writerT:Object.freeze(Object.defineProperty({__proto__:null,getWriterM:Iye},Symbol.toStringTag,{value:"Module"})),zero:M9},Symbol.toStringTag,{value:"Module"})));function pq(e,t,n){return n===void 0&&(n=e.name),new be(n,e.is,e.validate,function(r){return t(e.encode(r))})}const Oye=Fa(Object.freeze(Object.defineProperty({__proto__:null,mapOutput:pq},Symbol.toStringTag,{value:"Module"})));Object.defineProperty(je,"__esModule",{value:!0}),je.addType=je.isEmpty=je.objectToMap=je.grouped=je.formatDate=je.formatDateTime=je.filterDouble=je.refineType=je.nullable=void 0;const wye=ee.exports,Eye=dq,Rye=ur,mf=(0,wye.__importStar)(ie),Mye=Oye;function xye(e){return mf.union([e,mf.null,mf.undefined])}je.nullable=xye;function Cye(e,t,n){return new mf.Type(t,e.is,(r,i)=>(0,Rye.pipe)(e.validate(r,i),Eye.either.chain(o=>n(o)?mf.success(o):mf.failure(r,i))),e.encode)}je.refineType=Cye;function Aye(e){if(e==="")return null;const t=Number(e);return Number.isNaN(t)?null:t}je.filterDouble=Aye;function kye(e){return e.toISOString().replace(/\.\d{3}Z$/,"+0000")}je.formatDateTime=kye;function Wye(e){return e.toISOString().replace(/T.*/,"")}je.formatDate=Wye;function Nye(e,t){return e.reduce((n,r,i)=>(i%t===0?n.push([r]):n[Math.floor(i/t)].push(r),n),new Array)}je.grouped=Nye;function Pye(e){return new Map(Object.entries(e))}je.objectToMap=Pye;function Fye(e){for(const t in e)return!1;return!0}je.isEmpty=Fye;function Dye(e,t){return(0,Mye.mapOutput)(e,n=>({...n,__TYPE__:t}))}je.addType=Dye;var w1={};Object.defineProperty(w1,"__esModule",{value:!0});const Lye=ee.exports,jye=Sn,Uye=ur,Ys=(0,Lye.__importStar)(ie);w1.default=new Ys.Type("IntFromNumber",Ys.Int.is,(e,t)=>(0,Uye.pipe)(Ys.number.validate(e,t),(0,jye.chain)(n=>Ys.Int.is(n)?Ys.success(n):Ys.success(Math.round(n)))),Ys.Int.encode);var E1={};Object.defineProperty(E1,"__esModule",{value:!0});const Bye=ee.exports,zye=Sn,qye=ur,vf=(0,Bye.__importStar)(ie),Kye=/^([0-9]+)px$/;E1.default=new vf.Type("IntFromPixels",vf.Int.is,(e,t)=>(0,qye.pipe)(vf.string.validate(e,t),(0,zye.chain)(n=>{try{const r=n.match(Kye);if(!r)return vf.failure(e,t);const i=parseInt(r[1]);return vf.success(i)}catch{return vf.failure(e,t)}})),String);var R1={};Object.defineProperty(R1,"__esModule",{value:!0});const Vye=ee.exports,Hye=(0,Vye.__importStar)(ie),Jye=je;R1.default=(0,Jye.refineType)(Hye.string,"nonEmptyString",e=>e.trim().length>0);var M1={},Ey={};Object.defineProperty(Ey,"__esModule",{value:!0});const Gye=ee.exports,Yye=(0,Gye.__importStar)(ie),Zye=je;Ey.default=(0,Zye.nullable)(Yye.string),Object.defineProperty(M1,"__esModule",{value:!0});const Xye=ee.exports,Qye=Sn,ebe=ur,x1=ie,tbe=(0,Xye.__importDefault)(Ey);M1.default=new x1.Type("nonEmptyStringOrNull",e=>typeof e=="string"||e===null,(e,t)=>(0,ebe.pipe)(tbe.default.validate(e,t),(0,Qye.chain)(n=>typeof n=="string"&&n.length>0?(0,x1.success)(n):(0,x1.success)(null))),e=>e);var C1={};Object.defineProperty(C1,"__esModule",{value:!0});const nbe=ee.exports,rbe=(0,nbe.__importStar)(ie),ibe=je;C1.default=(0,ibe.nullable)(rbe.number);var A1={};Object.defineProperty(A1,"__esModule",{value:!0});const obe=ee.exports,abe=Sn,ube=ur,Ry=(0,obe.__importStar)(ie);A1.default=new Ry.Type("StringFromInt",Ry.string.is,(e,t)=>(0,ube.pipe)(Ry.boolean.validate(e,t),(0,abe.chain)(n=>Ry.success(n.toString()))),e=>e);var k1={};Object.defineProperty(k1,"__esModule",{value:!0});const sbe=ee.exports,cbe=Sn,lbe=ur,My=(0,sbe.__importStar)(ie);k1.default=new My.Type("StringFromInt",My.string.is,(e,t)=>(0,lbe.pipe)(My.number.validate(e,t),(0,cbe.chain)(n=>My.success(n.toString()))),e=>e),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.StringOrNull=e.StringFromNumber=e.StringFromBoolean=e.NumberOrNull=e.NonEmptyStringOrNull=e.NonEmptyString=e.IntFromPixels=e.IntFromNumber=e.Function=e.DateFromTsMs=e.DateFromStringOrNumber=e.DateFromString=void 0;const t=ee.exports;var n=v_;Object.defineProperty(e,"DateFromString",{enumerable:!0,get:function(){return(0,t.__importDefault)(n).default}});var r=g_;Object.defineProperty(e,"DateFromStringOrNumber",{enumerable:!0,get:function(){return(0,t.__importDefault)(r).default}});var i=y_;Object.defineProperty(e,"DateFromTsMs",{enumerable:!0,get:function(){return(0,t.__importDefault)(i).default}}),e.Function=(0,t.__importStar)(je);var o=w1;Object.defineProperty(e,"IntFromNumber",{enumerable:!0,get:function(){return(0,t.__importDefault)(o).default}});var a=E1;Object.defineProperty(e,"IntFromPixels",{enumerable:!0,get:function(){return(0,t.__importDefault)(a).default}});var u=R1;Object.defineProperty(e,"NonEmptyString",{enumerable:!0,get:function(){return(0,t.__importDefault)(u).default}});var s=M1;Object.defineProperty(e,"NonEmptyStringOrNull",{enumerable:!0,get:function(){return(0,t.__importDefault)(s).default}});var c=C1;Object.defineProperty(e,"NumberOrNull",{enumerable:!0,get:function(){return(0,t.__importDefault)(c).default}});var l=A1;Object.defineProperty(e,"StringFromBoolean",{enumerable:!0,get:function(){return(0,t.__importDefault)(l).default}});var f=k1;Object.defineProperty(e,"StringFromNumber",{enumerable:!0,get:function(){return(0,t.__importDefault)(f).default}});var d=Ey;Object.defineProperty(e,"StringOrNull",{enumerable:!0,get:function(){return(0,t.__importDefault)(d).default}})}(Ze);var Ii={},W1={},N1={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EmptyContent=e.EmptyContentType=void 0,e.EmptyContentType="EmptyContent",e.EmptyContent={is:t=>t.__TYPE__===e.EmptyContentType}})(N1);var xy={};const hq=Fa(kW),vu=Fa(bN);var Cy={},Ay={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.BooleanContentType=void 0;const t=ee.exports,n=Sn,r=(0,t.__importStar)(ie);e.BooleanContentType="BooleanContent";const i=new r.Type("BooleanContent",o=>{var a;return((a=o)===null||a===void 0?void 0:a.__TYPE__)===e.BooleanContentType},(o,a)=>n.Chain.chain(r.boolean.validate(o,a),u=>r.success({value:u,__TYPE__:e.BooleanContentType})),o=>r.boolean.encode(o.value));e.default=i})(Ay);var mh={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EmbedContent=e.EmbedContentType=void 0;const t=ee.exports,n=dq,r=ur,i=(0,t.__importStar)(ie),o=Ze,a=je;e.EmbedContentType="EmbedContent",e.EmbedContent=new i.Type("EmbedContent",s=>s.__TYPE__===e.EmbedContentType,s=>(0,r.pipe)(u.decode(s),n.either.map(c=>({...u.encode(c),all:s}))),s=>u.encode(s));const u=(0,a.addType)(i.exact(i.intersection([i.type({embed_url:i.string,type:i.string}),i.partial({version:i.union([i.string,i.number,i.null]),title:o.StringOrNull,author_name:o.StringOrNull,author_url:o.StringOrNull,provider_name:o.StringOrNull,provider_url:o.StringOrNull,cache_age:i.union([i.string,i.number,i.null]),thumbnail_url:o.StringOrNull,thumbnail_width:o.NumberOrNull,thumbnail_height:o.NumberOrNull,html:o.StringOrNull})])),e.EmbedContentType)})(mh);var Zs={};Object.defineProperty(Zs,"__esModule",{value:!0}),Zs.FieldContentType=void 0;const mq=ee.exports,fbe=ur,vq=(0,mq.__importStar)(vu),dbe=(0,mq.__importStar)(ie);Zs.FieldContentType="FieldContent";function pbe(e){let t=0;for(;t<e.length&&e[t]<=" ";)t++;let n=e.length;for(;t<n&&e[n-1]<=" ";)n--;return e.substring(t,n)}const hbe={types:["Text","Date","Timestamp","Color","Number","Range","Select"],forType:(e,t)=>(0,fbe.pipe)(vq.fromEither(dbe.string.decode(t)),vq.map(n=>({value:pbe(n),type:e,__TYPE__:"FieldContent"})))};Zs.default=hbe;var ky={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.GeoPointContent=e.GeoPointContentType=void 0;const t=ee.exports,n=(0,t.__importStar)(ie),r=je;e.GeoPointContentType="GeoPointContent",e.GeoPointContent=(0,r.addType)(n.strict({position:n.strict({lat:n.number,lng:n.number})}),e.GeoPointContentType)})(ky);var vh={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ImageContent=e.ImageContentType=e.ImageContentView=void 0;const t=ee.exports,n=(0,t.__importStar)(ie),r=Ze,i=je,o=n.exact(n.type({id:n.string,url:n.string,width:n.number,height:n.number}));e.ImageContentView=n.exact(n.intersection([n.type({origin:o,width:n.number,height:n.number,edit:n.type({zoom:n.number,crop:n.type({x:n.number,y:n.number}),background:n.string})}),n.partial({url:n.string,credits:r.NonEmptyStringOrNull,alt:r.NonEmptyStringOrNull,provider:r.StringOrNull})])),e.ImageContentType="ImageContent",e.ImageContent=(0,i.addType)(n.intersection([e.ImageContentView,n.partial({thumbnails:n.record(n.string,e.ImageContentView)})]),e.ImageContentType)})(vh);var Wy={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.IntegrationFieldsContentType=void 0;const t=ee.exports,n=Sn,r=(0,t.__importStar)(ie);e.IntegrationFieldsContentType="IntegrationFieldsContent";const i=new r.Type("IntegrationFieldsContent",o=>{var a;return((a=o)===null||a===void 0?void 0:a.__TYPE__)===e.IntegrationFieldsContentType},(o,a)=>n.Chain.chain(r.string.validate(o,a),u=>r.success({value:u,__TYPE__:e.IntegrationFieldsContentType})),()=>{throw new Error("Not implemented - Not used - Not relevant")});e.default=i})(Wy);var P1={},F1={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isDocumentLink=e.DocumentLink=e.DocumentLinkType=void 0;const t=ee.exports,n=(0,t.__importStar)(ie),r=Ze,i=je;e.DocumentLinkType="DocumentLink",e.DocumentLink=(0,i.addType)(n.strict({id:r.NonEmptyString}),e.DocumentLinkType);function o(a){return a.__TYPE__===e.DocumentLinkType}e.isDocumentLink=o})(F1);var D1={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isExternalLink=e.ExternalLink=e.ExternalLinkType=void 0;const t=ee.exports,n=(0,t.__importStar)(ie),r=Ze,i=je;e.ExternalLinkType="ExternalLink",e.ExternalLink=(0,i.addType)(n.exact(n.intersection([n.type({url:n.string}),n.partial({kind:n.literal("web"),target:r.StringOrNull,preview:(0,i.nullable)(n.partial({title:n.string}))})])),e.ExternalLinkType);function o(a){return a.__TYPE__===e.ExternalLinkType}e.isExternalLink=o})(D1);var L1={},Ny={},mbe=se&&se.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),vbe=se&&se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),gbe=se&&se.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.hasOwnProperty.call(e,n)&&mbe(t,e,n);return vbe(t,e),t};Object.defineProperty(Ny,"__esModule",{value:!0}),Ny.mapOutput=void 0;var ybe=gbe(ie);function bbe(e,t,n){return n===void 0&&(n=e.name),new ybe.Type(n,e.is,e.validate,function(r){return t(e.encode(r))})}Ny.mapOutput=bbe,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isFileLink=e.FileLink=e.FileLinkType=void 0;const t=ee.exports,n=(0,t.__importStar)(ie),r=Ny,i=je;e.FileLinkType="FileLink",e.FileLink=(0,r.mapOutput)(n.exact(n.intersection([n.type({id:n.string,url:n.string,name:n.string,kind:n.string}),n.partial({date:(0,i.nullable)(n.string),size:(0,i.nullable)(n.string)})])),a=>({...a,size:a.size||"0",__TYPE__:e.FileLinkType}));function o(a){return a.__TYPE__===e.FileLinkType}e.isFileLink=o}(L1);var j1={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isImageLink=e.ImageLink=e.ImageLinkType=void 0;const t=ee.exports,n=(0,t.__importStar)(ie),r=Ze,i=je;e.ImageLinkType="ImageLink",e.ImageLink=(0,i.addType)(n.exact(n.intersection([n.type({id:n.string,url:n.string,height:n.string,width:n.string,size:n.string,name:n.string,kind:n.string}),n.partial({date:r.StringOrNull})])),e.ImageLinkType);function o(a){return a.__TYPE__===e.ImageLinkType}e.isImageLink=o})(j1);var U1={},gq;function yq(){return gq||(gq=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.LinkContent=e.LinkContentType=void 0;const t=ee.exports,n=Sn,r=(0,t.__importStar)(ie),i=gf();e.LinkContentType="LinkContent",e.LinkContent=new r.Type("LinkContent",o=>{var a;return i.Link.is((a=o)===null||a===void 0?void 0:a.value)},(o,a)=>n.Chain.chain(i.Link.validate(o,a),u=>r.success({value:u,__TYPE__:e.LinkContentType})),o=>i.Link.encode(o.value))}(U1)),U1}var bq;function gf(){return bq||(bq=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.LinksTypes=e.is=e.BROKEN_CUSTOM_TYPE=e.LinkContent=e.ImageLink=e.FileLink=e.ExternalLink=e.DocumentLink=e.Link=void 0;const t=ee.exports,n=(0,t.__importStar)(ie),r=F1,i=D1,o=L1,a=j1,u=yq();e.Link=n.union([a.ImageLink,o.FileLink,r.DocumentLink,i.ExternalLink]);var s=F1;Object.defineProperty(e,"DocumentLink",{enumerable:!0,get:function(){return s.DocumentLink}});var c=D1;Object.defineProperty(e,"ExternalLink",{enumerable:!0,get:function(){return c.ExternalLink}});var l=L1;Object.defineProperty(e,"FileLink",{enumerable:!0,get:function(){return l.FileLink}});var f=j1;Object.defineProperty(e,"ImageLink",{enumerable:!0,get:function(){return f.ImageLink}});var d=yq();Object.defineProperty(e,"LinkContent",{enumerable:!0,get:function(){return d.LinkContent}}),e.BROKEN_CUSTOM_TYPE="broken_type",e.is={documentLink:r.isDocumentLink,fileLink:o.isFileLink,externalLink:i.isExternalLink,imageLink:a.isImageLink},e.LinksTypes={DocumentLink:r.DocumentLinkType,FileLink:o.FileLinkType,ExternalLink:i.ExternalLinkType,ImageLink:a.ImageLinkType,LinkContent:u.LinkContentType}}(P1)),P1}var Py={},Xs={},xe={},Fy={},pt={};Object.defineProperty(pt,"__esModule",{value:!0}),pt.WidgetTypes=void 0,pt.WidgetTypes={Text:"Text",RichText:"StructuredText",Color:"Color",Image:"Image",Date:"Date",Timestamp:"Timestamp",Number:"Number",Range:"Range",Select:"Select",Link:"Link",Embed:"Embed",GeoPoint:"GeoPoint",Separator:"Separator",UID:"UID",BooleanField:"Boolean",IntegrationField:"IntegrationFields",Group:"Group",Slices:"Slices",LegacySlices:"Choice"},Object.defineProperty(Fy,"__esModule",{value:!0});const $be=ee.exports,ro=(0,$be.__importStar)(ie),_be=Ze,Sbe=pt,Tbe=ro.exact(ro.partial({label:_be.StringOrNull,default_value:ro.boolean,placeholder_true:ro.string,placeholder_false:ro.string})),Ibe=ro.exact(ro.intersection([ro.type({type:ro.literal(Sbe.WidgetTypes.BooleanField)}),ro.partial({config:Tbe})]));Fy.default=Ibe;var Dy={};Object.defineProperty(Dy,"__esModule",{value:!0});const Obe=ee.exports,gu=(0,Obe.__importStar)(ie),$q=Ze,wbe=pt,Ebe=gu.exact(gu.partial({label:$q.StringOrNull,placeholder:gu.string})),Rbe=gu.exact(gu.intersection([gu.type({type:gu.literal(wbe.WidgetTypes.Color)}),gu.partial({fieldset:$q.StringOrNull,config:Ebe})]));Dy.default=Rbe;var Ly={};Object.defineProperty(Ly,"__esModule",{value:!0});const Mbe=ee.exports,oa=(0,Mbe.__importStar)(ie),_q=Ze,xbe=pt,Cbe=oa.exact(oa.partial({label:_q.StringOrNull,placeholder:oa.string,default:oa.string})),Abe=oa.exact(oa.intersection([oa.type({type:oa.literal(xbe.WidgetTypes.Date)}),oa.partial({fieldset:_q.StringOrNull,config:Cbe})]));Ly.default=Abe;var jy={};Object.defineProperty(jy,"__esModule",{value:!0});const kbe=ee.exports,aa=(0,kbe.__importStar)(ie),Sq=Ze,Wbe=pt,Nbe=aa.exact(aa.partial({label:Sq.StringOrNull,placeholder:aa.string,useAsTitle:aa.boolean})),Pbe=aa.exact(aa.intersection([aa.type({type:aa.literal(Wbe.WidgetTypes.Embed)}),aa.partial({fieldset:Sq.StringOrNull,config:Nbe})]));jy.default=Pbe;var Uy={};Object.defineProperty(Uy,"__esModule",{value:!0});const Fbe=ee.exports,Qs=(0,Fbe.__importStar)(ie),Tq=Ze,Dbe=pt,Lbe=Qs.exact(Qs.partial({label:Tq.StringOrNull})),jbe=Qs.exact(Qs.intersection([Qs.type({type:Qs.literal(Dbe.WidgetTypes.GeoPoint)}),Qs.partial({fieldset:Tq.StringOrNull,config:Lbe})]));Uy.default=jbe;var By={},gh={},zy={},yf={},ec={};Object.defineProperty(ec,"__esModule",{value:!0}),ec.pipe=ec.pipeable=void 0;var B1=Da,Ube=function(e){return typeof e.map=="function"},Bbe=function(e){return typeof e.contramap=="function"},zbe=function(e){return typeof e.mapWithIndex=="function"},qbe=function(e){return typeof e.ap=="function"},Kbe=function(e){return typeof e.chain=="function"},Vbe=function(e){return typeof e.bimap=="function"},Hbe=function(e){return typeof e.extend=="function"},Jbe=function(e){return typeof e.reduce=="function"},Gbe=function(e){return typeof e.reduceWithIndex=="function"},Ybe=function(e){return typeof e.alt=="function"},Zbe=function(e){return typeof e.compact=="function"},Xbe=function(e){return typeof e.filter=="function"},Qbe=function(e){return typeof e.filterWithIndex=="function"},e$e=function(e){return typeof e.promap=="function"},t$e=function(e){return typeof e.compose=="function"},n$e=function(e){return typeof e.throwError=="function"};function r$e(e){var t={};if(Ube(e)){var n=function(S){return function(_){return e.map(_,S)}};t.map=n}if(Bbe(e)){var r=function(S){return function(_){return e.contramap(_,S)}};t.contramap=r}if(zbe(e)){var i=function(S){return function(_){return e.mapWithIndex(_,S)}};t.mapWithIndex=i}if(qbe(e)){var o=function(S){return function(_){return e.ap(_,S)}},a=function(S){return function(_){return e.ap(e.map(_,function(U){return function(){return U}}),S)}};t.ap=o,t.apFirst=a,t.apSecond=function(S){return function(_){return e.ap(e.map(_,function(){return function(U){return U}}),S)}}}if(Kbe(e)){var u=function(S){return function(_){return e.chain(_,S)}},s=function(S){return function(_){return e.chain(_,function(U){return e.map(S(U),function(){return U})})}},c=function(S){return e.chain(S,B1.identity)};t.chain=u,t.chainFirst=s,t.flatten=c}if(Vbe(e)){var l=function(S,_){return function(U){return e.bimap(U,S,_)}},f=function(S){return function(_){return e.mapLeft(_,S)}};t.bimap=l,t.mapLeft=f}if(Hbe(e)){var d=function(S){return function(_){return e.extend(_,S)}},p=function(S){return e.extend(S,B1.identity)};t.extend=d,t.duplicate=p}if(Jbe(e)){var h=function(S,_){return function(U){return e.reduce(U,S,_)}},v=function(S){var _=e.foldMap(S);return function(U){return function(Y){return _(Y,U)}}},y=function(S,_){return function(U){return e.reduceRight(U,S,_)}};t.reduce=h,t.foldMap=v,t.reduceRight=y}if(Gbe(e)){var b=function(S,_){return function(U){return e.reduceWithIndex(U,S,_)}},w=function(S){var _=e.foldMapWithIndex(S);return function(U){return function(Y){return _(Y,U)}}},F=function(S,_){return function(U){return e.reduceRightWithIndex(U,S,_)}};t.reduceWithIndex=b,t.foldMapWithIndex=w,t.reduceRightWithIndex=F}if(Ybe(e)){var g=function(S){return function(_){return e.alt(_,S)}};t.alt=g}if(Zbe(e)&&(t.compact=e.compact,t.separate=e.separate),Xbe(e)){var I=function(S){return function(_){return e.filter(_,S)}},T=function(S){return function(_){return e.filterMap(_,S)}},k=function(S){return function(_){return e.partition(_,S)}},E=function(S){return function(_){return e.partitionMap(_,S)}};t.filter=I,t.filterMap=T,t.partition=k,t.partitionMap=E}if(Qbe(e)){var H=function(S){return function(_){return e.filterWithIndex(_,S)}},q=function(S){return function(_){return e.filterMapWithIndex(_,S)}},x=function(S){return function(_){return e.partitionWithIndex(_,S)}},J=function(S){return function(_){return e.partitionMapWithIndex(_,S)}};t.filterWithIndex=H,t.filterMapWithIndex=q,t.partitionWithIndex=x,t.partitionMapWithIndex=J}if(e$e(e)){var O=function(S,_){return function(U){return e.promap(U,S,_)}};t.promap=O}if(t$e(e)){var R=function(S){return function(_){return e.compose(_,S)}};t.compose=R}if(n$e(e)){var C=function(S){return function(_){return _._tag==="None"?e.throwError(S()):e.of(_.value)}},L=function(S){return S._tag==="Left"?e.throwError(S.left):e.of(S.right)},z=function(S,_){return function(U){return S(U)?e.of(U):e.throwError(_(U))}},j=function(S,_){return function(U){return e.chain(U,function(Y){return S(Y)?e.of(Y):e.throwError(_(Y))})}};t.fromOption=C,t.fromEither=L,t.fromPredicate=z,t.filterOrElse=j}return t}ec.pipeable=r$e,ec.pipe=B1.pipe;var i$e=se&&se.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),o$e=se&&se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a$e=se&&se.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.hasOwnProperty.call(e,n)&&i$e(t,e,n);return o$e(t,e),t};Object.defineProperty(yf,"__esModule",{value:!0}),yf.NumberFromString=void 0;var yh=a$e(ie),u$e=ec,s$e=$o;yf.NumberFromString=new yh.Type("NumberFromString",yh.number.is,function(e,t){return u$e.pipe(yh.string.validate(e,t),s$e.chain(function(n){var r=+n;return isNaN(r)||n.trim()===""?yh.failure(e,t):yh.success(r)}))},String);var c$e=se&&se.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),l$e=se&&se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),f$e=se&&se.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.hasOwnProperty.call(e,n)&&c$e(t,e,n);return l$e(t,e),t};Object.defineProperty(zy,"__esModule",{value:!0}),zy.IntFromString=void 0;var bh=f$e(ie),Iq=yf,d$e=ec,p$e=$o;zy.IntFromString=new bh.Type("IntFromString",bh.Int.is,function(e,t){return d$e.pipe(Iq.NumberFromString.validate(e,t),p$e.chain(function(n){return bh.Int.is(n)?bh.success(n):bh.failure(e,t)}))},Iq.NumberFromString.encode),Object.defineProperty(gh,"__esModule",{value:!0});const h$e=ee.exports,m$e=$o,ua=(0,h$e.__importStar)(ie),v$e=zy,Oq=Ze,wq=new ua.Type("SideConstraints",e=>!e||typeof e=="number",(e,t)=>m$e.either.chain(ua.union([ua.literal("auto"),ua.literal(""),ua.Int,v$e.IntFromString,Oq.IntFromNumber,Oq.IntFromPixels,ua.null]).validate(e,t),n=>n==="auto"||n===""?ua.success(null):ua.success(n)),e=>e),g$e=ua.partial({width:wq,height:wq});gh.default=g$e,Object.defineProperty(By,"__esModule",{value:!0});const Eq=ee.exports,yr=(0,Eq.__importStar)(ie),Rq=Ze,Mq=(0,Eq.__importDefault)(gh),y$e=pt,b$e=yr.exact(yr.intersection([yr.type({name:yr.string}),Mq.default])),$$e=yr.exact(yr.partial({label:Rq.StringOrNull,placeholder:yr.string,constraint:Mq.default,thumbnails:yr.readonlyArray(b$e)})),_$e=yr.exact(yr.intersection([yr.type({type:yr.literal(y$e.WidgetTypes.Image)}),yr.partial({fieldset:Rq.StringOrNull,config:$$e})]));By.default=_$e;var qy={};Object.defineProperty(qy,"__esModule",{value:!0});const S$e=ee.exports,sa=(0,S$e.__importStar)(ie),xq=Ze,T$e=pt,I$e=sa.exact(sa.partial({label:xq.StringOrNull,placeholder:sa.string,catalog:sa.string})),O$e=sa.exact(sa.intersection([sa.type({type:sa.literal(T$e.WidgetTypes.IntegrationField)}),sa.partial({fieldset:xq.StringOrNull,config:I$e})]));qy.default=O$e;var Ky={};Object.defineProperty(Ky,"__esModule",{value:!0});const w$e=ee.exports,E$e=$o,lt=(0,w$e.__importStar)(ie),R$e=Hc,Cq=Ze,M$e=pt,x$e=e=>{if(e instanceof Array&&e.reduce((n,r)=>n&&typeof r=="string",!0))return lt.success(e)},C$e=e=>{if(typeof e=="string")return lt.success([e])},Aq=new lt.Type("MasksArrayString",e=>e instanceof Array,(e,t)=>E$e.either.chain(lt.union([lt.array(lt.string),lt.string]).validate(e,t),n=>x$e(n)||C$e(n)||lt.failure(e,t)),e=>e),A$e=lt.exact(lt.partial({label:Cq.StringOrNull,useAsTitle:lt.boolean,placeholder:lt.string,select:(0,R$e.withFallback)(lt.union([lt.literal("media"),lt.literal("document"),lt.literal("web"),lt.null]),null),customtypes:lt.readonlyArray(lt.string),masks:Aq,tags:Aq,allowTargetBlank:lt.boolean})),k$e=lt.exact(lt.intersection([lt.type({type:lt.literal(M$e.WidgetTypes.Link)}),lt.partial({fieldset:Cq.StringOrNull,config:A$e})]));Ky.default=k$e;var yu={},Vy={};Object.defineProperty(Vy,"__esModule",{value:!0});const W$e=ee.exports,Gn=(0,W$e.__importStar)(ie),z1=yf,kq=Ze,N$e=pt,P$e=Gn.exact(Gn.partial({label:kq.StringOrNull,placeholder:Gn.string,min:Gn.union([Gn.number,z1.NumberFromString]),max:Gn.union([Gn.number,z1.NumberFromString]),step:Gn.union([Gn.number,z1.NumberFromString])})),F$e=Gn.exact(Gn.intersection([Gn.type({type:Gn.literal(N$e.WidgetTypes.Number)}),Gn.partial({fieldset:kq.StringOrNull,config:P$e})]));Vy.default=F$e;var Hy={};Object.defineProperty(Hy,"__esModule",{value:!0});const D$e=ee.exports,Yn=(0,D$e.__importStar)(ie),q1=yf,Wq=Ze,L$e=pt,j$e=Yn.exact(Yn.partial({label:Wq.StringOrNull,placeholder:Yn.string,min:Yn.union([Yn.number,q1.NumberFromString]),max:Yn.union([Yn.number,q1.NumberFromString]),step:Yn.union([Yn.number,q1.NumberFromString])})),U$e=Yn.exact(Yn.intersection([Yn.type({type:Yn.literal(L$e.WidgetTypes.Range)}),Yn.partial({fieldset:Wq.StringOrNull,config:j$e})]));Hy.default=U$e;var Jy={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RichText=e.RichTextConfig=e.RichTextNodeTypeCodec=e.RichTextNodeType=e.DEFAULT_OPTION=void 0;const t=ee.exports,n=$o,r=(0,t.__importStar)(ie),i=Ze,o=(0,t.__importDefault)(gh),a=pt;e.DEFAULT_OPTION="paragraph",e.RichTextNodeType={heading1:"heading1",heading2:"heading2",heading3:"heading3",heading4:"heading4",heading5:"heading5",heading6:"heading6",paragraph:"paragraph",strong:"strong",em:"em",preformatted:"preformatted",hyperlink:"hyperlink",image:"image",embed:"embed",list:"list-item",orderedList:"o-list-item",rtl:"rtl"},e.RichTextNodeTypeCodec=r.keyof({[e.RichTextNodeType.heading1]:null,[e.RichTextNodeType.heading2]:null,[e.RichTextNodeType.heading3]:null,[e.RichTextNodeType.heading4]:null,[e.RichTextNodeType.heading5]:null,[e.RichTextNodeType.heading6]:null,[e.RichTextNodeType.paragraph]:null,[e.RichTextNodeType.strong]:null,[e.RichTextNodeType.em]:null,[e.RichTextNodeType.preformatted]:null,[e.RichTextNodeType.hyperlink]:null,[e.RichTextNodeType.image]:null,[e.RichTextNodeType.embed]:null,[e.RichTextNodeType.list]:null,[e.RichTextNodeType.orderedList]:null,[e.RichTextNodeType.rtl]:null});const u=new r.Type("RichTextOptions",p=>typeof p=="string",(p,h)=>n.either.chain(r.union([r.string,r.null]).validate(p,h),v=>{if(!v)return r.success(e.DEFAULT_OPTION);const b=v.split(",").map(w=>w.trim()).filter(w=>(0,n.getOrElseW)(()=>{})(e.RichTextNodeTypeCodec.decode(w)));return b.length?r.success(b.join(",")):r.success(e.DEFAULT_OPTION)}),p=>p),s=p=>{if(!p)return r.success([])},c=p=>{if(p instanceof Object){const h=p;if(!Object.entries(h).length)return r.success([]);if(h[""])return r.success(h[""].map(y=>y.name));const v=Object.entries(h).reduce((y,[,b])=>y.concat(b.map(w=>w.name)),[]).filter(Boolean);return r.success(v)}},l=p=>{if(p instanceof Array&&p.reduce((v,y)=>v&&typeof y=="string",!0))return r.success(p)},f=p=>{if(typeof p=="string")return r.success([p])},d=new r.Type("RichTextLabels",p=>p instanceof Array,(p,h)=>{const v=r.record(r.string,r.readonlyArray(r.record(r.literal("name"),r.string))),y=r.readonlyArray(r.string);return n.either.chain(r.union([v,y,r.string,r.null]).validate(p,h),b=>s(b)||l(b)||c(b)||f(b)||r.failure(p,h))},p=>p);e.RichTextConfig=r.exact(r.partial({label:i.StringOrNull,placeholder:r.string,useAsTitle:r.boolean,single:u,multi:u,imageConstraint:o.default,labels:d,allowTargetBlank:r.boolean})),e.RichText=r.exact(r.intersection([r.type({type:r.literal(a.WidgetTypes.RichText)}),r.partial({fieldset:i.StringOrNull,config:e.RichTextConfig})]))})(Jy);var Gy={};Object.defineProperty(Gy,"__esModule",{value:!0});const B$e=ee.exports,Ur=(0,B$e.__importStar)(ie),Yy=Ze,z$e=pt,q$e=Ur.exact(Ur.partial({label:Yy.StringOrNull,placeholder:Ur.string,default_value:Ur.string,options:Ur.readonlyArray(Ur.union([Ur.string,Yy.StringFromNumber,Yy.StringFromBoolean]))})),K$e=Ur.exact(Ur.intersection([Ur.type({type:Ur.literal(z$e.WidgetTypes.Select)}),Ur.partial({fieldset:Yy.StringOrNull,config:q$e})]));Gy.default=K$e;var Zy={};Object.defineProperty(Zy,"__esModule",{value:!0});const V$e=ee.exports,tc=(0,V$e.__importStar)(ie),H$e=Ze,J$e=pt,G$e=tc.exact(tc.partial({label:H$e.StringOrNull})),Y$e=tc.exact(tc.intersection([tc.type({type:tc.literal(J$e.WidgetTypes.Separator)}),tc.partial({config:G$e})]));Zy.default=Y$e;var Xy={};Object.defineProperty(Xy,"__esModule",{value:!0});const Z$e=ee.exports,ca=(0,Z$e.__importStar)(ie),Nq=Ze,X$e=pt,Q$e=ca.exact(ca.partial({label:Nq.StringOrNull,useAsTitle:ca.boolean,placeholder:ca.string})),e_e=ca.exact(ca.intersection([ca.type({type:ca.literal(X$e.WidgetTypes.Text)}),ca.partial({fieldset:Nq.StringOrNull,config:Q$e})]));Xy.default=e_e;var Qy={};Object.defineProperty(Qy,"__esModule",{value:!0});const t_e=ee.exports,la=(0,t_e.__importStar)(ie),Pq=Ze,n_e=pt,r_e=la.exact(la.partial({label:Pq.StringOrNull,placeholder:la.string,default:la.string})),i_e=la.exact(la.intersection([la.type({type:la.literal(n_e.WidgetTypes.Timestamp)}),la.partial({fieldset:Pq.StringOrNull,config:r_e})]));Qy.default=i_e,Object.defineProperty(yu,"__esModule",{value:!0});const xn=ee.exports,o_e=(0,xn.__importStar)(ie),a_e=(0,xn.__importDefault)(Fy),u_e=(0,xn.__importDefault)(Dy),s_e=(0,xn.__importDefault)(Ly),c_e=(0,xn.__importDefault)(jy),l_e=(0,xn.__importDefault)(Uy),f_e=(0,xn.__importDefault)(By),d_e=(0,xn.__importDefault)(qy),p_e=(0,xn.__importDefault)(Ky),h_e=(0,xn.__importDefault)(Vy),m_e=(0,xn.__importDefault)(Hy),v_e=Jy,g_e=(0,xn.__importDefault)(Gy),y_e=(0,xn.__importDefault)(Zy),b_e=(0,xn.__importDefault)(Xy),$_e=(0,xn.__importDefault)(Qy),__e=o_e.union([u_e.default,a_e.default,c_e.default,l_e.default,s_e.default,h_e.default,m_e.default,v_e.RichText,g_e.default,y_e.default,b_e.default,$_e.default,p_e.default,f_e.default,d_e.default]);yu.default=__e,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Timestamp=e.Text=e.Separator=e.Select=e.Range=e.Number=e.NestableWidget=e.Link=e.IntegrationField=e.Image=e.GeoPoint=e.Embed=e.Date=e.Color=e.BooleanField=void 0;const t=ee.exports;var n=Fy;Object.defineProperty(e,"BooleanField",{enumerable:!0,get:function(){return(0,t.__importDefault)(n).default}});var r=Dy;Object.defineProperty(e,"Color",{enumerable:!0,get:function(){return(0,t.__importDefault)(r).default}});var i=Ly;Object.defineProperty(e,"Date",{enumerable:!0,get:function(){return(0,t.__importDefault)(i).default}});var o=jy;Object.defineProperty(e,"Embed",{enumerable:!0,get:function(){return(0,t.__importDefault)(o).default}});var a=Uy;Object.defineProperty(e,"GeoPoint",{enumerable:!0,get:function(){return(0,t.__importDefault)(a).default}});var u=By;Object.defineProperty(e,"Image",{enumerable:!0,get:function(){return(0,t.__importDefault)(u).default}});var s=qy;Object.defineProperty(e,"IntegrationField",{enumerable:!0,get:function(){return(0,t.__importDefault)(s).default}});var c=Ky;Object.defineProperty(e,"Link",{enumerable:!0,get:function(){return(0,t.__importDefault)(c).default}});var l=yu;Object.defineProperty(e,"NestableWidget",{enumerable:!0,get:function(){return(0,t.__importDefault)(l).default}});var f=Vy;Object.defineProperty(e,"Number",{enumerable:!0,get:function(){return(0,t.__importDefault)(f).default}});var d=Hy;Object.defineProperty(e,"Range",{enumerable:!0,get:function(){return(0,t.__importDefault)(d).default}}),(0,t.__exportStar)(Jy,e);var p=Gy;Object.defineProperty(e,"Select",{enumerable:!0,get:function(){return(0,t.__importDefault)(p).default}});var h=Zy;Object.defineProperty(e,"Separator",{enumerable:!0,get:function(){return(0,t.__importDefault)(h).default}});var v=Xy;Object.defineProperty(e,"Text",{enumerable:!0,get:function(){return(0,t.__importDefault)(v).default}});var y=Qy;Object.defineProperty(e,"Timestamp",{enumerable:!0,get:function(){return(0,t.__importDefault)(y).default}})}(xe),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Block=e.TextBlock=e.checkEmbedBlock=e.EmbedBlock=e.checkImageBlock=e.ImageBlock=e.ValidatedMetas=e.Span=e.Meta=void 0;const t=ee.exports,n=(0,t.__importStar)($o),r=(0,t.__importStar)(ie),i=xe,o=Ze,a=je,u=mh,s=vh,c=gf();e.Meta=r.exact(r.intersection([r.partial({data:r.unknown}),r.type({start:r.number,end:r.number,type:r.union([i.RichTextNodeTypeCodec,r.literal("label")])})])),e.Span=e.Meta,e.ValidatedMetas=new r.Type("ValidatedMetas",d=>Array.isArray(d)&&d.every(e.Meta.is),(d,p)=>{if(Array.isArray(d)){const h=d.reduce((v,y)=>{const b=e.Meta.decode(y);if(n.isRight(b)){const w=b.right;if(w.data&&w.type==="hyperlink"&&n.isRight(c.Link.validate(w.data,p))||w.type!=="hyperlink")return[...v,w]}return v},[]).sort((v,y)=>v.start-y.start);return r.success(h)}else return r.failure(d,p)},d=>r.array(e.Meta).encode(d)),e.ImageBlock=r.exact(r.intersection([r.type({type:r.literal(i.RichTextNodeType.image),data:r.intersection([s.ImageContentView,r.partial({linkTo:(0,a.nullable)(c.Link)})])}),r.partial({label:o.StringOrNull,direction:o.StringOrNull})]));function l(d){return d.type===i.RichTextNodeType.image}e.checkImageBlock=l,e.EmbedBlock=r.exact(r.intersection([r.type({type:r.literal(i.RichTextNodeType.embed),data:u.EmbedContent}),r.partial({label:o.StringOrNull,direction:o.StringOrNull})]));function f(d){return d.type===i.RichTextNodeType.embed}e.checkEmbedBlock=f,e.TextBlock=r.exact(r.intersection([r.type({type:(0,a.refineType)(i.RichTextNodeTypeCodec,`string which isn't ${i.RichTextNodeType.image} ${i.RichTextNodeType.embed}`,d=>d!==i.RichTextNodeType.image&&d!==i.RichTextNodeType.embed),content:r.intersection([r.type({text:r.string}),r.partial({spans:e.ValidatedMetas})])}),r.partial({label:r.string,direction:r.string})])),e.Block=r.union([e.ImageBlock,e.EmbedBlock,e.TextBlock])}(Xs),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Blocks=e.StructuredTextContent=e.StructuredTextContentType=void 0;const t=ee.exports,n=Sn,r=(0,t.__importStar)(ie),i=Xs;e.StructuredTextContentType="StructuredTextContent",e.StructuredTextContent=new r.Type(e.StructuredTextContentType,o=>{var a;return((a=o)===null||a===void 0?void 0:a.__TYPE__)===e.StructuredTextContentType},(o,a)=>n.Chain.chain(r.array(i.Block).validate(o,a),u=>r.success({value:u,__TYPE__:e.StructuredTextContentType})),()=>{throw new Error("NotImplementedError: Not relevant method")}),e.Blocks=(0,t.__importStar)(Xs)}(Py);var eb={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.UIDContent=e.UIDContentType=void 0;const t=ee.exports,n=Sn,r=(0,t.__importStar)(ie);e.UIDContentType="UIDContent",e.UIDContent=new r.Type("UIDContent",i=>{var o;return((o=i)===null||o===void 0?void 0:o.__TYPE__)===e.UIDContentType},(i,o)=>n.Chain.chain(r.string.validate(i,o),a=>r.success({value:a,__TYPE__:"UIDContent"})),i=>i.value)})(eb),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SimpleWidgetContent=e.is=e.SimpleWidgetContentType=void 0;const t=ee.exports,n=ur,r=(0,t.__importStar)(vu),i=(0,t.__importStar)(ie),o=(0,t.__importDefault)(Ay),a=mh,u=(0,t.__importDefault)(Zs),s=ky,c=vh,l=(0,t.__importDefault)(Wy),f=gf(),d=Py,p=eb;e.SimpleWidgetContentType=["EmptyContent","ImageContent","GeoPointContent","EmbedContent","BooleanContent","IntegrationFieldsContent","StructuredTextContent","LinkContent","UIDContent","SeparatorContent","FieldContent"];function h(y){const b=y;return e.SimpleWidgetContentType.includes(b.__TYPE__)}e.is=h;const v=i.type({value:i.null});e.SimpleWidgetContent={from:(y,b)=>{if(b===null||v.is(b)){const w={type:y,__TYPE__:"EmptyContent"};return r.some(w)}switch(y){case"StructuredText":return r.fromEither(d.StructuredTextContent.decode(b));case"IntegrationFields":return r.fromEither(l.default.decode(b));case"Image":return(0,n.pipe)(r.fromEither(c.ImageContent.decode(b)),r.map(w=>c.ImageContent.encode(w)));case"GeoPoint":return(0,n.pipe)(r.fromEither(s.GeoPointContent.decode(b)),r.map(w=>s.GeoPointContent.encode(w)));case"Embed":return r.fromEither(a.EmbedContent.decode(b));case"Link":return r.fromEither(f.LinkContent.decode(b));case"UID":return r.fromEither(p.UIDContent.decode(b));case"Separator":return r.some({__TYPE__:"SeparatorContent"});case"Boolean":return r.fromEither(o.default.decode(b));default:return u.default.types.includes(y)?u.default.forType(y,b):r.none}},is:y=>e.SimpleWidgetContentType.includes(y.__TYPE__)}}(Cy),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.GroupContent=e.GroupContentType=e.GroupItemContentType=void 0;const t=ee.exports,n=(0,t.__importStar)(hq),r=(0,t.__importStar)(vu),i=(0,t.__importStar)(ie),o=Cy;e.GroupItemContentType="GroupItemContent",e.GroupContentType="GroupContentType",e.GroupContent=Object.freeze({itemsContentsFromJson:(a,u,s,c)=>u?u.map(l=>{if(typeof l=="object"&&l!==null){const d=Object.entries(l).sort(([p],[h])=>{var v,y;const b=(v=c.get(`${a}.${p}`))!==null&&v!==void 0?v:1e4,w=(y=c.get(`${a}.${h}`))!==null&&y!==void 0?y:1e4;return b-w}).map(([p,h])=>{const v=s.get(`${a}.${p}`);return v?r.map(y=>[p,y])(o.SimpleWidgetContent.from(v,h)):r.none});return{__TYPE__:"GroupItemContent",value:n.compact(d)}}else return{__TYPE__:"GroupItemContent",value:[]}}):[],fromJson:(a,u,s,c,l)=>{const f=Array.of(a,[u]).flat().join("."),d=r.fromEither(i.array(i.unknown).decode(s));return r.map(p=>({value:e.GroupContent.itemsContentsFromJson(f,p,c,l),__TYPE__:e.GroupContentType}))(d)}})}(xy);var fa={},nc={};Object.defineProperty(nc,"__esModule",{value:!0}),nc.SeparatorContent=nc.SeparatorContentType=void 0,nc.SeparatorContentType="SeparatorContent",nc.SeparatorContent={is(e){return e.__TYPE__==="SeparatorContent"}},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.NestableTypes=e.Links=e.IntegrationFieldsContent=e.ImageContentView=e.ImageContent=e.GeoPointContent=e.FieldContent=e.BooleanContent=void 0;const t=ee.exports,n=Ay,r=mh,i=Zs,o=ky,a=vh,u=Wy,s=gf(),c=nc,l=Py;var f=Ay;Object.defineProperty(e,"BooleanContent",{enumerable:!0,get:function(){return(0,t.__importDefault)(f).default}}),(0,t.__exportStar)(mh,e);var d=Zs;Object.defineProperty(e,"FieldContent",{enumerable:!0,get:function(){return(0,t.__importDefault)(d).default}});var p=ky;Object.defineProperty(e,"GeoPointContent",{enumerable:!0,get:function(){return p.GeoPointContent}});var h=vh;Object.defineProperty(e,"ImageContent",{enumerable:!0,get:function(){return h.ImageContent}}),Object.defineProperty(e,"ImageContentView",{enumerable:!0,get:function(){return h.ImageContentView}});var v=Wy;Object.defineProperty(e,"IntegrationFieldsContent",{enumerable:!0,get:function(){return(0,t.__importDefault)(v).default}}),e.Links=(0,t.__importStar)(gf()),(0,t.__exportStar)(nc,e),(0,t.__exportStar)(Py,e),e.NestableTypes={Links:s.LinksTypes,StructuredText:l.StructuredTextContentType,Boolean:n.BooleanContentType,Embed:r.EmbedContentType,Field:i.FieldContentType,GeoPoint:o.GeoPointContentType,Image:a.ImageContentType,IntegrationFields:u.IntegrationFieldsContentType,Separator:c.SeparatorContentType}}(fa);var K1={},rc={},Fq;function Dq(){if(Fq)return rc;Fq=1,Object.defineProperty(rc,"__esModule",{value:!0}),rc.CompositeSliceContent=rc.CompositeSliceContentType=void 0;const e=ee.exports,t=Sn,n=(0,e.__importStar)(vu),r=(0,e.__importStar)(ie),i=_u();rc.CompositeSliceContentType="CompositeSliceContent";const o=r.exact(r.partial({repeat:r.array(r.unknown),"non-repeat":r.UnknownRecord}));return rc.CompositeSliceContent={fromJson:(a,u,s,c,l)=>{var f;const d=Array.of(a,[u,"repeat"]).flat().join("."),p=o.decode(s);if((0,t.isRight)(p)){const h=p.right.repeat,v=(f=p.right["non-repeat"])!==null&&f!==void 0?f:{},y=i.GroupContent.itemsContentsFromJson(d,h,c,l),w=Object.entries(v).sort(([F],[g])=>{var I,T;const k=(I=l.get(`${Array.of(a,[u]).flat().join(".")}.${F}`))!==null&&I!==void 0?I:1e4,E=(T=l.get(`${Array.of(a,[u]).flat().join(".")}.${g}`))!==null&&T!==void 0?T:1e4;return k-E}).reduce((F,[g,I])=>{const T=Array.of(a,[u,"non-repeat",g]).flat().join("."),k=c.get(T);if(k){const E=i.SimpleWidgetContent.from(k,I);n.isSome(E)&&(F[g]=E.value)}return F},{});return n.some({repeat:y,nonRepeat:w,__TYPE__:"CompositeSliceContent"})}else return n.none}},rc}var ic={},Lq=mm(oi,function(e){return e.length>0},"NonEmptyString");function jq(e,t){t===void 0&&(t="NonEmptyArray<"+e.name+">");var n=gm(e);return new be(t,function(r){return n.is(r)&&Ct(r)},function(r,i){return ce(n.validate(r,i),Ar(function(o){var a=aS(o);return Ne(a)?Ye(r,i):Ie(a.value)}))},function(r){return n.encode(r)})}function Uq(e,t,n){n===void 0&&(n="Set<"+e.name+">");var r=gm(e),i=YU(t),o=HU(t);return new be(n,function(a){return a instanceof Set&&GU(e.is)(a)},function(a,u){return ce(r.validate(a,u),Ar(function(s){var c=o(s);return c.size!==s.length?Ye(a,u):Ie(c)}))},function(a){return r.encode(i(a))})}function S_e(e,t,n){return n===void 0&&(n="ReadonlySet<"+e.name+">"),Uq(e,t,n)}function V1(e,t){return new be(e,t,function(n,r){return t(n)?Ie(n):Ye(n,r)},We)}var T_e=function(e){return e instanceof Date},I_e=V1("Date",T_e),O_e=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},w_e=function(e,t){return{get:e,reverseGet:t}},Bq=function(e){return bu(e.get,Z(e.reverseGet,Fn))},E_e=function(e){return oc(Z(e.get,mt),e.reverseGet)},R_e=function(e){return da(Z(e.get,mt),Z(e.reverseGet,Fn))},M_e=function(e){return bf(function(t){return function(n){return function(r){return t.map(n(e.get(r)),function(i){return e.reverseGet(i)})}}})},bu=function(e,t){return{get:e,set:t}},H1=function(e){return da(Z(e.get,mt),e.set)},x_e=function(e){return bf(function(t){return function(n){return function(r){return t.map(n(e.get(r)),function(i){return e.set(i)(r)})}}})},zq=function(e){return function(t){return bu(function(n){return e.get(t.get(n))},function(n){return function(r){return t.set(e.set(n)(t.get(r)))(r)}})}},C_e=function(e){return function(t){return oc(Z(t.getOption,ep(e.getOption)),Z(e.reverseGet,t.reverseGet))}},A_e=function(e){return function(t){return ac(J1(e))(H1(t))}},k_e=function(){return bu(B,Fn)},W_e=function(e){return function(t){return bu(function(n){return t.get(n)[e]},function(n){return function(r){var i,o=t.get(r);return n===o[e]?r:t.set(Object.assign({},o,(i={},i[e]=n,i)))(r)}})}},N_e=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(n){return bu(function(r){for(var i=n.get(r),o={},a=0,u=e;a<u.length;a++){var s=u[a];o[s]=i[s]}return o},function(r){return function(i){for(var o=n.get(i),a=0,u=e;a<u.length;a++){var s=u[a];if(r[s]!==o[s])return n.set(Object.assign({},o,r))(i)}return i}})}},P_e=function(e){return function(t){return bu(function(n){return t.get(n)[e]},function(n){return function(r){var i=t.get(r);if(n===i[e])return r;var o=i.slice();return o[e]=n,t.set(o)(r)}})}},F_e=function(e){return function(t){return ce(t,zq(oSe().at(e)))}},oc=function(e,t){return{getOption:e,reverseGet:t}},J1=function(e){return da(e.getOption,function(t){return Kq(t)(e)})},qq=function(e){return bf(function(t){return function(n){return function(r){return ce(e.getOption(r),xo(function(){return t.of(r)},function(i){return t.map(n(i),function(o){return Kq(o)(e)(r)})}))}}})},D_e=function(e){return function(t){return function(n){return ce(t.getOption(n),qi(function(r){var i=e(r);return i===r?n:t.reverseGet(i)}))}}},L_e=function(e){return function(t){var n=D_e(e)(t);return function(r){return ce(n(r),D0(function(){return r}))}}},Kq=function(e){return L_e(function(){return e})},j_e=function(e){return function(t){return ac(H1(e))(J1(t))}},U_e=function(){return oc(hs,B)},G1=function(e){return oc(Iv(e),B)},B_e=function(){return oc(B,mt)},z_e=function(){return oc(yl,ze)},q_e=function(){return oc(function(e){return re(e)?mt(e.left):et},yt)},da=function(e,t){return{getOption:e,set:t}},K_e=function(e){return bf(function(t){return function(n){return function(r){return ce(e.getOption(r),xo(function(){return t.of(r)},function(i){return t.map(n(i),function(o){return e.set(o)(r)})}))}}})},Vq=function(e){return function(t){return function(n){return ce(t.getOption(n),qi(function(r){var i=e(r);return i===r?n:t.set(i)(n)}))}}},Hq=function(e){return function(t){var n=Vq(e)(t);return function(r){return ce(n(r),D0(function(){return r}))}}},ac=function(e){return function(t){return da(Z(t.getOption,ep(e.getOption)),function(n){return Hq(e.set(n))(t)})}},V_e=function(e){return function(t){return ce(t,ac(tSe().index(e)))}},H_e=function(e){return function(t){return ce(t,ac(nSe().index(e)))}},J_e=function(e){return function(t){return ce(t,ac(rSe().index(e)))}},G_e=function(e){return da(nv(e),function(t){return function(n){return ce(tv(e)(n),xo(function(){return n},function(r){return hv(r,t,n)}))}})},Jq=function(e,t,n){if(n[e]===t)return n;var r=O_e([n[0]],n.slice(1),!0);return r[e]=t,r},Y_e=function(e){return da(nv(e),function(t){return function(n){return ce(tv(e)(n),xo(function(){return n},function(r){return Jq(r,t,n)}))}})},bf=function(e){return{modifyF:e}};function Y1(e){return function(t){return bf(function(n){return function(r){return t.modifyF(n)(e.modifyF(n)(r))}})}}var Z_e={URI:"Identity",map:function(e,t){return t(e)},of:B,ap:function(e,t){return e(t)}},X_e=function(e){return e.URI==="Identity"};function Q_e(e){return function(){return bf(function(t){var n=X_e(t)?e.map:e.traverse(t);return function(r){return function(i){return n(i,r)}}})}}function eSe(e){return Y1(Q_e(e)())}var Z1=function(e){return{index:e}},tSe=function(){return Z1(function(e){return da(function(t){return ss(e,t)},function(t){return function(n){return ce(ss(e,n),xo(function(){return n},function(){return hv(e,t,n)}))}})})},nSe=function(){return Z1(function(e){return da(function(t){return ss(e,t)},function(t){return function(n){return ce(ss(e,n),xo(function(){return n},function(){return Jq(e,t,n)}))}})})},rSe=function(){return Z1(function(e){return da(function(t){return As(e,t)},function(t){return function(n){return n[e]===t||Ne(As(e,n))?n:IO(e,t)(n)}})})},iSe=function(e){return{at:e}};function oSe(){return iSe(function(e){return bu(function(t){return As(e,t)},xo(function(){return Bg(e)},function(t){return IO(e,t)}))})}var Gq=w_e,X1=Bq,Q1=E_e,eE=R_e,tE=M_e,aSe=function(e){return function(t){return Gq(Z(t.get,e.get),Z(e.reverseGet,t.reverseGet))}},uSe=function(e){return Gq(e.reverseGet,e.get)},sSe=function(e){return function(t){return function(n){return t.reverseGet(e(t.get(n)))}}},Yq=bu,tb=k_e,$u=H1,$f=x_e,uc=zq,cSe=uc,lSe=Z(Bq,uc),sc=A_e,nE=function(e){return Z($u,ac(e))},fSe=function(e){return Z($f,Y1(e))},Zq=function(e){return function(t){return function(n){var r=t.get(n),i=e(r);return r===i?n:t.set(i)(n)}}};function dSe(e){return function(t){return function(n){return function(r){return ce(n.get(r),t,function(i){return e.map(i,function(o){return n.set(o)(r)})})}}}}var pSe=function(e){return sc(U_e())(e)};function hSe(e){return sc(G1(e))}var Xq=W_e,Qq=N_e,mSe=P_e,vSe=function(e){return Z($u,V_e(e))},gSe=function(e){return Z($u,H_e(e))},ySe=function(e){return Z($u,J_e(e))},bSe=F_e,$Se=sc(B_e()),_Se=sc(z_e()),SSe=sc(q_e());function TSe(e){return Z($f,eSe(e))}function ISe(e){return nE(G_e(e))}function OSe(e){return nE(Y_e(e))}var wSe=function(e,t){return function(n){return e2(n,e,t)}},e2=function(e,t,n){return Yq(Z(e.get,t),Z(n,e.set))},nb="monocle-ts/Lens",ESe={URI:nb,imap:e2},t2={URI:nb,compose:function(e,t){return uc(e)(t)}},RSe={URI:nb,compose:t2.compose,id:tb};const MSe=Object.freeze(Object.defineProperty({__proto__:null,lens:Yq,id:tb,asOptional:$u,asTraversal:$f,compose:uc,composeLens:cSe,composeIso:lSe,composePrism:sc,composeOptional:nE,composeTraversal:fSe,modify:Zq,modifyF:dSe,fromNullable:pSe,filter:hSe,prop:Xq,props:Qq,component:mSe,index:vSe,indexNonEmpty:gSe,key:ySe,atKey:bSe,some:$Se,right:_Se,left:SSe,traverse:TSe,findFirst:ISe,findFirstNonEmpty:OSe,imap:wSe,URI:nb,Invariant:ESe,Semigroupoid:t2,Category:RSe},Symbol.toStringTag,{value:"Module"}));var n2=K_e,cc=ac,xSe=Vq,CSe=Hq,ASe=G1,rE=J1,iE=qq,oE=C_e,kSe=j_e,pa=Y1,r2=function(e){return function(t){return t.modifyF(Z_e)(e)}},WSe=function(e){return r2(function(){return e})};function NSe(e){return pa(qq(G1(e)))}var i2=function(e){return new a2(e.get,e.reverseGet)},_f=function(e){return new aE(e.get,e.set)},$h=function(e){return new u2(e.getOption,e.reverseGet)},Br=function(e){return new PSe(e.getOption,e.set)},br=function(e){return new FSe(e.modifyF)},o2=function(e,t,n){var r;return n===e[t]?e:Object.assign({},e,(r={},r[t]=n,r))},a2=function(){function e(t,n){this.get=t,this.reverseGet=n,this._tag="Iso",this.unwrap=this.get,this.to=this.get,this.wrap=this.reverseGet,this.from=this.reverseGet}return e.prototype.reverse=function(){return i2(uSe(this))},e.prototype.modify=function(t){return sSe(t)(this)},e.prototype.asLens=function(){return _f(X1(this))},e.prototype.asPrism=function(){return $h(Q1(this))},e.prototype.asOptional=function(){return Br(eE(this))},e.prototype.asTraversal=function(){return br(tE(this))},e.prototype.asFold=function(){var t=this;return new Sf(function(){return function(n){return function(r){return n(t.get(r))}}})},e.prototype.asGetter=function(){var t=this;return new c2(function(n){return t.get(n)})},e.prototype.asSetter=function(){var t=this;return new _h(function(n){return t.modify(n)})},e.prototype.compose=function(t){return i2(aSe(t)(this))},e.prototype.composeIso=function(t){return this.compose(t)},e.prototype.composeLens=function(t){return _f(ce(this,X1,uc(t)))},e.prototype.composePrism=function(t){return $h(ce(this,Q1,oE(t)))},e.prototype.composeOptional=function(t){return Br(ce(this,eE,cc(t)))},e.prototype.composeTraversal=function(t){return br(ce(this,tE,pa(t)))},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeGetter=function(t){return this.asGetter().compose(t)},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e}(),aE=function(){function e(t,n){this.get=t,this.set=n,this._tag="Lens"}return e.fromPath=function(){var t=e.fromProp();return function(n){var r=t(n[0]);return n.slice(1).reduce(function(i,o){return i.compose(t(o))},r)}},e.fromProp=function(){return function(t){return _f(ce(tb(),Xq(t)))}},e.fromProps=function(){return function(t){return _f(ce(tb(),Qq.apply(MSe,t)))}},e.fromNullableProp=function(){return function(t,n){return new e(function(r){var i=hs(r[t]);return Ne(i)?n:i.value},function(r){return function(i){return o2(i,t,r)}})}},e.prototype.modify=function(t){return Zq(t)(this)},e.prototype.asOptional=function(){return Br($u(this))},e.prototype.asTraversal=function(){return br($f(this))},e.prototype.asSetter=function(){var t=this;return new _h(function(n){return t.modify(n)})},e.prototype.asGetter=function(){var t=this;return new c2(function(n){return t.get(n)})},e.prototype.asFold=function(){var t=this;return new Sf(function(){return function(n){return function(r){return n(t.get(r))}}})},e.prototype.compose=function(t){return _f(uc(t)(this))},e.prototype.composeLens=function(t){return this.compose(t)},e.prototype.composeGetter=function(t){return this.asGetter().compose(t)},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeOptional=function(t){return Br(ce(this,$u,cc(t)))},e.prototype.composeTraversal=function(t){return br(ce(this,$f,pa(t)))},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e.prototype.composeIso=function(t){return _f(ce(this,uc(ce(t,X1))))},e.prototype.composePrism=function(t){return Br(sc(t)(this))},e}(),u2=function(){function e(t,n){this.getOption=t,this.reverseGet=n,this._tag="Prism"}return e.fromPredicate=function(t){return $h(ASe(t))},e.some=function(){return s2},e.prototype.modify=function(t){var n=this;return function(r){var i=n.modifyOption(t)(r);return Ne(i)?r:i.value}},e.prototype.modifyOption=function(t){var n=this;return function(r){return gN.map(n.getOption(r),function(i){var o=t(i);return o===i?r:n.reverseGet(o)})}},e.prototype.set=function(t){return this.modify(function(){return t})},e.prototype.asOptional=function(){return Br(rE(this))},e.prototype.asTraversal=function(){return br(iE(this))},e.prototype.asSetter=function(){var t=this;return new _h(function(n){return t.modify(n)})},e.prototype.asFold=function(){var t=this;return new Sf(function(n){return function(r){return function(i){var o=t.getOption(i);return Ne(o)?n.empty:r(o.value)}}})},e.prototype.compose=function(t){return $h(oE(t)(this))},e.prototype.composePrism=function(t){return this.compose(t)},e.prototype.composeOptional=function(t){return Br(ce(this,rE,cc(t)))},e.prototype.composeTraversal=function(t){return br(ce(this,iE,pa(t)))},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e.prototype.composeIso=function(t){return $h(ce(this,oE(ce(t,Q1))))},e.prototype.composeLens=function(t){return Br(kSe(t)(this))},e.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},e}(),s2=new u2(B,mt),PSe=function(){function e(t,n){this.getOption=t,this.set=n,this._tag="Optional"}return e.fromPath=function(){var t=e.fromNullableProp();return function(n){var r=t(n[0]);return n.slice(1).reduce(function(i,o){return i.compose(t(o))},r)}},e.fromNullableProp=function(){return function(t){return new e(function(n){return hs(n[t])},function(n){return function(r){return r[t]==null?r:o2(r,t,n)}})}},e.fromOptionProp=function(){var t=aE.fromProp();return function(n){return t(n).composePrism(s2)}},e.prototype.modify=function(t){return CSe(t)(this)},e.prototype.modifyOption=function(t){return xSe(t)(this)},e.prototype.asTraversal=function(){return br(n2(this))},e.prototype.asFold=function(){var t=this;return new Sf(function(n){return function(r){return function(i){var o=t.getOption(i);return Ne(o)?n.empty:r(o.value)}}})},e.prototype.asSetter=function(){var t=this;return new _h(function(n){return t.modify(n)})},e.prototype.compose=function(t){return Br(cc(t)(this))},e.prototype.composeOptional=function(t){return this.compose(t)},e.prototype.composeTraversal=function(t){return br(ce(this,n2,pa(t)))},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e.prototype.composeLens=function(t){return Br(ce(this,cc(ce(t,$u))))},e.prototype.composePrism=function(t){return Br(ce(this,cc(ce(t,rE))))},e.prototype.composeIso=function(t){return Br(ce(this,cc(ce(t,eE))))},e.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},e}(),FSe=function(){function e(t){this.modifyF=t,this._tag="Traversal"}return e.prototype.modify=function(t){return r2(t)(this)},e.prototype.set=function(t){return WSe(t)(this)},e.prototype.filter=function(t){return br(NSe(t)(this))},e.prototype.asFold=function(){var t=this;return new Sf(function(n){return function(r){return t.modifyF(_N(n))(function(i){return bl(r(i))})}})},e.prototype.asSetter=function(){var t=this;return new _h(function(n){return t.modify(n)})},e.prototype.compose=function(t){return br(pa(t)(this))},e.prototype.composeTraversal=function(t){return this.compose(t)},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e.prototype.composeOptional=function(t){return this.compose(t.asTraversal())},e.prototype.composeLens=function(t){return br(ce(this,pa(ce(t,$f))))},e.prototype.composePrism=function(t){return br(ce(this,pa(ce(t,iE))))},e.prototype.composeIso=function(t){return br(ce(this,pa(ce(t,tE))))},e.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},e}(),c2=function(){function e(t){this.get=t,this._tag="Getter"}return e.prototype.asFold=function(){var t=this;return new Sf(function(){return function(n){return function(r){return n(t.get(r))}}})},e.prototype.compose=function(t){var n=this;return new e(function(r){return t.get(n.get(r))})},e.prototype.composeGetter=function(t){return this.compose(t)},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeLens=function(t){return this.compose(t.asGetter())},e.prototype.composeIso=function(t){return this.compose(t.asGetter())},e.prototype.composeTraversal=function(t){return this.asFold().compose(t.asFold())},e.prototype.composeOptional=function(t){return this.asFold().compose(t.asFold())},e.prototype.composePrism=function(t){return this.asFold().compose(t.asFold())},e}(),Sf=function(){function e(t){this.foldMap=t,this._tag="Fold",this.getAll=t(g0())(Xa),this.exist=t(bD),this.all=t(yD),this.foldMapFirst=t(yN())}return e.prototype.compose=function(t){var n=this;return new e(function(r){return function(i){return n.foldMap(r)(t.foldMap(r)(i))}})},e.prototype.composeFold=function(t){return this.compose(t)},e.prototype.composeGetter=function(t){return this.compose(t.asFold())},e.prototype.composeTraversal=function(t){return this.compose(t.asFold())},e.prototype.composeOptional=function(t){return this.compose(t.asFold())},e.prototype.composeLens=function(t){return this.compose(t.asFold())},e.prototype.composePrism=function(t){return this.compose(t.asFold())},e.prototype.composeIso=function(t){return this.compose(t.asFold())},e.prototype.find=function(t){return this.foldMapFirst(Iv(t))},e.prototype.headOption=function(t){return this.find(function(){return!0})(t)},e}(),_h=function(){function e(t){this.modify=t,this._tag="Setter"}return e.prototype.set=function(t){return this.modify(Fn(t))},e.prototype.compose=function(t){var n=this;return new e(function(r){return n.modify(t.modify(r))})},e.prototype.composeSetter=function(t){return this.compose(t)},e.prototype.composeTraversal=function(t){return this.compose(t.asSetter())},e.prototype.composeOptional=function(t){return this.compose(t.asSetter())},e.prototype.composeLens=function(t){return this.compose(t.asSetter())},e.prototype.composePrism=function(t){return this.compose(t.asSetter())},e.prototype.composeIso=function(t){return this.compose(t.asSetter())},e}(),DSe=new a2(Fc,Fc);function LSe(){return DSe}function jSe(e,t){t===void 0&&(t="fromNewtype("+e.name+")");var n=LSe();return new be(t,function(r){return e.is(r)},function(r,i){return ce(e.validate(r,i),ns(n.wrap))},function(r){return e.encode(n.unwrap(r))})}var USe=wd({_tag:Id("None")}),BSe=Id("Some");function l2(e,t){return t===void 0&&(t="Option<"+e.name+">"),Od([USe,wd({_tag:BSe,value:e},"Some<"+e.name+">")],t)}function zSe(e,t){return t===void 0&&(t="Option<"+e.name+">"),new be(t,l2(e).is,function(n,r){return n==null?Ie(et):ce(e.validate(n,r),ns(mt))},function(n){return L0(ce(n,qi(e.encode)))})}var qSe=new be("DateFromISOString",function(e){return e instanceof Date},function(e,t){return ce(oi.validate(e,t),Ar(function(n){var r=new Date(n);return isNaN(r.getTime())?Ye(e,t):Ie(r)}))},function(e){return e.toISOString()});function KSe(e,t){return t===void 0&&(t="ReadonlyNonEmptyArray<"+e.name+">"),jq(e,t)}function f2(e){var t=Object.create(Object.getPrototypeOf(e));return Object.assign(t,e),t}var VSe=new be("DateFromNumber",function(e){return e instanceof Date},function(e,t){return ce(as.validate(e,t),Ar(function(n){var r=new Date(n);return isNaN(r.getTime())?Ye(e,t):Ie(r)}))},function(e){return e.getTime()});function rb(e,t,n){n===void 0&&(n=e.name);var r=f2(e);return r.validate=t,r.decode=function(i){return t(i,pC(r))},r.name=n,r}function HSe(e,t,n){return n===void 0&&(n="withFallback("+e.name+")"),rb(e,function(r,i){return Sx(function(){return Ie(t)})(e.validate(r,i))},n)}var JSe=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,GSe=mm(oi,function(e){return JSe.test(e)},"UUID");function YSe(e,t,n){return n===void 0&&(n="fromNullable("+e.name+")"),rb(e,function(r,i){return r==null?Ie(t):e.validate(r,i)},n)}var ZSe=new be("BooleanFromString",hm.is,function(e,t){return ce(oi.validate(e,t),Ar(function(n){return n==="true"?Ie(!0):n==="false"?Ie(!1):Ye(e,t)}))},String);function XSe(e,t){return rb(e,function(n,r){return _d(function(){return[{value:n,context:r,message:t(n,r),actual:n}]})(e.validate(n,r))})}function d2(e){switch(e._tag){case"InterfaceType":return e.props;case"ExactType":return d2(e.type)}}var QSe=aE.fromProp();function e0e(e){var t={};for(var n in d2(e))t[n]=QSe(n);return t}var t0e=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},n0e=V1("RegExp",t0e),r0e=new be("DateFromUnixTime",function(e){return e instanceof Date},function(e,t){return ce(vm.validate(e,t),Ar(function(n){var r=new Date(n*1e3);return isNaN(r.getTime())?Ye(e,t):Ie(r)}))},function(e){return Math.floor(e.getTime()/1e3)}),uE=new be("NumberFromString",as.is,function(e,t){return ce(oi.validate(e,t),Ar(function(n){var r=+n;return isNaN(r)||n.trim()===""?Ye(e,t):Ie(r)}))},String),i0e=new be("IntFromString",vm.is,function(e,t){return ce(uE.validate(e,t),Ar(function(n){return vm.is(n)?Ie(n):Ye(e,t)}))},uE.encode),p2=l_("JsonArray",function(){return cC(ib)}),h2=l_("JsonRecord",function(){return p_(oi,ib)}),ib=Od([hm,as,oi,s_,p2,h2],"Json"),o0e=new be("JsonFromString",ib.is,function(e,t){try{return Ie(JSON.parse(e))}catch{return Ye(e,t)}},function(e){return JSON.stringify(e)}),a0e=Id("Left"),u0e=Id("Right");function s0e(e,t,n){return n===void 0&&(n="Either<"+e.name+", "+t.name+">"),Od([wd({_tag:a0e,left:e},"Left<"+e.name+">"),wd({_tag:u0e,right:t},"Right<"+e.name+">")],n)}var c0e=new be("BigIntFromString",function(e){return typeof e=="bigint"},function(e,t){return ce(oi.validate(e,t),Ar(function(n){if(!Lq.is(n.trim()))return Ye(e,t);try{return Ie(BigInt(n))}catch{return Ye(e,t)}}))},String);function l0e(e,t,n){return n===void 0&&(n=e.name),new be(n,e.is,e.validate,t)}var f0e=new be("BooleanFromNumber",hm.is,function(e,t){return ce(as.validate(e,t),ns(function(n){return n!==0}))},Number);const d0e=Fa(Object.freeze(Object.defineProperty({__proto__:null,mapOutput:pq,NonEmptyString:Lq,nonEmptyArray:jq,readonlySetFromArray:S_e,fromRefinement:V1,date:I_e,fromNewtype:jSe,optionFromNullable:zSe,DateFromISOString:qSe,readonlyNonEmptyArray:KSe,clone:f2,DateFromNumber:VSe,withFallback:HSe,UUID:GSe,fromNullable:YSe,BooleanFromString:ZSe,withMessage:XSe,withValidate:rb,getLenses:e0e,regexp:n0e,option:l2,DateFromUnixTime:r0e,NumberFromString:uE,setFromArray:Uq,IntFromString:i0e,JsonArray:p2,JsonRecord:h2,Json:ib,JsonFromString:o0e,either:s0e,BigIntFromString:c0e,withEncode:l0e,BooleanFromNumber:f0e},Symbol.toStringTag,{value:"Module"})));var m2;function v2(){if(m2)return ic;m2=1,Object.defineProperty(ic,"__esModule",{value:!0}),ic.SharedSliceContent=ic.SharedSliceContentType=void 0;const e=ee.exports,t=Sn,n=(0,e.__importStar)(vu),r=(0,e.__importStar)(ie),i=d0e,o=_u();ic.SharedSliceContentType="SharedSliceContent";const a=r.exact(r.type({variation:r.string,items:(0,i.withFallback)(r.array(r.unknown),[]),primary:(0,i.withFallback)(r.UnknownRecord,{})}));return ic.SharedSliceContent={fromJson:(u,s,c,l,f)=>{const d=(0,t.map)(p=>{const h=Array.of(u,[s,"variations",p.variation,"items"]).flat().join("."),v=o.GroupContent.itemsContentsFromJson(h,p.items,l,f),b=Object.entries(p.primary).sort(([F],[g])=>{var I,T;const k=(I=f.get(`${Array.of(u,[s]).flat().join(".")}.${F}`))!==null&&I!==void 0?I:1e4,E=(T=f.get(`${Array.of(u,[s]).flat().join(".")}.${g}`))!==null&&T!==void 0?T:1e4;return k-E}).reduce((F,[g,I])=>{const T=Array.of(u,[s,"variations",p.variation,"primary",g]).flat().join("."),k=l.get(T);if(k){const E=o.SimpleWidgetContent.from(k,I);n.isSome(E)&&(F[g]=E.value)}return F},{});return{variation:p.variation,primary:b,items:v,__TYPE__:"SharedSliceContent"}})(a.decode(c));return n.fromEither(d)}},ic}var ob={},Tf={};Object.defineProperty(Tf,"__esModule",{value:!0});const p0e=ee.exports,h0e=(0,p0e.__importStar)(vu),g2=xy,y2=Cy,m0e={fromJson:(e,t,n,r,i)=>{const o=Array.of(e,[t]).flat().join("."),a=r.get(o);return a==="Group"?g2.GroupContent.fromJson(e,t,n,r,i):a?y2.SimpleWidgetContent.from(a,n):h0e.none},is:e=>y2.SimpleWidgetContent.is(e)||g2.GroupContentType===e.__TYPE__};Tf.default=m0e,Object.defineProperty(ob,"__esModule",{value:!0}),ob.SimpleSliceContent=void 0;const v0e=ee.exports,g0e=(0,v0e.__importDefault)(Tf);ob.SimpleSliceContent=g0e.default;var sE={},Sh={},b2;function $2(){if(b2)return Sh;b2=1,Object.defineProperty(Sh,"__esModule",{value:!0}),Sh.SliceWidgetContent=void 0;const e=ee.exports,t=(0,e.__importStar)(vu),n=(0,e.__importDefault)(Tf),r=Dq(),i=v2();return Sh.SliceWidgetContent={fromJson:(o,a,u,s,c)=>{const l=Array.of(o,[a]).flat().join("."),f=s.get(l);return f==="SharedSlice"?i.SharedSliceContent.fromJson(o,a,u,s,c):f==="Slice"?r.CompositeSliceContent.fromJson(o,a,u,s,c):f?n.default.fromJson(o,a,u,s,c):t.none}},Sh}var _2;function y0e(){return _2||(_2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SlicesContent=e.SlicesContentType=void 0;const t=ee.exports,n=(0,t.__importStar)(hq),r=ur,i=(0,t.__importStar)(vu),o=(0,t.__importStar)(ie),a=je,u=$2();e.SlicesContentType="SliceContentType";const s=o.exact(o.intersection([o.type({key:o.string,value:o.unknown}),o.partial({label:(0,a.nullable)(o.string)})]));e.SlicesContent={itemsCodec:(c,l)=>(0,r.pipe)(s.decode(c),i.fromEither,i.chain(f=>{const d=f.key.indexOf("$"),p=f.key.substring(0,d>0?d:void 0),h=l(p,f.value);return i.map(v=>{var y;return{key:f.key,name:p,maybeLabel:(y=f.label)!==null&&y!==void 0?y:void 0,widget:v}})(h)})),fromJson:(c,l,f,d)=>{if(f.get(c)==="Slices"){const p=i.getOrElse(()=>new Array)(i.fromEither(o.array(o.unknown).decode(l))),h=(v,y)=>u.SliceWidgetContent.fromJson([c],v,y,f,d);return i.some({value:n.compact(p.map(v=>e.SlicesContent.itemsCodec(v,h))),__TYPE__:e.SlicesContentType})}else return console.error("fieldTypes.get(key) !== 'Slices'"),i.none}}}(sE)),sE}var S2;function T2(){return S2||(S2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=ee.exports;(0,t.__exportStar)(Dq(),e),(0,t.__exportStar)(v2(),e),(0,t.__exportStar)(ob,e),(0,t.__exportStar)(y0e(),e),(0,t.__exportStar)($2(),e)}(K1)),K1}var I2;function _u(){return I2||(I2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Widget=e.WidgetKey=e.WidgetTypes=e.StaticWidgetContent=e.Slices=e.Nestable=void 0;const t=ee.exports,n=(0,t.__importStar)(ie),r=je,i=N1,o=xy,a=fa,u=T2(),s=(0,t.__importDefault)(Tf),c=eb;(0,t.__exportStar)(N1,e),(0,t.__exportStar)(xy,e),e.Nestable=(0,t.__importStar)(fa),(0,t.__exportStar)(Cy,e),e.Slices=(0,t.__importStar)(T2());var l=Tf;Object.defineProperty(e,"StaticWidgetContent",{enumerable:!0,get:function(){return(0,t.__importDefault)(l).default}}),(0,t.__exportStar)(eb,e),e.WidgetTypes={...a.NestableTypes,Empty:i.EmptyContentType,UID:c.UIDContentType,Group:o.GroupContentType,slices:u.SlicesContentType};const f=new RegExp("^[^<>]+$");e.WidgetKey=(0,r.refineType)(n.string,"WidgetKey",d=>d.length===0||f.test(d)),e.Widget={fromJson(d,p,h,v){return h.get(d)==="Slices"?u.SlicesContent.fromJson(d,p,h,v):s.default.fromJson([],d,p,h,v)}}}(W1)),W1}var Oi={},Th={};Object.defineProperty(Th,"__esModule",{value:!0});const O2=ee.exports,wi=(0,O2.__importStar)(ie),b0e=_u(),w2=Ze,$0e=(0,O2.__importDefault)(yu),_0e=pt,S0e=wi.exact(wi.partial({label:w2.StringOrNull,repeat:wi.boolean,fields:wi.record(b0e.WidgetKey,$0e.default)})),T0e=wi.exact(wi.intersection([wi.type({type:wi.literal(_0e.WidgetTypes.Group)}),wi.partial({fieldset:w2.StringOrNull,icon:wi.string,description:wi.string,config:S0e})]));Th.default=T0e;var cE={},ab={},ha={};Object.defineProperty(ha,"__esModule",{value:!0}),ha.SlicesTypes=void 0,ha.SlicesTypes={Slice:"Slice",SharedSlice:"SharedSlice"},Object.defineProperty(ab,"__esModule",{value:!0});const E2=ee.exports,zr=(0,E2.__importStar)(ie),R2=_u(),M2=Ze,x2=(0,E2.__importDefault)(yu),I0e=ha,O0e=zr.exact(zr.partial({label:M2.StringOrNull})),w0e=zr.exact(zr.intersection([zr.type({type:zr.literal(I0e.SlicesTypes.Slice)}),zr.partial({fieldset:M2.StringOrNull,description:zr.string,icon:zr.string,display:zr.string,"non-repeat":zr.record(R2.WidgetKey,x2.default),repeat:zr.record(R2.WidgetKey,x2.default),config:O0e})]));ab.default=w0e;var ub={};Object.defineProperty(ub,"__esModule",{value:!0});const lE=ee.exports,E0e=(0,lE.__importStar)(ie),R0e=(0,lE.__importDefault)(Th),M0e=(0,lE.__importDefault)(yu),x0e=E0e.union([M0e.default,R0e.default]);ub.default=x0e;var fE={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SharedSlice=e.Variation=void 0;const t=ee.exports,n=(0,t.__importStar)(ie),r=Hc,i=_u(),o=(0,t.__importDefault)(yu),a=ha,u="https://images.prismic.io/slice-machine/621a5ec4-0387-4bc5-9860-2dd46cbc07cd_default_ss.png?auto=compress,format";e.Variation=n.exact(n.intersection([n.type({id:n.string,name:n.string,description:n.string,imageUrl:(0,r.withFallback)(n.string,u),docURL:n.string,version:n.string}),n.partial({display:n.string,primary:n.record(i.WidgetKey,o.default),items:n.record(i.WidgetKey,o.default)})])),e.SharedSlice=n.exact(n.intersection([n.type({id:n.string,type:n.literal(a.SlicesTypes.SharedSlice),name:n.string,variations:n.readonlyArray(e.Variation)}),n.partial({description:n.string})]))})(fE);var sb={};Object.defineProperty(sb,"__esModule",{value:!0});const C0e=ee.exports,dE=(0,C0e.__importStar)(ie),A0e=ha,k0e=dE.exact(dE.type({type:dE.literal(A0e.SlicesTypes.SharedSlice)}));sb.default=k0e,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Slices=e.DynamicSlices=e.StaticSlices=e.slicesReader=e.DynamicSlicesConfig=e.StaticSlicesConfig=e.slicesConfigReader=e.SlicesLabels=void 0;const t=ee.exports,n=(0,t.__importStar)(ie),r=_u(),i=Ze,o=pt,a=(0,t.__importDefault)(ab),u=(0,t.__importDefault)(ub),s=fE,c=(0,t.__importDefault)(sb),l=ha;e.SlicesLabels=n.union([n.record(n.string,n.readonlyArray(n.exact(n.intersection([n.type({name:n.string}),n.partial({display:n.string})])))),n.null]);function f(h){return n.exact(n.partial({label:i.StringOrNull,labels:e.SlicesLabels,choices:n.record(r.WidgetKey,n.union([u.default,a.default,h]))}))}e.slicesConfigReader=f,e.StaticSlicesConfig=f(s.SharedSlice),e.DynamicSlicesConfig=f(c.default);const d={toStatic(h,v){const y=Object.entries(h.choices||{}).reduce((b,[w,F])=>{if(F.type===l.SlicesTypes.SharedSlice){const g=v.get(w);return g?{...b,[w]:g}:b}else return{...b,[w]:F}},{});return{...h,choices:y}}};function p(h){return n.exact(n.intersection([n.type({type:n.union([n.literal(o.WidgetTypes.Slices),n.literal(o.WidgetTypes.LegacySlices)])}),n.partial({fieldset:i.StringOrNull,config:h})]))}e.slicesReader=p,e.StaticSlices=p(e.StaticSlicesConfig),e.DynamicSlices=p(e.DynamicSlicesConfig),e.Slices={toStatic(h,v){return h.config?{...h,config:d.toStatic(h.config,v)}:h}}}(cE);var cb={};Object.defineProperty(cb,"__esModule",{value:!0});const W0e=ee.exports,ma=(0,W0e.__importStar)(ie),C2=Ze,N0e=pt,P0e=ma.exact(ma.partial({label:C2.StringOrNull,useAsTitle:ma.boolean,placeholder:ma.string})),F0e=ma.exact(ma.intersection([ma.type({type:ma.literal(N0e.WidgetTypes.UID)}),ma.partial({fieldset:C2.StringOrNull,config:P0e})]));cb.default=F0e,Object.defineProperty(Oi,"__esModule",{value:!0}),Oi.Widgets=Oi.DynamicWidget=Oi.StaticWidget=Oi.widgetReader=void 0;const lb=ee.exports,D0e=(0,lb.__importStar)(ie),L0e=(0,lb.__importDefault)(Th),j0e=(0,lb.__importDefault)(yu),pE=cE,U0e=(0,lb.__importDefault)(cb),A2=pt;function hE(e){return D0e.union([U0e.default,j0e.default,L0e.default,e])}Oi.widgetReader=hE,Oi.StaticWidget=hE(pE.StaticSlices),Oi.DynamicWidget=hE(pE.DynamicSlices),Oi.Widgets={toStatic(e,t){switch(e.type){case A2.WidgetTypes.LegacySlices:case A2.WidgetTypes.Slices:return pE.Slices.toStatic(e,t);default:return e}}},Object.defineProperty(Ii,"__esModule",{value:!0}),Ii.Sections=Ii.DynamicSection=Ii.StaticSection=Ii.sectionReader=void 0;const B0e=ee.exports,z0e=(0,B0e.__importStar)(ie),q0e=_u(),mE=Oi;function vE(e){return z0e.record(q0e.WidgetKey,e)}Ii.sectionReader=vE,Ii.StaticSection=vE(mE.StaticWidget),Ii.DynamicSection=vE(mE.DynamicWidget),Ii.Sections={toStatic(e,t){return Object.entries(e).reduce((r,[i,o])=>({...r,[i]:mE.Widgets.toStatic(o,t)}),{})}},Object.defineProperty(pn,"__esModule",{value:!0}),pn.filterMissingSharedSlices=pn.collectWidgets=pn.validateSlices=pn.toStatic=pn.flattenWidgets=pn.CustomType=pn.StaticCustomType=void 0;const K0e=ee.exports,k2=$o,io=(0,K0e.__importStar)(ie),W2=Hc,V0e=Ze,gE=Ii,N2=ha,P2=pt;class H0e 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
3
  ${t.map(r=>` - ${r}`).join(`
4
4
  `)}
5
- `}}function D2(e){return oo.exact(oo.intersection([oo.type({id:oo.string,label:L0e.StringOrNull,repeatable:(0,N2.withFallback)(oo.boolean,!0),json:oo.record(oo.string,e),status:(0,N2.withFallback)(oo.boolean,!0)}),oo.partial({hash:oo.string})]))}pn.StaticCustomType=D2(bE.StaticSection),pn.CustomType=D2(bE.DynamicSection);function L2(e){return Object.entries(e.json).reduce((t,[,n])=>{const r=Object.entries(n);return t.concat(r)},[])}pn.flattenWidgets=L2;function U0e(e){return L2(e).filter(([,r])=>r.type===F2.WidgetTypes.Slices).reduce((r,[,i])=>{const o=Object.entries(i.config&&i.config.choices?i.config.choices:{}).filter(([,a])=>a.type===P2.SlicesTypes.SharedSlice).map(([a])=>a);return r.concat(o)},[])}function B0e(e){const t=U0e(e);return function(n){return t.map(n)}}function z0e(e,t){const n=Object.entries(e.json).reduce((r,[i,o])=>({...r,[i]:bE.Sections.toStatic(o,t)}),{});return{...e,json:n}}pn.toStatic=z0e;function q0e(e,t){const n=B0e(e)(r=>{if(!t.get(r))return r}).filter(Boolean);return n.length>0?(0,W2.left)(new j0e(n)):(0,W2.right)(e)}pn.validateSlices=q0e;function j2(e,t){const n=Object.entries(e.json).reduce((r,[i,o])=>{const a=Object.entries(o).reduce((u,[s,c])=>{const l=t(s,c);return l?{...u,[s]:l}:u},{});return{...r,[i]:a}},{});return{...e,json:n}}pn.collectWidgets=j2;function K0e(e,t){return j2(e,(n,r)=>{if(r.type===F2.WidgetTypes.Slices){if(!r.config||!r.config.choices)return r;const i=Object.entries(r.config.choices).reduce((a,[u,s])=>s.type===P2.SlicesTypes.SharedSlice&&!t.get(u)?a:{...a,[u]:s},{}),o={...r.config,choices:i};return{...r,config:o}}return r})}pn.filterMissingSharedSlices=K0e;var tt={},U2={};(function(e){var t=se&&se.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(e,"__esModule",{value:!0}),e.ImageConstraint=void 0;var n=gh;Object.defineProperty(e,"ImageConstraint",{enumerable:!0,get:function(){return t(n).default}})})(U2);var fb={},B2={};Object.defineProperty(B2,"__esModule",{value:!0}),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SlicesTypes=e.SliceZone=e.Slice=e.SharedSliceRef=e.LegacySlice=e.CompositeSlice=void 0;const t=ee.exports;var n=ab;Object.defineProperty(e,"CompositeSlice",{enumerable:!0,get:function(){return(0,t.__importDefault)(n).default}});var r=ub;Object.defineProperty(e,"LegacySlice",{enumerable:!0,get:function(){return(0,t.__importDefault)(r).default}}),(0,t.__exportStar)(pE,e);var i=sb;Object.defineProperty(e,"SharedSliceRef",{enumerable:!0,get:function(){return(0,t.__importDefault)(i).default}}),e.Slice=(0,t.__importStar)(B2),e.SliceZone=(0,t.__importStar)(fE);var o=ma;Object.defineProperty(e,"SlicesTypes",{enumerable:!0,get:function(){return o.SlicesTypes}})}(fb),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.WidgetTypes=e.Widget=e.UID=e.Slices=e.Shared=e.Nestable=e.Group=void 0;const t=ee.exports;var n=Th;Object.defineProperty(e,"Group",{enumerable:!0,get:function(){return(0,t.__importDefault)(n).default}}),e.Nestable=(0,t.__importStar)(xe),e.Shared=(0,t.__importStar)(U2),e.Slices=(0,t.__importStar)(fb);var r=cb;Object.defineProperty(e,"UID",{enumerable:!0,get:function(){return(0,t.__importDefault)(r).default}}),e.Widget=(0,t.__importStar)(Oi);var i=pt;Object.defineProperty(e,"WidgetTypes",{enumerable:!0,get:function(){return i.WidgetTypes}})}(tt),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Widgets=e.Section=void 0;const t=ee.exports;(0,t.__exportStar)(pn,e),e.Section=(0,t.__importStar)(Ii),e.Widgets=(0,t.__importStar)(tt)}(LM);function V0e(e){return vi(e.json)}function H0e(e,t){const n=e.json[t];if(n===void 0)throw new Error(`Cannot find a section with name '${t}'.`);return n}function J0e(e,t){return ff(n=>e[n]!==void 0)(t)}function ga(e){return e!=null}function G0e(e){const t=m(e,Qg(ga));return new Map(Lp(t))}var Rt=Tu();function Y0e(e){return e.type===tt.WidgetTypes.LegacySlices||e.type===tt.WidgetTypes.Slices}function Z0e(e){return e.__TYPE__===Rt.WidgetTypes.slices}function $E(e){return Object.entries(e).filter(t=>t[1]!==void 0)}function vt(e,t){return e===void 0||!t(e)?void 0:e}function X0e(e){const t=m(e,ey(Y0e),U$(Lp));return[md(t),vd(t)]}function Q0e(e,t){return m(t,ff((n,r)=>e[n]!==void 0&&(r===void 0||Rt.StaticWidgetContent.is(r))))}function eTe(e){return e.__TYPE__==="SharedSliceContent"}function tTe(e){return e.__TYPE__==="CompositeSliceContent"}function nTe(e){return e.__TYPE__!==Rt.WidgetTypes.Empty&&e.__TYPE__!==Rt.WidgetTypes.UID&&e.__TYPE__!=="CompositeSliceContent"&&e.__TYPE__!=="SharedSliceContent"}function rTe(e){return e.__TYPE__===Rt.WidgetTypes.Empty}function iTe(e,t,n){const r=e.value[t];if(r===void 0)throw new Error(`Cannot update undefined content at index ${t}.`);return{...e,value:[...e.value.slice(0,t),{...r,widget:n!=null?n:{__TYPE__:"EmptyContent",type:""}},...e.value.slice(t+1)]}}function oTe(e){var t,n,r;return(r=(n=(t=e.config)==null?void 0:t.label)!=null?n:e.fieldset)!=null?r:e.type}function aTe(e){var t;return(t=e["non-repeat"])!=null?t:{}}function uTe(e){var t;return(t=e.repeat)!=null?t:{}}function z2(e){return e.__TYPE__===Rt.WidgetTypes.Group}function db(e){return e.__TYPE__!==Rt.WidgetTypes.Empty&&e.__TYPE__!==Rt.WidgetTypes.Group&&e.__TYPE__!==Rt.WidgetTypes.UID}function sTe(e,t,n){return n===void 0?Bg(t)(e):{...e,[t]:n}}var cTe=bf();function lTe(e){return e.__TYPE__===Rt.WidgetTypes.Field&&e.type==="Color"}function fTe(e){return e.__TYPE__===Rt.WidgetTypes.Field&&e.type==="Date"}function dTe(e){return e.__TYPE__===Rt.WidgetTypes.GeoPoint}function pTe(e){return e.__TYPE__===Rt.WidgetTypes.Image}function hTe(e){return e.__TYPE__===Rt.WidgetTypes.Field&&e.type==="Text"}function mTe(e){return e.__TYPE__===Rt.WidgetTypes.Field&&e.type==="Number"}function vTe(e){return e.__TYPE__===Rt.WidgetTypes.Field&&e.type==="Range"}function gTe(e){return e.__TYPE__===Rt.WidgetTypes.Field&&e.type==="Select"}function yTe(e){return e.__TYPE__===Rt.WidgetTypes.Field&&e.type==="Timestamp"}function fc(e){var t,n,r;return(r=(n=(t=e.config)==null?void 0:t.label)!=null?n:e.type===tt.WidgetTypes.BooleanField||e.type===tt.WidgetTypes.Separator?void 0:e.fieldset)!=null?r:e.type}const q2="...";function pb(e,t){var n,r,i,o,a;return e.type===tt.WidgetTypes.BooleanField?(i=t?(n=e.config)==null?void 0:n.placeholder_true:(r=e.config)==null?void 0:r.placeholder_false)!=null?i:q2:e.type===tt.WidgetTypes.GeoPoint?"TODO":(a=(o=e.config)==null?void 0:o.placeholder)!=null?a:q2}var hb={exports:{}},Ih={};/**
5
+ `}}function F2(e){return io.exact(io.intersection([io.type({id:io.string,label:V0e.StringOrNull,repeatable:(0,W2.withFallback)(io.boolean,!0),json:io.record(io.string,e),status:(0,W2.withFallback)(io.boolean,!0)}),io.partial({hash:io.string})]))}pn.StaticCustomType=F2(gE.StaticSection),pn.CustomType=F2(gE.DynamicSection);function D2(e){return Object.entries(e.json).reduce((t,[,n])=>{const r=Object.entries(n);return t.concat(r)},[])}pn.flattenWidgets=D2;function J0e(e){return D2(e).filter(([,r])=>r.type===P2.WidgetTypes.Slices).reduce((r,[,i])=>{const o=Object.entries(i.config&&i.config.choices?i.config.choices:{}).filter(([,a])=>a.type===N2.SlicesTypes.SharedSlice).map(([a])=>a);return r.concat(o)},[])}function G0e(e){const t=J0e(e);return function(n){return t.map(n)}}function Y0e(e,t){const n=Object.entries(e.json).reduce((r,[i,o])=>({...r,[i]:gE.Sections.toStatic(o,t)}),{});return{...e,json:n}}pn.toStatic=Y0e;function Z0e(e,t){const n=G0e(e)(r=>{if(!t.get(r))return r}).filter(Boolean);return n.length>0?(0,k2.left)(new H0e(n)):(0,k2.right)(e)}pn.validateSlices=Z0e;function L2(e,t){const n=Object.entries(e.json).reduce((r,[i,o])=>{const a=Object.entries(o).reduce((u,[s,c])=>{const l=t(s,c);return l?{...u,[s]:l}:u},{});return{...r,[i]:a}},{});return{...e,json:n}}pn.collectWidgets=L2;function X0e(e,t){return L2(e,(n,r)=>{if(r.type===P2.WidgetTypes.Slices){if(!r.config||!r.config.choices)return r;const i=Object.entries(r.config.choices).reduce((a,[u,s])=>s.type===N2.SlicesTypes.SharedSlice&&!t.get(u)?a:{...a,[u]:s},{}),o={...r.config,choices:i};return{...r,config:o}}return r})}pn.filterMissingSharedSlices=X0e;var tt={},j2={};(function(e){var t=se&&se.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(e,"__esModule",{value:!0}),e.ImageConstraint=void 0;var n=gh;Object.defineProperty(e,"ImageConstraint",{enumerable:!0,get:function(){return t(n).default}})})(j2);var fb={},U2={};Object.defineProperty(U2,"__esModule",{value:!0}),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SlicesTypes=e.SliceZone=e.Slice=e.SharedSliceRef=e.LegacySlice=e.CompositeSlice=void 0;const t=ee.exports;var n=ab;Object.defineProperty(e,"CompositeSlice",{enumerable:!0,get:function(){return(0,t.__importDefault)(n).default}});var r=ub;Object.defineProperty(e,"LegacySlice",{enumerable:!0,get:function(){return(0,t.__importDefault)(r).default}}),(0,t.__exportStar)(fE,e);var i=sb;Object.defineProperty(e,"SharedSliceRef",{enumerable:!0,get:function(){return(0,t.__importDefault)(i).default}}),e.Slice=(0,t.__importStar)(U2),e.SliceZone=(0,t.__importStar)(cE);var o=ha;Object.defineProperty(e,"SlicesTypes",{enumerable:!0,get:function(){return o.SlicesTypes}})}(fb),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.WidgetTypes=e.Widget=e.UID=e.Slices=e.Shared=e.Nestable=e.Group=void 0;const t=ee.exports;var n=Th;Object.defineProperty(e,"Group",{enumerable:!0,get:function(){return(0,t.__importDefault)(n).default}}),e.Nestable=(0,t.__importStar)(xe),e.Shared=(0,t.__importStar)(j2),e.Slices=(0,t.__importStar)(fb);var r=cb;Object.defineProperty(e,"UID",{enumerable:!0,get:function(){return(0,t.__importDefault)(r).default}}),e.Widget=(0,t.__importStar)(Oi);var i=pt;Object.defineProperty(e,"WidgetTypes",{enumerable:!0,get:function(){return i.WidgetTypes}})}(tt),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Widgets=e.Section=void 0;const t=ee.exports;(0,t.__exportStar)(pn,e),e.Section=(0,t.__importStar)(Ii),e.Widgets=(0,t.__importStar)(tt)}(FM);function Q0e(e){return vi(e.json)}function eTe(e,t){const n=e.json[t];if(n===void 0)throw new Error(`Cannot find a section with name '${t}'.`);return n}function tTe(e,t){return cf(n=>e[n]!==void 0)(t)}function va(e){return e!=null}function nTe(e){const t=m(e,Qg(va));return new Map(Lp(t))}var Rt=_u();function rTe(e){return e.type===tt.WidgetTypes.LegacySlices||e.type===tt.WidgetTypes.Slices}function iTe(e){return e.__TYPE__===Rt.WidgetTypes.slices}function yE(e){return Object.entries(e).filter(t=>t[1]!==void 0)}function vt(e,t){return e===void 0||!t(e)?void 0:e}function oTe(e){const t=m(e,ey(rTe),j$(Lp));return[pd(t),hd(t)]}function aTe(e,t){return m(t,cf((n,r)=>e[n]!==void 0&&(r===void 0||Rt.StaticWidgetContent.is(r))))}function uTe(e){return e.__TYPE__==="SharedSliceContent"}function sTe(e){return e.__TYPE__==="CompositeSliceContent"}function cTe(e){return e.__TYPE__!==Rt.WidgetTypes.Empty&&e.__TYPE__!==Rt.WidgetTypes.UID&&e.__TYPE__!=="CompositeSliceContent"&&e.__TYPE__!=="SharedSliceContent"}function lTe(e){return e.__TYPE__===Rt.WidgetTypes.Empty}function fTe(e,t,n){const r=e.value[t];if(r===void 0)throw new Error(`Cannot update undefined content at index ${t}.`);return{...e,value:[...e.value.slice(0,t),{...r,widget:n!=null?n:{__TYPE__:"EmptyContent",type:""}},...e.value.slice(t+1)]}}function dTe(e){var t,n,r;return(r=(n=(t=e.config)==null?void 0:t.label)!=null?n:e.fieldset)!=null?r:e.type}function pTe(e){var t;return(t=e["non-repeat"])!=null?t:{}}function hTe(e){var t;return(t=e.repeat)!=null?t:{}}function B2(e){return e.__TYPE__===Rt.WidgetTypes.Group}function db(e){return e.__TYPE__!==Rt.WidgetTypes.Empty&&e.__TYPE__!==Rt.WidgetTypes.Group&&e.__TYPE__!==Rt.WidgetTypes.UID}function mTe(e,t,n){return n===void 0?Bg(t)(e):{...e,[t]:n}}var vTe=gf();function gTe(e){return e.__TYPE__===Rt.WidgetTypes.Field&&e.type==="Color"}function yTe(e){return e.__TYPE__===Rt.WidgetTypes.Field&&e.type==="Date"}function bTe(e){return e.__TYPE__===Rt.WidgetTypes.GeoPoint}function $Te(e){return e.__TYPE__===Rt.WidgetTypes.Image}function _Te(e){return e.__TYPE__===Rt.WidgetTypes.Field&&e.type==="Text"}function STe(e){return e.__TYPE__===Rt.WidgetTypes.Field&&e.type==="Number"}function TTe(e){return e.__TYPE__===Rt.WidgetTypes.Field&&e.type==="Range"}function ITe(e){return e.__TYPE__===Rt.WidgetTypes.Field&&e.type==="Select"}function OTe(e){return e.__TYPE__===Rt.WidgetTypes.Field&&e.type==="Timestamp"}function lc(e){var t,n,r;return(r=(n=(t=e.config)==null?void 0:t.label)!=null?n:e.type===tt.WidgetTypes.BooleanField||e.type===tt.WidgetTypes.Separator?void 0:e.fieldset)!=null?r:e.type}const z2="...";function pb(e,t){var n,r,i,o,a;return e.type===tt.WidgetTypes.BooleanField?(i=t?(n=e.config)==null?void 0:n.placeholder_true:(r=e.config)==null?void 0:r.placeholder_false)!=null?i:z2:e.type===tt.WidgetTypes.GeoPoint?"TODO":(a=(o=e.config)==null?void 0:o.placeholder)!=null?a:z2}var hb={exports:{}},Ih={};/**
6
6
  * @license React
7
7
  * react-jsx-runtime.production.min.js
8
8
  *
@@ -10,7 +10,7 @@ ${t.map(r=>` - ${r}`).join(`
10
10
  *
11
11
  * This source code is licensed under the MIT license found in the
12
12
  * LICENSE file in the root directory of this source tree.
13
- */var K2;function bTe(){if(K2)return Ih;K2=1;var e=Pc.default,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function a(u,s,c){var l,f={},d=null,p=null;c!==void 0&&(d=""+c),s.key!==void 0&&(d=""+s.key),s.ref!==void 0&&(p=s.ref);for(l in s)r.call(s,l)&&!o.hasOwnProperty(l)&&(f[l]=s[l]);if(u&&u.defaultProps)for(l in s=u.defaultProps,s)f[l]===void 0&&(f[l]=s[l]);return{$$typeof:t,type:u,key:d,ref:p,props:f,_owner:i.current}}return Ih.Fragment=n,Ih.jsx=a,Ih.jsxs=a,Ih}var Oh={};/**
13
+ */var q2;function wTe(){if(q2)return Ih;q2=1;var e=Nc.default,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function a(u,s,c){var l,f={},d=null,p=null;c!==void 0&&(d=""+c),s.key!==void 0&&(d=""+s.key),s.ref!==void 0&&(p=s.ref);for(l in s)r.call(s,l)&&!o.hasOwnProperty(l)&&(f[l]=s[l]);if(u&&u.defaultProps)for(l in s=u.defaultProps,s)f[l]===void 0&&(f[l]=s[l]);return{$$typeof:t,type:u,key:d,ref:p,props:f,_owner:i.current}}return Ih.Fragment=n,Ih.jsx=a,Ih.jsxs=a,Ih}var Oh={};/**
14
14
  * @license React
15
15
  * react-jsx-runtime.development.js
16
16
  *
@@ -18,29 +18,29 @@ ${t.map(r=>` - ${r}`).join(`
18
18
  *
19
19
  * This source code is licensed under the MIT license found in the
20
20
  * LICENSE file in the root directory of this source tree.
21
- */var V2;function $Te(){return V2||(V2=1,process.env.NODE_ENV!=="production"&&function(){var e=Pc.default,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),u=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),l=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),h=Symbol.iterator,v="@@iterator";function y($){if($===null||typeof $!="object")return null;var q=h&&$[h]||$[v];return typeof q=="function"?q:null}var b=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function w($){{for(var q=arguments.length,Q=new Array(q>1?q-1:0),be=1;be<q;be++)Q[be-1]=arguments[be];F("error",$,Q)}}function F($,q,Q){{var be=b.ReactDebugCurrentFrame,Ke=be.getStackAddendum();Ke!==""&&(q+="%s",Q=Q.concat([Ke]));var nt=Q.map(function(Le){return String(Le)});nt.unshift("Warning: "+q),Function.prototype.apply.call(console[$],console,nt)}}var g=!1,I=!1,T=!1,k=!1,E=!1,Y;Y=Symbol.for("react.module.reference");function K($){return!!(typeof $=="string"||typeof $=="function"||$===r||$===o||E||$===i||$===c||$===l||k||$===p||g||I||T||typeof $=="object"&&$!==null&&($.$$typeof===d||$.$$typeof===f||$.$$typeof===a||$.$$typeof===u||$.$$typeof===s||$.$$typeof===Y||$.getModuleId!==void 0))}function x($,q,Q){var be=$.displayName;if(be)return be;var Ke=q.displayName||q.name||"";return Ke!==""?Q+"("+Ke+")":Q}function X($){return $.displayName||"Context"}function O($){if($==null)return null;if(typeof $.tag=="number"&&w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof $=="function")return $.displayName||$.name||null;if(typeof $=="string")return $;switch($){case r:return"Fragment";case n:return"Portal";case o:return"Profiler";case i:return"StrictMode";case c:return"Suspense";case l:return"SuspenseList"}if(typeof $=="object")switch($.$$typeof){case u:var q=$;return X(q)+".Consumer";case a:var Q=$;return X(Q._context)+".Provider";case s:return x($,$.render,"ForwardRef");case f:var be=$.displayName||null;return be!==null?be:O($.type)||"Memo";case d:{var Ke=$,nt=Ke._payload,Le=Ke._init;try{return O(Le(nt))}catch{return null}}}return null}var R=Object.assign,W=0,L,z,j,S,_,U,G;function ge(){}ge.__reactDisabledLog=!0;function he(){{if(W===0){L=console.log,z=console.info,j=console.warn,S=console.error,_=console.group,U=console.groupCollapsed,G=console.groupEnd;var $={configurable:!0,enumerable:!0,value:ge,writable:!0};Object.defineProperties(console,{info:$,log:$,warn:$,error:$,group:$,groupCollapsed:$,groupEnd:$})}W++}}function Se(){{if(W--,W===0){var $={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:R({},$,{value:L}),info:R({},$,{value:z}),warn:R({},$,{value:j}),error:R({},$,{value:S}),group:R({},$,{value:_}),groupCollapsed:R({},$,{value:U}),groupEnd:R({},$,{value:G})})}W<0&&w("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Qe=b.ReactCurrentDispatcher,Ft;function Jt($,q,Q){{if(Ft===void 0)try{throw Error()}catch(Ke){var be=Ke.stack.trim().match(/\n( *(at )?)/);Ft=be&&be[1]||""}return`
22
- `+Ft+$}}var Yr=!1,Wn;{var bo=typeof WeakMap=="function"?WeakMap:Map;Wn=new bo}function xa($,q){if(!$||Yr)return"";{var Q=Wn.get($);if(Q!==void 0)return Q}var be;Yr=!0;var Ke=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var nt;nt=Qe.current,Qe.current=null,he();try{if(q){var Le=function(){throw Error()};if(Object.defineProperty(Le.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Le,[])}catch(Fa){be=Fa}Reflect.construct($,[],Le)}else{try{Le.call()}catch(Fa){be=Fa}$.call(Le.prototype)}}else{try{throw Error()}catch(Fa){be=Fa}$()}}catch(Fa){if(Fa&&be&&typeof Fa.stack=="string"){for(var ke=Fa.stack.split(`
23
- `),Pn=be.stack.split(`
21
+ */var K2;function ETe(){return K2||(K2=1,process.env.NODE_ENV!=="production"&&function(){var e=Nc.default,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),u=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),l=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),h=Symbol.iterator,v="@@iterator";function y($){if($===null||typeof $!="object")return null;var K=h&&$[h]||$[v];return typeof K=="function"?K:null}var b=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function w($){{for(var K=arguments.length,Q=new Array(K>1?K-1:0),$e=1;$e<K;$e++)Q[$e-1]=arguments[$e];F("error",$,Q)}}function F($,K,Q){{var $e=b.ReactDebugCurrentFrame,Ve=$e.getStackAddendum();Ve!==""&&(K+="%s",Q=Q.concat([Ve]));var nt=Q.map(function(Le){return String(Le)});nt.unshift("Warning: "+K),Function.prototype.apply.call(console[$],console,nt)}}var g=!1,I=!1,T=!1,k=!1,E=!1,H;H=Symbol.for("react.module.reference");function q($){return!!(typeof $=="string"||typeof $=="function"||$===r||$===o||E||$===i||$===c||$===l||k||$===p||g||I||T||typeof $=="object"&&$!==null&&($.$$typeof===d||$.$$typeof===f||$.$$typeof===a||$.$$typeof===u||$.$$typeof===s||$.$$typeof===H||$.getModuleId!==void 0))}function x($,K,Q){var $e=$.displayName;if($e)return $e;var Ve=K.displayName||K.name||"";return Ve!==""?Q+"("+Ve+")":Q}function J($){return $.displayName||"Context"}function O($){if($==null)return null;if(typeof $.tag=="number"&&w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof $=="function")return $.displayName||$.name||null;if(typeof $=="string")return $;switch($){case r:return"Fragment";case n:return"Portal";case o:return"Profiler";case i:return"StrictMode";case c:return"Suspense";case l:return"SuspenseList"}if(typeof $=="object")switch($.$$typeof){case u:var K=$;return J(K)+".Consumer";case a:var Q=$;return J(Q._context)+".Provider";case s:return x($,$.render,"ForwardRef");case f:var $e=$.displayName||null;return $e!==null?$e:O($.type)||"Memo";case d:{var Ve=$,nt=Ve._payload,Le=Ve._init;try{return O(Le(nt))}catch{return null}}}return null}var R=Object.assign,C=0,L,z,j,S,_,U,Y;function ge(){}ge.__reactDisabledLog=!0;function he(){{if(C===0){L=console.log,z=console.info,j=console.warn,S=console.error,_=console.group,U=console.groupCollapsed,Y=console.groupEnd;var $={configurable:!0,enumerable:!0,value:ge,writable:!0};Object.defineProperties(console,{info:$,log:$,warn:$,error:$,group:$,groupCollapsed:$,groupEnd:$})}C++}}function Te(){{if(C--,C===0){var $={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:R({},$,{value:L}),info:R({},$,{value:z}),warn:R({},$,{value:j}),error:R({},$,{value:S}),group:R({},$,{value:_}),groupCollapsed:R({},$,{value:U}),groupEnd:R({},$,{value:Y})})}C<0&&w("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Qe=b.ReactCurrentDispatcher,Ft;function Jt($,K,Q){{if(Ft===void 0)try{throw Error()}catch(Ve){var $e=Ve.stack.trim().match(/\n( *(at )?)/);Ft=$e&&$e[1]||""}return`
22
+ `+Ft+$}}var Yr=!1,Wn;{var yo=typeof WeakMap=="function"?WeakMap:Map;Wn=new yo}function Ma($,K){if(!$||Yr)return"";{var Q=Wn.get($);if(Q!==void 0)return Q}var $e;Yr=!0;var Ve=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var nt;nt=Qe.current,Qe.current=null,he();try{if(K){var Le=function(){throw Error()};if(Object.defineProperty(Le.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Le,[])}catch(Pa){$e=Pa}Reflect.construct($,[],Le)}else{try{Le.call()}catch(Pa){$e=Pa}$.call(Le.prototype)}}else{try{throw Error()}catch(Pa){$e=Pa}$()}}catch(Pa){if(Pa&&$e&&typeof Pa.stack=="string"){for(var ke=Pa.stack.split(`
23
+ `),Pn=$e.stack.split(`
24
24
  `),Mt=ke.length-1,kt=Pn.length-1;Mt>=1&&kt>=0&&ke[Mt]!==Pn[kt];)kt--;for(;Mt>=1&&kt>=0;Mt--,kt--)if(ke[Mt]!==Pn[kt]){if(Mt!==1||kt!==1)do if(Mt--,kt--,kt<0||ke[Mt]!==Pn[kt]){var ei=`
25
- `+ke[Mt].replace(" at new "," at ");return $.displayName&&ei.includes("<anonymous>")&&(ei=ei.replace("<anonymous>",$.displayName)),typeof $=="function"&&Wn.set($,ei),ei}while(Mt>=1&&kt>=0);break}}}finally{Yr=!1,Qe.current=nt,Se(),Error.prepareStackTrace=Ke}var pd=$?$.displayName||$.name:"",R5=pd?Jt(pd):"";return typeof $=="function"&&Wn.set($,R5),R5}function Ca($,q,Q){return xa($,!1)}function Yu($){var q=$.prototype;return!!(q&&q.isReactComponent)}function ki($,q,Q){if($==null)return"";if(typeof $=="function")return xa($,Yu($));if(typeof $=="string")return Jt($);switch($){case c:return Jt("Suspense");case l:return Jt("SuspenseList")}if(typeof $=="object")switch($.$$typeof){case s:return Ca($.render);case f:return ki($.type,q,Q);case d:{var be=$,Ke=be._payload,nt=be._init;try{return ki(nt(Ke),q,Q)}catch{}}}return""}var Zr=Object.prototype.hasOwnProperty,$o={},Aa=b.ReactDebugCurrentFrame;function Wi($){if($){var q=$._owner,Q=ki($.type,$._source,q?q.type:null);Aa.setExtraStackFrame(Q)}else Aa.setExtraStackFrame(null)}function ir($,q,Q,be,Ke){{var nt=Function.call.bind(Zr);for(var Le in $)if(nt($,Le)){var ke=void 0;try{if(typeof $[Le]!="function"){var Pn=Error((be||"React class")+": "+Q+" type `"+Le+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof $[Le]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Pn.name="Invariant Violation",Pn}ke=$[Le](q,Le,be,Q,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Mt){ke=Mt}ke&&!(ke instanceof Error)&&(Wi(Ke),w("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",be||"React class",Q,Le,typeof ke),Wi(null)),ke instanceof Error&&!(ke.message in $o)&&($o[ke.message]=!0,Wi(Ke),w("Failed %s type: %s",Q,ke.message),Wi(null))}}}var Xr=Array.isArray;function Ni($){return Xr($)}function Pi($){{var q=typeof Symbol=="function"&&Symbol.toStringTag,Q=q&&$[Symbol.toStringTag]||$.constructor.name||"Object";return Q}}function ka($){try{return Wa($),!1}catch{return!0}}function Wa($){return""+$}function Na($){if(ka($))return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Pi($)),Wa($)}var Qr=b.ReactCurrentOwner,Zu={key:!0,ref:!0,__self:!0,__source:!0},sd,C,M;M={};function D($){if(Zr.call($,"ref")){var q=Object.getOwnPropertyDescriptor($,"ref").get;if(q&&q.isReactWarning)return!1}return $.ref!==void 0}function Me($){if(Zr.call($,"key")){var q=Object.getOwnPropertyDescriptor($,"key").get;if(q&&q.isReactWarning)return!1}return $.key!==void 0}function A($,q){if(typeof $.ref=="string"&&Qr.current&&q&&Qr.current.stateNode!==q){var Q=O(Qr.current.type);M[Q]||(w('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',O(Qr.current.type),$.ref),M[Q]=!0)}}function ne($,q){{var Q=function(){sd||(sd=!0,w("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",q))};Q.isReactWarning=!0,Object.defineProperty($,"key",{get:Q,configurable:!0})}}function pe($,q){{var Q=function(){C||(C=!0,w("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",q))};Q.isReactWarning=!0,Object.defineProperty($,"ref",{get:Q,configurable:!0})}}var de=function($,q,Q,be,Ke,nt,Le){var ke={$$typeof:t,type:$,key:q,ref:Q,props:Le,_owner:nt};return ke._store={},Object.defineProperty(ke._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(ke,"_self",{configurable:!1,enumerable:!1,writable:!1,value:be}),Object.defineProperty(ke,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Ke}),Object.freeze&&(Object.freeze(ke.props),Object.freeze(ke)),ke};function $e($,q,Q,be,Ke){{var nt,Le={},ke=null,Pn=null;Q!==void 0&&(Na(Q),ke=""+Q),Me(q)&&(Na(q.key),ke=""+q.key),D(q)&&(Pn=q.ref,A(q,Ke));for(nt in q)Zr.call(q,nt)&&!Zu.hasOwnProperty(nt)&&(Le[nt]=q[nt]);if($&&$.defaultProps){var Mt=$.defaultProps;for(nt in Mt)Le[nt]===void 0&&(Le[nt]=Mt[nt])}if(ke||Pn){var kt=typeof $=="function"?$.displayName||$.name||"Unknown":$;ke&&ne(Le,kt),Pn&&pe(Le,kt)}return de($,ke,Pn,Ke,be,Qr.current,Le)}}var it=b.ReactCurrentOwner,Nn=b.ReactDebugCurrentFrame;function Mr($){if($){var q=$._owner,Q=ki($.type,$._source,q?q.type:null);Nn.setExtraStackFrame(Q)}else Nn.setExtraStackFrame(null)}var cd;cd=!1;function Fi($){return typeof $=="object"&&$!==null&&$.$$typeof===t}function ld(){{if(it.current){var $=O(it.current.type);if($)return`
25
+ `+ke[Mt].replace(" at new "," at ");return $.displayName&&ei.includes("<anonymous>")&&(ei=ei.replace("<anonymous>",$.displayName)),typeof $=="function"&&Wn.set($,ei),ei}while(Mt>=1&&kt>=0);break}}}finally{Yr=!1,Qe.current=nt,Te(),Error.prepareStackTrace=Ve}var fd=$?$.displayName||$.name:"",W5=fd?Jt(fd):"";return typeof $=="function"&&Wn.set($,W5),W5}function xa($,K,Q){return Ma($,!1)}function Ju($){var K=$.prototype;return!!(K&&K.isReactComponent)}function ki($,K,Q){if($==null)return"";if(typeof $=="function")return Ma($,Ju($));if(typeof $=="string")return Jt($);switch($){case c:return Jt("Suspense");case l:return Jt("SuspenseList")}if(typeof $=="object")switch($.$$typeof){case s:return xa($.render);case f:return ki($.type,K,Q);case d:{var $e=$,Ve=$e._payload,nt=$e._init;try{return ki(nt(Ve),K,Q)}catch{}}}return""}var Zr=Object.prototype.hasOwnProperty,bo={},Ca=b.ReactDebugCurrentFrame;function Wi($){if($){var K=$._owner,Q=ki($.type,$._source,K?K.type:null);Ca.setExtraStackFrame(Q)}else Ca.setExtraStackFrame(null)}function ir($,K,Q,$e,Ve){{var nt=Function.call.bind(Zr);for(var Le in $)if(nt($,Le)){var ke=void 0;try{if(typeof $[Le]!="function"){var Pn=Error(($e||"React class")+": "+Q+" type `"+Le+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof $[Le]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Pn.name="Invariant Violation",Pn}ke=$[Le](K,Le,$e,Q,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Mt){ke=Mt}ke&&!(ke instanceof Error)&&(Wi(Ve),w("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",$e||"React class",Q,Le,typeof ke),Wi(null)),ke instanceof Error&&!(ke.message in bo)&&(bo[ke.message]=!0,Wi(Ve),w("Failed %s type: %s",Q,ke.message),Wi(null))}}}var Xr=Array.isArray;function Ni($){return Xr($)}function Pi($){{var K=typeof Symbol=="function"&&Symbol.toStringTag,Q=K&&$[Symbol.toStringTag]||$.constructor.name||"Object";return Q}}function Aa($){try{return ka($),!1}catch{return!0}}function ka($){return""+$}function Wa($){if(Aa($))return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Pi($)),ka($)}var Qr=b.ReactCurrentOwner,Gu={key:!0,ref:!0,__self:!0,__source:!0},ad,W,M;M={};function D($){if(Zr.call($,"ref")){var K=Object.getOwnPropertyDescriptor($,"ref").get;if(K&&K.isReactWarning)return!1}return $.ref!==void 0}function Me($){if(Zr.call($,"key")){var K=Object.getOwnPropertyDescriptor($,"key").get;if(K&&K.isReactWarning)return!1}return $.key!==void 0}function N($,K){if(typeof $.ref=="string"&&Qr.current&&K&&Qr.current.stateNode!==K){var Q=O(Qr.current.type);M[Q]||(w('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',O(Qr.current.type),$.ref),M[Q]=!0)}}function ne($,K){{var Q=function(){ad||(ad=!0,w("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",K))};Q.isReactWarning=!0,Object.defineProperty($,"key",{get:Q,configurable:!0})}}function pe($,K){{var Q=function(){W||(W=!0,w("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",K))};Q.isReactWarning=!0,Object.defineProperty($,"ref",{get:Q,configurable:!0})}}var de=function($,K,Q,$e,Ve,nt,Le){var ke={$$typeof:t,type:$,key:K,ref:Q,props:Le,_owner:nt};return ke._store={},Object.defineProperty(ke._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(ke,"_self",{configurable:!1,enumerable:!1,writable:!1,value:$e}),Object.defineProperty(ke,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Ve}),Object.freeze&&(Object.freeze(ke.props),Object.freeze(ke)),ke};function _e($,K,Q,$e,Ve){{var nt,Le={},ke=null,Pn=null;Q!==void 0&&(Wa(Q),ke=""+Q),Me(K)&&(Wa(K.key),ke=""+K.key),D(K)&&(Pn=K.ref,N(K,Ve));for(nt in K)Zr.call(K,nt)&&!Gu.hasOwnProperty(nt)&&(Le[nt]=K[nt]);if($&&$.defaultProps){var Mt=$.defaultProps;for(nt in Mt)Le[nt]===void 0&&(Le[nt]=Mt[nt])}if(ke||Pn){var kt=typeof $=="function"?$.displayName||$.name||"Unknown":$;ke&&ne(Le,kt),Pn&&pe(Le,kt)}return de($,ke,Pn,Ve,$e,Qr.current,Le)}}var it=b.ReactCurrentOwner,Nn=b.ReactDebugCurrentFrame;function Mr($){if($){var K=$._owner,Q=ki($.type,$._source,K?K.type:null);Nn.setExtraStackFrame(Q)}else Nn.setExtraStackFrame(null)}var ud;ud=!1;function Fi($){return typeof $=="object"&&$!==null&&$.$$typeof===t}function sd(){{if(it.current){var $=O(it.current.type);if($)return`
26
26
 
27
- Check the render method of \``+$+"`."}return""}}function fd($){{if($!==void 0){var q=$.fileName.replace(/^.*[\\\/]/,""),Q=$.lineNumber;return`
27
+ Check the render method of \``+$+"`."}return""}}function cd($){{if($!==void 0){var K=$.fileName.replace(/^.*[\\\/]/,""),Q=$.lineNumber;return`
28
28
 
29
- Check your code at `+q+":"+Q+"."}return""}}var Pa={};function PM($){{var q=ld();if(!q){var Q=typeof $=="string"?$:$.displayName||$.name;Q&&(q=`
29
+ Check your code at `+K+":"+Q+"."}return""}}var Na={};function WM($){{var K=sd();if(!K){var Q=typeof $=="string"?$:$.displayName||$.name;Q&&(K=`
30
30
 
31
- Check the top-level render call using <`+Q+">.")}return q}}function dd($,q){{if(!$._store||$._store.validated||$.key!=null)return;$._store.validated=!0;var Q=PM(q);if(Pa[Q])return;Pa[Q]=!0;var be="";$&&$._owner&&$._owner!==it.current&&(be=" It was passed a child from "+O($._owner.type)+"."),Mr($),w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',Q,be),Mr(null)}}function Nc($,q){{if(typeof $!="object")return;if(Ni($))for(var Q=0;Q<$.length;Q++){var be=$[Q];Fi(be)&&dd(be,q)}else if(Fi($))$._store&&($._store.validated=!0);else if($){var Ke=y($);if(typeof Ke=="function"&&Ke!==$.entries)for(var nt=Ke.call($),Le;!(Le=nt.next()).done;)Fi(Le.value)&&dd(Le.value,q)}}}function mAe($){{var q=$.type;if(q==null||typeof q=="string")return;var Q;if(typeof q=="function")Q=q.propTypes;else if(typeof q=="object"&&(q.$$typeof===s||q.$$typeof===f))Q=q.propTypes;else return;if(Q){var be=O(q);ir(Q,$.props,"prop",be,$)}else if(q.PropTypes!==void 0&&!cd){cd=!0;var Ke=O(q);w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Ke||"Unknown")}typeof q.getDefaultProps=="function"&&!q.getDefaultProps.isReactClassApproved&&w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function vAe($){{for(var q=Object.keys($.props),Q=0;Q<q.length;Q++){var be=q[Q];if(be!=="children"&&be!=="key"){Mr($),w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",be),Mr(null);break}}$.ref!==null&&(Mr($),w("Invalid attribute `ref` supplied to `React.Fragment`."),Mr(null))}}function E5($,q,Q,be,Ke,nt){{var Le=K($);if(!Le){var ke="";($===void 0||typeof $=="object"&&$!==null&&Object.keys($).length===0)&&(ke+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Pn=fd(Ke);Pn?ke+=Pn:ke+=ld();var Mt;$===null?Mt="null":Ni($)?Mt="array":$!==void 0&&$.$$typeof===t?(Mt="<"+(O($.type)||"Unknown")+" />",ke=" Did you accidentally export a JSX literal instead of a component?"):Mt=typeof $,w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Mt,ke)}var kt=$e($,q,Q,Ke,nt);if(kt==null)return kt;if(Le){var ei=q.children;if(ei!==void 0)if(be)if(Ni(ei)){for(var pd=0;pd<ei.length;pd++)Nc(ei[pd],$);Object.freeze&&Object.freeze(ei)}else w("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Nc(ei,$)}return $===r?vAe(kt):mAe(kt),kt}}function gAe($,q,Q){return E5($,q,Q,!0)}function yAe($,q,Q){return E5($,q,Q,!1)}var bAe=yAe,$Ae=gAe;Oh.Fragment=r,Oh.jsx=bAe,Oh.jsxs=$Ae}()),Oh}(function(e){process.env.NODE_ENV==="production"?e.exports=bTe():e.exports=$Te()})(hb);const wf=hb.exports.Fragment,N=hb.exports.jsx,He=hb.exports.jsxs,_Te=({content:e,field:t,id:n,onContentChange:r,readOnly:i})=>{var a,u,s;const o=(s=(u=e==null?void 0:e.value)!=null?u:(a=t.config)==null?void 0:a.default_value)!=null?s:!1;return He(P.Field,{children:[N(P.FieldIcon,{children:N(P.Icon,{name:"toggleOff"})}),N(P.FieldLabel,{htmlFor:n,children:fc(t)}),He(P.FieldControl,{children:[N(P.Text,{children:pb(t,o)}),N(P.Switch,{checked:o,id:n,onCheckedChange:c=>{i||r(STe(c))}})]})]})};function STe(e){return{__TYPE__:"BooleanContent",value:e}}function TTe(e,t){const n={};for(const r in e)n[r]=t(e[r],r);return n}const mb="main";function ITe(e,t,n){const r=e.name===mb?void 0:e.name;let i;return t?ga(e.width)&&ga(e.height)?i=[e.width,e.height]:ga(n)?i=[n.origin.width,n.origin.height]:i=void 0:i=void 0,[r,i?`${i[0]}x${i[1]}px`:void 0]}function OTe(e){var t,n,r;return[{...(t=e.config)==null?void 0:t.constraint,name:mb}].concat((r=(n=e.config)==null?void 0:n.thumbnails)!=null?r:[])}function wTe(e,t){var a,u;const{__TYPE__:n,thumbnails:r,...i}=t,o=(u=(a=e.config)==null?void 0:a.thumbnails)==null?void 0:u.map(({name:s})=>r==null?void 0:r[s]);return[i,...o!=null?o:[]]}function ETe(e,t,n,r){const i=r.length===0?void 0:r;return e===mb?{...t,alt:i}:{...t,thumbnails:{...t.thumbnails,[e]:{...n,alt:i}}}}function RTe(e,t,n,r){var a,u,s,c,l,f;if(!n){const d=(a=t.config)==null?void 0:a.thumbnails,p=d&&Object.fromEntries(d.map(h=>[h.name,vb(r,h)]));return{__TYPE__:"ImageContent",...vb(r,(u=t.config)==null?void 0:u.constraint),thumbnails:p}}if(e===mb)return{...n,...vb(r,(s=t.config)==null?void 0:s.constraint)};const i=(l=(c=t.config)==null?void 0:c.thumbnails)==null?void 0:l.find(d=>d.name===e);if(!i)return n;const o=vb(r,i);return{...n,thumbnails:TTe((f=n.thumbnails)!=null?f:{},(d,p)=>p===e?o:d)}}function vb(e,t){const{width:n,height:r,rect:i}=MTe(e,t),o=Boolean((t==null?void 0:t.width)||(t==null?void 0:t.height));return{url:CTe(e.url,i,n,r,o),origin:{id:e.id,url:e.url,width:e.width,height:e.height},width:n,height:r,edit:{background:"transparent",zoom:1,crop:{x:i.x,y:i.y}}}}function MTe(e,t){const[n,r]=xTe(e,t),i=Math.max(n/e.width,r/e.height),o=Math.round((e.width-n/i)/2),a=Math.round((e.height-r/i)/2),u=Math.round(n/i),s=Math.round(r/i);return{width:n,height:r,rect:{x:o,y:a,width:u,height:s}}}function xTe(e,t){const{width:n,height:r}=t!=null?t:{};return n&&r?[n,r]:n?[n,Math.round(e.height*(n/e.width))]:r?[Math.round(e.width*(r/e.height)),r]:[e.width,e.height]}function CTe(e,t,n,r,i){const o=new URL(e);if(i){const{x:a,y:u,width:s,height:c}=t;o.searchParams.set("rect",[a,u,s,c].join(",")),o.searchParams.set("w",n.toString()),o.searchParams.set("h",r.toString())}return o.toString()}function ATe(e){const t=ue.useRef(e);return ue.useEffect(()=>{t.current=e}),ue.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function kTe(){const[e,t]=ue.useState({});return ue.useCallback(()=>()=>t({}),[])}function WTe(e,t,n){ue.useEffect(()=>{const r=setTimeout(()=>n(e),t);return()=>clearTimeout(r)},[e])}var Je;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const o={};for(const a of i)o[a]=a;return o},e.getValidEnumValues=i=>{const o=e.objectKeys(i).filter(u=>typeof i[i[u]]!="number"),a={};for(const u of o)a[u]=i[u];return e.objectValues(a)},e.objectValues=i=>e.objectKeys(i).map(function(o){return i[o]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const o=[];for(const a in i)Object.prototype.hasOwnProperty.call(i,a)&&o.push(a);return o},e.find=(i,o)=>{for(const a of i)if(o(a))return a},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}e.joinValues=r,e.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(Je||(Je={}));const oe=Je.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),dc=e=>{switch(typeof e){case"undefined":return oe.undefined;case"string":return oe.string;case"number":return isNaN(e)?oe.nan:oe.number;case"boolean":return oe.boolean;case"function":return oe.function;case"bigint":return oe.bigint;case"object":return Array.isArray(e)?oe.array:e===null?oe.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?oe.promise:typeof Map<"u"&&e instanceof Map?oe.map:typeof Set<"u"&&e instanceof Set?oe.set:typeof Date<"u"&&e instanceof Date?oe.date:oe.object;default:return oe.unknown}},te=Je.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of"]);class Iu extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(o){return o.message},r={_errors:[]},i=o=>{for(const a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let u=r,s=0;for(;s<a.path.length;){const c=a.path[s];s===a.path.length-1?(u[c]=u[c]||{_errors:[]},u[c]._errors.push(n(a))):u[c]=u[c]||{_errors:[]},u=u[c],s++}}};return i(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,Je.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Iu.create=e=>new Iu(e);const gb=(e,t)=>{let n;switch(e.code){case te.invalid_type:e.received===oe.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case te.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Je.jsonStringifyReplacer)}`;break;case te.unrecognized_keys:n=`Unrecognized key(s) in object: ${Je.joinValues(e.keys,", ")}`;break;case te.invalid_union:n="Invalid input";break;case te.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Je.joinValues(e.options)}`;break;case te.invalid_enum_value:n=`Invalid enum value. Expected ${Je.joinValues(e.options)}, received '${e.received}'`;break;case te.invalid_arguments:n="Invalid function arguments";break;case te.invalid_return_type:n="Invalid function return type";break;case te.invalid_date:n="Invalid date";break;case te.invalid_string:typeof e.validation=="object"?"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Je.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case te.too_small:e.type==="array"?n=`Array must contain ${e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be greater than ${e.inclusive?"or equal to ":""}${e.minimum}`:e.type==="date"?n=`Date must be greater than ${e.inclusive?"or equal to ":""}${new Date(e.minimum)}`:n="Invalid input";break;case te.too_big:e.type==="array"?n=`Array must contain ${e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be less than ${e.inclusive?"or equal to ":""}${e.maximum}`:e.type==="date"?n=`Date must be smaller than ${e.inclusive?"or equal to ":""}${new Date(e.maximum)}`:n="Invalid input";break;case te.custom:n="Invalid input";break;case te.invalid_intersection_types:n="Intersection results could not be merged";break;case te.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;default:n=t.defaultError,Je.assertNever(e)}return{message:n}};let NTe=gb;function _E(){return NTe}const SE=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,o=[...n,...i.path||[]],a={...i,path:o};let u="";const s=r.filter(c=>!!c).slice().reverse();for(const c of s)u=c(a,{data:t,defaultError:u}).message;return{...i,path:o,message:i.message||u}};function fe(e,t){const n=SE({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,_E(),gb].filter(r=>!!r)});e.common.issues.push(n)}class Zn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return we;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n)r.push({key:await i.key,value:await i.value});return Zn.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:o,value:a}=i;if(o.status==="aborted"||a.status==="aborted")return we;o.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),(typeof a.value<"u"||i.alwaysSet)&&(r[o.value]=a.value)}return{status:t.value,value:r}}}const we=Object.freeze({status:"aborted"}),Xn=e=>({status:"valid",value:e}),H2=e=>e.status==="aborted",J2=e=>e.status==="dirty",TE=e=>e.status==="valid",G2=e=>typeof Promise!==void 0&&e instanceof Promise;var ze;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(ze||(ze={}));class ao{constructor(t,n,r,i){this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._path.concat(this._key)}}const Y2=(e,t)=>{if(TE(t))return{success:!0,data:t.value};{if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");const n=new Iu(e.common.issues);return{success:!1,error:n}}};function Ce(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(a,u)=>a.code!=="invalid_type"?{message:u.defaultError}:typeof u.data>"u"?{message:r!=null?r:u.defaultError}:{message:n!=null?n:u.defaultError},description:i}}class Ue{constructor(t){this.spa=this.safeParseAsync,this.superRefine=this._refinement,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.default=this.default.bind(this),this.describe=this.describe.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return dc(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:dc(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Zn,ctx:{common:t.parent.common,data:t.data,parsedType:dc(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(G2(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:dc(t)},o=this._parseSync({data:t,path:i.path,parent:i});return Y2(i,o)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:dc(t)},i=this._parse({data:t,path:[],parent:r}),o=await(G2(i)?i:Promise.resolve(i));return Y2(r,o)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,o)=>{const a=t(i),u=()=>o.addIssue({code:te.custom,...r(i)});return typeof Promise<"u"&&a instanceof Promise?a.then(s=>s?!0:(u(),!1)):a?!0:(u(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new wu({schema:this,typeName:_e.ZodEffects,effect:{type:"refinement",refinement:t}})}optional(){return $a.create(this)}nullable(){return Cf.create(this)}nullish(){return this.optional().nullable()}array(){return ya.create(this)}promise(){return Rh.create(this)}or(t){return yb.create([this,t])}and(t){return bb.create(this,t)}transform(t){return new wu({schema:this,typeName:_e.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new Q2({innerType:this,defaultValue:n,typeName:_e.ZodDefault})}brand(){return new jTe({typeName:_e.ZodBranded,type:this,...Ce(void 0)})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const PTe=/^c[^\s-]{8,}$/i,FTe=/^([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,DTe=/^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i;class pc extends Ue{constructor(){super(...arguments),this._regex=(t,n,r)=>this.refinement(i=>t.test(i),{validation:n,code:te.invalid_string,...ze.errToObj(r)}),this.nonempty=t=>this.min(1,ze.errToObj(t)),this.trim=()=>new pc({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}_parse(t){if(this._getType(t)!==oe.string){const o=this._getOrReturnCtx(t);return fe(o,{code:te.invalid_type,expected:oe.string,received:o.parsedType}),we}const r=new Zn;let i;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(i=this._getOrReturnCtx(t,i),fe(i,{code:te.too_small,minimum:o.value,type:"string",inclusive:!0,message:o.message}),r.dirty());else if(o.kind==="max")t.data.length>o.value&&(i=this._getOrReturnCtx(t,i),fe(i,{code:te.too_big,maximum:o.value,type:"string",inclusive:!0,message:o.message}),r.dirty());else if(o.kind==="email")DTe.test(t.data)||(i=this._getOrReturnCtx(t,i),fe(i,{validation:"email",code:te.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")FTe.test(t.data)||(i=this._getOrReturnCtx(t,i),fe(i,{validation:"uuid",code:te.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")PTe.test(t.data)||(i=this._getOrReturnCtx(t,i),fe(i,{validation:"cuid",code:te.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),fe(i,{validation:"url",code:te.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),fe(i,{validation:"regex",code:te.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="startsWith"?t.data.startsWith(o.value)||(i=this._getOrReturnCtx(t,i),fe(i,{code:te.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(i=this._getOrReturnCtx(t,i),fe(i,{code:te.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):Je.assertNever(o);return{status:r.value,value:t.data}}_addCheck(t){return new pc({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...ze.errToObj(t)})}url(t){return this._addCheck({kind:"url",...ze.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...ze.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...ze.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...ze.errToObj(n)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...ze.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...ze.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...ze.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...ze.errToObj(n)})}length(t,n){return this.min(t,n).max(t,n)}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}pc.create=e=>new pc({checks:[],typeName:_e.ZodString,...Ce(e)});function LTe(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,o=parseInt(e.toFixed(i).replace(".","")),a=parseInt(t.toFixed(i).replace(".",""));return o%a/Math.pow(10,i)}class Ef extends Ue{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._getType(t)!==oe.number){const o=this._getOrReturnCtx(t);return fe(o,{code:te.invalid_type,expected:oe.number,received:o.parsedType}),we}let r;const i=new Zn;for(const o of this._def.checks)o.kind==="int"?Je.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),fe(r,{code:te.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),fe(r,{code:te.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),fe(r,{code:te.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?LTe(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),fe(r,{code:te.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):Je.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,ze.toString(n))}gt(t,n){return this.setLimit("min",t,!1,ze.toString(n))}lte(t,n){return this.setLimit("max",t,!0,ze.toString(n))}lt(t,n){return this.setLimit("max",t,!1,ze.toString(n))}setLimit(t,n,r,i){return new Ef({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:ze.toString(i)}]})}_addCheck(t){return new Ef({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:ze.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ze.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ze.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ze.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ze.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:ze.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int")}}Ef.create=e=>new Ef({checks:[],typeName:_e.ZodNumber,...Ce(e)});class IE extends Ue{_parse(t){if(this._getType(t)!==oe.bigint){const r=this._getOrReturnCtx(t);return fe(r,{code:te.invalid_type,expected:oe.bigint,received:r.parsedType}),we}return Xn(t.data)}}IE.create=e=>new IE({typeName:_e.ZodBigInt,...Ce(e)});class OE extends Ue{_parse(t){if(this._getType(t)!==oe.boolean){const r=this._getOrReturnCtx(t);return fe(r,{code:te.invalid_type,expected:oe.boolean,received:r.parsedType}),we}return Xn(t.data)}}OE.create=e=>new OE({typeName:_e.ZodBoolean,...Ce(e)});class wh extends Ue{_parse(t){if(this._getType(t)!==oe.date){const o=this._getOrReturnCtx(t);return fe(o,{code:te.invalid_type,expected:oe.date,received:o.parsedType}),we}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return fe(o,{code:te.invalid_date}),we}const r=new Zn;let i;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(i=this._getOrReturnCtx(t,i),fe(i,{code:te.too_small,message:o.message,inclusive:!0,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(i=this._getOrReturnCtx(t,i),fe(i,{code:te.too_big,message:o.message,inclusive:!0,maximum:o.value,type:"date"}),r.dirty()):Je.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new wh({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:ze.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:ze.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}wh.create=e=>new wh({checks:[],typeName:_e.ZodDate,...Ce(e)});class wE extends Ue{_parse(t){if(this._getType(t)!==oe.undefined){const r=this._getOrReturnCtx(t);return fe(r,{code:te.invalid_type,expected:oe.undefined,received:r.parsedType}),we}return Xn(t.data)}}wE.create=e=>new wE({typeName:_e.ZodUndefined,...Ce(e)});class EE extends Ue{_parse(t){if(this._getType(t)!==oe.null){const r=this._getOrReturnCtx(t);return fe(r,{code:te.invalid_type,expected:oe.null,received:r.parsedType}),we}return Xn(t.data)}}EE.create=e=>new EE({typeName:_e.ZodNull,...Ce(e)});class RE extends Ue{constructor(){super(...arguments),this._any=!0}_parse(t){return Xn(t.data)}}RE.create=e=>new RE({typeName:_e.ZodAny,...Ce(e)});class Rf extends Ue{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Xn(t.data)}}Rf.create=e=>new Rf({typeName:_e.ZodUnknown,...Ce(e)});class Ou extends Ue{_parse(t){const n=this._getOrReturnCtx(t);return fe(n,{code:te.invalid_type,expected:oe.never,received:n.parsedType}),we}}Ou.create=e=>new Ou({typeName:_e.ZodNever,...Ce(e)});class ME extends Ue{_parse(t){if(this._getType(t)!==oe.undefined){const r=this._getOrReturnCtx(t);return fe(r,{code:te.invalid_type,expected:oe.void,received:r.parsedType}),we}return Xn(t.data)}}ME.create=e=>new ME({typeName:_e.ZodVoid,...Ce(e)});class ya extends Ue{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==oe.array)return fe(n,{code:te.invalid_type,expected:oe.array,received:n.parsedType}),we;if(i.minLength!==null&&n.data.length<i.minLength.value&&(fe(n,{code:te.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(fe(n,{code:te.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all(n.data.map((a,u)=>i.type._parseAsync(new ao(n,a,n.path,u)))).then(a=>Zn.mergeArray(r,a));const o=n.data.map((a,u)=>i.type._parseSync(new ao(n,a,n.path,u)));return Zn.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new ya({...this._def,minLength:{value:t,message:ze.toString(n)}})}max(t,n){return new ya({...this._def,maxLength:{value:t,message:ze.toString(n)}})}length(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}ya.create=(e,t)=>new ya({type:e,minLength:null,maxLength:null,typeName:_e.ZodArray,...Ce(t)});var xE;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(xE||(xE={}));const Z2=e=>t=>new gt({...e,shape:()=>({...e.shape(),...t})});function Mf(e){if(e instanceof gt){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=$a.create(Mf(r))}return new gt({...e._def,shape:()=>t})}else return e instanceof ya?ya.create(Mf(e.element)):e instanceof $a?$a.create(Mf(e.unwrap())):e instanceof Cf?Cf.create(Mf(e.unwrap())):e instanceof ba?ba.create(e.items.map(t=>Mf(t))):e}class gt extends Ue{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=Z2(this._def),this.extend=Z2(this._def)}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Je.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==oe.object){const c=this._getOrReturnCtx(t);return fe(c,{code:te.invalid_type,expected:oe.object,received:c.parsedType}),we}const{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),u=[];if(!(this._def.catchall instanceof Ou&&this._def.unknownKeys==="strip"))for(const c in i.data)a.includes(c)||u.push(c);const s=[];for(const c of a){const l=o[c],f=i.data[c];s.push({key:{status:"valid",value:c},value:l._parse(new ao(i,f,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof Ou){const c=this._def.unknownKeys;if(c==="passthrough")for(const l of u)s.push({key:{status:"valid",value:l},value:{status:"valid",value:i.data[l]}});else if(c==="strict")u.length>0&&(fe(i,{code:te.unrecognized_keys,keys:u}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const l of u){const f=i.data[l];s.push({key:{status:"valid",value:l},value:c._parse(new ao(i,f,i.path,l)),alwaysSet:l in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const c=[];for(const l of s){const f=await l.key;c.push({key:f,value:await l.value,alwaysSet:l.alwaysSet})}return c}).then(c=>Zn.mergeObjectSync(r,c)):Zn.mergeObjectSync(r,s)}get shape(){return this._def.shape()}strict(t){return ze.errToObj,new gt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,o,a,u;const s=(a=(o=(i=this._def).errorMap)===null||o===void 0?void 0:o.call(i,n,r).message)!==null&&a!==void 0?a:r.defaultError;return n.code==="unrecognized_keys"?{message:(u=ze.errToObj(t).message)!==null&&u!==void 0?u:s}:{message:s}}}:{}})}strip(){return new gt({...this._def,unknownKeys:"strip"})}passthrough(){return new gt({...this._def,unknownKeys:"passthrough"})}setKey(t,n){return this.augment({[t]:n})}merge(t){return new gt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>xE.mergeShapes(this._def.shape(),t._def.shape()),typeName:_e.ZodObject})}catchall(t){return new gt({...this._def,catchall:t})}pick(t){const n={};return Je.objectKeys(t).map(r=>{this.shape[r]&&(n[r]=this.shape[r])}),new gt({...this._def,shape:()=>n})}omit(t){const n={};return Je.objectKeys(this.shape).map(r=>{Je.objectKeys(t).indexOf(r)===-1&&(n[r]=this.shape[r])}),new gt({...this._def,shape:()=>n})}deepPartial(){return Mf(this)}partial(t){const n={};if(t)return Je.objectKeys(this.shape).map(r=>{Je.objectKeys(t).indexOf(r)===-1?n[r]=this.shape[r]:n[r]=this.shape[r].optional()}),new gt({...this._def,shape:()=>n});for(const r in this.shape){const i=this.shape[r];n[r]=i.optional()}return new gt({...this._def,shape:()=>n})}required(){const t={};for(const n in this.shape){let i=this.shape[n];for(;i instanceof $a;)i=i._def.innerType;t[n]=i}return new gt({...this._def,shape:()=>t})}keyof(){return X2(Je.objectKeys(this.shape))}}gt.create=(e,t)=>new gt({shape:()=>e,unknownKeys:"strip",catchall:Ou.create(),typeName:_e.ZodObject,...Ce(t)}),gt.strictCreate=(e,t)=>new gt({shape:()=>e,unknownKeys:"strict",catchall:Ou.create(),typeName:_e.ZodObject,...Ce(t)}),gt.lazycreate=(e,t)=>new gt({shape:e,unknownKeys:"strip",catchall:Ou.create(),typeName:_e.ZodObject,...Ce(t)});class yb extends Ue{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(o){for(const u of o)if(u.result.status==="valid")return u.result;for(const u of o)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;const a=o.map(u=>new Iu(u.ctx.common.issues));return fe(n,{code:te.invalid_union,unionErrors:a}),we}if(n.common.async)return Promise.all(r.map(async o=>{const a={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(i);{let o;const a=[];for(const s of r){const c={...n,common:{...n.common,issues:[]},parent:null},l=s._parseSync({data:n.data,path:n.path,parent:c});if(l.status==="valid")return l;l.status==="dirty"&&!o&&(o={result:l,ctx:c}),c.common.issues.length&&a.push(c.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const u=a.map(s=>new Iu(s));return fe(n,{code:te.invalid_union,unionErrors:u}),we}}get options(){return this._def.options}}yb.create=(e,t)=>new yb({options:e,typeName:_e.ZodUnion,...Ce(t)});class CE extends Ue{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==oe.object)return fe(n,{code:te.invalid_type,expected:oe.object,received:n.parsedType}),we;const r=this.discriminator,i=n.data[r],o=this.options.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}):(fe(n,{code:te.invalid_union_discriminator,options:this.validDiscriminatorValues,path:[r]}),we)}get discriminator(){return this._def.discriminator}get validDiscriminatorValues(){return Array.from(this.options.keys())}get options(){return this._def.options}static create(t,n,r){const i=new Map;try{n.forEach(o=>{const a=o.shape[t].value;i.set(a,o)})}catch{throw new Error("The discriminator value could not be extracted from all the provided schemas")}if(i.size!==n.length)throw new Error("Some of the discriminator values are not unique");return new CE({typeName:_e.ZodDiscriminatedUnion,discriminator:t,options:i,...Ce(r)})}}function AE(e,t){const n=dc(e),r=dc(t);if(e===t)return{valid:!0,data:e};if(n===oe.object&&r===oe.object){const i=Je.objectKeys(t),o=Je.objectKeys(e).filter(u=>i.indexOf(u)!==-1),a={...e,...t};for(const u of o){const s=AE(e[u],t[u]);if(!s.valid)return{valid:!1};a[u]=s.data}return{valid:!0,data:a}}else if(n===oe.array&&r===oe.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let o=0;o<e.length;o++){const a=e[o],u=t[o],s=AE(a,u);if(!s.valid)return{valid:!1};i.push(s.data)}return{valid:!0,data:i}}else return n===oe.date&&r===oe.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class bb extends Ue{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=(o,a)=>{if(H2(o)||H2(a))return we;const u=AE(o.value,a.value);return u.valid?((J2(o)||J2(a))&&n.dirty(),{status:n.value,value:u.data}):(fe(r,{code:te.invalid_intersection_types}),we)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,a])=>i(o,a)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}bb.create=(e,t,n)=>new bb({left:e,right:t,typeName:_e.ZodIntersection,...Ce(n)});class ba extends Ue{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==oe.array)return fe(r,{code:te.invalid_type,expected:oe.array,received:r.parsedType}),we;if(r.data.length<this._def.items.length)return fe(r,{code:te.too_small,minimum:this._def.items.length,inclusive:!0,type:"array"}),we;!this._def.rest&&r.data.length>this._def.items.length&&(fe(r,{code:te.too_big,maximum:this._def.items.length,inclusive:!0,type:"array"}),n.dirty());const o=r.data.map((a,u)=>{const s=this._def.items[u]||this._def.rest;return s?s._parse(new ao(r,a,r.path,u)):null}).filter(a=>!!a);return r.common.async?Promise.all(o).then(a=>Zn.mergeArray(n,a)):Zn.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new ba({...this._def,rest:t})}}ba.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ba({items:e,typeName:_e.ZodTuple,rest:null,...Ce(t)})};class $b extends Ue{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==oe.object)return fe(r,{code:te.invalid_type,expected:oe.object,received:r.parsedType}),we;const i=[],o=this._def.keyType,a=this._def.valueType;for(const u in r.data)i.push({key:o._parse(new ao(r,u,r.path,u)),value:a._parse(new ao(r,r.data[u],r.path,u))});return r.common.async?Zn.mergeObjectAsync(n,i):Zn.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Ue?new $b({keyType:t,valueType:n,typeName:_e.ZodRecord,...Ce(r)}):new $b({keyType:pc.create(),valueType:t,typeName:_e.ZodRecord,...Ce(n)})}}class kE extends Ue{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==oe.map)return fe(r,{code:te.invalid_type,expected:oe.map,received:r.parsedType}),we;const i=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([u,s],c)=>({key:i._parse(new ao(r,u,r.path,[c,"key"])),value:o._parse(new ao(r,s,r.path,[c,"value"]))}));if(r.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const s of a){const c=await s.key,l=await s.value;if(c.status==="aborted"||l.status==="aborted")return we;(c.status==="dirty"||l.status==="dirty")&&n.dirty(),u.set(c.value,l.value)}return{status:n.value,value:u}})}else{const u=new Map;for(const s of a){const c=s.key,l=s.value;if(c.status==="aborted"||l.status==="aborted")return we;(c.status==="dirty"||l.status==="dirty")&&n.dirty(),u.set(c.value,l.value)}return{status:n.value,value:u}}}}kE.create=(e,t,n)=>new kE({valueType:t,keyType:e,typeName:_e.ZodMap,...Ce(n)});class xf extends Ue{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==oe.set)return fe(r,{code:te.invalid_type,expected:oe.set,received:r.parsedType}),we;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(fe(r,{code:te.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(fe(r,{code:te.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,message:i.maxSize.message}),n.dirty());const o=this._def.valueType;function a(s){const c=new Set;for(const l of s){if(l.status==="aborted")return we;l.status==="dirty"&&n.dirty(),c.add(l.value)}return{status:n.value,value:c}}const u=[...r.data.values()].map((s,c)=>o._parse(new ao(r,s,r.path,c)));return r.common.async?Promise.all(u).then(s=>a(s)):a(u)}min(t,n){return new xf({...this._def,minSize:{value:t,message:ze.toString(n)}})}max(t,n){return new xf({...this._def,maxSize:{value:t,message:ze.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}xf.create=(e,t)=>new xf({valueType:e,minSize:null,maxSize:null,typeName:_e.ZodSet,...Ce(t)});class Eh extends Ue{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==oe.function)return fe(n,{code:te.invalid_type,expected:oe.function,received:n.parsedType}),we;function r(u,s){return SE({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,_E(),gb].filter(c=>!!c),issueData:{code:te.invalid_arguments,argumentsError:s}})}function i(u,s){return SE({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,_E(),gb].filter(c=>!!c),issueData:{code:te.invalid_return_type,returnTypeError:s}})}const o={errorMap:n.common.contextualErrorMap},a=n.data;return this._def.returns instanceof Rh?Xn(async(...u)=>{const s=new Iu([]),c=await this._def.args.parseAsync(u,o).catch(d=>{throw s.addIssue(r(u,d)),s}),l=await a(...c);return await this._def.returns._def.type.parseAsync(l,o).catch(d=>{throw s.addIssue(i(l,d)),s})}):Xn((...u)=>{const s=this._def.args.safeParse(u,o);if(!s.success)throw new Iu([r(u,s.error)]);const c=a(...s.data),l=this._def.returns.safeParse(c,o);if(!l.success)throw new Iu([i(c,l.error)]);return l.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Eh({...this._def,args:ba.create(t).rest(Rf.create())})}returns(t){return new Eh({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new Eh({args:t||ba.create([]).rest(Rf.create()),returns:n||Rf.create(),typeName:_e.ZodFunction,...Ce(r)})}}class WE extends Ue{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}WE.create=(e,t)=>new WE({getter:e,typeName:_e.ZodLazy,...Ce(t)});class NE extends Ue{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return fe(n,{code:te.invalid_literal,expected:this._def.value}),we}return{status:"valid",value:t.data}}get value(){return this._def.value}}NE.create=(e,t)=>new NE({value:e,typeName:_e.ZodLiteral,...Ce(t)});function X2(e,t){return new PE({values:e,typeName:_e.ZodEnum,...Ce(t)})}class PE extends Ue{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return fe(n,{expected:Je.joinValues(r),received:n.parsedType,code:te.invalid_type}),we}if(this._def.values.indexOf(t.data)===-1){const n=this._getOrReturnCtx(t),r=this._def.values;return fe(n,{received:n.data,code:te.invalid_enum_value,options:r}),we}return Xn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}}PE.create=X2;class FE extends Ue{_parse(t){const n=Je.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==oe.string&&r.parsedType!==oe.number){const i=Je.objectValues(n);return fe(r,{expected:Je.joinValues(i),received:r.parsedType,code:te.invalid_type}),we}if(n.indexOf(t.data)===-1){const i=Je.objectValues(n);return fe(r,{received:r.data,code:te.invalid_enum_value,options:i}),we}return Xn(t.data)}get enum(){return this._def.values}}FE.create=(e,t)=>new FE({values:e,typeName:_e.ZodNativeEnum,...Ce(t)});class Rh extends Ue{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==oe.promise&&n.common.async===!1)return fe(n,{code:te.invalid_type,expected:oe.promise,received:n.parsedType}),we;const r=n.parsedType===oe.promise?n.data:Promise.resolve(n.data);return Xn(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Rh.create=(e,t)=>new Rh({type:e,typeName:_e.ZodPromise,...Ce(t)});class wu extends Ue{innerType(){return this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null;if(i.type==="preprocess"){const a=i.transform(r.data);return r.common.async?Promise.resolve(a).then(u=>this._def.schema._parseAsync({data:u,path:r.path,parent:r})):this._def.schema._parseSync({data:a,path:r.path,parent:r})}const o={addIssue:a=>{fe(r,a),a.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="refinement"){const a=u=>{const s=i.refinement(u,o);if(r.common.async)return Promise.resolve(s);if(s instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(r.common.async===!1){const u=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return u.status==="aborted"?we:(u.status==="dirty"&&n.dirty(),a(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(u=>u.status==="aborted"?we:(u.status==="dirty"&&n.dirty(),a(u.value).then(()=>({status:n.value,value:u.value}))))}if(i.type==="transform")if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!TE(a))return a;const u=i.transform(a.value,o);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>TE(a)?Promise.resolve(i.transform(a.value,o)).then(u=>({status:n.value,value:u})):a);Je.assertNever(i)}}wu.create=(e,t,n)=>new wu({schema:e,typeName:_e.ZodEffects,effect:t,...Ce(n)}),wu.createWithPreprocess=(e,t,n)=>new wu({schema:t,effect:{type:"preprocess",transform:e},typeName:_e.ZodEffects,...Ce(n)});class $a extends Ue{_parse(t){return this._getType(t)===oe.undefined?Xn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}$a.create=(e,t)=>new $a({innerType:e,typeName:_e.ZodOptional,...Ce(t)});class Cf extends Ue{_parse(t){return this._getType(t)===oe.null?Xn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Cf.create=(e,t)=>new Cf({innerType:e,typeName:_e.ZodNullable,...Ce(t)});class Q2 extends Ue{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===oe.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Q2.create=(e,t)=>new $a({innerType:e,typeName:_e.ZodOptional,...Ce(t)});class DE extends Ue{_parse(t){if(this._getType(t)!==oe.nan){const r=this._getOrReturnCtx(t);return fe(r,{code:te.invalid_type,expected:oe.nan,received:r.parsedType}),we}return{status:"valid",value:t.data}}}DE.create=e=>new DE({typeName:_e.ZodNaN,...Ce(e)});class jTe extends Ue{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}gt.lazycreate;var _e;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded"})(_e||(_e={}));const LE=pc.create,eK=Ef.create;DE.create,IE.create,OE.create,wh.create,wE.create,EE.create,RE.create;const UTe=Rf.create;Ou.create,ME.create;const BTe=ya.create,jE=gt.create;gt.strictCreate,yb.create,CE.create,bb.create,ba.create,$b.create,kE.create,xf.create,Eh.create,WE.create,NE.create,PE.create,FE.create,Rh.create,wu.create,$a.create,Cf.create,wu.createWithPreprocess;async function zTe(e,t){const{okType:n,errorType:r=qTe,signal:i,headers:o,body:a,timeout:u=1e4,...s}=t,c=new Headers(o);c.has("Content-Type")||c.set("Content-Type","application/json");const l=c.get("Content-Type")==="application/json"?JSON.stringify(a):a;let f=!1;try{const d=new AbortController,p=KTe([d.signal,i].filter(ga));setTimeout(()=>{f=!0,d.abort()},u);const h=await fetch(e,{...s,body:l,headers:c,signal:p}),{status:v}=h,y=await h.json();if(h.ok){const b=n.safeParse(y);return b.success?{ok:!0,body:b.data}:{ok:!1,error:"validation",status:v,cause:b.error}}else{const b=r.safeParse(y);return b.success?{ok:!1,error:"http",status:v,body:b.data}:{ok:!1,error:"validation",status:v,cause:b.error}}}catch(d){return VTe(d)?{ok:!1,error:f?"timeout":"abort"}:{ok:!1,error:"unknown",cause:d}}}const qTe=UTe();function KTe(e){const t=new AbortController;function n(){t.abort();for(const r of e)r.removeEventListener("abort",n)}for(const r of e){if(r.aborted){n();break}r.addEventListener("abort",n)}return t.signal}function VTe(e){return e instanceof DOMException&&e.name==="AbortError"}function HTe(e,t){JTe(e,t);const n=Eu.get(e,t);if(!n){const i=e(...t);throw Eu.set(e,t,{state:"fetching",promise:i}),tK(e,t,i).catch(o=>console.error(o)),i}if(n.state==="fetching")throw n.promise;const{result:r}=n;if(r.ok)return r.body;throw r}function JTe(e,t){const n=kTe();ue.useEffect(()=>{const r=Eu.getFetcherConfig(e).revalidationStrategy;if((r==null?void 0:r.type)==="never"||!(r!=null&&r.onFocus))return;function i(){if(document.visibilityState==="hidden")return;const o=Eu.get(e,t);if(!o||o.state!=="fetched")return;const a=e(...t);Eu.set(e,t,{state:"revalidating",promise:a,result:o.result}),tK(e,t,a).then(n).catch(u=>console.error(u))}return document.addEventListener("visibilitychange",i),()=>document.removeEventListener("visibilitychange",i)})}function tK(e,t,n){return n.then(r=>Eu.set(e,t,{state:"fetched",result:r})).catch(r=>Eu.set(e,t,{state:"fetched",result:{ok:!1,error:"unknown",cause:r}}))}const Eu=YTe(),GTe=Eu;function YTe(){const e=new Map,t=new Map,n={cacheCapacity:100,revalidationStrategy:{type:"swr",onFocus:!0}};function r(o){return o.join(`
32
- `)}function i(o){var a;return(a=e.get(o))!=null?a:n}return{get(o,a){const u=r(a),s=t.get(o);if(!s||!s.has(u))return;const c=s.get(u);return s.delete(u),c!==void 0&&s.set(u,c),c},set(o,a,u){let s=t.get(o);s||(s=new Map,t.set(o,s));const c=i(o),l=r(a);s.size===c.cacheCapacity&&!s.has(l)&&s.delete(s.keys().next().value),s.set(l,u)},getFetcherConfig:i,registerFetcherConfig(o,a){e.set(o,a)}}}const ZTe=jE({id:LE(),width:eK(),height:eK(),urls:jE({full:LE(),small:LE()})}),XTe=jE({results:BTe(ZTe)}).transform(e=>e.results);function nK(e,t){const n=new URLSearchParams({page:"1",per_page:"30",query:t});return zTe(`${e}/search/photos?${n.toString()}`,{okType:XTe})}GTe.registerFetcherConfig(nK,{cacheCapacity:5,revalidationStrategy:{type:"never"}});function QTe(e,t){return HTe(nK,[e,t])}const rK=e=>{const{trigger:t,onMediaSelected:n}=e,[r,i]=ue.useState(!1),[o,a]=ue.useState(""),[u,s]=ue.useState(o),[c,l]=ue.useTransition();return WTe(o,200,f=>l(()=>s(f))),He(P.Dialog,{open:r,onOpenChange:i,children:[N(P.DialogTrigger,{children:t}),He(P.DialogContainer,{children:[He(P.DialogHeader,{children:[N(P.DialogHeaderIcon,{name:"folder"}),N(P.DialogHeaderTitle,{children:"Add an image from Unsplash.com"})]}),He(P.DialogContent,{style:{gap:P.tokens.space[6]},children:[N("div",{style:{paddingInline:P.tokens.space[8]},children:N(P.SearchInput,{value:o,placeholder:"Search on Unsplash.com",onValueChange:a})}),N(nIe,{children:N(P.ErrorBoundary,{errorImageSrc:P.dialogErrorImage,title:"Request failed",description:"An error occurred while searching for your image.",style:{marginBlock:"auto"},children:N(ue.Suspense,{fallback:N(P.MasonrySkeleton,{}),children:N(eIe,{term:u,isUpdating:c,onMediaSelected:f=>{i(!1),n==null||n(f)}})})})})]})]})]})},eIe=e=>{const{term:t,isUpdating:n,onMediaSelected:r}=e,i=QTe("https://unsplash.wroom.io",t||"fruit"),o=tIe(n);return i.length?N(P.Masonry,{items:i,getItemInfo:rIe,style:o,children:a=>N(P.MasonryMedia,{url:a.urls.small,onClick:()=>r({id:a.id,url:a.urls.full,width:a.width,height:a.height})})}):He(P.BlankSlate,{style:{marginBlock:"auto",...o},children:[N(P.BlankSlateImage,{children:N("img",{src:P.dialogErrorImage,alt:"No results"})}),N(P.BlankSlateTitle,{size:"big",children:"Oh no ..."}),N(P.BlankSlateDescription,{children:"The search returned no result."})]})};function tIe(e){return{opacity:e?.4:1,transitionProperty:e?"opacity":"none",transitionDuration:P.tokens.transitionDuration.standard,transitionTimingFunction:P.tokens.transitionTimingFunction.easeInOut}}const nIe=({children:e})=>N(P.ScrollArea,{style:{blockSize:"100%",paddingInline:P.tokens.space[8],paddingBlockStart:P.tokens.space[2]},children:e});function rIe(e){return{key:e.id,aspectRatio:e.width/e.height}}const iIe=({content:e,field:t,id:n,onContentChange:r,readOnly:i})=>{const[o,a]=ue.useState(0),s=oIe(t)[o],c=e?wTe(t,e):void 0,l=c==null?void 0:c[o],f=fc(t),d=s?ITe(s,e,l).filter(ga):[],p=e&&!i?"visible":"hidden";function h(v){!s||r(RTe(s.name,t,e,v))}return He(P.Card,{color:"grey2",variant:"dashed",children:[He(P.CardHeader,{children:[He(P.CardHeaderTitle,{children:[f,d.length>0?N(P.Text,{color:"grey11",component:"span",children:` \u2022 ${d.join(" \u2022 ")}`}):null]}),He(P.CardHeaderActions,{style:{visibility:p},children:[N(rK,{trigger:N(P.Button,{startIcon:N(P.Icon,{name:"imageSearch"}),children:"Replace"}),onMediaSelected:h}),N(P.Button,{onClick:()=>{a(0),r(void 0)},startIcon:N(P.Icon,{name:"delete"}),children:"Clear"})]})]}),s&&e&&c?N(aIe,{allContentViews:c,content:e,contentView:l,id:n,onContentChange:r,onPageChange:a,page:o,readOnly:i,thumbnailName:s.name}):N(uIe,{onMediaSelected:h,readOnly:i})]})};function oIe(e){return ue.useMemo(()=>OTe(e),[e])}const aIe=({allContentViews:e,content:t,contentView:n,id:r,onContentChange:i,onPageChange:o,page:a,readOnly:u,thumbnailName:s})=>{var c;return He(P.CardContent,{children:[N(P.Carousel,{getItemSource:l=>{var f;return(f=l==null?void 0:l.url)!=null?f:""},items:e,onPageChange:o,page:a,style:{blockSize:400},children:(l,f)=>{var d,p;return l?N(P.CarouselItem,{src:l.url,alt:(d=l.alt)!=null?d:void 0},`${f}_${(p=l.url)!=null?p:""}`):null}}),He(P.Field,{labelPosition:"side",children:[N(P.FieldLabel,{htmlFor:r,children:"Alt text"}),N(P.FieldControl,{children:N(P.TextInput,{id:r,onValueChange:l=>{n&&i(ETe(s,t,n,l))},placeholder:"Short description for the visually impaired",readOnly:u||!n,value:(c=n==null?void 0:n.alt)!=null?c:""})})]})]})},uIe=({onMediaSelected:e,readOnly:t})=>N(P.CardContent,{children:N(P.Card,{color:"grey3",variant:"outlined",children:N(P.CardContent,{style:{paddingBlock:parseFloat(P.tokens.space[10])},children:He(P.BlankSlate,{children:[N(P.BlankSlateIcon,{name:"cloudUpload"}),N(P.BlankSlateTitle,{children:"You haven't selected an image"}),t?null:N(P.BlankSlateActions,{children:N(rK,{trigger:N(P.Button,{children:"Select image"}),onMediaSelected:e})})]})})})}),sIe=({content:e,field:t,id:n,onContentChange:r,readOnly:i})=>{var o;return He(P.Field,{children:[N(P.FieldIcon,{children:N(P.Icon,{name:"notes"})}),N(P.FieldLabel,{htmlFor:n,children:fc(t)}),N(P.FieldControl,{children:N(P.TextArea,{id:n,onChange:a=>{r(cIe(a.target.value))},placeholder:pb(t),readOnly:i,value:(o=e==null?void 0:e.value)!=null?o:""})})]})};function cIe(e){return e.length===0?void 0:{__TYPE__:"FieldContent",type:"Text",value:e}}const lIe=({content:e,field:t,id:n,onContentChange:r,readOnly:i})=>{var u,s;const o=Number(e==null?void 0:e.value),a=Number.isFinite(o)?o:void 0;return He(P.Field,{children:[N(P.FieldIcon,{children:N(P.Icon,{name:"pin"})}),N(P.FieldLabel,{htmlFor:n,children:fc(t)}),N(P.FieldControl,{children:N(P.NumberInput,{id:n,value:a,min:(u=t.config)==null?void 0:u.min,max:(s=t.config)==null?void 0:s.max,placeholder:pb(t),readOnly:i,onValueChange:c=>r(fIe(c))})})]})};function fIe(e){return e===void 0?void 0:{__TYPE__:"FieldContent",type:"Number",value:String(e)}}function cn(e){this.content=e}cn.prototype={constructor:cn,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),o=r.content.slice();return i==-1?o.push(n||e,t):(o[i+1]=t,n&&(o[i]=n)),new cn(o)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new cn(n)},addToStart:function(e,t){return new cn([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new cn(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),o=r.find(e);return i.splice(o==-1?i.length:o,0,t,n),new cn(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=cn.from(e),e.size?new cn(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=cn.from(e),e.size?new cn(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=cn.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},get size(){return this.content.length>>1}},cn.from=function(e){if(e instanceof cn)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new cn(t)};function iK(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),o=t.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let a=0;i.text[a]==o.text[a];a++)n++;return n}if(i.content.size||o.content.size){let a=iK(i.content,o.content,n+1);if(a!=null)return a}n+=i.nodeSize}}function oK(e,t,n,r){for(let i=e.childCount,o=t.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let a=e.child(--i),u=t.child(--o),s=a.nodeSize;if(a==u){n-=s,r-=s;continue}if(!a.sameMarkup(u))return{a:n,b:r};if(a.isText&&a.text!=u.text){let c=0,l=Math.min(a.text.length,u.text.length);for(;c<l&&a.text[a.text.length-c-1]==u.text[u.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(a.content.size||u.content.size){let c=oK(a.content,u.content,n-1,r-1);if(c)return c}n-=s,r-=s}}class V{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let r=0;r<t.length;r++)this.size+=t[r].nodeSize}nodesBetween(t,n,r,i=0,o){for(let a=0,u=0;u<n;a++){let s=this.content[a],c=u+s.nodeSize;if(c>t&&r(s,i+u,o||null,a)!==!1&&s.content.size){let l=u+1;s.nodesBetween(Math.max(0,t-l),Math.min(s.content.size,n-l),r,i+l)}u=c}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,r,i){let o="",a=!0;return this.nodesBetween(t,n,(u,s)=>{u.isText?(o+=u.text.slice(Math.max(t,s)-s,n-s),a=!r):u.isLeaf?(i?o+=typeof i=="function"?i(u):i:u.type.spec.leafText&&(o+=u.type.spec.leafText(u)),a=!r):!a&&u.isBlock&&(o+=r,a=!0)},0),o}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o<t.content.length;o++)i.push(t.content[o]);return new V(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let o=0,a=0;a<n;o++){let u=this.content[o],s=a+u.nodeSize;s>t&&((a<t||s>n)&&(u.isText?u=u.cut(Math.max(0,t-a),Math.min(u.text.length,n-a)):u=u.cut(Math.max(0,t-a-1),Math.min(u.content.size,n-a-1))),r.push(u),i+=u.nodeSize),a=s}return new V(r,i)}cutByIndex(t,n){return t==n?V.empty:t==0&&n==this.content.length?this:new V(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 V(i,o)}addToStart(t){return new V([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new V(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(t.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let n=this.content[t];if(!n)throw new RangeError("Index "+t+" out of range for "+this);return n}maybeChild(t){return this.content[t]||null}forEach(t){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];t(i,r,n),r+=i.nodeSize}}findDiffStart(t,n=0){return iK(this,t,n)}findDiffEnd(t,n=this.size,r=t.size){return oK(this,t,n,r)}findIndex(t,n=-1){if(t==0)return _b(0,t);if(t==this.size)return _b(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),a=i+o.nodeSize;if(a>=t)return a==t||n>0?_b(r+1,a):_b(r,i);i=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return V.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new V(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return V.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 V(n||t,r)}static from(t){if(!t)return V.empty;if(t instanceof V)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new V([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}V.empty=new V([],0);const UE={index:0,offset:0};function _b(e,t){return UE.index=e,UE.offset=t,UE}function Sb(e,t){if(e===t)return!0;if(!(e&&typeof e=="object")||!(t&&typeof t=="object"))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!Sb(e[r],t[r]))return!1}else{for(let r in e)if(!(r in t)||!Sb(e[r],t[r]))return!1;for(let r in t)if(!(r in e))return!1}return!0}class Ge{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&&Sb(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=t.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);return r.create(n.attrs)}static sameSet(t,n){if(t==n)return!0;if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].eq(n[r]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return Ge.none;if(t instanceof Ge)return[t];let n=t.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}}Ge.none=[];class Af extends Error{}class Z{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=uK(this.content,t+this.openStart,n);return r&&new Z(r,this.openStart,this.openEnd)}removeBetween(t,n){return new Z(aK(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 Z.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Z(V.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let o=t.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=t.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new Z(t,r,i)}}Z.empty=new Z(V.empty,0,0);function aK(e,t,n){let{index:r,offset:i}=e.findIndex(t),o=e.maybeChild(r),{index:a,offset:u}=e.findIndex(n);if(i==t||o.isText){if(u!=n&&!e.child(a).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=a)throw new RangeError("Removing non-flat range");return e.replaceChild(r,o.copy(aK(o.content,t-i-1,n-i-1)))}function uK(e,t,n,r){let{index:i,offset:o}=e.findIndex(t),a=e.maybeChild(i);if(o==t||a.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let u=uK(a.content,t-o-1,n);return u&&e.replaceChild(i,a.copy(u))}function dIe(e,t,n){if(n.openStart>e.depth)throw new Af("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Af("Inconsistent open depths");return sK(e,t,n,0)}function sK(e,t,n,r){let i=e.index(r),o=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let a=sK(e,t,n,r+1);return o.copy(o.content.replaceChild(i,a))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let a=e.parent,u=a.content;return mc(a,u.cut(0,e.parentOffset).append(n.content).append(u.cut(t.parentOffset)))}else{let{start:a,end:u}=pIe(n,e);return mc(o,lK(e,a,u,t,r))}else return mc(o,Tb(e,t,r))}function cK(e,t){if(!t.type.compatibleContent(e.type))throw new Af("Cannot join "+t.type.name+" onto "+e.type.name)}function BE(e,t,n){let r=e.node(n);return cK(r,t.node(n)),r}function hc(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Mh(e,t,n,r){let i=(t||e).node(n),o=0,a=t?t.index(n):i.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(hc(e.nodeAfter,r),o++));for(let u=o;u<a;u++)hc(i.child(u),r);t&&t.depth==n&&t.textOffset&&hc(t.nodeBefore,r)}function mc(e,t){if(!e.type.validContent(t))throw new Af("Invalid content for node "+e.type.name);return e.copy(t)}function lK(e,t,n,r,i){let o=e.depth>i&&BE(e,t,i+1),a=r.depth>i&&BE(n,r,i+1),u=[];return Mh(null,e,i,u),o&&a&&t.index(i)==n.index(i)?(cK(o,a),hc(mc(o,lK(e,t,n,r,i+1)),u)):(o&&hc(mc(o,Tb(e,t,i+1)),u),Mh(t,n,i,u),a&&hc(mc(a,Tb(n,r,i+1)),u)),Mh(r,null,i,u),new V(u)}function Tb(e,t,n){let r=[];if(Mh(null,e,n,r),e.depth>n){let i=BE(e,t,n+1);hc(mc(i,Tb(e,t,n+1)),r)}return Mh(t,null,n,r),new V(r)}function pIe(e,t){let n=t.depth-e.openStart,i=t.node(n).copy(e.content);for(let o=n-1;o>=0;o--)i=t.node(o).copy(V.from(i));return{start:i.resolveNoCache(e.openStart+n),end:i.resolveNoCache(i.content.size-e.openEnd-n)}}class xh{constructor(t,n,r){this.pos=t,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=t.child(n);return r?t.child(n).cut(r):i}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o<t;o++)i+=r.child(o).nodeSize;return i}marks(){let t=this.parent,n=this.index();if(t.content.size==0)return Ge.none;if(this.textOffset)return t.child(n).marks;let r=t.maybeChild(n-1),i=t.maybeChild(n);if(!r){let u=r;r=i,i=u}let o=r.marks;for(var a=0;a<o.length;a++)o[a].type.spec.inclusive===!1&&(!i||!o[a].isInSet(i.marks))&&(o=o[a--].removeFromSet(o));return o}marksAcross(t){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=t.parent.maybeChild(t.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(t){for(let n=this.depth;n>0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos<this.pos)return t.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);r>=0;r--)if(t.pos<=this.end(r)&&(!n||n(this.node(r))))return new Ib(this,t,r);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let n=1;n<=this.depth;n++)t+=(t?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return t+":"+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let a=t;;){let{index:u,offset:s}=a.content.findIndex(o),c=o-s;if(r.push(a,u,i+s),!c||(a=a.child(u),a.isText))break;o=c-1,i+=s+1}return new xh(n,r,o)}static resolveCached(t,n){for(let i=0;i<zE.length;i++){let o=zE[i];if(o.pos==n&&o.doc==t)return o}let r=zE[qE]=xh.resolve(t,n);return qE=(qE+1)%hIe,r}}let zE=[],qE=0,hIe=12;class Ib{constructor(t,n,r){this.$from=t,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const mIe=Object.create(null);class uo{constructor(t,n,r,i=Ge.none){this.type=t,this.attrs=n,this.marks=i,this.content=r||V.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&&Sb(this.attrs,n||t.defaultAttrs||mIe)&&Ge.sameSet(this.marks,r||Ge.none)}copy(t=null){return t==this.content?this:new uo(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new uo(this.type,this.attrs,this.content,t)}cut(t,n=this.content.size){return t==0&&n==this.content.size?this:this.copy(this.content.cut(t,n))}slice(t,n=this.content.size,r=!1){if(t==n)return Z.empty;let i=this.resolve(t),o=this.resolve(n),a=r?0:i.sharedDepth(n),u=i.start(a),c=i.node(a).content.cut(i.pos-u,o.pos-u);return new Z(c,i.depth-a,o.depth-a)}replace(t,n,r){return dIe(this.resolve(t),this.resolve(n),r)}nodeAt(t){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(t);if(n=n.maybeChild(r),!n)return null;if(i==t||n.isText)return n;t-=i+1}}childAfter(t){let{index:n,offset:r}=this.content.findIndex(t);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(t){if(t==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(t);if(r<t)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(t){return xh.resolveCached(this,t)}resolveNoCache(t){return xh.resolve(this,t)}rangeHasMark(t,n,r){let i=!1;return n>t&&this.nodesBetween(t,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),fK(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,r=V.empty,i=0,o=r.childCount){let a=this.contentMatchAt(t).matchFragment(r,i,o),u=a&&a.matchFragment(this.content,n);if(!u||!u.validEnd)return!1;for(let s=i;s<o;s++)if(!this.type.allowsMarks(r.child(s).marks))return!1;return!0}canReplaceWith(t,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(t).matchType(r),a=o&&o.matchFragment(this.content,n);return a?a.validEnd:!1}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){if(!this.type.validContent(this.content))throw new RangeError(`Invalid content for node ${this.type.name}: ${this.content.toString().slice(0,50)}`);let t=Ge.none;for(let n=0;n<this.marks.length;n++)t=this.marks[n].addToSet(t);if(!Ge.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r=null;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,r)}let i=V.fromJSON(t,n.content);return t.nodeType(n.type).create(n.attrs,i,r)}}uo.prototype.text=void 0;class Ob extends uo{constructor(t,n,r,i){if(super(t,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):fK(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new Ob(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new Ob(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function fK(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class vc{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new vIe(t,n);if(r.next==null)return vc.empty;let i=dK(r);r.next&&r.err("Unexpected trailing text");let o=TIe(SIe(i));return IIe(o,r),o}matchType(t){for(let n=0;n<this.next.length;n++)if(this.next[n].type==t)return this.next[n].next;return null}matchFragment(t,n=0,r=t.childCount){let i=this;for(let o=n;i&&o<r;o++)i=i.matchType(t.child(o).type);return i}get inlineContent(){return this.next.length&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:n}=this.next[t];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(t){for(let n=0;n<this.next.length;n++)for(let r=0;r<t.next.length;r++)if(this.next[n].type==t.next[r].type)return!0;return!1}fillBefore(t,n=!1,r=0){let i=[this];function o(a,u){let s=a.matchFragment(t,r);if(s&&(!n||s.validEnd))return V.from(u.map(c=>c.createAndFill()));for(let c=0;c<a.next.length;c++){let{type:l,next:f}=a.next[c];if(!(l.isText||l.hasRequiredAttrs())&&i.indexOf(f)==-1){i.push(f);let d=o(f,u.concat(l));if(d)return d}}return null}return o(this,[])}findWrapping(t){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==t)return this.wrapCache[r+1];let n=this.computeWrapping(t);return this.wrapCache.push(t,n),n}computeWrapping(t){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(t)){let a=[];for(let u=i;u.type;u=u.via)a.push(u.type);return a.reverse()}for(let a=0;a<o.next.length;a++){let{type:u,next:s}=o.next[a];!u.isLeaf&&!u.hasRequiredAttrs()&&!(u.name in n)&&(!i.type||s.validEnd)&&(r.push({match:u.contentMatch,type:u,via:i}),n[u.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(r){t.push(r);for(let i=0;i<r.next.length;i++)t.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),t.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let a=0;a<r.next.length;a++)o+=(a?", ":"")+r.next[a].type.name+"->"+t.indexOf(r.next[a].next);return o}).join(`
33
- `)}}vc.empty=new vc(!0);class vIe{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function dK(e){let t=[];do t.push(gIe(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function gIe(e){let t=[];do t.push(yIe(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function yIe(e){let t=_Ie(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=bIe(e,t);else break;return t}function pK(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function bIe(e,t){let n=pK(e),r=n;return e.eat(",")&&(e.next!="}"?r=pK(e):r=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function $Ie(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let o in n){let a=n[o];a.groups.indexOf(t)>-1&&i.push(a)}return i.length==0&&e.err("No node type or group '"+t+"' found"),i}function _Ie(e){if(e.eat("(")){let t=dK(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=$Ie(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function SIe(e){let t=[[]];return i(o(e,0),n()),t;function n(){return t.push([])-1}function r(a,u,s){let c={term:s,to:u};return t[a].push(c),c}function i(a,u){a.forEach(s=>s.to=u)}function o(a,u){if(a.type=="choice")return a.exprs.reduce((s,c)=>s.concat(o(c,u)),[]);if(a.type=="seq")for(let s=0;;s++){let c=o(a.exprs[s],u);if(s==a.exprs.length-1)return c;i(c,u=n())}else if(a.type=="star"){let s=n();return r(u,s),i(o(a.expr,s),s),[r(s)]}else if(a.type=="plus"){let s=n();return i(o(a.expr,u),s),i(o(a.expr,s),s),[r(s)]}else{if(a.type=="opt")return[r(u)].concat(o(a.expr,u));if(a.type=="range"){let s=u;for(let c=0;c<a.min;c++){let l=n();i(o(a.expr,s),l),s=l}if(a.max==-1)i(o(a.expr,s),s);else for(let c=a.min;c<a.max;c++){let l=n();r(s,l),i(o(a.expr,s),l),s=l}return[r(s)]}else{if(a.type=="name")return[r(u,void 0,a.value)];throw new Error("Unknown expr type")}}}}function hK(e,t){return t-e}function mK(e,t){let n=[];return r(t),n.sort(hK);function r(i){let o=e[i];if(o.length==1&&!o[0].term)return r(o[0].to);n.push(i);for(let a=0;a<o.length;a++){let{term:u,to:s}=o[a];!u&&n.indexOf(s)==-1&&r(s)}}}function TIe(e){let t=Object.create(null);return n(mK(e,0));function n(r){let i=[];r.forEach(a=>{e[a].forEach(({term:u,to:s})=>{if(!u)return;let c;for(let l=0;l<i.length;l++)i[l][0]==u&&(c=i[l][1]);mK(e,s).forEach(l=>{c||i.push([u,c=[]]),c.indexOf(l)==-1&&c.push(l)})})});let o=t[r.join(",")]=new vc(r.indexOf(e.length-1)>-1);for(let a=0;a<i.length;a++){let u=i[a][1].sort(hK);o.next.push({type:i[a][0],next:t[u.join(",")]||n(u)})}return o}}function IIe(e,t){for(let n=0,r=[e];n<r.length;n++){let i=r[n],o=!i.validEnd,a=[];for(let u=0;u<i.next.length;u++){let{type:s,next:c}=i.next[u];a.push(s.name),o&&!(s.isText||s.hasRequiredAttrs())&&(o=!1),r.indexOf(c)==-1&&r.push(c)}o&&t.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function vK(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function gK(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let o=e[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function yK(e){let t=Object.create(null);if(e)for(let n in e)t[n]=new OIe(e[n]);return t}class wb{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=yK(r.attrs),this.defaultAttrs=vK(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||t=="text"),this.isText=t=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==vc.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:gK(this.attrs,t)}create(t=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new uo(this,this.computeAttrs(t),V.from(n),Ge.setFrom(r))}createChecked(t=null,n,r){if(n=V.from(n),!this.validContent(n))throw new RangeError("Invalid content for node "+this.name);return new uo(this,this.computeAttrs(t),n,Ge.setFrom(r))}createAndFill(t=null,n,r){if(t=this.computeAttrs(t),n=V.from(n),n.size){let a=this.contentMatch.fillBefore(n);if(!a)return null;n=a.append(n)}let i=this.contentMatch.matchFragment(n),o=i&&i.fillBefore(V.empty,!0);return o?new uo(this,t,n.append(o),Ge.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}allowsMarkType(t){return this.markSet==null||this.markSet.indexOf(t)>-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;n<t.length;n++)if(!this.allowsMarkType(t[n].type))return!1;return!0}allowedMarks(t){if(this.markSet==null)return t;let n;for(let r=0;r<t.length;r++)this.allowsMarkType(t[r].type)?n&&n.push(t[r]):n||(n=t.slice(0,r));return n?n.length?n:Ge.none:t}static compile(t,n){let r=Object.create(null);t.forEach((o,a)=>r[o]=new wb(o,n,a));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}}class OIe{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class Eb{constructor(t,n,r,i){this.name=t,this.rank=n,this.schema=r,this.spec=i,this.attrs=yK(i.attrs),this.excluded=null;let o=vK(this.attrs);this.instance=o?new Ge(this,o):null}create(t=null){return!t&&this.instance?this.instance:new Ge(this,gK(this.attrs,t))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((o,a)=>r[o]=new Eb(o,i++,n,a)),r}removeFromSet(t){for(var n=0;n<t.length;n++)t[n].type==this&&(t=t.slice(0,n).concat(t.slice(n+1)),n--);return t}isInSet(t){for(let n=0;n<t.length;n++)if(t[n].type==this)return t[n]}excludes(t){return this.excluded.indexOf(t)>-1}}class wIe{constructor(t){this.cached=Object.create(null),this.spec={nodes:cn.from(t.nodes),marks:cn.from(t.marks||{}),topNode:t.topNode},this.nodes=wb.compile(this.spec.nodes,this),this.marks=Eb.compile(this.spec.marks,this);let n=Object.create(null);for(let r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");let i=this.nodes[r],o=i.spec.content||"",a=i.spec.marks;i.contentMatch=n[o]||(n[o]=vc.parse(o,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.markSet=a=="_"?null:a?bK(this,a.split(" ")):a==""||!i.inlineContent?[]:null}for(let r in this.marks){let i=this.marks[r],o=i.spec.excludes;i.excluded=o==null?[i]:o==""?[]:bK(this,o.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,r,i){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof wb){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(n,r,i)}text(t,n){let r=this.nodes.text;return new Ob(r,r.defaultAttrs,t,Ge.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeFromJSON(t){return uo.fromJSON(this,t)}markFromJSON(t){return Ge.fromJSON(this,t)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}}function bK(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],o=e.marks[i],a=o;if(o)n.push(o);else for(let u in e.marks){let s=e.marks[u];(i=="_"||s.spec.group&&s.spec.group.split(" ").indexOf(i)>-1)&&n.push(a=s)}if(!a)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class kf{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[],n.forEach(r=>{r.tag?this.tags.push(r):r.style&&this.styles.push(r)}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let i=t.nodes[r.node];return i.contentMatch.matchType(i)})}parse(t,n={}){let r=new TK(this,n,!1);return r.addAll(t,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new TK(this,n,!0);return r.addAll(t,n.from,n.to),Z.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(MIe(t,o.tag)&&(o.namespace===void 0||t.namespaceURI==o.namespace)&&(!o.context||n.matchesContext(o.context))){if(o.getAttrs){let a=o.getAttrs(t);if(a===!1)continue;o.attrs=a||void 0}return o}}}matchStyle(t,n,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let a=this.styles[o],u=a.style;if(!(u.indexOf(t)!=0||a.context&&!r.matchesContext(a.context)||u.length>t.length&&(u.charCodeAt(t.length)!=61||u.slice(t.length+1)!=n))){if(a.getAttrs){let s=a.getAttrs(n);if(s===!1)continue;a.attrs=s||void 0}return a}}}static schemaRules(t){let n=[];function r(i){let o=i.priority==null?50:i.priority,a=0;for(;a<n.length;a++){let u=n[a];if((u.priority==null?50:u.priority)<o)break}n.splice(a,0,i)}for(let i in t.marks){let o=t.marks[i].spec.parseDOM;o&&o.forEach(a=>{r(a=IK(a)),a.mark=i})}for(let i in t.nodes){let o=t.nodes[i].spec.parseDOM;o&&o.forEach(a=>{r(a=IK(a)),a.node=i})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new kf(t,kf.schemaRules(t)))}}const $K={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},EIe={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},_K={ol:!0,ul:!0},Rb=1,Mb=2,Ch=4;function SK(e,t,n){return t!=null?(t?Rb:0)|(t==="full"?Mb:0):e&&e.whitespace=="pre"?Rb|Mb:n&~Ch}class xb{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=Ge.none,this.stashMarks=[],this.match=a||(u&Ch?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(V.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(t.type))?(this.match=r,i):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&Rb)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=V.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(V.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}popFromStashMark(t){for(let n=this.stashMarks.length-1;n>=0;n--)if(t.eq(this.stashMarks[n]))return this.stashMarks.splice(n,1)[0]}applyPending(t){for(let n=0,r=this.pendingMarks;n<r.length;n++){let i=r[n];(this.type?this.type.allowsMarkType(i.type):CIe(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&&!$K.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class TK{constructor(t,n,r){this.parser=t,this.options=n,this.isOpen=r,this.open=0;let i=n.topNode,o,a=SK(null,n.preserveWhitespace,0)|(r?Ch:0);i?o=new xb(i.type,i.attrs,Ge.none,Ge.none,!0,n.topMatch||i.type.contentMatch,a):r?o=new xb(null,null,Ge.none,Ge.none,!0,null,a):o=new xb(t.schema.topNodeType,null,Ge.none,Ge.none,!0,null,a),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t){if(t.nodeType==3)this.addTextNode(t);else if(t.nodeType==1){let n=t.getAttribute("style"),r=n?this.readStyles(xIe(n)):null,i=this.top;if(r!=null)for(let o=0;o<r.length;o++)this.addPendingMark(r[o]);if(this.addElement(t),r!=null)for(let o=0;o<r.length;o++)this.removePendingMark(r[o],i)}}addTextNode(t){let n=t.nodeValue,r=this.top;if(r.options&Mb||r.inlineContext(t)||/[^ \t\r\n\u000c]/.test(n)){if(r.options&Rb)r.options&Mb?n=n.replace(/\r\n?/g,`
34
- `):n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let i=r.content[r.content.length-1],o=t.previousSibling;(!i||o&&o.nodeName=="BR"||i.isText&&/[ \t\r\n\u000c]$/.test(i.text))&&(n=n.slice(1))}n&&this.insertNode(this.parser.schema.text(n)),this.findInText(t)}else this.findInside(t)}addElement(t,n){let r=t.nodeName.toLowerCase(),i;_K.hasOwnProperty(r)&&this.parser.normalizeLists&&RIe(t);let o=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(i=this.parser.matchTag(t,this,n));if(o?o.ignore:EIe.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($K.hasOwnProperty(r))a=!0,u.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t);return}this.addAll(t),a&&this.sync(u),this.needsBlock=s}else this.addElementByRule(t,o,o.consuming===!1?i:void 0)}leafFallback(t){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(`
35
- `))}ignoreFallback(t){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(t){let n=Ge.none;e:for(let r=0;r<t.length;r+=2)for(let i=void 0;;){let o=this.parser.matchStyle(t[r],t[r+1],this,i);if(!o)continue e;if(o.ignore)return null;if(n=this.parser.schema.marks[o.mark].create(o.attrs).addToSet(n),o.consuming===!1)i=o;else break}return n}addElementByRule(t,n,r){let i,o,a;n.node?(o=this.parser.schema.nodes[n.node],o.isLeaf?this.insertNode(o.create(n.attrs))||this.leafFallback(t):i=this.enter(o,n.attrs||null,n.preserveWhitespace)):(a=this.parser.schema.marks[n.mark].create(n.attrs),this.addPendingMark(a));let u=this.top;if(o&&o.isLeaf)this.findInside(t);else if(r)this.addElement(t,r);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(s=>this.insertNode(s));else{let s=t;typeof n.contentElement=="string"?s=t.querySelector(n.contentElement):typeof n.contentElement=="function"?s=n.contentElement(t):n.contentElement&&(s=n.contentElement),this.findAround(t,s,!0),this.addAll(s)}i&&this.sync(u)&&this.open--,a&&this.removePendingMark(a,u)}addAll(t,n,r){let i=n||0;for(let o=n?t.childNodes[n]:t.firstChild,a=r==null?null:t.childNodes[r];o!=a;o=o.nextSibling,++i)this.findAtPoint(t,i),this.addDOM(o);this.findAtPoint(t,i)}findPlace(t){let n,r;for(let i=this.open;i>=0;i--){let o=this.nodes[i],a=o.findWrapping(t);if(a&&(!n||n.length>a.length)&&(n=a,r=o,!a.length)||o.solid)break}if(!n)return!1;this.sync(r);for(let i=0;i<n.length;i++)this.enterInner(n[i],null,!1);return!0}insertNode(t){if(t.isInline&&this.needsBlock&&!this.top.type){let n=this.textblockFromContext();n&&this.enterInner(n)}if(this.findPlace(t)){this.closeExtra();let n=this.top;n.applyPending(t.type),n.match&&(n.match=n.match.matchType(t.type));let r=n.activeMarks;for(let i=0;i<t.marks.length;i++)(!n.type||n.type.allowsMarkType(t.marks[i].type))&&(r=t.marks[i].addToSet(r));return n.content.push(t.mark(r)),!0}return!1}enter(t,n,r){let i=this.findPlace(t.create(n));return i&&this.enterInner(t,n,!0,r),i}enterInner(t,n=null,r=!1,i){this.closeExtra();let o=this.top;o.applyPending(t),o.match=o.match&&o.match.matchType(t);let a=SK(t,i,o.options);o.options&Ch&&o.content.length==0&&(a|=Ch),this.nodes.push(new xb(t,n,o.activeMarks,o.pendingMarks,r,null,a)),this.open++}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(t){for(let n=this.open;n>=0;n--)if(this.nodes[n]==t)return this.open=n,!0;return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)t+=r[i].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==t&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&t.nodeType==1&&t.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(t,n,r){if(t!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&t.nodeType==1&&t.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&(this.find[n].pos=this.currentPos-(t.nodeValue.length-this.find[n].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),a=(u,s)=>{for(;u>=0;u--){let c=n[u];if(c==""){if(u==n.length-1||u==0)continue;for(;s>=o;s--)if(a(u-1,s))return!0;return!1}else{let l=s>0||s==0&&i?this.nodes[s].type:r&&s>=o?r.node(s-o).type:null;if(!l||l.name!=c&&l.groups.indexOf(c)==-1)return!1;s--}}return!0};return a(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(t){let n=AIe(t,this.top.pendingMarks);n&&this.top.stashMarks.push(n),this.top.pendingMarks=t.addToSet(this.top.pendingMarks)}removePendingMark(t,n){for(let r=this.open;r>=0;r--){let i=this.nodes[r];if(i.pendingMarks.lastIndexOf(t)>-1)i.pendingMarks=t.removeFromSet(i.pendingMarks);else{i.activeMarks=t.removeFromSet(i.activeMarks);let a=i.popFromStashMark(t);a&&i.type&&i.type.allowsMarkType(a.type)&&(i.activeMarks=a.addToSet(i.activeMarks))}if(i==n)break}}}function RIe(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let r=t.nodeType==1?t.nodeName.toLowerCase():null;r&&_K.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):r=="li"?n=t:r&&(n=null)}}function MIe(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function xIe(e){let t=/\s*([\w-]+)\s*:\s*([^;]+)/g,n,r=[];for(;n=t.exec(e);)r.push(n[1],n[2].trim());return r}function IK(e){let t={};for(let n in e)t[n]=e[n];return t}function CIe(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let o=[],a=u=>{o.push(u);for(let s=0;s<u.edgeCount;s++){let{type:c,next:l}=u.edge(s);if(c==t||o.indexOf(l)<0&&a(l))return!0}};if(a(i.contentMatch))return!0}}function AIe(e,t){for(let n=0;n<t.length;n++)if(e.eq(t[n]))return t[n]}class so{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},r){r||(r=KE(n).createDocumentFragment());let i=r,o=[];return t.forEach(a=>{if(o.length||a.marks.length){let u=0,s=0;for(;u<o.length&&s<a.marks.length;){let c=a.marks[s];if(!this.marks[c.type.name]){s++;continue}if(!c.eq(o[u][0])||c.type.spec.spanning===!1)break;u++,s++}for(;u<o.length;)i=o.pop()[1];for(;s<a.marks.length;){let c=a.marks[s++],l=this.serializeMark(c,a.isInline,n);l&&(o.push([c,i]),i.appendChild(l.dom),i=l.contentDOM||l.dom)}}i.appendChild(this.serializeNodeInner(a,n))}),r}serializeNodeInner(t,n){let{dom:r,contentDOM:i}=so.renderSpec(KE(n),this.nodes[t.type.name](t));if(i){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,n,i)}return r}serializeNode(t,n={}){let r=this.serializeNodeInner(t,n);for(let i=t.marks.length-1;i>=0;i--){let o=this.serializeMark(t.marks[i],t.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(t,n,r={}){let i=this.marks[t.type.name];return i&&so.renderSpec(KE(r),i(t,n))}static renderSpec(t,n,r=null){if(typeof n=="string")return{dom:t.createTextNode(n)};if(n.nodeType!=null)return{dom:n};if(n.dom&&n.dom.nodeType!=null)return n;let i=n[0],o=i.indexOf(" ");o>0&&(r=i.slice(0,o),i=i.slice(o+1));let a,u=r?t.createElementNS(r,i):t.createElement(i),s=n[1],c=1;if(s&&typeof s=="object"&&s.nodeType==null&&!Array.isArray(s)){c=2;for(let l in s)if(s[l]!=null){let f=l.indexOf(" ");f>0?u.setAttributeNS(l.slice(0,f),l.slice(f+1),s[l]):u.setAttribute(l,s[l])}}for(let l=c;l<n.length;l++){let f=n[l];if(f===0){if(l<n.length-1||l>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u}}else{let{dom:d,contentDOM:p}=so.renderSpec(t,f,r);if(u.appendChild(d),p){if(a)throw new RangeError("Multiple content holes");a=p}}}return{dom:u,contentDOM:a}}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new so(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=OK(t.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(t){return OK(t.marks)}}function OK(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function KE(e){return e.document||window.document}const wK=65535,EK=Math.pow(2,16);function kIe(e,t){return e+t*EK}function RK(e){return e&wK}function WIe(e){return(e-(e&wK))/EK}const MK=1,xK=2,Cb=4,CK=8;class VE{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&CK)>0}get deletedBefore(){return(this.delInfo&(MK|Cb))>0}get deletedAfter(){return(this.delInfo&(xK|Cb))>0}get deletedAcross(){return(this.delInfo&Cb)>0}}class qr{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&qr.empty)return qr.empty}recover(t){let n=0,r=RK(t);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+WIe(t)}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,r){let i=0,o=this.inverted?2:1,a=this.inverted?1:2;for(let u=0;u<this.ranges.length;u+=3){let s=this.ranges[u]-(this.inverted?i:0);if(s>t)break;let c=this.ranges[u+o],l=this.ranges[u+a],f=s+c;if(t<=f){let d=c?t==s?-1:t==f?1:n:n,p=s+i+(d<0?0:l);if(r)return p;let h=t==(n<0?s:f)?null:kIe(u/3,t-s),v=t==s?xK:t==f?MK:Cb;return(n<0?t!=s:t!=f)&&(v|=CK),new VE(p,v,h)}i+=l-c}return r?t+i:new VE(t+i,0,null)}touches(t,n){let r=0,i=RK(n),o=this.inverted?2:1,a=this.inverted?1:2;for(let u=0;u<this.ranges.length;u+=3){let s=this.ranges[u]-(this.inverted?r:0);if(s>t)break;let c=this.ranges[u+o],l=s+c;if(t<=l&&u==i*3)return!0;r+=this.ranges[u+a]-c}return!1}forEach(t){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let a=this.ranges[i],u=a-(this.inverted?o:0),s=a+(this.inverted?0:o),c=this.ranges[i+n],l=this.ranges[i+r];t(u,u+c,s,s+l),o+=l-c}}invert(){return new qr(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?qr.empty:new qr(t<0?[0,-t,0]:[0,0,t])}}qr.empty=new qr([]);class Ah{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 Ah(this.maps,this.mirror,t,n)}copy(){return new Ah(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(t,n){this.to=this.maps.push(t),n!=null&&this.setMirror(this.maps.length-1,n)}appendMapping(t){for(let n=0,r=this.maps.length;n<t.maps.length;n++){let i=t.getMirror(n);this.appendMap(t.maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(t){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==t)return this.mirror[n+(n%2?-1:1)]}}setMirror(t,n){this.mirror||(this.mirror=[]),this.mirror.push(t,n)}appendMappingInverted(t){for(let n=t.maps.length-1,r=this.maps.length+t.maps.length;n>=0;n--){let i=t.getMirror(n);this.appendMap(t.maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let t=new Ah;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let r=this.from;r<this.to;r++)t=this.maps[r].map(t,n);return t}mapResult(t,n=1){return this._map(t,n,!1)}_map(t,n,r){let i=0;for(let o=this.from;o<this.to;o++){let a=this.maps[o],u=a.mapResult(t,n);if(u.recover!=null){let s=this.getMirror(o);if(s!=null&&s>o&&s<this.to){o=s,t=this.maps[s].recover(u.recover);continue}}i|=u.delInfo,t=u.pos}return r?t:new VE(t,i,null)}}const HE=Object.create(null);class Qn{getMap(){return qr.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=HE[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in HE)throw new RangeError("Duplicate use of step JSON ID "+t);return HE[t]=n,n.prototype.jsonID=t,n}}class Pt{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new Pt(t,null)}static fail(t){return new Pt(null,t)}static fromReplace(t,n,r,i){try{return Pt.ok(t.replace(n,r,i))}catch(o){if(o instanceof Af)return Pt.fail(o.message);throw o}}}function JE(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(JE(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return V.fromArray(r)}class Ru extends Qn{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 Z(JE(n.content,(a,u)=>!a.isAtom||!u.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),i),n.openStart,n.openEnd);return Pt.fromReplace(t,this.from,this.to,o)}invert(){return new co(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 Ru(n.pos,r.pos,this.mark)}merge(t){return t instanceof Ru&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Ru(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Ru(n.from,n.to,t.markFromJSON(n.mark))}}Qn.jsonID("addMark",Ru);class co extends Qn{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 Z(JE(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),n.openStart,n.openEnd);return Pt.fromReplace(t,this.from,this.to,r)}invert(){return new Ru(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 co(n.pos,r.pos,this.mark)}merge(t){return t instanceof co&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new co(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new co(n.from,n.to,t.markFromJSON(n.mark))}}Qn.jsonID("removeMark",co);class Mu extends Qn{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Pt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Pt.fromReplace(t,this.pos,this.pos+1,new Z(V.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 Mu(this.pos,n.marks[i]);return new Mu(this.pos,this.mark)}}return new Wf(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Mu(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Mu(n.pos,t.markFromJSON(n.mark))}}Qn.jsonID("addNodeMark",Mu);class Wf extends Qn{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Pt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Pt.fromReplace(t,this.pos,this.pos+1,new Z(V.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Mu(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Wf(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Wf(n.pos,t.markFromJSON(n.mark))}}Qn.jsonID("removeNodeMark",Wf);class Cn extends Qn{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&GE(t,this.from,this.to)?Pt.fail("Structure replace would overwrite content"):Pt.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new qr([this.from,this.to-this.from,this.slice.size])}invert(t){return new Cn(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new Cn(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof Cn)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?Z.empty:new Z(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new Cn(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?Z.empty:new Z(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new Cn(t.from,this.to,n,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Cn(n.from,n.to,Z.fromJSON(t,n.slice),!!n.structure)}}Qn.jsonID("replace",Cn);class ln extends Qn{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&&(GE(t,this.from,this.gapFrom)||GE(t,this.gapTo,this.to)))return Pt.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Pt.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Pt.fromReplace(t,this.from,this.to,r):Pt.fail("Content does not fit in gap")}getMap(){return new qr([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 ln(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 ln(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new ln(n.from,n.to,n.gapFrom,n.gapTo,Z.fromJSON(t,n.slice),n.insert,!!n.structure)}}Qn.jsonID("replaceAround",ln);function GE(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let a=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}}return!1}function NIe(e,t,n,r){let i=[],o=[],a,u;e.doc.nodesBetween(t,n,(s,c,l)=>{if(!s.isInline)return;let f=s.marks;if(!r.isInSet(f)&&l.type.allowsMarkType(r.type)){let d=Math.max(c,t),p=Math.min(c+s.nodeSize,n),h=r.addToSet(f);for(let v=0;v<f.length;v++)f[v].isInSet(h)||(a&&a.to==d&&a.mark.eq(f[v])?a.to=p:i.push(a=new co(d,p,f[v])));u&&u.to==d?u.to=p:o.push(u=new Ru(d,p,r))}}),i.forEach(s=>e.step(s)),o.forEach(s=>e.step(s))}function PIe(e,t,n,r){let i=[],o=0;e.doc.nodesBetween(t,n,(a,u)=>{if(!a.isInline)return;o++;let s=null;if(r instanceof Eb){let c=a.marks,l;for(;l=r.isInSet(c);)(s||(s=[])).push(l),c=l.removeFromSet(c)}else r?r.isInSet(a.marks)&&(s=[r]):s=a.marks;if(s&&s.length){let c=Math.min(u+a.nodeSize,n);for(let l=0;l<s.length;l++){let f=s[l],d;for(let p=0;p<i.length;p++){let h=i[p];h.step==o-1&&f.eq(i[p].style)&&(d=h)}d?(d.to=c,d.step=o):i.push({style:f,from:Math.max(u,t),to:c,step:o})}}}),i.forEach(a=>e.step(new co(a.from,a.to,a.style)))}function FIe(e,t,n,r=n.contentMatch){let i=e.doc.nodeAt(t),o=[],a=t+1;for(let u=0;u<i.childCount;u++){let s=i.child(u),c=a+s.nodeSize,l=r.matchType(s.type);if(!l)o.push(new Cn(a,c,Z.empty));else{r=l;for(let f=0;f<s.marks.length;f++)n.allowsMarkType(s.marks[f].type)||e.step(new co(a,c,s.marks[f]))}a=c}if(!r.validEnd){let u=r.fillBefore(V.empty,!0);e.replace(a,a,new Z(u,0,0))}for(let u=o.length-1;u>=0;u--)e.step(o[u])}function DIe(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function kh(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let r=e.depth;;--r){let i=e.$from.node(r),o=e.$from.index(r),a=e.$to.indexAfter(r);if(r<e.depth&&i.canReplace(o,a,n))return r;if(r==0||i.type.spec.isolating||!DIe(i,o,a))break}return null}function LIe(e,t,n){let{$from:r,$to:i,depth:o}=t,a=r.before(o+1),u=i.after(o+1),s=a,c=u,l=V.empty,f=0;for(let h=o,v=!1;h>n;h--)v||r.index(h)>0?(v=!0,l=V.from(r.node(h).copy(l)),f++):s--;let d=V.empty,p=0;for(let h=o,v=!1;h>n;h--)v||i.after(h+1)<i.end(h)?(v=!0,d=V.from(i.node(h).copy(d)),p++):c++;e.step(new ln(s,c,a,u,new Z(l.append(d),f,p),l.size-f,!0))}function AK(e,t,n=null,r=e){let i=jIe(e,t),o=i&&UIe(r,t);return o?i.map(kK).concat({type:t,attrs:n}).concat(o.map(kK)):null}function kK(e){return{type:e,attrs:null}}function jIe(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.contentMatchAt(r).findWrapping(t);if(!o)return null;let a=o.length?o[0]:t;return n.canReplaceWith(r,i,a)?o:null}function UIe(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.child(r),a=t.contentMatch.findWrapping(o.type);if(!a)return null;let s=(a.length?a[a.length-1]:t).contentMatch;for(let c=r;s&&c<i;c++)s=s.matchType(n.child(c).type);return!s||!s.validEnd?null:a}function BIe(e,t,n){let r=V.empty;for(let a=n.length-1;a>=0;a--){if(r.size){let u=n[a].type.contentMatch.matchFragment(r);if(!u||!u.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=V.from(n[a].type.create(n[a].attrs,r))}let i=t.start,o=t.end;e.step(new ln(i,o,i,o,new Z(r,0,0),n.length,!0))}function zIe(e,t,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=e.steps.length;e.doc.nodesBetween(t,n,(a,u)=>{if(a.isTextblock&&!a.hasMarkup(r,i)&&qIe(e.doc,e.mapping.slice(o).map(u),r)){e.clearIncompatible(e.mapping.slice(o).map(u,1),r);let s=e.mapping.slice(o),c=s.map(u,1),l=s.map(u+a.nodeSize,1);return e.step(new ln(c,l,c+1,l-1,new Z(V.from(r.create(i,null,a.marks)),0,0),1,!0)),!1}})}function qIe(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function KIe(e,t,n,r,i){let o=e.doc.nodeAt(t);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let a=n.create(r,null,i||o.marks);if(o.isLeaf)return e.replaceWith(t,t+o.nodeSize,a);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new ln(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new Z(V.from(a),0,0),1,!0))}function WK(e,t,n=1,r){let i=e.resolve(t),o=i.depth-n,a=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!a.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,l=n-2;c>o;c--,l--){let f=i.node(c),d=i.index(c);if(f.type.spec.isolating)return!1;let p=f.content.cutByIndex(d,f.childCount),h=r&&r[l]||f;if(h!=f&&(p=p.replaceChild(0,h.type.create(h.attrs))),!f.canReplace(d+1,f.childCount)||!h.type.validContent(p))return!1}let u=i.indexAfter(o),s=r&&r[0];return i.node(o).canReplaceWith(u,u,s?s.type:i.node(o+1).type)}function VIe(e,t,n=1,r){let i=e.doc.resolve(t),o=V.empty,a=V.empty;for(let u=i.depth,s=i.depth-n,c=n-1;u>s;u--,c--){o=V.from(i.node(u).copy(o));let l=r&&r[c];a=V.from(l?l.type.create(l.attrs,a):i.node(u).copy(a))}e.step(new Cn(t,t,new Z(o.append(a),n,n),!0))}function NK(e,t){let n=e.resolve(t),r=n.index();return HIe(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function HIe(e,t){return!!(e&&t&&!e.isLeaf&&e.canAppend(t))}function JIe(e,t,n){let r=new Cn(t-n,t+n,Z.empty,!0);e.step(r)}function GIe(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,n))return r.after(i+1);if(o<r.node(i).childCount)return null}return null}function YIe(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let o=0;o<n.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(n.openStart==0&&n.size?2:1);o++)for(let a=r.depth;a>=0;a--){let u=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,s=r.index(a)+(u>0?1:0),c=r.node(a),l=!1;if(o==1)l=c.canReplace(s,s,i);else{let f=c.contentMatchAt(s).findWrapping(i.firstChild.type);l=f&&c.canReplaceWith(s,s,f[0])}if(l)return u==0?r.pos:u<0?r.before(a+1):r.after(a+1)}return null}function YE(e,t,n=t,r=Z.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return PK(i,o,r)?new Cn(t,n,r):new ZIe(i,o,r).fit()}function PK(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class ZIe{constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=V.empty;for(let i=0;i<=t.depth;i++){let o=t.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(t.indexAfter(i))})}for(let i=t.depth;i>0;i--)this.placed=V.from(t.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(t<0?this.$to:r.doc.resolve(t));if(!i)return null;let o=this.placed,a=r.depth,u=i.depth;for(;a&&u&&o.childCount==1;)o=o.firstChild.content,a--,u--;let s=new Z(o,a,u);return t>-1?new ln(r.pos,t,this.$to.pos,this.$to.end(),s,n):s.size||r.pos!=this.$to.pos?new Cn(r.pos,i.pos,s):null}findFittable(){for(let t=1;t<=2;t++)for(let n=this.unplaced.openStart;n>=0;n--){let r,i=null;n?(i=ZE(this.unplaced.content,n-1).firstChild,r=i.content):r=this.unplaced.content;let o=r.firstChild;for(let a=this.depth;a>=0;a--){let{type:u,match:s}=this.frontier[a],c,l=null;if(t==1&&(o?s.matchType(o.type)||(l=s.fillBefore(V.from(o),!1)):i&&u.compatibleContent(i.type)))return{sliceDepth:n,frontierDepth:a,parent:i,inject:l};if(t==2&&o&&(c=s.findWrapping(o.type)))return{sliceDepth:n,frontierDepth:a,parent:i,wrap:c};if(i&&s.matchType(i.type))break}}}openMore(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=ZE(t,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new Z(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=ZE(t,n);if(i.childCount<=1&&n>0){let o=t.size-n<=n+i.size;this.unplaced=new Z(Wh(t,n-1,1),n-1,o?n-1:r)}else this.unplaced=new Z(Wh(t,n,1),n,r)}placeNodes({sliceDepth:t,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let v=0;v<o.length;v++)this.openFrontierNode(o[v]);let a=this.unplaced,u=r?r.content:a.content,s=a.openStart-t,c=0,l=[],{match:f,type:d}=this.frontier[n];if(i){for(let v=0;v<i.childCount;v++)l.push(i.child(v));f=f.matchFragment(i)}let p=u.size+t-(a.content.size-a.openEnd);for(;c<u.childCount;){let v=u.child(c),y=f.matchType(v.type);if(!y)break;c++,(c>1||s==0||v.content.size)&&(f=y,l.push(FK(v.mark(d.allowedMarks(v.marks)),c==1?s:0,c==u.childCount?p:-1)))}let h=c==u.childCount;h||(p=-1),this.placed=Nh(this.placed,n,V.from(l)),this.frontier[n].match=f,h&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let v=0,y=u;v<p;v++){let b=y.lastChild;this.frontier.push({type:b.type,match:b.contentMatchAt(b.childCount)}),y=b.content}this.unplaced=h?t==0?Z.empty:new Z(Wh(a.content,t-1,1),t-1,p<0?a.openEnd:t-1):new Z(Wh(a.content,t,c),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t=this.frontier[this.depth],n;if(!t.type.isTextblock||!XE(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=XE(t,n,i,r,o);if(!!a){for(let u=n-1;u>=0;u--){let{match:s,type:c}=this.frontier[u],l=XE(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=Nh(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=Nh(this.placed,this.depth,V.from(t.create(n,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(V.empty,!0);n.childCount&&(this.placed=Nh(this.placed,this.frontier.length,n))}}function Wh(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Wh(e.firstChild.content,t-1,n)))}function Nh(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Nh(e.lastChild.content,t-1,n)))}function ZE(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function FK(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,FK(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(V.empty,!0)))),e.copy(r)}function XE(e,t,n,r,i){let o=e.node(t),a=i?e.indexAfter(t):e.index(t);if(a==o.childCount&&!n.compatibleContent(o.type))return null;let u=r.fillBefore(o.content,!0,a);return u&&!XIe(n,o.content,a)?u:null}function XIe(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function QIe(e){return e.spec.defining||e.spec.definingForContent}function eOe(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),o=e.doc.resolve(n);if(PK(i,o,r))return e.step(new Cn(t,n,r));let a=LK(i,e.doc.resolve(n));a[a.length-1]==0&&a.pop();let u=-(i.depth+1);a.unshift(u);for(let d=i.depth,p=i.pos-1;d>0;d--,p--){let h=i.node(d).type.spec;if(h.defining||h.definingAsContext||h.isolating)break;a.indexOf(d)>-1?u=d:i.before(d)==p&&a.splice(1,0,-d)}let s=a.indexOf(u),c=[],l=r.openStart;for(let d=r.content,p=0;;p++){let h=d.firstChild;if(c.push(h),p==r.openStart)break;d=h.content}for(let d=l-1;d>=0;d--){let p=c[d].type,h=QIe(p);if(h&&i.node(s).type!=p)l=d;else if(h||!p.isTextblock)break}for(let d=r.openStart;d>=0;d--){let p=(d+l+1)%(r.openStart+1),h=c[p];if(!!h)for(let v=0;v<a.length;v++){let y=a[(v+s)%a.length],b=!0;y<0&&(b=!1,y=-y);let w=i.node(y-1),F=i.index(y-1);if(w.canReplaceWith(F,F,h.type,h.marks))return e.replace(i.before(y),b?o.after(y):n,new Z(DK(r.content,0,r.openStart,p),p,r.openEnd))}}let f=e.steps.length;for(let d=a.length-1;d>=0&&(e.replace(t,n,r),!(e.steps.length>f));d--){let p=a[d];p<0||(t=i.before(p),n=o.after(p))}}function DK(e,t,n,r,i){if(t<n){let o=e.firstChild;e=e.replaceChild(0,o.copy(DK(o.content,t+1,n,r,o)))}if(t>r){let o=i.contentMatchAt(0),a=o.fillBefore(e).append(e);e=a.append(o.matchFragment(a).fillBefore(V.empty,!0))}return e}function tOe(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=GIe(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new Z(V.from(r),0,0))}function nOe(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n),o=LK(r,i);for(let a=0;a<o.length;a++){let u=o[a],s=a==o.length-1;if(s&&u==0||r.node(u).type.contentMatch.validEnd)return e.delete(r.start(u),i.end(u));if(u>0&&(s||r.node(u-1).canReplace(r.index(u-1),i.indexAfter(u-1))))return e.delete(r.before(u),i.after(u))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(t-r.start(a)==r.depth-a&&n>r.end(a)&&i.end(a)-n!=i.depth-a)return e.delete(r.before(a),n);e.delete(t,n)}function LK(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let o=e.start(i);if(o<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(o==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==o-1)&&n.push(i)}return n}class Nf extends Qn{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 Pt.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return Pt.fromReplace(t,this.pos,this.pos+1,new Z(V.from(i),0,n.isLeaf?0:1))}getMap(){return qr.empty}invert(t){return new Nf(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 Nf(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Nf(n.pos,n.attr,n.value)}}Qn.jsonID("attr",Nf);let Pf=class extends Error{};Pf=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},Pf.prototype=Object.create(Error.prototype),Pf.prototype.constructor=Pf,Pf.prototype.name="TransformError";class rOe{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new Ah}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new Pf(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=Z.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 Z(V.from(r),0,0))}delete(t,n){return this.replace(t,n,Z.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,r){return eOe(this,t,n,r),this}replaceRangeWith(t,n,r){return tOe(this,t,n,r),this}deleteRange(t,n){return nOe(this,t,n),this}lift(t,n){return LIe(this,t,n),this}join(t,n=1){return JIe(this,t,n),this}wrap(t,n){return BIe(this,t,n),this}setBlockType(t,n=t,r,i=null){return zIe(this,t,n,r,i),this}setNodeMarkup(t,n,r=null,i=[]){return KIe(this,t,n,r,i),this}setNodeAttribute(t,n,r){return this.step(new Nf(t,n,r)),this}addNodeMark(t,n){return this.step(new Mu(t,n)),this}removeNodeMark(t,n){if(!(n instanceof Ge)){let r=this.doc.nodeAt(t);if(!r)throw new RangeError("No node at position "+t);if(n=n.isInSet(r.marks),!n)return this}return this.step(new Wf(t,n)),this}split(t,n=1,r){return VIe(this,t,n,r),this}addMark(t,n,r){return NIe(this,t,n,r),this}removeMark(t,n,r){return PIe(this,t,n,r),this}clearIncompatible(t,n,r){return FIe(this,t,n,r),this}}const QE=Object.create(null);class Fe{constructor(t,n,r){this.$anchor=t,this.$head=n,this.ranges=r||[new iOe(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=Z.empty){let r=n.content.lastChild,i=null;for(let u=0;u<n.openEnd;u++)i=r,r=r.lastChild;let o=t.steps.length,a=this.ranges;for(let u=0;u<a.length;u++){let{$from:s,$to:c}=a[u],l=t.mapping.slice(o);t.replaceRange(l.map(s.pos),l.map(c.pos),u?Z.empty:n),u==0&&BK(t,o,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(t,n){let r=t.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:a,$to:u}=i[o],s=t.mapping.slice(r),c=s.map(a.pos),l=s.map(u.pos);o?t.deleteRange(c,l):(t.replaceRangeWith(c,l,n),BK(t,r,n.isInline?-1:1))}}static findFrom(t,n,r=!1){let i=t.parent.inlineContent?new Ae(t):Ff(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?Ff(t.node(0),t.node(o),t.before(o+1),t.index(o),n,r):Ff(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 Ei(t.node(0))}static atStart(t){return Ff(t,t,0,0,1)||new Ei(t)}static atEnd(t){return Ff(t,t,t.content.size,t.childCount,-1)||new Ei(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=QE[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in QE)throw new RangeError("Duplicate use of selection JSON ID "+t);return QE[t]=n,n.prototype.jsonID=t,n}getBookmark(){return Ae.between(this.$anchor,this.$head).getBookmark()}}Fe.prototype.visible=!0;class iOe{constructor(t,n){this.$from=t,this.$to=n}}let jK=!1;function UK(e){!jK&&!e.parent.inlineContent&&(jK=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class Ae extends Fe{constructor(t,n=t){UK(t),UK(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 Fe.near(r);let i=t.resolve(n.map(this.anchor));return new Ae(i.parent.inlineContent?i:r,r)}replace(t,n=Z.empty){if(super.replace(t,n),n==Z.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof Ae&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Ab(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Ae(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=Fe.findFrom(n,r,!0)||Fe.findFrom(n,-r,!0);if(o)n=o.$head;else return Fe.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(Fe.findFrom(t,-r,!0)||Fe.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new Ae(t,n)}}Fe.jsonID("text",Ae);class Ab{constructor(t,n){this.anchor=t,this.head=n}map(t){return new Ab(t.map(this.anchor),t.map(this.head))}resolve(t){return Ae.between(t.resolve(this.anchor),t.resolve(this.head))}}class ve extends Fe{constructor(t){let n=t.nodeAfter,r=t.node(0).resolve(t.pos+n.nodeSize);super(t,r),this.node=n}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),o=t.resolve(i);return r?Fe.near(o):new ve(o)}content(){return new Z(V.from(this.node),0,0)}eq(t){return t instanceof ve&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new eR(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new ve(t.resolve(n.anchor))}static create(t,n){return new ve(t.resolve(n))}static isSelectable(t){return!t.isText&&t.type.spec.selectable!==!1}}ve.prototype.visible=!1,Fe.jsonID("node",ve);class eR{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new Ab(r,r):new eR(r)}resolve(t){let n=t.resolve(this.anchor),r=n.nodeAfter;return r&&ve.isSelectable(r)?new ve(n):Fe.near(n)}}class Ei extends Fe{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,n=Z.empty){if(n==Z.empty){t.delete(0,t.doc.content.size);let r=Fe.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(t){return new Ei(t)}map(t){return new Ei(t)}eq(t){return t instanceof Ei}getBookmark(){return oOe}}Fe.jsonID("all",Ei);const oOe={map(){return this},resolve(e){return new Ei(e)}};function Ff(e,t,n,r,i,o=!1){if(t.inlineContent)return Ae.create(e,n);for(let a=r-(i>0?0:1);i>0?a<t.childCount:a>=0;a+=i){let u=t.child(a);if(u.isAtom){if(!o&&ve.isSelectable(u))return ve.create(e,n-(i<0?u.nodeSize:0))}else{let s=Ff(e,u,n+i,i<0?u.childCount:0,i,o);if(s)return s}n+=u.nodeSize*i}return null}function BK(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof Cn||i instanceof ln))return;let o=e.mapping.maps[r],a;o.forEach((u,s,c,l)=>{a==null&&(a=l)}),e.setSelection(Fe.near(e.doc.resolve(a),n))}const zK=1,kb=2,qK=4;class aOe extends rOe{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(t){if(t.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=(this.updated|zK)&~kb,this.storedMarks=null,this}get selectionSet(){return(this.updated&zK)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=kb,this}ensureMarks(t){return Ge.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&kb)>0}addStep(t,n){super.addStep(t,n),this.updated=this.updated&~kb,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)||Ge.none))),r.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,n,r){let i=this.doc.type.schema;if(n==null)return t?this.replaceSelectionWith(i.text(t),!0):this.deleteSelection();{if(r==null&&(r=n),r=r==null?n:r,!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(Fe.near(this.selection.$to)),this}}setMeta(t,n){return this.meta[typeof t=="string"?t:t.key]=n,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=qK,this}get scrolledIntoView(){return(this.updated&qK)>0}}function KK(e,t){return!t||!e?e:e.bind(t)}class Ph{constructor(t,n,r){this.name=t,this.init=KK(n.init,r),this.apply=KK(n.apply,r)}}const uOe=[new Ph("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new Ph("selection",{init(e,t){return e.selection||Fe.atStart(t.doc)},apply(e){return e.selection}}),new Ph("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new Ph("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class tR{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=uOe.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Ph(r.key,r.spec.state,r))})}}class Df{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,t,this))return!1}return!0}applyTransaction(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};let n=[t],r=this.applyInner(t),i=null;for(;;){let o=!1;for(let a=0;a<this.config.plugins.length;a++){let u=this.config.plugins[a];if(u.spec.appendTransaction){let s=i?i[a].n:0,c=i?i[a].state:this,l=s<n.length&&u.spec.appendTransaction.call(u,s?n.slice(s):n,c,r);if(l&&r.filterTransaction(l,a)){if(l.setMeta("appendedTransaction",t),!i){i=[];for(let f=0;f<this.config.plugins.length;f++)i.push(f<a?{state:r,n:n.length}:{state:this,n:0})}n.push(l),r=r.applyInner(l),o=!0}i&&(i[a]={state:r,n:n.length})}}if(!o)return{state:r,transactions:n}}}applyInner(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new Df(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 aOe(this)}static create(t){let n=new tR(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new Df(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 tR(this.schema,t.plugins),r=n.fields,i=new Df(n);for(let o=0;o<r.length;o++){let a=r[o].name;i[a]=this.hasOwnProperty(a)?this[a]:r[o].init(t,i)}return i}toJSON(t){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),t&&typeof t=="object")for(let r in t){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=t[r],o=i.spec.state;o&&o.toJSON&&(n[r]=o.toJSON.call(i,this[i.key]))}return n}static fromJSON(t,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let i=new tR(t.schema,t.plugins),o=new Df(i);return i.fields.forEach(a=>{if(a.name=="doc")o.doc=uo.fromJSON(t.schema,n.doc);else if(a.name=="selection")o.selection=Fe.fromJSON(o.doc,n.selection);else if(a.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let u in r){let s=r[u],c=s.spec.state;if(s.key==a.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,u)){o[a.name]=c.fromJSON.call(s,t,n[u],o);return}}o[a.name]=a.init(t,o)}}),o}}function VK(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r=="handleDOMEvents"&&(i=VK(i,t,{})),n[r]=i}return n}class Kr{constructor(t){this.spec=t,this.props={},t.props&&VK(t.props,this,this.props),this.key=t.key?t.key.key:HK("plugin")}getState(t){return t[this.key]}}const nR=Object.create(null);function HK(e){return e in nR?e+"$"+ ++nR[e]:(nR[e]=0,e+"$")}class xu{constructor(t="key"){this.key=HK(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const Cu=typeof navigator<"u"?navigator:null,JK=typeof document<"u"?document:null,Au=Cu&&Cu.userAgent||"",rR=/Edge\/(\d+)/.exec(Au),GK=/MSIE \d/.exec(Au),iR=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Au),$r=!!(GK||iR||rR),ku=GK?document.documentMode:iR?+iR[1]:rR?+rR[1]:0,lo=!$r&&/gecko\/(\d+)/i.test(Au);lo&&+(/Firefox\/(\d+)/.exec(Au)||[0,0])[1];const oR=!$r&&/Chrome\/(\d+)/.exec(Au),An=!!oR,sOe=oR?+oR[1]:0,er=!$r&&!!Cu&&/Apple Computer/.test(Cu.vendor),Lf=er&&(/Mobile\/\w+/.test(Au)||!!Cu&&Cu.maxTouchPoints>2),Vr=Lf||(Cu?/Mac/.test(Cu.platform):!1),fo=/Android \d/.test(Au),Wb=!!JK&&"webkitFontSmoothing"in JK.documentElement.style,cOe=Wb?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,_r=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},aR=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t};let YK=null;const _a=function(e,t,n){let r=YK||(YK=document.createRange());return r.setEnd(e,n==null?e.nodeValue.length:n),r.setStart(e,t||0),r},Fh=function(e,t,n,r){return n&&(ZK(e,t,n,r,-1)||ZK(e,t,n,r,1))},lOe=/^(img|br|input|textarea|hr)$/i;function ZK(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:po(e))){let o=e.parentNode;if(!o||o.nodeType!=1||dOe(e)||lOe.test(e.nodeName)||e.contentEditable=="false")return!1;t=_r(e)+(i<0?0:1),e=o}else if(e.nodeType==1){if(e=e.childNodes[t+(i<0?-1:0)],e.contentEditable=="false")return!1;t=i<0?po(e):0}else return!1}}function po(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function fOe(e,t,n){for(let r=t==0,i=t==po(e);r||i;){if(e==n)return!0;let o=_r(e);if(e=e.parentNode,!e)return!1;r=r&&o==0,i=i&&o==po(e)}}function dOe(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const uR=function(e){let t=e.isCollapsed;return t&&An&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t};function jf(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function pOe(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Wu(e,t){return typeof e=="number"?e:e[t]}function hOe(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function XK(e,t,n){let r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,o=e.dom.ownerDocument;for(let a=n||e.dom;a;a=aR(a)){if(a.nodeType!=1)continue;let u=a,s=u==o.body,c=s?pOe(o):hOe(u),l=0,f=0;if(t.top<c.top+Wu(r,"top")?f=-(c.top-t.top+Wu(i,"top")):t.bottom>c.bottom-Wu(r,"bottom")&&(f=t.bottom-c.bottom+Wu(i,"bottom")),t.left<c.left+Wu(r,"left")?l=-(c.left-t.left+Wu(i,"left")):t.right>c.right-Wu(r,"right")&&(l=t.right-c.right+Wu(i,"right")),l||f)if(s)o.defaultView.scrollBy(l,f);else{let d=u.scrollLeft,p=u.scrollTop;f&&(u.scrollTop+=f),l&&(u.scrollLeft+=l);let h=u.scrollLeft-d,v=u.scrollTop-p;t={left:t.left-h,top:t.top-v,right:t.right-h,bottom:t.bottom-v}}if(s)break}}function mOe(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,i;for(let o=(t.left+t.right)/2,a=n+1;a<Math.min(innerHeight,t.bottom);a+=5){let u=e.root.elementFromPoint(o,a);if(!u||u==e.dom||!e.dom.contains(u))continue;let s=u.getBoundingClientRect();if(s.top>=n-20){r=u,i=s.top;break}}return{refDOM:r,refTop:i,stack:QK(e.dom)}}function QK(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=aR(r));return t}function vOe({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;eV(n,r==0?0:r-t)}function eV(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:o}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=o&&(r.scrollLeft=o)}}let Uf=null;function gOe(e){if(e.setActive)return e.setActive();if(Uf)return e.focus(Uf);let t=QK(e);e.focus(Uf==null?{get preventScroll(){return Uf={preventScroll:!0},!0}}:void 0),Uf||(Uf=!1,eV(t,0))}function tV(e,t){let n,r=2e8,i,o=0,a=t.top,u=t.top;for(let s=e.firstChild,c=0;s;s=s.nextSibling,c++){let l;if(s.nodeType==1)l=s.getClientRects();else if(s.nodeType==3)l=_a(s).getClientRects();else continue;for(let f=0;f<l.length;f++){let d=l[f];if(d.top<=a&&d.bottom>=u){a=Math.max(d.bottom,a),u=Math.min(d.top,u);let p=d.left>t.left?d.left-t.left:d.right<t.left?t.left-d.right:0;if(p<r){n=s,r=p,i=p&&n.nodeType==3?{left:d.right<t.left?d.right:d.left,top:t.top}:t,s.nodeType==1&&p&&(o=c+(t.left>=(d.left+d.right)/2?1:0));continue}}!n&&(t.left>=d.right&&t.top>=d.top||t.left>=d.left&&t.top>=d.bottom)&&(o=c+1)}}return n&&n.nodeType==3?yOe(n,i):!n||r&&n.nodeType==1?{node:e,offset:o}:tV(n,i)}function yOe(e,t){let n=e.nodeValue.length,r=document.createRange();for(let i=0;i<n;i++){r.setEnd(e,i+1),r.setStart(e,i);let o=Nu(r,1);if(o.top!=o.bottom&&sR(t,o))return{node:e,offset:i+(t.left>=(o.left+o.right)/2?1:0)}}return{node:e,offset:0}}function sR(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function bOe(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function $Oe(e,t,n){let{node:r,offset:i}=tV(t,n),o=-1;if(r.nodeType==1&&!r.firstChild){let a=r.getBoundingClientRect();o=a.left!=a.right&&n.left>(a.left+a.right)/2?1:-1}return e.docView.posFromDOM(r,i,o)}function _Oe(e,t,n,r){let i=-1;for(let o=t;o!=e.dom;){let a=e.docView.nearestDesc(o,!0);if(!a)return null;if(a.node.isBlock&&a.parent){let u=a.dom.getBoundingClientRect();if(u.left>r.left||u.top>r.top)i=a.posBefore;else if(u.right<r.left||u.bottom<r.top)i=a.posAfter;else break}o=a.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,1)}function nV(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),o=i;;){let a=e.childNodes[o];if(a.nodeType==1){let u=a.getClientRects();for(let s=0;s<u.length;s++){let c=u[s];if(sR(t,c))return nV(a,t,c)}}if((o=(o+1)%r)==i)break}return e}function SOe(e,t){let n=e.dom.ownerDocument,r,i=0;if(n.caretPositionFromPoint)try{let s=n.caretPositionFromPoint(t.left,t.top);s&&({offsetNode:r,offset:i}=s)}catch{}if(!r&&n.caretRangeFromPoint){let s=n.caretRangeFromPoint(t.left,t.top);s&&({startContainer:r,startOffset:i}=s)}let o=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top+1),a;if(!o||!e.dom.contains(o.nodeType!=1?o.parentNode:o)){let s=e.dom.getBoundingClientRect();if(!sR(t,s)||(o=nV(e.dom,t,s),!o))return null}if(er)for(let s=o;r&&s;s=aR(s))s.draggable&&(r=void 0);if(o=bOe(o,t),r){if(lo&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let s=r.childNodes[i],c;s.nodeName=="IMG"&&(c=s.getBoundingClientRect()).right<=t.left&&c.bottom>t.top&&i++}r==e.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?a=e.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(a=_Oe(e,r,i,t))}a==null&&(a=$Oe(e,o,t));let u=e.docView.nearestDesc(o,!0);return{pos:a,inside:u?u.posAtStart-u.border:-1}}function Nu(e,t){let n=e.getClientRects();return n.length?n[t<0?0:n.length-1]:e.getBoundingClientRect()}const TOe=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function rV(e,t,n){let{node:r,offset:i}=e.docView.domFromPos(t,n<0?-1:1),o=Wb||lo;if(r.nodeType==3)if(o&&(TOe.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let a=Nu(_a(r,i,i),n);if(lo&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let u=Nu(_a(r,i-1,i-1),-1);if(u.top==a.top){let s=Nu(_a(r,i,i+1),-1);if(s.top!=a.top)return Dh(s,s.left<u.left)}}return a}else{let a=i,u=i,s=n<0?1:-1;return n<0&&!i?(u++,s=-1):n>=0&&i==r.nodeValue.length?(a--,s=1):n<0?a--:u++,Dh(Nu(_a(r,a,u),s),s<0)}if(!e.state.doc.resolve(t).parent.inlineContent){if(i&&(n<0||i==po(r))){let a=r.childNodes[i-1];if(a.nodeType==1)return cR(a.getBoundingClientRect(),!1)}if(i<po(r)){let a=r.childNodes[i];if(a.nodeType==1)return cR(a.getBoundingClientRect(),!0)}return cR(r.getBoundingClientRect(),n>=0)}if(i&&(n<0||i==po(r))){let a=r.childNodes[i-1],u=a.nodeType==3?_a(a,po(a)-(o?0:1)):a.nodeType==1&&(a.nodeName!="BR"||!a.nextSibling)?a:null;if(u)return Dh(Nu(u,1),!1)}if(i<po(r)){let a=r.childNodes[i];for(;a.pmViewDesc&&a.pmViewDesc.ignoreForCoords;)a=a.nextSibling;let u=a?a.nodeType==3?_a(a,0,o?0:1):a.nodeType==1?a:null:null;if(u)return Dh(Nu(u,-1),!0)}return Dh(Nu(r.nodeType==3?_a(r):r,-n),n>=0)}function Dh(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function cR(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function iV(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}function IOe(e,t,n){let r=t.selection,i=n=="up"?r.$from:r.$to;return iV(e,t,()=>{let{node:o}=e.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let u=e.docView.nearestDesc(o,!0);if(!u)break;if(u.node.isBlock){o=u.dom;break}o=u.dom.parentNode}let a=rV(e,i.pos,1);for(let u=o.firstChild;u;u=u.nextSibling){let s;if(u.nodeType==1)s=u.getClientRects();else if(u.nodeType==3)s=_a(u,0,u.nodeValue.length).getClientRects();else continue;for(let c=0;c<s.length;c++){let l=s[c];if(l.bottom>l.top+1&&(n=="up"?a.top-l.top>(l.bottom-a.top)*2:l.bottom-a.bottom>(a.bottom-l.top)*2))return!1}}return!0})}const OOe=/[\u0590-\u08ac]/;function wOe(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,a=i==r.parent.content.size,u=e.domSelection();return!OOe.test(r.parent.textContent)||!u.modify?n=="left"||n=="backward"?o:a:iV(e,t,()=>{let s=u.getRangeAt(0),c=u.focusNode,l=u.focusOffset,f=u.caretBidiLevel;u.modify("move",n,"character");let p=!(r.depth?e.docView.domAfterPos(r.before()):e.dom).contains(u.focusNode.nodeType==1?u.focusNode:u.focusNode.parentNode)||c==u.focusNode&&l==u.focusOffset;return u.removeAllRanges(),u.addRange(s),f!=null&&(u.caretBidiLevel=f),p})}let oV=null,aV=null,uV=!1;function EOe(e,t,n){return oV==t&&aV==n?uV:(oV=t,aV=n,uV=n=="up"||n=="down"?IOe(e,t,n):wOe(e,t,n))}const Ri=0,sV=1,Bf=2,ho=3;class Lh{constructor(t,n,r,i){this.parent=t,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=Ri,r.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,n,r){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let n=0;n<this.children.length;n++)t+=this.children[n].size;return t}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let t=0;t<this.children.length;t++)this.children[t].destroy()}posBeforeChild(t){for(let n=0,r=this.posAtStart;;n++){let i=this.children[n];if(i==t)return r;r+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(t,n,r){if(this.contentDOM&&this.contentDOM.contains(t.nodeType==1?t:t.parentNode))if(r<0){let o,a;if(t==this.contentDOM)o=t.childNodes[n-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;o=t.previousSibling}for(;o&&!((a=o.pmViewDesc)&&a.parent==this);)o=o.previousSibling;return o?this.posBeforeChild(a)+a.size:this.posAtStart}else{let o,a;if(t==this.contentDOM)o=t.childNodes[n];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;o=t.nextSibling}for(;o&&!((a=o.pmViewDesc)&&a.parent==this);)o=o.nextSibling;return o?this.posBeforeChild(a):this.posAtEnd}let i;if(t==this.dom&&this.contentDOM)i=n>_r(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=t.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let o=t;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&n==t.childNodes.length)for(let o=t;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return(i==null?r>0:i)?this.posAtEnd:this.posAtStart}nearestDesc(t,n=!1){for(let r=!0,i=t;i;i=i.parentNode){let o=this.getDesc(i),a;if(o&&(!n||o.node))if(r&&(a=o.nodeDOM)&&!(a.nodeType==1?a.contains(t.nodeType==1?t:t.parentNode):a==t))r=!1;else return o}}getDesc(t){let n=t.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(t,n,r){for(let i=t;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(t,n,r)}return-1}descAt(t){for(let n=0,r=0;n<this.children.length;n++){let i=this.children[n],o=r+i.size;if(r==t&&o!=r){for(;!i.border&&i.children.length;)i=i.children[0];return i}if(t<o)return i.descAt(t-r-i.border);r=o}}domFromPos(t,n){if(!this.contentDOM)return{node:this.dom,offset:0};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 fV){i=t-o;break}o=u}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof cV&&o.side>=0;r--);if(n<=0){let o,a=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,a=!1);return o&&n&&a&&!o.border&&!o.domAtom?o.domFromPos(o.size,n):{node:this.contentDOM,offset:o?_r(o.dom)+1:0}}else{let o,a=!0;for(;o=r<this.children.length?this.children[r]:null,!(!o||o.dom.parentNode==this.contentDOM);r++,a=!1);return o&&a&&!o.border&&!o.domAtom?o.domFromPos(0,n):{node:this.contentDOM,offset:o?_r(o.dom):this.contentDOM.childNodes.length}}}parseRange(t,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:t,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,o=-1;for(let a=r,u=0;;u++){let s=this.children[u],c=a+s.size;if(i==-1&&t<=c){let l=a+s.border;if(t>=l&&n<=c-s.border&&s.node&&s.contentDOM&&this.contentDOM.contains(s.contentDOM))return s.parseRange(t,n,l);t=a;for(let f=u;f>0;f--){let d=this.children[f-1];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(1)){i=_r(d.dom)+1;break}t-=d.size}i==-1&&(i=0)}if(i>-1&&(c>n||u==this.children.length-1)){n=c;for(let l=u+1;l<this.children.length;l++){let f=this.children[l];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){o=_r(f.dom);break}n+=f.size}o==-1&&(o=this.contentDOM.childNodes.length);break}a=c}return{node:this.contentDOM,from:t,to:n,fromOffset:i,toOffset:o}}emptyChildAt(t){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[t<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(t)}domAfterPos(t){let{node:n,offset:r}=this.domFromPos(t,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+t);return n.childNodes[r]}setSelection(t,n,r,i=!1){let o=Math.min(t,n),a=Math.max(t,n);for(let d=0,p=0;d<this.children.length;d++){let h=this.children[d],v=p+h.size;if(o>p&&a<v)return h.setSelection(t-p-h.border,n-p-h.border,r,i);p=v}let u=this.domFromPos(t,t?-1:1),s=n==t?u:this.domFromPos(n,n?-1:1),c=r.getSelection(),l=!1;if((lo||er)&&t==n){let{node:d,offset:p}=u;if(d.nodeType==3){if(l=!!(p&&d.nodeValue[p-1]==`
36
- `),l&&p==d.nodeValue.length)for(let h=d,v;h;h=h.parentNode){if(v=h.nextSibling){v.nodeName=="BR"&&(u=s={node:v.parentNode,offset:_r(v)+1});break}let y=h.pmViewDesc;if(y&&y.node&&y.node.isBlock)break}}else{let h=d.childNodes[p-1];l=h&&(h.nodeName=="BR"||h.contentEditable=="false")}}if(lo&&c.focusNode&&c.focusNode!=s.node&&c.focusNode.nodeType==1){let d=c.focusNode.childNodes[c.focusOffset];d&&d.contentEditable=="false"&&(i=!0)}if(!(i||l&&er)&&Fh(u.node,u.offset,c.anchorNode,c.anchorOffset)&&Fh(s.node,s.offset,c.focusNode,c.focusOffset))return;let f=!1;if((c.extend||t==n)&&!l){c.collapse(u.node,u.offset);try{t!=n&&c.extend(s.node,s.offset),f=!0}catch(d){if(!(d instanceof DOMException))throw d}}if(!f){if(t>n){let p=u;u=s,s=p}let d=document.createRange();d.setEnd(s.node,s.offset),d.setStart(u.node,u.offset),c.removeAllRanges(),c.addRange(d)}}ignoreMutation(t){return!this.contentDOM&&t.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,n){for(let r=0,i=0;i<this.children.length;i++){let o=this.children[i],a=r+o.size;if(r==a?t<=a&&n>=r:t<a&&n>r){let u=r+o.border,s=a-o.border;if(t>=u&&n<=s){this.dirty=t==r||n==a?Bf:sV,t==u&&n==s&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=ho:o.markDirty(t-u,n-u);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?Bf:ho}r=a}this.dirty=Bf}markParentsDirty(){let t=1;for(let n=this.parent;n;n=n.parent,t++){let r=t==1?Bf:sV;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class cV extends Lh{constructor(t,n,r,i){let o,a=n.type.toDOM;if(typeof a=="function"&&(a=a(r,()=>{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!n.type.spec.raw){if(a.nodeType!=1){let u=document.createElement("span");u.appendChild(a),a=u}a.contentEditable="false",a.classList.add("ProseMirror-widget")}super(t,[],a,null),this.widget=n,this.widget=n,o=this}matchesWidget(t){return this.dirty==Ri&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let n=this.widget.spec.stopEvent;return n?n(t):!1}ignoreMutation(t){return t.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class ROe extends Lh{constructor(t,n,r,i){super(t,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(t,n){return t!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return t.type==="characterData"&&t.target.nodeValue==t.oldValue}}class gc extends Lh{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=so.renderSpec(document,n.type.spec.toDOM(n,r))),new gc(t,n,a.dom,a.contentDOM||a.dom)}parseRule(){return this.dirty&ho||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM||void 0}}matchesMark(t){return this.dirty!=ho&&this.mark.eq(t)}markDirty(t,n){if(super.markDirty(t,n),this.dirty!=Ri){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Ri}}slice(t,n,r){let i=gc.create(this.parent,this.mark,!0,r),o=this.children,a=this.size;n<a&&(o=dR(o,n,a,r)),t>0&&(o=dR(o,0,t,r));for(let u=0;u<o.length;u++)o[u].parent=i;return i.children=o,i}}class yc extends Lh{constructor(t,n,r,i,o,a,u,s,c){super(t,[],o,a),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=u,a&&this.updateChildren(s,c)}static create(t,n,r,i,o,a){let u=o.nodeViews[n.type.name],s,c=u&&u(n,o,()=>{if(!s)return a;if(s.parent)return s.parent.posBeforeChild(s)},r,i),l=c&&c.dom,f=c&&c.contentDOM;if(n.isText){if(!l)l=document.createTextNode(n.text);else if(l.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else l||({dom:l,contentDOM:f}=so.renderSpec(document,n.type.spec.toDOM(n)));!f&&!n.isText&&l.nodeName!="BR"&&(l.hasAttribute("contenteditable")||(l.contentEditable="false"),n.type.spec.draggable&&(l.draggable=!0));let d=l;return l=hV(l,r,n),c?s=new MOe(t,n,r,i,l,f||null,d,c,o,a+1):n.isText?new Nb(t,n,r,i,l,d,o):new yc(t,n,r,i,l,f||null,d,o,a+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(t.preserveWhitespace="full"),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){t.contentElement=r.dom.parentNode;break}}t.contentElement||(t.getContent=()=>V.empty)}return t}matchesNode(t,n,r){return this.dirty==Ri&&t.eq(this.node)&&fR(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 COe(this,a&&a.node);WOe(this.node,this.innerDeco,(c,l,f)=>{c.spec.marks?s.syncToMarks(c.spec.marks,r,t):c.type.side>=0&&!f&&s.syncToMarks(l==this.node.childCount?Ge.none:this.node.child(l).marks,r,t),s.placeWidget(c,t,i)},(c,l,f,d)=>{s.syncToMarks(c.marks,r,t);let p;s.findNodeMatch(c,l,f,d)||u&&t.state.selection.from>i&&t.state.selection.to<i+c.nodeSize&&(p=s.findIndexWithChild(o.node))>-1&&s.updateNodeAt(c,l,f,p,t)||s.updateNextNode(c,l,f,t,d)||s.addNode(c,l,f,t,i),i+=c.nodeSize}),s.syncToMarks([],r,t),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||this.dirty==Bf)&&(a&&this.protectLocalComposition(t,a),dV(this.contentDOM,this.children,t),Lf&&NOe(this.dom))}localCompositionInfo(t,n){let{from:r,to:i}=t.state.selection;if(!(t.state.selection instanceof Ae)||r<n||i>n+this.node.content.size)return null;let o=t.domSelection(),a=POe(o.focusNode,o.focusOffset);if(!a||!this.dom.contains(a.parentNode))return null;if(this.node.inlineContent){let u=a.nodeValue,s=FOe(this.node.content,u,r-n,i-n);return s<0?null:{node:a,pos:s,text:u}}else return{node:a,pos:-1,text:""}}protectLocalComposition(t,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let o=n;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let a=new ROe(this,o,n,i);t.input.compositionNodes.push(a),this.children=dR(this.children,r,r+i.length,t,a)}update(t,n,r,i){return this.dirty==ho||!t.sameMarkup(this.node)?!1:(this.updateInner(t,n,r,i),!0)}updateInner(t,n,r,i){this.updateOuterDeco(n),this.node=t,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=Ri}updateOuterDeco(t){if(fR(t,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=pV(this.dom,this.nodeDOM,lR(this.outerDeco,this.node,n),lR(t,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function lV(e,t,n,r,i){return hV(r,t,e),new yc(void 0,e,t,n,r,r,r,i,0)}class Nb extends yc{constructor(t,n,r,i,o,a,u){super(t,n,r,i,o,null,a,u,0)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,n,r,i){return this.dirty==ho||this.dirty!=Ri&&!this.inParent()||!t.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Ri||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=Ri,!0)}inParent(){let t=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,n,r){return t==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(t,n,r)}ignoreMutation(t){return t.type!="characterData"&&t.type!="selection"}slice(t,n,r){let i=this.node.cut(t,n),o=document.createTextNode(i.text);return new Nb(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(t,n){super.markDirty(t,n),this.dom!=this.nodeDOM&&(t==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=ho)}get domAtom(){return!1}}class fV extends Lh{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==Ri&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class MOe extends yc{constructor(t,n,r,i,o,a,u,s,c,l){super(t,n,r,i,o,a,u,c,l),this.spec=s}update(t,n,r,i){if(this.dirty==ho)return!1;if(this.spec.update){let o=this.spec.update(t,n,r);return o&&this.updateInner(t,n,r,i),o}else return!this.contentDOM&&!t.isLeaf?!1:super.update(t,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,n,r,i){this.spec.setSelection?this.spec.setSelection(t,n,r):super.setSelection(t,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return this.spec.stopEvent?this.spec.stopEvent(t):!1}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function dV(e,t,n){let r=e.firstChild,i=!1;for(let o=0;o<t.length;o++){let a=t[o],u=a.dom;if(u.parentNode==e){for(;u!=r;)r=mV(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(u,r);if(a instanceof gc){let s=r?r.previousSibling:e.lastChild;dV(a.contentDOM,a.children,n),r=s?s.nextSibling:e.firstChild}}for(;r;)r=mV(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}const jh=function(e){e&&(this.nodeName=e)};jh.prototype=Object.create(null);const bc=[new jh];function lR(e,t,n){if(e.length==0)return bc;let r=n?bc[0]:new jh,i=[r];for(let o=0;o<e.length;o++){let a=e[o].type.attrs;if(!!a){a.nodeName&&i.push(r=new jh(a.nodeName));for(let u in a){let s=a[u];s!=null&&(n&&i.length==1&&i.push(r=new jh(t.isInline?"span":"div")),u=="class"?r.class=(r.class?r.class+" ":"")+s:u=="style"?r.style=(r.style?r.style+";":"")+s:u!="nodeName"&&(r[u]=s))}}}return i}function pV(e,t,n,r){if(n==bc&&r==bc)return t;let i=t;for(let o=0;o<r.length;o++){let a=r[o],u=n[o];if(o){let s;u&&u.nodeName==a.nodeName&&i!=e&&(s=i.parentNode)&&s.nodeName.toLowerCase()==a.nodeName||(s=document.createElement(a.nodeName),s.pmIsDeco=!0,s.appendChild(i),u=bc[0]),i=s}xOe(i,u||bc[0],a)}return i}function xOe(e,t,n){for(let r in t)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&e.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let o=0;o<r.length;o++)i.indexOf(r[o])==-1&&e.classList.remove(r[o]);for(let o=0;o<i.length;o++)r.indexOf(i[o])==-1&&e.classList.add(i[o]);e.classList.length==0&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(t.style);)e.style.removeProperty(i[1])}n.style&&(e.style.cssText+=n.style)}}function hV(e,t,n){return pV(e,e,bc,lR(t,n,e.nodeType!=1))}function fR(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function mV(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class COe{constructor(t,n){this.lock=n,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=AOe(t.node.content,t)}destroyBetween(t,n){if(t!=n){for(let r=t;r<n;r++)this.top.children[r].destroy();this.top.children.splice(t,n-t),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(t,n,r){let i=0,o=this.stack.length>>1,a=Math.min(o,t.length);for(;i<a&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(t[i])&&t[i].type.spec.spanning!==!1;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=Ri,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++)if(this.top.children[s].matchesMark(t[o])){u=s;break}if(u>-1)u>this.index&&(this.changed=!0,this.destroyBetween(this.index,u)),this.top=this.top.children[this.index];else{let s=gc.create(this.top,t[o],n,r);this.top.children.splice(this.index,0,s),this.top=s,this.changed=!0}this.index=0,o++}}findNodeMatch(t,n,r,i){let o=-1,a;if(i>=this.preMatch.index&&(a=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&a.matchesNode(t,n,r))o=this.top.children.indexOf(a,this.index);else for(let u=this.index,s=Math.min(this.top.children.length,u+5);u<s;u++){let c=this.top.children[u];if(c.matchesNode(t,n,r)&&!this.preMatch.matched.has(c)){o=u;break}}return o<0?!1:(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(t,n,r,i,o){let a=this.top.children[i];return a.dirty==ho&&a.dom==a.contentDOM&&(a.dirty=Bf),a.update(t,n,r,o)?(this.destroyBetween(this.index,i),this.index=i+1,!0):!1}findIndexWithChild(t){for(;;){let n=t.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=t.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}t=n}}updateNextNode(t,n,r,i,o){for(let a=this.index;a<this.top.children.length;a++){let u=this.top.children[a];if(u instanceof yc){let s=this.preMatch.matched.get(u);if(s!=null&&s!=o)return!1;let c=u.dom;if(!(this.lock&&(c==this.lock||c.nodeType==1&&c.contains(this.lock.parentNode))&&!(t.isText&&u.node&&u.node.isText&&u.nodeDOM.nodeValue==t.text&&u.dirty!=ho&&fR(n,u.outerDeco)))&&u.update(t,n,r,i))return this.destroyBetween(this.index,a),u.dom!=c&&(this.changed=!0),this.index++,!0;break}}return!1}addNode(t,n,r,i,o){this.top.children.splice(this.index++,0,yc.create(this.top,t,n,r,i,o)),this.changed=!0}placeWidget(t,n,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(t)&&(t==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let o=new cV(this.top,t,n,r);this.top.children.splice(this.index++,0,o),this.changed=!0}}addTextblockHacks(){let t=this.top.children[this.index-1],n=this.top;for(;t instanceof gc;)n=t,t=n.children[n.children.length-1];(!t||!(t instanceof Nb)||/\n$/.test(t.node.text))&&((er||An)&&t&&t.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(t,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(t))this.index++;else{let r=document.createElement(t);t=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),t=="BR"&&(r.className="ProseMirror-trailingBreak");let i=new fV(this.top,[],r,null);n!=this.top?n.children.push(i):n.children.splice(this.index++,0,i),this.changed=!0}}}function AOe(e,t){let n=t,r=n.children.length,i=e.childCount,o=new Map,a=[];e:for(;i>0;){let u;for(;;)if(r){let c=n.children[r-1];if(c instanceof gc)n=c,r=c.children.length;else{u=c,r--;break}}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let s=u.node;if(!!s){if(s!=e.child(i-1))break;--i,o.set(u,i),a.push(u)}}return{index:i,matched:o,matches:a.reverse()}}function kOe(e,t){return e.type.side-t.type.side}function WOe(e,t,n,r){let i=t.locals(e),o=0;if(i.length==0){for(let c=0;c<e.childCount;c++){let l=e.child(c);r(l,i,t.forChild(o,l),c),o+=l.nodeSize}return}let a=0,u=[],s=null;for(let c=0;;){if(a<i.length&&i[a].to==o){let h=i[a++],v;for(;a<i.length&&i[a].to==o;)(v||(v=[h])).push(i[a++]);if(v){v.sort(kOe);for(let y=0;y<v.length;y++)n(v[y],c,!!s)}else n(h,c,!!s)}let l,f;if(s)f=-1,l=s,s=null;else if(c<e.childCount)f=c,l=e.child(c++);else break;for(let h=0;h<u.length;h++)u[h].to<=o&&u.splice(h--,1);for(;a<i.length&&i[a].from<=o&&i[a].to>o;)u.push(i[a++]);let d=o+l.nodeSize;if(l.isText){let h=d;a<i.length&&i[a].from<h&&(h=i[a].from);for(let v=0;v<u.length;v++)u[v].to<h&&(h=u[v].to);h<d&&(s=l.cut(h-o),l=l.cut(0,h-o),d=h,f=-1)}let p=l.isInline&&!l.isLeaf?u.filter(h=>!h.inline):u.slice();r(l,p,t.forChild(o,l),f),o=d}}function NOe(e){if(e.nodeName=="UL"||e.nodeName=="OL"){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}function POe(e,t){for(;;){if(e.nodeType==3)return e;if(e.nodeType==1&&t>0){if(e.childNodes.length>t&&e.childNodes[t].nodeType==3)return e.childNodes[t];e=e.childNodes[t-1],t=po(e)}else if(e.nodeType==1&&t<e.childNodes.length)e=e.childNodes[t],t=0;else return null}}function FOe(e,t,n,r){for(let i=0,o=0;i<e.childCount&&o<=r;){let a=e.child(i++),u=o;if(o+=a.nodeSize,!a.isText)continue;let s=a.text;for(;i<e.childCount;){let c=e.child(i++);if(o+=c.nodeSize,!c.isText)break;s+=c.text}if(o>=n){let c=u<r?s.lastIndexOf(t,r-u-1):-1;if(c>=0&&c+t.length+u>=n)return u+c;if(n==r&&s.length>=r+t.length-u&&s.slice(r-u,r-u+t.length)==t)return r}}return-1}function dR(e,t,n,r,i){let o=[];for(let a=0,u=0;a<e.length;a++){let s=e[a],c=u,l=u+=s.size;c>=n||l<=t?o.push(s):(c<t&&o.push(s.slice(0,t-c,r)),i&&(o.push(i),i=void 0),l>n&&o.push(s.slice(n-c,s.size,r)))}return o}function vV(e,t=null){let n=e.domSelection(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),o=i&&i.size==0,a=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(a<0)return null;let u=r.resolve(a),s,c;if(uR(n)){for(s=u;i&&!i.node;)i=i.parent;let l=i.node;if(i&&l.isAtom&&ve.isSelectable(l)&&i.parent&&!(l.isInline&&fOe(n.focusNode,n.focusOffset,i.dom))){let f=i.posBefore;c=new ve(a==f?u:r.resolve(f))}}else{let l=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null;s=r.resolve(l)}if(!c){let l=t=="pointer"||e.state.selection.head<u.pos&&!o?1:-1;c=hR(e,s,u,l)}return c}function gV(e){return e.editable?e.hasFocus():IV(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Pu(e,t=!1){let n=e.state.selection;if(_V(e,n),!!gV(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&An){let r=e.domSelection(),i=e.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&Fh(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)LOe(e);else{let{anchor:r,head:i}=n,o,a;yV&&!(n instanceof Ae)&&(n.$from.parent.inlineContent||(o=bV(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(a=bV(e,n.to))),e.docView.setSelection(r,i,e.root,t),yV&&(o&&$V(o),a&&$V(a)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&DOe(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const yV=er||An&&sOe<63;function bV(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(er&&i&&i.contentEditable=="false")return pR(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return pR(i);if(o)return pR(o)}}function pR(e){return e.contentEditable="true",er&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function $V(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function DOe(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelection(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!gV(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function LOe(e){let t=e.domSelection(),n=document.createRange(),r=e.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setEnd(r.parentNode,_r(r)+1):n.setEnd(r,0),n.collapse(!1),t.removeAllRanges(),t.addRange(n),!i&&!e.state.selection.visible&&$r&&ku<=11&&(r.disabled=!0,r.disabled=!1)}function _V(e,t){if(t instanceof ve){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(SV(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else SV(e)}function SV(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function hR(e,t,n,r){return e.someProp("createSelectionBetween",i=>i(e,t,n))||Ae.between(t,n,r)}function TV(e){return e.editable&&e.root.activeElement!=e.dom?!1:IV(e)}function IV(e){let t=e.domSelection();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function jOe(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelection();return Fh(t.node,t.offset,n.anchorNode,n.anchorOffset)}function mR(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return o&&Fe.findFrom(o,t)}function $c(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function OV(e,t,n){let r=e.state.selection;if(r instanceof Ae){if(!r.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){let i=mR(e.state,t);return i&&i instanceof ve?$c(e,i):!1}else if(!(Vr&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter,a;if(!o||o.isText)return!1;let u=t<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(a=e.docView.descAt(u))&&!a.contentDOM?ve.isSelectable(o)?$c(e,new ve(t<0?e.state.doc.resolve(i.pos-o.nodeSize):i)):Wb?$c(e,new Ae(e.state.doc.resolve(t<0?u:u+o.nodeSize))):!1:!1}}else{if(r instanceof ve&&r.node.isInline)return $c(e,new Ae(t>0?r.$to:r.$from));{let i=mR(e.state,t);return i?$c(e,i):!1}}}function Pb(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Uh(e){let t=e.pmViewDesc;return t&&t.size==0&&(e.nextSibling||e.nodeName!="BR")}function vR(e){let t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,a=!1;for(lo&&n.nodeType==1&&r<Pb(n)&&Uh(n.childNodes[r])&&(a=!0);;)if(r>0){if(n.nodeType!=1)break;{let u=n.childNodes[r-1];if(Uh(u))i=n,o=--r;else if(u.nodeType==3)n=u,r=n.nodeValue.length;else break}}else{if(wV(n))break;{let u=n.previousSibling;for(;u&&Uh(u);)i=n.parentNode,o=_r(u),u=u.previousSibling;if(u)n=u,r=Pb(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}a?yR(e,t,n,r):i&&yR(e,t,i,o)}function gR(e){let t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=Pb(n),o,a;for(;;)if(r<i){if(n.nodeType!=1)break;let u=n.childNodes[r];if(Uh(u))o=n,a=++r;else break}else{if(wV(n))break;{let u=n.nextSibling;for(;u&&Uh(u);)o=u.parentNode,a=_r(u)+1,u=u.nextSibling;if(u)n=u,r=0,i=Pb(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}}o&&yR(e,t,o,a)}function wV(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function yR(e,t,n,r){if(uR(t)){let o=document.createRange();o.setEnd(n,r),o.setStart(n,r),t.removeAllRanges(),t.addRange(o)}else t.extend&&t.extend(n,r);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&Pu(e)},50)}function EV(e,t,n){let r=e.state.selection;if(r instanceof Ae&&!r.empty||n.indexOf("s")>-1||Vr&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let a=mR(e.state,t);if(a&&a instanceof ve)return $c(e,a)}if(!i.parent.inlineContent){let a=t<0?i:o,u=r instanceof Ei?Fe.near(a,t):Fe.findFrom(a,t);return u?$c(e,u):!1}return!1}function RV(e,t){if(!(e.state.selection instanceof Ae))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let o=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let a=e.state.tr;return t<0?a.delete(n.pos-o.nodeSize,n.pos):a.delete(n.pos,n.pos+o.nodeSize),e.dispatch(a),!0}return!1}function MV(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function UOe(e){if(!er||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelection();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable=="false"){let r=t.firstChild;MV(e,r,"true"),setTimeout(()=>MV(e,r,"false"),20)}return!1}function BOe(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function zOe(e,t){let n=t.keyCode,r=BOe(t);return n==8||Vr&&n==72&&r=="c"?RV(e,-1)||vR(e):n==46||Vr&&n==68&&r=="c"?RV(e,1)||gR(e):n==13||n==27?!0:n==37||Vr&&n==66&&r=="c"?OV(e,-1,r)||vR(e):n==39||Vr&&n==70&&r=="c"?OV(e,1,r)||gR(e):n==38||Vr&&n==80&&r=="c"?EV(e,-1,r)||vR(e):n==40||Vr&&n==78&&r=="c"?UOe(e)||EV(e,1,r)||gR(e):r==(Vr?"m":"c")&&(n==66||n==73||n==89||n==90)}function xV(e,t){let n=[],{content:r,openStart:i,openEnd:o}=t;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let p=r.firstChild;n.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let a=e.someProp("clipboardSerializer")||so.fromSchema(e.state.schema),u=DV(),s=u.createElement("div");s.appendChild(a.serializeFragment(r,{document:u}));let c=s.firstChild,l,f=0;for(;c&&c.nodeType==1&&(l=PV[c.nodeName.toLowerCase()]);){for(let p=l.length-1;p>=0;p--){let h=u.createElement(l[p]);for(;s.firstChild;)h.appendChild(s.firstChild);s.appendChild(h),f++}c=s.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${i} ${o}${f?` -${f}`:""} ${JSON.stringify(n)}`);let d=e.someProp("clipboardTextSerializer",p=>p(t))||t.content.textBetween(0,t.content.size,`
31
+ Check the top-level render call using <`+Q+">.")}return K}}function ld($,K){{if(!$._store||$._store.validated||$.key!=null)return;$._store.validated=!0;var Q=WM(K);if(Na[Q])return;Na[Q]=!0;var $e="";$&&$._owner&&$._owner!==it.current&&($e=" It was passed a child from "+O($._owner.type)+"."),Mr($),w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',Q,$e),Mr(null)}}function Wc($,K){{if(typeof $!="object")return;if(Ni($))for(var Q=0;Q<$.length;Q++){var $e=$[Q];Fi($e)&&ld($e,K)}else if(Fi($))$._store&&($._store.validated=!0);else if($){var Ve=y($);if(typeof Ve=="function"&&Ve!==$.entries)for(var nt=Ve.call($),Le;!(Le=nt.next()).done;)Fi(Le.value)&&ld(Le.value,K)}}}function AAe($){{var K=$.type;if(K==null||typeof K=="string")return;var Q;if(typeof K=="function")Q=K.propTypes;else if(typeof K=="object"&&(K.$$typeof===s||K.$$typeof===f))Q=K.propTypes;else return;if(Q){var $e=O(K);ir(Q,$.props,"prop",$e,$)}else if(K.PropTypes!==void 0&&!ud){ud=!0;var Ve=O(K);w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Ve||"Unknown")}typeof K.getDefaultProps=="function"&&!K.getDefaultProps.isReactClassApproved&&w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function kAe($){{for(var K=Object.keys($.props),Q=0;Q<K.length;Q++){var $e=K[Q];if($e!=="children"&&$e!=="key"){Mr($),w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",$e),Mr(null);break}}$.ref!==null&&(Mr($),w("Invalid attribute `ref` supplied to `React.Fragment`."),Mr(null))}}function k5($,K,Q,$e,Ve,nt){{var Le=q($);if(!Le){var ke="";($===void 0||typeof $=="object"&&$!==null&&Object.keys($).length===0)&&(ke+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Pn=cd(Ve);Pn?ke+=Pn:ke+=sd();var Mt;$===null?Mt="null":Ni($)?Mt="array":$!==void 0&&$.$$typeof===t?(Mt="<"+(O($.type)||"Unknown")+" />",ke=" Did you accidentally export a JSX literal instead of a component?"):Mt=typeof $,w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Mt,ke)}var kt=_e($,K,Q,Ve,nt);if(kt==null)return kt;if(Le){var ei=K.children;if(ei!==void 0)if($e)if(Ni(ei)){for(var fd=0;fd<ei.length;fd++)Wc(ei[fd],$);Object.freeze&&Object.freeze(ei)}else w("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Wc(ei,$)}return $===r?kAe(kt):AAe(kt),kt}}function WAe($,K,Q){return k5($,K,Q,!0)}function NAe($,K,Q){return k5($,K,Q,!1)}var PAe=NAe,FAe=WAe;Oh.Fragment=r,Oh.jsx=PAe,Oh.jsxs=FAe}()),Oh}(function(e){process.env.NODE_ENV==="production"?e.exports=wTe():e.exports=ETe()})(hb);const If=hb.exports.Fragment,A=hb.exports.jsx,Ue=hb.exports.jsxs,RTe=({content:e,field:t,id:n,onContentChange:r,readOnly:i})=>{var a,u,s;const o=(s=(u=e==null?void 0:e.value)!=null?u:(a=t.config)==null?void 0:a.default_value)!=null?s:!1;return Ue(P.Field,{children:[A(P.FieldIcon,{children:A(P.Icon,{name:"toggleOff"})}),A(P.FieldLabel,{htmlFor:n,children:lc(t)}),Ue(P.FieldControl,{children:[A(P.Text,{children:pb(t,o)}),A(P.Switch,{checked:o,id:n,onCheckedChange:c=>{i||r(MTe(c))}})]})]})};function MTe(e){return{__TYPE__:"BooleanContent",value:e}}const wh="__MAIN_THUMBNAIL__";function V2(e,t,n){var o,a,u,s;const r=e.name===wh?void 0:e.name;let i;return t?va(n)?i=[n.width,n.height]:va(e.width)||va(e.height)?i=[(o=e.width)!=null?o:void 0,(a=e.height)!=null?a:void 0]:i=[t.origin.width,t.origin.height]:i=void 0,[r,i?`${(u=i[0])!=null?u:"auto"}x${(s=i[1])!=null?s:"auto"}px`:void 0]}function xTe(e){var t,n,r;return[{...(t=e.config)==null?void 0:t.constraint,name:wh}].concat((r=(n=e.config)==null?void 0:n.thumbnails)!=null?r:[])}function CTe(e,t){var a,u;const{__TYPE__:n,thumbnails:r,...i}=t,o=(u=(a=e.config)==null?void 0:a.thumbnails)==null?void 0:u.map(({name:s})=>r==null?void 0:r[s]);return[i,...o!=null?o:[]]}function ATe(e,t,n,r){const i=r.length===0?void 0:r;return e===wh?{...t,alt:i}:{...t,thumbnails:{...t.thumbnails,[e]:{...n,alt:i}}}}function H2(e,t){const{width:n,height:r}=t!=null?t:{};return n&&r?[n,r]:n?[n,Math.round(e.height*(n/e.width))]:r?[Math.round(e.width*(r/e.height)),r]:[e.width,e.height]}function J2(e,t,n,r,i){const o=new URL(e);if(i){const{x:a,y:u,width:s,height:c}=t;o.searchParams.set("rect",[a,u,s,c].join(",")),o.searchParams.set("w",n.toString()),o.searchParams.set("h",r.toString())}return o.toString()}function G2(e){const t=new URL(e);return t.searchParams.delete("q"),t.searchParams.set("w","800"),t.searchParams.set("h","800"),t.searchParams.set("auto","compress,format"),t.searchParams.set("fit","max"),t.toString()}function kTe(e){const t=new URL(e);return t.searchParams.delete("q"),t.searchParams.delete("fm"),t.searchParams.set("w","300"),t.searchParams.set("auto","compress,format"),t.toString()}const Y2=({contentView:e,constraints:t,croppedImage:n})=>{const[r,i]=H2(e.origin,t),o=J2(e.origin.url,n,r,i,!0);return{...e,width:r,height:i,url:o,edit:{...e.edit,zoom:n.zoom,crop:{x:n.x,y:n.y}}}},WTe=({field:e,content:t,thumbnail:n,croppedImage:r})=>{var u,s,c,l;if(n===wh)return{...t,...Y2({contentView:t,constraints:(u=e.config)==null?void 0:u.constraint,croppedImage:r})};const i=(c=(s=e.config)==null?void 0:s.thumbnails)==null?void 0:c.find(f=>f.name===n),o=(l=t.thumbnails)==null?void 0:l[n];if(!i||!o)return t;const a=Y2({contentView:o,constraints:i,croppedImage:r});return{...t,thumbnails:{...t.thumbnails,[n]:a}}},NTe=({initialSize:e,constraints:t})=>{const n=(t==null?void 0:t.width)&&(t==null?void 0:t.height)?t.width/t.height:e.width/e.height,[r,i]=e.width<e.height?[e.width,Math.round(e.width/n)]:[Math.round(e.height*n),e.height],o=Math.max(r/e.width,i/e.height,1);return{width:Math.round(r/o),height:Math.round(i/o)}},PTe=({contentView:e,constraints:t})=>{var a;const n=NTe({initialSize:e.origin,constraints:t}),r=(a=e.edit.zoom)!=null?a:1,i=Math.round(n.width/r),o=Math.round(n.height/r);return{...e.edit.crop,width:i,height:o,zoom:r}};function FTe(e,t){const n={};for(const r in e)n[r]=t(e[r],r);return n}function DTe(e,t,n,r){var a,u,s,c,l,f;if(!n){const d=(a=t.config)==null?void 0:a.thumbnails,p=d&&Object.fromEntries(d.map(h=>[h.name,mb(r,h)]));return{__TYPE__:"ImageContent",...mb(r,(u=t.config)==null?void 0:u.constraint),thumbnails:p}}if(e===wh)return{...n,...mb(r,(s=t.config)==null?void 0:s.constraint)};const i=(l=(c=t.config)==null?void 0:c.thumbnails)==null?void 0:l.find(d=>d.name===e);if(!i)return n;const o=mb(r,i);return{...n,thumbnails:FTe((f=n.thumbnails)!=null?f:{},(d,p)=>p===e?o:d)}}function mb(e,t){const{width:n,height:r,rect:i}=LTe(e,t),o=Boolean((t==null?void 0:t.width)||(t==null?void 0:t.height));return{url:J2(e.url,i,n,r,o),origin:{id:e.id,url:e.url,width:e.width,height:e.height},width:n,height:r,edit:{background:"transparent",zoom:1,crop:{x:i.x,y:i.y}}}}function LTe(e,t){const[n,r]=H2(e,t),i=Math.max(n/e.width,r/e.height),o=Math.round((e.width-n/i)/2),a=Math.round((e.height-r/i)/2),u=Math.round(n/i),s=Math.round(r/i);return{width:n,height:r,rect:{x:o,y:a,width:u,height:s}}}const Z2={x:0,y:0,width:0,height:0,zoom:1},jTe=({selectedImage:{thumbnail:e,contentView:t}})=>e.width&&e.height?e.width/e.height:t?t.origin.width/t.origin.height:1,UTe=({trigger:e,initialImages:t,initialOption:n,onClose:r})=>{var T,k,E,H,q,x;const[i,o]=ye.useState({}),[a,u]=ye.useState({}),[s,c]=ye.useState(!1),[l,f]=ye.useState(!1),[d,p]=ye.useState(n),h=t[d],v=J=>{var C;if(!h)return;const O=h.thumbnail.name,R=(C=i[O])!=null?C:Z2;o({...i,[O]:{...R,zoom:J}})},y=J=>{var C;if(!h)return;const O=h.thumbnail.name,R=(C=i[O])!=null?C:Z2;o({...i,[O]:{...R,...J}})},b=J=>{if(!h)return;const O=h.thumbnail.name,R=a[O];u({...a,[O]:{...R,crop:J}})},w=J=>{var C;if(!h)return;const O=h.thumbnail.name,R=(C=a[O])!=null?C:{};u({...a,[O]:{...R,aspectRatio:J}})},F=i[(T=h==null?void 0:h.thumbnail.name)!=null?T:""],g=s?F!=null?F:(h==null?void 0:h.contentView)&&PTe({contentView:h.contentView,constraints:h.thumbnail}):void 0,I=a[(k=h==null?void 0:h.thumbnail.name)!=null?k:""];return Ue(P.Dialog,{open:s,onOpenChange:J=>{J?(p(n),o({}),u({})):(f(!1),r({option:d,croppedImages:i})),c(J)},children:[A(P.DialogTrigger,{children:e}),Ue(P.DialogContainer,{onReady:()=>f(!0),children:[Ue(P.DialogHeader,{children:[A(P.DialogHeaderIcon,{name:"photo"}),A(P.DialogHeaderTitle,{children:"Image editor"})]}),A(P.DialogMenu,{children:A(P.DialogOptions,{value:String(d),onValueChange:J=>p(Number(J)),children:t.map((J,O)=>{var R,C;return A(P.DialogOptionsItem,{value:String(O),icon:"photo",title:(R=J.labels[0])!=null?R:"Main",subtitle:(C=J.labels[1])!=null?C:""},J.thumbnail.name)})})}),h&&A(P.DialogContent,{children:l&&A(P.CropperControls,{image:(H=(E=h.contentView)==null?void 0:E.origin.url)!=null?H:"",crop:(q=I==null?void 0:I.crop)!=null?q:{x:0,y:0},onCropChange:b,zoom:(x=F==null?void 0:F.zoom)!=null?x:1,onZoomChange:v,aspectRatio:jTe({selectedImage:h,cropper:I}),onAspectRatioChange:w,initialCroppedArea:g,onCropAreaChange:y},h.thumbnail.name)})]})]})};function BTe(e){const t=ae.useRef(e);return ae.useEffect(()=>{t.current=e}),ae.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function zTe(){const[e,t]=ae.useState({});return ae.useCallback(()=>()=>t({}),[])}function qTe(e,t,n){ae.useEffect(()=>{const r=setTimeout(()=>n(e),t);return()=>clearTimeout(r)},[e])}var Je;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const o={};for(const a of i)o[a]=a;return o},e.getValidEnumValues=i=>{const o=e.objectKeys(i).filter(u=>typeof i[i[u]]!="number"),a={};for(const u of o)a[u]=i[u];return e.objectValues(a)},e.objectValues=i=>e.objectKeys(i).map(function(o){return i[o]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const o=[];for(const a in i)Object.prototype.hasOwnProperty.call(i,a)&&o.push(a);return o},e.find=(i,o)=>{for(const a of i)if(o(a))return a},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}e.joinValues=r,e.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(Je||(Je={}));const oe=Je.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),fc=e=>{switch(typeof e){case"undefined":return oe.undefined;case"string":return oe.string;case"number":return isNaN(e)?oe.nan:oe.number;case"boolean":return oe.boolean;case"function":return oe.function;case"bigint":return oe.bigint;case"object":return Array.isArray(e)?oe.array:e===null?oe.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?oe.promise:typeof Map<"u"&&e instanceof Map?oe.map:typeof Set<"u"&&e instanceof Set?oe.set:typeof Date<"u"&&e instanceof Date?oe.date:oe.object;default:return oe.unknown}},te=Je.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of"]);class Su extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(o){return o.message},r={_errors:[]},i=o=>{for(const a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let u=r,s=0;for(;s<a.path.length;){const c=a.path[s];s===a.path.length-1?(u[c]=u[c]||{_errors:[]},u[c]._errors.push(n(a))):u[c]=u[c]||{_errors:[]},u=u[c],s++}}};return i(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,Je.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Su.create=e=>new Su(e);const vb=(e,t)=>{let n;switch(e.code){case te.invalid_type:e.received===oe.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case te.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Je.jsonStringifyReplacer)}`;break;case te.unrecognized_keys:n=`Unrecognized key(s) in object: ${Je.joinValues(e.keys,", ")}`;break;case te.invalid_union:n="Invalid input";break;case te.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Je.joinValues(e.options)}`;break;case te.invalid_enum_value:n=`Invalid enum value. Expected ${Je.joinValues(e.options)}, received '${e.received}'`;break;case te.invalid_arguments:n="Invalid function arguments";break;case te.invalid_return_type:n="Invalid function return type";break;case te.invalid_date:n="Invalid date";break;case te.invalid_string:typeof e.validation=="object"?"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Je.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case te.too_small:e.type==="array"?n=`Array must contain ${e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be greater than ${e.inclusive?"or equal to ":""}${e.minimum}`:e.type==="date"?n=`Date must be greater than ${e.inclusive?"or equal to ":""}${new Date(e.minimum)}`:n="Invalid input";break;case te.too_big:e.type==="array"?n=`Array must contain ${e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be less than ${e.inclusive?"or equal to ":""}${e.maximum}`:e.type==="date"?n=`Date must be smaller than ${e.inclusive?"or equal to ":""}${new Date(e.maximum)}`:n="Invalid input";break;case te.custom:n="Invalid input";break;case te.invalid_intersection_types:n="Intersection results could not be merged";break;case te.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;default:n=t.defaultError,Je.assertNever(e)}return{message:n}};let KTe=vb;function bE(){return KTe}const $E=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,o=[...n,...i.path||[]],a={...i,path:o};let u="";const s=r.filter(c=>!!c).slice().reverse();for(const c of s)u=c(a,{data:t,defaultError:u}).message;return{...i,path:o,message:i.message||u}};function fe(e,t){const n=$E({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,bE(),vb].filter(r=>!!r)});e.common.issues.push(n)}class Zn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return we;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n)r.push({key:await i.key,value:await i.value});return Zn.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:o,value:a}=i;if(o.status==="aborted"||a.status==="aborted")return we;o.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),(typeof a.value<"u"||i.alwaysSet)&&(r[o.value]=a.value)}return{status:t.value,value:r}}}const we=Object.freeze({status:"aborted"}),Xn=e=>({status:"valid",value:e}),X2=e=>e.status==="aborted",Q2=e=>e.status==="dirty",_E=e=>e.status==="valid",eK=e=>typeof Promise!==void 0&&e instanceof Promise;var qe;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(qe||(qe={}));class oo{constructor(t,n,r,i){this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._path.concat(this._key)}}const tK=(e,t)=>{if(_E(t))return{success:!0,data:t.value};{if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");const n=new Su(e.common.issues);return{success:!1,error:n}}};function Ce(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(a,u)=>a.code!=="invalid_type"?{message:u.defaultError}:typeof u.data>"u"?{message:r!=null?r:u.defaultError}:{message:n!=null?n:u.defaultError},description:i}}class Be{constructor(t){this.spa=this.safeParseAsync,this.superRefine=this._refinement,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.default=this.default.bind(this),this.describe=this.describe.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return fc(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:fc(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Zn,ctx:{common:t.parent.common,data:t.data,parsedType:fc(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(eK(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:fc(t)},o=this._parseSync({data:t,path:i.path,parent:i});return tK(i,o)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:fc(t)},i=this._parse({data:t,path:[],parent:r}),o=await(eK(i)?i:Promise.resolve(i));return tK(r,o)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,o)=>{const a=t(i),u=()=>o.addIssue({code:te.custom,...r(i)});return typeof Promise<"u"&&a instanceof Promise?a.then(s=>s?!0:(u(),!1)):a?!0:(u(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new Iu({schema:this,typeName:Se.ZodEffects,effect:{type:"refinement",refinement:t}})}optional(){return ba.create(this)}nullable(){return Mf.create(this)}nullish(){return this.optional().nullable()}array(){return ga.create(this)}promise(){return Mh.create(this)}or(t){return gb.create([this,t])}and(t){return yb.create(this,t)}transform(t){return new Iu({schema:this,typeName:Se.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new iK({innerType:this,defaultValue:n,typeName:Se.ZodDefault})}brand(){return new YTe({typeName:Se.ZodBranded,type:this,...Ce(void 0)})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const VTe=/^c[^\s-]{8,}$/i,HTe=/^([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,JTe=/^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i;class dc extends Be{constructor(){super(...arguments),this._regex=(t,n,r)=>this.refinement(i=>t.test(i),{validation:n,code:te.invalid_string,...qe.errToObj(r)}),this.nonempty=t=>this.min(1,qe.errToObj(t)),this.trim=()=>new dc({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}_parse(t){if(this._getType(t)!==oe.string){const o=this._getOrReturnCtx(t);return fe(o,{code:te.invalid_type,expected:oe.string,received:o.parsedType}),we}const r=new Zn;let i;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(i=this._getOrReturnCtx(t,i),fe(i,{code:te.too_small,minimum:o.value,type:"string",inclusive:!0,message:o.message}),r.dirty());else if(o.kind==="max")t.data.length>o.value&&(i=this._getOrReturnCtx(t,i),fe(i,{code:te.too_big,maximum:o.value,type:"string",inclusive:!0,message:o.message}),r.dirty());else if(o.kind==="email")JTe.test(t.data)||(i=this._getOrReturnCtx(t,i),fe(i,{validation:"email",code:te.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")HTe.test(t.data)||(i=this._getOrReturnCtx(t,i),fe(i,{validation:"uuid",code:te.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")VTe.test(t.data)||(i=this._getOrReturnCtx(t,i),fe(i,{validation:"cuid",code:te.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),fe(i,{validation:"url",code:te.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),fe(i,{validation:"regex",code:te.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="startsWith"?t.data.startsWith(o.value)||(i=this._getOrReturnCtx(t,i),fe(i,{code:te.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(i=this._getOrReturnCtx(t,i),fe(i,{code:te.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):Je.assertNever(o);return{status:r.value,value:t.data}}_addCheck(t){return new dc({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...qe.errToObj(t)})}url(t){return this._addCheck({kind:"url",...qe.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...qe.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...qe.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...qe.errToObj(n)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...qe.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...qe.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...qe.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...qe.errToObj(n)})}length(t,n){return this.min(t,n).max(t,n)}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}dc.create=e=>new dc({checks:[],typeName:Se.ZodString,...Ce(e)});function GTe(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,o=parseInt(e.toFixed(i).replace(".","")),a=parseInt(t.toFixed(i).replace(".",""));return o%a/Math.pow(10,i)}class Of extends Be{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._getType(t)!==oe.number){const o=this._getOrReturnCtx(t);return fe(o,{code:te.invalid_type,expected:oe.number,received:o.parsedType}),we}let r;const i=new Zn;for(const o of this._def.checks)o.kind==="int"?Je.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),fe(r,{code:te.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),fe(r,{code:te.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),fe(r,{code:te.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?GTe(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),fe(r,{code:te.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):Je.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,qe.toString(n))}gt(t,n){return this.setLimit("min",t,!1,qe.toString(n))}lte(t,n){return this.setLimit("max",t,!0,qe.toString(n))}lt(t,n){return this.setLimit("max",t,!1,qe.toString(n))}setLimit(t,n,r,i){return new Of({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:qe.toString(i)}]})}_addCheck(t){return new Of({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:qe.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:qe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:qe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:qe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:qe.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:qe.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int")}}Of.create=e=>new Of({checks:[],typeName:Se.ZodNumber,...Ce(e)});class SE extends Be{_parse(t){if(this._getType(t)!==oe.bigint){const r=this._getOrReturnCtx(t);return fe(r,{code:te.invalid_type,expected:oe.bigint,received:r.parsedType}),we}return Xn(t.data)}}SE.create=e=>new SE({typeName:Se.ZodBigInt,...Ce(e)});class TE extends Be{_parse(t){if(this._getType(t)!==oe.boolean){const r=this._getOrReturnCtx(t);return fe(r,{code:te.invalid_type,expected:oe.boolean,received:r.parsedType}),we}return Xn(t.data)}}TE.create=e=>new TE({typeName:Se.ZodBoolean,...Ce(e)});class Eh extends Be{_parse(t){if(this._getType(t)!==oe.date){const o=this._getOrReturnCtx(t);return fe(o,{code:te.invalid_type,expected:oe.date,received:o.parsedType}),we}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return fe(o,{code:te.invalid_date}),we}const r=new Zn;let i;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(i=this._getOrReturnCtx(t,i),fe(i,{code:te.too_small,message:o.message,inclusive:!0,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(i=this._getOrReturnCtx(t,i),fe(i,{code:te.too_big,message:o.message,inclusive:!0,maximum:o.value,type:"date"}),r.dirty()):Je.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Eh({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:qe.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:qe.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}Eh.create=e=>new Eh({checks:[],typeName:Se.ZodDate,...Ce(e)});class IE extends Be{_parse(t){if(this._getType(t)!==oe.undefined){const r=this._getOrReturnCtx(t);return fe(r,{code:te.invalid_type,expected:oe.undefined,received:r.parsedType}),we}return Xn(t.data)}}IE.create=e=>new IE({typeName:Se.ZodUndefined,...Ce(e)});class OE extends Be{_parse(t){if(this._getType(t)!==oe.null){const r=this._getOrReturnCtx(t);return fe(r,{code:te.invalid_type,expected:oe.null,received:r.parsedType}),we}return Xn(t.data)}}OE.create=e=>new OE({typeName:Se.ZodNull,...Ce(e)});class wE extends Be{constructor(){super(...arguments),this._any=!0}_parse(t){return Xn(t.data)}}wE.create=e=>new wE({typeName:Se.ZodAny,...Ce(e)});class wf extends Be{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Xn(t.data)}}wf.create=e=>new wf({typeName:Se.ZodUnknown,...Ce(e)});class Tu extends Be{_parse(t){const n=this._getOrReturnCtx(t);return fe(n,{code:te.invalid_type,expected:oe.never,received:n.parsedType}),we}}Tu.create=e=>new Tu({typeName:Se.ZodNever,...Ce(e)});class EE extends Be{_parse(t){if(this._getType(t)!==oe.undefined){const r=this._getOrReturnCtx(t);return fe(r,{code:te.invalid_type,expected:oe.void,received:r.parsedType}),we}return Xn(t.data)}}EE.create=e=>new EE({typeName:Se.ZodVoid,...Ce(e)});class ga extends Be{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==oe.array)return fe(n,{code:te.invalid_type,expected:oe.array,received:n.parsedType}),we;if(i.minLength!==null&&n.data.length<i.minLength.value&&(fe(n,{code:te.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(fe(n,{code:te.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all(n.data.map((a,u)=>i.type._parseAsync(new oo(n,a,n.path,u)))).then(a=>Zn.mergeArray(r,a));const o=n.data.map((a,u)=>i.type._parseSync(new oo(n,a,n.path,u)));return Zn.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new ga({...this._def,minLength:{value:t,message:qe.toString(n)}})}max(t,n){return new ga({...this._def,maxLength:{value:t,message:qe.toString(n)}})}length(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}ga.create=(e,t)=>new ga({type:e,minLength:null,maxLength:null,typeName:Se.ZodArray,...Ce(t)});var RE;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(RE||(RE={}));const nK=e=>t=>new gt({...e,shape:()=>({...e.shape(),...t})});function Ef(e){if(e instanceof gt){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=ba.create(Ef(r))}return new gt({...e._def,shape:()=>t})}else return e instanceof ga?ga.create(Ef(e.element)):e instanceof ba?ba.create(Ef(e.unwrap())):e instanceof Mf?Mf.create(Ef(e.unwrap())):e instanceof ya?ya.create(e.items.map(t=>Ef(t))):e}class gt extends Be{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=nK(this._def),this.extend=nK(this._def)}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Je.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==oe.object){const c=this._getOrReturnCtx(t);return fe(c,{code:te.invalid_type,expected:oe.object,received:c.parsedType}),we}const{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),u=[];if(!(this._def.catchall instanceof Tu&&this._def.unknownKeys==="strip"))for(const c in i.data)a.includes(c)||u.push(c);const s=[];for(const c of a){const l=o[c],f=i.data[c];s.push({key:{status:"valid",value:c},value:l._parse(new oo(i,f,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof Tu){const c=this._def.unknownKeys;if(c==="passthrough")for(const l of u)s.push({key:{status:"valid",value:l},value:{status:"valid",value:i.data[l]}});else if(c==="strict")u.length>0&&(fe(i,{code:te.unrecognized_keys,keys:u}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const l of u){const f=i.data[l];s.push({key:{status:"valid",value:l},value:c._parse(new oo(i,f,i.path,l)),alwaysSet:l in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const c=[];for(const l of s){const f=await l.key;c.push({key:f,value:await l.value,alwaysSet:l.alwaysSet})}return c}).then(c=>Zn.mergeObjectSync(r,c)):Zn.mergeObjectSync(r,s)}get shape(){return this._def.shape()}strict(t){return qe.errToObj,new gt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,o,a,u;const s=(a=(o=(i=this._def).errorMap)===null||o===void 0?void 0:o.call(i,n,r).message)!==null&&a!==void 0?a:r.defaultError;return n.code==="unrecognized_keys"?{message:(u=qe.errToObj(t).message)!==null&&u!==void 0?u:s}:{message:s}}}:{}})}strip(){return new gt({...this._def,unknownKeys:"strip"})}passthrough(){return new gt({...this._def,unknownKeys:"passthrough"})}setKey(t,n){return this.augment({[t]:n})}merge(t){return new gt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>RE.mergeShapes(this._def.shape(),t._def.shape()),typeName:Se.ZodObject})}catchall(t){return new gt({...this._def,catchall:t})}pick(t){const n={};return Je.objectKeys(t).map(r=>{this.shape[r]&&(n[r]=this.shape[r])}),new gt({...this._def,shape:()=>n})}omit(t){const n={};return Je.objectKeys(this.shape).map(r=>{Je.objectKeys(t).indexOf(r)===-1&&(n[r]=this.shape[r])}),new gt({...this._def,shape:()=>n})}deepPartial(){return Ef(this)}partial(t){const n={};if(t)return Je.objectKeys(this.shape).map(r=>{Je.objectKeys(t).indexOf(r)===-1?n[r]=this.shape[r]:n[r]=this.shape[r].optional()}),new gt({...this._def,shape:()=>n});for(const r in this.shape){const i=this.shape[r];n[r]=i.optional()}return new gt({...this._def,shape:()=>n})}required(){const t={};for(const n in this.shape){let i=this.shape[n];for(;i instanceof ba;)i=i._def.innerType;t[n]=i}return new gt({...this._def,shape:()=>t})}keyof(){return rK(Je.objectKeys(this.shape))}}gt.create=(e,t)=>new gt({shape:()=>e,unknownKeys:"strip",catchall:Tu.create(),typeName:Se.ZodObject,...Ce(t)}),gt.strictCreate=(e,t)=>new gt({shape:()=>e,unknownKeys:"strict",catchall:Tu.create(),typeName:Se.ZodObject,...Ce(t)}),gt.lazycreate=(e,t)=>new gt({shape:e,unknownKeys:"strip",catchall:Tu.create(),typeName:Se.ZodObject,...Ce(t)});class gb extends Be{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(o){for(const u of o)if(u.result.status==="valid")return u.result;for(const u of o)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;const a=o.map(u=>new Su(u.ctx.common.issues));return fe(n,{code:te.invalid_union,unionErrors:a}),we}if(n.common.async)return Promise.all(r.map(async o=>{const a={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(i);{let o;const a=[];for(const s of r){const c={...n,common:{...n.common,issues:[]},parent:null},l=s._parseSync({data:n.data,path:n.path,parent:c});if(l.status==="valid")return l;l.status==="dirty"&&!o&&(o={result:l,ctx:c}),c.common.issues.length&&a.push(c.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const u=a.map(s=>new Su(s));return fe(n,{code:te.invalid_union,unionErrors:u}),we}}get options(){return this._def.options}}gb.create=(e,t)=>new gb({options:e,typeName:Se.ZodUnion,...Ce(t)});class ME extends Be{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==oe.object)return fe(n,{code:te.invalid_type,expected:oe.object,received:n.parsedType}),we;const r=this.discriminator,i=n.data[r],o=this.options.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}):(fe(n,{code:te.invalid_union_discriminator,options:this.validDiscriminatorValues,path:[r]}),we)}get discriminator(){return this._def.discriminator}get validDiscriminatorValues(){return Array.from(this.options.keys())}get options(){return this._def.options}static create(t,n,r){const i=new Map;try{n.forEach(o=>{const a=o.shape[t].value;i.set(a,o)})}catch{throw new Error("The discriminator value could not be extracted from all the provided schemas")}if(i.size!==n.length)throw new Error("Some of the discriminator values are not unique");return new ME({typeName:Se.ZodDiscriminatedUnion,discriminator:t,options:i,...Ce(r)})}}function xE(e,t){const n=fc(e),r=fc(t);if(e===t)return{valid:!0,data:e};if(n===oe.object&&r===oe.object){const i=Je.objectKeys(t),o=Je.objectKeys(e).filter(u=>i.indexOf(u)!==-1),a={...e,...t};for(const u of o){const s=xE(e[u],t[u]);if(!s.valid)return{valid:!1};a[u]=s.data}return{valid:!0,data:a}}else if(n===oe.array&&r===oe.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let o=0;o<e.length;o++){const a=e[o],u=t[o],s=xE(a,u);if(!s.valid)return{valid:!1};i.push(s.data)}return{valid:!0,data:i}}else return n===oe.date&&r===oe.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class yb extends Be{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=(o,a)=>{if(X2(o)||X2(a))return we;const u=xE(o.value,a.value);return u.valid?((Q2(o)||Q2(a))&&n.dirty(),{status:n.value,value:u.data}):(fe(r,{code:te.invalid_intersection_types}),we)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,a])=>i(o,a)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}yb.create=(e,t,n)=>new yb({left:e,right:t,typeName:Se.ZodIntersection,...Ce(n)});class ya extends Be{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==oe.array)return fe(r,{code:te.invalid_type,expected:oe.array,received:r.parsedType}),we;if(r.data.length<this._def.items.length)return fe(r,{code:te.too_small,minimum:this._def.items.length,inclusive:!0,type:"array"}),we;!this._def.rest&&r.data.length>this._def.items.length&&(fe(r,{code:te.too_big,maximum:this._def.items.length,inclusive:!0,type:"array"}),n.dirty());const o=r.data.map((a,u)=>{const s=this._def.items[u]||this._def.rest;return s?s._parse(new oo(r,a,r.path,u)):null}).filter(a=>!!a);return r.common.async?Promise.all(o).then(a=>Zn.mergeArray(n,a)):Zn.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new ya({...this._def,rest:t})}}ya.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ya({items:e,typeName:Se.ZodTuple,rest:null,...Ce(t)})};class bb extends Be{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==oe.object)return fe(r,{code:te.invalid_type,expected:oe.object,received:r.parsedType}),we;const i=[],o=this._def.keyType,a=this._def.valueType;for(const u in r.data)i.push({key:o._parse(new oo(r,u,r.path,u)),value:a._parse(new oo(r,r.data[u],r.path,u))});return r.common.async?Zn.mergeObjectAsync(n,i):Zn.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Be?new bb({keyType:t,valueType:n,typeName:Se.ZodRecord,...Ce(r)}):new bb({keyType:dc.create(),valueType:t,typeName:Se.ZodRecord,...Ce(n)})}}class CE extends Be{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==oe.map)return fe(r,{code:te.invalid_type,expected:oe.map,received:r.parsedType}),we;const i=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([u,s],c)=>({key:i._parse(new oo(r,u,r.path,[c,"key"])),value:o._parse(new oo(r,s,r.path,[c,"value"]))}));if(r.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const s of a){const c=await s.key,l=await s.value;if(c.status==="aborted"||l.status==="aborted")return we;(c.status==="dirty"||l.status==="dirty")&&n.dirty(),u.set(c.value,l.value)}return{status:n.value,value:u}})}else{const u=new Map;for(const s of a){const c=s.key,l=s.value;if(c.status==="aborted"||l.status==="aborted")return we;(c.status==="dirty"||l.status==="dirty")&&n.dirty(),u.set(c.value,l.value)}return{status:n.value,value:u}}}}CE.create=(e,t,n)=>new CE({valueType:t,keyType:e,typeName:Se.ZodMap,...Ce(n)});class Rf extends Be{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==oe.set)return fe(r,{code:te.invalid_type,expected:oe.set,received:r.parsedType}),we;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(fe(r,{code:te.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(fe(r,{code:te.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,message:i.maxSize.message}),n.dirty());const o=this._def.valueType;function a(s){const c=new Set;for(const l of s){if(l.status==="aborted")return we;l.status==="dirty"&&n.dirty(),c.add(l.value)}return{status:n.value,value:c}}const u=[...r.data.values()].map((s,c)=>o._parse(new oo(r,s,r.path,c)));return r.common.async?Promise.all(u).then(s=>a(s)):a(u)}min(t,n){return new Rf({...this._def,minSize:{value:t,message:qe.toString(n)}})}max(t,n){return new Rf({...this._def,maxSize:{value:t,message:qe.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}Rf.create=(e,t)=>new Rf({valueType:e,minSize:null,maxSize:null,typeName:Se.ZodSet,...Ce(t)});class Rh extends Be{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==oe.function)return fe(n,{code:te.invalid_type,expected:oe.function,received:n.parsedType}),we;function r(u,s){return $E({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,bE(),vb].filter(c=>!!c),issueData:{code:te.invalid_arguments,argumentsError:s}})}function i(u,s){return $E({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,bE(),vb].filter(c=>!!c),issueData:{code:te.invalid_return_type,returnTypeError:s}})}const o={errorMap:n.common.contextualErrorMap},a=n.data;return this._def.returns instanceof Mh?Xn(async(...u)=>{const s=new Su([]),c=await this._def.args.parseAsync(u,o).catch(d=>{throw s.addIssue(r(u,d)),s}),l=await a(...c);return await this._def.returns._def.type.parseAsync(l,o).catch(d=>{throw s.addIssue(i(l,d)),s})}):Xn((...u)=>{const s=this._def.args.safeParse(u,o);if(!s.success)throw new Su([r(u,s.error)]);const c=a(...s.data),l=this._def.returns.safeParse(c,o);if(!l.success)throw new Su([i(c,l.error)]);return l.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Rh({...this._def,args:ya.create(t).rest(wf.create())})}returns(t){return new Rh({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new Rh({args:t||ya.create([]).rest(wf.create()),returns:n||wf.create(),typeName:Se.ZodFunction,...Ce(r)})}}class AE extends Be{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}AE.create=(e,t)=>new AE({getter:e,typeName:Se.ZodLazy,...Ce(t)});class kE extends Be{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return fe(n,{code:te.invalid_literal,expected:this._def.value}),we}return{status:"valid",value:t.data}}get value(){return this._def.value}}kE.create=(e,t)=>new kE({value:e,typeName:Se.ZodLiteral,...Ce(t)});function rK(e,t){return new WE({values:e,typeName:Se.ZodEnum,...Ce(t)})}class WE extends Be{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return fe(n,{expected:Je.joinValues(r),received:n.parsedType,code:te.invalid_type}),we}if(this._def.values.indexOf(t.data)===-1){const n=this._getOrReturnCtx(t),r=this._def.values;return fe(n,{received:n.data,code:te.invalid_enum_value,options:r}),we}return Xn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}}WE.create=rK;class NE extends Be{_parse(t){const n=Je.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==oe.string&&r.parsedType!==oe.number){const i=Je.objectValues(n);return fe(r,{expected:Je.joinValues(i),received:r.parsedType,code:te.invalid_type}),we}if(n.indexOf(t.data)===-1){const i=Je.objectValues(n);return fe(r,{received:r.data,code:te.invalid_enum_value,options:i}),we}return Xn(t.data)}get enum(){return this._def.values}}NE.create=(e,t)=>new NE({values:e,typeName:Se.ZodNativeEnum,...Ce(t)});class Mh extends Be{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==oe.promise&&n.common.async===!1)return fe(n,{code:te.invalid_type,expected:oe.promise,received:n.parsedType}),we;const r=n.parsedType===oe.promise?n.data:Promise.resolve(n.data);return Xn(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Mh.create=(e,t)=>new Mh({type:e,typeName:Se.ZodPromise,...Ce(t)});class Iu extends Be{innerType(){return this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null;if(i.type==="preprocess"){const a=i.transform(r.data);return r.common.async?Promise.resolve(a).then(u=>this._def.schema._parseAsync({data:u,path:r.path,parent:r})):this._def.schema._parseSync({data:a,path:r.path,parent:r})}const o={addIssue:a=>{fe(r,a),a.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="refinement"){const a=u=>{const s=i.refinement(u,o);if(r.common.async)return Promise.resolve(s);if(s instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(r.common.async===!1){const u=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return u.status==="aborted"?we:(u.status==="dirty"&&n.dirty(),a(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(u=>u.status==="aborted"?we:(u.status==="dirty"&&n.dirty(),a(u.value).then(()=>({status:n.value,value:u.value}))))}if(i.type==="transform")if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!_E(a))return a;const u=i.transform(a.value,o);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>_E(a)?Promise.resolve(i.transform(a.value,o)).then(u=>({status:n.value,value:u})):a);Je.assertNever(i)}}Iu.create=(e,t,n)=>new Iu({schema:e,typeName:Se.ZodEffects,effect:t,...Ce(n)}),Iu.createWithPreprocess=(e,t,n)=>new Iu({schema:t,effect:{type:"preprocess",transform:e},typeName:Se.ZodEffects,...Ce(n)});class ba extends Be{_parse(t){return this._getType(t)===oe.undefined?Xn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ba.create=(e,t)=>new ba({innerType:e,typeName:Se.ZodOptional,...Ce(t)});class Mf extends Be{_parse(t){return this._getType(t)===oe.null?Xn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Mf.create=(e,t)=>new Mf({innerType:e,typeName:Se.ZodNullable,...Ce(t)});class iK extends Be{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===oe.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}iK.create=(e,t)=>new ba({innerType:e,typeName:Se.ZodOptional,...Ce(t)});class PE extends Be{_parse(t){if(this._getType(t)!==oe.nan){const r=this._getOrReturnCtx(t);return fe(r,{code:te.invalid_type,expected:oe.nan,received:r.parsedType}),we}return{status:"valid",value:t.data}}}PE.create=e=>new PE({typeName:Se.ZodNaN,...Ce(e)});class YTe extends Be{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}gt.lazycreate;var Se;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded"})(Se||(Se={}));const FE=dc.create,oK=Of.create;PE.create,SE.create,TE.create,Eh.create,IE.create,OE.create,wE.create;const ZTe=wf.create;Tu.create,EE.create;const XTe=ga.create,DE=gt.create;gt.strictCreate,gb.create,ME.create,yb.create,ya.create,bb.create,CE.create,Rf.create,Rh.create,AE.create,kE.create,WE.create,NE.create,Mh.create,Iu.create,ba.create,Mf.create,Iu.createWithPreprocess;async function QTe(e,t){const{okType:n,errorType:r=eIe,signal:i,headers:o,body:a,timeout:u=1e4,...s}=t,c=new Headers(o);c.has("Content-Type")||c.set("Content-Type","application/json");const l=c.get("Content-Type")==="application/json"?JSON.stringify(a):a;let f=!1;try{const d=new AbortController,p=tIe([d.signal,i].filter(va));setTimeout(()=>{f=!0,d.abort()},u);const h=await fetch(e,{...s,body:l,headers:c,signal:p}),{status:v}=h,y=await h.json();if(h.ok){const b=n.safeParse(y);return b.success?{ok:!0,body:b.data}:{ok:!1,error:"validation",status:v,cause:b.error}}else{const b=r.safeParse(y);return b.success?{ok:!1,error:"http",status:v,body:b.data}:{ok:!1,error:"validation",status:v,cause:b.error}}}catch(d){return nIe(d)?{ok:!1,error:f?"timeout":"abort"}:{ok:!1,error:"unknown",cause:d}}}const eIe=ZTe();function tIe(e){const t=new AbortController;function n(){t.abort();for(const r of e)r.removeEventListener("abort",n)}for(const r of e){if(r.aborted){n();break}r.addEventListener("abort",n)}return t.signal}function nIe(e){return e instanceof DOMException&&e.name==="AbortError"}function rIe(e,t){iIe(e,t);const n=Ou.get(e,t);if(!n){const i=e(...t);throw Ou.set(e,t,{state:"fetching",promise:i}),aK(e,t,i).catch(o=>console.error(o)),i}if(n.state==="fetching")throw n.promise;const{result:r}=n;if(r.ok)return r.body;throw r}function iIe(e,t){const n=zTe();ae.useEffect(()=>{const r=Ou.getFetcherConfig(e).revalidationStrategy;if((r==null?void 0:r.type)==="never"||!(r!=null&&r.onFocus))return;function i(){if(document.visibilityState==="hidden")return;const o=Ou.get(e,t);if(!o||o.state!=="fetched")return;const a=e(...t);Ou.set(e,t,{state:"revalidating",promise:a,result:o.result}),aK(e,t,a).then(n).catch(u=>console.error(u))}return document.addEventListener("visibilitychange",i),()=>document.removeEventListener("visibilitychange",i)})}function aK(e,t,n){return n.then(r=>Ou.set(e,t,{state:"fetched",result:r})).catch(r=>Ou.set(e,t,{state:"fetched",result:{ok:!1,error:"unknown",cause:r}}))}const Ou=aIe(),oIe=Ou;function aIe(){const e=new Map,t=new Map,n={cacheCapacity:100,revalidationStrategy:{type:"swr",onFocus:!0}};function r(o){return o.join(`
32
+ `)}function i(o){var a;return(a=e.get(o))!=null?a:n}return{get(o,a){const u=r(a),s=t.get(o);if(!s||!s.has(u))return;const c=s.get(u);return s.delete(u),c!==void 0&&s.set(u,c),c},set(o,a,u){let s=t.get(o);s||(s=new Map,t.set(o,s));const c=i(o),l=r(a);s.size===c.cacheCapacity&&!s.has(l)&&s.delete(s.keys().next().value),s.set(l,u)},getFetcherConfig:i,registerFetcherConfig(o,a){e.set(o,a)},forgetAllErrors(){t.forEach(o=>o.forEach((a,u)=>{a.state==="fetched"&&!a.result.ok&&o.delete(u)}))}}}const uIe=DE({id:FE(),width:oK(),height:oK(),urls:DE({full:FE(),small:FE().transform(kTe)})}),sIe=DE({results:XTe(uIe)}).transform(e=>e.results);function uK(e,t){const n=new URLSearchParams({page:"1",per_page:"30",query:t});return QTe(`${e}/search/photos?${n.toString()}`,{okType:sIe})}oIe.registerFetcherConfig(uK,{cacheCapacity:5,revalidationStrategy:{type:"never"}});function cIe(e,t){return rIe(uK,[e,t])}const sK=e=>{const{trigger:t,onMediaSelected:n}=e,[r,i]=ae.useState(!1),[o,a]=ae.useState(""),[u,s]=ae.useState(o),[c,l]=ae.useTransition();return qTe(o,200,f=>l(()=>s(f))),Ue(P.Dialog,{open:r,onOpenChange:i,children:[A(P.DialogTrigger,{children:t}),Ue(P.DialogContainer,{children:[Ue(P.DialogHeader,{children:[A(P.DialogHeaderIcon,{name:"folder"}),A(P.DialogHeaderTitle,{children:"Add an image from Unsplash.com"})]}),Ue(P.DialogContent,{style:{gap:P.tokens.space[6]},children:[A("div",{style:{paddingInline:P.tokens.space[8]},children:A(P.SearchInput,{value:o,placeholder:"Search on Unsplash.com",onValueChange:a})}),A(dIe,{children:A(P.ErrorBoundary,{errorImageSrc:P.dialogErrorImage,title:"Request failed",description:"An error occurred while searching for your image.",style:{marginBlock:"auto"},children:A(ae.Suspense,{fallback:A(P.MasonrySkeleton,{}),children:A(lIe,{term:u,isUpdating:c,onMediaSelected:f=>{i(!1),n==null||n(f)}})})})})]})]})]})},lIe=e=>{const{term:t,isUpdating:n,onMediaSelected:r}=e,i=cIe("https://unsplash.wroom.io",t||"fruit"),o=fIe(n);return i.length?A(P.Masonry,{items:i,getItemInfo:pIe,style:o,children:a=>A(P.MasonryMedia,{url:a.urls.small,onClick:()=>r({id:a.id,url:a.urls.full,width:a.width,height:a.height})})}):Ue(P.BlankSlate,{style:{marginBlock:"auto",...o},children:[A(P.BlankSlateImage,{children:A("img",{src:P.dialogErrorImage,alt:"No results"})}),A(P.BlankSlateTitle,{size:"big",children:"Oh no ..."}),A(P.BlankSlateDescription,{children:"The search returned no result."})]})};function fIe(e){return{opacity:e?.4:1,transitionProperty:e?"opacity":"none",transitionDuration:P.tokens.transitionDuration.standard,transitionTimingFunction:P.tokens.transitionTimingFunction.easeInOut}}const dIe=({children:e})=>A(P.ScrollArea,{style:{blockSize:"100%",paddingInline:P.tokens.space[8],paddingBlockStart:P.tokens.space[2]},children:e});function pIe(e){return{key:e.id,aspectRatio:e.width/e.height}}const hIe=({content:e,field:t,id:n,onContentChange:r,readOnly:i})=>{const[o,a]=ae.useState(0),[u,s]=ae.useTransition(),c=mIe(t),l=c[o],f=e?CTe(t,e):void 0,d=f==null?void 0:f[o],p=lc(t),h=l?V2(l,e,d).filter(va):[],v=e&&!i?"visible":"hidden";function y(g){!l||s(()=>r(DTe(l.name,t,e,g)))}function b(g){s(()=>a(g))}const w=c.map((g,I)=>{const T=f==null?void 0:f[I];return{thumbnail:g,contentView:T,labels:V2(g,e,T)}}),F=({option:g,croppedImages:I})=>{a(g),e&&s(()=>r(Object.entries(I).reduce((T,[k,E])=>WTe({field:t,content:T,thumbnail:k,croppedImage:E}),e)))};return Ue(P.Card,{color:"grey2",variant:"dashed",children:[Ue(P.CardHeader,{children:[Ue(P.CardHeaderTitle,{children:[p,h.length>0?A(P.Text,{color:"grey11",component:"span",children:` \u2022 ${h.join(" \u2022 ")}`}):null]}),Ue(P.CardHeaderActions,{style:{visibility:v},children:[A(UTe,{trigger:A(P.Button,{startIcon:A(P.Icon,{name:"crop"}),children:"Crop & Resize"}),initialImages:w,initialOption:o,onClose:F}),A(sK,{trigger:A(P.Button,{startIcon:A(P.Icon,{name:"imageSearch"}),children:"Replace"}),onMediaSelected:y}),A(P.Button,{onClick:()=>{a(0),r(void 0)},startIcon:A(P.Icon,{name:"delete"}),children:"Clear"})]})]}),A(ae.Suspense,{fallback:A("div",{style:{blockSize:466}}),children:l&&e&&f?A(vIe,{allContentViews:f,content:e,contentView:d,id:n,onContentChange:r,onPageChange:b,page:o,readOnly:i,thumbnailName:l.name,isUpdating:u}):A(gIe,{onMediaSelected:y,readOnly:i,isUpdating:u})})]})};function mIe(e){return ae.useMemo(()=>xTe(e),[e])}const vIe=({allContentViews:e,content:t,contentView:n,id:r,onContentChange:i,onPageChange:o,page:a,readOnly:u,thumbnailName:s,isUpdating:c})=>{var l;return Ue(P.CardContent,{children:[A(P.Carousel,{getItemSource:yIe,items:e,onPageChange:o,page:a,style:{blockSize:400},children:f=>{var d;return f!=null&&f.url?A(P.CarouselItem,{src:G2(f.url),alt:(d=f.alt)!=null?d:void 0,isUpdating:c},`${s}_${f.url}`):null}}),Ue(P.Field,{labelPosition:"side",children:[A(P.FieldLabel,{htmlFor:r,children:"Alt text"}),A(P.FieldControl,{children:A(P.TextInput,{id:r,onValueChange:f=>{n&&i(ATe(s,t,n,f))},placeholder:"Short description for the visually impaired",readOnly:u||!n,value:(l=n==null?void 0:n.alt)!=null?l:""})})]})]})},gIe=({onMediaSelected:e,readOnly:t,isUpdating:n})=>A(P.CardContent,{children:A(P.Card,{color:"grey3",variant:"outlined",children:A(P.CardContent,{style:{paddingBlock:parseFloat(P.tokens.space[10])},children:Ue(P.BlankSlate,{children:[A(P.BlankSlateIcon,{name:"cloudUpload"}),A(P.BlankSlateTitle,{children:n?"Preparing your image...":"You haven't selected an image"}),t?null:A(P.BlankSlateActions,{children:A(sK,{trigger:A(P.Button,{disabled:n,children:"Select image"}),onMediaSelected:e})})]})})})});function yIe(e){return e!=null&&e.url?G2(e.url):void 0}const bIe=({content:e,field:t,id:n,onContentChange:r,readOnly:i})=>{var o;return Ue(P.Field,{children:[A(P.FieldIcon,{children:A(P.Icon,{name:"notes"})}),A(P.FieldLabel,{htmlFor:n,children:lc(t)}),A(P.FieldControl,{children:A(P.TextArea,{id:n,onChange:a=>{r($Ie(a.target.value))},placeholder:pb(t),readOnly:i,value:(o=e==null?void 0:e.value)!=null?o:""})})]})};function $Ie(e){return e.length===0?void 0:{__TYPE__:"FieldContent",type:"Text",value:e}}const _Ie=({content:e,field:t,id:n,onContentChange:r,readOnly:i})=>{var u,s;const o=Number(e==null?void 0:e.value),a=Number.isFinite(o)?o:void 0;return Ue(P.Field,{children:[A(P.FieldIcon,{children:A(P.Icon,{name:"pin"})}),A(P.FieldLabel,{htmlFor:n,children:lc(t)}),A(P.FieldControl,{children:A(P.NumberInput,{id:n,value:a,min:(u=t.config)==null?void 0:u.min,max:(s=t.config)==null?void 0:s.max,placeholder:pb(t),readOnly:i,onValueChange:c=>r(SIe(c))})})]})};function SIe(e){return e===void 0?void 0:{__TYPE__:"FieldContent",type:"Number",value:String(e)}}function cn(e){this.content=e}cn.prototype={constructor:cn,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),o=r.content.slice();return i==-1?o.push(n||e,t):(o[i+1]=t,n&&(o[i]=n)),new cn(o)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new cn(n)},addToStart:function(e,t){return new cn([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new cn(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),o=r.find(e);return i.splice(o==-1?i.length:o,0,t,n),new cn(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=cn.from(e),e.size?new cn(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=cn.from(e),e.size?new cn(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=cn.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},get size(){return this.content.length>>1}},cn.from=function(e){if(e instanceof cn)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new cn(t)};function cK(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),o=t.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let a=0;i.text[a]==o.text[a];a++)n++;return n}if(i.content.size||o.content.size){let a=cK(i.content,o.content,n+1);if(a!=null)return a}n+=i.nodeSize}}function lK(e,t,n,r){for(let i=e.childCount,o=t.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let a=e.child(--i),u=t.child(--o),s=a.nodeSize;if(a==u){n-=s,r-=s;continue}if(!a.sameMarkup(u))return{a:n,b:r};if(a.isText&&a.text!=u.text){let c=0,l=Math.min(a.text.length,u.text.length);for(;c<l&&a.text[a.text.length-c-1]==u.text[u.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(a.content.size||u.content.size){let c=lK(a.content,u.content,n-1,r-1);if(c)return c}n-=s,r-=s}}class V{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let r=0;r<t.length;r++)this.size+=t[r].nodeSize}nodesBetween(t,n,r,i=0,o){for(let a=0,u=0;u<n;a++){let s=this.content[a],c=u+s.nodeSize;if(c>t&&r(s,i+u,o||null,a)!==!1&&s.content.size){let l=u+1;s.nodesBetween(Math.max(0,t-l),Math.min(s.content.size,n-l),r,i+l)}u=c}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,r,i){let o="",a=!0;return this.nodesBetween(t,n,(u,s)=>{u.isText?(o+=u.text.slice(Math.max(t,s)-s,n-s),a=!r):u.isLeaf?(i?o+=typeof i=="function"?i(u):i:u.type.spec.leafText&&(o+=u.type.spec.leafText(u)),a=!r):!a&&u.isBlock&&(o+=r,a=!0)},0),o}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o<t.content.length;o++)i.push(t.content[o]);return new V(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let o=0,a=0;a<n;o++){let u=this.content[o],s=a+u.nodeSize;s>t&&((a<t||s>n)&&(u.isText?u=u.cut(Math.max(0,t-a),Math.min(u.text.length,n-a)):u=u.cut(Math.max(0,t-a-1),Math.min(u.content.size,n-a-1))),r.push(u),i+=u.nodeSize),a=s}return new V(r,i)}cutByIndex(t,n){return t==n?V.empty:t==0&&n==this.content.length?this:new V(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 V(i,o)}addToStart(t){return new V([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new V(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(t.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let n=this.content[t];if(!n)throw new RangeError("Index "+t+" out of range for "+this);return n}maybeChild(t){return this.content[t]||null}forEach(t){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];t(i,r,n),r+=i.nodeSize}}findDiffStart(t,n=0){return cK(this,t,n)}findDiffEnd(t,n=this.size,r=t.size){return lK(this,t,n,r)}findIndex(t,n=-1){if(t==0)return $b(0,t);if(t==this.size)return $b(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),a=i+o.nodeSize;if(a>=t)return a==t||n>0?$b(r+1,a):$b(r,i);i=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return V.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new V(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return V.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 V(n||t,r)}static from(t){if(!t)return V.empty;if(t instanceof V)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new V([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}V.empty=new V([],0);const LE={index:0,offset:0};function $b(e,t){return LE.index=e,LE.offset=t,LE}function _b(e,t){if(e===t)return!0;if(!(e&&typeof e=="object")||!(t&&typeof t=="object"))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!_b(e[r],t[r]))return!1}else{for(let r in e)if(!(r in t)||!_b(e[r],t[r]))return!1;for(let r in t)if(!(r in e))return!1}return!0}class Ge{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&&_b(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=t.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);return r.create(n.attrs)}static sameSet(t,n){if(t==n)return!0;if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].eq(n[r]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return Ge.none;if(t instanceof Ge)return[t];let n=t.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}}Ge.none=[];class xf extends Error{}class X{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=dK(this.content,t+this.openStart,n);return r&&new X(r,this.openStart,this.openEnd)}removeBetween(t,n){return new X(fK(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 X.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new X(V.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let o=t.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=t.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new X(t,r,i)}}X.empty=new X(V.empty,0,0);function fK(e,t,n){let{index:r,offset:i}=e.findIndex(t),o=e.maybeChild(r),{index:a,offset:u}=e.findIndex(n);if(i==t||o.isText){if(u!=n&&!e.child(a).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=a)throw new RangeError("Removing non-flat range");return e.replaceChild(r,o.copy(fK(o.content,t-i-1,n-i-1)))}function dK(e,t,n,r){let{index:i,offset:o}=e.findIndex(t),a=e.maybeChild(i);if(o==t||a.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let u=dK(a.content,t-o-1,n);return u&&e.replaceChild(i,a.copy(u))}function TIe(e,t,n){if(n.openStart>e.depth)throw new xf("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new xf("Inconsistent open depths");return pK(e,t,n,0)}function pK(e,t,n,r){let i=e.index(r),o=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let a=pK(e,t,n,r+1);return o.copy(o.content.replaceChild(i,a))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let a=e.parent,u=a.content;return hc(a,u.cut(0,e.parentOffset).append(n.content).append(u.cut(t.parentOffset)))}else{let{start:a,end:u}=IIe(n,e);return hc(o,mK(e,a,u,t,r))}else return hc(o,Sb(e,t,r))}function hK(e,t){if(!t.type.compatibleContent(e.type))throw new xf("Cannot join "+t.type.name+" onto "+e.type.name)}function jE(e,t,n){let r=e.node(n);return hK(r,t.node(n)),r}function pc(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function xh(e,t,n,r){let i=(t||e).node(n),o=0,a=t?t.index(n):i.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(pc(e.nodeAfter,r),o++));for(let u=o;u<a;u++)pc(i.child(u),r);t&&t.depth==n&&t.textOffset&&pc(t.nodeBefore,r)}function hc(e,t){if(!e.type.validContent(t))throw new xf("Invalid content for node "+e.type.name);return e.copy(t)}function mK(e,t,n,r,i){let o=e.depth>i&&jE(e,t,i+1),a=r.depth>i&&jE(n,r,i+1),u=[];return xh(null,e,i,u),o&&a&&t.index(i)==n.index(i)?(hK(o,a),pc(hc(o,mK(e,t,n,r,i+1)),u)):(o&&pc(hc(o,Sb(e,t,i+1)),u),xh(t,n,i,u),a&&pc(hc(a,Sb(n,r,i+1)),u)),xh(r,null,i,u),new V(u)}function Sb(e,t,n){let r=[];if(xh(null,e,n,r),e.depth>n){let i=jE(e,t,n+1);pc(hc(i,Sb(e,t,n+1)),r)}return xh(t,null,n,r),new V(r)}function IIe(e,t){let n=t.depth-e.openStart,i=t.node(n).copy(e.content);for(let o=n-1;o>=0;o--)i=t.node(o).copy(V.from(i));return{start:i.resolveNoCache(e.openStart+n),end:i.resolveNoCache(i.content.size-e.openEnd-n)}}class Ch{constructor(t,n,r){this.pos=t,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=t.child(n);return r?t.child(n).cut(r):i}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o<t;o++)i+=r.child(o).nodeSize;return i}marks(){let t=this.parent,n=this.index();if(t.content.size==0)return Ge.none;if(this.textOffset)return t.child(n).marks;let r=t.maybeChild(n-1),i=t.maybeChild(n);if(!r){let u=r;r=i,i=u}let o=r.marks;for(var a=0;a<o.length;a++)o[a].type.spec.inclusive===!1&&(!i||!o[a].isInSet(i.marks))&&(o=o[a--].removeFromSet(o));return o}marksAcross(t){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=t.parent.maybeChild(t.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(t){for(let n=this.depth;n>0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos<this.pos)return t.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);r>=0;r--)if(t.pos<=this.end(r)&&(!n||n(this.node(r))))return new Tb(this,t,r);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let n=1;n<=this.depth;n++)t+=(t?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return t+":"+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let a=t;;){let{index:u,offset:s}=a.content.findIndex(o),c=o-s;if(r.push(a,u,i+s),!c||(a=a.child(u),a.isText))break;o=c-1,i+=s+1}return new Ch(n,r,o)}static resolveCached(t,n){for(let i=0;i<UE.length;i++){let o=UE[i];if(o.pos==n&&o.doc==t)return o}let r=UE[BE]=Ch.resolve(t,n);return BE=(BE+1)%OIe,r}}let UE=[],BE=0,OIe=12;class Tb{constructor(t,n,r){this.$from=t,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const wIe=Object.create(null);class ao{constructor(t,n,r,i=Ge.none){this.type=t,this.attrs=n,this.marks=i,this.content=r||V.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&&_b(this.attrs,n||t.defaultAttrs||wIe)&&Ge.sameSet(this.marks,r||Ge.none)}copy(t=null){return t==this.content?this:new ao(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new ao(this.type,this.attrs,this.content,t)}cut(t,n=this.content.size){return t==0&&n==this.content.size?this:this.copy(this.content.cut(t,n))}slice(t,n=this.content.size,r=!1){if(t==n)return X.empty;let i=this.resolve(t),o=this.resolve(n),a=r?0:i.sharedDepth(n),u=i.start(a),c=i.node(a).content.cut(i.pos-u,o.pos-u);return new X(c,i.depth-a,o.depth-a)}replace(t,n,r){return TIe(this.resolve(t),this.resolve(n),r)}nodeAt(t){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(t);if(n=n.maybeChild(r),!n)return null;if(i==t||n.isText)return n;t-=i+1}}childAfter(t){let{index:n,offset:r}=this.content.findIndex(t);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(t){if(t==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(t);if(r<t)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(t){return Ch.resolveCached(this,t)}resolveNoCache(t){return Ch.resolve(this,t)}rangeHasMark(t,n,r){let i=!1;return n>t&&this.nodesBetween(t,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),vK(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,r=V.empty,i=0,o=r.childCount){let a=this.contentMatchAt(t).matchFragment(r,i,o),u=a&&a.matchFragment(this.content,n);if(!u||!u.validEnd)return!1;for(let s=i;s<o;s++)if(!this.type.allowsMarks(r.child(s).marks))return!1;return!0}canReplaceWith(t,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(t).matchType(r),a=o&&o.matchFragment(this.content,n);return a?a.validEnd:!1}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){if(!this.type.validContent(this.content))throw new RangeError(`Invalid content for node ${this.type.name}: ${this.content.toString().slice(0,50)}`);let t=Ge.none;for(let n=0;n<this.marks.length;n++)t=this.marks[n].addToSet(t);if(!Ge.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r=null;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,r)}let i=V.fromJSON(t,n.content);return t.nodeType(n.type).create(n.attrs,i,r)}}ao.prototype.text=void 0;class Ib extends ao{constructor(t,n,r,i){if(super(t,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):vK(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 Ib(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new Ib(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function vK(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class mc{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new EIe(t,n);if(r.next==null)return mc.empty;let i=gK(r);r.next&&r.err("Unexpected trailing text");let o=WIe(kIe(i));return NIe(o,r),o}matchType(t){for(let n=0;n<this.next.length;n++)if(this.next[n].type==t)return this.next[n].next;return null}matchFragment(t,n=0,r=t.childCount){let i=this;for(let o=n;i&&o<r;o++)i=i.matchType(t.child(o).type);return i}get inlineContent(){return this.next.length&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:n}=this.next[t];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(t){for(let n=0;n<this.next.length;n++)for(let r=0;r<t.next.length;r++)if(this.next[n].type==t.next[r].type)return!0;return!1}fillBefore(t,n=!1,r=0){let i=[this];function o(a,u){let s=a.matchFragment(t,r);if(s&&(!n||s.validEnd))return V.from(u.map(c=>c.createAndFill()));for(let c=0;c<a.next.length;c++){let{type:l,next:f}=a.next[c];if(!(l.isText||l.hasRequiredAttrs())&&i.indexOf(f)==-1){i.push(f);let d=o(f,u.concat(l));if(d)return d}}return null}return o(this,[])}findWrapping(t){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==t)return this.wrapCache[r+1];let n=this.computeWrapping(t);return this.wrapCache.push(t,n),n}computeWrapping(t){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(t)){let a=[];for(let u=i;u.type;u=u.via)a.push(u.type);return a.reverse()}for(let a=0;a<o.next.length;a++){let{type:u,next:s}=o.next[a];!u.isLeaf&&!u.hasRequiredAttrs()&&!(u.name in n)&&(!i.type||s.validEnd)&&(r.push({match:u.contentMatch,type:u,via:i}),n[u.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(r){t.push(r);for(let i=0;i<r.next.length;i++)t.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),t.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let a=0;a<r.next.length;a++)o+=(a?", ":"")+r.next[a].type.name+"->"+t.indexOf(r.next[a].next);return o}).join(`
33
+ `)}}mc.empty=new mc(!0);class EIe{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function gK(e){let t=[];do t.push(RIe(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function RIe(e){let t=[];do t.push(MIe(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function MIe(e){let t=AIe(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=xIe(e,t);else break;return t}function yK(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function xIe(e,t){let n=yK(e),r=n;return e.eat(",")&&(e.next!="}"?r=yK(e):r=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function CIe(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let o in n){let a=n[o];a.groups.indexOf(t)>-1&&i.push(a)}return i.length==0&&e.err("No node type or group '"+t+"' found"),i}function AIe(e){if(e.eat("(")){let t=gK(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=CIe(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function kIe(e){let t=[[]];return i(o(e,0),n()),t;function n(){return t.push([])-1}function r(a,u,s){let c={term:s,to:u};return t[a].push(c),c}function i(a,u){a.forEach(s=>s.to=u)}function o(a,u){if(a.type=="choice")return a.exprs.reduce((s,c)=>s.concat(o(c,u)),[]);if(a.type=="seq")for(let s=0;;s++){let c=o(a.exprs[s],u);if(s==a.exprs.length-1)return c;i(c,u=n())}else if(a.type=="star"){let s=n();return r(u,s),i(o(a.expr,s),s),[r(s)]}else if(a.type=="plus"){let s=n();return i(o(a.expr,u),s),i(o(a.expr,s),s),[r(s)]}else{if(a.type=="opt")return[r(u)].concat(o(a.expr,u));if(a.type=="range"){let s=u;for(let c=0;c<a.min;c++){let l=n();i(o(a.expr,s),l),s=l}if(a.max==-1)i(o(a.expr,s),s);else for(let c=a.min;c<a.max;c++){let l=n();r(s,l),i(o(a.expr,s),l),s=l}return[r(s)]}else{if(a.type=="name")return[r(u,void 0,a.value)];throw new Error("Unknown expr type")}}}}function bK(e,t){return t-e}function $K(e,t){let n=[];return r(t),n.sort(bK);function r(i){let o=e[i];if(o.length==1&&!o[0].term)return r(o[0].to);n.push(i);for(let a=0;a<o.length;a++){let{term:u,to:s}=o[a];!u&&n.indexOf(s)==-1&&r(s)}}}function WIe(e){let t=Object.create(null);return n($K(e,0));function n(r){let i=[];r.forEach(a=>{e[a].forEach(({term:u,to:s})=>{if(!u)return;let c;for(let l=0;l<i.length;l++)i[l][0]==u&&(c=i[l][1]);$K(e,s).forEach(l=>{c||i.push([u,c=[]]),c.indexOf(l)==-1&&c.push(l)})})});let o=t[r.join(",")]=new mc(r.indexOf(e.length-1)>-1);for(let a=0;a<i.length;a++){let u=i[a][1].sort(bK);o.next.push({type:i[a][0],next:t[u.join(",")]||n(u)})}return o}}function NIe(e,t){for(let n=0,r=[e];n<r.length;n++){let i=r[n],o=!i.validEnd,a=[];for(let u=0;u<i.next.length;u++){let{type:s,next:c}=i.next[u];a.push(s.name),o&&!(s.isText||s.hasRequiredAttrs())&&(o=!1),r.indexOf(c)==-1&&r.push(c)}o&&t.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function _K(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function SK(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let o=e[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function TK(e){let t=Object.create(null);if(e)for(let n in e)t[n]=new PIe(e[n]);return t}class Ob{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=TK(r.attrs),this.defaultAttrs=_K(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||t=="text"),this.isText=t=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==mc.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:SK(this.attrs,t)}create(t=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new ao(this,this.computeAttrs(t),V.from(n),Ge.setFrom(r))}createChecked(t=null,n,r){if(n=V.from(n),!this.validContent(n))throw new RangeError("Invalid content for node "+this.name);return new ao(this,this.computeAttrs(t),n,Ge.setFrom(r))}createAndFill(t=null,n,r){if(t=this.computeAttrs(t),n=V.from(n),n.size){let a=this.contentMatch.fillBefore(n);if(!a)return null;n=a.append(n)}let i=this.contentMatch.matchFragment(n),o=i&&i.fillBefore(V.empty,!0);return o?new ao(this,t,n.append(o),Ge.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}allowsMarkType(t){return this.markSet==null||this.markSet.indexOf(t)>-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;n<t.length;n++)if(!this.allowsMarkType(t[n].type))return!1;return!0}allowedMarks(t){if(this.markSet==null)return t;let n;for(let r=0;r<t.length;r++)this.allowsMarkType(t[r].type)?n&&n.push(t[r]):n||(n=t.slice(0,r));return n?n.length?n:Ge.none:t}static compile(t,n){let r=Object.create(null);t.forEach((o,a)=>r[o]=new Ob(o,n,a));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}}class PIe{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class wb{constructor(t,n,r,i){this.name=t,this.rank=n,this.schema=r,this.spec=i,this.attrs=TK(i.attrs),this.excluded=null;let o=_K(this.attrs);this.instance=o?new Ge(this,o):null}create(t=null){return!t&&this.instance?this.instance:new Ge(this,SK(this.attrs,t))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((o,a)=>r[o]=new wb(o,i++,n,a)),r}removeFromSet(t){for(var n=0;n<t.length;n++)t[n].type==this&&(t=t.slice(0,n).concat(t.slice(n+1)),n--);return t}isInSet(t){for(let n=0;n<t.length;n++)if(t[n].type==this)return t[n]}excludes(t){return this.excluded.indexOf(t)>-1}}class FIe{constructor(t){this.cached=Object.create(null),this.spec={nodes:cn.from(t.nodes),marks:cn.from(t.marks||{}),topNode:t.topNode},this.nodes=Ob.compile(this.spec.nodes,this),this.marks=wb.compile(this.spec.marks,this);let n=Object.create(null);for(let r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");let i=this.nodes[r],o=i.spec.content||"",a=i.spec.marks;i.contentMatch=n[o]||(n[o]=mc.parse(o,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.markSet=a=="_"?null:a?IK(this,a.split(" ")):a==""||!i.inlineContent?[]:null}for(let r in this.marks){let i=this.marks[r],o=i.spec.excludes;i.excluded=o==null?[i]:o==""?[]:IK(this,o.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,r,i){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof Ob){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(n,r,i)}text(t,n){let r=this.nodes.text;return new Ib(r,r.defaultAttrs,t,Ge.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeFromJSON(t){return ao.fromJSON(this,t)}markFromJSON(t){return Ge.fromJSON(this,t)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}}function IK(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],o=e.marks[i],a=o;if(o)n.push(o);else for(let u in e.marks){let s=e.marks[u];(i=="_"||s.spec.group&&s.spec.group.split(" ").indexOf(i)>-1)&&n.push(a=s)}if(!a)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class Cf{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[],n.forEach(r=>{r.tag?this.tags.push(r):r.style&&this.styles.push(r)}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let i=t.nodes[r.node];return i.contentMatch.matchType(i)})}parse(t,n={}){let r=new RK(this,n,!1);return r.addAll(t,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new RK(this,n,!0);return r.addAll(t,n.from,n.to),X.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(jIe(t,o.tag)&&(o.namespace===void 0||t.namespaceURI==o.namespace)&&(!o.context||n.matchesContext(o.context))){if(o.getAttrs){let a=o.getAttrs(t);if(a===!1)continue;o.attrs=a||void 0}return o}}}matchStyle(t,n,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let a=this.styles[o],u=a.style;if(!(u.indexOf(t)!=0||a.context&&!r.matchesContext(a.context)||u.length>t.length&&(u.charCodeAt(t.length)!=61||u.slice(t.length+1)!=n))){if(a.getAttrs){let s=a.getAttrs(n);if(s===!1)continue;a.attrs=s||void 0}return a}}}static schemaRules(t){let n=[];function r(i){let o=i.priority==null?50:i.priority,a=0;for(;a<n.length;a++){let u=n[a];if((u.priority==null?50:u.priority)<o)break}n.splice(a,0,i)}for(let i in t.marks){let o=t.marks[i].spec.parseDOM;o&&o.forEach(a=>{r(a=MK(a)),a.mark=i})}for(let i in t.nodes){let o=t.nodes[i].spec.parseDOM;o&&o.forEach(a=>{r(a=MK(a)),a.node=i})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new Cf(t,Cf.schemaRules(t)))}}const OK={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},DIe={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},wK={ol:!0,ul:!0},Eb=1,Rb=2,Ah=4;function EK(e,t,n){return t!=null?(t?Eb:0)|(t==="full"?Rb:0):e&&e.whitespace=="pre"?Eb|Rb:n&~Ah}class Mb{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=Ge.none,this.stashMarks=[],this.match=a||(u&Ah?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(V.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(t.type))?(this.match=r,i):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&Eb)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=V.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(V.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}popFromStashMark(t){for(let n=this.stashMarks.length-1;n>=0;n--)if(t.eq(this.stashMarks[n]))return this.stashMarks.splice(n,1)[0]}applyPending(t){for(let n=0,r=this.pendingMarks;n<r.length;n++){let i=r[n];(this.type?this.type.allowsMarkType(i.type):BIe(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&&!OK.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class RK{constructor(t,n,r){this.parser=t,this.options=n,this.isOpen=r,this.open=0;let i=n.topNode,o,a=EK(null,n.preserveWhitespace,0)|(r?Ah:0);i?o=new Mb(i.type,i.attrs,Ge.none,Ge.none,!0,n.topMatch||i.type.contentMatch,a):r?o=new Mb(null,null,Ge.none,Ge.none,!0,null,a):o=new Mb(t.schema.topNodeType,null,Ge.none,Ge.none,!0,null,a),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t){if(t.nodeType==3)this.addTextNode(t);else if(t.nodeType==1){let n=t.getAttribute("style"),r=n?this.readStyles(UIe(n)):null,i=this.top;if(r!=null)for(let o=0;o<r.length;o++)this.addPendingMark(r[o]);if(this.addElement(t),r!=null)for(let o=0;o<r.length;o++)this.removePendingMark(r[o],i)}}addTextNode(t){let n=t.nodeValue,r=this.top;if(r.options&Rb||r.inlineContext(t)||/[^ \t\r\n\u000c]/.test(n)){if(r.options&Eb)r.options&Rb?n=n.replace(/\r\n?/g,`
34
+ `):n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let i=r.content[r.content.length-1],o=t.previousSibling;(!i||o&&o.nodeName=="BR"||i.isText&&/[ \t\r\n\u000c]$/.test(i.text))&&(n=n.slice(1))}n&&this.insertNode(this.parser.schema.text(n)),this.findInText(t)}else this.findInside(t)}addElement(t,n){let r=t.nodeName.toLowerCase(),i;wK.hasOwnProperty(r)&&this.parser.normalizeLists&&LIe(t);let o=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(i=this.parser.matchTag(t,this,n));if(o?o.ignore:DIe.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(OK.hasOwnProperty(r))a=!0,u.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t);return}this.addAll(t),a&&this.sync(u),this.needsBlock=s}else this.addElementByRule(t,o,o.consuming===!1?i:void 0)}leafFallback(t){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(`
35
+ `))}ignoreFallback(t){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(t){let n=Ge.none;e:for(let r=0;r<t.length;r+=2)for(let i=void 0;;){let o=this.parser.matchStyle(t[r],t[r+1],this,i);if(!o)continue e;if(o.ignore)return null;if(n=this.parser.schema.marks[o.mark].create(o.attrs).addToSet(n),o.consuming===!1)i=o;else break}return n}addElementByRule(t,n,r){let i,o,a;n.node?(o=this.parser.schema.nodes[n.node],o.isLeaf?this.insertNode(o.create(n.attrs))||this.leafFallback(t):i=this.enter(o,n.attrs||null,n.preserveWhitespace)):(a=this.parser.schema.marks[n.mark].create(n.attrs),this.addPendingMark(a));let u=this.top;if(o&&o.isLeaf)this.findInside(t);else if(r)this.addElement(t,r);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(s=>this.insertNode(s));else{let s=t;typeof n.contentElement=="string"?s=t.querySelector(n.contentElement):typeof n.contentElement=="function"?s=n.contentElement(t):n.contentElement&&(s=n.contentElement),this.findAround(t,s,!0),this.addAll(s)}i&&this.sync(u)&&this.open--,a&&this.removePendingMark(a,u)}addAll(t,n,r){let i=n||0;for(let o=n?t.childNodes[n]:t.firstChild,a=r==null?null:t.childNodes[r];o!=a;o=o.nextSibling,++i)this.findAtPoint(t,i),this.addDOM(o);this.findAtPoint(t,i)}findPlace(t){let n,r;for(let i=this.open;i>=0;i--){let o=this.nodes[i],a=o.findWrapping(t);if(a&&(!n||n.length>a.length)&&(n=a,r=o,!a.length)||o.solid)break}if(!n)return!1;this.sync(r);for(let i=0;i<n.length;i++)this.enterInner(n[i],null,!1);return!0}insertNode(t){if(t.isInline&&this.needsBlock&&!this.top.type){let n=this.textblockFromContext();n&&this.enterInner(n)}if(this.findPlace(t)){this.closeExtra();let n=this.top;n.applyPending(t.type),n.match&&(n.match=n.match.matchType(t.type));let r=n.activeMarks;for(let i=0;i<t.marks.length;i++)(!n.type||n.type.allowsMarkType(t.marks[i].type))&&(r=t.marks[i].addToSet(r));return n.content.push(t.mark(r)),!0}return!1}enter(t,n,r){let i=this.findPlace(t.create(n));return i&&this.enterInner(t,n,!0,r),i}enterInner(t,n=null,r=!1,i){this.closeExtra();let o=this.top;o.applyPending(t),o.match=o.match&&o.match.matchType(t);let a=EK(t,i,o.options);o.options&Ah&&o.content.length==0&&(a|=Ah),this.nodes.push(new Mb(t,n,o.activeMarks,o.pendingMarks,r,null,a)),this.open++}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(t){for(let n=this.open;n>=0;n--)if(this.nodes[n]==t)return this.open=n,!0;return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)t+=r[i].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==t&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&t.nodeType==1&&t.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(t,n,r){if(t!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&t.nodeType==1&&t.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&(this.find[n].pos=this.currentPos-(t.nodeValue.length-this.find[n].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),a=(u,s)=>{for(;u>=0;u--){let c=n[u];if(c==""){if(u==n.length-1||u==0)continue;for(;s>=o;s--)if(a(u-1,s))return!0;return!1}else{let l=s>0||s==0&&i?this.nodes[s].type:r&&s>=o?r.node(s-o).type:null;if(!l||l.name!=c&&l.groups.indexOf(c)==-1)return!1;s--}}return!0};return a(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(t){let n=zIe(t,this.top.pendingMarks);n&&this.top.stashMarks.push(n),this.top.pendingMarks=t.addToSet(this.top.pendingMarks)}removePendingMark(t,n){for(let r=this.open;r>=0;r--){let i=this.nodes[r];if(i.pendingMarks.lastIndexOf(t)>-1)i.pendingMarks=t.removeFromSet(i.pendingMarks);else{i.activeMarks=t.removeFromSet(i.activeMarks);let a=i.popFromStashMark(t);a&&i.type&&i.type.allowsMarkType(a.type)&&(i.activeMarks=a.addToSet(i.activeMarks))}if(i==n)break}}}function LIe(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let r=t.nodeType==1?t.nodeName.toLowerCase():null;r&&wK.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):r=="li"?n=t:r&&(n=null)}}function jIe(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function UIe(e){let t=/\s*([\w-]+)\s*:\s*([^;]+)/g,n,r=[];for(;n=t.exec(e);)r.push(n[1],n[2].trim());return r}function MK(e){let t={};for(let n in e)t[n]=e[n];return t}function BIe(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let o=[],a=u=>{o.push(u);for(let s=0;s<u.edgeCount;s++){let{type:c,next:l}=u.edge(s);if(c==t||o.indexOf(l)<0&&a(l))return!0}};if(a(i.contentMatch))return!0}}function zIe(e,t){for(let n=0;n<t.length;n++)if(e.eq(t[n]))return t[n]}class uo{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},r){r||(r=zE(n).createDocumentFragment());let i=r,o=[];return t.forEach(a=>{if(o.length||a.marks.length){let u=0,s=0;for(;u<o.length&&s<a.marks.length;){let c=a.marks[s];if(!this.marks[c.type.name]){s++;continue}if(!c.eq(o[u][0])||c.type.spec.spanning===!1)break;u++,s++}for(;u<o.length;)i=o.pop()[1];for(;s<a.marks.length;){let c=a.marks[s++],l=this.serializeMark(c,a.isInline,n);l&&(o.push([c,i]),i.appendChild(l.dom),i=l.contentDOM||l.dom)}}i.appendChild(this.serializeNodeInner(a,n))}),r}serializeNodeInner(t,n){let{dom:r,contentDOM:i}=uo.renderSpec(zE(n),this.nodes[t.type.name](t));if(i){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,n,i)}return r}serializeNode(t,n={}){let r=this.serializeNodeInner(t,n);for(let i=t.marks.length-1;i>=0;i--){let o=this.serializeMark(t.marks[i],t.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(t,n,r={}){let i=this.marks[t.type.name];return i&&uo.renderSpec(zE(r),i(t,n))}static renderSpec(t,n,r=null){if(typeof n=="string")return{dom:t.createTextNode(n)};if(n.nodeType!=null)return{dom:n};if(n.dom&&n.dom.nodeType!=null)return n;let i=n[0],o=i.indexOf(" ");o>0&&(r=i.slice(0,o),i=i.slice(o+1));let a,u=r?t.createElementNS(r,i):t.createElement(i),s=n[1],c=1;if(s&&typeof s=="object"&&s.nodeType==null&&!Array.isArray(s)){c=2;for(let l in s)if(s[l]!=null){let f=l.indexOf(" ");f>0?u.setAttributeNS(l.slice(0,f),l.slice(f+1),s[l]):u.setAttribute(l,s[l])}}for(let l=c;l<n.length;l++){let f=n[l];if(f===0){if(l<n.length-1||l>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u}}else{let{dom:d,contentDOM:p}=uo.renderSpec(t,f,r);if(u.appendChild(d),p){if(a)throw new RangeError("Multiple content holes");a=p}}}return{dom:u,contentDOM:a}}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new uo(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=xK(t.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(t){return xK(t.marks)}}function xK(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function zE(e){return e.document||window.document}const CK=65535,AK=Math.pow(2,16);function qIe(e,t){return e+t*AK}function kK(e){return e&CK}function KIe(e){return(e-(e&CK))/AK}const WK=1,NK=2,xb=4,PK=8;class qE{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&PK)>0}get deletedBefore(){return(this.delInfo&(WK|xb))>0}get deletedAfter(){return(this.delInfo&(NK|xb))>0}get deletedAcross(){return(this.delInfo&xb)>0}}class qr{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&qr.empty)return qr.empty}recover(t){let n=0,r=kK(t);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+KIe(t)}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,r){let i=0,o=this.inverted?2:1,a=this.inverted?1:2;for(let u=0;u<this.ranges.length;u+=3){let s=this.ranges[u]-(this.inverted?i:0);if(s>t)break;let c=this.ranges[u+o],l=this.ranges[u+a],f=s+c;if(t<=f){let d=c?t==s?-1:t==f?1:n:n,p=s+i+(d<0?0:l);if(r)return p;let h=t==(n<0?s:f)?null:qIe(u/3,t-s),v=t==s?NK:t==f?WK:xb;return(n<0?t!=s:t!=f)&&(v|=PK),new qE(p,v,h)}i+=l-c}return r?t+i:new qE(t+i,0,null)}touches(t,n){let r=0,i=kK(n),o=this.inverted?2:1,a=this.inverted?1:2;for(let u=0;u<this.ranges.length;u+=3){let s=this.ranges[u]-(this.inverted?r:0);if(s>t)break;let c=this.ranges[u+o],l=s+c;if(t<=l&&u==i*3)return!0;r+=this.ranges[u+a]-c}return!1}forEach(t){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let a=this.ranges[i],u=a-(this.inverted?o:0),s=a+(this.inverted?0:o),c=this.ranges[i+n],l=this.ranges[i+r];t(u,u+c,s,s+l),o+=l-c}}invert(){return new qr(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?qr.empty:new qr(t<0?[0,-t,0]:[0,0,t])}}qr.empty=new qr([]);class kh{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 kh(this.maps,this.mirror,t,n)}copy(){return new kh(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(t,n){this.to=this.maps.push(t),n!=null&&this.setMirror(this.maps.length-1,n)}appendMapping(t){for(let n=0,r=this.maps.length;n<t.maps.length;n++){let i=t.getMirror(n);this.appendMap(t.maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(t){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==t)return this.mirror[n+(n%2?-1:1)]}}setMirror(t,n){this.mirror||(this.mirror=[]),this.mirror.push(t,n)}appendMappingInverted(t){for(let n=t.maps.length-1,r=this.maps.length+t.maps.length;n>=0;n--){let i=t.getMirror(n);this.appendMap(t.maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let t=new kh;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let r=this.from;r<this.to;r++)t=this.maps[r].map(t,n);return t}mapResult(t,n=1){return this._map(t,n,!1)}_map(t,n,r){let i=0;for(let o=this.from;o<this.to;o++){let a=this.maps[o],u=a.mapResult(t,n);if(u.recover!=null){let s=this.getMirror(o);if(s!=null&&s>o&&s<this.to){o=s,t=this.maps[s].recover(u.recover);continue}}i|=u.delInfo,t=u.pos}return r?t:new qE(t,i,null)}}const KE=Object.create(null);class Qn{getMap(){return qr.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=KE[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in KE)throw new RangeError("Duplicate use of step JSON ID "+t);return KE[t]=n,n.prototype.jsonID=t,n}}class Pt{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new Pt(t,null)}static fail(t){return new Pt(null,t)}static fromReplace(t,n,r,i){try{return Pt.ok(t.replace(n,r,i))}catch(o){if(o instanceof xf)return Pt.fail(o.message);throw o}}}function VE(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(VE(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return V.fromArray(r)}class wu extends Qn{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 X(VE(n.content,(a,u)=>!a.isAtom||!u.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),i),n.openStart,n.openEnd);return Pt.fromReplace(t,this.from,this.to,o)}invert(){return new so(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 wu(n.pos,r.pos,this.mark)}merge(t){return t instanceof wu&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new wu(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new wu(n.from,n.to,t.markFromJSON(n.mark))}}Qn.jsonID("addMark",wu);class so extends Qn{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 X(VE(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),n.openStart,n.openEnd);return Pt.fromReplace(t,this.from,this.to,r)}invert(){return new wu(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 so(n.pos,r.pos,this.mark)}merge(t){return t instanceof so&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new so(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new so(n.from,n.to,t.markFromJSON(n.mark))}}Qn.jsonID("removeMark",so);class Eu extends Qn{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Pt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Pt.fromReplace(t,this.pos,this.pos+1,new X(V.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 Eu(this.pos,n.marks[i]);return new Eu(this.pos,this.mark)}}return new Af(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Eu(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Eu(n.pos,t.markFromJSON(n.mark))}}Qn.jsonID("addNodeMark",Eu);class Af extends Qn{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Pt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Pt.fromReplace(t,this.pos,this.pos+1,new X(V.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Eu(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Af(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Af(n.pos,t.markFromJSON(n.mark))}}Qn.jsonID("removeNodeMark",Af);class Cn extends Qn{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&HE(t,this.from,this.to)?Pt.fail("Structure replace would overwrite content"):Pt.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new qr([this.from,this.to-this.from,this.slice.size])}invert(t){return new Cn(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new Cn(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof Cn)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?X.empty:new X(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new Cn(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?X.empty:new X(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new Cn(t.from,this.to,n,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Cn(n.from,n.to,X.fromJSON(t,n.slice),!!n.structure)}}Qn.jsonID("replace",Cn);class ln extends Qn{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&&(HE(t,this.from,this.gapFrom)||HE(t,this.gapTo,this.to)))return Pt.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Pt.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Pt.fromReplace(t,this.from,this.to,r):Pt.fail("Content does not fit in gap")}getMap(){return new qr([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 ln(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 ln(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new ln(n.from,n.to,n.gapFrom,n.gapTo,X.fromJSON(t,n.slice),n.insert,!!n.structure)}}Qn.jsonID("replaceAround",ln);function HE(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let a=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}}return!1}function VIe(e,t,n,r){let i=[],o=[],a,u;e.doc.nodesBetween(t,n,(s,c,l)=>{if(!s.isInline)return;let f=s.marks;if(!r.isInSet(f)&&l.type.allowsMarkType(r.type)){let d=Math.max(c,t),p=Math.min(c+s.nodeSize,n),h=r.addToSet(f);for(let v=0;v<f.length;v++)f[v].isInSet(h)||(a&&a.to==d&&a.mark.eq(f[v])?a.to=p:i.push(a=new so(d,p,f[v])));u&&u.to==d?u.to=p:o.push(u=new wu(d,p,r))}}),i.forEach(s=>e.step(s)),o.forEach(s=>e.step(s))}function HIe(e,t,n,r){let i=[],o=0;e.doc.nodesBetween(t,n,(a,u)=>{if(!a.isInline)return;o++;let s=null;if(r instanceof wb){let c=a.marks,l;for(;l=r.isInSet(c);)(s||(s=[])).push(l),c=l.removeFromSet(c)}else r?r.isInSet(a.marks)&&(s=[r]):s=a.marks;if(s&&s.length){let c=Math.min(u+a.nodeSize,n);for(let l=0;l<s.length;l++){let f=s[l],d;for(let p=0;p<i.length;p++){let h=i[p];h.step==o-1&&f.eq(i[p].style)&&(d=h)}d?(d.to=c,d.step=o):i.push({style:f,from:Math.max(u,t),to:c,step:o})}}}),i.forEach(a=>e.step(new so(a.from,a.to,a.style)))}function JIe(e,t,n,r=n.contentMatch){let i=e.doc.nodeAt(t),o=[],a=t+1;for(let u=0;u<i.childCount;u++){let s=i.child(u),c=a+s.nodeSize,l=r.matchType(s.type);if(!l)o.push(new Cn(a,c,X.empty));else{r=l;for(let f=0;f<s.marks.length;f++)n.allowsMarkType(s.marks[f].type)||e.step(new so(a,c,s.marks[f]))}a=c}if(!r.validEnd){let u=r.fillBefore(V.empty,!0);e.replace(a,a,new X(u,0,0))}for(let u=o.length-1;u>=0;u--)e.step(o[u])}function GIe(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Wh(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let r=e.depth;;--r){let i=e.$from.node(r),o=e.$from.index(r),a=e.$to.indexAfter(r);if(r<e.depth&&i.canReplace(o,a,n))return r;if(r==0||i.type.spec.isolating||!GIe(i,o,a))break}return null}function YIe(e,t,n){let{$from:r,$to:i,depth:o}=t,a=r.before(o+1),u=i.after(o+1),s=a,c=u,l=V.empty,f=0;for(let h=o,v=!1;h>n;h--)v||r.index(h)>0?(v=!0,l=V.from(r.node(h).copy(l)),f++):s--;let d=V.empty,p=0;for(let h=o,v=!1;h>n;h--)v||i.after(h+1)<i.end(h)?(v=!0,d=V.from(i.node(h).copy(d)),p++):c++;e.step(new ln(s,c,a,u,new X(l.append(d),f,p),l.size-f,!0))}function FK(e,t,n=null,r=e){let i=ZIe(e,t),o=i&&XIe(r,t);return o?i.map(DK).concat({type:t,attrs:n}).concat(o.map(DK)):null}function DK(e){return{type:e,attrs:null}}function ZIe(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.contentMatchAt(r).findWrapping(t);if(!o)return null;let a=o.length?o[0]:t;return n.canReplaceWith(r,i,a)?o:null}function XIe(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.child(r),a=t.contentMatch.findWrapping(o.type);if(!a)return null;let s=(a.length?a[a.length-1]:t).contentMatch;for(let c=r;s&&c<i;c++)s=s.matchType(n.child(c).type);return!s||!s.validEnd?null:a}function QIe(e,t,n){let r=V.empty;for(let a=n.length-1;a>=0;a--){if(r.size){let u=n[a].type.contentMatch.matchFragment(r);if(!u||!u.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=V.from(n[a].type.create(n[a].attrs,r))}let i=t.start,o=t.end;e.step(new ln(i,o,i,o,new X(r,0,0),n.length,!0))}function eOe(e,t,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=e.steps.length;e.doc.nodesBetween(t,n,(a,u)=>{if(a.isTextblock&&!a.hasMarkup(r,i)&&tOe(e.doc,e.mapping.slice(o).map(u),r)){e.clearIncompatible(e.mapping.slice(o).map(u,1),r);let s=e.mapping.slice(o),c=s.map(u,1),l=s.map(u+a.nodeSize,1);return e.step(new ln(c,l,c+1,l-1,new X(V.from(r.create(i,null,a.marks)),0,0),1,!0)),!1}})}function tOe(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function nOe(e,t,n,r,i){let o=e.doc.nodeAt(t);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let a=n.create(r,null,i||o.marks);if(o.isLeaf)return e.replaceWith(t,t+o.nodeSize,a);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new ln(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new X(V.from(a),0,0),1,!0))}function LK(e,t,n=1,r){let i=e.resolve(t),o=i.depth-n,a=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!a.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,l=n-2;c>o;c--,l--){let f=i.node(c),d=i.index(c);if(f.type.spec.isolating)return!1;let p=f.content.cutByIndex(d,f.childCount),h=r&&r[l]||f;if(h!=f&&(p=p.replaceChild(0,h.type.create(h.attrs))),!f.canReplace(d+1,f.childCount)||!h.type.validContent(p))return!1}let u=i.indexAfter(o),s=r&&r[0];return i.node(o).canReplaceWith(u,u,s?s.type:i.node(o+1).type)}function rOe(e,t,n=1,r){let i=e.doc.resolve(t),o=V.empty,a=V.empty;for(let u=i.depth,s=i.depth-n,c=n-1;u>s;u--,c--){o=V.from(i.node(u).copy(o));let l=r&&r[c];a=V.from(l?l.type.create(l.attrs,a):i.node(u).copy(a))}e.step(new Cn(t,t,new X(o.append(a),n,n),!0))}function jK(e,t){let n=e.resolve(t),r=n.index();return iOe(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function iOe(e,t){return!!(e&&t&&!e.isLeaf&&e.canAppend(t))}function oOe(e,t,n){let r=new Cn(t-n,t+n,X.empty,!0);e.step(r)}function aOe(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,n))return r.after(i+1);if(o<r.node(i).childCount)return null}return null}function uOe(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let o=0;o<n.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(n.openStart==0&&n.size?2:1);o++)for(let a=r.depth;a>=0;a--){let u=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,s=r.index(a)+(u>0?1:0),c=r.node(a),l=!1;if(o==1)l=c.canReplace(s,s,i);else{let f=c.contentMatchAt(s).findWrapping(i.firstChild.type);l=f&&c.canReplaceWith(s,s,f[0])}if(l)return u==0?r.pos:u<0?r.before(a+1):r.after(a+1)}return null}function JE(e,t,n=t,r=X.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return UK(i,o,r)?new Cn(t,n,r):new sOe(i,o,r).fit()}function UK(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class sOe{constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=V.empty;for(let i=0;i<=t.depth;i++){let o=t.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(t.indexAfter(i))})}for(let i=t.depth;i>0;i--)this.placed=V.from(t.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(t<0?this.$to:r.doc.resolve(t));if(!i)return null;let o=this.placed,a=r.depth,u=i.depth;for(;a&&u&&o.childCount==1;)o=o.firstChild.content,a--,u--;let s=new X(o,a,u);return t>-1?new ln(r.pos,t,this.$to.pos,this.$to.end(),s,n):s.size||r.pos!=this.$to.pos?new Cn(r.pos,i.pos,s):null}findFittable(){for(let t=1;t<=2;t++)for(let n=this.unplaced.openStart;n>=0;n--){let r,i=null;n?(i=GE(this.unplaced.content,n-1).firstChild,r=i.content):r=this.unplaced.content;let o=r.firstChild;for(let a=this.depth;a>=0;a--){let{type:u,match:s}=this.frontier[a],c,l=null;if(t==1&&(o?s.matchType(o.type)||(l=s.fillBefore(V.from(o),!1)):i&&u.compatibleContent(i.type)))return{sliceDepth:n,frontierDepth:a,parent:i,inject:l};if(t==2&&o&&(c=s.findWrapping(o.type)))return{sliceDepth:n,frontierDepth:a,parent:i,wrap:c};if(i&&s.matchType(i.type))break}}}openMore(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=GE(t,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new X(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=GE(t,n);if(i.childCount<=1&&n>0){let o=t.size-n<=n+i.size;this.unplaced=new X(Nh(t,n-1,1),n-1,o?n-1:r)}else this.unplaced=new X(Nh(t,n,1),n,r)}placeNodes({sliceDepth:t,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let v=0;v<o.length;v++)this.openFrontierNode(o[v]);let a=this.unplaced,u=r?r.content:a.content,s=a.openStart-t,c=0,l=[],{match:f,type:d}=this.frontier[n];if(i){for(let v=0;v<i.childCount;v++)l.push(i.child(v));f=f.matchFragment(i)}let p=u.size+t-(a.content.size-a.openEnd);for(;c<u.childCount;){let v=u.child(c),y=f.matchType(v.type);if(!y)break;c++,(c>1||s==0||v.content.size)&&(f=y,l.push(BK(v.mark(d.allowedMarks(v.marks)),c==1?s:0,c==u.childCount?p:-1)))}let h=c==u.childCount;h||(p=-1),this.placed=Ph(this.placed,n,V.from(l)),this.frontier[n].match=f,h&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let v=0,y=u;v<p;v++){let b=y.lastChild;this.frontier.push({type:b.type,match:b.contentMatchAt(b.childCount)}),y=b.content}this.unplaced=h?t==0?X.empty:new X(Nh(a.content,t-1,1),t-1,p<0?a.openEnd:t-1):new X(Nh(a.content,t,c),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t=this.frontier[this.depth],n;if(!t.type.isTextblock||!YE(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=YE(t,n,i,r,o);if(!!a){for(let u=n-1;u>=0;u--){let{match:s,type:c}=this.frontier[u],l=YE(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=Ph(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=Ph(this.placed,this.depth,V.from(t.create(n,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(V.empty,!0);n.childCount&&(this.placed=Ph(this.placed,this.frontier.length,n))}}function Nh(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Nh(e.firstChild.content,t-1,n)))}function Ph(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Ph(e.lastChild.content,t-1,n)))}function GE(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function BK(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,BK(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(V.empty,!0)))),e.copy(r)}function YE(e,t,n,r,i){let o=e.node(t),a=i?e.indexAfter(t):e.index(t);if(a==o.childCount&&!n.compatibleContent(o.type))return null;let u=r.fillBefore(o.content,!0,a);return u&&!cOe(n,o.content,a)?u:null}function cOe(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function lOe(e){return e.spec.defining||e.spec.definingForContent}function fOe(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),o=e.doc.resolve(n);if(UK(i,o,r))return e.step(new Cn(t,n,r));let a=qK(i,e.doc.resolve(n));a[a.length-1]==0&&a.pop();let u=-(i.depth+1);a.unshift(u);for(let d=i.depth,p=i.pos-1;d>0;d--,p--){let h=i.node(d).type.spec;if(h.defining||h.definingAsContext||h.isolating)break;a.indexOf(d)>-1?u=d:i.before(d)==p&&a.splice(1,0,-d)}let s=a.indexOf(u),c=[],l=r.openStart;for(let d=r.content,p=0;;p++){let h=d.firstChild;if(c.push(h),p==r.openStart)break;d=h.content}for(let d=l-1;d>=0;d--){let p=c[d].type,h=lOe(p);if(h&&i.node(s).type!=p)l=d;else if(h||!p.isTextblock)break}for(let d=r.openStart;d>=0;d--){let p=(d+l+1)%(r.openStart+1),h=c[p];if(!!h)for(let v=0;v<a.length;v++){let y=a[(v+s)%a.length],b=!0;y<0&&(b=!1,y=-y);let w=i.node(y-1),F=i.index(y-1);if(w.canReplaceWith(F,F,h.type,h.marks))return e.replace(i.before(y),b?o.after(y):n,new X(zK(r.content,0,r.openStart,p),p,r.openEnd))}}let f=e.steps.length;for(let d=a.length-1;d>=0&&(e.replace(t,n,r),!(e.steps.length>f));d--){let p=a[d];p<0||(t=i.before(p),n=o.after(p))}}function zK(e,t,n,r,i){if(t<n){let o=e.firstChild;e=e.replaceChild(0,o.copy(zK(o.content,t+1,n,r,o)))}if(t>r){let o=i.contentMatchAt(0),a=o.fillBefore(e).append(e);e=a.append(o.matchFragment(a).fillBefore(V.empty,!0))}return e}function dOe(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=aOe(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new X(V.from(r),0,0))}function pOe(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n),o=qK(r,i);for(let a=0;a<o.length;a++){let u=o[a],s=a==o.length-1;if(s&&u==0||r.node(u).type.contentMatch.validEnd)return e.delete(r.start(u),i.end(u));if(u>0&&(s||r.node(u-1).canReplace(r.index(u-1),i.indexAfter(u-1))))return e.delete(r.before(u),i.after(u))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(t-r.start(a)==r.depth-a&&n>r.end(a)&&i.end(a)-n!=i.depth-a)return e.delete(r.before(a),n);e.delete(t,n)}function qK(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let o=e.start(i);if(o<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(o==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==o-1)&&n.push(i)}return n}class kf extends Qn{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 Pt.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return Pt.fromReplace(t,this.pos,this.pos+1,new X(V.from(i),0,n.isLeaf?0:1))}getMap(){return qr.empty}invert(t){return new kf(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 kf(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new kf(n.pos,n.attr,n.value)}}Qn.jsonID("attr",kf);let Wf=class extends Error{};Wf=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},Wf.prototype=Object.create(Error.prototype),Wf.prototype.constructor=Wf,Wf.prototype.name="TransformError";class hOe{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new kh}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new Wf(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=X.empty){let i=JE(this.doc,t,n,r);return i&&this.step(i),this}replaceWith(t,n,r){return this.replace(t,n,new X(V.from(r),0,0))}delete(t,n){return this.replace(t,n,X.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,r){return fOe(this,t,n,r),this}replaceRangeWith(t,n,r){return dOe(this,t,n,r),this}deleteRange(t,n){return pOe(this,t,n),this}lift(t,n){return YIe(this,t,n),this}join(t,n=1){return oOe(this,t,n),this}wrap(t,n){return QIe(this,t,n),this}setBlockType(t,n=t,r,i=null){return eOe(this,t,n,r,i),this}setNodeMarkup(t,n,r=null,i=[]){return nOe(this,t,n,r,i),this}setNodeAttribute(t,n,r){return this.step(new kf(t,n,r)),this}addNodeMark(t,n){return this.step(new Eu(t,n)),this}removeNodeMark(t,n){if(!(n instanceof Ge)){let r=this.doc.nodeAt(t);if(!r)throw new RangeError("No node at position "+t);if(n=n.isInSet(r.marks),!n)return this}return this.step(new Af(t,n)),this}split(t,n=1,r){return rOe(this,t,n,r),this}addMark(t,n,r){return VIe(this,t,n,r),this}removeMark(t,n,r){return HIe(this,t,n,r),this}clearIncompatible(t,n,r){return JIe(this,t,n,r),this}}const ZE=Object.create(null);class Fe{constructor(t,n,r){this.$anchor=t,this.$head=n,this.ranges=r||[new mOe(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=X.empty){let r=n.content.lastChild,i=null;for(let u=0;u<n.openEnd;u++)i=r,r=r.lastChild;let o=t.steps.length,a=this.ranges;for(let u=0;u<a.length;u++){let{$from:s,$to:c}=a[u],l=t.mapping.slice(o);t.replaceRange(l.map(s.pos),l.map(c.pos),u?X.empty:n),u==0&&HK(t,o,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(t,n){let r=t.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:a,$to:u}=i[o],s=t.mapping.slice(r),c=s.map(a.pos),l=s.map(u.pos);o?t.deleteRange(c,l):(t.replaceRangeWith(c,l,n),HK(t,r,n.isInline?-1:1))}}static findFrom(t,n,r=!1){let i=t.parent.inlineContent?new Ae(t):Nf(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?Nf(t.node(0),t.node(o),t.before(o+1),t.index(o),n,r):Nf(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 Ei(t.node(0))}static atStart(t){return Nf(t,t,0,0,1)||new Ei(t)}static atEnd(t){return Nf(t,t,t.content.size,t.childCount,-1)||new Ei(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=ZE[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in ZE)throw new RangeError("Duplicate use of selection JSON ID "+t);return ZE[t]=n,n.prototype.jsonID=t,n}getBookmark(){return Ae.between(this.$anchor,this.$head).getBookmark()}}Fe.prototype.visible=!0;class mOe{constructor(t,n){this.$from=t,this.$to=n}}let KK=!1;function VK(e){!KK&&!e.parent.inlineContent&&(KK=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class Ae extends Fe{constructor(t,n=t){VK(t),VK(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 Fe.near(r);let i=t.resolve(n.map(this.anchor));return new Ae(i.parent.inlineContent?i:r,r)}replace(t,n=X.empty){if(super.replace(t,n),n==X.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof Ae&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Cb(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Ae(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=Fe.findFrom(n,r,!0)||Fe.findFrom(n,-r,!0);if(o)n=o.$head;else return Fe.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(Fe.findFrom(t,-r,!0)||Fe.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new Ae(t,n)}}Fe.jsonID("text",Ae);class Cb{constructor(t,n){this.anchor=t,this.head=n}map(t){return new Cb(t.map(this.anchor),t.map(this.head))}resolve(t){return Ae.between(t.resolve(this.anchor),t.resolve(this.head))}}class ve extends Fe{constructor(t){let n=t.nodeAfter,r=t.node(0).resolve(t.pos+n.nodeSize);super(t,r),this.node=n}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),o=t.resolve(i);return r?Fe.near(o):new ve(o)}content(){return new X(V.from(this.node),0,0)}eq(t){return t instanceof ve&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new XE(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new ve(t.resolve(n.anchor))}static create(t,n){return new ve(t.resolve(n))}static isSelectable(t){return!t.isText&&t.type.spec.selectable!==!1}}ve.prototype.visible=!1,Fe.jsonID("node",ve);class XE{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new Cb(r,r):new XE(r)}resolve(t){let n=t.resolve(this.anchor),r=n.nodeAfter;return r&&ve.isSelectable(r)?new ve(n):Fe.near(n)}}class Ei extends Fe{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,n=X.empty){if(n==X.empty){t.delete(0,t.doc.content.size);let r=Fe.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(t){return new Ei(t)}map(t){return new Ei(t)}eq(t){return t instanceof Ei}getBookmark(){return vOe}}Fe.jsonID("all",Ei);const vOe={map(){return this},resolve(e){return new Ei(e)}};function Nf(e,t,n,r,i,o=!1){if(t.inlineContent)return Ae.create(e,n);for(let a=r-(i>0?0:1);i>0?a<t.childCount:a>=0;a+=i){let u=t.child(a);if(u.isAtom){if(!o&&ve.isSelectable(u))return ve.create(e,n-(i<0?u.nodeSize:0))}else{let s=Nf(e,u,n+i,i<0?u.childCount:0,i,o);if(s)return s}n+=u.nodeSize*i}return null}function HK(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof Cn||i instanceof ln))return;let o=e.mapping.maps[r],a;o.forEach((u,s,c,l)=>{a==null&&(a=l)}),e.setSelection(Fe.near(e.doc.resolve(a),n))}const JK=1,Ab=2,GK=4;class gOe extends hOe{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(t){if(t.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=(this.updated|JK)&~Ab,this.storedMarks=null,this}get selectionSet(){return(this.updated&JK)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=Ab,this}ensureMarks(t){return Ge.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Ab)>0}addStep(t,n){super.addStep(t,n),this.updated=this.updated&~Ab,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)||Ge.none))),r.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,n,r){let i=this.doc.type.schema;if(n==null)return t?this.replaceSelectionWith(i.text(t),!0):this.deleteSelection();{if(r==null&&(r=n),r=r==null?n:r,!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(Fe.near(this.selection.$to)),this}}setMeta(t,n){return this.meta[typeof t=="string"?t:t.key]=n,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=GK,this}get scrolledIntoView(){return(this.updated&GK)>0}}function YK(e,t){return!t||!e?e:e.bind(t)}class Fh{constructor(t,n,r){this.name=t,this.init=YK(n.init,r),this.apply=YK(n.apply,r)}}const yOe=[new Fh("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new Fh("selection",{init(e,t){return e.selection||Fe.atStart(t.doc)},apply(e){return e.selection}}),new Fh("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new Fh("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class QE{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=yOe.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Fh(r.key,r.spec.state,r))})}}class Pf{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,t,this))return!1}return!0}applyTransaction(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};let n=[t],r=this.applyInner(t),i=null;for(;;){let o=!1;for(let a=0;a<this.config.plugins.length;a++){let u=this.config.plugins[a];if(u.spec.appendTransaction){let s=i?i[a].n:0,c=i?i[a].state:this,l=s<n.length&&u.spec.appendTransaction.call(u,s?n.slice(s):n,c,r);if(l&&r.filterTransaction(l,a)){if(l.setMeta("appendedTransaction",t),!i){i=[];for(let f=0;f<this.config.plugins.length;f++)i.push(f<a?{state:r,n:n.length}:{state:this,n:0})}n.push(l),r=r.applyInner(l),o=!0}i&&(i[a]={state:r,n:n.length})}}if(!o)return{state:r,transactions:n}}}applyInner(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new Pf(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 gOe(this)}static create(t){let n=new QE(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new Pf(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 QE(this.schema,t.plugins),r=n.fields,i=new Pf(n);for(let o=0;o<r.length;o++){let a=r[o].name;i[a]=this.hasOwnProperty(a)?this[a]:r[o].init(t,i)}return i}toJSON(t){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),t&&typeof t=="object")for(let r in t){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=t[r],o=i.spec.state;o&&o.toJSON&&(n[r]=o.toJSON.call(i,this[i.key]))}return n}static fromJSON(t,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let i=new QE(t.schema,t.plugins),o=new Pf(i);return i.fields.forEach(a=>{if(a.name=="doc")o.doc=ao.fromJSON(t.schema,n.doc);else if(a.name=="selection")o.selection=Fe.fromJSON(o.doc,n.selection);else if(a.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let u in r){let s=r[u],c=s.spec.state;if(s.key==a.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,u)){o[a.name]=c.fromJSON.call(s,t,n[u],o);return}}o[a.name]=a.init(t,o)}}),o}}function ZK(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r=="handleDOMEvents"&&(i=ZK(i,t,{})),n[r]=i}return n}class Kr{constructor(t){this.spec=t,this.props={},t.props&&ZK(t.props,this,this.props),this.key=t.key?t.key.key:XK("plugin")}getState(t){return t[this.key]}}const eR=Object.create(null);function XK(e){return e in eR?e+"$"+ ++eR[e]:(eR[e]=0,e+"$")}class Ru{constructor(t="key"){this.key=XK(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const Mu=typeof navigator<"u"?navigator:null,QK=typeof document<"u"?document:null,xu=Mu&&Mu.userAgent||"",tR=/Edge\/(\d+)/.exec(xu),eV=/MSIE \d/.exec(xu),nR=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(xu),$r=!!(eV||nR||tR),Cu=eV?document.documentMode:nR?+nR[1]:tR?+tR[1]:0,co=!$r&&/gecko\/(\d+)/i.test(xu);co&&+(/Firefox\/(\d+)/.exec(xu)||[0,0])[1];const rR=!$r&&/Chrome\/(\d+)/.exec(xu),An=!!rR,bOe=rR?+rR[1]:0,er=!$r&&!!Mu&&/Apple Computer/.test(Mu.vendor),Ff=er&&(/Mobile\/\w+/.test(xu)||!!Mu&&Mu.maxTouchPoints>2),Vr=Ff||(Mu?/Mac/.test(Mu.platform):!1),lo=/Android \d/.test(xu),kb=!!QK&&"webkitFontSmoothing"in QK.documentElement.style,$Oe=kb?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,_r=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},iR=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t};let tV=null;const $a=function(e,t,n){let r=tV||(tV=document.createRange());return r.setEnd(e,n==null?e.nodeValue.length:n),r.setStart(e,t||0),r},Dh=function(e,t,n,r){return n&&(nV(e,t,n,r,-1)||nV(e,t,n,r,1))},_Oe=/^(img|br|input|textarea|hr)$/i;function nV(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:fo(e))){let o=e.parentNode;if(!o||o.nodeType!=1||TOe(e)||_Oe.test(e.nodeName)||e.contentEditable=="false")return!1;t=_r(e)+(i<0?0:1),e=o}else if(e.nodeType==1){if(e=e.childNodes[t+(i<0?-1:0)],e.contentEditable=="false")return!1;t=i<0?fo(e):0}else return!1}}function fo(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function SOe(e,t,n){for(let r=t==0,i=t==fo(e);r||i;){if(e==n)return!0;let o=_r(e);if(e=e.parentNode,!e)return!1;r=r&&o==0,i=i&&o==fo(e)}}function TOe(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const oR=function(e){let t=e.isCollapsed;return t&&An&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t};function Df(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function IOe(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Au(e,t){return typeof e=="number"?e:e[t]}function OOe(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function rV(e,t,n){let r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,o=e.dom.ownerDocument;for(let a=n||e.dom;a;a=iR(a)){if(a.nodeType!=1)continue;let u=a,s=u==o.body,c=s?IOe(o):OOe(u),l=0,f=0;if(t.top<c.top+Au(r,"top")?f=-(c.top-t.top+Au(i,"top")):t.bottom>c.bottom-Au(r,"bottom")&&(f=t.bottom-c.bottom+Au(i,"bottom")),t.left<c.left+Au(r,"left")?l=-(c.left-t.left+Au(i,"left")):t.right>c.right-Au(r,"right")&&(l=t.right-c.right+Au(i,"right")),l||f)if(s)o.defaultView.scrollBy(l,f);else{let d=u.scrollLeft,p=u.scrollTop;f&&(u.scrollTop+=f),l&&(u.scrollLeft+=l);let h=u.scrollLeft-d,v=u.scrollTop-p;t={left:t.left-h,top:t.top-v,right:t.right-h,bottom:t.bottom-v}}if(s)break}}function wOe(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,i;for(let o=(t.left+t.right)/2,a=n+1;a<Math.min(innerHeight,t.bottom);a+=5){let u=e.root.elementFromPoint(o,a);if(!u||u==e.dom||!e.dom.contains(u))continue;let s=u.getBoundingClientRect();if(s.top>=n-20){r=u,i=s.top;break}}return{refDOM:r,refTop:i,stack:iV(e.dom)}}function iV(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=iR(r));return t}function EOe({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;oV(n,r==0?0:r-t)}function oV(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:o}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=o&&(r.scrollLeft=o)}}let Lf=null;function ROe(e){if(e.setActive)return e.setActive();if(Lf)return e.focus(Lf);let t=iV(e);e.focus(Lf==null?{get preventScroll(){return Lf={preventScroll:!0},!0}}:void 0),Lf||(Lf=!1,oV(t,0))}function aV(e,t){let n,r=2e8,i,o=0,a=t.top,u=t.top;for(let s=e.firstChild,c=0;s;s=s.nextSibling,c++){let l;if(s.nodeType==1)l=s.getClientRects();else if(s.nodeType==3)l=$a(s).getClientRects();else continue;for(let f=0;f<l.length;f++){let d=l[f];if(d.top<=a&&d.bottom>=u){a=Math.max(d.bottom,a),u=Math.min(d.top,u);let p=d.left>t.left?d.left-t.left:d.right<t.left?t.left-d.right:0;if(p<r){n=s,r=p,i=p&&n.nodeType==3?{left:d.right<t.left?d.right:d.left,top:t.top}:t,s.nodeType==1&&p&&(o=c+(t.left>=(d.left+d.right)/2?1:0));continue}}!n&&(t.left>=d.right&&t.top>=d.top||t.left>=d.left&&t.top>=d.bottom)&&(o=c+1)}}return n&&n.nodeType==3?MOe(n,i):!n||r&&n.nodeType==1?{node:e,offset:o}:aV(n,i)}function MOe(e,t){let n=e.nodeValue.length,r=document.createRange();for(let i=0;i<n;i++){r.setEnd(e,i+1),r.setStart(e,i);let o=ku(r,1);if(o.top!=o.bottom&&aR(t,o))return{node:e,offset:i+(t.left>=(o.left+o.right)/2?1:0)}}return{node:e,offset:0}}function aR(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function xOe(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function COe(e,t,n){let{node:r,offset:i}=aV(t,n),o=-1;if(r.nodeType==1&&!r.firstChild){let a=r.getBoundingClientRect();o=a.left!=a.right&&n.left>(a.left+a.right)/2?1:-1}return e.docView.posFromDOM(r,i,o)}function AOe(e,t,n,r){let i=-1;for(let o=t;o!=e.dom;){let a=e.docView.nearestDesc(o,!0);if(!a)return null;if(a.node.isBlock&&a.parent){let u=a.dom.getBoundingClientRect();if(u.left>r.left||u.top>r.top)i=a.posBefore;else if(u.right<r.left||u.bottom<r.top)i=a.posAfter;else break}o=a.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,1)}function uV(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),o=i;;){let a=e.childNodes[o];if(a.nodeType==1){let u=a.getClientRects();for(let s=0;s<u.length;s++){let c=u[s];if(aR(t,c))return uV(a,t,c)}}if((o=(o+1)%r)==i)break}return e}function kOe(e,t){let n=e.dom.ownerDocument,r,i=0;if(n.caretPositionFromPoint)try{let s=n.caretPositionFromPoint(t.left,t.top);s&&({offsetNode:r,offset:i}=s)}catch{}if(!r&&n.caretRangeFromPoint){let s=n.caretRangeFromPoint(t.left,t.top);s&&({startContainer:r,startOffset:i}=s)}let o=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top+1),a;if(!o||!e.dom.contains(o.nodeType!=1?o.parentNode:o)){let s=e.dom.getBoundingClientRect();if(!aR(t,s)||(o=uV(e.dom,t,s),!o))return null}if(er)for(let s=o;r&&s;s=iR(s))s.draggable&&(r=void 0);if(o=xOe(o,t),r){if(co&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let s=r.childNodes[i],c;s.nodeName=="IMG"&&(c=s.getBoundingClientRect()).right<=t.left&&c.bottom>t.top&&i++}r==e.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?a=e.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(a=AOe(e,r,i,t))}a==null&&(a=COe(e,o,t));let u=e.docView.nearestDesc(o,!0);return{pos:a,inside:u?u.posAtStart-u.border:-1}}function ku(e,t){let n=e.getClientRects();return n.length?n[t<0?0:n.length-1]:e.getBoundingClientRect()}const WOe=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function sV(e,t,n){let{node:r,offset:i}=e.docView.domFromPos(t,n<0?-1:1),o=kb||co;if(r.nodeType==3)if(o&&(WOe.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let a=ku($a(r,i,i),n);if(co&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let u=ku($a(r,i-1,i-1),-1);if(u.top==a.top){let s=ku($a(r,i,i+1),-1);if(s.top!=a.top)return Lh(s,s.left<u.left)}}return a}else{let a=i,u=i,s=n<0?1:-1;return n<0&&!i?(u++,s=-1):n>=0&&i==r.nodeValue.length?(a--,s=1):n<0?a--:u++,Lh(ku($a(r,a,u),s),s<0)}if(!e.state.doc.resolve(t).parent.inlineContent){if(i&&(n<0||i==fo(r))){let a=r.childNodes[i-1];if(a.nodeType==1)return uR(a.getBoundingClientRect(),!1)}if(i<fo(r)){let a=r.childNodes[i];if(a.nodeType==1)return uR(a.getBoundingClientRect(),!0)}return uR(r.getBoundingClientRect(),n>=0)}if(i&&(n<0||i==fo(r))){let a=r.childNodes[i-1],u=a.nodeType==3?$a(a,fo(a)-(o?0:1)):a.nodeType==1&&(a.nodeName!="BR"||!a.nextSibling)?a:null;if(u)return Lh(ku(u,1),!1)}if(i<fo(r)){let a=r.childNodes[i];for(;a.pmViewDesc&&a.pmViewDesc.ignoreForCoords;)a=a.nextSibling;let u=a?a.nodeType==3?$a(a,0,o?0:1):a.nodeType==1?a:null:null;if(u)return Lh(ku(u,-1),!0)}return Lh(ku(r.nodeType==3?$a(r):r,-n),n>=0)}function Lh(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function uR(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function cV(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}function NOe(e,t,n){let r=t.selection,i=n=="up"?r.$from:r.$to;return cV(e,t,()=>{let{node:o}=e.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let u=e.docView.nearestDesc(o,!0);if(!u)break;if(u.node.isBlock){o=u.dom;break}o=u.dom.parentNode}let a=sV(e,i.pos,1);for(let u=o.firstChild;u;u=u.nextSibling){let s;if(u.nodeType==1)s=u.getClientRects();else if(u.nodeType==3)s=$a(u,0,u.nodeValue.length).getClientRects();else continue;for(let c=0;c<s.length;c++){let l=s[c];if(l.bottom>l.top+1&&(n=="up"?a.top-l.top>(l.bottom-a.top)*2:l.bottom-a.bottom>(a.bottom-l.top)*2))return!1}}return!0})}const POe=/[\u0590-\u08ac]/;function FOe(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,a=i==r.parent.content.size,u=e.domSelection();return!POe.test(r.parent.textContent)||!u.modify?n=="left"||n=="backward"?o:a:cV(e,t,()=>{let s=u.getRangeAt(0),c=u.focusNode,l=u.focusOffset,f=u.caretBidiLevel;u.modify("move",n,"character");let p=!(r.depth?e.docView.domAfterPos(r.before()):e.dom).contains(u.focusNode.nodeType==1?u.focusNode:u.focusNode.parentNode)||c==u.focusNode&&l==u.focusOffset;return u.removeAllRanges(),u.addRange(s),f!=null&&(u.caretBidiLevel=f),p})}let lV=null,fV=null,dV=!1;function DOe(e,t,n){return lV==t&&fV==n?dV:(lV=t,fV=n,dV=n=="up"||n=="down"?NOe(e,t,n):FOe(e,t,n))}const Ri=0,pV=1,jf=2,po=3;class jh{constructor(t,n,r,i){this.parent=t,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=Ri,r.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,n,r){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let n=0;n<this.children.length;n++)t+=this.children[n].size;return t}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let t=0;t<this.children.length;t++)this.children[t].destroy()}posBeforeChild(t){for(let n=0,r=this.posAtStart;;n++){let i=this.children[n];if(i==t)return r;r+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(t,n,r){if(this.contentDOM&&this.contentDOM.contains(t.nodeType==1?t:t.parentNode))if(r<0){let o,a;if(t==this.contentDOM)o=t.childNodes[n-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;o=t.previousSibling}for(;o&&!((a=o.pmViewDesc)&&a.parent==this);)o=o.previousSibling;return o?this.posBeforeChild(a)+a.size:this.posAtStart}else{let o,a;if(t==this.contentDOM)o=t.childNodes[n];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;o=t.nextSibling}for(;o&&!((a=o.pmViewDesc)&&a.parent==this);)o=o.nextSibling;return o?this.posBeforeChild(a):this.posAtEnd}let i;if(t==this.dom&&this.contentDOM)i=n>_r(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=t.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let o=t;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&n==t.childNodes.length)for(let o=t;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return(i==null?r>0:i)?this.posAtEnd:this.posAtStart}nearestDesc(t,n=!1){for(let r=!0,i=t;i;i=i.parentNode){let o=this.getDesc(i),a;if(o&&(!n||o.node))if(r&&(a=o.nodeDOM)&&!(a.nodeType==1?a.contains(t.nodeType==1?t:t.parentNode):a==t))r=!1;else return o}}getDesc(t){let n=t.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(t,n,r){for(let i=t;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(t,n,r)}return-1}descAt(t){for(let n=0,r=0;n<this.children.length;n++){let i=this.children[n],o=r+i.size;if(r==t&&o!=r){for(;!i.border&&i.children.length;)i=i.children[0];return i}if(t<o)return i.descAt(t-r-i.border);r=o}}domFromPos(t,n){if(!this.contentDOM)return{node:this.dom,offset:0};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 vV){i=t-o;break}o=u}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof hV&&o.side>=0;r--);if(n<=0){let o,a=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,a=!1);return o&&n&&a&&!o.border&&!o.domAtom?o.domFromPos(o.size,n):{node:this.contentDOM,offset:o?_r(o.dom)+1:0}}else{let o,a=!0;for(;o=r<this.children.length?this.children[r]:null,!(!o||o.dom.parentNode==this.contentDOM);r++,a=!1);return o&&a&&!o.border&&!o.domAtom?o.domFromPos(0,n):{node:this.contentDOM,offset:o?_r(o.dom):this.contentDOM.childNodes.length}}}parseRange(t,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:t,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,o=-1;for(let a=r,u=0;;u++){let s=this.children[u],c=a+s.size;if(i==-1&&t<=c){let l=a+s.border;if(t>=l&&n<=c-s.border&&s.node&&s.contentDOM&&this.contentDOM.contains(s.contentDOM))return s.parseRange(t,n,l);t=a;for(let f=u;f>0;f--){let d=this.children[f-1];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(1)){i=_r(d.dom)+1;break}t-=d.size}i==-1&&(i=0)}if(i>-1&&(c>n||u==this.children.length-1)){n=c;for(let l=u+1;l<this.children.length;l++){let f=this.children[l];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){o=_r(f.dom);break}n+=f.size}o==-1&&(o=this.contentDOM.childNodes.length);break}a=c}return{node:this.contentDOM,from:t,to:n,fromOffset:i,toOffset:o}}emptyChildAt(t){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[t<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(t)}domAfterPos(t){let{node:n,offset:r}=this.domFromPos(t,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+t);return n.childNodes[r]}setSelection(t,n,r,i=!1){let o=Math.min(t,n),a=Math.max(t,n);for(let d=0,p=0;d<this.children.length;d++){let h=this.children[d],v=p+h.size;if(o>p&&a<v)return h.setSelection(t-p-h.border,n-p-h.border,r,i);p=v}let u=this.domFromPos(t,t?-1:1),s=n==t?u:this.domFromPos(n,n?-1:1),c=r.getSelection(),l=!1;if((co||er)&&t==n){let{node:d,offset:p}=u;if(d.nodeType==3){if(l=!!(p&&d.nodeValue[p-1]==`
36
+ `),l&&p==d.nodeValue.length)for(let h=d,v;h;h=h.parentNode){if(v=h.nextSibling){v.nodeName=="BR"&&(u=s={node:v.parentNode,offset:_r(v)+1});break}let y=h.pmViewDesc;if(y&&y.node&&y.node.isBlock)break}}else{let h=d.childNodes[p-1];l=h&&(h.nodeName=="BR"||h.contentEditable=="false")}}if(co&&c.focusNode&&c.focusNode!=s.node&&c.focusNode.nodeType==1){let d=c.focusNode.childNodes[c.focusOffset];d&&d.contentEditable=="false"&&(i=!0)}if(!(i||l&&er)&&Dh(u.node,u.offset,c.anchorNode,c.anchorOffset)&&Dh(s.node,s.offset,c.focusNode,c.focusOffset))return;let f=!1;if((c.extend||t==n)&&!l){c.collapse(u.node,u.offset);try{t!=n&&c.extend(s.node,s.offset),f=!0}catch(d){if(!(d instanceof DOMException))throw d}}if(!f){if(t>n){let p=u;u=s,s=p}let d=document.createRange();d.setEnd(s.node,s.offset),d.setStart(u.node,u.offset),c.removeAllRanges(),c.addRange(d)}}ignoreMutation(t){return!this.contentDOM&&t.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,n){for(let r=0,i=0;i<this.children.length;i++){let o=this.children[i],a=r+o.size;if(r==a?t<=a&&n>=r:t<a&&n>r){let u=r+o.border,s=a-o.border;if(t>=u&&n<=s){this.dirty=t==r||n==a?jf:pV,t==u&&n==s&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=po:o.markDirty(t-u,n-u);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?jf:po}r=a}this.dirty=jf}markParentsDirty(){let t=1;for(let n=this.parent;n;n=n.parent,t++){let r=t==1?jf:pV;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class hV extends jh{constructor(t,n,r,i){let o,a=n.type.toDOM;if(typeof a=="function"&&(a=a(r,()=>{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!n.type.spec.raw){if(a.nodeType!=1){let u=document.createElement("span");u.appendChild(a),a=u}a.contentEditable="false",a.classList.add("ProseMirror-widget")}super(t,[],a,null),this.widget=n,this.widget=n,o=this}matchesWidget(t){return this.dirty==Ri&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let n=this.widget.spec.stopEvent;return n?n(t):!1}ignoreMutation(t){return t.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class LOe extends jh{constructor(t,n,r,i){super(t,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(t,n){return t!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return t.type==="characterData"&&t.target.nodeValue==t.oldValue}}class vc extends jh{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=uo.renderSpec(document,n.type.spec.toDOM(n,r))),new vc(t,n,a.dom,a.contentDOM||a.dom)}parseRule(){return this.dirty&po||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM||void 0}}matchesMark(t){return this.dirty!=po&&this.mark.eq(t)}markDirty(t,n){if(super.markDirty(t,n),this.dirty!=Ri){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Ri}}slice(t,n,r){let i=vc.create(this.parent,this.mark,!0,r),o=this.children,a=this.size;n<a&&(o=lR(o,n,a,r)),t>0&&(o=lR(o,0,t,r));for(let u=0;u<o.length;u++)o[u].parent=i;return i.children=o,i}}class gc extends jh{constructor(t,n,r,i,o,a,u,s,c){super(t,[],o,a),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=u,a&&this.updateChildren(s,c)}static create(t,n,r,i,o,a){let u=o.nodeViews[n.type.name],s,c=u&&u(n,o,()=>{if(!s)return a;if(s.parent)return s.parent.posBeforeChild(s)},r,i),l=c&&c.dom,f=c&&c.contentDOM;if(n.isText){if(!l)l=document.createTextNode(n.text);else if(l.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else l||({dom:l,contentDOM:f}=uo.renderSpec(document,n.type.spec.toDOM(n)));!f&&!n.isText&&l.nodeName!="BR"&&(l.hasAttribute("contenteditable")||(l.contentEditable="false"),n.type.spec.draggable&&(l.draggable=!0));let d=l;return l=bV(l,r,n),c?s=new jOe(t,n,r,i,l,f||null,d,c,o,a+1):n.isText?new Wb(t,n,r,i,l,d,o):new gc(t,n,r,i,l,f||null,d,o,a+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(t.preserveWhitespace="full"),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){t.contentElement=r.dom.parentNode;break}}t.contentElement||(t.getContent=()=>V.empty)}return t}matchesNode(t,n,r){return this.dirty==Ri&&t.eq(this.node)&&cR(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 BOe(this,a&&a.node);KOe(this.node,this.innerDeco,(c,l,f)=>{c.spec.marks?s.syncToMarks(c.spec.marks,r,t):c.type.side>=0&&!f&&s.syncToMarks(l==this.node.childCount?Ge.none:this.node.child(l).marks,r,t),s.placeWidget(c,t,i)},(c,l,f,d)=>{s.syncToMarks(c.marks,r,t);let p;s.findNodeMatch(c,l,f,d)||u&&t.state.selection.from>i&&t.state.selection.to<i+c.nodeSize&&(p=s.findIndexWithChild(o.node))>-1&&s.updateNodeAt(c,l,f,p,t)||s.updateNextNode(c,l,f,t,d)||s.addNode(c,l,f,t,i),i+=c.nodeSize}),s.syncToMarks([],r,t),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||this.dirty==jf)&&(a&&this.protectLocalComposition(t,a),gV(this.contentDOM,this.children,t),Ff&&VOe(this.dom))}localCompositionInfo(t,n){let{from:r,to:i}=t.state.selection;if(!(t.state.selection instanceof Ae)||r<n||i>n+this.node.content.size)return null;let o=t.domSelection(),a=HOe(o.focusNode,o.focusOffset);if(!a||!this.dom.contains(a.parentNode))return null;if(this.node.inlineContent){let u=a.nodeValue,s=JOe(this.node.content,u,r-n,i-n);return s<0?null:{node:a,pos:s,text:u}}else return{node:a,pos:-1,text:""}}protectLocalComposition(t,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let o=n;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let a=new LOe(this,o,n,i);t.input.compositionNodes.push(a),this.children=lR(this.children,r,r+i.length,t,a)}update(t,n,r,i){return this.dirty==po||!t.sameMarkup(this.node)?!1:(this.updateInner(t,n,r,i),!0)}updateInner(t,n,r,i){this.updateOuterDeco(n),this.node=t,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=Ri}updateOuterDeco(t){if(cR(t,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=yV(this.dom,this.nodeDOM,sR(this.outerDeco,this.node,n),sR(t,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function mV(e,t,n,r,i){return bV(r,t,e),new gc(void 0,e,t,n,r,r,r,i,0)}class Wb extends gc{constructor(t,n,r,i,o,a,u){super(t,n,r,i,o,null,a,u,0)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,n,r,i){return this.dirty==po||this.dirty!=Ri&&!this.inParent()||!t.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Ri||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=Ri,!0)}inParent(){let t=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,n,r){return t==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(t,n,r)}ignoreMutation(t){return t.type!="characterData"&&t.type!="selection"}slice(t,n,r){let i=this.node.cut(t,n),o=document.createTextNode(i.text);return new Wb(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(t,n){super.markDirty(t,n),this.dom!=this.nodeDOM&&(t==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=po)}get domAtom(){return!1}}class vV extends jh{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==Ri&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class jOe extends gc{constructor(t,n,r,i,o,a,u,s,c,l){super(t,n,r,i,o,a,u,c,l),this.spec=s}update(t,n,r,i){if(this.dirty==po)return!1;if(this.spec.update){let o=this.spec.update(t,n,r);return o&&this.updateInner(t,n,r,i),o}else return!this.contentDOM&&!t.isLeaf?!1:super.update(t,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,n,r,i){this.spec.setSelection?this.spec.setSelection(t,n,r):super.setSelection(t,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return this.spec.stopEvent?this.spec.stopEvent(t):!1}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function gV(e,t,n){let r=e.firstChild,i=!1;for(let o=0;o<t.length;o++){let a=t[o],u=a.dom;if(u.parentNode==e){for(;u!=r;)r=$V(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(u,r);if(a instanceof vc){let s=r?r.previousSibling:e.lastChild;gV(a.contentDOM,a.children,n),r=s?s.nextSibling:e.firstChild}}for(;r;)r=$V(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}const Uh=function(e){e&&(this.nodeName=e)};Uh.prototype=Object.create(null);const yc=[new Uh];function sR(e,t,n){if(e.length==0)return yc;let r=n?yc[0]:new Uh,i=[r];for(let o=0;o<e.length;o++){let a=e[o].type.attrs;if(!!a){a.nodeName&&i.push(r=new Uh(a.nodeName));for(let u in a){let s=a[u];s!=null&&(n&&i.length==1&&i.push(r=new Uh(t.isInline?"span":"div")),u=="class"?r.class=(r.class?r.class+" ":"")+s:u=="style"?r.style=(r.style?r.style+";":"")+s:u!="nodeName"&&(r[u]=s))}}}return i}function yV(e,t,n,r){if(n==yc&&r==yc)return t;let i=t;for(let o=0;o<r.length;o++){let a=r[o],u=n[o];if(o){let s;u&&u.nodeName==a.nodeName&&i!=e&&(s=i.parentNode)&&s.nodeName.toLowerCase()==a.nodeName||(s=document.createElement(a.nodeName),s.pmIsDeco=!0,s.appendChild(i),u=yc[0]),i=s}UOe(i,u||yc[0],a)}return i}function UOe(e,t,n){for(let r in t)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&e.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let o=0;o<r.length;o++)i.indexOf(r[o])==-1&&e.classList.remove(r[o]);for(let o=0;o<i.length;o++)r.indexOf(i[o])==-1&&e.classList.add(i[o]);e.classList.length==0&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(t.style);)e.style.removeProperty(i[1])}n.style&&(e.style.cssText+=n.style)}}function bV(e,t,n){return yV(e,e,yc,sR(t,n,e.nodeType!=1))}function cR(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function $V(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class BOe{constructor(t,n){this.lock=n,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=zOe(t.node.content,t)}destroyBetween(t,n){if(t!=n){for(let r=t;r<n;r++)this.top.children[r].destroy();this.top.children.splice(t,n-t),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(t,n,r){let i=0,o=this.stack.length>>1,a=Math.min(o,t.length);for(;i<a&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(t[i])&&t[i].type.spec.spanning!==!1;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=Ri,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++)if(this.top.children[s].matchesMark(t[o])){u=s;break}if(u>-1)u>this.index&&(this.changed=!0,this.destroyBetween(this.index,u)),this.top=this.top.children[this.index];else{let s=vc.create(this.top,t[o],n,r);this.top.children.splice(this.index,0,s),this.top=s,this.changed=!0}this.index=0,o++}}findNodeMatch(t,n,r,i){let o=-1,a;if(i>=this.preMatch.index&&(a=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&a.matchesNode(t,n,r))o=this.top.children.indexOf(a,this.index);else for(let u=this.index,s=Math.min(this.top.children.length,u+5);u<s;u++){let c=this.top.children[u];if(c.matchesNode(t,n,r)&&!this.preMatch.matched.has(c)){o=u;break}}return o<0?!1:(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(t,n,r,i,o){let a=this.top.children[i];return a.dirty==po&&a.dom==a.contentDOM&&(a.dirty=jf),a.update(t,n,r,o)?(this.destroyBetween(this.index,i),this.index=i+1,!0):!1}findIndexWithChild(t){for(;;){let n=t.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=t.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}t=n}}updateNextNode(t,n,r,i,o){for(let a=this.index;a<this.top.children.length;a++){let u=this.top.children[a];if(u instanceof gc){let s=this.preMatch.matched.get(u);if(s!=null&&s!=o)return!1;let c=u.dom;if(!(this.lock&&(c==this.lock||c.nodeType==1&&c.contains(this.lock.parentNode))&&!(t.isText&&u.node&&u.node.isText&&u.nodeDOM.nodeValue==t.text&&u.dirty!=po&&cR(n,u.outerDeco)))&&u.update(t,n,r,i))return this.destroyBetween(this.index,a),u.dom!=c&&(this.changed=!0),this.index++,!0;break}}return!1}addNode(t,n,r,i,o){this.top.children.splice(this.index++,0,gc.create(this.top,t,n,r,i,o)),this.changed=!0}placeWidget(t,n,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(t)&&(t==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let o=new hV(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 vc;)n=t,t=n.children[n.children.length-1];(!t||!(t instanceof Wb)||/\n$/.test(t.node.text))&&((er||An)&&t&&t.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(t,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(t))this.index++;else{let r=document.createElement(t);t=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),t=="BR"&&(r.className="ProseMirror-trailingBreak");let i=new vV(this.top,[],r,null);n!=this.top?n.children.push(i):n.children.splice(this.index++,0,i),this.changed=!0}}}function zOe(e,t){let n=t,r=n.children.length,i=e.childCount,o=new Map,a=[];e:for(;i>0;){let u;for(;;)if(r){let c=n.children[r-1];if(c instanceof vc)n=c,r=c.children.length;else{u=c,r--;break}}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let s=u.node;if(!!s){if(s!=e.child(i-1))break;--i,o.set(u,i),a.push(u)}}return{index:i,matched:o,matches:a.reverse()}}function qOe(e,t){return e.type.side-t.type.side}function KOe(e,t,n,r){let i=t.locals(e),o=0;if(i.length==0){for(let c=0;c<e.childCount;c++){let l=e.child(c);r(l,i,t.forChild(o,l),c),o+=l.nodeSize}return}let a=0,u=[],s=null;for(let c=0;;){if(a<i.length&&i[a].to==o){let h=i[a++],v;for(;a<i.length&&i[a].to==o;)(v||(v=[h])).push(i[a++]);if(v){v.sort(qOe);for(let y=0;y<v.length;y++)n(v[y],c,!!s)}else n(h,c,!!s)}let l,f;if(s)f=-1,l=s,s=null;else if(c<e.childCount)f=c,l=e.child(c++);else break;for(let h=0;h<u.length;h++)u[h].to<=o&&u.splice(h--,1);for(;a<i.length&&i[a].from<=o&&i[a].to>o;)u.push(i[a++]);let d=o+l.nodeSize;if(l.isText){let h=d;a<i.length&&i[a].from<h&&(h=i[a].from);for(let v=0;v<u.length;v++)u[v].to<h&&(h=u[v].to);h<d&&(s=l.cut(h-o),l=l.cut(0,h-o),d=h,f=-1)}let p=l.isInline&&!l.isLeaf?u.filter(h=>!h.inline):u.slice();r(l,p,t.forChild(o,l),f),o=d}}function VOe(e){if(e.nodeName=="UL"||e.nodeName=="OL"){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}function HOe(e,t){for(;;){if(e.nodeType==3)return e;if(e.nodeType==1&&t>0){if(e.childNodes.length>t&&e.childNodes[t].nodeType==3)return e.childNodes[t];e=e.childNodes[t-1],t=fo(e)}else if(e.nodeType==1&&t<e.childNodes.length)e=e.childNodes[t],t=0;else return null}}function JOe(e,t,n,r){for(let i=0,o=0;i<e.childCount&&o<=r;){let a=e.child(i++),u=o;if(o+=a.nodeSize,!a.isText)continue;let s=a.text;for(;i<e.childCount;){let c=e.child(i++);if(o+=c.nodeSize,!c.isText)break;s+=c.text}if(o>=n){let c=u<r?s.lastIndexOf(t,r-u-1):-1;if(c>=0&&c+t.length+u>=n)return u+c;if(n==r&&s.length>=r+t.length-u&&s.slice(r-u,r-u+t.length)==t)return r}}return-1}function lR(e,t,n,r,i){let o=[];for(let a=0,u=0;a<e.length;a++){let s=e[a],c=u,l=u+=s.size;c>=n||l<=t?o.push(s):(c<t&&o.push(s.slice(0,t-c,r)),i&&(o.push(i),i=void 0),l>n&&o.push(s.slice(n-c,s.size,r)))}return o}function _V(e,t=null){let n=e.domSelection(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),o=i&&i.size==0,a=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(a<0)return null;let u=r.resolve(a),s,c;if(oR(n)){for(s=u;i&&!i.node;)i=i.parent;let l=i.node;if(i&&l.isAtom&&ve.isSelectable(l)&&i.parent&&!(l.isInline&&SOe(n.focusNode,n.focusOffset,i.dom))){let f=i.posBefore;c=new ve(a==f?u:r.resolve(f))}}else{let l=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null;s=r.resolve(l)}if(!c){let l=t=="pointer"||e.state.selection.head<u.pos&&!o?1:-1;c=dR(e,s,u,l)}return c}function SV(e){return e.editable?e.hasFocus():MV(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Wu(e,t=!1){let n=e.state.selection;if(wV(e,n),!!SV(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&An){let r=e.domSelection(),i=e.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&Dh(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)YOe(e);else{let{anchor:r,head:i}=n,o,a;TV&&!(n instanceof Ae)&&(n.$from.parent.inlineContent||(o=IV(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(a=IV(e,n.to))),e.docView.setSelection(r,i,e.root,t),TV&&(o&&OV(o),a&&OV(a)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&GOe(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const TV=er||An&&bOe<63;function IV(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(er&&i&&i.contentEditable=="false")return fR(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return fR(i);if(o)return fR(o)}}function fR(e){return e.contentEditable="true",er&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function OV(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function GOe(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelection(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!SV(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function YOe(e){let t=e.domSelection(),n=document.createRange(),r=e.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setEnd(r.parentNode,_r(r)+1):n.setEnd(r,0),n.collapse(!1),t.removeAllRanges(),t.addRange(n),!i&&!e.state.selection.visible&&$r&&Cu<=11&&(r.disabled=!0,r.disabled=!1)}function wV(e,t){if(t instanceof ve){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(EV(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else EV(e)}function EV(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function dR(e,t,n,r){return e.someProp("createSelectionBetween",i=>i(e,t,n))||Ae.between(t,n,r)}function RV(e){return e.editable&&e.root.activeElement!=e.dom?!1:MV(e)}function MV(e){let t=e.domSelection();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function ZOe(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelection();return Dh(t.node,t.offset,n.anchorNode,n.anchorOffset)}function pR(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return o&&Fe.findFrom(o,t)}function bc(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function xV(e,t,n){let r=e.state.selection;if(r instanceof Ae){if(!r.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){let i=pR(e.state,t);return i&&i instanceof ve?bc(e,i):!1}else if(!(Vr&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter,a;if(!o||o.isText)return!1;let u=t<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(a=e.docView.descAt(u))&&!a.contentDOM?ve.isSelectable(o)?bc(e,new ve(t<0?e.state.doc.resolve(i.pos-o.nodeSize):i)):kb?bc(e,new Ae(e.state.doc.resolve(t<0?u:u+o.nodeSize))):!1:!1}}else{if(r instanceof ve&&r.node.isInline)return bc(e,new Ae(t>0?r.$to:r.$from));{let i=pR(e.state,t);return i?bc(e,i):!1}}}function Nb(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Bh(e){let t=e.pmViewDesc;return t&&t.size==0&&(e.nextSibling||e.nodeName!="BR")}function hR(e){let t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,a=!1;for(co&&n.nodeType==1&&r<Nb(n)&&Bh(n.childNodes[r])&&(a=!0);;)if(r>0){if(n.nodeType!=1)break;{let u=n.childNodes[r-1];if(Bh(u))i=n,o=--r;else if(u.nodeType==3)n=u,r=n.nodeValue.length;else break}}else{if(CV(n))break;{let u=n.previousSibling;for(;u&&Bh(u);)i=n.parentNode,o=_r(u),u=u.previousSibling;if(u)n=u,r=Nb(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}a?vR(e,t,n,r):i&&vR(e,t,i,o)}function mR(e){let t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=Nb(n),o,a;for(;;)if(r<i){if(n.nodeType!=1)break;let u=n.childNodes[r];if(Bh(u))o=n,a=++r;else break}else{if(CV(n))break;{let u=n.nextSibling;for(;u&&Bh(u);)o=u.parentNode,a=_r(u)+1,u=u.nextSibling;if(u)n=u,r=0,i=Nb(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}}o&&vR(e,t,o,a)}function CV(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function vR(e,t,n,r){if(oR(t)){let o=document.createRange();o.setEnd(n,r),o.setStart(n,r),t.removeAllRanges(),t.addRange(o)}else t.extend&&t.extend(n,r);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&Wu(e)},50)}function AV(e,t,n){let r=e.state.selection;if(r instanceof Ae&&!r.empty||n.indexOf("s")>-1||Vr&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let a=pR(e.state,t);if(a&&a instanceof ve)return bc(e,a)}if(!i.parent.inlineContent){let a=t<0?i:o,u=r instanceof Ei?Fe.near(a,t):Fe.findFrom(a,t);return u?bc(e,u):!1}return!1}function kV(e,t){if(!(e.state.selection instanceof Ae))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let o=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let a=e.state.tr;return t<0?a.delete(n.pos-o.nodeSize,n.pos):a.delete(n.pos,n.pos+o.nodeSize),e.dispatch(a),!0}return!1}function WV(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function XOe(e){if(!er||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelection();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable=="false"){let r=t.firstChild;WV(e,r,"true"),setTimeout(()=>WV(e,r,"false"),20)}return!1}function QOe(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function ewe(e,t){let n=t.keyCode,r=QOe(t);return n==8||Vr&&n==72&&r=="c"?kV(e,-1)||hR(e):n==46||Vr&&n==68&&r=="c"?kV(e,1)||mR(e):n==13||n==27?!0:n==37||Vr&&n==66&&r=="c"?xV(e,-1,r)||hR(e):n==39||Vr&&n==70&&r=="c"?xV(e,1,r)||mR(e):n==38||Vr&&n==80&&r=="c"?AV(e,-1,r)||hR(e):n==40||Vr&&n==78&&r=="c"?XOe(e)||AV(e,1,r)||mR(e):r==(Vr?"m":"c")&&(n==66||n==73||n==89||n==90)}function NV(e,t){let n=[],{content:r,openStart:i,openEnd:o}=t;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let p=r.firstChild;n.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let a=e.someProp("clipboardSerializer")||uo.fromSchema(e.state.schema),u=zV(),s=u.createElement("div");s.appendChild(a.serializeFragment(r,{document:u}));let c=s.firstChild,l,f=0;for(;c&&c.nodeType==1&&(l=UV[c.nodeName.toLowerCase()]);){for(let p=l.length-1;p>=0;p--){let h=u.createElement(l[p]);for(;s.firstChild;)h.appendChild(s.firstChild);s.appendChild(h),f++}c=s.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${i} ${o}${f?` -${f}`:""} ${JSON.stringify(n)}`);let d=e.someProp("clipboardTextSerializer",p=>p(t))||t.content.textBetween(0,t.content.size,`
37
37
 
38
- `);return{dom:s,text:d}}function CV(e,t,n,r,i){let o=i.parent.type.spec.code,a,u;if(!n&&!t)return null;let s=t&&(r||o||!n);if(s){if(e.someProp("transformPastedText",d=>{t=d(t,o||r)}),o)return t?new Z(V.from(e.state.schema.text(t.replace(/\r\n?/g,`
39
- `))),0,0):Z.empty;let f=e.someProp("clipboardTextParser",d=>d(t,i,r));if(f)u=f;else{let d=i.marks(),{schema:p}=e.state,h=so.fromSchema(p);a=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(v=>{let y=a.appendChild(document.createElement("p"));v&&y.appendChild(h.serializeNode(p.text(v,d)))})}}else e.someProp("transformPastedHTML",f=>{n=f(n)}),a=VOe(n),Wb&&HOe(a);let c=a&&a.querySelector("[data-pm-slice]"),l=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(l&&l[3])for(let f=+l[3];f>0&&a.firstChild;f--)a=a.firstChild;if(u||(u=(e.someProp("clipboardParser")||e.someProp("domParser")||kf.fromSchema(e.state.schema)).parseSlice(a,{preserveWhitespace:!!(s||l),context:i,ruleFromNode(d){return d.nodeName=="BR"&&!d.nextSibling&&d.parentNode&&!qOe.test(d.parentNode.nodeName)?{ignore:!0}:null}})),l)u=JOe(NV(u,+l[1],+l[2]),l[4]);else if(u=Z.maxOpen(KOe(u.content,i),!0),u.openStart||u.openEnd){let f=0,d=0;for(let p=u.content.firstChild;f<u.openStart&&!p.type.spec.isolating;f++,p=p.firstChild);for(let p=u.content.lastChild;d<u.openEnd&&!p.type.spec.isolating;d++,p=p.lastChild);u=NV(u,f,d)}return e.someProp("transformPasted",f=>{u=f(u)}),u}const qOe=/^(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 KOe(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let i=t.node(n).contentMatchAt(t.index(n)),o,a=[];if(e.forEach(u=>{if(!a)return;let s=i.findWrapping(u.type),c;if(!s)return a=null;if(c=a.length&&o.length&&kV(s,o,u,a[a.length-1],0))a[a.length-1]=c;else{a.length&&(a[a.length-1]=WV(a[a.length-1],o.length));let l=AV(u,s);a.push(l),i=i.matchType(l.type),o=s}}),a)return V.from(a)}return e}function AV(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,V.from(e));return e}function kV(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let o=kV(e,t,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(V.from(AV(n,e,i+1))))}}function WV(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,WV(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(V.empty,!0);return e.copy(n.append(r))}function bR(e,t,n,r,i,o){let a=t<0?e.firstChild:e.lastChild,u=a.content;return i<r-1&&(u=bR(u,t,n,r,i+1,o)),i>=n&&(u=t<0?a.contentMatchAt(0).fillBefore(u,e.childCount>1||o<=i).append(u):u.append(a.contentMatchAt(a.childCount).fillBefore(V.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,a.copy(u))}function NV(e,t,n){return t<e.openStart&&(e=new Z(bR(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new Z(bR(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const PV={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let FV=null;function DV(){return FV||(FV=document.implementation.createHTMLDocument("title"))}function VOe(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=DV().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&PV[r[1].toLowerCase()])&&(e=i.map(o=>"<"+o+">").join("")+e+i.map(o=>"</"+o+">").reverse().join("")),n.innerHTML=e,i)for(let o=0;o<i.length;o++)n=n.querySelector(i[o])||n;return n}function HOe(e){let t=e.querySelectorAll(An?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent=="\xA0"&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}function JOe(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:i,openStart:o,openEnd:a}=e;for(let u=r.length-2;u>=0;u-=2){let s=n.nodes[r[u]];if(!s||s.hasRequiredAttrs())break;i=V.from(s.create(r[u+1],i)),o++,a++}return new Z(i,o,a)}const tr={};let kn={};class GOe{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.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function YOe(e){for(let t in tr){let n=tr[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=r=>{XOe(e,r)&&!_R(e,r)&&(e.editable||!(r.type in kn))&&n(e,r)})}er&&e.dom.addEventListener("input",()=>null),$R(e)}function _c(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function ZOe(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function $R(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=r=>_R(e,r))})}function _R(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function XOe(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function QOe(e,t){!_R(e,t)&&tr[t.type]&&(e.editable||!(t.type in kn))&&tr[t.type](e,t)}kn.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!jV(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(fo&&An&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),Lf&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();e.input.lastIOSEnter=r,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==r&&(e.someProp("handleKeyDown",i=>i(e,jf(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",r=>r(e,n))||zOe(e,n)?n.preventDefault():_c(e,"key")},kn.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)},kn.keypress=(e,t)=>{let n=t;if(jV(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Vr&&n.metaKey)return;if(e.someProp("handleKeyPress",i=>i(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof Ae)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode);e.someProp("handleTextInput",o=>o(e,r.$from.pos,r.$to.pos,i))||e.dispatch(e.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}};function Fb(e){return{left:e.clientX,top:e.clientY}}function ewe(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function SR(e,t,n,r,i){if(r==-1)return!1;let o=e.state.doc.resolve(r);for(let a=o.depth+1;a>0;a--)if(e.someProp(t,u=>a>o.depth?u(e,n,o.nodeAfter,o.before(a),i,!0):u(e,n,o.node(a),o.before(a),i,!1)))return!0;return!1}function zf(e,t,n){e.focused||e.focus();let r=e.state.tr.setSelection(t);n=="pointer"&&r.setMeta("pointer",!0),e.dispatch(r)}function twe(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&ve.isSelectable(r)?(zf(e,new ve(n),"pointer"),!0):!1}function nwe(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof ve&&(r=n.node);let o=e.state.doc.resolve(t);for(let a=o.depth+1;a>0;a--){let u=a>o.depth?o.nodeAfter:o.node(a);if(ve.isSelectable(u)){r&&n.$from.depth>0&&a>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?i=o.before(n.$from.depth):i=o.before(a);break}}return i!=null?(zf(e,ve.create(e.state.doc,i),"pointer"),!0):!1}function rwe(e,t,n,r,i){return SR(e,"handleClickOn",t,n,r)||e.someProp("handleClick",o=>o(e,t,r))||(i?nwe(e,n):twe(e,n))}function iwe(e,t,n,r){return SR(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",i=>i(e,t,r))}function owe(e,t,n,r){return SR(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",i=>i(e,t,r))||awe(e,n,r)}function awe(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?(zf(e,Ae.create(r,0,r.content.size),"pointer"),!0):!1;let i=r.resolve(t);for(let o=i.depth+1;o>0;o--){let a=o>i.depth?i.nodeAfter:i.node(o),u=i.before(o);if(a.inlineContent)zf(e,Ae.create(r,u+1,u+1+a.content.size),"pointer");else if(ve.isSelectable(a))zf(e,ve.create(r,u),"pointer");else continue;return!0}}function TR(e){return Db(e)}const LV=Vr?"metaKey":"ctrlKey";tr.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=TR(e),i=Date.now(),o="singleClick";i-e.input.lastClick.time<500&&ewe(n,e.input.lastClick)&&!n[LV]&&(e.input.lastClick.type=="singleClick"?o="doubleClick":e.input.lastClick.type=="doubleClick"&&(o="tripleClick")),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let a=e.posAtCoords(Fb(n));!a||(o=="singleClick"?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new uwe(e,a,n,!!r)):(o=="doubleClick"?iwe:owe)(e,a.pos,a.inside,n)?n.preventDefault():_c(e,"pointer"))};class uwe{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[LV],this.allowDefault=r.shiftKey;let o,a;if(n.inside>-1)o=t.state.doc.nodeAt(n.inside),a=n.inside;else{let l=t.state.doc.resolve(n.pos);o=l.parent,a=l.depth?l.before():0}const u=i?null:r.target,s=u?t.docView.nearestDesc(u,!0):null;this.target=s?s.dom:null;let{selection:c}=t.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||c instanceof ve&&c.from<=a&&c.to>a)&&(this.mightDrag={node:o,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&lo&&!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)),_c(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(()=>Pu(this.view)),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Fb(t))),this.allowDefault||!n?_c(this.view,"pointer"):rwe(this.view,n.pos,n.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||er&&this.mightDrag&&!this.mightDrag.node.isAtom||An&&!(this.view.state.selection instanceof Ae)&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(zf(this.view,Fe.near(this.view.state.doc.resolve(n.pos)),"pointer"),t.preventDefault()):_c(this.view,"pointer")}move(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0),_c(this.view,"pointer"),t.buttons==0&&this.done()}}tr.touchdown=e=>{TR(e),_c(e,"pointer")},tr.contextmenu=e=>TR(e);function jV(e,t){return e.composing?!0:er&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const swe=fo?5e3:-1;kn.compositionstart=kn.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))e.markCursor=e.state.storedMarks||n.marks(),Db(e,!0),e.markCursor=null;else if(Db(e),lo&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=e.domSelection();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let a=o<0?i.lastChild:i.childNodes[o-1];if(!a)break;if(a.nodeType==3){r.collapse(a,a.nodeValue.length);break}else i=a,o=-1}}e.input.composing=!0}UV(e,swe)},kn.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,UV(e,20))};function UV(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Db(e),t))}function BV(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=cwe());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function cwe(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function Db(e,t=!1){if(!(fo&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),BV(e),t||e.docView&&e.docView.dirty){let n=vV(e);return n&&!n.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(n)):e.updateState(e.state),!0}return!1}}function lwe(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}const qf=$r&&ku<15||Lf&&cOe<604;tr.copy=kn.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type=="cut";if(r.empty)return;let o=qf?null:n.clipboardData,a=r.content(),{dom:u,text:s}=xV(e,a);o?(n.preventDefault(),o.clearData(),o.setData("text/html",u.innerHTML),o.setData("text/plain",s)):lwe(e,u),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function fwe(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function dwe(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?IR(e,r.value,null,t):IR(e,r.textContent,r.innerHTML,t)},50)}function IR(e,t,n,r){let i=CV(e,t,n,e.input.shiftKey,e.state.selection.$from);if(e.someProp("handlePaste",u=>u(e,r,i||Z.empty)))return!0;if(!i)return!1;let o=fwe(i),a=o?e.state.tr.replaceSelectionWith(o,e.input.shiftKey):e.state.tr.replaceSelection(i);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}kn.paste=(e,t)=>{let n=t;if(e.composing&&!fo)return;let r=qf?null:n.clipboardData;r&&IR(e,r.getData("text/plain"),r.getData("text/html"),n)?n.preventDefault():dwe(e,n)};class pwe{constructor(t,n){this.slice=t,this.move=n}}const zV=Vr?"altKey":"ctrlKey";tr.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,o=i.empty?null:e.posAtCoords(Fb(n));if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof ve?i.to-1:i.to))){if(r&&r.mightDrag)e.dispatch(e.state.tr.setSelection(ve.create(e.state.doc,r.mightDrag.pos)));else if(n.target&&n.target.nodeType==1){let c=e.docView.nearestDesc(n.target,!0);c&&c.node.type.spec.draggable&&c!=e.docView&&e.dispatch(e.state.tr.setSelection(ve.create(e.state.doc,c.posBefore)))}}let a=e.state.selection.content(),{dom:u,text:s}=xV(e,a);n.dataTransfer.clearData(),n.dataTransfer.setData(qf?"Text":"text/html",u.innerHTML),n.dataTransfer.effectAllowed="copyMove",qf||n.dataTransfer.setData("text/plain",s),e.dragging=new pwe(a,!n[zV])},tr.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},kn.dragover=kn.dragenter=(e,t)=>t.preventDefault(),kn.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let i=e.posAtCoords(Fb(n));if(!i)return;let o=e.state.doc.resolve(i.pos);if(!o)return;let a=r&&r.slice;a?e.someProp("transformPasted",h=>{a=h(a)}):a=CV(e,n.dataTransfer.getData(qf?"Text":"text/plain"),qf?null:n.dataTransfer.getData("text/html"),!1,o);let u=!!(r&&!n[zV]);if(e.someProp("handleDrop",h=>h(e,n,a||Z.empty,u))){n.preventDefault();return}if(!a)return;n.preventDefault();let s=a?YIe(e.state.doc,o.pos,a):o.pos;s==null&&(s=o.pos);let c=e.state.tr;u&&c.deleteSelection();let l=c.mapping.map(s),f=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,d=c.doc;if(f?c.replaceRangeWith(l,l,a.content.firstChild):c.replaceRange(l,l,a),c.doc.eq(d))return;let p=c.doc.resolve(l);if(f&&ve.isSelectable(a.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new ve(p));else{let h=c.mapping.map(s);c.mapping.maps[c.mapping.maps.length-1].forEach((v,y,b,w)=>h=w),c.setSelection(hR(e,p,c.doc.resolve(h)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))},tr.focus=e=>{e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelection())&&Pu(e)},20))},tr.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},tr.beforeinput=(e,t)=>{if(An&&fo&&t.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:r}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=r||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",o=>o(e,jf(8,"Backspace")))))return;let{$cursor:i}=e.state.selection;i&&i.pos>0&&e.dispatch(e.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let e in kn)tr[e]=kn[e];function Bh(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class OR{constructor(t,n){this.toDOM=t,this.spec=n||Sc,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 Sr(o-r,o-r,this)}valid(){return!0}eq(t){return this==t||t instanceof OR&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Bh(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class Fu{constructor(t,n){this.attrs=t,this.spec=n||Sc}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 Sr(o,a,this)}valid(t,n){return n.from<n.to}eq(t){return this==t||t instanceof Fu&&Bh(this.attrs,t.attrs)&&Bh(this.spec,t.spec)}static is(t){return t.type instanceof Fu}destroy(){}}class wR{constructor(t,n){this.attrs=t,this.spec=n||Sc}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 Sr(o.pos-r,a.pos-r,this)}valid(t,n){let{index:r,offset:i}=t.content.findIndex(n.from),o;return i==n.from&&!(o=t.child(r)).isText&&i+o.nodeSize==n.to}eq(t){return this==t||t instanceof wR&&Bh(this.attrs,t.attrs)&&Bh(this.spec,t.spec)}destroy(){}}class Sr{constructor(t,n,r){this.from=t,this.to=n,this.type=r}copy(t,n){return new Sr(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 Sr(t,t,new OR(n,r))}static inline(t,n,r,i){return new Sr(t,n,new Fu(r,i))}static node(t,n,r,i){return new Sr(t,n,new wR(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Fu}}const Kf=[],Sc={};class Vt{constructor(t,n){this.local=t.length?t:Kf,this.children=n.length?n:Kf}static create(t,n){return n.length?Lb(n,t,0,Sc):bn}find(t,n,r){let i=[];return this.findInner(t==null?0:t,n==null?1e9:n,i,0,r),i}findInner(t,n,r,i,o){for(let a=0;a<this.local.length;a++){let u=this.local[a];u.from<=n&&u.to>=t&&(!o||o(u.spec))&&r.push(u.copy(u.from+i,u.to+i))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<n&&this.children[a+1]>t){let u=this.children[a]+1;this.children[a+2].findInner(t-u,n-u,r,i+u,o)}}map(t,n,r){return this==bn||t.maps.length==0?this:this.mapInner(t,n,0,0,r||Sc)}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?hwe(this.children,a||[],t,n,r,i,o):a?new Vt(a.sort(Tc),Kf):bn}add(t,n){return n.length?this==bn?Vt.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,o=0;t.forEach((u,s)=>{let c=s+r,l;if(!!(l=KV(n,u,c))){for(i||(i=this.children.slice());o<i.length&&i[o]<s;)o+=3;i[o]==s?i[o+2]=i[o+2].addInner(u,l,c+1):i.splice(o,0,s,s+u.nodeSize,Lb(l,u,c+1,Sc)),o+=3}});let a=qV(o?VV(n):n,-r);for(let u=0;u<a.length;u++)a[u].type.valid(t,a[u])||a.splice(u--,1);return new Vt(a.length?this.local.concat(a).sort(Tc):this.local,i||this.children)}remove(t){return t.length==0||this==bn?this:this.removeInner(t,0)}removeInner(t,n){let r=this.children,i=this.local;for(let o=0;o<r.length;o+=3){let a,u=r[o]+n,s=r[o+1]+n;for(let l=0,f;l<t.length;l++)(f=t[l])&&f.from>u&&f.to<s&&(t[l]=null,(a||(a=[])).push(f));if(!a)continue;r==this.children&&(r=this.children.slice());let c=r[o+2].removeInner(a,u+1);c!=bn?r[o+2]=c:(r.splice(o,3),o-=3)}if(i.length){for(let o=0,a;o<t.length;o++)if(a=t[o])for(let u=0;u<i.length;u++)i[u].eq(a,n)&&(i==this.local&&(i=this.local.slice()),i.splice(u--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new Vt(i,r):bn}forChild(t,n){if(this==bn)return this;if(n.isLeaf)return Vt.empty;let r,i;for(let u=0;u<this.children.length;u+=3)if(this.children[u]>=t){this.children[u]==t&&(r=this.children[u+2]);break}let o=t+1,a=o+n.content.size;for(let u=0;u<this.local.length;u++){let s=this.local[u];if(s.from<a&&s.to>o&&s.type instanceof Fu){let c=Math.max(o,s.from)-o,l=Math.min(a,s.to)-o;c<l&&(i||(i=[])).push(s.copy(c,l))}}if(i){let u=new Vt(i.sort(Tc),Kf);return r?new Du([u,r]):u}return r||bn}eq(t){if(this==t)return!0;if(!(t instanceof Vt)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(t.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=t.children[n]||this.children[n+1]!=t.children[n+1]||!this.children[n+2].eq(t.children[n+2]))return!1;return!0}locals(t){return ER(this.localsInner(t))}localsInner(t){if(this==bn)return Kf;if(t.inlineContent||!this.local.some(Fu.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Fu||n.push(this.local[r]);return n}}Vt.empty=new Vt([],[]),Vt.removeOverlap=ER;const bn=Vt.empty;class Du{constructor(t){this.members=t}map(t,n){const r=this.members.map(i=>i.map(t,n,Sc));return Du.from(r)}forChild(t,n){if(n.isLeaf)return Vt.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(t,n);o!=bn&&(o instanceof Du?r=r.concat(o.members):r.push(o))}return Du.from(r)}eq(t){if(!(t instanceof Du)||t.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(t.members[n]))return!1;return!0}locals(t){let n,r=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(t);if(!!o.length)if(!n)n=o;else{r&&(n=n.slice(),r=!1);for(let a=0;a<o.length;a++)n.push(o[a])}}return n?ER(r?n:n.sort(Tc)):Kf}static from(t){switch(t.length){case 0:return bn;case 1:return t[0];default:return new Du(t)}}}function hwe(e,t,n,r,i,o,a){let u=e.slice(),s=(l,f,d,p)=>{for(let h=0;h<u.length;h+=3){let v=u[h+1],y;if(v<0||l>v+o)continue;let b=u[h]+o;f>=b?u[h+1]=l<=b?-2:-1:d>=i&&(y=p-d-(f-l))&&(u[h]+=y,u[h+1]+=y)}};for(let l=0;l<n.maps.length;l++)n.maps[l].forEach(s);let c=!1;for(let l=0;l<u.length;l+=3)if(u[l+1]<0){if(u[l+1]==-2){c=!0,u[l+1]=-1;continue}let f=n.map(e[l]+o),d=f-i;if(d<0||d>=r.content.size){c=!0;continue}let p=n.map(e[l+1]+o,-1),h=p-i,{index:v,offset:y}=r.content.findIndex(d),b=r.maybeChild(v);if(b&&y==d&&y+b.nodeSize==h){let w=u[l+2].mapInner(n,b,f+1,e[l]+o+1,a);w!=bn?(u[l]=d,u[l+1]=h,u[l+2]=w):(u[l+1]=-2,c=!0)}else c=!0}if(c){let l=mwe(u,e,t,n,i,o,a),f=Lb(l,r,0,a);t=f.local;for(let d=0;d<u.length;d+=3)u[d+1]<0&&(u.splice(d,3),d-=3);for(let d=0,p=0;d<f.children.length;d+=3){let h=f.children[d];for(;p<u.length&&u[p]<h;)p+=3;u.splice(p,0,f.children[d],f.children[d+1],f.children[d+2])}}return new Vt(t.sort(Tc),u)}function qV(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new Sr(i.from+t,i.to+t,i.type))}return n}function mwe(e,t,n,r,i,o,a){function u(s,c){for(let l=0;l<s.local.length;l++){let f=s.local[l].map(r,i,c);f?n.push(f):a.onRemove&&a.onRemove(s.local[l].spec)}for(let l=0;l<s.children.length;l+=3)u(s.children[l+2],s.children[l]+c+1)}for(let s=0;s<e.length;s+=3)e[s+1]==-1&&u(e[s+2],t[s]+o+1);return n}function KV(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let o=0,a;o<e.length;o++)(a=e[o])&&a.from>n&&a.to<r&&((i||(i=[])).push(a),e[o]=null);return i}function VV(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function Lb(e,t,n,r){let i=[],o=!1;t.forEach((u,s)=>{let c=KV(e,u,s+n);if(c){o=!0;let l=Lb(c,u,n+s+1,r);l!=bn&&i.push(s,s+u.nodeSize,l)}});let a=qV(o?VV(e):e,-n).sort(Tc);for(let u=0;u<a.length;u++)a[u].type.valid(t,a[u])||(r.onRemove&&r.onRemove(a[u].spec),a.splice(u--,1));return a.length||i.length?new Vt(a,i):bn}function Tc(e,t){return e.from-t.from||e.to-t.to}function ER(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let o=t[i];if(o.from==r.from){o.to!=r.to&&(t==e&&(t=e.slice()),t[i]=o.copy(o.from,r.to),HV(t,i+1,o.copy(r.to,o.to)));continue}else{o.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,o.from),HV(t,i,r.copy(o.from,r.to)));break}}}return t}function HV(e,t,n){for(;t<e.length&&Tc(n,e[t])>0;)t++;e.splice(t,0,n)}function RR(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=bn&&t.push(r)}),e.cursorWrapper&&t.push(Vt.create(e.state.doc,[e.cursorWrapper.deco])),Du.from(t)}const vwe={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},gwe=$r&&ku<=11;class ywe{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 bwe{constructor(t,n){this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new ywe,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i<r.length;i++)this.queue.push(r[i]);$r&&ku<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),gwe&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&this.observer.observe(this.view.dom,vwe),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(!!TV(this.view)){if(this.suppressingSelectionUpdates)return Pu(this.view);if($r&&ku<=11&&!this.view.state.selection.empty){let t=this.view.domSelection();if(t.focusNode&&Fh(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelection())}ignoreSelectionChange(t){if(t.rangeCount==0)return!0;let n=t.getRangeAt(0).commonAncestorContainer,r=this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:"selection",target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}flush(){if(!this.view.docView||this.flushingSoon>-1)return;let t=this.observer?this.observer.takeRecords():[];this.queue.length&&(t=this.queue.concat(t),this.queue.length=0);let n=this.view.domSelection(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&TV(this.view)&&!this.ignoreSelectionChange(n),i=-1,o=-1,a=!1,u=[];if(this.view.editable)for(let s=0;s<t.length;s++){let c=this.registerMutation(t[s],u);c&&(i=i<0?c.from:Math.min(c.from,i),o=o<0?c.to:Math.max(c.to,o),c.typeOver&&(a=!0))}if(lo&&u.length>1){let s=u.filter(c=>c.nodeName=="BR");if(s.length==2){let c=s[0],l=s[1];c.parentNode&&c.parentNode.parentNode==l.parentNode?l.remove():c.remove()}}(i>-1||r)&&(i>-1&&(this.view.docView.markDirty(i,o),$we(this.view)),this.handleDOMChange(i,o,a,u),this.view.docView&&this.view.docView.dirty?this.view.updateState(this.view.state):this.currentSelection.eq(n)||Pu(this.view),this.currentSelection.set(n))}registerMutation(t,n){if(n.indexOf(t.target)>-1)return null;let r=this.view.docView.nearestDesc(t.target);if(t.type=="attributes"&&(r==this.view.docView||t.attributeName=="contenteditable"||t.attributeName=="style"&&!t.oldValue&&!t.target.getAttribute("style"))||!r||r.ignoreMutation(t))return null;if(t.type=="childList"){for(let l=0;l<t.addedNodes.length;l++)n.push(t.addedNodes[l]);if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(t.target))return{from:r.posBefore,to:r.posAfter};let i=t.previousSibling,o=t.nextSibling;if($r&&ku<=11&&t.addedNodes.length)for(let l=0;l<t.addedNodes.length;l++){let{previousSibling:f,nextSibling:d}=t.addedNodes[l];(!f||Array.prototype.indexOf.call(t.addedNodes,f)<0)&&(i=f),(!d||Array.prototype.indexOf.call(t.addedNodes,d)<0)&&(o=d)}let a=i&&i.parentNode==t.target?_r(i)+1:0,u=r.localPosFromDOM(t.target,a,-1),s=o&&o.parentNode==t.target?_r(o):t.target.childNodes.length,c=r.localPosFromDOM(t.target,s,1);return{from:u,to:c}}else return t.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:{from:r.posAtStart,to:r.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}}}let JV=!1;function $we(e){JV||(JV=!0,getComputedStyle(e.dom).whiteSpace=="normal"&&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."))}function _we(e,t,n){let{node:r,fromOffset:i,toOffset:o,from:a,to:u}=e.docView.parseRange(t,n),s=e.domSelection(),c,l=s.anchorNode;if(l&&e.dom.contains(l.nodeType==1?l:l.parentNode)&&(c=[{node:l,offset:s.anchorOffset}],uR(s)||c.push({node:s.focusNode,offset:s.focusOffset})),An&&e.input.lastKeyCode===8)for(let y=o;y>i;y--){let b=r.childNodes[y-1],w=b.pmViewDesc;if(b.nodeName=="BR"&&!w){o=y;break}if(!w||w.size)break}let f=e.state.doc,d=e.someProp("domParser")||kf.fromSchema(e.state.schema),p=f.resolve(a),h=null,v=d.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:o,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:Swe,context:p});if(c&&c[0].pos!=null){let y=c[0].pos,b=c[1]&&c[1].pos;b==null&&(b=y),h={anchor:y+a,head:b+a}}return{doc:v,sel:h,from:a,to:u}}function Swe(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName=="BR"&&e.parentNode){if(er&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(e.parentNode.lastChild==e||er&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}function Twe(e,t,n,r,i){if(t<0){let E=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,Y=vV(e,E);if(Y&&!e.state.selection.eq(Y)){let K=e.state.tr.setSelection(Y);E=="pointer"?K.setMeta("pointer",!0):E=="key"&&K.scrollIntoView(),e.dispatch(K)}return}let o=e.state.doc.resolve(t),a=o.sharedDepth(n);t=o.before(a+1),n=e.state.doc.resolve(n).after(a+1);let u=e.state.selection,s=_we(e,t,n);if(An&&e.cursorWrapper&&s.sel&&s.sel.anchor==e.cursorWrapper.deco.from){let E=e.cursorWrapper.deco.type.toDOM.nextSibling,Y=E&&E.nodeValue?E.nodeValue.length:1;s.sel={anchor:s.sel.anchor+Y,head:s.sel.anchor+Y}}let c=e.state.doc,l=c.slice(s.from,s.to),f,d;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(f=e.state.selection.to,d="end"):(f=e.state.selection.from,d="start"),e.input.lastKeyCode=null;let p=wwe(l.content,s.doc.content,s.from,f,d);if((Lf&&e.input.lastIOSEnter>Date.now()-225||fo)&&i.some(E=>E.nodeName=="DIV"||E.nodeName=="P")&&(!p||p.endA>=p.endB)&&e.someProp("handleKeyDown",E=>E(e,jf(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!p)if(r&&u instanceof Ae&&!u.empty&&u.$head.sameParent(u.$anchor)&&!e.composing&&!(s.sel&&s.sel.anchor!=s.sel.head))p={start:u.from,endA:u.to,endB:u.to};else{if(s.sel){let E=GV(e,e.state.doc,s.sel);E&&!E.eq(e.state.selection)&&e.dispatch(e.state.tr.setSelection(E))}return}e.input.domChangeCount++,e.state.selection.from<e.state.selection.to&&p.start==p.endB&&e.state.selection instanceof Ae&&(p.start>e.state.selection.from&&p.start<=e.state.selection.from+2&&e.state.selection.from>=s.from?p.start=e.state.selection.from:p.endA<e.state.selection.to&&p.endA>=e.state.selection.to-2&&e.state.selection.to<=s.to&&(p.endB+=e.state.selection.to-p.endA,p.endA=e.state.selection.to)),$r&&ku<=11&&p.endB==p.start+1&&p.endA==p.start&&p.start>s.from&&s.doc.textBetween(p.start-s.from-1,p.start-s.from+1)==" \xA0"&&(p.start--,p.endA--,p.endB--);let h=s.doc.resolveNoCache(p.start-s.from),v=s.doc.resolveNoCache(p.endB-s.from),y=c.resolve(p.start),b=h.sameParent(v)&&h.parent.inlineContent&&y.end()>=p.endA,w;if((Lf&&e.input.lastIOSEnter>Date.now()-225&&(!b||i.some(E=>E.nodeName=="DIV"||E.nodeName=="P"))||!b&&h.pos<s.doc.content.size&&(w=Fe.findFrom(s.doc.resolve(h.pos+1),1,!0))&&w.head==v.pos)&&e.someProp("handleKeyDown",E=>E(e,jf(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>p.start&&Owe(c,p.start,p.endA,h,v)&&e.someProp("handleKeyDown",E=>E(e,jf(8,"Backspace")))){fo&&An&&e.domObserver.suppressSelectionUpdates();return}An&&fo&&p.endB==p.start&&(e.input.lastAndroidDelete=Date.now()),fo&&!b&&h.start()!=v.start()&&v.parentOffset==0&&h.depth==v.depth&&s.sel&&s.sel.anchor==s.sel.head&&s.sel.head==p.endA&&(p.endB-=2,v=s.doc.resolveNoCache(p.endB-s.from),setTimeout(()=>{e.someProp("handleKeyDown",function(E){return E(e,jf(13,"Enter"))})},20));let F=p.start,g=p.endA,I,T,k;if(b){if(h.pos==v.pos)$r&&ku<=11&&h.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>Pu(e),20)),I=e.state.tr.delete(F,g),T=c.resolve(p.start).marksAcross(c.resolve(p.endA));else if(p.endA==p.endB&&(k=Iwe(h.parent.content.cut(h.parentOffset,v.parentOffset),y.parent.content.cut(y.parentOffset,p.endA-y.start()))))I=e.state.tr,k.type=="add"?I.addMark(F,g,k.mark):I.removeMark(F,g,k.mark);else if(h.parent.child(h.index()).isText&&h.index()==v.index()-(v.textOffset?0:1)){let E=h.parent.textBetween(h.parentOffset,v.parentOffset);if(e.someProp("handleTextInput",Y=>Y(e,F,g,E)))return;I=e.state.tr.insertText(E,F,g)}}if(I||(I=e.state.tr.replace(F,g,s.doc.slice(p.start-s.from,p.endB-s.from))),s.sel){let E=GV(e,I.doc,s.sel);E&&!(An&&fo&&e.composing&&E.empty&&(p.start!=p.endB||e.input.lastAndroidDelete<Date.now()-100)&&(E.head==F||E.head==I.mapping.map(g)-1)||$r&&E.empty&&E.head==F)&&I.setSelection(E)}T&&I.ensureMarks(T),e.dispatch(I.scrollIntoView())}function GV(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:hR(e,t.resolve(n.anchor),t.resolve(n.head))}function Iwe(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,o=r,a,u,s;for(let l=0;l<r.length;l++)i=r[l].removeFromSet(i);for(let l=0;l<n.length;l++)o=n[l].removeFromSet(o);if(i.length==1&&o.length==0)u=i[0],a="add",s=l=>l.mark(u.addToSet(l.marks));else if(i.length==0&&o.length==1)u=o[0],a="remove",s=l=>l.mark(u.removeFromSet(l.marks));else return null;let c=[];for(let l=0;l<t.childCount;l++)c.push(s(t.child(l)));if(V.from(c).eq(e))return{mark:u,type:a}}function Owe(e,t,n,r,i){if(!r.parent.isTextblock||n-t<=i.pos-r.pos||MR(r,!0,!1)<i.pos)return!1;let o=e.resolve(t);if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let a=e.resolve(MR(o,!0,!0));return!a.parent.isTextblock||a.pos>n||MR(a,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(a.parent.content)}function MR(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let o=e.node(r).maybeChild(e.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function wwe(e,t,n,r,i){let o=e.findDiffStart(t,n);if(o==null)return null;let{a,b:u}=e.findDiffEnd(t,n+e.size,n+t.size);if(i=="end"){let s=Math.max(0,o-Math.min(a,u));r-=a+s-o}return a<o&&e.size<t.size?(o-=r<=o&&r>=a?o-r:0,u=o+(u-a),a=o):u<o&&(o-=r<=o&&r>=u?o-r:0,a=o+(a-u),u=o),{start:o,endA:a,endB:u}}class Ewe{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 GOe,this.prevDirectPlugins=[],this.pluginViews=[],this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(e3),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):typeof t=="function"?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=XV(this),ZV(this),this.nodeViews=QV(this),this.docView=lV(this.state.doc,YV(this),RR(this),this.dom,this),this.domObserver=new bwe(this,(r,i,o,a)=>Twe(this,r,i,o,a)),this.domObserver.start(),YOe(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let n in t)this._props[n]=t[n];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&$R(this),this._props=t,t.plugins&&(t.plugins.forEach(e3),this.directPlugins=t.plugins),this.updateStateInner(t.state,!0)}setProps(t){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in t)n[r]=t[r];this.update(n)}updateState(t){this.updateStateInner(t,this.state.plugins!=t.plugins)}updateStateInner(t,n){let r=this.state,i=!1,o=!1;if(t.storedMarks&&this.composing&&(BV(this),o=!0),this.state=t,n){let f=QV(this);Mwe(f,this.nodeViews)&&(this.nodeViews=f,i=!0),$R(this)}this.editable=XV(this),ZV(this);let a=RR(this),u=YV(this),s=n?"reset":t.scrollToSelection>r.scrollToSelection?"to selection":"preserve",c=i||!this.docView.matchesNode(t.doc,u,a);(c||!t.selection.eq(r.selection))&&(o=!0);let l=s=="preserve"&&o&&this.dom.style.overflowAnchor==null&&mOe(this);if(o){this.domObserver.stop();let f=c&&($r||An)&&!this.composing&&!r.selection.empty&&!t.selection.empty&&Rwe(r.selection,t.selection);if(c){let d=An?this.trackWrites=this.domSelection().focusNode:null;(i||!this.docView.update(t.doc,u,a,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=lV(t.doc,u,a,this.dom,this)),d&&!this.trackWrites&&(f=!0)}f||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelection())&&jOe(this))?Pu(this,f):(_V(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}if(this.updatePluginViews(r),s=="reset")this.dom.scrollTop=0;else if(s=="to selection"){let f=this.domSelection().focusNode;if(!this.someProp("handleScrollToSelection",d=>d(this)))if(t.selection instanceof ve){let d=this.docView.domAfterPos(t.selection.from);d.nodeType==1&&XK(this,d.getBoundingClientRect(),f)}else XK(this,this.coordsAtPos(t.selection.head,1),f)}else l&&vOe(l)}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(!t||t.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,t)}}someProp(t,n){let r=this._props&&this._props[t],i;if(r!=null&&(i=n?n(r):r))return i;for(let a=0;a<this.directPlugins.length;a++){let u=this.directPlugins[a].props[t];if(u!=null&&(i=n?n(u):u))return i}let o=this.state.plugins;if(o)for(let a=0;a<o.length;a++){let u=o[a].props[t];if(u!=null&&(i=n?n(u):u))return i}}hasFocus(){return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&gOe(this.dom),Pu(this),this.domObserver.start()}get root(){let t=this._root;if(t==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return t||document}posAtCoords(t){return SOe(this,t)}coordsAtPos(t,n=1){return rV(this,t,n)}domAtPos(t,n=0){return this.docView.domFromPos(t,n)}nodeDOM(t){let n=this.docView.descAt(t);return n?n.nodeDOM:null}posAtDOM(t,n,r=-1){let i=this.docView.posFromDOM(t,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(t,n){return EOe(this,n||this.state,t)}destroy(){!this.docView||(ZOe(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],RR(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return this.docView==null}dispatchEvent(t){return QOe(this,t)}dispatch(t){let n=this._props.dispatchTransaction;n?n.call(this,t):this.updateState(this.state.apply(t))}domSelection(){return this.root.getSelection()}}function YV(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),t.translate="no",e.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(e.state)),n)for(let r in n)r=="class"&&(t.class+=" "+n[r]),r=="style"?t.style=(t.style?t.style+";":"")+n[r]:!t[r]&&r!="contenteditable"&&r!="nodeName"&&(t[r]=String(n[r]))}),[Sr.node(0,e.state.doc.content.size,t)]}function ZV(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:Sr.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function XV(e){return!e.someProp("editable",t=>t(e.state)===!1)}function Rwe(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function QV(e){let t=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(t,i)||(t[i]=r[i])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function Mwe(e,t){let n=0,r=0;for(let i in e){if(e[i]!=t[i])return!0;n++}for(let i in t)r++;return n!=r}function e3(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Lu={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:"'"},jb={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},t3=typeof navigator<"u"&&/Chrome\/(\d+)/.exec(navigator.userAgent);typeof navigator<"u"&&/Gecko\/\d+/.test(navigator.userAgent);for(var xwe=typeof navigator<"u"&&/Mac/.test(navigator.platform),Cwe=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Awe=xwe||t3&&+t3[1]<57,fn=0;fn<10;fn++)Lu[48+fn]=Lu[96+fn]=String(fn);for(var fn=1;fn<=24;fn++)Lu[fn+111]="F"+fn;for(var fn=65;fn<=90;fn++)Lu[fn]=String.fromCharCode(fn+32),jb[fn]=String.fromCharCode(fn);for(var xR in Lu)jb.hasOwnProperty(xR)||(jb[xR]=Lu[xR]);function kwe(e){var t=Awe&&(e.ctrlKey||e.altKey||e.metaKey)||Cwe&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?jb:Lu)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const Wwe=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function Nwe(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n=="Space"&&(n=" ");let r,i,o,a;for(let u=0;u<t.length-1;u++){let s=t[u];if(/^(cmd|meta|m)$/i.test(s))a=!0;else if(/^a(lt)?$/i.test(s))r=!0;else if(/^(c|ctrl|control)$/i.test(s))i=!0;else if(/^s(hift)?$/i.test(s))o=!0;else if(/^mod$/i.test(s))Wwe?a=!0:i=!0;else throw new Error("Unrecognized modifier name: "+s)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),a&&(n="Meta-"+n),o&&(n="Shift-"+n),n}function Pwe(e){let t=Object.create(null);for(let n in e)t[Nwe(n)]=e[n];return t}function CR(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n!==!1&&t.shiftKey&&(e="Shift-"+e),e}function Fwe(e){return new Kr({props:{handleKeyDown:Dwe(e)}})}function Dwe(e){let t=Pwe(e);return function(n,r){let i=kwe(r),o=i.length==1&&i!=" ",a,u=t[CR(i,r,!o)];if(u&&u(n.state,n.dispatch,n))return!0;if(o&&(r.shiftKey||r.altKey||r.metaKey||i.charCodeAt(0)>127)&&(a=Lu[r.keyCode])&&a!=i){let s=t[CR(a,r,!0)];if(s&&s(n.state,n.dispatch,n))return!0}else if(o&&r.shiftKey){let s=t[CR(i,r,!0)];if(s&&s(n.state,n.dispatch,n))return!0}return!1}}const n3=65535,r3=Math.pow(2,16);function Lwe(e,t){return e+t*r3}function i3(e){return e&n3}function jwe(e){return(e-(e&n3))/r3}const o3=1,a3=2,Ub=4,u3=8;class s3{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&u3)>0}get deletedBefore(){return(this.delInfo&(o3|Ub))>0}get deletedAfter(){return(this.delInfo&(a3|Ub))>0}get deletedAcross(){return(this.delInfo&Ub)>0}}class Mi{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&Mi.empty)return Mi.empty}recover(t){let n=0,r=i3(t);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+jwe(t)}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,r){let i=0,o=this.inverted?2:1,a=this.inverted?1:2;for(let u=0;u<this.ranges.length;u+=3){let s=this.ranges[u]-(this.inverted?i:0);if(s>t)break;let c=this.ranges[u+o],l=this.ranges[u+a],f=s+c;if(t<=f){let d=c?t==s?-1:t==f?1:n:n,p=s+i+(d<0?0:l);if(r)return p;let h=t==(n<0?s:f)?null:Lwe(u/3,t-s),v=t==s?a3:t==f?o3:Ub;return(n<0?t!=s:t!=f)&&(v|=u3),new s3(p,v,h)}i+=l-c}return r?t+i:new s3(t+i,0,null)}touches(t,n){let r=0,i=i3(n),o=this.inverted?2:1,a=this.inverted?1:2;for(let u=0;u<this.ranges.length;u+=3){let s=this.ranges[u]-(this.inverted?r:0);if(s>t)break;let c=this.ranges[u+o],l=s+c;if(t<=l&&u==i*3)return!0;r+=this.ranges[u+a]-c}return!1}forEach(t){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let a=this.ranges[i],u=a-(this.inverted?o:0),s=a+(this.inverted?0:o),c=this.ranges[i+n],l=this.ranges[i+r];t(u,u+c,s,s+l),o+=l-c}}invert(){return new Mi(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?Mi.empty:new Mi(t<0?[0,-t,0]:[0,0,t])}}Mi.empty=new Mi([]);const AR=Object.create(null);class ju{getMap(){return Mi.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=AR[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in AR)throw new RangeError("Duplicate use of step JSON ID "+t);return AR[t]=n,n.prototype.jsonID=t,n}}class Tr{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new Tr(t,null)}static fail(t){return new Tr(null,t)}static fromReplace(t,n,r,i){try{return Tr.ok(t.replace(n,r,i))}catch(o){if(o instanceof Af)return Tr.fail(o.message);throw o}}}function kR(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(kR(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return V.fromArray(r)}class Ic extends ju{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 Z(kR(n.content,(a,u)=>!a.isAtom||!u.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),i),n.openStart,n.openEnd);return Tr.fromReplace(t,this.from,this.to,o)}invert(){return new Oc(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 Ic(n.pos,r.pos,this.mark)}merge(t){return t instanceof Ic&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Ic(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Ic(n.from,n.to,t.markFromJSON(n.mark))}}ju.jsonID("addMark",Ic);class Oc extends ju{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 Z(kR(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),n.openStart,n.openEnd);return Tr.fromReplace(t,this.from,this.to,r)}invert(){return new Ic(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 Oc(n.pos,r.pos,this.mark)}merge(t){return t instanceof Oc&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Oc(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Oc(n.from,n.to,t.markFromJSON(n.mark))}}ju.jsonID("removeMark",Oc);class Sa extends ju{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&WR(t,this.from,this.to)?Tr.fail("Structure replace would overwrite content"):Tr.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new Mi([this.from,this.to-this.from,this.slice.size])}invert(t){return new Sa(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 Sa(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof Sa)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?Z.empty:new Z(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new Sa(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?Z.empty:new Z(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new Sa(t.from,this.to,n,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Sa(n.from,n.to,Z.fromJSON(t,n.slice),!!n.structure)}}ju.jsonID("replace",Sa);class Vf extends ju{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&&(WR(t,this.from,this.gapFrom)||WR(t,this.gapTo,this.to)))return Tr.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Tr.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Tr.fromReplace(t,this.from,this.to,r):Tr.fail("Content does not fit in gap")}getMap(){return new Mi([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 Vf(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 Vf(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Vf(n.from,n.to,n.gapFrom,n.gapTo,Z.fromJSON(t,n.slice),n.insert,!!n.structure)}}ju.jsonID("replaceAround",Vf);function WR(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let a=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}}return!1}function Uwe(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Bwe(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let r=e.depth;;--r){let i=e.$from.node(r),o=e.$from.index(r),a=e.$to.indexAfter(r);if(r<e.depth&&i.canReplace(o,a,n))return r;if(r==0||i.type.spec.isolating||!Uwe(i,o,a))break}return null}function zwe(e,t,n=null,r=e){let i=qwe(e,t),o=i&&Kwe(r,t);return o?i.map(c3).concat({type:t,attrs:n}).concat(o.map(c3)):null}function c3(e){return{type:e,attrs:null}}function qwe(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.contentMatchAt(r).findWrapping(t);if(!o)return null;let a=o.length?o[0]:t;return n.canReplaceWith(r,i,a)?o:null}function Kwe(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.child(r),a=t.contentMatch.findWrapping(o.type);if(!a)return null;let s=(a.length?a[a.length-1]:t).contentMatch;for(let c=r;s&&c<i;c++)s=s.matchType(n.child(c).type);return!s||!s.validEnd?null:a}function Bb(e,t,n=1,r){let i=e.resolve(t),o=i.depth-n,a=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!a.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,l=n-2;c>o;c--,l--){let f=i.node(c),d=i.index(c);if(f.type.spec.isolating)return!1;let p=f.content.cutByIndex(d,f.childCount),h=r&&r[l]||f;if(h!=f&&(p=p.replaceChild(0,h.type.create(h.attrs))),!f.canReplace(d+1,f.childCount)||!h.type.validContent(p))return!1}let u=i.indexAfter(o),s=r&&r[0];return i.node(o).canReplaceWith(u,u,s?s.type:i.node(o+1).type)}function NR(e,t){let n=e.resolve(t),r=n.index();return Vwe(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function Vwe(e,t){return!!(e&&t&&!e.isLeaf&&e.canAppend(t))}let zh=class extends Error{};zh=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},zh.prototype=Object.create(Error.prototype),zh.prototype.constructor=zh,zh.prototype.name="TransformError";const Hwe=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0),Jwe=(e,t,n)=>{let{$cursor:r}=e.selection;if(!r||(n?!n.endOfTextblock("backward",e):r.parentOffset>0))return!1;let i=l3(r);if(!i){let a=r.blockRange(),u=a&&kh(a);return u==null?!1:(t&&t(e.tr.lift(a,u).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&p3(e,i,t))return!0;if(r.parent.content.size==0&&(Hf(o,"end")||ve.isSelectable(o))){let a=YE(e.doc,r.before(),r.after(),Z.empty);if(a&&a.slice.size<a.to-a.from){if(t){let u=e.tr.step(a);u.setSelection(Hf(o,"end")?Fe.findFrom(u.doc.resolve(u.mapping.map(i.pos,-1)),-1):ve.create(u.doc,i.pos-o.nodeSize)),t(u.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1};function Hf(e,t,n=!1){for(let r=e;r;r=t=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const Gwe=(e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;o=l3(r)}let a=o&&o.nodeBefore;return!a||!ve.isSelectable(a)?!1:(t&&t(e.tr.setSelection(ve.create(e.doc,o.pos-a.nodeSize)).scrollIntoView()),!0)};function l3(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}const Ywe=(e,t,n)=>{let{$cursor:r}=e.selection;if(!r||(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size))return!1;let i=f3(r);if(!i)return!1;let o=i.nodeAfter;if(p3(e,i,t))return!0;if(r.parent.content.size==0&&(Hf(o,"start")||ve.isSelectable(o))){let a=YE(e.doc,r.before(),r.after(),Z.empty);if(a&&a.slice.size<a.to-a.from){if(t){let u=e.tr.step(a);u.setSelection(Hf(o,"start")?Fe.findFrom(u.doc.resolve(u.mapping.map(i.pos)),1):ve.create(u.doc,u.mapping.map(i.pos))),t(u.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0):!1},Zwe=(e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;o=f3(r)}let a=o&&o.nodeAfter;return!a||!ve.isSelectable(a)?!1:(t&&t(e.tr.setSelection(ve.create(e.doc,o.pos)).scrollIntoView()),!0)};function f3(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}const Xwe=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),o=i&&kh(i);return o==null?!1:(t&&t(e.tr.lift(i,o).scrollIntoView()),!0)},Qwe=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
40
- `).scrollIntoView()),!0)};function d3(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const e1e=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),a=d3(i.contentMatchAt(o));if(!a||!i.canReplaceWith(o,o,a))return!1;if(t){let u=n.after(),s=e.tr.replaceWith(u,u,a.createAndFill());s.setSelection(Fe.near(s.doc.resolve(u),1)),t(s.scrollIntoView())}return!0},t1e=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof Ei||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=d3(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let a=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,u=e.tr.insert(a,o.createAndFill());u.setSelection(Ae.create(u.doc,a+1)),t(u.scrollIntoView())}return!0},n1e=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(WK(e.doc,o))return t&&t(e.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&kh(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)},r1e=(e,t)=>{let{$from:n,to:r}=e.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),t&&t(e.tr.setSelection(ve.create(e.doc,i))),!0)};function i1e(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,o=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(o-1,o)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(o,o+1)||!(i.isTextblock||NK(e.doc,t.pos))?!1:(n&&n(e.tr.clearIncompatible(t.pos,r.type,r.contentMatchAt(r.childCount)).join(t.pos).scrollIntoView()),!0)}function p3(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,o,a;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(i1e(e,t,n))return!0;let u=t.parent.canReplace(t.index(),t.index()+1);if(u&&(o=(a=r.contentMatchAt(r.childCount)).findWrapping(i.type))&&a.matchType(o[0]||i.type).validEnd){if(n){let f=t.pos+i.nodeSize,d=V.empty;for(let v=o.length-1;v>=0;v--)d=V.from(o[v].create(null,d));d=V.from(r.copy(d));let p=e.tr.step(new ln(t.pos-1,f,t.pos,f,new Z(d,1,0),o.length,!0)),h=f+2*o.length;NK(p.doc,h)&&p.join(h),n(p.scrollIntoView())}return!0}let s=Fe.findFrom(t,1),c=s&&s.$from.blockRange(s.$to),l=c&&kh(c);if(l!=null&&l>=t.depth)return n&&n(e.tr.lift(c,l).scrollIntoView()),!0;if(u&&Hf(i,"start",!0)&&Hf(r,"end")){let f=r,d=[];for(;d.push(f),!f.isTextblock;)f=f.lastChild;let p=i,h=1;for(;!p.isTextblock;p=p.firstChild)h++;if(f.canReplace(f.childCount,f.childCount,p.content)){if(n){let v=V.empty;for(let b=d.length-1;b>=0;b--)v=V.from(d[b].copy(v));let y=e.tr.step(new ln(t.pos-d.length,t.pos+i.nodeSize,t.pos+h,t.pos+i.nodeSize-h,new Z(v,d.length,0),0,!0));n(y.scrollIntoView())}return!0}}return!1}function h3(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(n&&n(t.tr.setSelection(Ae.create(t.doc,e<0?i.start(o):i.end(o)))),!0):!1}}const o1e=h3(-1),a1e=h3(1);function u1e(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,a=i.blockRange(o),u=a&&AK(a,e,t);return u?(r&&r(n.tr.wrap(a,u).scrollIntoView()),!0):!1}}function m3(e,t=null){return function(n,r){let{from:i,to:o}=n.selection,a=!1;return n.doc.nodesBetween(i,o,(u,s)=>{if(a)return!1;if(!(!u.isTextblock||u.hasMarkup(e,t)))if(u.type==e)a=!0;else{let c=n.doc.resolve(s),l=c.index();a=c.parent.canReplaceWith(l,l+1,e)}}),a?(r&&r(n.tr.setBlockType(i,o,e,t).scrollIntoView()),!0):!1}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function s1e(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,a=i.blockRange(o),u=!1,s=a;if(!a)return!1;if(a.depth>=2&&i.node(a.depth-1).type.compatibleContent(e)&&a.startIndex==0){if(i.index(a.depth-1)==0)return!1;let l=n.doc.resolve(a.start-2);s=new Ib(l,l,a.depth),a.endIndex<a.parent.childCount&&(a=new Ib(i,n.doc.resolve(o.end(a.depth)),a.depth)),u=!0}let c=AK(s,e,t,a);return c?(r&&r(c1e(n.tr,a,c,u,e).scrollIntoView()),!0):!1}}function c1e(e,t,n,r,i){let o=V.empty;for(let l=n.length-1;l>=0;l--)o=V.from(n[l].type.create(n[l].attrs,o));e.step(new ln(t.start-(r?2:0),t.end,t.start,t.end,new Z(o,0,0),n.length,!0));let a=0;for(let l=0;l<n.length;l++)n[l].type==i&&(a=l+1);let u=n.length-a,s=t.start+n.length-(r?2:0),c=t.parent;for(let l=t.startIndex,f=t.endIndex,d=!0;l<f;l++,d=!1)!d&&WK(e.doc,s,u)&&(e.split(s,u),s+=2*u),s+=c.child(l).nodeSize;return e}function l1e(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,a=>a.childCount>0&&a.firstChild.type==e);return o?n?r.node(o.depth-1).type==e?f1e(t,n,e,o):d1e(t,n,o):!0:!1}}function f1e(e,t,n,r){let i=e.tr,o=r.end,a=r.$to.end(r.depth);return o<a&&(i.step(new ln(o-1,a,o,a,new Z(V.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Ib(i.doc.resolve(r.$from.pos),i.doc.resolve(a),r.depth)),t(i.lift(r,kh(r)).scrollIntoView()),!0}function d1e(e,t,n){let r=e.tr,i=n.parent;for(let p=n.end,h=n.endIndex-1,v=n.startIndex;h>v;h--)p-=i.child(h).nodeSize,r.delete(p-1,p+1);let o=r.doc.resolve(n.start),a=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let u=n.startIndex==0,s=n.endIndex==i.childCount,c=o.node(-1),l=o.index(-1);if(!c.canReplace(l+(u?0:1),l+1,a.content.append(s?V.empty:V.from(i))))return!1;let f=o.pos,d=f+a.nodeSize;return r.step(new ln(f-(u?1:0),d+(s?1:0),f+1,d-1,new Z((u?V.empty:V.from(i.copy(V.empty))).append(s?V.empty:V.from(i.copy(V.empty))),u?0:1,s?0:1),u?0:1)),t(r.scrollIntoView()),!0}function p1e(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,c=>c.childCount>0&&c.firstChild.type==e);if(!o)return!1;let a=o.startIndex;if(a==0)return!1;let u=o.parent,s=u.child(a-1);if(s.type!=e)return!1;if(n){let c=s.lastChild&&s.lastChild.type==u.type,l=V.from(c?e.create():null),f=new Z(V.from(e.create(null,V.from(u.type.create(null,l)))),c?3:1,0),d=o.start,p=o.end;n(t.tr.step(new ln(d-(c?3:1),p,d,p,f,1,!0)).scrollIntoView())}return!0}}function zb(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),filterTransaction:t.filterTransaction,plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}class qb{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:n,state:r}=this,{view:i}=n,{tr:o}=r,a=this.buildProps(o);return Object.fromEntries(Object.entries(t).map(([u,s])=>[u,(...l)=>{const f=s(...l)(a);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),f}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:a}=i,u=[],s=!!t,c=t||o.tr,l=()=>(!s&&n&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&a.dispatch(c),u.every(d=>d===!0)),f={...Object.fromEntries(Object.entries(r).map(([d,p])=>[d,(...v)=>{const y=this.buildProps(c,n),b=p(...v)(y);return u.push(b),f}])),run:l};return f}createCan(t){const{rawCommands:n,state:r}=this,i=!1,o=t||r.tr,a=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(n).map(([s,c])=>[s,(...l)=>c(...l)({...a,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(t,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:a}=i;o.storedMarks&&t.setStoredMarks(o.storedMarks);const u={tr:t,editor:i,view:a,state:zb({state:o,transaction:t}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(t),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(r).map(([s,c])=>[s,(...l)=>c(...l)(u)]))}};return u}}class h1e{constructor(){this.callbacks={}}on(t,n){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(n),this}emit(t,...n){const r=this.callbacks[t];return r&&r.forEach(i=>i.apply(this,n)),this}off(t,n){const r=this.callbacks[t];return r&&(n?this.callbacks[t]=r.filter(i=>i!==n):delete this.callbacks[t]),this}removeAllListeners(){this.callbacks={}}}function ae(e,t,n){return e.config[t]===void 0&&e.parent?ae(e.parent,t,n):typeof e.config[t]=="function"?e.config[t].bind({...n,parent:e.parent?ae(e.parent,t,n):null}):e.config[t]}function Kb(e){const t=e.filter(i=>i.type==="extension"),n=e.filter(i=>i.type==="node"),r=e.filter(i=>i.type==="mark");return{baseExtensions:t,nodeExtensions:n,markExtensions:r}}function v3(e){const t=[],{nodeExtensions:n,markExtensions:r}=Kb(e),i=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach(a=>{const u={name:a.name,options:a.options,storage:a.storage},s=ae(a,"addGlobalAttributes",u);if(!s)return;s().forEach(l=>{l.types.forEach(f=>{Object.entries(l.attributes).forEach(([d,p])=>{t.push({type:f,name:d,attribute:{...o,...p}})})})})}),i.forEach(a=>{const u={name:a.name,options:a.options,storage:a.storage},s=ae(a,"addAttributes",u);if(!s)return;const c=s();Object.entries(c).forEach(([l,f])=>{const d={...o,...f};f.isRequired&&f.default===void 0&&delete d.default,t.push({type:a.name,name:l,attribute:d})})}),t}function Ht(e,t){if(typeof e=="string"){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}function dn(...e){return e.filter(t=>!!t).reduce((t,n)=>{const r={...t};return Object.entries(n).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}i==="class"?r[i]=[r[i],o].join(" "):i==="style"?r[i]=[r[i],o].join("; "):r[i]=o}),r},{})}function PR(e,t){return t.filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(e.attrs)||{}:{[n.name]:e.attrs[n.name]}).reduce((n,r)=>dn(n,r),{})}function g3(e){return typeof e=="function"}function Ee(e,t=void 0,...n){return g3(e)?t?e.bind(t)(...n):e(...n):e}function m1e(e={}){return Object.keys(e).length===0&&e.constructor===Object}function v1e(e){return typeof e!="string"?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e==="true"?!0:e==="false"?!1:e}function y3(e,t){return e.style?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;const i=t.reduce((o,a)=>{const u=a.attribute.parseHTML?a.attribute.parseHTML(n):v1e(n.getAttribute(a.name));return u==null?o:{...o,[a.name]:u}},{});return{...r,...i}}}}function b3(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>t==="attrs"&&m1e(n)?!1:n!=null))}function $3(e){var t;const n=v3(e),{nodeExtensions:r,markExtensions:i}=Kb(e),o=(t=r.find(s=>ae(s,"topNode")))===null||t===void 0?void 0:t.name,a=Object.fromEntries(r.map(s=>{const c=n.filter(y=>y.type===s.name),l={name:s.name,options:s.options,storage:s.storage},f=e.reduce((y,b)=>{const w=ae(b,"extendNodeSchema",l);return{...y,...w?w(s):{}}},{}),d=b3({...f,content:Ee(ae(s,"content",l)),marks:Ee(ae(s,"marks",l)),group:Ee(ae(s,"group",l)),inline:Ee(ae(s,"inline",l)),atom:Ee(ae(s,"atom",l)),selectable:Ee(ae(s,"selectable",l)),draggable:Ee(ae(s,"draggable",l)),code:Ee(ae(s,"code",l)),defining:Ee(ae(s,"defining",l)),isolating:Ee(ae(s,"isolating",l)),attrs:Object.fromEntries(c.map(y=>{var b;return[y.name,{default:(b=y==null?void 0:y.attribute)===null||b===void 0?void 0:b.default}]}))}),p=Ee(ae(s,"parseHTML",l));p&&(d.parseDOM=p.map(y=>y3(y,c)));const h=ae(s,"renderHTML",l);h&&(d.toDOM=y=>h({node:y,HTMLAttributes:PR(y,c)}));const v=ae(s,"renderText",l);return v&&(d.toText=v),[s.name,d]})),u=Object.fromEntries(i.map(s=>{const c=n.filter(v=>v.type===s.name),l={name:s.name,options:s.options,storage:s.storage},f=e.reduce((v,y)=>{const b=ae(y,"extendMarkSchema",l);return{...v,...b?b(s):{}}},{}),d=b3({...f,inclusive:Ee(ae(s,"inclusive",l)),excludes:Ee(ae(s,"excludes",l)),group:Ee(ae(s,"group",l)),spanning:Ee(ae(s,"spanning",l)),code:Ee(ae(s,"code",l)),attrs:Object.fromEntries(c.map(v=>{var y;return[v.name,{default:(y=v==null?void 0:v.attribute)===null||y===void 0?void 0:y.default}]}))}),p=Ee(ae(s,"parseHTML",l));p&&(d.parseDOM=p.map(v=>y3(v,c)));const h=ae(s,"renderHTML",l);return h&&(d.toDOM=v=>h({mark:v,HTMLAttributes:PR(v,c)})),[s.name,d]}));return new wIe({topNode:o,nodes:a,marks:u})}function FR(e,t){return t.nodes[e]||t.marks[e]||null}function _3(e,t){return Array.isArray(t)?t.some(n=>(typeof n=="string"?n:n.name)===e.name):t}const g1e=(e,t=500)=>{let n="";return e.parent.nodesBetween(Math.max(0,e.parentOffset-t),e.parentOffset,(r,i,o,a)=>{var u,s,c;n+=((s=(u=r.type.spec).toText)===null||s===void 0?void 0:s.call(u,{node:r,pos:i,parent:o,index:a}))||((c=e.nodeBefore)===null||c===void 0?void 0:c.text)||"%leaf%"}),n};function DR(e){return Object.prototype.toString.call(e)==="[object RegExp]"}class LR{constructor(t){this.find=t.find,this.handler=t.handler}}const y1e=(e,t)=>{if(DR(t))return t.exec(e);const n=t(e);if(!n)return null;const r=[];return r.push(n.text),r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function jR(e){var t;const{editor:n,from:r,to:i,text:o,rules:a,plugin:u}=e,{view:s}=n;if(s.composing)return!1;const c=s.state.doc.resolve(r);if(c.parent.type.spec.code||!!(!((t=c.nodeBefore||c.nodeAfter)===null||t===void 0)&&t.marks.find(d=>d.type.spec.code)))return!1;let l=!1;const f=g1e(c)+o;return a.forEach(d=>{if(l)return;const p=y1e(f,d.find);if(!p)return;const h=s.state.tr,v=zb({state:s.state,transaction:h}),y={from:r-(p[0].length-o.length),to:i},{commands:b,chain:w,can:F}=new qb({editor:n,state:v});d.handler({state:v,range:y,match:p,commands:b,chain:w,can:F})===null||!h.steps.length||(h.setMeta(u,{transform:h,from:r,to:i,text:o}),s.dispatch(h),l=!0)}),l}function b1e(e){const{editor:t,rules:n}=e,r=new Kr({state:{init(){return null},apply(i,o){const a=i.getMeta(r);return a||(i.selectionSet||i.docChanged?null:o)}},props:{handleTextInput(i,o,a,u){return jR({editor:t,from:o,to:a,text:u,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&jR({editor:t,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;const{$cursor:a}=i.state.selection;return a?jR({editor:t,from:a.pos,to:a.pos,text:`
41
- `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function $1e(e){return typeof e=="number"}class _1e{constructor(t){this.find=t.find,this.handler=t.handler}}const S1e=(e,t)=>{if(DR(t))return[...e.matchAll(t)];const n=t(e);return n?n.map(r=>{const i=[];return i.push(r.text),i.index=r.index,i.input=e,i.data=r.data,r.replaceWith&&(r.text.includes(r.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(r.replaceWith)),i}):[]};function T1e(e){const{editor:t,state:n,from:r,to:i,rule:o}=e,{commands:a,chain:u,can:s}=new qb({editor:t,state:n}),c=[];return n.doc.nodesBetween(r,i,(f,d)=>{if(!f.isTextblock||f.type.spec.code)return;const p=Math.max(r,d),h=Math.min(i,d+f.content.size),v=f.textBetween(p-d,h-d,void 0,"\uFFFC");S1e(v,o.find).forEach(b=>{if(b.index===void 0)return;const w=p+b.index+1,F=w+b[0].length,g={from:n.tr.mapping.map(w),to:n.tr.mapping.map(F)},I=o.handler({state:n,range:g,match:b,commands:a,chain:u,can:s});c.push(I)})}),c.every(f=>f!==null)}function I1e(e){const{editor:t,rules:n}=e;let r=null,i=!1,o=!1;return n.map(u=>new Kr({view(s){const c=l=>{var f;r=!((f=s.dom.parentElement)===null||f===void 0)&&f.contains(l.target)?s.dom.parentElement:null};return window.addEventListener("dragstart",c),{destroy(){window.removeEventListener("dragstart",c)}}},props:{handleDOMEvents:{drop:s=>(o=r===s.dom.parentElement,!1),paste:(s,c)=>{var l;const f=(l=c.clipboardData)===null||l===void 0?void 0:l.getData("text/html");return i=!!(f!=null&&f.includes("data-pm-slice")),!1}}},appendTransaction:(s,c,l)=>{const f=s[0],d=f.getMeta("uiEvent")==="paste"&&!i,p=f.getMeta("uiEvent")==="drop"&&!o;if(!d&&!p)return;const h=c.doc.content.findDiffStart(l.doc.content),v=c.doc.content.findDiffEnd(l.doc.content);if(!$1e(h)||!v||h===v.b)return;const y=l.tr,b=zb({state:l,transaction:y});if(!(!T1e({editor:t,state:b,from:Math.max(h-1,0),to:v.b-1,rule:u})||!y.steps.length))return y}}))}function O1e(e){const t=e.filter((n,r)=>e.indexOf(n)!==r);return[...new Set(t)]}class wc{constructor(t,n){this.splittableMarks=[],this.editor=n,this.extensions=wc.resolve(t),this.schema=$3(this.extensions),this.extensions.forEach(r=>{var i;this.editor.extensionStorage[r.name]=r.storage;const o={name:r.name,options:r.options,storage:r.storage,editor:this.editor,type:FR(r.name,this.schema)};r.type==="mark"&&((i=Ee(ae(r,"keepOnSplit",o)))!==null&&i!==void 0?i:!0)&&this.splittableMarks.push(r.name);const a=ae(r,"onBeforeCreate",o);a&&this.editor.on("beforeCreate",a);const u=ae(r,"onCreate",o);u&&this.editor.on("create",u);const s=ae(r,"onUpdate",o);s&&this.editor.on("update",s);const c=ae(r,"onSelectionUpdate",o);c&&this.editor.on("selectionUpdate",c);const l=ae(r,"onTransaction",o);l&&this.editor.on("transaction",l);const f=ae(r,"onFocus",o);f&&this.editor.on("focus",f);const d=ae(r,"onBlur",o);d&&this.editor.on("blur",d);const p=ae(r,"onDestroy",o);p&&this.editor.on("destroy",p)})}static resolve(t){const n=wc.sort(wc.flatten(t)),r=O1e(n.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),n}static flatten(t){return t.map(n=>{const r={name:n.name,options:n.options,storage:n.storage},i=ae(n,"addExtensions",r);return i?[n,...this.flatten(i())]:n}).flat(10)}static sort(t){return t.sort((r,i)=>{const o=ae(r,"priority")||100,a=ae(i,"priority")||100;return o>a?-1:o<a?1:0})}get commands(){return this.extensions.reduce((t,n)=>{const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:FR(n.name,this.schema)},i=ae(n,"addCommands",r);return i?{...t,...i()}:t},{})}get plugins(){const{editor:t}=this,n=wc.sort([...this.extensions].reverse()),r=[],i=[],o=n.map(a=>{const u={name:a.name,options:a.options,storage:a.storage,editor:t,type:FR(a.name,this.schema)},s=[],c=ae(a,"addKeyboardShortcuts",u);let l={};if(a.type==="mark"&&a.config.exitable&&(l.ArrowRight=()=>Jf.handleExit({editor:t,mark:a})),c){const v=Object.fromEntries(Object.entries(c()).map(([y,b])=>[y,()=>b({editor:t})]));l={...l,...v}}const f=Fwe(l);s.push(f);const d=ae(a,"addInputRules",u);_3(a,t.options.enableInputRules)&&d&&r.push(...d());const p=ae(a,"addPasteRules",u);_3(a,t.options.enablePasteRules)&&p&&i.push(...p());const h=ae(a,"addProseMirrorPlugins",u);if(h){const v=h();s.push(...v)}return s}).flat();return[b1e({editor:t,rules:r}),...I1e({editor:t,rules:i}),...o]}get attributes(){return v3(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:n}=Kb(this.extensions);return Object.fromEntries(n.filter(r=>!!ae(r,"addNodeView")).map(r=>{const i=this.attributes.filter(s=>s.type===r.name),o={name:r.name,options:r.options,storage:r.storage,editor:t,type:Ht(r.name,this.schema)},a=ae(r,"addNodeView",o);if(!a)return[];const u=(s,c,l,f)=>{const d=PR(s,i);return a()({editor:t,node:s,getPos:l,decorations:f,HTMLAttributes:d,extension:r})};return[r.name,u]}))}}function w1e(e){return Object.prototype.toString.call(e).slice(8,-1)}function UR(e){return w1e(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function Vb(e,t){const n={...e};return UR(e)&&UR(t)&&Object.keys(t).forEach(r=>{UR(t[r])?r in e?n[r]=Vb(e[r],t[r]):Object.assign(n,{[r]:t[r]}):Object.assign(n,{[r]:t[r]})}),n}class Ir{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=Ee(ae(this,"addOptions",{name:this.name}))),this.storage=Ee(ae(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new Ir(t)}configure(t={}){const n=this.extend();return n.options=Vb(this.options,t),n.storage=Ee(ae(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){const n=new Ir(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=Ee(ae(n,"addOptions",{name:n.name})),n.storage=Ee(ae(n,"addStorage",{name:n.name,options:n.options})),n}}function S3(e,t,n){const{from:r,to:i}=t,{blockSeparator:o=`
38
+ `);return{dom:s,text:d}}function PV(e,t,n,r,i){let o=i.parent.type.spec.code,a,u;if(!n&&!t)return null;let s=t&&(r||o||!n);if(s){if(e.someProp("transformPastedText",d=>{t=d(t,o||r)}),o)return t?new X(V.from(e.state.schema.text(t.replace(/\r\n?/g,`
39
+ `))),0,0):X.empty;let f=e.someProp("clipboardTextParser",d=>d(t,i,r));if(f)u=f;else{let d=i.marks(),{schema:p}=e.state,h=uo.fromSchema(p);a=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(v=>{let y=a.appendChild(document.createElement("p"));v&&y.appendChild(h.serializeNode(p.text(v,d)))})}}else e.someProp("transformPastedHTML",f=>{n=f(n)}),a=rwe(n),kb&&iwe(a);let c=a&&a.querySelector("[data-pm-slice]"),l=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(l&&l[3])for(let f=+l[3];f>0&&a.firstChild;f--)a=a.firstChild;if(u||(u=(e.someProp("clipboardParser")||e.someProp("domParser")||Cf.fromSchema(e.state.schema)).parseSlice(a,{preserveWhitespace:!!(s||l),context:i,ruleFromNode(d){return d.nodeName=="BR"&&!d.nextSibling&&d.parentNode&&!twe.test(d.parentNode.nodeName)?{ignore:!0}:null}})),l)u=owe(jV(u,+l[1],+l[2]),l[4]);else if(u=X.maxOpen(nwe(u.content,i),!0),u.openStart||u.openEnd){let f=0,d=0;for(let p=u.content.firstChild;f<u.openStart&&!p.type.spec.isolating;f++,p=p.firstChild);for(let p=u.content.lastChild;d<u.openEnd&&!p.type.spec.isolating;d++,p=p.lastChild);u=jV(u,f,d)}return e.someProp("transformPasted",f=>{u=f(u)}),u}const twe=/^(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 nwe(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let i=t.node(n).contentMatchAt(t.index(n)),o,a=[];if(e.forEach(u=>{if(!a)return;let s=i.findWrapping(u.type),c;if(!s)return a=null;if(c=a.length&&o.length&&DV(s,o,u,a[a.length-1],0))a[a.length-1]=c;else{a.length&&(a[a.length-1]=LV(a[a.length-1],o.length));let l=FV(u,s);a.push(l),i=i.matchType(l.type),o=s}}),a)return V.from(a)}return e}function FV(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,V.from(e));return e}function DV(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let o=DV(e,t,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(V.from(FV(n,e,i+1))))}}function LV(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,LV(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(V.empty,!0);return e.copy(n.append(r))}function gR(e,t,n,r,i,o){let a=t<0?e.firstChild:e.lastChild,u=a.content;return i<r-1&&(u=gR(u,t,n,r,i+1,o)),i>=n&&(u=t<0?a.contentMatchAt(0).fillBefore(u,e.childCount>1||o<=i).append(u):u.append(a.contentMatchAt(a.childCount).fillBefore(V.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,a.copy(u))}function jV(e,t,n){return t<e.openStart&&(e=new X(gR(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new X(gR(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const UV={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let BV=null;function zV(){return BV||(BV=document.implementation.createHTMLDocument("title"))}function rwe(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=zV().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&UV[r[1].toLowerCase()])&&(e=i.map(o=>"<"+o+">").join("")+e+i.map(o=>"</"+o+">").reverse().join("")),n.innerHTML=e,i)for(let o=0;o<i.length;o++)n=n.querySelector(i[o])||n;return n}function iwe(e){let t=e.querySelectorAll(An?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent=="\xA0"&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}function owe(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:i,openStart:o,openEnd:a}=e;for(let u=r.length-2;u>=0;u-=2){let s=n.nodes[r[u]];if(!s||s.hasRequiredAttrs())break;i=V.from(s.create(r[u+1],i)),o++,a++}return new X(i,o,a)}const tr={};let kn={};class awe{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.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function uwe(e){for(let t in tr){let n=tr[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=r=>{cwe(e,r)&&!bR(e,r)&&(e.editable||!(r.type in kn))&&n(e,r)})}er&&e.dom.addEventListener("input",()=>null),yR(e)}function $c(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function swe(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function yR(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=r=>bR(e,r))})}function bR(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function cwe(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function lwe(e,t){!bR(e,t)&&tr[t.type]&&(e.editable||!(t.type in kn))&&tr[t.type](e,t)}kn.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!KV(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(lo&&An&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),Ff&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();e.input.lastIOSEnter=r,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==r&&(e.someProp("handleKeyDown",i=>i(e,Df(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",r=>r(e,n))||ewe(e,n)?n.preventDefault():$c(e,"key")},kn.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)},kn.keypress=(e,t)=>{let n=t;if(KV(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Vr&&n.metaKey)return;if(e.someProp("handleKeyPress",i=>i(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof Ae)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode);e.someProp("handleTextInput",o=>o(e,r.$from.pos,r.$to.pos,i))||e.dispatch(e.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}};function Pb(e){return{left:e.clientX,top:e.clientY}}function fwe(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function $R(e,t,n,r,i){if(r==-1)return!1;let o=e.state.doc.resolve(r);for(let a=o.depth+1;a>0;a--)if(e.someProp(t,u=>a>o.depth?u(e,n,o.nodeAfter,o.before(a),i,!0):u(e,n,o.node(a),o.before(a),i,!1)))return!0;return!1}function Uf(e,t,n){e.focused||e.focus();let r=e.state.tr.setSelection(t);n=="pointer"&&r.setMeta("pointer",!0),e.dispatch(r)}function dwe(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&ve.isSelectable(r)?(Uf(e,new ve(n),"pointer"),!0):!1}function pwe(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof ve&&(r=n.node);let o=e.state.doc.resolve(t);for(let a=o.depth+1;a>0;a--){let u=a>o.depth?o.nodeAfter:o.node(a);if(ve.isSelectable(u)){r&&n.$from.depth>0&&a>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?i=o.before(n.$from.depth):i=o.before(a);break}}return i!=null?(Uf(e,ve.create(e.state.doc,i),"pointer"),!0):!1}function hwe(e,t,n,r,i){return $R(e,"handleClickOn",t,n,r)||e.someProp("handleClick",o=>o(e,t,r))||(i?pwe(e,n):dwe(e,n))}function mwe(e,t,n,r){return $R(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",i=>i(e,t,r))}function vwe(e,t,n,r){return $R(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",i=>i(e,t,r))||gwe(e,n,r)}function gwe(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?(Uf(e,Ae.create(r,0,r.content.size),"pointer"),!0):!1;let i=r.resolve(t);for(let o=i.depth+1;o>0;o--){let a=o>i.depth?i.nodeAfter:i.node(o),u=i.before(o);if(a.inlineContent)Uf(e,Ae.create(r,u+1,u+1+a.content.size),"pointer");else if(ve.isSelectable(a))Uf(e,ve.create(r,u),"pointer");else continue;return!0}}function _R(e){return Fb(e)}const qV=Vr?"metaKey":"ctrlKey";tr.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=_R(e),i=Date.now(),o="singleClick";i-e.input.lastClick.time<500&&fwe(n,e.input.lastClick)&&!n[qV]&&(e.input.lastClick.type=="singleClick"?o="doubleClick":e.input.lastClick.type=="doubleClick"&&(o="tripleClick")),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let a=e.posAtCoords(Pb(n));!a||(o=="singleClick"?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new ywe(e,a,n,!!r)):(o=="doubleClick"?mwe:vwe)(e,a.pos,a.inside,n)?n.preventDefault():$c(e,"pointer"))};class ywe{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[qV],this.allowDefault=r.shiftKey;let o,a;if(n.inside>-1)o=t.state.doc.nodeAt(n.inside),a=n.inside;else{let l=t.state.doc.resolve(n.pos);o=l.parent,a=l.depth?l.before():0}const u=i?null:r.target,s=u?t.docView.nearestDesc(u,!0):null;this.target=s?s.dom:null;let{selection:c}=t.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||c instanceof ve&&c.from<=a&&c.to>a)&&(this.mightDrag={node:o,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&co&&!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)),$c(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(()=>Wu(this.view)),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Pb(t))),this.allowDefault||!n?$c(this.view,"pointer"):hwe(this.view,n.pos,n.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||er&&this.mightDrag&&!this.mightDrag.node.isAtom||An&&!(this.view.state.selection instanceof Ae)&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Uf(this.view,Fe.near(this.view.state.doc.resolve(n.pos)),"pointer"),t.preventDefault()):$c(this.view,"pointer")}move(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0),$c(this.view,"pointer"),t.buttons==0&&this.done()}}tr.touchdown=e=>{_R(e),$c(e,"pointer")},tr.contextmenu=e=>_R(e);function KV(e,t){return e.composing?!0:er&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const bwe=lo?5e3:-1;kn.compositionstart=kn.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))e.markCursor=e.state.storedMarks||n.marks(),Fb(e,!0),e.markCursor=null;else if(Fb(e),co&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=e.domSelection();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let a=o<0?i.lastChild:i.childNodes[o-1];if(!a)break;if(a.nodeType==3){r.collapse(a,a.nodeValue.length);break}else i=a,o=-1}}e.input.composing=!0}VV(e,bwe)},kn.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,VV(e,20))};function VV(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Fb(e),t))}function HV(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=$we());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function $we(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function Fb(e,t=!1){if(!(lo&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),HV(e),t||e.docView&&e.docView.dirty){let n=_V(e);return n&&!n.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(n)):e.updateState(e.state),!0}return!1}}function _we(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}const Bf=$r&&Cu<15||Ff&&$Oe<604;tr.copy=kn.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type=="cut";if(r.empty)return;let o=Bf?null:n.clipboardData,a=r.content(),{dom:u,text:s}=NV(e,a);o?(n.preventDefault(),o.clearData(),o.setData("text/html",u.innerHTML),o.setData("text/plain",s)):_we(e,u),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function Swe(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function Twe(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?SR(e,r.value,null,t):SR(e,r.textContent,r.innerHTML,t)},50)}function SR(e,t,n,r){let i=PV(e,t,n,e.input.shiftKey,e.state.selection.$from);if(e.someProp("handlePaste",u=>u(e,r,i||X.empty)))return!0;if(!i)return!1;let o=Swe(i),a=o?e.state.tr.replaceSelectionWith(o,e.input.shiftKey):e.state.tr.replaceSelection(i);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}kn.paste=(e,t)=>{let n=t;if(e.composing&&!lo)return;let r=Bf?null:n.clipboardData;r&&SR(e,r.getData("text/plain"),r.getData("text/html"),n)?n.preventDefault():Twe(e,n)};class Iwe{constructor(t,n){this.slice=t,this.move=n}}const JV=Vr?"altKey":"ctrlKey";tr.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,o=i.empty?null:e.posAtCoords(Pb(n));if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof ve?i.to-1:i.to))){if(r&&r.mightDrag)e.dispatch(e.state.tr.setSelection(ve.create(e.state.doc,r.mightDrag.pos)));else if(n.target&&n.target.nodeType==1){let c=e.docView.nearestDesc(n.target,!0);c&&c.node.type.spec.draggable&&c!=e.docView&&e.dispatch(e.state.tr.setSelection(ve.create(e.state.doc,c.posBefore)))}}let a=e.state.selection.content(),{dom:u,text:s}=NV(e,a);n.dataTransfer.clearData(),n.dataTransfer.setData(Bf?"Text":"text/html",u.innerHTML),n.dataTransfer.effectAllowed="copyMove",Bf||n.dataTransfer.setData("text/plain",s),e.dragging=new Iwe(a,!n[JV])},tr.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},kn.dragover=kn.dragenter=(e,t)=>t.preventDefault(),kn.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let i=e.posAtCoords(Pb(n));if(!i)return;let o=e.state.doc.resolve(i.pos);if(!o)return;let a=r&&r.slice;a?e.someProp("transformPasted",h=>{a=h(a)}):a=PV(e,n.dataTransfer.getData(Bf?"Text":"text/plain"),Bf?null:n.dataTransfer.getData("text/html"),!1,o);let u=!!(r&&!n[JV]);if(e.someProp("handleDrop",h=>h(e,n,a||X.empty,u))){n.preventDefault();return}if(!a)return;n.preventDefault();let s=a?uOe(e.state.doc,o.pos,a):o.pos;s==null&&(s=o.pos);let c=e.state.tr;u&&c.deleteSelection();let l=c.mapping.map(s),f=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,d=c.doc;if(f?c.replaceRangeWith(l,l,a.content.firstChild):c.replaceRange(l,l,a),c.doc.eq(d))return;let p=c.doc.resolve(l);if(f&&ve.isSelectable(a.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new ve(p));else{let h=c.mapping.map(s);c.mapping.maps[c.mapping.maps.length-1].forEach((v,y,b,w)=>h=w),c.setSelection(dR(e,p,c.doc.resolve(h)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))},tr.focus=e=>{e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelection())&&Wu(e)},20))},tr.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},tr.beforeinput=(e,t)=>{if(An&&lo&&t.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:r}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=r||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",o=>o(e,Df(8,"Backspace")))))return;let{$cursor:i}=e.state.selection;i&&i.pos>0&&e.dispatch(e.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let e in kn)tr[e]=kn[e];function zh(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class TR{constructor(t,n){this.toDOM=t,this.spec=n||_c,this.side=this.spec.side||0}map(t,n,r,i){let{pos:o,deleted:a}=t.mapResult(n.from+i,this.side<0?-1:1);return a?null:new Sr(o-r,o-r,this)}valid(){return!0}eq(t){return this==t||t instanceof TR&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&zh(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class Nu{constructor(t,n){this.attrs=t,this.spec=n||_c}map(t,n,r,i){let o=t.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,a=t.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=a?null:new Sr(o,a,this)}valid(t,n){return n.from<n.to}eq(t){return this==t||t instanceof Nu&&zh(this.attrs,t.attrs)&&zh(this.spec,t.spec)}static is(t){return t.type instanceof Nu}destroy(){}}class IR{constructor(t,n){this.attrs=t,this.spec=n||_c}map(t,n,r,i){let o=t.mapResult(n.from+i,1);if(o.deleted)return null;let a=t.mapResult(n.to+i,-1);return a.deleted||a.pos<=o.pos?null:new Sr(o.pos-r,a.pos-r,this)}valid(t,n){let{index:r,offset:i}=t.content.findIndex(n.from),o;return i==n.from&&!(o=t.child(r)).isText&&i+o.nodeSize==n.to}eq(t){return this==t||t instanceof IR&&zh(this.attrs,t.attrs)&&zh(this.spec,t.spec)}destroy(){}}class Sr{constructor(t,n,r){this.from=t,this.to=n,this.type=r}copy(t,n){return new Sr(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 Sr(t,t,new TR(n,r))}static inline(t,n,r,i){return new Sr(t,n,new Nu(r,i))}static node(t,n,r,i){return new Sr(t,n,new IR(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Nu}}const zf=[],_c={};class Vt{constructor(t,n){this.local=t.length?t:zf,this.children=n.length?n:zf}static create(t,n){return n.length?Db(n,t,0,_c):bn}find(t,n,r){let i=[];return this.findInner(t==null?0:t,n==null?1e9:n,i,0,r),i}findInner(t,n,r,i,o){for(let a=0;a<this.local.length;a++){let u=this.local[a];u.from<=n&&u.to>=t&&(!o||o(u.spec))&&r.push(u.copy(u.from+i,u.to+i))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<n&&this.children[a+1]>t){let u=this.children[a]+1;this.children[a+2].findInner(t-u,n-u,r,i+u,o)}}map(t,n,r){return this==bn||t.maps.length==0?this:this.mapInner(t,n,0,0,r||_c)}mapInner(t,n,r,i,o){let a;for(let u=0;u<this.local.length;u++){let s=this.local[u].map(t,r,i);s&&s.type.valid(n,s)?(a||(a=[])).push(s):o.onRemove&&o.onRemove(this.local[u].spec)}return this.children.length?Owe(this.children,a||[],t,n,r,i,o):a?new Vt(a.sort(Sc),zf):bn}add(t,n){return n.length?this==bn?Vt.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,o=0;t.forEach((u,s)=>{let c=s+r,l;if(!!(l=YV(n,u,c))){for(i||(i=this.children.slice());o<i.length&&i[o]<s;)o+=3;i[o]==s?i[o+2]=i[o+2].addInner(u,l,c+1):i.splice(o,0,s,s+u.nodeSize,Db(l,u,c+1,_c)),o+=3}});let a=GV(o?ZV(n):n,-r);for(let u=0;u<a.length;u++)a[u].type.valid(t,a[u])||a.splice(u--,1);return new Vt(a.length?this.local.concat(a).sort(Sc):this.local,i||this.children)}remove(t){return t.length==0||this==bn?this:this.removeInner(t,0)}removeInner(t,n){let r=this.children,i=this.local;for(let o=0;o<r.length;o+=3){let a,u=r[o]+n,s=r[o+1]+n;for(let l=0,f;l<t.length;l++)(f=t[l])&&f.from>u&&f.to<s&&(t[l]=null,(a||(a=[])).push(f));if(!a)continue;r==this.children&&(r=this.children.slice());let c=r[o+2].removeInner(a,u+1);c!=bn?r[o+2]=c:(r.splice(o,3),o-=3)}if(i.length){for(let o=0,a;o<t.length;o++)if(a=t[o])for(let u=0;u<i.length;u++)i[u].eq(a,n)&&(i==this.local&&(i=this.local.slice()),i.splice(u--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new Vt(i,r):bn}forChild(t,n){if(this==bn)return this;if(n.isLeaf)return Vt.empty;let r,i;for(let u=0;u<this.children.length;u+=3)if(this.children[u]>=t){this.children[u]==t&&(r=this.children[u+2]);break}let o=t+1,a=o+n.content.size;for(let u=0;u<this.local.length;u++){let s=this.local[u];if(s.from<a&&s.to>o&&s.type instanceof Nu){let c=Math.max(o,s.from)-o,l=Math.min(a,s.to)-o;c<l&&(i||(i=[])).push(s.copy(c,l))}}if(i){let u=new Vt(i.sort(Sc),zf);return r?new Pu([u,r]):u}return r||bn}eq(t){if(this==t)return!0;if(!(t instanceof Vt)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(t.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=t.children[n]||this.children[n+1]!=t.children[n+1]||!this.children[n+2].eq(t.children[n+2]))return!1;return!0}locals(t){return OR(this.localsInner(t))}localsInner(t){if(this==bn)return zf;if(t.inlineContent||!this.local.some(Nu.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Nu||n.push(this.local[r]);return n}}Vt.empty=new Vt([],[]),Vt.removeOverlap=OR;const bn=Vt.empty;class Pu{constructor(t){this.members=t}map(t,n){const r=this.members.map(i=>i.map(t,n,_c));return Pu.from(r)}forChild(t,n){if(n.isLeaf)return Vt.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(t,n);o!=bn&&(o instanceof Pu?r=r.concat(o.members):r.push(o))}return Pu.from(r)}eq(t){if(!(t instanceof Pu)||t.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(t.members[n]))return!1;return!0}locals(t){let n,r=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(t);if(!!o.length)if(!n)n=o;else{r&&(n=n.slice(),r=!1);for(let a=0;a<o.length;a++)n.push(o[a])}}return n?OR(r?n:n.sort(Sc)):zf}static from(t){switch(t.length){case 0:return bn;case 1:return t[0];default:return new Pu(t)}}}function Owe(e,t,n,r,i,o,a){let u=e.slice(),s=(l,f,d,p)=>{for(let h=0;h<u.length;h+=3){let v=u[h+1],y;if(v<0||l>v+o)continue;let b=u[h]+o;f>=b?u[h+1]=l<=b?-2:-1:d>=i&&(y=p-d-(f-l))&&(u[h]+=y,u[h+1]+=y)}};for(let l=0;l<n.maps.length;l++)n.maps[l].forEach(s);let c=!1;for(let l=0;l<u.length;l+=3)if(u[l+1]<0){if(u[l+1]==-2){c=!0,u[l+1]=-1;continue}let f=n.map(e[l]+o),d=f-i;if(d<0||d>=r.content.size){c=!0;continue}let p=n.map(e[l+1]+o,-1),h=p-i,{index:v,offset:y}=r.content.findIndex(d),b=r.maybeChild(v);if(b&&y==d&&y+b.nodeSize==h){let w=u[l+2].mapInner(n,b,f+1,e[l]+o+1,a);w!=bn?(u[l]=d,u[l+1]=h,u[l+2]=w):(u[l+1]=-2,c=!0)}else c=!0}if(c){let l=wwe(u,e,t,n,i,o,a),f=Db(l,r,0,a);t=f.local;for(let d=0;d<u.length;d+=3)u[d+1]<0&&(u.splice(d,3),d-=3);for(let d=0,p=0;d<f.children.length;d+=3){let h=f.children[d];for(;p<u.length&&u[p]<h;)p+=3;u.splice(p,0,f.children[d],f.children[d+1],f.children[d+2])}}return new Vt(t.sort(Sc),u)}function GV(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new Sr(i.from+t,i.to+t,i.type))}return n}function wwe(e,t,n,r,i,o,a){function u(s,c){for(let l=0;l<s.local.length;l++){let f=s.local[l].map(r,i,c);f?n.push(f):a.onRemove&&a.onRemove(s.local[l].spec)}for(let l=0;l<s.children.length;l+=3)u(s.children[l+2],s.children[l]+c+1)}for(let s=0;s<e.length;s+=3)e[s+1]==-1&&u(e[s+2],t[s]+o+1);return n}function YV(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let o=0,a;o<e.length;o++)(a=e[o])&&a.from>n&&a.to<r&&((i||(i=[])).push(a),e[o]=null);return i}function ZV(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function Db(e,t,n,r){let i=[],o=!1;t.forEach((u,s)=>{let c=YV(e,u,s+n);if(c){o=!0;let l=Db(c,u,n+s+1,r);l!=bn&&i.push(s,s+u.nodeSize,l)}});let a=GV(o?ZV(e):e,-n).sort(Sc);for(let u=0;u<a.length;u++)a[u].type.valid(t,a[u])||(r.onRemove&&r.onRemove(a[u].spec),a.splice(u--,1));return a.length||i.length?new Vt(a,i):bn}function Sc(e,t){return e.from-t.from||e.to-t.to}function OR(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let o=t[i];if(o.from==r.from){o.to!=r.to&&(t==e&&(t=e.slice()),t[i]=o.copy(o.from,r.to),XV(t,i+1,o.copy(r.to,o.to)));continue}else{o.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,o.from),XV(t,i,r.copy(o.from,r.to)));break}}}return t}function XV(e,t,n){for(;t<e.length&&Sc(n,e[t])>0;)t++;e.splice(t,0,n)}function wR(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=bn&&t.push(r)}),e.cursorWrapper&&t.push(Vt.create(e.state.doc,[e.cursorWrapper.deco])),Pu.from(t)}const Ewe={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Rwe=$r&&Cu<=11;class Mwe{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 xwe{constructor(t,n){this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Mwe,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i<r.length;i++)this.queue.push(r[i]);$r&&Cu<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),Rwe&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&this.observer.observe(this.view.dom,Ewe),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(!!RV(this.view)){if(this.suppressingSelectionUpdates)return Wu(this.view);if($r&&Cu<=11&&!this.view.state.selection.empty){let t=this.view.domSelection();if(t.focusNode&&Dh(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelection())}ignoreSelectionChange(t){if(t.rangeCount==0)return!0;let n=t.getRangeAt(0).commonAncestorContainer,r=this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:"selection",target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}flush(){if(!this.view.docView||this.flushingSoon>-1)return;let t=this.observer?this.observer.takeRecords():[];this.queue.length&&(t=this.queue.concat(t),this.queue.length=0);let n=this.view.domSelection(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&RV(this.view)&&!this.ignoreSelectionChange(n),i=-1,o=-1,a=!1,u=[];if(this.view.editable)for(let s=0;s<t.length;s++){let c=this.registerMutation(t[s],u);c&&(i=i<0?c.from:Math.min(c.from,i),o=o<0?c.to:Math.max(c.to,o),c.typeOver&&(a=!0))}if(co&&u.length>1){let s=u.filter(c=>c.nodeName=="BR");if(s.length==2){let c=s[0],l=s[1];c.parentNode&&c.parentNode.parentNode==l.parentNode?l.remove():c.remove()}}(i>-1||r)&&(i>-1&&(this.view.docView.markDirty(i,o),Cwe(this.view)),this.handleDOMChange(i,o,a,u),this.view.docView&&this.view.docView.dirty?this.view.updateState(this.view.state):this.currentSelection.eq(n)||Wu(this.view),this.currentSelection.set(n))}registerMutation(t,n){if(n.indexOf(t.target)>-1)return null;let r=this.view.docView.nearestDesc(t.target);if(t.type=="attributes"&&(r==this.view.docView||t.attributeName=="contenteditable"||t.attributeName=="style"&&!t.oldValue&&!t.target.getAttribute("style"))||!r||r.ignoreMutation(t))return null;if(t.type=="childList"){for(let l=0;l<t.addedNodes.length;l++)n.push(t.addedNodes[l]);if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(t.target))return{from:r.posBefore,to:r.posAfter};let i=t.previousSibling,o=t.nextSibling;if($r&&Cu<=11&&t.addedNodes.length)for(let l=0;l<t.addedNodes.length;l++){let{previousSibling:f,nextSibling:d}=t.addedNodes[l];(!f||Array.prototype.indexOf.call(t.addedNodes,f)<0)&&(i=f),(!d||Array.prototype.indexOf.call(t.addedNodes,d)<0)&&(o=d)}let a=i&&i.parentNode==t.target?_r(i)+1:0,u=r.localPosFromDOM(t.target,a,-1),s=o&&o.parentNode==t.target?_r(o):t.target.childNodes.length,c=r.localPosFromDOM(t.target,s,1);return{from:u,to:c}}else return t.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:{from:r.posAtStart,to:r.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}}}let QV=!1;function Cwe(e){QV||(QV=!0,getComputedStyle(e.dom).whiteSpace=="normal"&&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."))}function Awe(e,t,n){let{node:r,fromOffset:i,toOffset:o,from:a,to:u}=e.docView.parseRange(t,n),s=e.domSelection(),c,l=s.anchorNode;if(l&&e.dom.contains(l.nodeType==1?l:l.parentNode)&&(c=[{node:l,offset:s.anchorOffset}],oR(s)||c.push({node:s.focusNode,offset:s.focusOffset})),An&&e.input.lastKeyCode===8)for(let y=o;y>i;y--){let b=r.childNodes[y-1],w=b.pmViewDesc;if(b.nodeName=="BR"&&!w){o=y;break}if(!w||w.size)break}let f=e.state.doc,d=e.someProp("domParser")||Cf.fromSchema(e.state.schema),p=f.resolve(a),h=null,v=d.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:o,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:kwe,context:p});if(c&&c[0].pos!=null){let y=c[0].pos,b=c[1]&&c[1].pos;b==null&&(b=y),h={anchor:y+a,head:b+a}}return{doc:v,sel:h,from:a,to:u}}function kwe(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName=="BR"&&e.parentNode){if(er&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(e.parentNode.lastChild==e||er&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}function Wwe(e,t,n,r,i){if(t<0){let E=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,H=_V(e,E);if(H&&!e.state.selection.eq(H)){let q=e.state.tr.setSelection(H);E=="pointer"?q.setMeta("pointer",!0):E=="key"&&q.scrollIntoView(),e.dispatch(q)}return}let o=e.state.doc.resolve(t),a=o.sharedDepth(n);t=o.before(a+1),n=e.state.doc.resolve(n).after(a+1);let u=e.state.selection,s=Awe(e,t,n);if(An&&e.cursorWrapper&&s.sel&&s.sel.anchor==e.cursorWrapper.deco.from){let E=e.cursorWrapper.deco.type.toDOM.nextSibling,H=E&&E.nodeValue?E.nodeValue.length:1;s.sel={anchor:s.sel.anchor+H,head:s.sel.anchor+H}}let c=e.state.doc,l=c.slice(s.from,s.to),f,d;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(f=e.state.selection.to,d="end"):(f=e.state.selection.from,d="start"),e.input.lastKeyCode=null;let p=Fwe(l.content,s.doc.content,s.from,f,d);if((Ff&&e.input.lastIOSEnter>Date.now()-225||lo)&&i.some(E=>E.nodeName=="DIV"||E.nodeName=="P")&&(!p||p.endA>=p.endB)&&e.someProp("handleKeyDown",E=>E(e,Df(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!p)if(r&&u instanceof Ae&&!u.empty&&u.$head.sameParent(u.$anchor)&&!e.composing&&!(s.sel&&s.sel.anchor!=s.sel.head))p={start:u.from,endA:u.to,endB:u.to};else{if(s.sel){let E=e3(e,e.state.doc,s.sel);E&&!E.eq(e.state.selection)&&e.dispatch(e.state.tr.setSelection(E))}return}e.input.domChangeCount++,e.state.selection.from<e.state.selection.to&&p.start==p.endB&&e.state.selection instanceof Ae&&(p.start>e.state.selection.from&&p.start<=e.state.selection.from+2&&e.state.selection.from>=s.from?p.start=e.state.selection.from:p.endA<e.state.selection.to&&p.endA>=e.state.selection.to-2&&e.state.selection.to<=s.to&&(p.endB+=e.state.selection.to-p.endA,p.endA=e.state.selection.to)),$r&&Cu<=11&&p.endB==p.start+1&&p.endA==p.start&&p.start>s.from&&s.doc.textBetween(p.start-s.from-1,p.start-s.from+1)==" \xA0"&&(p.start--,p.endA--,p.endB--);let h=s.doc.resolveNoCache(p.start-s.from),v=s.doc.resolveNoCache(p.endB-s.from),y=c.resolve(p.start),b=h.sameParent(v)&&h.parent.inlineContent&&y.end()>=p.endA,w;if((Ff&&e.input.lastIOSEnter>Date.now()-225&&(!b||i.some(E=>E.nodeName=="DIV"||E.nodeName=="P"))||!b&&h.pos<s.doc.content.size&&(w=Fe.findFrom(s.doc.resolve(h.pos+1),1,!0))&&w.head==v.pos)&&e.someProp("handleKeyDown",E=>E(e,Df(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>p.start&&Pwe(c,p.start,p.endA,h,v)&&e.someProp("handleKeyDown",E=>E(e,Df(8,"Backspace")))){lo&&An&&e.domObserver.suppressSelectionUpdates();return}An&&lo&&p.endB==p.start&&(e.input.lastAndroidDelete=Date.now()),lo&&!b&&h.start()!=v.start()&&v.parentOffset==0&&h.depth==v.depth&&s.sel&&s.sel.anchor==s.sel.head&&s.sel.head==p.endA&&(p.endB-=2,v=s.doc.resolveNoCache(p.endB-s.from),setTimeout(()=>{e.someProp("handleKeyDown",function(E){return E(e,Df(13,"Enter"))})},20));let F=p.start,g=p.endA,I,T,k;if(b){if(h.pos==v.pos)$r&&Cu<=11&&h.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>Wu(e),20)),I=e.state.tr.delete(F,g),T=c.resolve(p.start).marksAcross(c.resolve(p.endA));else if(p.endA==p.endB&&(k=Nwe(h.parent.content.cut(h.parentOffset,v.parentOffset),y.parent.content.cut(y.parentOffset,p.endA-y.start()))))I=e.state.tr,k.type=="add"?I.addMark(F,g,k.mark):I.removeMark(F,g,k.mark);else if(h.parent.child(h.index()).isText&&h.index()==v.index()-(v.textOffset?0:1)){let E=h.parent.textBetween(h.parentOffset,v.parentOffset);if(e.someProp("handleTextInput",H=>H(e,F,g,E)))return;I=e.state.tr.insertText(E,F,g)}}if(I||(I=e.state.tr.replace(F,g,s.doc.slice(p.start-s.from,p.endB-s.from))),s.sel){let E=e3(e,I.doc,s.sel);E&&!(An&&lo&&e.composing&&E.empty&&(p.start!=p.endB||e.input.lastAndroidDelete<Date.now()-100)&&(E.head==F||E.head==I.mapping.map(g)-1)||$r&&E.empty&&E.head==F)&&I.setSelection(E)}T&&I.ensureMarks(T),e.dispatch(I.scrollIntoView())}function e3(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:dR(e,t.resolve(n.anchor),t.resolve(n.head))}function Nwe(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,o=r,a,u,s;for(let l=0;l<r.length;l++)i=r[l].removeFromSet(i);for(let l=0;l<n.length;l++)o=n[l].removeFromSet(o);if(i.length==1&&o.length==0)u=i[0],a="add",s=l=>l.mark(u.addToSet(l.marks));else if(i.length==0&&o.length==1)u=o[0],a="remove",s=l=>l.mark(u.removeFromSet(l.marks));else return null;let c=[];for(let l=0;l<t.childCount;l++)c.push(s(t.child(l)));if(V.from(c).eq(e))return{mark:u,type:a}}function Pwe(e,t,n,r,i){if(!r.parent.isTextblock||n-t<=i.pos-r.pos||ER(r,!0,!1)<i.pos)return!1;let o=e.resolve(t);if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let a=e.resolve(ER(o,!0,!0));return!a.parent.isTextblock||a.pos>n||ER(a,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(a.parent.content)}function ER(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let o=e.node(r).maybeChild(e.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function Fwe(e,t,n,r,i){let o=e.findDiffStart(t,n);if(o==null)return null;let{a,b:u}=e.findDiffEnd(t,n+e.size,n+t.size);if(i=="end"){let s=Math.max(0,o-Math.min(a,u));r-=a+s-o}return a<o&&e.size<t.size?(o-=r<=o&&r>=a?o-r:0,u=o+(u-a),a=o):u<o&&(o-=r<=o&&r>=u?o-r:0,a=o+(a-u),u=o),{start:o,endA:a,endB:u}}class Dwe{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 awe,this.prevDirectPlugins=[],this.pluginViews=[],this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(o3),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):typeof t=="function"?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=r3(this),n3(this),this.nodeViews=i3(this),this.docView=mV(this.state.doc,t3(this),wR(this),this.dom,this),this.domObserver=new xwe(this,(r,i,o,a)=>Wwe(this,r,i,o,a)),this.domObserver.start(),uwe(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let n in t)this._props[n]=t[n];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&yR(this),this._props=t,t.plugins&&(t.plugins.forEach(o3),this.directPlugins=t.plugins),this.updateStateInner(t.state,!0)}setProps(t){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in t)n[r]=t[r];this.update(n)}updateState(t){this.updateStateInner(t,this.state.plugins!=t.plugins)}updateStateInner(t,n){let r=this.state,i=!1,o=!1;if(t.storedMarks&&this.composing&&(HV(this),o=!0),this.state=t,n){let f=i3(this);jwe(f,this.nodeViews)&&(this.nodeViews=f,i=!0),yR(this)}this.editable=r3(this),n3(this);let a=wR(this),u=t3(this),s=n?"reset":t.scrollToSelection>r.scrollToSelection?"to selection":"preserve",c=i||!this.docView.matchesNode(t.doc,u,a);(c||!t.selection.eq(r.selection))&&(o=!0);let l=s=="preserve"&&o&&this.dom.style.overflowAnchor==null&&wOe(this);if(o){this.domObserver.stop();let f=c&&($r||An)&&!this.composing&&!r.selection.empty&&!t.selection.empty&&Lwe(r.selection,t.selection);if(c){let d=An?this.trackWrites=this.domSelection().focusNode:null;(i||!this.docView.update(t.doc,u,a,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=mV(t.doc,u,a,this.dom,this)),d&&!this.trackWrites&&(f=!0)}f||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelection())&&ZOe(this))?Wu(this,f):(wV(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}if(this.updatePluginViews(r),s=="reset")this.dom.scrollTop=0;else if(s=="to selection"){let f=this.domSelection().focusNode;if(!this.someProp("handleScrollToSelection",d=>d(this)))if(t.selection instanceof ve){let d=this.docView.domAfterPos(t.selection.from);d.nodeType==1&&rV(this,d.getBoundingClientRect(),f)}else rV(this,this.coordsAtPos(t.selection.head,1),f)}else l&&EOe(l)}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(!t||t.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,t)}}someProp(t,n){let r=this._props&&this._props[t],i;if(r!=null&&(i=n?n(r):r))return i;for(let a=0;a<this.directPlugins.length;a++){let u=this.directPlugins[a].props[t];if(u!=null&&(i=n?n(u):u))return i}let o=this.state.plugins;if(o)for(let a=0;a<o.length;a++){let u=o[a].props[t];if(u!=null&&(i=n?n(u):u))return i}}hasFocus(){return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&ROe(this.dom),Wu(this),this.domObserver.start()}get root(){let t=this._root;if(t==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return t||document}posAtCoords(t){return kOe(this,t)}coordsAtPos(t,n=1){return sV(this,t,n)}domAtPos(t,n=0){return this.docView.domFromPos(t,n)}nodeDOM(t){let n=this.docView.descAt(t);return n?n.nodeDOM:null}posAtDOM(t,n,r=-1){let i=this.docView.posFromDOM(t,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(t,n){return DOe(this,n||this.state,t)}destroy(){!this.docView||(swe(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],wR(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return this.docView==null}dispatchEvent(t){return lwe(this,t)}dispatch(t){let n=this._props.dispatchTransaction;n?n.call(this,t):this.updateState(this.state.apply(t))}domSelection(){return this.root.getSelection()}}function t3(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),t.translate="no",e.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(e.state)),n)for(let r in n)r=="class"&&(t.class+=" "+n[r]),r=="style"?t.style=(t.style?t.style+";":"")+n[r]:!t[r]&&r!="contenteditable"&&r!="nodeName"&&(t[r]=String(n[r]))}),[Sr.node(0,e.state.doc.content.size,t)]}function n3(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:Sr.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function r3(e){return!e.someProp("editable",t=>t(e.state)===!1)}function Lwe(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function i3(e){let t=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(t,i)||(t[i]=r[i])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function jwe(e,t){let n=0,r=0;for(let i in e){if(e[i]!=t[i])return!0;n++}for(let i in t)r++;return n!=r}function o3(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Fu={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:"'"},Lb={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},a3=typeof navigator<"u"&&/Chrome\/(\d+)/.exec(navigator.userAgent);typeof navigator<"u"&&/Gecko\/\d+/.test(navigator.userAgent);for(var Uwe=typeof navigator<"u"&&/Mac/.test(navigator.platform),Bwe=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),zwe=Uwe||a3&&+a3[1]<57,fn=0;fn<10;fn++)Fu[48+fn]=Fu[96+fn]=String(fn);for(var fn=1;fn<=24;fn++)Fu[fn+111]="F"+fn;for(var fn=65;fn<=90;fn++)Fu[fn]=String.fromCharCode(fn+32),Lb[fn]=String.fromCharCode(fn);for(var RR in Fu)Lb.hasOwnProperty(RR)||(Lb[RR]=Fu[RR]);function qwe(e){var t=zwe&&(e.ctrlKey||e.altKey||e.metaKey)||Bwe&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?Lb:Fu)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const Kwe=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function Vwe(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n=="Space"&&(n=" ");let r,i,o,a;for(let u=0;u<t.length-1;u++){let s=t[u];if(/^(cmd|meta|m)$/i.test(s))a=!0;else if(/^a(lt)?$/i.test(s))r=!0;else if(/^(c|ctrl|control)$/i.test(s))i=!0;else if(/^s(hift)?$/i.test(s))o=!0;else if(/^mod$/i.test(s))Kwe?a=!0:i=!0;else throw new Error("Unrecognized modifier name: "+s)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),a&&(n="Meta-"+n),o&&(n="Shift-"+n),n}function Hwe(e){let t=Object.create(null);for(let n in e)t[Vwe(n)]=e[n];return t}function MR(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n!==!1&&t.shiftKey&&(e="Shift-"+e),e}function Jwe(e){return new Kr({props:{handleKeyDown:Gwe(e)}})}function Gwe(e){let t=Hwe(e);return function(n,r){let i=qwe(r),o=i.length==1&&i!=" ",a,u=t[MR(i,r,!o)];if(u&&u(n.state,n.dispatch,n))return!0;if(o&&(r.shiftKey||r.altKey||r.metaKey||i.charCodeAt(0)>127)&&(a=Fu[r.keyCode])&&a!=i){let s=t[MR(a,r,!0)];if(s&&s(n.state,n.dispatch,n))return!0}else if(o&&r.shiftKey){let s=t[MR(i,r,!0)];if(s&&s(n.state,n.dispatch,n))return!0}return!1}}const u3=65535,s3=Math.pow(2,16);function Ywe(e,t){return e+t*s3}function c3(e){return e&u3}function Zwe(e){return(e-(e&u3))/s3}const l3=1,f3=2,jb=4,d3=8;class p3{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&d3)>0}get deletedBefore(){return(this.delInfo&(l3|jb))>0}get deletedAfter(){return(this.delInfo&(f3|jb))>0}get deletedAcross(){return(this.delInfo&jb)>0}}class Mi{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&Mi.empty)return Mi.empty}recover(t){let n=0,r=c3(t);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+Zwe(t)}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,r){let i=0,o=this.inverted?2:1,a=this.inverted?1:2;for(let u=0;u<this.ranges.length;u+=3){let s=this.ranges[u]-(this.inverted?i:0);if(s>t)break;let c=this.ranges[u+o],l=this.ranges[u+a],f=s+c;if(t<=f){let d=c?t==s?-1:t==f?1:n:n,p=s+i+(d<0?0:l);if(r)return p;let h=t==(n<0?s:f)?null:Ywe(u/3,t-s),v=t==s?f3:t==f?l3:jb;return(n<0?t!=s:t!=f)&&(v|=d3),new p3(p,v,h)}i+=l-c}return r?t+i:new p3(t+i,0,null)}touches(t,n){let r=0,i=c3(n),o=this.inverted?2:1,a=this.inverted?1:2;for(let u=0;u<this.ranges.length;u+=3){let s=this.ranges[u]-(this.inverted?r:0);if(s>t)break;let c=this.ranges[u+o],l=s+c;if(t<=l&&u==i*3)return!0;r+=this.ranges[u+a]-c}return!1}forEach(t){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let a=this.ranges[i],u=a-(this.inverted?o:0),s=a+(this.inverted?0:o),c=this.ranges[i+n],l=this.ranges[i+r];t(u,u+c,s,s+l),o+=l-c}}invert(){return new Mi(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?Mi.empty:new Mi(t<0?[0,-t,0]:[0,0,t])}}Mi.empty=new Mi([]);const xR=Object.create(null);class Du{getMap(){return Mi.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=xR[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in xR)throw new RangeError("Duplicate use of step JSON ID "+t);return xR[t]=n,n.prototype.jsonID=t,n}}class Tr{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new Tr(t,null)}static fail(t){return new Tr(null,t)}static fromReplace(t,n,r,i){try{return Tr.ok(t.replace(n,r,i))}catch(o){if(o instanceof xf)return Tr.fail(o.message);throw o}}}function CR(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(CR(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return V.fromArray(r)}class Tc extends Du{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 X(CR(n.content,(a,u)=>!a.isAtom||!u.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),i),n.openStart,n.openEnd);return Tr.fromReplace(t,this.from,this.to,o)}invert(){return new Ic(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 Tc(n.pos,r.pos,this.mark)}merge(t){return t instanceof Tc&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Tc(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Tc(n.from,n.to,t.markFromJSON(n.mark))}}Du.jsonID("addMark",Tc);class Ic extends Du{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 X(CR(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),n.openStart,n.openEnd);return Tr.fromReplace(t,this.from,this.to,r)}invert(){return new Tc(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 Ic(n.pos,r.pos,this.mark)}merge(t){return t instanceof Ic&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Ic(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Ic(n.from,n.to,t.markFromJSON(n.mark))}}Du.jsonID("removeMark",Ic);class _a extends Du{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&AR(t,this.from,this.to)?Tr.fail("Structure replace would overwrite content"):Tr.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new Mi([this.from,this.to-this.from,this.slice.size])}invert(t){return new _a(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 _a(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof _a)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?X.empty:new X(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new _a(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?X.empty:new X(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new _a(t.from,this.to,n,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new _a(n.from,n.to,X.fromJSON(t,n.slice),!!n.structure)}}Du.jsonID("replace",_a);class qf extends Du{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&&(AR(t,this.from,this.gapFrom)||AR(t,this.gapTo,this.to)))return Tr.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Tr.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Tr.fromReplace(t,this.from,this.to,r):Tr.fail("Content does not fit in gap")}getMap(){return new Mi([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 qf(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 qf(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new qf(n.from,n.to,n.gapFrom,n.gapTo,X.fromJSON(t,n.slice),n.insert,!!n.structure)}}Du.jsonID("replaceAround",qf);function AR(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let a=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}}return!1}function Xwe(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Qwe(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let r=e.depth;;--r){let i=e.$from.node(r),o=e.$from.index(r),a=e.$to.indexAfter(r);if(r<e.depth&&i.canReplace(o,a,n))return r;if(r==0||i.type.spec.isolating||!Xwe(i,o,a))break}return null}function e1e(e,t,n=null,r=e){let i=t1e(e,t),o=i&&n1e(r,t);return o?i.map(h3).concat({type:t,attrs:n}).concat(o.map(h3)):null}function h3(e){return{type:e,attrs:null}}function t1e(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.contentMatchAt(r).findWrapping(t);if(!o)return null;let a=o.length?o[0]:t;return n.canReplaceWith(r,i,a)?o:null}function n1e(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.child(r),a=t.contentMatch.findWrapping(o.type);if(!a)return null;let s=(a.length?a[a.length-1]:t).contentMatch;for(let c=r;s&&c<i;c++)s=s.matchType(n.child(c).type);return!s||!s.validEnd?null:a}function Ub(e,t,n=1,r){let i=e.resolve(t),o=i.depth-n,a=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!a.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,l=n-2;c>o;c--,l--){let f=i.node(c),d=i.index(c);if(f.type.spec.isolating)return!1;let p=f.content.cutByIndex(d,f.childCount),h=r&&r[l]||f;if(h!=f&&(p=p.replaceChild(0,h.type.create(h.attrs))),!f.canReplace(d+1,f.childCount)||!h.type.validContent(p))return!1}let u=i.indexAfter(o),s=r&&r[0];return i.node(o).canReplaceWith(u,u,s?s.type:i.node(o+1).type)}function kR(e,t){let n=e.resolve(t),r=n.index();return r1e(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function r1e(e,t){return!!(e&&t&&!e.isLeaf&&e.canAppend(t))}let qh=class extends Error{};qh=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},qh.prototype=Object.create(Error.prototype),qh.prototype.constructor=qh,qh.prototype.name="TransformError";const i1e=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0),o1e=(e,t,n)=>{let{$cursor:r}=e.selection;if(!r||(n?!n.endOfTextblock("backward",e):r.parentOffset>0))return!1;let i=m3(r);if(!i){let a=r.blockRange(),u=a&&Wh(a);return u==null?!1:(t&&t(e.tr.lift(a,u).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&y3(e,i,t))return!0;if(r.parent.content.size==0&&(Kf(o,"end")||ve.isSelectable(o))){let a=JE(e.doc,r.before(),r.after(),X.empty);if(a&&a.slice.size<a.to-a.from){if(t){let u=e.tr.step(a);u.setSelection(Kf(o,"end")?Fe.findFrom(u.doc.resolve(u.mapping.map(i.pos,-1)),-1):ve.create(u.doc,i.pos-o.nodeSize)),t(u.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1};function Kf(e,t,n=!1){for(let r=e;r;r=t=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const a1e=(e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;o=m3(r)}let a=o&&o.nodeBefore;return!a||!ve.isSelectable(a)?!1:(t&&t(e.tr.setSelection(ve.create(e.doc,o.pos-a.nodeSize)).scrollIntoView()),!0)};function m3(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}const u1e=(e,t,n)=>{let{$cursor:r}=e.selection;if(!r||(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size))return!1;let i=v3(r);if(!i)return!1;let o=i.nodeAfter;if(y3(e,i,t))return!0;if(r.parent.content.size==0&&(Kf(o,"start")||ve.isSelectable(o))){let a=JE(e.doc,r.before(),r.after(),X.empty);if(a&&a.slice.size<a.to-a.from){if(t){let u=e.tr.step(a);u.setSelection(Kf(o,"start")?Fe.findFrom(u.doc.resolve(u.mapping.map(i.pos)),1):ve.create(u.doc,u.mapping.map(i.pos))),t(u.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0):!1},s1e=(e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;o=v3(r)}let a=o&&o.nodeAfter;return!a||!ve.isSelectable(a)?!1:(t&&t(e.tr.setSelection(ve.create(e.doc,o.pos)).scrollIntoView()),!0)};function v3(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}const c1e=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),o=i&&Wh(i);return o==null?!1:(t&&t(e.tr.lift(i,o).scrollIntoView()),!0)},l1e=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
40
+ `).scrollIntoView()),!0)};function g3(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const f1e=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),a=g3(i.contentMatchAt(o));if(!a||!i.canReplaceWith(o,o,a))return!1;if(t){let u=n.after(),s=e.tr.replaceWith(u,u,a.createAndFill());s.setSelection(Fe.near(s.doc.resolve(u),1)),t(s.scrollIntoView())}return!0},d1e=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof Ei||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=g3(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let a=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,u=e.tr.insert(a,o.createAndFill());u.setSelection(Ae.create(u.doc,a+1)),t(u.scrollIntoView())}return!0},p1e=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(LK(e.doc,o))return t&&t(e.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Wh(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)},h1e=(e,t)=>{let{$from:n,to:r}=e.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),t&&t(e.tr.setSelection(ve.create(e.doc,i))),!0)};function m1e(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,o=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(o-1,o)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(o,o+1)||!(i.isTextblock||jK(e.doc,t.pos))?!1:(n&&n(e.tr.clearIncompatible(t.pos,r.type,r.contentMatchAt(r.childCount)).join(t.pos).scrollIntoView()),!0)}function y3(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,o,a;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(m1e(e,t,n))return!0;let u=t.parent.canReplace(t.index(),t.index()+1);if(u&&(o=(a=r.contentMatchAt(r.childCount)).findWrapping(i.type))&&a.matchType(o[0]||i.type).validEnd){if(n){let f=t.pos+i.nodeSize,d=V.empty;for(let v=o.length-1;v>=0;v--)d=V.from(o[v].create(null,d));d=V.from(r.copy(d));let p=e.tr.step(new ln(t.pos-1,f,t.pos,f,new X(d,1,0),o.length,!0)),h=f+2*o.length;jK(p.doc,h)&&p.join(h),n(p.scrollIntoView())}return!0}let s=Fe.findFrom(t,1),c=s&&s.$from.blockRange(s.$to),l=c&&Wh(c);if(l!=null&&l>=t.depth)return n&&n(e.tr.lift(c,l).scrollIntoView()),!0;if(u&&Kf(i,"start",!0)&&Kf(r,"end")){let f=r,d=[];for(;d.push(f),!f.isTextblock;)f=f.lastChild;let p=i,h=1;for(;!p.isTextblock;p=p.firstChild)h++;if(f.canReplace(f.childCount,f.childCount,p.content)){if(n){let v=V.empty;for(let b=d.length-1;b>=0;b--)v=V.from(d[b].copy(v));let y=e.tr.step(new ln(t.pos-d.length,t.pos+i.nodeSize,t.pos+h,t.pos+i.nodeSize-h,new X(v,d.length,0),0,!0));n(y.scrollIntoView())}return!0}}return!1}function b3(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(n&&n(t.tr.setSelection(Ae.create(t.doc,e<0?i.start(o):i.end(o)))),!0):!1}}const v1e=b3(-1),g1e=b3(1);function y1e(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,a=i.blockRange(o),u=a&&FK(a,e,t);return u?(r&&r(n.tr.wrap(a,u).scrollIntoView()),!0):!1}}function $3(e,t=null){return function(n,r){let{from:i,to:o}=n.selection,a=!1;return n.doc.nodesBetween(i,o,(u,s)=>{if(a)return!1;if(!(!u.isTextblock||u.hasMarkup(e,t)))if(u.type==e)a=!0;else{let c=n.doc.resolve(s),l=c.index();a=c.parent.canReplaceWith(l,l+1,e)}}),a?(r&&r(n.tr.setBlockType(i,o,e,t).scrollIntoView()),!0):!1}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function b1e(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,a=i.blockRange(o),u=!1,s=a;if(!a)return!1;if(a.depth>=2&&i.node(a.depth-1).type.compatibleContent(e)&&a.startIndex==0){if(i.index(a.depth-1)==0)return!1;let l=n.doc.resolve(a.start-2);s=new Tb(l,l,a.depth),a.endIndex<a.parent.childCount&&(a=new Tb(i,n.doc.resolve(o.end(a.depth)),a.depth)),u=!0}let c=FK(s,e,t,a);return c?(r&&r($1e(n.tr,a,c,u,e).scrollIntoView()),!0):!1}}function $1e(e,t,n,r,i){let o=V.empty;for(let l=n.length-1;l>=0;l--)o=V.from(n[l].type.create(n[l].attrs,o));e.step(new ln(t.start-(r?2:0),t.end,t.start,t.end,new X(o,0,0),n.length,!0));let a=0;for(let l=0;l<n.length;l++)n[l].type==i&&(a=l+1);let u=n.length-a,s=t.start+n.length-(r?2:0),c=t.parent;for(let l=t.startIndex,f=t.endIndex,d=!0;l<f;l++,d=!1)!d&&LK(e.doc,s,u)&&(e.split(s,u),s+=2*u),s+=c.child(l).nodeSize;return e}function _1e(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,a=>a.childCount>0&&a.firstChild.type==e);return o?n?r.node(o.depth-1).type==e?S1e(t,n,e,o):T1e(t,n,o):!0:!1}}function S1e(e,t,n,r){let i=e.tr,o=r.end,a=r.$to.end(r.depth);return o<a&&(i.step(new ln(o-1,a,o,a,new X(V.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Tb(i.doc.resolve(r.$from.pos),i.doc.resolve(a),r.depth)),t(i.lift(r,Wh(r)).scrollIntoView()),!0}function T1e(e,t,n){let r=e.tr,i=n.parent;for(let p=n.end,h=n.endIndex-1,v=n.startIndex;h>v;h--)p-=i.child(h).nodeSize,r.delete(p-1,p+1);let o=r.doc.resolve(n.start),a=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let u=n.startIndex==0,s=n.endIndex==i.childCount,c=o.node(-1),l=o.index(-1);if(!c.canReplace(l+(u?0:1),l+1,a.content.append(s?V.empty:V.from(i))))return!1;let f=o.pos,d=f+a.nodeSize;return r.step(new ln(f-(u?1:0),d+(s?1:0),f+1,d-1,new X((u?V.empty:V.from(i.copy(V.empty))).append(s?V.empty:V.from(i.copy(V.empty))),u?0:1,s?0:1),u?0:1)),t(r.scrollIntoView()),!0}function I1e(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,c=>c.childCount>0&&c.firstChild.type==e);if(!o)return!1;let a=o.startIndex;if(a==0)return!1;let u=o.parent,s=u.child(a-1);if(s.type!=e)return!1;if(n){let c=s.lastChild&&s.lastChild.type==u.type,l=V.from(c?e.create():null),f=new X(V.from(e.create(null,V.from(u.type.create(null,l)))),c?3:1,0),d=o.start,p=o.end;n(t.tr.step(new ln(d-(c?3:1),p,d,p,f,1,!0)).scrollIntoView())}return!0}}function Bb(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),filterTransaction:t.filterTransaction,plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}class zb{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:n,state:r}=this,{view:i}=n,{tr:o}=r,a=this.buildProps(o);return Object.fromEntries(Object.entries(t).map(([u,s])=>[u,(...l)=>{const f=s(...l)(a);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),f}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:a}=i,u=[],s=!!t,c=t||o.tr,l=()=>(!s&&n&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&a.dispatch(c),u.every(d=>d===!0)),f={...Object.fromEntries(Object.entries(r).map(([d,p])=>[d,(...v)=>{const y=this.buildProps(c,n),b=p(...v)(y);return u.push(b),f}])),run:l};return f}createCan(t){const{rawCommands:n,state:r}=this,i=!1,o=t||r.tr,a=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(n).map(([s,c])=>[s,(...l)=>c(...l)({...a,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(t,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:a}=i;o.storedMarks&&t.setStoredMarks(o.storedMarks);const u={tr:t,editor:i,view:a,state:Bb({state:o,transaction:t}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(t),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(r).map(([s,c])=>[s,(...l)=>c(...l)(u)]))}};return u}}class O1e{constructor(){this.callbacks={}}on(t,n){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(n),this}emit(t,...n){const r=this.callbacks[t];return r&&r.forEach(i=>i.apply(this,n)),this}off(t,n){const r=this.callbacks[t];return r&&(n?this.callbacks[t]=r.filter(i=>i!==n):delete this.callbacks[t]),this}removeAllListeners(){this.callbacks={}}}function ue(e,t,n){return e.config[t]===void 0&&e.parent?ue(e.parent,t,n):typeof e.config[t]=="function"?e.config[t].bind({...n,parent:e.parent?ue(e.parent,t,n):null}):e.config[t]}function qb(e){const t=e.filter(i=>i.type==="extension"),n=e.filter(i=>i.type==="node"),r=e.filter(i=>i.type==="mark");return{baseExtensions:t,nodeExtensions:n,markExtensions:r}}function _3(e){const t=[],{nodeExtensions:n,markExtensions:r}=qb(e),i=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach(a=>{const u={name:a.name,options:a.options,storage:a.storage},s=ue(a,"addGlobalAttributes",u);if(!s)return;s().forEach(l=>{l.types.forEach(f=>{Object.entries(l.attributes).forEach(([d,p])=>{t.push({type:f,name:d,attribute:{...o,...p}})})})})}),i.forEach(a=>{const u={name:a.name,options:a.options,storage:a.storage},s=ue(a,"addAttributes",u);if(!s)return;const c=s();Object.entries(c).forEach(([l,f])=>{const d={...o,...f};f.isRequired&&f.default===void 0&&delete d.default,t.push({type:a.name,name:l,attribute:d})})}),t}function Ht(e,t){if(typeof e=="string"){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}function dn(...e){return e.filter(t=>!!t).reduce((t,n)=>{const r={...t};return Object.entries(n).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}i==="class"?r[i]=[r[i],o].join(" "):i==="style"?r[i]=[r[i],o].join("; "):r[i]=o}),r},{})}function WR(e,t){return t.filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(e.attrs)||{}:{[n.name]:e.attrs[n.name]}).reduce((n,r)=>dn(n,r),{})}function S3(e){return typeof e=="function"}function Ee(e,t=void 0,...n){return S3(e)?t?e.bind(t)(...n):e(...n):e}function w1e(e={}){return Object.keys(e).length===0&&e.constructor===Object}function E1e(e){return typeof e!="string"?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e==="true"?!0:e==="false"?!1:e}function T3(e,t){return e.style?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;const i=t.reduce((o,a)=>{const u=a.attribute.parseHTML?a.attribute.parseHTML(n):E1e(n.getAttribute(a.name));return u==null?o:{...o,[a.name]:u}},{});return{...r,...i}}}}function I3(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>t==="attrs"&&w1e(n)?!1:n!=null))}function O3(e){var t;const n=_3(e),{nodeExtensions:r,markExtensions:i}=qb(e),o=(t=r.find(s=>ue(s,"topNode")))===null||t===void 0?void 0:t.name,a=Object.fromEntries(r.map(s=>{const c=n.filter(y=>y.type===s.name),l={name:s.name,options:s.options,storage:s.storage},f=e.reduce((y,b)=>{const w=ue(b,"extendNodeSchema",l);return{...y,...w?w(s):{}}},{}),d=I3({...f,content:Ee(ue(s,"content",l)),marks:Ee(ue(s,"marks",l)),group:Ee(ue(s,"group",l)),inline:Ee(ue(s,"inline",l)),atom:Ee(ue(s,"atom",l)),selectable:Ee(ue(s,"selectable",l)),draggable:Ee(ue(s,"draggable",l)),code:Ee(ue(s,"code",l)),defining:Ee(ue(s,"defining",l)),isolating:Ee(ue(s,"isolating",l)),attrs:Object.fromEntries(c.map(y=>{var b;return[y.name,{default:(b=y==null?void 0:y.attribute)===null||b===void 0?void 0:b.default}]}))}),p=Ee(ue(s,"parseHTML",l));p&&(d.parseDOM=p.map(y=>T3(y,c)));const h=ue(s,"renderHTML",l);h&&(d.toDOM=y=>h({node:y,HTMLAttributes:WR(y,c)}));const v=ue(s,"renderText",l);return v&&(d.toText=v),[s.name,d]})),u=Object.fromEntries(i.map(s=>{const c=n.filter(v=>v.type===s.name),l={name:s.name,options:s.options,storage:s.storage},f=e.reduce((v,y)=>{const b=ue(y,"extendMarkSchema",l);return{...v,...b?b(s):{}}},{}),d=I3({...f,inclusive:Ee(ue(s,"inclusive",l)),excludes:Ee(ue(s,"excludes",l)),group:Ee(ue(s,"group",l)),spanning:Ee(ue(s,"spanning",l)),code:Ee(ue(s,"code",l)),attrs:Object.fromEntries(c.map(v=>{var y;return[v.name,{default:(y=v==null?void 0:v.attribute)===null||y===void 0?void 0:y.default}]}))}),p=Ee(ue(s,"parseHTML",l));p&&(d.parseDOM=p.map(v=>T3(v,c)));const h=ue(s,"renderHTML",l);return h&&(d.toDOM=v=>h({mark:v,HTMLAttributes:WR(v,c)})),[s.name,d]}));return new FIe({topNode:o,nodes:a,marks:u})}function NR(e,t){return t.nodes[e]||t.marks[e]||null}function w3(e,t){return Array.isArray(t)?t.some(n=>(typeof n=="string"?n:n.name)===e.name):t}const R1e=(e,t=500)=>{let n="";return e.parent.nodesBetween(Math.max(0,e.parentOffset-t),e.parentOffset,(r,i,o,a)=>{var u,s,c;n+=((s=(u=r.type.spec).toText)===null||s===void 0?void 0:s.call(u,{node:r,pos:i,parent:o,index:a}))||((c=e.nodeBefore)===null||c===void 0?void 0:c.text)||"%leaf%"}),n};function PR(e){return Object.prototype.toString.call(e)==="[object RegExp]"}class FR{constructor(t){this.find=t.find,this.handler=t.handler}}const M1e=(e,t)=>{if(PR(t))return t.exec(e);const n=t(e);if(!n)return null;const r=[];return r.push(n.text),r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function DR(e){var t;const{editor:n,from:r,to:i,text:o,rules:a,plugin:u}=e,{view:s}=n;if(s.composing)return!1;const c=s.state.doc.resolve(r);if(c.parent.type.spec.code||!!(!((t=c.nodeBefore||c.nodeAfter)===null||t===void 0)&&t.marks.find(d=>d.type.spec.code)))return!1;let l=!1;const f=R1e(c)+o;return a.forEach(d=>{if(l)return;const p=M1e(f,d.find);if(!p)return;const h=s.state.tr,v=Bb({state:s.state,transaction:h}),y={from:r-(p[0].length-o.length),to:i},{commands:b,chain:w,can:F}=new zb({editor:n,state:v});d.handler({state:v,range:y,match:p,commands:b,chain:w,can:F})===null||!h.steps.length||(h.setMeta(u,{transform:h,from:r,to:i,text:o}),s.dispatch(h),l=!0)}),l}function x1e(e){const{editor:t,rules:n}=e,r=new Kr({state:{init(){return null},apply(i,o){const a=i.getMeta(r);return a||(i.selectionSet||i.docChanged?null:o)}},props:{handleTextInput(i,o,a,u){return DR({editor:t,from:o,to:a,text:u,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&DR({editor:t,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;const{$cursor:a}=i.state.selection;return a?DR({editor:t,from:a.pos,to:a.pos,text:`
41
+ `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function C1e(e){return typeof e=="number"}class A1e{constructor(t){this.find=t.find,this.handler=t.handler}}const k1e=(e,t)=>{if(PR(t))return[...e.matchAll(t)];const n=t(e);return n?n.map(r=>{const i=[];return i.push(r.text),i.index=r.index,i.input=e,i.data=r.data,r.replaceWith&&(r.text.includes(r.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(r.replaceWith)),i}):[]};function W1e(e){const{editor:t,state:n,from:r,to:i,rule:o}=e,{commands:a,chain:u,can:s}=new zb({editor:t,state:n}),c=[];return n.doc.nodesBetween(r,i,(f,d)=>{if(!f.isTextblock||f.type.spec.code)return;const p=Math.max(r,d),h=Math.min(i,d+f.content.size),v=f.textBetween(p-d,h-d,void 0,"\uFFFC");k1e(v,o.find).forEach(b=>{if(b.index===void 0)return;const w=p+b.index+1,F=w+b[0].length,g={from:n.tr.mapping.map(w),to:n.tr.mapping.map(F)},I=o.handler({state:n,range:g,match:b,commands:a,chain:u,can:s});c.push(I)})}),c.every(f=>f!==null)}function N1e(e){const{editor:t,rules:n}=e;let r=null,i=!1,o=!1;return n.map(u=>new Kr({view(s){const c=l=>{var f;r=!((f=s.dom.parentElement)===null||f===void 0)&&f.contains(l.target)?s.dom.parentElement:null};return window.addEventListener("dragstart",c),{destroy(){window.removeEventListener("dragstart",c)}}},props:{handleDOMEvents:{drop:s=>(o=r===s.dom.parentElement,!1),paste:(s,c)=>{var l;const f=(l=c.clipboardData)===null||l===void 0?void 0:l.getData("text/html");return i=!!(f!=null&&f.includes("data-pm-slice")),!1}}},appendTransaction:(s,c,l)=>{const f=s[0],d=f.getMeta("uiEvent")==="paste"&&!i,p=f.getMeta("uiEvent")==="drop"&&!o;if(!d&&!p)return;const h=c.doc.content.findDiffStart(l.doc.content),v=c.doc.content.findDiffEnd(l.doc.content);if(!C1e(h)||!v||h===v.b)return;const y=l.tr,b=Bb({state:l,transaction:y});if(!(!W1e({editor:t,state:b,from:Math.max(h-1,0),to:v.b-1,rule:u})||!y.steps.length))return y}}))}function P1e(e){const t=e.filter((n,r)=>e.indexOf(n)!==r);return[...new Set(t)]}class Oc{constructor(t,n){this.splittableMarks=[],this.editor=n,this.extensions=Oc.resolve(t),this.schema=O3(this.extensions),this.extensions.forEach(r=>{var i;this.editor.extensionStorage[r.name]=r.storage;const o={name:r.name,options:r.options,storage:r.storage,editor:this.editor,type:NR(r.name,this.schema)};r.type==="mark"&&((i=Ee(ue(r,"keepOnSplit",o)))!==null&&i!==void 0?i:!0)&&this.splittableMarks.push(r.name);const a=ue(r,"onBeforeCreate",o);a&&this.editor.on("beforeCreate",a);const u=ue(r,"onCreate",o);u&&this.editor.on("create",u);const s=ue(r,"onUpdate",o);s&&this.editor.on("update",s);const c=ue(r,"onSelectionUpdate",o);c&&this.editor.on("selectionUpdate",c);const l=ue(r,"onTransaction",o);l&&this.editor.on("transaction",l);const f=ue(r,"onFocus",o);f&&this.editor.on("focus",f);const d=ue(r,"onBlur",o);d&&this.editor.on("blur",d);const p=ue(r,"onDestroy",o);p&&this.editor.on("destroy",p)})}static resolve(t){const n=Oc.sort(Oc.flatten(t)),r=P1e(n.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),n}static flatten(t){return t.map(n=>{const r={name:n.name,options:n.options,storage:n.storage},i=ue(n,"addExtensions",r);return i?[n,...this.flatten(i())]:n}).flat(10)}static sort(t){return t.sort((r,i)=>{const o=ue(r,"priority")||100,a=ue(i,"priority")||100;return o>a?-1:o<a?1:0})}get commands(){return this.extensions.reduce((t,n)=>{const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:NR(n.name,this.schema)},i=ue(n,"addCommands",r);return i?{...t,...i()}:t},{})}get plugins(){const{editor:t}=this,n=Oc.sort([...this.extensions].reverse()),r=[],i=[],o=n.map(a=>{const u={name:a.name,options:a.options,storage:a.storage,editor:t,type:NR(a.name,this.schema)},s=[],c=ue(a,"addKeyboardShortcuts",u);let l={};if(a.type==="mark"&&a.config.exitable&&(l.ArrowRight=()=>Vf.handleExit({editor:t,mark:a})),c){const v=Object.fromEntries(Object.entries(c()).map(([y,b])=>[y,()=>b({editor:t})]));l={...l,...v}}const f=Jwe(l);s.push(f);const d=ue(a,"addInputRules",u);w3(a,t.options.enableInputRules)&&d&&r.push(...d());const p=ue(a,"addPasteRules",u);w3(a,t.options.enablePasteRules)&&p&&i.push(...p());const h=ue(a,"addProseMirrorPlugins",u);if(h){const v=h();s.push(...v)}return s}).flat();return[x1e({editor:t,rules:r}),...N1e({editor:t,rules:i}),...o]}get attributes(){return _3(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:n}=qb(this.extensions);return Object.fromEntries(n.filter(r=>!!ue(r,"addNodeView")).map(r=>{const i=this.attributes.filter(s=>s.type===r.name),o={name:r.name,options:r.options,storage:r.storage,editor:t,type:Ht(r.name,this.schema)},a=ue(r,"addNodeView",o);if(!a)return[];const u=(s,c,l,f)=>{const d=WR(s,i);return a()({editor:t,node:s,getPos:l,decorations:f,HTMLAttributes:d,extension:r})};return[r.name,u]}))}}function F1e(e){return Object.prototype.toString.call(e).slice(8,-1)}function LR(e){return F1e(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function Kb(e,t){const n={...e};return LR(e)&&LR(t)&&Object.keys(t).forEach(r=>{LR(t[r])?r in e?n[r]=Kb(e[r],t[r]):Object.assign(n,{[r]:t[r]}):Object.assign(n,{[r]:t[r]})}),n}class Ir{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=Ee(ue(this,"addOptions",{name:this.name}))),this.storage=Ee(ue(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new Ir(t)}configure(t={}){const n=this.extend();return n.options=Kb(this.options,t),n.storage=Ee(ue(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){const n=new Ir(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=Ee(ue(n,"addOptions",{name:n.name})),n.storage=Ee(ue(n,"addStorage",{name:n.name,options:n.options})),n}}function E3(e,t,n){const{from:r,to:i}=t,{blockSeparator:o=`
42
42
 
43
- `,textSerializers:a={}}=n||{};let u="",s=!0;return e.nodesBetween(r,i,(c,l,f,d)=>{var p;const h=a==null?void 0:a[c.type.name];h?(c.isBlock&&!s&&(u+=o,s=!0),f&&(u+=h({node:c,pos:l,parent:f,index:d,range:t}))):c.isText?(u+=(p=c==null?void 0:c.text)===null||p===void 0?void 0:p.slice(Math.max(r,l)-l,i-l),s=!1):c.isBlock&&!s&&(u+=o,s=!0)}),u}function T3(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}const E1e=Ir.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new Kr({key:new xu("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:o}=i,a=Math.min(...o.map(l=>l.$from.pos)),u=Math.max(...o.map(l=>l.$to.pos)),s=T3(n);return S3(r,{from:a,to:u},{textSerializers:s})}}})]}}),R1e=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),M1e=(e=!1)=>({commands:t})=>t.setContent("",e),x1e=()=>({state:e,tr:t,dispatch:n})=>{const{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:a})=>{e.doc.nodesBetween(o.pos,a.pos,(u,s)=>{if(u.type.isText)return;const{doc:c,mapping:l}=t,f=c.resolve(l.map(s)),d=c.resolve(l.map(s+u.nodeSize)),p=f.blockRange(d);if(!p)return;const h=Bwe(p);if(u.type.isTextblock){const{defaultType:v}=f.parent.contentMatchAt(f.index());t.setNodeMarkup(p.start,v)}(h||h===0)&&t.lift(p,h)})}),!0},C1e=e=>t=>e(t),A1e=()=>({state:e,dispatch:t})=>t1e(e,t),k1e=e=>({tr:t,state:n,dispatch:r})=>{const i=Ht(e,n.schema),o=t.selection.$anchor;for(let a=o.depth;a>0;a-=1)if(o.node(a).type===i){if(r){const s=o.before(a),c=o.after(a);t.delete(s,c).scrollIntoView()}return!0}return!1},W1e=e=>({tr:t,dispatch:n})=>{const{from:r,to:i}=e;return n&&t.delete(r,i),!0},N1e=()=>({state:e,dispatch:t})=>Hwe(e,t),P1e=()=>({commands:e})=>e.keyboardShortcut("Enter"),F1e=()=>({state:e,dispatch:t})=>e1e(e,t);function Hb(e,t,n={strict:!0}){const r=Object.keys(t);return r.length?r.every(i=>n.strict?t[i]===e[i]:DR(t[i])?t[i].test(e[i]):t[i]===e[i]):!0}function BR(e,t,n={}){return e.find(r=>r.type===t&&Hb(r.attrs,n))}function D1e(e,t,n={}){return!!BR(e,t,n)}function zR(e,t,n={}){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if(e.parentOffset===r.offset&&r.offset!==0&&(r=e.parent.childBefore(e.parentOffset)),!r.node)return;const i=BR([...r.node.marks],t,n);if(!i)return;let o=r.index,a=e.start()+r.offset,u=o+1,s=a+r.node.nodeSize;for(BR([...r.node.marks],t,n);o>0&&i.isInSet(e.parent.child(o-1).marks);)o-=1,a-=e.parent.child(o).nodeSize;for(;u<e.parent.childCount&&D1e([...e.parent.child(u).marks],t,n);)s+=e.parent.child(u).nodeSize,u+=1;return{from:a,to:s}}function Uu(e,t){if(typeof e=="string"){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}const L1e=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const o=Uu(e,r.schema),{doc:a,selection:u}=n,{$from:s,from:c,to:l}=u;if(i){const f=zR(s,o,t);if(f&&f.from<=c&&f.to>=l){const d=Ae.create(a,f.from,f.to);n.setSelection(d)}}return!0},j1e=e=>t=>{const n=typeof e=="function"?e(t):e;for(let r=0;r<n.length;r+=1)if(n[r](t))return!0;return!1};function I3(e){return e instanceof Ae}function Ta(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function O3(e,t=null){if(!t)return null;const n=Fe.atStart(e),r=Fe.atEnd(e);if(t==="start"||t===!0)return n;if(t==="end")return r;const i=n.from,o=r.to;return t==="all"?Ae.create(e,Ta(0,i,o),Ta(e.content.size,i,o)):Ae.create(e,Ta(t,i,o),Ta(t,i,o))}function Jb(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const U1e=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:o})=>{t={scrollIntoView:!0,...t};const a=()=>{Jb()&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t!=null&&t.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&e===null||e===!1)return!0;if(o&&e===null&&!I3(n.state.selection))return a(),!0;const u=O3(i.doc,e)||n.state.selection,s=n.state.selection.eq(u);return o&&(s||i.setSelection(u),s&&i.storedMarks&&i.setStoredMarks(i.storedMarks),a()),!0},B1e=(e,t)=>n=>e.every((r,i)=>t(r,{...n,index:i})),z1e=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t);function w3(e){const t=`<body>${e}</body>`;return new window.DOMParser().parseFromString(t,"text/html").body}function Gb(e,t,n){if(n={slice:!0,parseOptions:{},...n},typeof e=="object"&&e!==null)try{return Array.isArray(e)?V.fromArray(e.map(r=>t.nodeFromJSON(r))):t.nodeFromJSON(e)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",r),Gb("",t,n)}if(typeof e=="string"){const r=kf.fromSchema(t);return n.slice?r.parseSlice(w3(e),n.parseOptions).content:r.parse(w3(e),n.parseOptions)}return Gb("",t,n)}function q1e(e,t,n){const r=e.steps.length-1;if(r<t)return;const i=e.steps[r];if(!(i instanceof Sa||i instanceof Vf))return;const o=e.mapping.maps[r];let a=0;o.forEach((u,s,c,l)=>{a===0&&(a=l)}),e.setSelection(Fe.near(e.doc.resolve(a),n))}const K1e=e=>e.toString().startsWith("<"),V1e=(e,t,n)=>({tr:r,dispatch:i,editor:o})=>{if(i){n={parseOptions:{},updateSelection:!0,...n};const a=Gb(t,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions}});if(a.toString()==="<>")return!0;let{from:u,to:s}=typeof e=="number"?{from:e,to:e}:e,c=!0,l=!0;if((K1e(a)?a:[a]).forEach(d=>{d.check(),c=c?d.isText&&d.marks.length===0:!1,l=l?d.isBlock:!1}),u===s&&l){const{parent:d}=r.doc.resolve(u);d.isTextblock&&!d.type.spec.code&&!d.childCount&&(u-=1,s+=1)}c?r.insertText(t,u,s):r.replaceWith(u,s,a),n.updateSelection&&q1e(r,r.steps.length-1,-1)}return!0},H1e=()=>({state:e,dispatch:t})=>Jwe(e,t),J1e=()=>({state:e,dispatch:t})=>Ywe(e,t);function E3(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function G1e(e){const t=e.split(/-(?!$)/);let n=t[t.length-1];n==="Space"&&(n=" ");let r,i,o,a;for(let u=0;u<t.length-1;u+=1){const s=t[u];if(/^(cmd|meta|m)$/i.test(s))a=!0;else if(/^a(lt)?$/i.test(s))r=!0;else if(/^(c|ctrl|control)$/i.test(s))i=!0;else if(/^s(hift)?$/i.test(s))o=!0;else if(/^mod$/i.test(s))Jb()||E3()?a=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${s}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),a&&(n=`Meta-${n}`),o&&(n=`Shift-${n}`),n}const Y1e=e=>({editor:t,view:n,tr:r,dispatch:i})=>{const o=G1e(e).split(/-(?!$)/),a=o.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),u=new KeyboardEvent("keydown",{key:a==="Space"?" ":a,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),s=t.captureTransaction(()=>{n.someProp("handleKeyDown",c=>c(n,u))});return s==null||s.steps.forEach(c=>{const l=c.map(r.mapping);l&&i&&r.maybeStep(l)}),!0};function qh(e,t,n={}){const{from:r,to:i,empty:o}=e.selection,a=t?Ht(t,e.schema):null,u=[];e.doc.nodesBetween(r,i,(f,d)=>{if(f.isText)return;const p=Math.max(r,d),h=Math.min(i,d+f.nodeSize);u.push({node:f,from:p,to:h})});const s=i-r,c=u.filter(f=>a?a.name===f.node.type.name:!0).filter(f=>Hb(f.node.attrs,n,{strict:!1}));return o?!!c.length:c.reduce((f,d)=>f+d.to-d.from,0)>=s}const Z1e=(e,t={})=>({state:n,dispatch:r})=>{const i=Ht(e,n.schema);return qh(n,i,t)?Xwe(n,r):!1},X1e=()=>({state:e,dispatch:t})=>n1e(e,t),Q1e=e=>({state:t,dispatch:n})=>{const r=Ht(e,t.schema);return l1e(r)(t,n)},eEe=()=>({state:e,dispatch:t})=>Qwe(e,t);function Yb(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function R3(e,t){const n=typeof t=="string"?[t]:t;return Object.keys(e).reduce((r,i)=>(n.includes(i)||(r[i]=e[i]),r),{})}const tEe=(e,t)=>({tr:n,state:r,dispatch:i})=>{let o=null,a=null;const u=Yb(typeof e=="string"?e:e.name,r.schema);return u?(u==="node"&&(o=Ht(e,r.schema)),u==="mark"&&(a=Uu(e,r.schema)),i&&n.selection.ranges.forEach(s=>{r.doc.nodesBetween(s.$from.pos,s.$to.pos,(c,l)=>{o&&o===c.type&&n.setNodeMarkup(l,void 0,R3(c.attrs,t)),a&&c.marks.length&&c.marks.forEach(f=>{a===f.type&&n.addMark(l,l+c.nodeSize,a.create(R3(f.attrs,t)))})})}),!0):!1},nEe=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),rEe=()=>({tr:e,commands:t})=>t.setTextSelection({from:0,to:e.doc.content.size}),iEe=()=>({state:e,dispatch:t})=>Gwe(e,t),oEe=()=>({state:e,dispatch:t})=>Zwe(e,t),aEe=()=>({state:e,dispatch:t})=>r1e(e,t),uEe=()=>({state:e,dispatch:t})=>a1e(e,t),sEe=()=>({state:e,dispatch:t})=>o1e(e,t);function M3(e,t,n={}){return Gb(e,t,{slice:!1,parseOptions:n})}const cEe=(e,t=!1,n={})=>({tr:r,editor:i,dispatch:o})=>{const{doc:a}=r,u=M3(e,i.schema,n);return o&&r.replaceWith(0,a.content.size,u).setMeta("preventUpdate",!t),!0};function x3(e,t){const n=Uu(t,e.schema),{from:r,to:i,empty:o}=e.selection,a=[];o?(e.storedMarks&&a.push(...e.storedMarks),a.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,s=>{a.push(...s.marks)});const u=a.find(s=>s.type.name===n.name);return u?{...u.attrs}:{}}const lEe=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:a,ranges:u}=o,s=Uu(e,r.schema);if(i)if(a){const c=x3(r,s);n.addStoredMark(s.create({...c,...t}))}else u.forEach(c=>{const l=c.$from.pos,f=c.$to.pos;r.doc.nodesBetween(l,f,(d,p)=>{const h=Math.max(p,l),v=Math.min(p+d.nodeSize,f);d.marks.find(b=>b.type===s)?d.marks.forEach(b=>{s===b.type&&n.addMark(h,v,s.create({...b.attrs,...t}))}):n.addMark(h,v,s.create(t))})});return!0},fEe=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),dEe=(e,t={})=>({state:n,dispatch:r,chain:i})=>{const o=Ht(e,n.schema);return o.isTextblock?i().command(({commands:a})=>m3(o,t)(n)?!0:a.clearNodes()).command(({state:a})=>m3(o,t)(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},pEe=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,i=Ta(e,0,r.content.size),o=ve.create(r,i);t.setSelection(o)}return!0},hEe=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,{from:i,to:o}=typeof e=="number"?{from:e,to:e}:e,a=Ae.atStart(r).from,u=Ae.atEnd(r).to,s=Ta(i,a,u),c=Ta(o,a,u),l=Ae.create(r,s,c);t.setSelection(l)}return!0},mEe=e=>({state:t,dispatch:n})=>{const r=Ht(e,t.schema);return p1e(r)(t,n)};function vEe(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function Zb(e,t,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=e.find(o=>o.type===t&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function C3(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter(i=>t==null?void 0:t.includes(i.type.name));e.tr.ensureMarks(r)}}const gEe=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{const{selection:o,doc:a}=t,{$from:u,$to:s}=o,c=i.extensionManager.attributes,l=Zb(c,u.node().type.name,u.node().attrs);if(o instanceof ve&&o.node.isBlock)return!u.parentOffset||!Bb(a,u.pos)?!1:(r&&(e&&C3(n,i.extensionManager.splittableMarks),t.split(u.pos).scrollIntoView()),!0);if(!u.parent.isBlock)return!1;if(r){const f=s.parentOffset===s.parent.content.size;o instanceof Ae&&t.deleteSelection();const d=u.depth===0?void 0:vEe(u.node(-1).contentMatchAt(u.indexAfter(-1)));let p=f&&d?[{type:d,attrs:l}]:void 0,h=Bb(t.doc,t.mapping.map(u.pos),1,p);if(!p&&!h&&Bb(t.doc,t.mapping.map(u.pos),1,d?[{type:d}]:void 0)&&(h=!0,p=d?[{type:d,attrs:l}]:void 0),h&&(t.split(t.mapping.map(u.pos),1,p),d&&!f&&!u.parentOffset&&u.parent.type!==d)){const v=t.mapping.map(u.before()),y=t.doc.resolve(v);u.node(-1).canReplaceWith(y.index(),y.index()+1,d)&&t.setNodeMarkup(t.mapping.map(u.before()),d)}e&&C3(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return!0},yEe=e=>({tr:t,state:n,dispatch:r,editor:i})=>{var o;const a=Ht(e,n.schema),{$from:u,$to:s}=n.selection,c=n.selection.node;if(c&&c.isBlock||u.depth<2||!u.sameParent(s))return!1;const l=u.node(-1);if(l.type!==a)return!1;const f=i.extensionManager.attributes;if(u.parent.content.size===0&&u.node(-1).childCount===u.indexAfter(-1)){if(u.depth===2||u.node(-3).type!==a||u.index(-2)!==u.node(-2).childCount-1)return!1;if(r){let y=V.empty;const b=u.index(-1)?1:u.index(-2)?2:3;for(let k=u.depth-b;k>=u.depth-3;k-=1)y=V.from(u.node(k).copy(y));const w=u.indexAfter(-1)<u.node(-2).childCount?1:u.indexAfter(-2)<u.node(-3).childCount?2:3,F=Zb(f,u.node().type.name,u.node().attrs),g=((o=a.contentMatch.defaultType)===null||o===void 0?void 0:o.createAndFill(F))||void 0;y=y.append(V.from(a.createAndFill(null,g)||void 0));const I=u.before(u.depth-(b-1));t.replace(I,u.after(-w),new Z(y,4-b,0));let T=-1;t.doc.nodesBetween(I,t.doc.content.size,(k,E)=>{if(T>-1)return!1;k.isTextblock&&k.content.size===0&&(T=E+1)}),T>-1&&t.setSelection(Ae.near(t.doc.resolve(T))),t.scrollIntoView()}return!0}const d=s.pos===u.end()?l.contentMatchAt(0).defaultType:null,p=Zb(f,l.type.name,l.attrs),h=Zb(f,u.node().type.name,u.node().attrs);t.delete(u.pos,s.pos);const v=d?[{type:a,attrs:p},{type:d,attrs:h}]:[{type:a,attrs:p}];return Bb(t.doc,u.pos,2)?(r&&t.split(u.pos,2,v).scrollIntoView(),!0):!1};function bEe(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function qR(e){return t=>bEe(t.$from,e)}function A3(e,t){const{nodeExtensions:n}=Kb(t),r=n.find(a=>a.name===e);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=Ee(ae(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}const k3=(e,t)=>{const n=qR(a=>a.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=e.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&NR(e.doc,n.pos)&&e.join(n.pos),!0},W3=(e,t)=>{const n=qR(a=>a.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=e.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&NR(e.doc,r)&&e.join(r),!0},$Ee=(e,t)=>({editor:n,tr:r,state:i,dispatch:o,chain:a,commands:u,can:s})=>{const{extensions:c}=n.extensionManager,l=Ht(e,i.schema),f=Ht(t,i.schema),{selection:d}=i,{$from:p,$to:h}=d,v=p.blockRange(h);if(!v)return!1;const y=qR(b=>A3(b.type.name,c))(d);if(v.depth>=1&&y&&v.depth-y.depth<=1){if(y.node.type===l)return u.liftListItem(f);if(A3(y.node.type.name,c)&&l.validContent(y.node.content)&&o)return a().command(()=>(r.setNodeMarkup(y.pos,l),!0)).command(()=>k3(r,l)).command(()=>W3(r,l)).run()}return a().command(()=>s().wrapInList(l)?!0:u.clearNodes()).wrapInList(l).command(()=>k3(r,l)).command(()=>W3(r,l)).run()};function KR(e,t,n={}){const{empty:r,ranges:i}=e.selection,o=t?Uu(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(f=>o?o.name===f.type.name:!0).find(f=>Hb(f.attrs,n,{strict:!1}));let a=0;const u=[];if(i.forEach(({$from:f,$to:d})=>{const p=f.pos,h=d.pos;e.doc.nodesBetween(p,h,(v,y)=>{if(!v.isText&&!v.marks.length)return;const b=Math.max(p,y),w=Math.min(h,y+v.nodeSize);a+=w-b,u.push(...v.marks.map(g=>({mark:g,from:b,to:w})))})}),a===0)return!1;const s=u.filter(f=>o?o.name===f.mark.type.name:!0).filter(f=>Hb(f.mark.attrs,n,{strict:!1})).reduce((f,d)=>f+d.to-d.from,0),c=u.filter(f=>o?f.mark.type!==o&&f.mark.type.excludes(o):!0).reduce((f,d)=>f+d.to-d.from,0);return(s>0?s+c:s)>=a}var _Ee=Object.freeze({__proto__:null,blur:R1e,clearContent:M1e,clearNodes:x1e,command:C1e,createParagraphNear:A1e,deleteNode:k1e,deleteRange:W1e,deleteSelection:N1e,enter:P1e,exitCode:F1e,extendMarkRange:L1e,first:j1e,focus:U1e,forEach:B1e,insertContent:z1e,insertContentAt:V1e,joinBackward:H1e,joinForward:J1e,keyboardShortcut:Y1e,lift:Z1e,liftEmptyBlock:X1e,liftListItem:Q1e,newlineInCode:eEe,resetAttributes:tEe,scrollIntoView:nEe,selectAll:rEe,selectNodeBackward:iEe,selectNodeForward:oEe,selectParentNode:aEe,selectTextblockEnd:uEe,selectTextblockStart:sEe,setContent:cEe,setMark:lEe,setMeta:fEe,setNode:dEe,setNodeSelection:pEe,setTextSelection:hEe,sinkListItem:mEe,splitBlock:gEe,splitListItem:yEe,toggleList:$Ee,toggleMark:(e,t={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,a=Uu(e,r.schema);return KR(r,a,t)?i.unsetMark(a,{extendEmptyMarkRange:o}):i.setMark(a,t)},toggleNode:(e,t,n={})=>({state:r,commands:i})=>{const o=Ht(e,r.schema),a=Ht(t,r.schema);return qh(r,o,n)?i.setNode(a):i.setNode(o,n)},toggleWrap:(e,t={})=>({state:n,commands:r})=>{const i=Ht(e,n.schema);return qh(n,i,t)?r.lift(i):r.wrapIn(i,t)},undoInputRule:()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let o;if(i.spec.isInputRules&&(o=i.getState(e))){if(t){const a=e.tr,u=o.transform;for(let s=u.steps.length-1;s>=0;s-=1)a.step(u.steps[s].invert(u.docs[s]));if(o.text){const s=a.doc.resolve(o.from).marks();a.replaceWith(o.from,o.to,e.schema.text(o.text,s))}else a.delete(o.from,o.to)}return!0}}return!1},unsetAllMarks:()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:r,ranges:i}=n;return r||t&&i.forEach(o=>{e.removeMark(o.$from.pos,o.$to.pos)}),!0},unsetMark:(e,t={})=>({tr:n,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:a=!1}=t,{selection:u}=n,s=Uu(e,r.schema),{$from:c,empty:l,ranges:f}=u;if(!i)return!0;if(l&&a){let{from:d,to:p}=u;const h=(o=c.marks().find(y=>y.type===s))===null||o===void 0?void 0:o.attrs,v=zR(c,s,h);v&&(d=v.from,p=v.to),n.removeMark(d,p,s)}else f.forEach(d=>{n.removeMark(d.$from.pos,d.$to.pos,s)});return n.removeStoredMark(s),!0},updateAttributes:(e,t={})=>({tr:n,state:r,dispatch:i})=>{let o=null,a=null;const u=Yb(typeof e=="string"?e:e.name,r.schema);return u?(u==="node"&&(o=Ht(e,r.schema)),u==="mark"&&(a=Uu(e,r.schema)),i&&n.selection.ranges.forEach(s=>{const c=s.$from.pos,l=s.$to.pos;r.doc.nodesBetween(c,l,(f,d)=>{o&&o===f.type&&n.setNodeMarkup(d,void 0,{...f.attrs,...t}),a&&f.marks.length&&f.marks.forEach(p=>{if(a===p.type){const h=Math.max(d,c),v=Math.min(d+f.nodeSize,l);n.addMark(h,v,a.create({...p.attrs,...t}))}})})}),!0):!1},wrapIn:(e,t={})=>({state:n,dispatch:r})=>{const i=Ht(e,n.schema);return u1e(i,t)(n,r)},wrapInList:(e,t={})=>({state:n,dispatch:r})=>{const i=Ht(e,n.schema);return s1e(i,t)(n,r)}});const SEe=Ir.create({name:"commands",addCommands(){return{..._Ee}}}),TEe=Ir.create({name:"editable",addProseMirrorPlugins(){return[new Kr({key:new xu("editable"),props:{editable:()=>this.editor.options.editable}})]}}),IEe=Ir.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new Kr({key:new xu("focusEvents"),props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),OEe=Ir.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first(({commands:a})=>[()=>a.undoInputRule(),()=>a.command(({tr:u})=>{const{selection:s,doc:c}=u,{empty:l,$anchor:f}=s,{pos:d,parent:p}=f,h=Fe.atStart(c).from===d;return!l||!h||!p.type.isTextblock||p.textContent.length?!1:a.clearNodes()}),()=>a.deleteSelection(),()=>a.joinBackward(),()=>a.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:a})=>[()=>a.deleteSelection(),()=>a.joinForward(),()=>a.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:a})=>[()=>a.newlineInCode(),()=>a.createParagraphNear(),()=>a.liftEmptyBlock(),()=>a.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Jb()||E3()?o:i},addProseMirrorPlugins(){return[new Kr({key:new xu("clearDocument"),appendTransaction:(e,t,n)=>{if(!(e.some(h=>h.docChanged)&&!t.doc.eq(n.doc)))return;const{empty:i,from:o,to:a}=t.selection,u=Fe.atStart(t.doc).from,s=Fe.atEnd(t.doc).to,c=o===u&&a===s,l=n.doc.textBetween(0,n.doc.content.size," "," ").length===0;if(i||!c||!l)return;const f=n.tr,d=zb({state:n,transaction:f}),{commands:p}=new qb({editor:this.editor,state:d});if(p.clearNodes(),!!f.steps.length)return f}})]}}),wEe=Ir.create({name:"tabindex",addProseMirrorPlugins(){return[new Kr({key:new xu("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var EEe=Object.freeze({__proto__:null,ClipboardTextSerializer:E1e,Commands:SEe,Editable:TEe,FocusEvents:IEe,Keymap:OEe,Tabindex:wEe});function REe(e,t){const n=Ht(t,e.schema),{from:r,to:i}=e.selection,o=[];e.doc.nodesBetween(r,i,u=>{o.push(u)});const a=o.reverse().find(u=>u.type.name===n.name);return a?{...a.attrs}:{}}function MEe(e,t){const n=Yb(typeof t=="string"?t:t.name,e.schema);return n==="node"?REe(e,t):n==="mark"?x3(e,t):{}}function xEe(e,t){const n=so.fromSchema(t).serializeFragment(e),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}function CEe(e,t){const n={from:0,to:e.content.size};return S3(e,n,t)}function AEe(e,t,n={}){if(!t)return qh(e,null,n)||KR(e,null,n);const r=Yb(t,e.schema);return r==="node"?qh(e,t,n):r==="mark"?KR(e,t,n):!1}function kEe(e){var t;const n=(t=e.type.createAndFill())===null||t===void 0?void 0:t.toJSON(),r=e.toJSON();return JSON.stringify(n)===JSON.stringify(r)}const WEe=`.ProseMirror {
43
+ `,textSerializers:a={}}=n||{};let u="",s=!0;return e.nodesBetween(r,i,(c,l,f,d)=>{var p;const h=a==null?void 0:a[c.type.name];h?(c.isBlock&&!s&&(u+=o,s=!0),f&&(u+=h({node:c,pos:l,parent:f,index:d,range:t}))):c.isText?(u+=(p=c==null?void 0:c.text)===null||p===void 0?void 0:p.slice(Math.max(r,l)-l,i-l),s=!1):c.isBlock&&!s&&(u+=o,s=!0)}),u}function R3(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}const D1e=Ir.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new Kr({key:new Ru("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:o}=i,a=Math.min(...o.map(l=>l.$from.pos)),u=Math.max(...o.map(l=>l.$to.pos)),s=R3(n);return E3(r,{from:a,to:u},{textSerializers:s})}}})]}}),L1e=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),j1e=(e=!1)=>({commands:t})=>t.setContent("",e),U1e=()=>({state:e,tr:t,dispatch:n})=>{const{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:a})=>{e.doc.nodesBetween(o.pos,a.pos,(u,s)=>{if(u.type.isText)return;const{doc:c,mapping:l}=t,f=c.resolve(l.map(s)),d=c.resolve(l.map(s+u.nodeSize)),p=f.blockRange(d);if(!p)return;const h=Qwe(p);if(u.type.isTextblock){const{defaultType:v}=f.parent.contentMatchAt(f.index());t.setNodeMarkup(p.start,v)}(h||h===0)&&t.lift(p,h)})}),!0},B1e=e=>t=>e(t),z1e=()=>({state:e,dispatch:t})=>d1e(e,t),q1e=e=>({tr:t,state:n,dispatch:r})=>{const i=Ht(e,n.schema),o=t.selection.$anchor;for(let a=o.depth;a>0;a-=1)if(o.node(a).type===i){if(r){const s=o.before(a),c=o.after(a);t.delete(s,c).scrollIntoView()}return!0}return!1},K1e=e=>({tr:t,dispatch:n})=>{const{from:r,to:i}=e;return n&&t.delete(r,i),!0},V1e=()=>({state:e,dispatch:t})=>i1e(e,t),H1e=()=>({commands:e})=>e.keyboardShortcut("Enter"),J1e=()=>({state:e,dispatch:t})=>f1e(e,t);function Vb(e,t,n={strict:!0}){const r=Object.keys(t);return r.length?r.every(i=>n.strict?t[i]===e[i]:PR(t[i])?t[i].test(e[i]):t[i]===e[i]):!0}function jR(e,t,n={}){return e.find(r=>r.type===t&&Vb(r.attrs,n))}function G1e(e,t,n={}){return!!jR(e,t,n)}function UR(e,t,n={}){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if(e.parentOffset===r.offset&&r.offset!==0&&(r=e.parent.childBefore(e.parentOffset)),!r.node)return;const i=jR([...r.node.marks],t,n);if(!i)return;let o=r.index,a=e.start()+r.offset,u=o+1,s=a+r.node.nodeSize;for(jR([...r.node.marks],t,n);o>0&&i.isInSet(e.parent.child(o-1).marks);)o-=1,a-=e.parent.child(o).nodeSize;for(;u<e.parent.childCount&&G1e([...e.parent.child(u).marks],t,n);)s+=e.parent.child(u).nodeSize,u+=1;return{from:a,to:s}}function Lu(e,t){if(typeof e=="string"){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}const Y1e=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const o=Lu(e,r.schema),{doc:a,selection:u}=n,{$from:s,from:c,to:l}=u;if(i){const f=UR(s,o,t);if(f&&f.from<=c&&f.to>=l){const d=Ae.create(a,f.from,f.to);n.setSelection(d)}}return!0},Z1e=e=>t=>{const n=typeof e=="function"?e(t):e;for(let r=0;r<n.length;r+=1)if(n[r](t))return!0;return!1};function M3(e){return e instanceof Ae}function Sa(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function x3(e,t=null){if(!t)return null;const n=Fe.atStart(e),r=Fe.atEnd(e);if(t==="start"||t===!0)return n;if(t==="end")return r;const i=n.from,o=r.to;return t==="all"?Ae.create(e,Sa(0,i,o),Sa(e.content.size,i,o)):Ae.create(e,Sa(t,i,o),Sa(t,i,o))}function Hb(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const X1e=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:o})=>{t={scrollIntoView:!0,...t};const a=()=>{Hb()&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t!=null&&t.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&e===null||e===!1)return!0;if(o&&e===null&&!M3(n.state.selection))return a(),!0;const u=x3(i.doc,e)||n.state.selection,s=n.state.selection.eq(u);return o&&(s||i.setSelection(u),s&&i.storedMarks&&i.setStoredMarks(i.storedMarks),a()),!0},Q1e=(e,t)=>n=>e.every((r,i)=>t(r,{...n,index:i})),eEe=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t);function C3(e){const t=`<body>${e}</body>`;return new window.DOMParser().parseFromString(t,"text/html").body}function Jb(e,t,n){if(n={slice:!0,parseOptions:{},...n},typeof e=="object"&&e!==null)try{return Array.isArray(e)?V.fromArray(e.map(r=>t.nodeFromJSON(r))):t.nodeFromJSON(e)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",r),Jb("",t,n)}if(typeof e=="string"){const r=Cf.fromSchema(t);return n.slice?r.parseSlice(C3(e),n.parseOptions).content:r.parse(C3(e),n.parseOptions)}return Jb("",t,n)}function tEe(e,t,n){const r=e.steps.length-1;if(r<t)return;const i=e.steps[r];if(!(i instanceof _a||i instanceof qf))return;const o=e.mapping.maps[r];let a=0;o.forEach((u,s,c,l)=>{a===0&&(a=l)}),e.setSelection(Fe.near(e.doc.resolve(a),n))}const nEe=e=>e.toString().startsWith("<"),rEe=(e,t,n)=>({tr:r,dispatch:i,editor:o})=>{if(i){n={parseOptions:{},updateSelection:!0,...n};const a=Jb(t,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions}});if(a.toString()==="<>")return!0;let{from:u,to:s}=typeof e=="number"?{from:e,to:e}:e,c=!0,l=!0;if((nEe(a)?a:[a]).forEach(d=>{d.check(),c=c?d.isText&&d.marks.length===0:!1,l=l?d.isBlock:!1}),u===s&&l){const{parent:d}=r.doc.resolve(u);d.isTextblock&&!d.type.spec.code&&!d.childCount&&(u-=1,s+=1)}c?r.insertText(t,u,s):r.replaceWith(u,s,a),n.updateSelection&&tEe(r,r.steps.length-1,-1)}return!0},iEe=()=>({state:e,dispatch:t})=>o1e(e,t),oEe=()=>({state:e,dispatch:t})=>u1e(e,t);function A3(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function aEe(e){const t=e.split(/-(?!$)/);let n=t[t.length-1];n==="Space"&&(n=" ");let r,i,o,a;for(let u=0;u<t.length-1;u+=1){const s=t[u];if(/^(cmd|meta|m)$/i.test(s))a=!0;else if(/^a(lt)?$/i.test(s))r=!0;else if(/^(c|ctrl|control)$/i.test(s))i=!0;else if(/^s(hift)?$/i.test(s))o=!0;else if(/^mod$/i.test(s))Hb()||A3()?a=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${s}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),a&&(n=`Meta-${n}`),o&&(n=`Shift-${n}`),n}const uEe=e=>({editor:t,view:n,tr:r,dispatch:i})=>{const o=aEe(e).split(/-(?!$)/),a=o.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),u=new KeyboardEvent("keydown",{key:a==="Space"?" ":a,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),s=t.captureTransaction(()=>{n.someProp("handleKeyDown",c=>c(n,u))});return s==null||s.steps.forEach(c=>{const l=c.map(r.mapping);l&&i&&r.maybeStep(l)}),!0};function Kh(e,t,n={}){const{from:r,to:i,empty:o}=e.selection,a=t?Ht(t,e.schema):null,u=[];e.doc.nodesBetween(r,i,(f,d)=>{if(f.isText)return;const p=Math.max(r,d),h=Math.min(i,d+f.nodeSize);u.push({node:f,from:p,to:h})});const s=i-r,c=u.filter(f=>a?a.name===f.node.type.name:!0).filter(f=>Vb(f.node.attrs,n,{strict:!1}));return o?!!c.length:c.reduce((f,d)=>f+d.to-d.from,0)>=s}const sEe=(e,t={})=>({state:n,dispatch:r})=>{const i=Ht(e,n.schema);return Kh(n,i,t)?c1e(n,r):!1},cEe=()=>({state:e,dispatch:t})=>p1e(e,t),lEe=e=>({state:t,dispatch:n})=>{const r=Ht(e,t.schema);return _1e(r)(t,n)},fEe=()=>({state:e,dispatch:t})=>l1e(e,t);function Gb(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function k3(e,t){const n=typeof t=="string"?[t]:t;return Object.keys(e).reduce((r,i)=>(n.includes(i)||(r[i]=e[i]),r),{})}const dEe=(e,t)=>({tr:n,state:r,dispatch:i})=>{let o=null,a=null;const u=Gb(typeof e=="string"?e:e.name,r.schema);return u?(u==="node"&&(o=Ht(e,r.schema)),u==="mark"&&(a=Lu(e,r.schema)),i&&n.selection.ranges.forEach(s=>{r.doc.nodesBetween(s.$from.pos,s.$to.pos,(c,l)=>{o&&o===c.type&&n.setNodeMarkup(l,void 0,k3(c.attrs,t)),a&&c.marks.length&&c.marks.forEach(f=>{a===f.type&&n.addMark(l,l+c.nodeSize,a.create(k3(f.attrs,t)))})})}),!0):!1},pEe=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),hEe=()=>({tr:e,commands:t})=>t.setTextSelection({from:0,to:e.doc.content.size}),mEe=()=>({state:e,dispatch:t})=>a1e(e,t),vEe=()=>({state:e,dispatch:t})=>s1e(e,t),gEe=()=>({state:e,dispatch:t})=>h1e(e,t),yEe=()=>({state:e,dispatch:t})=>g1e(e,t),bEe=()=>({state:e,dispatch:t})=>v1e(e,t);function W3(e,t,n={}){return Jb(e,t,{slice:!1,parseOptions:n})}const $Ee=(e,t=!1,n={})=>({tr:r,editor:i,dispatch:o})=>{const{doc:a}=r,u=W3(e,i.schema,n);return o&&r.replaceWith(0,a.content.size,u).setMeta("preventUpdate",!t),!0};function N3(e,t){const n=Lu(t,e.schema),{from:r,to:i,empty:o}=e.selection,a=[];o?(e.storedMarks&&a.push(...e.storedMarks),a.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,s=>{a.push(...s.marks)});const u=a.find(s=>s.type.name===n.name);return u?{...u.attrs}:{}}const _Ee=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:a,ranges:u}=o,s=Lu(e,r.schema);if(i)if(a){const c=N3(r,s);n.addStoredMark(s.create({...c,...t}))}else u.forEach(c=>{const l=c.$from.pos,f=c.$to.pos;r.doc.nodesBetween(l,f,(d,p)=>{const h=Math.max(p,l),v=Math.min(p+d.nodeSize,f);d.marks.find(b=>b.type===s)?d.marks.forEach(b=>{s===b.type&&n.addMark(h,v,s.create({...b.attrs,...t}))}):n.addMark(h,v,s.create(t))})});return!0},SEe=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),TEe=(e,t={})=>({state:n,dispatch:r,chain:i})=>{const o=Ht(e,n.schema);return o.isTextblock?i().command(({commands:a})=>$3(o,t)(n)?!0:a.clearNodes()).command(({state:a})=>$3(o,t)(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},IEe=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,i=Sa(e,0,r.content.size),o=ve.create(r,i);t.setSelection(o)}return!0},OEe=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,{from:i,to:o}=typeof e=="number"?{from:e,to:e}:e,a=Ae.atStart(r).from,u=Ae.atEnd(r).to,s=Sa(i,a,u),c=Sa(o,a,u),l=Ae.create(r,s,c);t.setSelection(l)}return!0},wEe=e=>({state:t,dispatch:n})=>{const r=Ht(e,t.schema);return I1e(r)(t,n)};function EEe(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function Yb(e,t,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=e.find(o=>o.type===t&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function P3(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter(i=>t==null?void 0:t.includes(i.type.name));e.tr.ensureMarks(r)}}const REe=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{const{selection:o,doc:a}=t,{$from:u,$to:s}=o,c=i.extensionManager.attributes,l=Yb(c,u.node().type.name,u.node().attrs);if(o instanceof ve&&o.node.isBlock)return!u.parentOffset||!Ub(a,u.pos)?!1:(r&&(e&&P3(n,i.extensionManager.splittableMarks),t.split(u.pos).scrollIntoView()),!0);if(!u.parent.isBlock)return!1;if(r){const f=s.parentOffset===s.parent.content.size;o instanceof Ae&&t.deleteSelection();const d=u.depth===0?void 0:EEe(u.node(-1).contentMatchAt(u.indexAfter(-1)));let p=f&&d?[{type:d,attrs:l}]:void 0,h=Ub(t.doc,t.mapping.map(u.pos),1,p);if(!p&&!h&&Ub(t.doc,t.mapping.map(u.pos),1,d?[{type:d}]:void 0)&&(h=!0,p=d?[{type:d,attrs:l}]:void 0),h&&(t.split(t.mapping.map(u.pos),1,p),d&&!f&&!u.parentOffset&&u.parent.type!==d)){const v=t.mapping.map(u.before()),y=t.doc.resolve(v);u.node(-1).canReplaceWith(y.index(),y.index()+1,d)&&t.setNodeMarkup(t.mapping.map(u.before()),d)}e&&P3(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return!0},MEe=e=>({tr:t,state:n,dispatch:r,editor:i})=>{var o;const a=Ht(e,n.schema),{$from:u,$to:s}=n.selection,c=n.selection.node;if(c&&c.isBlock||u.depth<2||!u.sameParent(s))return!1;const l=u.node(-1);if(l.type!==a)return!1;const f=i.extensionManager.attributes;if(u.parent.content.size===0&&u.node(-1).childCount===u.indexAfter(-1)){if(u.depth===2||u.node(-3).type!==a||u.index(-2)!==u.node(-2).childCount-1)return!1;if(r){let y=V.empty;const b=u.index(-1)?1:u.index(-2)?2:3;for(let k=u.depth-b;k>=u.depth-3;k-=1)y=V.from(u.node(k).copy(y));const w=u.indexAfter(-1)<u.node(-2).childCount?1:u.indexAfter(-2)<u.node(-3).childCount?2:3,F=Yb(f,u.node().type.name,u.node().attrs),g=((o=a.contentMatch.defaultType)===null||o===void 0?void 0:o.createAndFill(F))||void 0;y=y.append(V.from(a.createAndFill(null,g)||void 0));const I=u.before(u.depth-(b-1));t.replace(I,u.after(-w),new X(y,4-b,0));let T=-1;t.doc.nodesBetween(I,t.doc.content.size,(k,E)=>{if(T>-1)return!1;k.isTextblock&&k.content.size===0&&(T=E+1)}),T>-1&&t.setSelection(Ae.near(t.doc.resolve(T))),t.scrollIntoView()}return!0}const d=s.pos===u.end()?l.contentMatchAt(0).defaultType:null,p=Yb(f,l.type.name,l.attrs),h=Yb(f,u.node().type.name,u.node().attrs);t.delete(u.pos,s.pos);const v=d?[{type:a,attrs:p},{type:d,attrs:h}]:[{type:a,attrs:p}];return Ub(t.doc,u.pos,2)?(r&&t.split(u.pos,2,v).scrollIntoView(),!0):!1};function xEe(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function BR(e){return t=>xEe(t.$from,e)}function F3(e,t){const{nodeExtensions:n}=qb(t),r=n.find(a=>a.name===e);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=Ee(ue(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}const D3=(e,t)=>{const n=BR(a=>a.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=e.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&kR(e.doc,n.pos)&&e.join(n.pos),!0},L3=(e,t)=>{const n=BR(a=>a.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=e.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&kR(e.doc,r)&&e.join(r),!0},CEe=(e,t)=>({editor:n,tr:r,state:i,dispatch:o,chain:a,commands:u,can:s})=>{const{extensions:c}=n.extensionManager,l=Ht(e,i.schema),f=Ht(t,i.schema),{selection:d}=i,{$from:p,$to:h}=d,v=p.blockRange(h);if(!v)return!1;const y=BR(b=>F3(b.type.name,c))(d);if(v.depth>=1&&y&&v.depth-y.depth<=1){if(y.node.type===l)return u.liftListItem(f);if(F3(y.node.type.name,c)&&l.validContent(y.node.content)&&o)return a().command(()=>(r.setNodeMarkup(y.pos,l),!0)).command(()=>D3(r,l)).command(()=>L3(r,l)).run()}return a().command(()=>s().wrapInList(l)?!0:u.clearNodes()).wrapInList(l).command(()=>D3(r,l)).command(()=>L3(r,l)).run()};function zR(e,t,n={}){const{empty:r,ranges:i}=e.selection,o=t?Lu(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(f=>o?o.name===f.type.name:!0).find(f=>Vb(f.attrs,n,{strict:!1}));let a=0;const u=[];if(i.forEach(({$from:f,$to:d})=>{const p=f.pos,h=d.pos;e.doc.nodesBetween(p,h,(v,y)=>{if(!v.isText&&!v.marks.length)return;const b=Math.max(p,y),w=Math.min(h,y+v.nodeSize);a+=w-b,u.push(...v.marks.map(g=>({mark:g,from:b,to:w})))})}),a===0)return!1;const s=u.filter(f=>o?o.name===f.mark.type.name:!0).filter(f=>Vb(f.mark.attrs,n,{strict:!1})).reduce((f,d)=>f+d.to-d.from,0),c=u.filter(f=>o?f.mark.type!==o&&f.mark.type.excludes(o):!0).reduce((f,d)=>f+d.to-d.from,0);return(s>0?s+c:s)>=a}var AEe=Object.freeze({__proto__:null,blur:L1e,clearContent:j1e,clearNodes:U1e,command:B1e,createParagraphNear:z1e,deleteNode:q1e,deleteRange:K1e,deleteSelection:V1e,enter:H1e,exitCode:J1e,extendMarkRange:Y1e,first:Z1e,focus:X1e,forEach:Q1e,insertContent:eEe,insertContentAt:rEe,joinBackward:iEe,joinForward:oEe,keyboardShortcut:uEe,lift:sEe,liftEmptyBlock:cEe,liftListItem:lEe,newlineInCode:fEe,resetAttributes:dEe,scrollIntoView:pEe,selectAll:hEe,selectNodeBackward:mEe,selectNodeForward:vEe,selectParentNode:gEe,selectTextblockEnd:yEe,selectTextblockStart:bEe,setContent:$Ee,setMark:_Ee,setMeta:SEe,setNode:TEe,setNodeSelection:IEe,setTextSelection:OEe,sinkListItem:wEe,splitBlock:REe,splitListItem:MEe,toggleList:CEe,toggleMark:(e,t={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,a=Lu(e,r.schema);return zR(r,a,t)?i.unsetMark(a,{extendEmptyMarkRange:o}):i.setMark(a,t)},toggleNode:(e,t,n={})=>({state:r,commands:i})=>{const o=Ht(e,r.schema),a=Ht(t,r.schema);return Kh(r,o,n)?i.setNode(a):i.setNode(o,n)},toggleWrap:(e,t={})=>({state:n,commands:r})=>{const i=Ht(e,n.schema);return Kh(n,i,t)?r.lift(i):r.wrapIn(i,t)},undoInputRule:()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let o;if(i.spec.isInputRules&&(o=i.getState(e))){if(t){const a=e.tr,u=o.transform;for(let s=u.steps.length-1;s>=0;s-=1)a.step(u.steps[s].invert(u.docs[s]));if(o.text){const s=a.doc.resolve(o.from).marks();a.replaceWith(o.from,o.to,e.schema.text(o.text,s))}else a.delete(o.from,o.to)}return!0}}return!1},unsetAllMarks:()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:r,ranges:i}=n;return r||t&&i.forEach(o=>{e.removeMark(o.$from.pos,o.$to.pos)}),!0},unsetMark:(e,t={})=>({tr:n,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:a=!1}=t,{selection:u}=n,s=Lu(e,r.schema),{$from:c,empty:l,ranges:f}=u;if(!i)return!0;if(l&&a){let{from:d,to:p}=u;const h=(o=c.marks().find(y=>y.type===s))===null||o===void 0?void 0:o.attrs,v=UR(c,s,h);v&&(d=v.from,p=v.to),n.removeMark(d,p,s)}else f.forEach(d=>{n.removeMark(d.$from.pos,d.$to.pos,s)});return n.removeStoredMark(s),!0},updateAttributes:(e,t={})=>({tr:n,state:r,dispatch:i})=>{let o=null,a=null;const u=Gb(typeof e=="string"?e:e.name,r.schema);return u?(u==="node"&&(o=Ht(e,r.schema)),u==="mark"&&(a=Lu(e,r.schema)),i&&n.selection.ranges.forEach(s=>{const c=s.$from.pos,l=s.$to.pos;r.doc.nodesBetween(c,l,(f,d)=>{o&&o===f.type&&n.setNodeMarkup(d,void 0,{...f.attrs,...t}),a&&f.marks.length&&f.marks.forEach(p=>{if(a===p.type){const h=Math.max(d,c),v=Math.min(d+f.nodeSize,l);n.addMark(h,v,a.create({...p.attrs,...t}))}})})}),!0):!1},wrapIn:(e,t={})=>({state:n,dispatch:r})=>{const i=Ht(e,n.schema);return y1e(i,t)(n,r)},wrapInList:(e,t={})=>({state:n,dispatch:r})=>{const i=Ht(e,n.schema);return b1e(i,t)(n,r)}});const kEe=Ir.create({name:"commands",addCommands(){return{...AEe}}}),WEe=Ir.create({name:"editable",addProseMirrorPlugins(){return[new Kr({key:new Ru("editable"),props:{editable:()=>this.editor.options.editable}})]}}),NEe=Ir.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new Kr({key:new Ru("focusEvents"),props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),PEe=Ir.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first(({commands:a})=>[()=>a.undoInputRule(),()=>a.command(({tr:u})=>{const{selection:s,doc:c}=u,{empty:l,$anchor:f}=s,{pos:d,parent:p}=f,h=Fe.atStart(c).from===d;return!l||!h||!p.type.isTextblock||p.textContent.length?!1:a.clearNodes()}),()=>a.deleteSelection(),()=>a.joinBackward(),()=>a.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:a})=>[()=>a.deleteSelection(),()=>a.joinForward(),()=>a.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:a})=>[()=>a.newlineInCode(),()=>a.createParagraphNear(),()=>a.liftEmptyBlock(),()=>a.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Hb()||A3()?o:i},addProseMirrorPlugins(){return[new Kr({key:new Ru("clearDocument"),appendTransaction:(e,t,n)=>{if(!(e.some(h=>h.docChanged)&&!t.doc.eq(n.doc)))return;const{empty:i,from:o,to:a}=t.selection,u=Fe.atStart(t.doc).from,s=Fe.atEnd(t.doc).to,c=o===u&&a===s,l=n.doc.textBetween(0,n.doc.content.size," "," ").length===0;if(i||!c||!l)return;const f=n.tr,d=Bb({state:n,transaction:f}),{commands:p}=new zb({editor:this.editor,state:d});if(p.clearNodes(),!!f.steps.length)return f}})]}}),FEe=Ir.create({name:"tabindex",addProseMirrorPlugins(){return[new Kr({key:new Ru("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var DEe=Object.freeze({__proto__:null,ClipboardTextSerializer:D1e,Commands:kEe,Editable:WEe,FocusEvents:NEe,Keymap:PEe,Tabindex:FEe});function LEe(e,t){const n=Ht(t,e.schema),{from:r,to:i}=e.selection,o=[];e.doc.nodesBetween(r,i,u=>{o.push(u)});const a=o.reverse().find(u=>u.type.name===n.name);return a?{...a.attrs}:{}}function jEe(e,t){const n=Gb(typeof t=="string"?t:t.name,e.schema);return n==="node"?LEe(e,t):n==="mark"?N3(e,t):{}}function UEe(e,t){const n=uo.fromSchema(t).serializeFragment(e),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}function BEe(e,t){const n={from:0,to:e.content.size};return E3(e,n,t)}function zEe(e,t,n={}){if(!t)return Kh(e,null,n)||zR(e,null,n);const r=Gb(t,e.schema);return r==="node"?Kh(e,t,n):r==="mark"?zR(e,t,n):!1}function qEe(e){var t;const n=(t=e.type.createAndFill())===null||t===void 0?void 0:t.toJSON(),r=e.toJSON();return JSON.stringify(n)===JSON.stringify(r)}const KEe=`.ProseMirror {
44
44
  position: relative;
45
45
  }
46
46
 
@@ -114,35 +114,35 @@ img.ProseMirror-separator {
114
114
 
115
115
  .tippy-box[data-animation=fade][data-state=hidden] {
116
116
  opacity: 0
117
- }`;function NEe(e,t){const n=document.querySelector("style[data-tiptap-style]");if(n!==null)return n;const r=document.createElement("style");return t&&r.setAttribute("nonce",t),r.setAttribute("data-tiptap-style",""),r.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(r),r}class PEe extends h1e{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=NEe(WEe,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){this.setOptions({editable:t}),this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(t,n){const r=g3(n)?n(t,[...this.state.plugins]):[...this.state.plugins,t],i=this.state.reconfigure({plugins:r});this.view.updateState(i)}unregisterPlugin(t){if(this.isDestroyed)return;const n=typeof t=="string"?`${t}$`:t.key,r=this.state.reconfigure({plugins:this.state.plugins.filter(i=>!i.key.startsWith(n))});this.view.updateState(r)}createExtensionManager(){const n=[...this.options.enableCoreExtensions?Object.values(EEe):[],...this.options.extensions].filter(r=>["extension","node","mark"].includes(r==null?void 0:r.type));this.extensionManager=new wc(n,this)}createCommandManager(){this.commandManager=new qb({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){const t=M3(this.options.content,this.schema,this.options.parseOptions),n=O3(t,this.options.autofocus);this.view=new Ewe(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:Df.create({doc:t,selection:n||void 0})});const r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),this.createNodeViews();const i=this.view.dom;i.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(t){if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(a=>{var u;return(u=this.capturedTransaction)===null||u===void 0?void 0:u.step(a)});return}const n=this.state.apply(t),r=!this.state.selection.eq(n.selection);this.view.updateState(n),this.emit("transaction",{editor:this,transaction:t}),r&&this.emit("selectionUpdate",{editor:this,transaction:t});const i=t.getMeta("focus"),o=t.getMeta("blur");i&&this.emit("focus",{editor:this,event:i.event,transaction:t}),o&&this.emit("blur",{editor:this,event:o.event,transaction:t}),!(!t.docChanged||t.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:t})}getAttributes(t){return MEe(this.state,t)}isActive(t,n){const r=typeof t=="string"?t:null,i=typeof t=="string"?n:t;return AEe(this.state,r,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return xEe(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:n=`
117
+ }`;function VEe(e,t){const n=document.querySelector("style[data-tiptap-style]");if(n!==null)return n;const r=document.createElement("style");return t&&r.setAttribute("nonce",t),r.setAttribute("data-tiptap-style",""),r.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(r),r}class HEe extends O1e{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=VEe(KEe,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){this.setOptions({editable:t}),this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(t,n){const r=S3(n)?n(t,[...this.state.plugins]):[...this.state.plugins,t],i=this.state.reconfigure({plugins:r});this.view.updateState(i)}unregisterPlugin(t){if(this.isDestroyed)return;const n=typeof t=="string"?`${t}$`:t.key,r=this.state.reconfigure({plugins:this.state.plugins.filter(i=>!i.key.startsWith(n))});this.view.updateState(r)}createExtensionManager(){const n=[...this.options.enableCoreExtensions?Object.values(DEe):[],...this.options.extensions].filter(r=>["extension","node","mark"].includes(r==null?void 0:r.type));this.extensionManager=new Oc(n,this)}createCommandManager(){this.commandManager=new zb({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){const t=W3(this.options.content,this.schema,this.options.parseOptions),n=x3(t,this.options.autofocus);this.view=new Dwe(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:Pf.create({doc:t,selection:n||void 0})});const r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),this.createNodeViews();const i=this.view.dom;i.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(t){if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(a=>{var u;return(u=this.capturedTransaction)===null||u===void 0?void 0:u.step(a)});return}const n=this.state.apply(t),r=!this.state.selection.eq(n.selection);this.view.updateState(n),this.emit("transaction",{editor:this,transaction:t}),r&&this.emit("selectionUpdate",{editor:this,transaction:t});const i=t.getMeta("focus"),o=t.getMeta("blur");i&&this.emit("focus",{editor:this,event:i.event,transaction:t}),o&&this.emit("blur",{editor:this,event:o.event,transaction:t}),!(!t.docChanged||t.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:t})}getAttributes(t){return jEe(this.state,t)}isActive(t,n){const r=typeof t=="string"?t:null,i=typeof t=="string"?n:t;return zEe(this.state,r,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return UEe(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:n=`
118
118
 
119
- `,textSerializers:r={}}=t||{};return CEe(this.state.doc,{blockSeparator:n,textSerializers:{...r,...T3(this.schema)}})}get isEmpty(){return kEe(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var t;return!(!((t=this.view)===null||t===void 0)&&t.docView)}}function FEe(e){const t=wc.resolve(e);return $3(t)}function N3(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach(i=>{const o=n.resolve(e-1),a=zR(o,i.type);!a||r.push({mark:i,...a})}):n.nodesBetween(e,t,(i,o)=>{r.push(...i.marks.map(a=>({from:o,to:o+i.nodeSize,mark:a})))}),r}function DEe(e){return e instanceof ve}function LEe(e,t,n){const i=e.state.doc.content.size,o=Ta(t,0,i),a=Ta(n,0,i),u=e.coordsAtPos(o),s=e.coordsAtPos(a,-1),c=Math.min(u.top,s.top),l=Math.max(u.bottom,s.bottom),f=Math.min(u.left,s.left),d=Math.max(u.right,s.right),p=d-f,h=l-c,b={top:c,bottom:l,left:f,right:d,width:p,height:h,x:f,y:c};return{...b,toJSON:()=>b}}function Xb(e){return new LR({find:e.find,handler:({state:t,range:n,match:r})=>{const i=Ee(e.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=t,a=r[r.length-1],u=r[0];let s=n.to;if(a){const c=u.search(/\S/),l=n.from+u.indexOf(a),f=l+a.length;if(N3(n.from,n.to,t.doc).filter(p=>p.mark.type.excluded.find(v=>v===e.type&&v!==p.mark.type)).filter(p=>p.to>l).length)return null;f<n.to&&o.delete(f,n.to),l>n.from&&o.delete(n.from+c,l),s=n.from+c+a.length,o.addMark(n.from+c,s,e.type.create(i||{})),o.removeStoredMark(e.type)}}})}function VR(e){return new LR({find:e.find,handler:({state:t,range:n,match:r})=>{const i=t.doc.resolve(n.from),o=Ee(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,o)}})}function P3(e){return new LR({find:e.find,handler:({state:t,range:n,match:r})=>{const i=Ee(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),u=o.doc.resolve(n.from).blockRange(),s=u&&zwe(u,e.type,i);if(!s)return null;o.wrap(u,s);const c=o.doc.resolve(n.from-1).nodeBefore;c&&c.type===e.type&&NR(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,c))&&o.join(n.from-1)}})}class Jf{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=Ee(ae(this,"addOptions",{name:this.name}))),this.storage=Ee(ae(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new Jf(t)}configure(t={}){const n=this.extend();return n.options=Vb(this.options,t),n.storage=Ee(ae(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){const n=new Jf(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=Ee(ae(n,"addOptions",{name:n.name})),n.storage=Ee(ae(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:t,mark:n}){const{tr:r}=t.state,i=t.state.selection.$from;if(i.pos===i.end()){const a=i.marks();if(!!!a.find(c=>(c==null?void 0:c.type.name)===n.name))return!1;const s=a.find(c=>(c==null?void 0:c.type.name)===n.name);return s&&r.removeStoredMark(s),r.insertText(" ",i.pos),t.view.dispatch(r),!0}return!1}}class Or{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=Ee(ae(this,"addOptions",{name:this.name}))),this.storage=Ee(ae(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new Or(t)}configure(t={}){const n=this.extend();return n.options=Vb(this.options,t),n.storage=Ee(ae(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){const n=new Or(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=Ee(ae(n,"addOptions",{name:n.name})),n.storage=Ee(ae(n,"addStorage",{name:n.name,options:n.options})),n}}class jEe{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;const{view:c}=this.editor,l=t.target,f=l.nodeType===3?(n=l.parentElement)===null||n===void 0?void 0:n.closest("[data-drag-handle]"):l.closest("[data-drag-handle]");if(!this.dom||((r=this.contentDOM)===null||r===void 0?void 0:r.contains(l))||!f)return;let d=0,p=0;if(this.dom!==f){const y=this.dom.getBoundingClientRect(),b=f.getBoundingClientRect(),w=(i=t.offsetX)!==null&&i!==void 0?i:(o=t.nativeEvent)===null||o===void 0?void 0:o.offsetX,F=(a=t.offsetY)!==null&&a!==void 0?a:(u=t.nativeEvent)===null||u===void 0?void 0:u.offsetY;d=b.x-y.x+w,p=b.y-y.y+F}(s=t.dataTransfer)===null||s===void 0||s.setDragImage(this.dom,d,p);const h=ve.create(c.state.doc,this.getPos()),v=c.state.tr.setSelection(h);c.dispatch(v)}stopEvent(t){var n;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:t});const r=t.target;if(!(this.dom.contains(r)&&!(!((n=this.contentDOM)===null||n===void 0)&&n.contains(r))))return!1;const o=t.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(r.tagName)||r.isContentEditable)&&!o)return!0;const{isEditable:u}=this.editor,{isDragging:s}=this,c=!!this.node.type.spec.draggable,l=ve.isSelectable(this.node),f=t.type==="copy",d=t.type==="paste",p=t.type==="cut",h=t.type==="mousedown",v=t.type.startsWith("drag");if(!c&&l&&v&&t.preventDefault(),c&&v&&!s)return t.preventDefault(),!1;if(c&&u&&!s&&h){const y=r.closest("[data-drag-handle]");y&&(this.dom===y||this.dom.contains(y))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(s||o||f||d||p||h&&l)}ignoreMutation(t){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:t}):this.node.isLeaf||this.node.isAtom?!0:t.type==="selection"||this.dom.contains(t.target)&&t.type==="childList"&&Jb()&&this.editor.isFocused&&[...Array.from(t.addedNodes),...Array.from(t.removedNodes)].every(r=>r.isContentEditable)?!1:this.contentDOM===t.target&&t.type==="attributes"?!0:!this.contentDOM.contains(t.target)}updateAttributes(t){this.editor.commands.command(({tr:n})=>{const r=this.getPos();return n.setNodeMarkup(r,void 0,{...this.node.attrs,...t}),!0})}deleteNode(){const t=this.getPos(),n=t+this.node.nodeSize;this.editor.commands.deleteRange({from:t,to:n})}}function Qb(e){return new _1e({find:e.find,handler:({state:t,range:n,match:r})=>{const i=Ee(e.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=t,a=r[r.length-1],u=r[0];let s=n.to;if(a){const c=u.search(/\S/),l=n.from+u.indexOf(a),f=l+a.length;if(N3(n.from,n.to,t.doc).filter(p=>p.mark.type.excluded.find(v=>v===e.type&&v!==p.mark.type)).filter(p=>p.to>l).length)return null;f<n.to&&o.delete(f,n.to),l>n.from&&o.delete(n.from+c,l),s=n.from+c+a.length,o.addMark(n.from+c,s,e.type.create(i||{})),o.removeStoredMark(e.type)}}})}function UEe(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}var nr="top",Hr="bottom",Jr="right",rr="left",e$="auto",Kh=[nr,Hr,Jr,rr],Gf="start",Vh="end",BEe="clippingParents",F3="viewport",Hh="popper",zEe="reference",D3=Kh.reduce(function(e,t){return e.concat([t+"-"+Gf,t+"-"+Vh])},[]),L3=[].concat(Kh,[e$]).reduce(function(e,t){return e.concat([t,t+"-"+Gf,t+"-"+Vh])},[]),qEe="beforeRead",KEe="read",VEe="afterRead",HEe="beforeMain",JEe="main",GEe="afterMain",YEe="beforeWrite",ZEe="write",XEe="afterWrite",HR=[qEe,KEe,VEe,HEe,JEe,GEe,YEe,ZEe,XEe];function mo(e){return e?(e.nodeName||"").toLowerCase():null}function Gr(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Ec(e){var t=Gr(e).Element;return e instanceof t||e instanceof Element}function wr(e){var t=Gr(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function JR(e){if(typeof ShadowRoot>"u")return!1;var t=Gr(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function QEe(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},o=t.elements[n];!wr(o)||!mo(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(a){var u=i[a];u===!1?o.removeAttribute(a):o.setAttribute(a,u===!0?"":u)}))})}function eRe(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var i=t.elements[r],o=t.attributes[r]||{},a=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),u=a.reduce(function(s,c){return s[c]="",s},{});!wr(i)||!mo(i)||(Object.assign(i.style,u),Object.keys(o).forEach(function(s){i.removeAttribute(s)}))})}}const j3={name:"applyStyles",enabled:!0,phase:"write",fn:QEe,effect:eRe,requires:["computeStyles"]};function xi(e){return e.split("-")[0]}var Rc=Math.max,t$=Math.min,Yf=Math.round;function GR(){var e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function U3(){return!/^((?!chrome|android).)*safari/i.test(GR())}function Zf(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&wr(e)&&(i=e.offsetWidth>0&&Yf(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&Yf(r.height)/e.offsetHeight||1);var a=Ec(e)?Gr(e):window,u=a.visualViewport,s=!U3()&&n,c=(r.left+(s&&u?u.offsetLeft:0))/i,l=(r.top+(s&&u?u.offsetTop:0))/o,f=r.width/i,d=r.height/o;return{width:f,height:d,top:l,right:c+f,bottom:l+d,left:c,x:c,y:l}}function YR(e){var t=Zf(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function B3(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&JR(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Ci(e){return Gr(e).getComputedStyle(e)}function tRe(e){return["table","td","th"].indexOf(mo(e))>=0}function Bu(e){return((Ec(e)?e.ownerDocument:e.document)||window.document).documentElement}function n$(e){return mo(e)==="html"?e:e.assignedSlot||e.parentNode||(JR(e)?e.host:null)||Bu(e)}function z3(e){return!wr(e)||Ci(e).position==="fixed"?null:e.offsetParent}function nRe(e){var t=/firefox/i.test(GR()),n=/Trident/i.test(GR());if(n&&wr(e)){var r=Ci(e);if(r.position==="fixed")return null}var i=n$(e);for(JR(i)&&(i=i.host);wr(i)&&["html","body"].indexOf(mo(i))<0;){var o=Ci(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function Jh(e){for(var t=Gr(e),n=z3(e);n&&tRe(n)&&Ci(n).position==="static";)n=z3(n);return n&&(mo(n)==="html"||mo(n)==="body"&&Ci(n).position==="static")?t:n||nRe(e)||t}function ZR(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Gh(e,t,n){return Rc(e,t$(t,n))}function rRe(e,t,n){var r=Gh(e,t,n);return r>n?n:r}function q3(){return{top:0,right:0,bottom:0,left:0}}function K3(e){return Object.assign({},q3(),e)}function V3(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var iRe=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,K3(typeof t!="number"?t:V3(t,Kh))};function oRe(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,u=xi(n.placement),s=ZR(u),c=[rr,Jr].indexOf(u)>=0,l=c?"height":"width";if(!(!o||!a)){var f=iRe(i.padding,n),d=YR(o),p=s==="y"?nr:rr,h=s==="y"?Hr:Jr,v=n.rects.reference[l]+n.rects.reference[s]-a[s]-n.rects.popper[l],y=a[s]-n.rects.reference[s],b=Jh(o),w=b?s==="y"?b.clientHeight||0:b.clientWidth||0:0,F=v/2-y/2,g=f[p],I=w-d[l]-f[h],T=w/2-d[l]/2+F,k=Gh(g,T,I),E=s;n.modifiersData[r]=(t={},t[E]=k,t.centerOffset=k-T,t)}}function aRe(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;if(i!=null&&!(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i))){if(process.env.NODE_ENV!=="production"&&(wr(i)||console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).',"To use an SVG arrow, wrap it in an HTMLElement that will be used as","the arrow."].join(" "))),!B3(t.elements.popper,i)){process.env.NODE_ENV!=="production"&&console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper',"element."].join(" "));return}t.elements.arrow=i}}const uRe={name:"arrow",enabled:!0,phase:"main",fn:oRe,effect:aRe,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Xf(e){return e.split("-")[1]}var sRe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function cRe(e){var t=e.x,n=e.y,r=window,i=r.devicePixelRatio||1;return{x:Yf(t*i)/i||0,y:Yf(n*i)/i||0}}function H3(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,a=e.offsets,u=e.position,s=e.gpuAcceleration,c=e.adaptive,l=e.roundOffsets,f=e.isFixed,d=a.x,p=d===void 0?0:d,h=a.y,v=h===void 0?0:h,y=typeof l=="function"?l({x:p,y:v}):{x:p,y:v};p=y.x,v=y.y;var b=a.hasOwnProperty("x"),w=a.hasOwnProperty("y"),F=rr,g=nr,I=window;if(c){var T=Jh(n),k="clientHeight",E="clientWidth";if(T===Gr(n)&&(T=Bu(n),Ci(T).position!=="static"&&u==="absolute"&&(k="scrollHeight",E="scrollWidth")),T=T,i===nr||(i===rr||i===Jr)&&o===Vh){g=Hr;var Y=f&&T===I&&I.visualViewport?I.visualViewport.height:T[k];v-=Y-r.height,v*=s?1:-1}if(i===rr||(i===nr||i===Hr)&&o===Vh){F=Jr;var K=f&&T===I&&I.visualViewport?I.visualViewport.width:T[E];p-=K-r.width,p*=s?1:-1}}var x=Object.assign({position:u},c&&sRe),X=l===!0?cRe({x:p,y:v}):{x:p,y:v};if(p=X.x,v=X.y,s){var O;return Object.assign({},x,(O={},O[g]=w?"0":"",O[F]=b?"0":"",O.transform=(I.devicePixelRatio||1)<=1?"translate("+p+"px, "+v+"px)":"translate3d("+p+"px, "+v+"px, 0)",O))}return Object.assign({},x,(t={},t[g]=w?v+"px":"",t[F]=b?p+"px":"",t.transform="",t))}function lRe(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,a=o===void 0?!0:o,u=n.roundOffsets,s=u===void 0?!0:u;if(process.env.NODE_ENV!=="production"){var c=Ci(t.elements.popper).transitionProperty||"";a&&["transform","top","right","bottom","left"].some(function(f){return c.indexOf(f)>=0})&&console.warn(["Popper: Detected CSS transitions on at least one of the following",'CSS properties: "transform", "top", "right", "bottom", "left".',`
119
+ `,textSerializers:r={}}=t||{};return BEe(this.state.doc,{blockSeparator:n,textSerializers:{...r,...R3(this.schema)}})}get isEmpty(){return qEe(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var t;return!(!((t=this.view)===null||t===void 0)&&t.docView)}}function JEe(e){const t=Oc.resolve(e);return O3(t)}function j3(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach(i=>{const o=n.resolve(e-1),a=UR(o,i.type);!a||r.push({mark:i,...a})}):n.nodesBetween(e,t,(i,o)=>{r.push(...i.marks.map(a=>({from:o,to:o+i.nodeSize,mark:a})))}),r}function GEe(e){return e instanceof ve}function YEe(e,t,n){const i=e.state.doc.content.size,o=Sa(t,0,i),a=Sa(n,0,i),u=e.coordsAtPos(o),s=e.coordsAtPos(a,-1),c=Math.min(u.top,s.top),l=Math.max(u.bottom,s.bottom),f=Math.min(u.left,s.left),d=Math.max(u.right,s.right),p=d-f,h=l-c,b={top:c,bottom:l,left:f,right:d,width:p,height:h,x:f,y:c};return{...b,toJSON:()=>b}}function Zb(e){return new FR({find:e.find,handler:({state:t,range:n,match:r})=>{const i=Ee(e.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=t,a=r[r.length-1],u=r[0];let s=n.to;if(a){const c=u.search(/\S/),l=n.from+u.indexOf(a),f=l+a.length;if(j3(n.from,n.to,t.doc).filter(p=>p.mark.type.excluded.find(v=>v===e.type&&v!==p.mark.type)).filter(p=>p.to>l).length)return null;f<n.to&&o.delete(f,n.to),l>n.from&&o.delete(n.from+c,l),s=n.from+c+a.length,o.addMark(n.from+c,s,e.type.create(i||{})),o.removeStoredMark(e.type)}}})}function qR(e){return new FR({find:e.find,handler:({state:t,range:n,match:r})=>{const i=t.doc.resolve(n.from),o=Ee(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,o)}})}function U3(e){return new FR({find:e.find,handler:({state:t,range:n,match:r})=>{const i=Ee(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),u=o.doc.resolve(n.from).blockRange(),s=u&&e1e(u,e.type,i);if(!s)return null;o.wrap(u,s);const c=o.doc.resolve(n.from-1).nodeBefore;c&&c.type===e.type&&kR(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,c))&&o.join(n.from-1)}})}class Vf{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=Ee(ue(this,"addOptions",{name:this.name}))),this.storage=Ee(ue(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new Vf(t)}configure(t={}){const n=this.extend();return n.options=Kb(this.options,t),n.storage=Ee(ue(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){const n=new Vf(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=Ee(ue(n,"addOptions",{name:n.name})),n.storage=Ee(ue(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:t,mark:n}){const{tr:r}=t.state,i=t.state.selection.$from;if(i.pos===i.end()){const a=i.marks();if(!!!a.find(c=>(c==null?void 0:c.type.name)===n.name))return!1;const s=a.find(c=>(c==null?void 0:c.type.name)===n.name);return s&&r.removeStoredMark(s),r.insertText(" ",i.pos),t.view.dispatch(r),!0}return!1}}class Or{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=Ee(ue(this,"addOptions",{name:this.name}))),this.storage=Ee(ue(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new Or(t)}configure(t={}){const n=this.extend();return n.options=Kb(this.options,t),n.storage=Ee(ue(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){const n=new Or(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=Ee(ue(n,"addOptions",{name:n.name})),n.storage=Ee(ue(n,"addStorage",{name:n.name,options:n.options})),n}}class ZEe{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;const{view:c}=this.editor,l=t.target,f=l.nodeType===3?(n=l.parentElement)===null||n===void 0?void 0:n.closest("[data-drag-handle]"):l.closest("[data-drag-handle]");if(!this.dom||((r=this.contentDOM)===null||r===void 0?void 0:r.contains(l))||!f)return;let d=0,p=0;if(this.dom!==f){const y=this.dom.getBoundingClientRect(),b=f.getBoundingClientRect(),w=(i=t.offsetX)!==null&&i!==void 0?i:(o=t.nativeEvent)===null||o===void 0?void 0:o.offsetX,F=(a=t.offsetY)!==null&&a!==void 0?a:(u=t.nativeEvent)===null||u===void 0?void 0:u.offsetY;d=b.x-y.x+w,p=b.y-y.y+F}(s=t.dataTransfer)===null||s===void 0||s.setDragImage(this.dom,d,p);const h=ve.create(c.state.doc,this.getPos()),v=c.state.tr.setSelection(h);c.dispatch(v)}stopEvent(t){var n;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:t});const r=t.target;if(!(this.dom.contains(r)&&!(!((n=this.contentDOM)===null||n===void 0)&&n.contains(r))))return!1;const o=t.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(r.tagName)||r.isContentEditable)&&!o)return!0;const{isEditable:u}=this.editor,{isDragging:s}=this,c=!!this.node.type.spec.draggable,l=ve.isSelectable(this.node),f=t.type==="copy",d=t.type==="paste",p=t.type==="cut",h=t.type==="mousedown",v=t.type.startsWith("drag");if(!c&&l&&v&&t.preventDefault(),c&&v&&!s)return t.preventDefault(),!1;if(c&&u&&!s&&h){const y=r.closest("[data-drag-handle]");y&&(this.dom===y||this.dom.contains(y))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(s||o||f||d||p||h&&l)}ignoreMutation(t){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:t}):this.node.isLeaf||this.node.isAtom?!0:t.type==="selection"||this.dom.contains(t.target)&&t.type==="childList"&&Hb()&&this.editor.isFocused&&[...Array.from(t.addedNodes),...Array.from(t.removedNodes)].every(r=>r.isContentEditable)?!1:this.contentDOM===t.target&&t.type==="attributes"?!0:!this.contentDOM.contains(t.target)}updateAttributes(t){this.editor.commands.command(({tr:n})=>{const r=this.getPos();return n.setNodeMarkup(r,void 0,{...this.node.attrs,...t}),!0})}deleteNode(){const t=this.getPos(),n=t+this.node.nodeSize;this.editor.commands.deleteRange({from:t,to:n})}}function Xb(e){return new A1e({find:e.find,handler:({state:t,range:n,match:r})=>{const i=Ee(e.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=t,a=r[r.length-1],u=r[0];let s=n.to;if(a){const c=u.search(/\S/),l=n.from+u.indexOf(a),f=l+a.length;if(j3(n.from,n.to,t.doc).filter(p=>p.mark.type.excluded.find(v=>v===e.type&&v!==p.mark.type)).filter(p=>p.to>l).length)return null;f<n.to&&o.delete(f,n.to),l>n.from&&o.delete(n.from+c,l),s=n.from+c+a.length,o.addMark(n.from+c,s,e.type.create(i||{})),o.removeStoredMark(e.type)}}})}function XEe(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}var nr="top",Hr="bottom",Jr="right",rr="left",Qb="auto",Vh=[nr,Hr,Jr,rr],Hf="start",Hh="end",QEe="clippingParents",B3="viewport",Jh="popper",eRe="reference",z3=Vh.reduce(function(e,t){return e.concat([t+"-"+Hf,t+"-"+Hh])},[]),q3=[].concat(Vh,[Qb]).reduce(function(e,t){return e.concat([t,t+"-"+Hf,t+"-"+Hh])},[]),tRe="beforeRead",nRe="read",rRe="afterRead",iRe="beforeMain",oRe="main",aRe="afterMain",uRe="beforeWrite",sRe="write",cRe="afterWrite",KR=[tRe,nRe,rRe,iRe,oRe,aRe,uRe,sRe,cRe];function ho(e){return e?(e.nodeName||"").toLowerCase():null}function Gr(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function wc(e){var t=Gr(e).Element;return e instanceof t||e instanceof Element}function wr(e){var t=Gr(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function VR(e){if(typeof ShadowRoot>"u")return!1;var t=Gr(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function lRe(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},o=t.elements[n];!wr(o)||!ho(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(a){var u=i[a];u===!1?o.removeAttribute(a):o.setAttribute(a,u===!0?"":u)}))})}function fRe(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var i=t.elements[r],o=t.attributes[r]||{},a=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),u=a.reduce(function(s,c){return s[c]="",s},{});!wr(i)||!ho(i)||(Object.assign(i.style,u),Object.keys(o).forEach(function(s){i.removeAttribute(s)}))})}}const K3={name:"applyStyles",enabled:!0,phase:"write",fn:lRe,effect:fRe,requires:["computeStyles"]};function xi(e){return e.split("-")[0]}var Ec=Math.max,e$=Math.min,Jf=Math.round;function HR(){var e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function V3(){return!/^((?!chrome|android).)*safari/i.test(HR())}function Gf(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&wr(e)&&(i=e.offsetWidth>0&&Jf(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&Jf(r.height)/e.offsetHeight||1);var a=wc(e)?Gr(e):window,u=a.visualViewport,s=!V3()&&n,c=(r.left+(s&&u?u.offsetLeft:0))/i,l=(r.top+(s&&u?u.offsetTop:0))/o,f=r.width/i,d=r.height/o;return{width:f,height:d,top:l,right:c+f,bottom:l+d,left:c,x:c,y:l}}function JR(e){var t=Gf(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function H3(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&VR(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Ci(e){return Gr(e).getComputedStyle(e)}function dRe(e){return["table","td","th"].indexOf(ho(e))>=0}function ju(e){return((wc(e)?e.ownerDocument:e.document)||window.document).documentElement}function t$(e){return ho(e)==="html"?e:e.assignedSlot||e.parentNode||(VR(e)?e.host:null)||ju(e)}function J3(e){return!wr(e)||Ci(e).position==="fixed"?null:e.offsetParent}function pRe(e){var t=/firefox/i.test(HR()),n=/Trident/i.test(HR());if(n&&wr(e)){var r=Ci(e);if(r.position==="fixed")return null}var i=t$(e);for(VR(i)&&(i=i.host);wr(i)&&["html","body"].indexOf(ho(i))<0;){var o=Ci(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function Gh(e){for(var t=Gr(e),n=J3(e);n&&dRe(n)&&Ci(n).position==="static";)n=J3(n);return n&&(ho(n)==="html"||ho(n)==="body"&&Ci(n).position==="static")?t:n||pRe(e)||t}function GR(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Yh(e,t,n){return Ec(e,e$(t,n))}function hRe(e,t,n){var r=Yh(e,t,n);return r>n?n:r}function G3(){return{top:0,right:0,bottom:0,left:0}}function Y3(e){return Object.assign({},G3(),e)}function Z3(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var mRe=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,Y3(typeof t!="number"?t:Z3(t,Vh))};function vRe(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,u=xi(n.placement),s=GR(u),c=[rr,Jr].indexOf(u)>=0,l=c?"height":"width";if(!(!o||!a)){var f=mRe(i.padding,n),d=JR(o),p=s==="y"?nr:rr,h=s==="y"?Hr:Jr,v=n.rects.reference[l]+n.rects.reference[s]-a[s]-n.rects.popper[l],y=a[s]-n.rects.reference[s],b=Gh(o),w=b?s==="y"?b.clientHeight||0:b.clientWidth||0:0,F=v/2-y/2,g=f[p],I=w-d[l]-f[h],T=w/2-d[l]/2+F,k=Yh(g,T,I),E=s;n.modifiersData[r]=(t={},t[E]=k,t.centerOffset=k-T,t)}}function gRe(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;if(i!=null&&!(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i))){if(process.env.NODE_ENV!=="production"&&(wr(i)||console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).',"To use an SVG arrow, wrap it in an HTMLElement that will be used as","the arrow."].join(" "))),!H3(t.elements.popper,i)){process.env.NODE_ENV!=="production"&&console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper',"element."].join(" "));return}t.elements.arrow=i}}const yRe={name:"arrow",enabled:!0,phase:"main",fn:vRe,effect:gRe,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Yf(e){return e.split("-")[1]}var bRe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function $Re(e){var t=e.x,n=e.y,r=window,i=r.devicePixelRatio||1;return{x:Jf(t*i)/i||0,y:Jf(n*i)/i||0}}function X3(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,a=e.offsets,u=e.position,s=e.gpuAcceleration,c=e.adaptive,l=e.roundOffsets,f=e.isFixed,d=a.x,p=d===void 0?0:d,h=a.y,v=h===void 0?0:h,y=typeof l=="function"?l({x:p,y:v}):{x:p,y:v};p=y.x,v=y.y;var b=a.hasOwnProperty("x"),w=a.hasOwnProperty("y"),F=rr,g=nr,I=window;if(c){var T=Gh(n),k="clientHeight",E="clientWidth";if(T===Gr(n)&&(T=ju(n),Ci(T).position!=="static"&&u==="absolute"&&(k="scrollHeight",E="scrollWidth")),T=T,i===nr||(i===rr||i===Jr)&&o===Hh){g=Hr;var H=f&&T===I&&I.visualViewport?I.visualViewport.height:T[k];v-=H-r.height,v*=s?1:-1}if(i===rr||(i===nr||i===Hr)&&o===Hh){F=Jr;var q=f&&T===I&&I.visualViewport?I.visualViewport.width:T[E];p-=q-r.width,p*=s?1:-1}}var x=Object.assign({position:u},c&&bRe),J=l===!0?$Re({x:p,y:v}):{x:p,y:v};if(p=J.x,v=J.y,s){var O;return Object.assign({},x,(O={},O[g]=w?"0":"",O[F]=b?"0":"",O.transform=(I.devicePixelRatio||1)<=1?"translate("+p+"px, "+v+"px)":"translate3d("+p+"px, "+v+"px, 0)",O))}return Object.assign({},x,(t={},t[g]=w?v+"px":"",t[F]=b?p+"px":"",t.transform="",t))}function _Re(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,a=o===void 0?!0:o,u=n.roundOffsets,s=u===void 0?!0:u;if(process.env.NODE_ENV!=="production"){var c=Ci(t.elements.popper).transitionProperty||"";a&&["transform","top","right","bottom","left"].some(function(f){return c.indexOf(f)>=0})&&console.warn(["Popper: Detected CSS transitions on at least one of the following",'CSS properties: "transform", "top", "right", "bottom", "left".',`
120
120
 
121
121
  `,'Disable the "computeStyles" modifier\'s `adaptive` option to allow',"for smooth transitions, or remove these properties from the CSS","transition declaration on the popper element if only transitioning","opacity or background-color for example.",`
122
122
 
123
- `,"We recommend using the popper element as a wrapper around an inner","element that can have any CSS property transitioned for animations."].join(" "))}var l={placement:xi(t.placement),variation:Xf(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,H3(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:s})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,H3(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:s})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const fRe={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:lRe,data:{}};var r$={passive:!0};function dRe(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=i===void 0?!0:i,a=r.resize,u=a===void 0?!0:a,s=Gr(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&c.forEach(function(l){l.addEventListener("scroll",n.update,r$)}),u&&s.addEventListener("resize",n.update,r$),function(){o&&c.forEach(function(l){l.removeEventListener("scroll",n.update,r$)}),u&&s.removeEventListener("resize",n.update,r$)}}const pRe={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:dRe,data:{}};var hRe={left:"right",right:"left",bottom:"top",top:"bottom"};function i$(e){return e.replace(/left|right|bottom|top/g,function(t){return hRe[t]})}var mRe={start:"end",end:"start"};function J3(e){return e.replace(/start|end/g,function(t){return mRe[t]})}function XR(e){var t=Gr(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function QR(e){return Zf(Bu(e)).left+XR(e).scrollLeft}function vRe(e,t){var n=Gr(e),r=Bu(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,u=0,s=0;if(i){o=i.width,a=i.height;var c=U3();(c||!c&&t==="fixed")&&(u=i.offsetLeft,s=i.offsetTop)}return{width:o,height:a,x:u+QR(e),y:s}}function gRe(e){var t,n=Bu(e),r=XR(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=Rc(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=Rc(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),u=-r.scrollLeft+QR(e),s=-r.scrollTop;return Ci(i||n).direction==="rtl"&&(u+=Rc(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:u,y:s}}function eM(e){var t=Ci(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function G3(e){return["html","body","#document"].indexOf(mo(e))>=0?e.ownerDocument.body:wr(e)&&eM(e)?e:G3(n$(e))}function Yh(e,t){var n;t===void 0&&(t=[]);var r=G3(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=Gr(r),a=i?[o].concat(o.visualViewport||[],eM(r)?r:[]):r,u=t.concat(a);return i?u:u.concat(Yh(n$(a)))}function tM(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function yRe(e,t){var n=Zf(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function Y3(e,t,n){return t===F3?tM(vRe(e,n)):Ec(t)?yRe(t,n):tM(gRe(Bu(e)))}function bRe(e){var t=Yh(n$(e)),n=["absolute","fixed"].indexOf(Ci(e).position)>=0,r=n&&wr(e)?Jh(e):e;return Ec(r)?t.filter(function(i){return Ec(i)&&B3(i,r)&&mo(i)!=="body"}):[]}function $Re(e,t,n,r){var i=t==="clippingParents"?bRe(e):[].concat(t),o=[].concat(i,[n]),a=o[0],u=o.reduce(function(s,c){var l=Y3(e,c,r);return s.top=Rc(l.top,s.top),s.right=t$(l.right,s.right),s.bottom=t$(l.bottom,s.bottom),s.left=Rc(l.left,s.left),s},Y3(e,a,r));return u.width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u}function Z3(e){var t=e.reference,n=e.element,r=e.placement,i=r?xi(r):null,o=r?Xf(r):null,a=t.x+t.width/2-n.width/2,u=t.y+t.height/2-n.height/2,s;switch(i){case nr:s={x:a,y:t.y-n.height};break;case Hr:s={x:a,y:t.y+t.height};break;case Jr:s={x:t.x+t.width,y:u};break;case rr:s={x:t.x-n.width,y:u};break;default:s={x:t.x,y:t.y}}var c=i?ZR(i):null;if(c!=null){var l=c==="y"?"height":"width";switch(o){case Gf:s[c]=s[c]-(t[l]/2-n[l]/2);break;case Vh:s[c]=s[c]+(t[l]/2-n[l]/2);break}}return s}function Zh(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,o=n.strategy,a=o===void 0?e.strategy:o,u=n.boundary,s=u===void 0?BEe:u,c=n.rootBoundary,l=c===void 0?F3:c,f=n.elementContext,d=f===void 0?Hh:f,p=n.altBoundary,h=p===void 0?!1:p,v=n.padding,y=v===void 0?0:v,b=K3(typeof y!="number"?y:V3(y,Kh)),w=d===Hh?zEe:Hh,F=e.rects.popper,g=e.elements[h?w:d],I=$Re(Ec(g)?g:g.contextElement||Bu(e.elements.popper),s,l,a),T=Zf(e.elements.reference),k=Z3({reference:T,element:F,strategy:"absolute",placement:i}),E=tM(Object.assign({},F,k)),Y=d===Hh?E:T,K={top:I.top-Y.top+b.top,bottom:Y.bottom-I.bottom+b.bottom,left:I.left-Y.left+b.left,right:Y.right-I.right+b.right},x=e.modifiersData.offset;if(d===Hh&&x){var X=x[i];Object.keys(K).forEach(function(O){var R=[Jr,Hr].indexOf(O)>=0?1:-1,W=[nr,Hr].indexOf(O)>=0?"y":"x";K[O]+=X[W]*R})}return K}function _Re(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,u=n.flipVariations,s=n.allowedAutoPlacements,c=s===void 0?L3:s,l=Xf(r),f=l?u?D3:D3.filter(function(h){return Xf(h)===l}):Kh,d=f.filter(function(h){return c.indexOf(h)>=0});d.length===0&&(d=f,process.env.NODE_ENV!=="production"&&console.error(["Popper: The `allowedAutoPlacements` option did not allow any","placements. Ensure the `placement` option matches the variation","of the allowed placements.",'For example, "auto" cannot be used to allow "bottom-start".','Use "auto-start" instead.'].join(" ")));var p=d.reduce(function(h,v){return h[v]=Zh(e,{placement:v,boundary:i,rootBoundary:o,padding:a})[xi(v)],h},{});return Object.keys(p).sort(function(h,v){return p[h]-p[v]})}function SRe(e){if(xi(e)===e$)return[];var t=i$(e);return[J3(e),t,J3(t)]}function TRe(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,u=a===void 0?!0:a,s=n.fallbackPlacements,c=n.padding,l=n.boundary,f=n.rootBoundary,d=n.altBoundary,p=n.flipVariations,h=p===void 0?!0:p,v=n.allowedAutoPlacements,y=t.options.placement,b=xi(y),w=b===y,F=s||(w||!h?[i$(y)]:SRe(y)),g=[y].concat(F).reduce(function(he,Se){return he.concat(xi(Se)===e$?_Re(t,{placement:Se,boundary:l,rootBoundary:f,padding:c,flipVariations:h,allowedAutoPlacements:v}):Se)},[]),I=t.rects.reference,T=t.rects.popper,k=new Map,E=!0,Y=g[0],K=0;K<g.length;K++){var x=g[K],X=xi(x),O=Xf(x)===Gf,R=[nr,Hr].indexOf(X)>=0,W=R?"width":"height",L=Zh(t,{placement:x,boundary:l,rootBoundary:f,altBoundary:d,padding:c}),z=R?O?Jr:rr:O?Hr:nr;I[W]>T[W]&&(z=i$(z));var j=i$(z),S=[];if(o&&S.push(L[X]<=0),u&&S.push(L[z]<=0,L[j]<=0),S.every(function(he){return he})){Y=x,E=!1;break}k.set(x,S)}if(E)for(var _=h?3:1,U=function(Se){var Qe=g.find(function(Ft){var Jt=k.get(Ft);if(Jt)return Jt.slice(0,Se).every(function(Yr){return Yr})});if(Qe)return Y=Qe,"break"},G=_;G>0;G--){var ge=U(G);if(ge==="break")break}t.placement!==Y&&(t.modifiersData[r]._skip=!0,t.placement=Y,t.reset=!0)}}const IRe={name:"flip",enabled:!0,phase:"main",fn:TRe,requiresIfExists:["offset"],data:{_skip:!1}};function X3(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Q3(e){return[nr,Jr,Hr,rr].some(function(t){return e[t]>=0})}function ORe(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=Zh(t,{elementContext:"reference"}),u=Zh(t,{altBoundary:!0}),s=X3(a,r),c=X3(u,i,o),l=Q3(s),f=Q3(c);t.modifiersData[n]={referenceClippingOffsets:s,popperEscapeOffsets:c,isReferenceHidden:l,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":l,"data-popper-escaped":f})}const wRe={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:ORe};function ERe(e,t,n){var r=xi(e),i=[rr,nr].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=o[0],u=o[1];return a=a||0,u=(u||0)*i,[rr,Jr].indexOf(r)>=0?{x:u,y:a}:{x:a,y:u}}function RRe(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=i===void 0?[0,0]:i,a=L3.reduce(function(l,f){return l[f]=ERe(f,t.rects,o),l},{}),u=a[t.placement],s=u.x,c=u.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=s,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=a}const MRe={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:RRe};function xRe(e){var t=e.state,n=e.name;t.modifiersData[n]=Z3({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const CRe={name:"popperOffsets",enabled:!0,phase:"read",fn:xRe,data:{}};function ARe(e){return e==="x"?"y":"x"}function kRe(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,u=a===void 0?!1:a,s=n.boundary,c=n.rootBoundary,l=n.altBoundary,f=n.padding,d=n.tether,p=d===void 0?!0:d,h=n.tetherOffset,v=h===void 0?0:h,y=Zh(t,{boundary:s,rootBoundary:c,padding:f,altBoundary:l}),b=xi(t.placement),w=Xf(t.placement),F=!w,g=ZR(b),I=ARe(g),T=t.modifiersData.popperOffsets,k=t.rects.reference,E=t.rects.popper,Y=typeof v=="function"?v(Object.assign({},t.rects,{placement:t.placement})):v,K=typeof Y=="number"?{mainAxis:Y,altAxis:Y}:Object.assign({mainAxis:0,altAxis:0},Y),x=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,X={x:0,y:0};if(!!T){if(o){var O,R=g==="y"?nr:rr,W=g==="y"?Hr:Jr,L=g==="y"?"height":"width",z=T[g],j=z+y[R],S=z-y[W],_=p?-E[L]/2:0,U=w===Gf?k[L]:E[L],G=w===Gf?-E[L]:-k[L],ge=t.elements.arrow,he=p&&ge?YR(ge):{width:0,height:0},Se=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:q3(),Qe=Se[R],Ft=Se[W],Jt=Gh(0,k[L],he[L]),Yr=F?k[L]/2-_-Jt-Qe-K.mainAxis:U-Jt-Qe-K.mainAxis,Wn=F?-k[L]/2+_+Jt+Ft+K.mainAxis:G+Jt+Ft+K.mainAxis,bo=t.elements.arrow&&Jh(t.elements.arrow),xa=bo?g==="y"?bo.clientTop||0:bo.clientLeft||0:0,Ca=(O=x==null?void 0:x[g])!=null?O:0,Yu=z+Yr-Ca-xa,ki=z+Wn-Ca,Zr=Gh(p?t$(j,Yu):j,z,p?Rc(S,ki):S);T[g]=Zr,X[g]=Zr-z}if(u){var $o,Aa=g==="x"?nr:rr,Wi=g==="x"?Hr:Jr,ir=T[I],Xr=I==="y"?"height":"width",Ni=ir+y[Aa],Pi=ir-y[Wi],ka=[nr,rr].indexOf(b)!==-1,Wa=($o=x==null?void 0:x[I])!=null?$o:0,Na=ka?Ni:ir-k[Xr]-E[Xr]-Wa+K.altAxis,Qr=ka?ir+k[Xr]+E[Xr]-Wa-K.altAxis:Pi,Zu=p&&ka?rRe(Na,ir,Qr):Gh(p?Na:Ni,ir,p?Qr:Pi);T[I]=Zu,X[I]=Zu-ir}t.modifiersData[r]=X}}const WRe={name:"preventOverflow",enabled:!0,phase:"main",fn:kRe,requiresIfExists:["offset"]};function NRe(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function PRe(e){return e===Gr(e)||!wr(e)?XR(e):NRe(e)}function FRe(e){var t=e.getBoundingClientRect(),n=Yf(t.width)/e.offsetWidth||1,r=Yf(t.height)/e.offsetHeight||1;return n!==1||r!==1}function DRe(e,t,n){n===void 0&&(n=!1);var r=wr(t),i=wr(t)&&FRe(t),o=Bu(t),a=Zf(e,i,n),u={scrollLeft:0,scrollTop:0},s={x:0,y:0};return(r||!r&&!n)&&((mo(t)!=="body"||eM(o))&&(u=PRe(t)),wr(t)?(s=Zf(t,!0),s.x+=t.clientLeft,s.y+=t.clientTop):o&&(s.x=QR(o))),{x:a.left+u.scrollLeft-s.x,y:a.top+u.scrollTop-s.y,width:a.width,height:a.height}}function LRe(e){var t=new Map,n=new Set,r=[];e.forEach(function(o){t.set(o.name,o)});function i(o){n.add(o.name);var a=[].concat(o.requires||[],o.requiresIfExists||[]);a.forEach(function(u){if(!n.has(u)){var s=t.get(u);s&&i(s)}}),r.push(o)}return e.forEach(function(o){n.has(o.name)||i(o)}),r}function jRe(e){var t=LRe(e);return HR.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function URe(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function zu(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return[].concat(n).reduce(function(i,o){return i.replace(/%s/,o)},e)}var Mc='Popper: modifier "%s" provided an invalid %s property, expected %s but got %s',BRe='Popper: modifier "%s" requires "%s", but "%s" modifier is not available',e4=["name","enabled","phase","fn","effect","requires","options"];function zRe(e){e.forEach(function(t){[].concat(Object.keys(t),e4).filter(function(n,r,i){return i.indexOf(n)===r}).forEach(function(n){switch(n){case"name":typeof t.name!="string"&&console.error(zu(Mc,String(t.name),'"name"','"string"','"'+String(t.name)+'"'));break;case"enabled":typeof t.enabled!="boolean"&&console.error(zu(Mc,t.name,'"enabled"','"boolean"','"'+String(t.enabled)+'"'));break;case"phase":HR.indexOf(t.phase)<0&&console.error(zu(Mc,t.name,'"phase"',"either "+HR.join(", "),'"'+String(t.phase)+'"'));break;case"fn":typeof t.fn!="function"&&console.error(zu(Mc,t.name,'"fn"','"function"','"'+String(t.fn)+'"'));break;case"effect":t.effect!=null&&typeof t.effect!="function"&&console.error(zu(Mc,t.name,'"effect"','"function"','"'+String(t.fn)+'"'));break;case"requires":t.requires!=null&&!Array.isArray(t.requires)&&console.error(zu(Mc,t.name,'"requires"','"array"','"'+String(t.requires)+'"'));break;case"requiresIfExists":Array.isArray(t.requiresIfExists)||console.error(zu(Mc,t.name,'"requiresIfExists"','"array"','"'+String(t.requiresIfExists)+'"'));break;case"options":case"data":break;default:console.error('PopperJS: an invalid property has been provided to the "'+t.name+'" modifier, valid properties are '+e4.map(function(r){return'"'+r+'"'}).join(", ")+'; but "'+n+'" was provided.')}t.requires&&t.requires.forEach(function(r){e.find(function(i){return i.name===r})==null&&console.error(zu(BRe,String(t.name),r,r))})})})}function qRe(e,t){var n=new Set;return e.filter(function(r){var i=t(r);if(!n.has(i))return n.add(i),!0})}function KRe(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var t4="Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.",VRe="Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.",n4={placement:"bottom",modifiers:[],strategy:"absolute"};function r4(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function HRe(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,i=t.defaultOptions,o=i===void 0?n4:i;return function(u,s,c){c===void 0&&(c=o);var l={placement:"bottom",orderedModifiers:[],options:Object.assign({},n4,o),modifiersData:{},elements:{reference:u,popper:s},attributes:{},styles:{}},f=[],d=!1,p={state:l,setOptions:function(b){var w=typeof b=="function"?b(l.options):b;v(),l.options=Object.assign({},o,l.options,w),l.scrollParents={reference:Ec(u)?Yh(u):u.contextElement?Yh(u.contextElement):[],popper:Yh(s)};var F=jRe(KRe([].concat(r,l.options.modifiers)));if(l.orderedModifiers=F.filter(function(x){return x.enabled}),process.env.NODE_ENV!=="production"){var g=qRe([].concat(F,l.options.modifiers),function(x){var X=x.name;return X});if(zRe(g),xi(l.options.placement)===e$){var I=l.orderedModifiers.find(function(x){var X=x.name;return X==="flip"});I||console.error(['Popper: "auto" placements require the "flip" modifier be',"present and enabled to work."].join(" "))}var T=Ci(s),k=T.marginTop,E=T.marginRight,Y=T.marginBottom,K=T.marginLeft;[k,E,Y,K].some(function(x){return parseFloat(x)})&&console.warn(['Popper: CSS "margin" styles cannot be used to apply padding',"between the popper and its reference element or boundary.","To replicate margin, use the `offset` modifier, as well as","the `padding` option in the `preventOverflow` and `flip`","modifiers."].join(" "))}return h(),p.update()},forceUpdate:function(){if(!d){var b=l.elements,w=b.reference,F=b.popper;if(!r4(w,F)){process.env.NODE_ENV!=="production"&&console.error(t4);return}l.rects={reference:DRe(w,Jh(F),l.options.strategy==="fixed"),popper:YR(F)},l.reset=!1,l.placement=l.options.placement,l.orderedModifiers.forEach(function(x){return l.modifiersData[x.name]=Object.assign({},x.data)});for(var g=0,I=0;I<l.orderedModifiers.length;I++){if(process.env.NODE_ENV!=="production"&&(g+=1,g>100)){console.error(VRe);break}if(l.reset===!0){l.reset=!1,I=-1;continue}var T=l.orderedModifiers[I],k=T.fn,E=T.options,Y=E===void 0?{}:E,K=T.name;typeof k=="function"&&(l=k({state:l,options:Y,name:K,instance:p})||l)}}},update:URe(function(){return new Promise(function(y){p.forceUpdate(),y(l)})}),destroy:function(){v(),d=!0}};if(!r4(u,s))return process.env.NODE_ENV!=="production"&&console.error(t4),p;p.setOptions(c).then(function(y){!d&&c.onFirstUpdate&&c.onFirstUpdate(y)});function h(){l.orderedModifiers.forEach(function(y){var b=y.name,w=y.options,F=w===void 0?{}:w,g=y.effect;if(typeof g=="function"){var I=g({state:l,name:b,instance:p,options:F}),T=function(){};f.push(I||T)}})}function v(){f.forEach(function(y){return y()}),f=[]}return p}}var JRe=[pRe,CRe,fRe,j3,MRe,IRe,WRe,uRe,wRe],GRe=HRe({defaultModifiers:JRe}),YRe="tippy-box",i4="tippy-content",ZRe="tippy-backdrop",o4="tippy-arrow",a4="tippy-svg-arrow",xc={passive:!0,capture:!0},u4=function(){return document.body};function XRe(e,t){return{}.hasOwnProperty.call(e,t)}function nM(e,t,n){if(Array.isArray(e)){var r=e[t];return r==null?Array.isArray(n)?n[t]:n:r}return e}function rM(e,t){var n={}.toString.call(e);return n.indexOf("[object")===0&&n.indexOf(t+"]")>-1}function s4(e,t){return typeof e=="function"?e.apply(void 0,t):e}function c4(e,t){if(t===0)return e;var n;return function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)}}function QRe(e,t){var n=Object.assign({},e);return t.forEach(function(r){delete n[r]}),n}function eMe(e){return e.split(/\s+/).filter(Boolean)}function Qf(e){return[].concat(e)}function l4(e,t){e.indexOf(t)===-1&&e.push(t)}function tMe(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function nMe(e){return e.split("-")[0]}function o$(e){return[].slice.call(e)}function f4(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function Xh(){return document.createElement("div")}function Qh(e){return["Element","Fragment"].some(function(t){return rM(e,t)})}function rMe(e){return rM(e,"NodeList")}function iMe(e){return rM(e,"MouseEvent")}function oMe(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function aMe(e){return Qh(e)?[e]:rMe(e)?o$(e):Array.isArray(e)?e:o$(document.querySelectorAll(e))}function iM(e,t){e.forEach(function(n){n&&(n.style.transitionDuration=t+"ms")})}function d4(e,t){e.forEach(function(n){n&&n.setAttribute("data-state",t)})}function uMe(e){var t,n=Qf(e),r=n[0];return r!=null&&(t=r.ownerDocument)!=null&&t.body?r.ownerDocument:document}function sMe(e,t){var n=t.clientX,r=t.clientY;return e.every(function(i){var o=i.popperRect,a=i.popperState,u=i.props,s=u.interactiveBorder,c=nMe(a.placement),l=a.modifiersData.offset;if(!l)return!0;var f=c==="bottom"?l.top.y:0,d=c==="top"?l.bottom.y:0,p=c==="right"?l.left.x:0,h=c==="left"?l.right.x:0,v=o.top-r+f>s,y=r-o.bottom-d>s,b=o.left-n+p>s,w=n-o.right-h>s;return v||y||b||w})}function oM(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){e[r](i,n)})}function p4(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var vo={isTouch:!1},h4=0;function cMe(){vo.isTouch||(vo.isTouch=!0,window.performance&&document.addEventListener("mousemove",m4))}function m4(){var e=performance.now();e-h4<20&&(vo.isTouch=!1,document.removeEventListener("mousemove",m4)),h4=e}function lMe(){var e=document.activeElement;if(oMe(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function fMe(){document.addEventListener("touchstart",cMe,xc),window.addEventListener("blur",lMe)}var dMe=typeof window<"u"&&typeof document<"u",pMe=dMe?!!window.msCrypto:!1;function ed(e){var t=e==="destroy"?"n already-":" ";return[e+"() was called on a"+t+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function v4(e){var t=/[ \t]{2,}/g,n=/^[ \t]*/gm;return e.replace(t," ").replace(n,"").trim()}function hMe(e){return v4(`
123
+ `,"We recommend using the popper element as a wrapper around an inner","element that can have any CSS property transitioned for animations."].join(" "))}var l={placement:xi(t.placement),variation:Yf(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,X3(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:s})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,X3(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:s})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const SRe={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:_Re,data:{}};var n$={passive:!0};function TRe(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=i===void 0?!0:i,a=r.resize,u=a===void 0?!0:a,s=Gr(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&c.forEach(function(l){l.addEventListener("scroll",n.update,n$)}),u&&s.addEventListener("resize",n.update,n$),function(){o&&c.forEach(function(l){l.removeEventListener("scroll",n.update,n$)}),u&&s.removeEventListener("resize",n.update,n$)}}const IRe={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:TRe,data:{}};var ORe={left:"right",right:"left",bottom:"top",top:"bottom"};function r$(e){return e.replace(/left|right|bottom|top/g,function(t){return ORe[t]})}var wRe={start:"end",end:"start"};function Q3(e){return e.replace(/start|end/g,function(t){return wRe[t]})}function YR(e){var t=Gr(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function ZR(e){return Gf(ju(e)).left+YR(e).scrollLeft}function ERe(e,t){var n=Gr(e),r=ju(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,u=0,s=0;if(i){o=i.width,a=i.height;var c=V3();(c||!c&&t==="fixed")&&(u=i.offsetLeft,s=i.offsetTop)}return{width:o,height:a,x:u+ZR(e),y:s}}function RRe(e){var t,n=ju(e),r=YR(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=Ec(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=Ec(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),u=-r.scrollLeft+ZR(e),s=-r.scrollTop;return Ci(i||n).direction==="rtl"&&(u+=Ec(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:u,y:s}}function XR(e){var t=Ci(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function e4(e){return["html","body","#document"].indexOf(ho(e))>=0?e.ownerDocument.body:wr(e)&&XR(e)?e:e4(t$(e))}function Zh(e,t){var n;t===void 0&&(t=[]);var r=e4(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=Gr(r),a=i?[o].concat(o.visualViewport||[],XR(r)?r:[]):r,u=t.concat(a);return i?u:u.concat(Zh(t$(a)))}function QR(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function MRe(e,t){var n=Gf(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function t4(e,t,n){return t===B3?QR(ERe(e,n)):wc(t)?MRe(t,n):QR(RRe(ju(e)))}function xRe(e){var t=Zh(t$(e)),n=["absolute","fixed"].indexOf(Ci(e).position)>=0,r=n&&wr(e)?Gh(e):e;return wc(r)?t.filter(function(i){return wc(i)&&H3(i,r)&&ho(i)!=="body"}):[]}function CRe(e,t,n,r){var i=t==="clippingParents"?xRe(e):[].concat(t),o=[].concat(i,[n]),a=o[0],u=o.reduce(function(s,c){var l=t4(e,c,r);return s.top=Ec(l.top,s.top),s.right=e$(l.right,s.right),s.bottom=e$(l.bottom,s.bottom),s.left=Ec(l.left,s.left),s},t4(e,a,r));return u.width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u}function n4(e){var t=e.reference,n=e.element,r=e.placement,i=r?xi(r):null,o=r?Yf(r):null,a=t.x+t.width/2-n.width/2,u=t.y+t.height/2-n.height/2,s;switch(i){case nr:s={x:a,y:t.y-n.height};break;case Hr:s={x:a,y:t.y+t.height};break;case Jr:s={x:t.x+t.width,y:u};break;case rr:s={x:t.x-n.width,y:u};break;default:s={x:t.x,y:t.y}}var c=i?GR(i):null;if(c!=null){var l=c==="y"?"height":"width";switch(o){case Hf:s[c]=s[c]-(t[l]/2-n[l]/2);break;case Hh:s[c]=s[c]+(t[l]/2-n[l]/2);break}}return s}function Xh(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,o=n.strategy,a=o===void 0?e.strategy:o,u=n.boundary,s=u===void 0?QEe:u,c=n.rootBoundary,l=c===void 0?B3:c,f=n.elementContext,d=f===void 0?Jh:f,p=n.altBoundary,h=p===void 0?!1:p,v=n.padding,y=v===void 0?0:v,b=Y3(typeof y!="number"?y:Z3(y,Vh)),w=d===Jh?eRe:Jh,F=e.rects.popper,g=e.elements[h?w:d],I=CRe(wc(g)?g:g.contextElement||ju(e.elements.popper),s,l,a),T=Gf(e.elements.reference),k=n4({reference:T,element:F,strategy:"absolute",placement:i}),E=QR(Object.assign({},F,k)),H=d===Jh?E:T,q={top:I.top-H.top+b.top,bottom:H.bottom-I.bottom+b.bottom,left:I.left-H.left+b.left,right:H.right-I.right+b.right},x=e.modifiersData.offset;if(d===Jh&&x){var J=x[i];Object.keys(q).forEach(function(O){var R=[Jr,Hr].indexOf(O)>=0?1:-1,C=[nr,Hr].indexOf(O)>=0?"y":"x";q[O]+=J[C]*R})}return q}function ARe(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,u=n.flipVariations,s=n.allowedAutoPlacements,c=s===void 0?q3:s,l=Yf(r),f=l?u?z3:z3.filter(function(h){return Yf(h)===l}):Vh,d=f.filter(function(h){return c.indexOf(h)>=0});d.length===0&&(d=f,process.env.NODE_ENV!=="production"&&console.error(["Popper: The `allowedAutoPlacements` option did not allow any","placements. Ensure the `placement` option matches the variation","of the allowed placements.",'For example, "auto" cannot be used to allow "bottom-start".','Use "auto-start" instead.'].join(" ")));var p=d.reduce(function(h,v){return h[v]=Xh(e,{placement:v,boundary:i,rootBoundary:o,padding:a})[xi(v)],h},{});return Object.keys(p).sort(function(h,v){return p[h]-p[v]})}function kRe(e){if(xi(e)===Qb)return[];var t=r$(e);return[Q3(e),t,Q3(t)]}function WRe(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,u=a===void 0?!0:a,s=n.fallbackPlacements,c=n.padding,l=n.boundary,f=n.rootBoundary,d=n.altBoundary,p=n.flipVariations,h=p===void 0?!0:p,v=n.allowedAutoPlacements,y=t.options.placement,b=xi(y),w=b===y,F=s||(w||!h?[r$(y)]:kRe(y)),g=[y].concat(F).reduce(function(he,Te){return he.concat(xi(Te)===Qb?ARe(t,{placement:Te,boundary:l,rootBoundary:f,padding:c,flipVariations:h,allowedAutoPlacements:v}):Te)},[]),I=t.rects.reference,T=t.rects.popper,k=new Map,E=!0,H=g[0],q=0;q<g.length;q++){var x=g[q],J=xi(x),O=Yf(x)===Hf,R=[nr,Hr].indexOf(J)>=0,C=R?"width":"height",L=Xh(t,{placement:x,boundary:l,rootBoundary:f,altBoundary:d,padding:c}),z=R?O?Jr:rr:O?Hr:nr;I[C]>T[C]&&(z=r$(z));var j=r$(z),S=[];if(o&&S.push(L[J]<=0),u&&S.push(L[z]<=0,L[j]<=0),S.every(function(he){return he})){H=x,E=!1;break}k.set(x,S)}if(E)for(var _=h?3:1,U=function(Te){var Qe=g.find(function(Ft){var Jt=k.get(Ft);if(Jt)return Jt.slice(0,Te).every(function(Yr){return Yr})});if(Qe)return H=Qe,"break"},Y=_;Y>0;Y--){var ge=U(Y);if(ge==="break")break}t.placement!==H&&(t.modifiersData[r]._skip=!0,t.placement=H,t.reset=!0)}}const NRe={name:"flip",enabled:!0,phase:"main",fn:WRe,requiresIfExists:["offset"],data:{_skip:!1}};function r4(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function i4(e){return[nr,Jr,Hr,rr].some(function(t){return e[t]>=0})}function PRe(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=Xh(t,{elementContext:"reference"}),u=Xh(t,{altBoundary:!0}),s=r4(a,r),c=r4(u,i,o),l=i4(s),f=i4(c);t.modifiersData[n]={referenceClippingOffsets:s,popperEscapeOffsets:c,isReferenceHidden:l,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":l,"data-popper-escaped":f})}const FRe={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:PRe};function DRe(e,t,n){var r=xi(e),i=[rr,nr].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=o[0],u=o[1];return a=a||0,u=(u||0)*i,[rr,Jr].indexOf(r)>=0?{x:u,y:a}:{x:a,y:u}}function LRe(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=i===void 0?[0,0]:i,a=q3.reduce(function(l,f){return l[f]=DRe(f,t.rects,o),l},{}),u=a[t.placement],s=u.x,c=u.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=s,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=a}const jRe={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:LRe};function URe(e){var t=e.state,n=e.name;t.modifiersData[n]=n4({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const BRe={name:"popperOffsets",enabled:!0,phase:"read",fn:URe,data:{}};function zRe(e){return e==="x"?"y":"x"}function qRe(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,u=a===void 0?!1:a,s=n.boundary,c=n.rootBoundary,l=n.altBoundary,f=n.padding,d=n.tether,p=d===void 0?!0:d,h=n.tetherOffset,v=h===void 0?0:h,y=Xh(t,{boundary:s,rootBoundary:c,padding:f,altBoundary:l}),b=xi(t.placement),w=Yf(t.placement),F=!w,g=GR(b),I=zRe(g),T=t.modifiersData.popperOffsets,k=t.rects.reference,E=t.rects.popper,H=typeof v=="function"?v(Object.assign({},t.rects,{placement:t.placement})):v,q=typeof H=="number"?{mainAxis:H,altAxis:H}:Object.assign({mainAxis:0,altAxis:0},H),x=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,J={x:0,y:0};if(!!T){if(o){var O,R=g==="y"?nr:rr,C=g==="y"?Hr:Jr,L=g==="y"?"height":"width",z=T[g],j=z+y[R],S=z-y[C],_=p?-E[L]/2:0,U=w===Hf?k[L]:E[L],Y=w===Hf?-E[L]:-k[L],ge=t.elements.arrow,he=p&&ge?JR(ge):{width:0,height:0},Te=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:G3(),Qe=Te[R],Ft=Te[C],Jt=Yh(0,k[L],he[L]),Yr=F?k[L]/2-_-Jt-Qe-q.mainAxis:U-Jt-Qe-q.mainAxis,Wn=F?-k[L]/2+_+Jt+Ft+q.mainAxis:Y+Jt+Ft+q.mainAxis,yo=t.elements.arrow&&Gh(t.elements.arrow),Ma=yo?g==="y"?yo.clientTop||0:yo.clientLeft||0:0,xa=(O=x==null?void 0:x[g])!=null?O:0,Ju=z+Yr-xa-Ma,ki=z+Wn-xa,Zr=Yh(p?e$(j,Ju):j,z,p?Ec(S,ki):S);T[g]=Zr,J[g]=Zr-z}if(u){var bo,Ca=g==="x"?nr:rr,Wi=g==="x"?Hr:Jr,ir=T[I],Xr=I==="y"?"height":"width",Ni=ir+y[Ca],Pi=ir-y[Wi],Aa=[nr,rr].indexOf(b)!==-1,ka=(bo=x==null?void 0:x[I])!=null?bo:0,Wa=Aa?Ni:ir-k[Xr]-E[Xr]-ka+q.altAxis,Qr=Aa?ir+k[Xr]+E[Xr]-ka-q.altAxis:Pi,Gu=p&&Aa?hRe(Wa,ir,Qr):Yh(p?Wa:Ni,ir,p?Qr:Pi);T[I]=Gu,J[I]=Gu-ir}t.modifiersData[r]=J}}const KRe={name:"preventOverflow",enabled:!0,phase:"main",fn:qRe,requiresIfExists:["offset"]};function VRe(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function HRe(e){return e===Gr(e)||!wr(e)?YR(e):VRe(e)}function JRe(e){var t=e.getBoundingClientRect(),n=Jf(t.width)/e.offsetWidth||1,r=Jf(t.height)/e.offsetHeight||1;return n!==1||r!==1}function GRe(e,t,n){n===void 0&&(n=!1);var r=wr(t),i=wr(t)&&JRe(t),o=ju(t),a=Gf(e,i,n),u={scrollLeft:0,scrollTop:0},s={x:0,y:0};return(r||!r&&!n)&&((ho(t)!=="body"||XR(o))&&(u=HRe(t)),wr(t)?(s=Gf(t,!0),s.x+=t.clientLeft,s.y+=t.clientTop):o&&(s.x=ZR(o))),{x:a.left+u.scrollLeft-s.x,y:a.top+u.scrollTop-s.y,width:a.width,height:a.height}}function YRe(e){var t=new Map,n=new Set,r=[];e.forEach(function(o){t.set(o.name,o)});function i(o){n.add(o.name);var a=[].concat(o.requires||[],o.requiresIfExists||[]);a.forEach(function(u){if(!n.has(u)){var s=t.get(u);s&&i(s)}}),r.push(o)}return e.forEach(function(o){n.has(o.name)||i(o)}),r}function ZRe(e){var t=YRe(e);return KR.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function XRe(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function Uu(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return[].concat(n).reduce(function(i,o){return i.replace(/%s/,o)},e)}var Rc='Popper: modifier "%s" provided an invalid %s property, expected %s but got %s',QRe='Popper: modifier "%s" requires "%s", but "%s" modifier is not available',o4=["name","enabled","phase","fn","effect","requires","options"];function eMe(e){e.forEach(function(t){[].concat(Object.keys(t),o4).filter(function(n,r,i){return i.indexOf(n)===r}).forEach(function(n){switch(n){case"name":typeof t.name!="string"&&console.error(Uu(Rc,String(t.name),'"name"','"string"','"'+String(t.name)+'"'));break;case"enabled":typeof t.enabled!="boolean"&&console.error(Uu(Rc,t.name,'"enabled"','"boolean"','"'+String(t.enabled)+'"'));break;case"phase":KR.indexOf(t.phase)<0&&console.error(Uu(Rc,t.name,'"phase"',"either "+KR.join(", "),'"'+String(t.phase)+'"'));break;case"fn":typeof t.fn!="function"&&console.error(Uu(Rc,t.name,'"fn"','"function"','"'+String(t.fn)+'"'));break;case"effect":t.effect!=null&&typeof t.effect!="function"&&console.error(Uu(Rc,t.name,'"effect"','"function"','"'+String(t.fn)+'"'));break;case"requires":t.requires!=null&&!Array.isArray(t.requires)&&console.error(Uu(Rc,t.name,'"requires"','"array"','"'+String(t.requires)+'"'));break;case"requiresIfExists":Array.isArray(t.requiresIfExists)||console.error(Uu(Rc,t.name,'"requiresIfExists"','"array"','"'+String(t.requiresIfExists)+'"'));break;case"options":case"data":break;default:console.error('PopperJS: an invalid property has been provided to the "'+t.name+'" modifier, valid properties are '+o4.map(function(r){return'"'+r+'"'}).join(", ")+'; but "'+n+'" was provided.')}t.requires&&t.requires.forEach(function(r){e.find(function(i){return i.name===r})==null&&console.error(Uu(QRe,String(t.name),r,r))})})})}function tMe(e,t){var n=new Set;return e.filter(function(r){var i=t(r);if(!n.has(i))return n.add(i),!0})}function nMe(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var a4="Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.",rMe="Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.",u4={placement:"bottom",modifiers:[],strategy:"absolute"};function s4(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function iMe(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,i=t.defaultOptions,o=i===void 0?u4:i;return function(u,s,c){c===void 0&&(c=o);var l={placement:"bottom",orderedModifiers:[],options:Object.assign({},u4,o),modifiersData:{},elements:{reference:u,popper:s},attributes:{},styles:{}},f=[],d=!1,p={state:l,setOptions:function(b){var w=typeof b=="function"?b(l.options):b;v(),l.options=Object.assign({},o,l.options,w),l.scrollParents={reference:wc(u)?Zh(u):u.contextElement?Zh(u.contextElement):[],popper:Zh(s)};var F=ZRe(nMe([].concat(r,l.options.modifiers)));if(l.orderedModifiers=F.filter(function(x){return x.enabled}),process.env.NODE_ENV!=="production"){var g=tMe([].concat(F,l.options.modifiers),function(x){var J=x.name;return J});if(eMe(g),xi(l.options.placement)===Qb){var I=l.orderedModifiers.find(function(x){var J=x.name;return J==="flip"});I||console.error(['Popper: "auto" placements require the "flip" modifier be',"present and enabled to work."].join(" "))}var T=Ci(s),k=T.marginTop,E=T.marginRight,H=T.marginBottom,q=T.marginLeft;[k,E,H,q].some(function(x){return parseFloat(x)})&&console.warn(['Popper: CSS "margin" styles cannot be used to apply padding',"between the popper and its reference element or boundary.","To replicate margin, use the `offset` modifier, as well as","the `padding` option in the `preventOverflow` and `flip`","modifiers."].join(" "))}return h(),p.update()},forceUpdate:function(){if(!d){var b=l.elements,w=b.reference,F=b.popper;if(!s4(w,F)){process.env.NODE_ENV!=="production"&&console.error(a4);return}l.rects={reference:GRe(w,Gh(F),l.options.strategy==="fixed"),popper:JR(F)},l.reset=!1,l.placement=l.options.placement,l.orderedModifiers.forEach(function(x){return l.modifiersData[x.name]=Object.assign({},x.data)});for(var g=0,I=0;I<l.orderedModifiers.length;I++){if(process.env.NODE_ENV!=="production"&&(g+=1,g>100)){console.error(rMe);break}if(l.reset===!0){l.reset=!1,I=-1;continue}var T=l.orderedModifiers[I],k=T.fn,E=T.options,H=E===void 0?{}:E,q=T.name;typeof k=="function"&&(l=k({state:l,options:H,name:q,instance:p})||l)}}},update:XRe(function(){return new Promise(function(y){p.forceUpdate(),y(l)})}),destroy:function(){v(),d=!0}};if(!s4(u,s))return process.env.NODE_ENV!=="production"&&console.error(a4),p;p.setOptions(c).then(function(y){!d&&c.onFirstUpdate&&c.onFirstUpdate(y)});function h(){l.orderedModifiers.forEach(function(y){var b=y.name,w=y.options,F=w===void 0?{}:w,g=y.effect;if(typeof g=="function"){var I=g({state:l,name:b,instance:p,options:F}),T=function(){};f.push(I||T)}})}function v(){f.forEach(function(y){return y()}),f=[]}return p}}var oMe=[IRe,BRe,SRe,K3,jRe,NRe,KRe,yRe,FRe],aMe=iMe({defaultModifiers:oMe}),uMe="tippy-box",c4="tippy-content",sMe="tippy-backdrop",l4="tippy-arrow",f4="tippy-svg-arrow",Mc={passive:!0,capture:!0},d4=function(){return document.body};function cMe(e,t){return{}.hasOwnProperty.call(e,t)}function eM(e,t,n){if(Array.isArray(e)){var r=e[t];return r==null?Array.isArray(n)?n[t]:n:r}return e}function tM(e,t){var n={}.toString.call(e);return n.indexOf("[object")===0&&n.indexOf(t+"]")>-1}function p4(e,t){return typeof e=="function"?e.apply(void 0,t):e}function h4(e,t){if(t===0)return e;var n;return function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)}}function lMe(e,t){var n=Object.assign({},e);return t.forEach(function(r){delete n[r]}),n}function fMe(e){return e.split(/\s+/).filter(Boolean)}function Zf(e){return[].concat(e)}function m4(e,t){e.indexOf(t)===-1&&e.push(t)}function dMe(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function pMe(e){return e.split("-")[0]}function i$(e){return[].slice.call(e)}function v4(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function Qh(){return document.createElement("div")}function em(e){return["Element","Fragment"].some(function(t){return tM(e,t)})}function hMe(e){return tM(e,"NodeList")}function mMe(e){return tM(e,"MouseEvent")}function vMe(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function gMe(e){return em(e)?[e]:hMe(e)?i$(e):Array.isArray(e)?e:i$(document.querySelectorAll(e))}function nM(e,t){e.forEach(function(n){n&&(n.style.transitionDuration=t+"ms")})}function g4(e,t){e.forEach(function(n){n&&n.setAttribute("data-state",t)})}function yMe(e){var t,n=Zf(e),r=n[0];return r!=null&&(t=r.ownerDocument)!=null&&t.body?r.ownerDocument:document}function bMe(e,t){var n=t.clientX,r=t.clientY;return e.every(function(i){var o=i.popperRect,a=i.popperState,u=i.props,s=u.interactiveBorder,c=pMe(a.placement),l=a.modifiersData.offset;if(!l)return!0;var f=c==="bottom"?l.top.y:0,d=c==="top"?l.bottom.y:0,p=c==="right"?l.left.x:0,h=c==="left"?l.right.x:0,v=o.top-r+f>s,y=r-o.bottom-d>s,b=o.left-n+p>s,w=n-o.right-h>s;return v||y||b||w})}function rM(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){e[r](i,n)})}function y4(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var mo={isTouch:!1},b4=0;function $Me(){mo.isTouch||(mo.isTouch=!0,window.performance&&document.addEventListener("mousemove",$4))}function $4(){var e=performance.now();e-b4<20&&(mo.isTouch=!1,document.removeEventListener("mousemove",$4)),b4=e}function _Me(){var e=document.activeElement;if(vMe(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function SMe(){document.addEventListener("touchstart",$Me,Mc),window.addEventListener("blur",_Me)}var TMe=typeof window<"u"&&typeof document<"u",IMe=TMe?!!window.msCrypto:!1;function Xf(e){var t=e==="destroy"?"n already-":" ";return[e+"() was called on a"+t+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function _4(e){var t=/[ \t]{2,}/g,n=/^[ \t]*/gm;return e.replace(t," ").replace(n,"").trim()}function OMe(e){return _4(`
124
124
  %ctippy.js
125
125
 
126
- %c`+v4(e)+`
126
+ %c`+_4(e)+`
127
127
 
128
128
  %c\u{1F477}\u200D This is a development-only message. It will be removed in production.
129
- `)}function g4(e){return[hMe(e),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var em;process.env.NODE_ENV!=="production"&&mMe();function mMe(){em=new Set}function Ia(e,t){if(e&&!em.has(t)){var n;em.add(t),(n=console).warn.apply(n,g4(t))}}function aM(e,t){if(e&&!em.has(t)){var n;em.add(t),(n=console).error.apply(n,g4(t))}}function vMe(e){var t=!e,n=Object.prototype.toString.call(e)==="[object Object]"&&!e.addEventListener;aM(t,["tippy() was passed","`"+String(e)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),aM(n,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var y4={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},gMe={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Er=Object.assign({appendTo:u4,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},y4,gMe),yMe=Object.keys(Er),bMe=function(t){process.env.NODE_ENV!=="production"&&_4(t,[]);var n=Object.keys(t);n.forEach(function(r){Er[r]=t[r]})};function b4(e){var t=e.plugins||[],n=t.reduce(function(r,i){var o=i.name,a=i.defaultValue;if(o){var u;r[o]=e[o]!==void 0?e[o]:(u=Er[o])!=null?u:a}return r},{});return Object.assign({},e,n)}function $Me(e,t){var n=t?Object.keys(b4(Object.assign({},Er,{plugins:t}))):yMe,r=n.reduce(function(i,o){var a=(e.getAttribute("data-tippy-"+o)||"").trim();if(!a)return i;if(o==="content")i[o]=a;else try{i[o]=JSON.parse(a)}catch{i[o]=a}return i},{});return r}function $4(e,t){var n=Object.assign({},t,{content:s4(t.content,[e])},t.ignoreAttributes?{}:$Me(e,t.plugins));return n.aria=Object.assign({},Er.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?t.interactive:n.aria.expanded,content:n.aria.content==="auto"?t.interactive?null:"describedby":n.aria.content},n}function _4(e,t){e===void 0&&(e={}),t===void 0&&(t=[]);var n=Object.keys(e);n.forEach(function(r){var i=QRe(Er,Object.keys(y4)),o=!XRe(i,r);o&&(o=t.filter(function(a){return a.name===r}).length===0),Ia(o,["`"+r+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.",`
129
+ `)}function S4(e){return[OMe(e),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var tm;process.env.NODE_ENV!=="production"&&wMe();function wMe(){tm=new Set}function Ta(e,t){if(e&&!tm.has(t)){var n;tm.add(t),(n=console).warn.apply(n,S4(t))}}function iM(e,t){if(e&&!tm.has(t)){var n;tm.add(t),(n=console).error.apply(n,S4(t))}}function EMe(e){var t=!e,n=Object.prototype.toString.call(e)==="[object Object]"&&!e.addEventListener;iM(t,["tippy() was passed","`"+String(e)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),iM(n,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var T4={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},RMe={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Er=Object.assign({appendTo:d4,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},T4,RMe),MMe=Object.keys(Er),xMe=function(t){process.env.NODE_ENV!=="production"&&w4(t,[]);var n=Object.keys(t);n.forEach(function(r){Er[r]=t[r]})};function I4(e){var t=e.plugins||[],n=t.reduce(function(r,i){var o=i.name,a=i.defaultValue;if(o){var u;r[o]=e[o]!==void 0?e[o]:(u=Er[o])!=null?u:a}return r},{});return Object.assign({},e,n)}function CMe(e,t){var n=t?Object.keys(I4(Object.assign({},Er,{plugins:t}))):MMe,r=n.reduce(function(i,o){var a=(e.getAttribute("data-tippy-"+o)||"").trim();if(!a)return i;if(o==="content")i[o]=a;else try{i[o]=JSON.parse(a)}catch{i[o]=a}return i},{});return r}function O4(e,t){var n=Object.assign({},t,{content:p4(t.content,[e])},t.ignoreAttributes?{}:CMe(e,t.plugins));return n.aria=Object.assign({},Er.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?t.interactive:n.aria.expanded,content:n.aria.content==="auto"?t.interactive?null:"describedby":n.aria.content},n}function w4(e,t){e===void 0&&(e={}),t===void 0&&(t=[]);var n=Object.keys(e);n.forEach(function(r){var i=lMe(Er,Object.keys(T4)),o=!cMe(i,r);o&&(o=t.filter(function(a){return a.name===r}).length===0),Ta(o,["`"+r+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.",`
130
130
 
131
131
  `,`All props: https://atomiks.github.io/tippyjs/v6/all-props/
132
- `,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var _Me=function(){return"innerHTML"};function uM(e,t){e[_Me()]=t}function S4(e){var t=Xh();return e===!0?t.className=o4:(t.className=a4,Qh(e)?t.appendChild(e):uM(t,e)),t}function T4(e,t){Qh(t.content)?(uM(e,""),e.appendChild(t.content)):typeof t.content!="function"&&(t.allowHTML?uM(e,t.content):e.textContent=t.content)}function sM(e){var t=e.firstElementChild,n=o$(t.children);return{box:t,content:n.find(function(r){return r.classList.contains(i4)}),arrow:n.find(function(r){return r.classList.contains(o4)||r.classList.contains(a4)}),backdrop:n.find(function(r){return r.classList.contains(ZRe)})}}function I4(e){var t=Xh(),n=Xh();n.className=YRe,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Xh();r.className=i4,r.setAttribute("data-state","hidden"),T4(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props);function i(o,a){var u=sM(t),s=u.box,c=u.content,l=u.arrow;a.theme?s.setAttribute("data-theme",a.theme):s.removeAttribute("data-theme"),typeof a.animation=="string"?s.setAttribute("data-animation",a.animation):s.removeAttribute("data-animation"),a.inertia?s.setAttribute("data-inertia",""):s.removeAttribute("data-inertia"),s.style.maxWidth=typeof a.maxWidth=="number"?a.maxWidth+"px":a.maxWidth,a.role?s.setAttribute("role",a.role):s.removeAttribute("role"),(o.content!==a.content||o.allowHTML!==a.allowHTML)&&T4(c,e.props),a.arrow?l?o.arrow!==a.arrow&&(s.removeChild(l),s.appendChild(S4(a.arrow))):s.appendChild(S4(a.arrow)):l&&s.removeChild(l)}return{popper:t,onUpdate:i}}I4.$$tippy=!0;var SMe=1,a$=[],cM=[];function TMe(e,t){var n=$4(e,Object.assign({},Er,b4(f4(t)))),r,i,o,a=!1,u=!1,s=!1,c=!1,l,f,d,p=[],h=c4(Yu,n.interactiveDebounce),v,y=SMe++,b=null,w=tMe(n.plugins),F={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},g={id:y,reference:e,popper:Xh(),popperInstance:b,props:n,state:F,plugins:w,clearDelayTimeouts:Na,setProps:Qr,setContent:Zu,show:sd,hide:C,hideWithInteractivity:M,enable:ka,disable:Wa,unmount:D,destroy:Me};if(!n.render)return process.env.NODE_ENV!=="production"&&aM(!0,"render() function has not been supplied."),g;var I=n.render(g),T=I.popper,k=I.onUpdate;T.setAttribute("data-tippy-root",""),T.id="tippy-"+g.id,g.popper=T,e._tippy=g,T._tippy=g;var E=w.map(function(A){return A.fn(g)}),Y=e.hasAttribute("aria-expanded");return bo(),_(),z(),j("onCreate",[g]),n.showOnCreate&&Ni(),T.addEventListener("mouseenter",function(){g.props.interactive&&g.state.isVisible&&g.clearDelayTimeouts()}),T.addEventListener("mouseleave",function(){g.props.interactive&&g.props.trigger.indexOf("mouseenter")>=0&&R().addEventListener("mousemove",h)}),g;function K(){var A=g.props.touch;return Array.isArray(A)?A:[A,0]}function x(){return K()[0]==="hold"}function X(){var A;return!!((A=g.props.render)!=null&&A.$$tippy)}function O(){return v||e}function R(){var A=O().parentNode;return A?uMe(A):document}function W(){return sM(T)}function L(A){return g.state.isMounted&&!g.state.isVisible||vo.isTouch||l&&l.type==="focus"?0:nM(g.props.delay,A?0:1,Er.delay)}function z(A){A===void 0&&(A=!1),T.style.pointerEvents=g.props.interactive&&!A?"":"none",T.style.zIndex=""+g.props.zIndex}function j(A,ne,pe){if(pe===void 0&&(pe=!0),E.forEach(function($e){$e[A]&&$e[A].apply($e,ne)}),pe){var de;(de=g.props)[A].apply(de,ne)}}function S(){var A=g.props.aria;if(!!A.content){var ne="aria-"+A.content,pe=T.id,de=Qf(g.props.triggerTarget||e);de.forEach(function($e){var it=$e.getAttribute(ne);if(g.state.isVisible)$e.setAttribute(ne,it?it+" "+pe:pe);else{var Nn=it&&it.replace(pe,"").trim();Nn?$e.setAttribute(ne,Nn):$e.removeAttribute(ne)}})}}function _(){if(!(Y||!g.props.aria.expanded)){var A=Qf(g.props.triggerTarget||e);A.forEach(function(ne){g.props.interactive?ne.setAttribute("aria-expanded",g.state.isVisible&&ne===O()?"true":"false"):ne.removeAttribute("aria-expanded")})}}function U(){R().removeEventListener("mousemove",h),a$=a$.filter(function(A){return A!==h})}function G(A){if(!(vo.isTouch&&(s||A.type==="mousedown"))){var ne=A.composedPath&&A.composedPath()[0]||A.target;if(!(g.props.interactive&&p4(T,ne))){if(Qf(g.props.triggerTarget||e).some(function(pe){return p4(pe,ne)})){if(vo.isTouch||g.state.isVisible&&g.props.trigger.indexOf("click")>=0)return}else j("onClickOutside",[g,A]);g.props.hideOnClick===!0&&(g.clearDelayTimeouts(),g.hide(),u=!0,setTimeout(function(){u=!1}),g.state.isMounted||Qe())}}}function ge(){s=!0}function he(){s=!1}function Se(){var A=R();A.addEventListener("mousedown",G,!0),A.addEventListener("touchend",G,xc),A.addEventListener("touchstart",he,xc),A.addEventListener("touchmove",ge,xc)}function Qe(){var A=R();A.removeEventListener("mousedown",G,!0),A.removeEventListener("touchend",G,xc),A.removeEventListener("touchstart",he,xc),A.removeEventListener("touchmove",ge,xc)}function Ft(A,ne){Yr(A,function(){!g.state.isVisible&&T.parentNode&&T.parentNode.contains(T)&&ne()})}function Jt(A,ne){Yr(A,ne)}function Yr(A,ne){var pe=W().box;function de($e){$e.target===pe&&(oM(pe,"remove",de),ne())}if(A===0)return ne();oM(pe,"remove",f),oM(pe,"add",de),f=de}function Wn(A,ne,pe){pe===void 0&&(pe=!1);var de=Qf(g.props.triggerTarget||e);de.forEach(function($e){$e.addEventListener(A,ne,pe),p.push({node:$e,eventType:A,handler:ne,options:pe})})}function bo(){x()&&(Wn("touchstart",Ca,{passive:!0}),Wn("touchend",ki,{passive:!0})),eMe(g.props.trigger).forEach(function(A){if(A!=="manual")switch(Wn(A,Ca),A){case"mouseenter":Wn("mouseleave",ki);break;case"focus":Wn(pMe?"focusout":"blur",Zr);break;case"focusin":Wn("focusout",Zr);break}})}function xa(){p.forEach(function(A){var ne=A.node,pe=A.eventType,de=A.handler,$e=A.options;ne.removeEventListener(pe,de,$e)}),p=[]}function Ca(A){var ne,pe=!1;if(!(!g.state.isEnabled||$o(A)||u)){var de=((ne=l)==null?void 0:ne.type)==="focus";l=A,v=A.currentTarget,_(),!g.state.isVisible&&iMe(A)&&a$.forEach(function($e){return $e(A)}),A.type==="click"&&(g.props.trigger.indexOf("mouseenter")<0||a)&&g.props.hideOnClick!==!1&&g.state.isVisible?pe=!0:Ni(A),A.type==="click"&&(a=!pe),pe&&!de&&Pi(A)}}function Yu(A){var ne=A.target,pe=O().contains(ne)||T.contains(ne);if(!(A.type==="mousemove"&&pe)){var de=Xr().concat(T).map(function($e){var it,Nn=$e._tippy,Mr=(it=Nn.popperInstance)==null?void 0:it.state;return Mr?{popperRect:$e.getBoundingClientRect(),popperState:Mr,props:n}:null}).filter(Boolean);sMe(de,A)&&(U(),Pi(A))}}function ki(A){var ne=$o(A)||g.props.trigger.indexOf("click")>=0&&a;if(!ne){if(g.props.interactive){g.hideWithInteractivity(A);return}Pi(A)}}function Zr(A){g.props.trigger.indexOf("focusin")<0&&A.target!==O()||g.props.interactive&&A.relatedTarget&&T.contains(A.relatedTarget)||Pi(A)}function $o(A){return vo.isTouch?x()!==A.type.indexOf("touch")>=0:!1}function Aa(){Wi();var A=g.props,ne=A.popperOptions,pe=A.placement,de=A.offset,$e=A.getReferenceClientRect,it=A.moveTransition,Nn=X()?sM(T).arrow:null,Mr=$e?{getBoundingClientRect:$e,contextElement:$e.contextElement||O()}:e,cd={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(fd){var Pa=fd.state;if(X()){var PM=W(),dd=PM.box;["placement","reference-hidden","escaped"].forEach(function(Nc){Nc==="placement"?dd.setAttribute("data-placement",Pa.placement):Pa.attributes.popper["data-popper-"+Nc]?dd.setAttribute("data-"+Nc,""):dd.removeAttribute("data-"+Nc)}),Pa.attributes.popper={}}}},Fi=[{name:"offset",options:{offset:de}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!it}},cd];X()&&Nn&&Fi.push({name:"arrow",options:{element:Nn,padding:3}}),Fi.push.apply(Fi,(ne==null?void 0:ne.modifiers)||[]),g.popperInstance=GRe(Mr,T,Object.assign({},ne,{placement:pe,onFirstUpdate:d,modifiers:Fi}))}function Wi(){g.popperInstance&&(g.popperInstance.destroy(),g.popperInstance=null)}function ir(){var A=g.props.appendTo,ne,pe=O();g.props.interactive&&A===u4||A==="parent"?ne=pe.parentNode:ne=s4(A,[pe]),ne.contains(T)||ne.appendChild(T),g.state.isMounted=!0,Aa(),process.env.NODE_ENV!=="production"&&Ia(g.props.interactive&&A===Er.appendTo&&pe.nextElementSibling!==T,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",`
132
+ `,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var AMe=function(){return"innerHTML"};function oM(e,t){e[AMe()]=t}function E4(e){var t=Qh();return e===!0?t.className=l4:(t.className=f4,em(e)?t.appendChild(e):oM(t,e)),t}function R4(e,t){em(t.content)?(oM(e,""),e.appendChild(t.content)):typeof t.content!="function"&&(t.allowHTML?oM(e,t.content):e.textContent=t.content)}function aM(e){var t=e.firstElementChild,n=i$(t.children);return{box:t,content:n.find(function(r){return r.classList.contains(c4)}),arrow:n.find(function(r){return r.classList.contains(l4)||r.classList.contains(f4)}),backdrop:n.find(function(r){return r.classList.contains(sMe)})}}function M4(e){var t=Qh(),n=Qh();n.className=uMe,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Qh();r.className=c4,r.setAttribute("data-state","hidden"),R4(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props);function i(o,a){var u=aM(t),s=u.box,c=u.content,l=u.arrow;a.theme?s.setAttribute("data-theme",a.theme):s.removeAttribute("data-theme"),typeof a.animation=="string"?s.setAttribute("data-animation",a.animation):s.removeAttribute("data-animation"),a.inertia?s.setAttribute("data-inertia",""):s.removeAttribute("data-inertia"),s.style.maxWidth=typeof a.maxWidth=="number"?a.maxWidth+"px":a.maxWidth,a.role?s.setAttribute("role",a.role):s.removeAttribute("role"),(o.content!==a.content||o.allowHTML!==a.allowHTML)&&R4(c,e.props),a.arrow?l?o.arrow!==a.arrow&&(s.removeChild(l),s.appendChild(E4(a.arrow))):s.appendChild(E4(a.arrow)):l&&s.removeChild(l)}return{popper:t,onUpdate:i}}M4.$$tippy=!0;var kMe=1,o$=[],uM=[];function WMe(e,t){var n=O4(e,Object.assign({},Er,I4(v4(t)))),r,i,o,a=!1,u=!1,s=!1,c=!1,l,f,d,p=[],h=h4(Ju,n.interactiveDebounce),v,y=kMe++,b=null,w=dMe(n.plugins),F={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},g={id:y,reference:e,popper:Qh(),popperInstance:b,props:n,state:F,plugins:w,clearDelayTimeouts:Wa,setProps:Qr,setContent:Gu,show:ad,hide:W,hideWithInteractivity:M,enable:Aa,disable:ka,unmount:D,destroy:Me};if(!n.render)return process.env.NODE_ENV!=="production"&&iM(!0,"render() function has not been supplied."),g;var I=n.render(g),T=I.popper,k=I.onUpdate;T.setAttribute("data-tippy-root",""),T.id="tippy-"+g.id,g.popper=T,e._tippy=g,T._tippy=g;var E=w.map(function(N){return N.fn(g)}),H=e.hasAttribute("aria-expanded");return yo(),_(),z(),j("onCreate",[g]),n.showOnCreate&&Ni(),T.addEventListener("mouseenter",function(){g.props.interactive&&g.state.isVisible&&g.clearDelayTimeouts()}),T.addEventListener("mouseleave",function(){g.props.interactive&&g.props.trigger.indexOf("mouseenter")>=0&&R().addEventListener("mousemove",h)}),g;function q(){var N=g.props.touch;return Array.isArray(N)?N:[N,0]}function x(){return q()[0]==="hold"}function J(){var N;return!!((N=g.props.render)!=null&&N.$$tippy)}function O(){return v||e}function R(){var N=O().parentNode;return N?yMe(N):document}function C(){return aM(T)}function L(N){return g.state.isMounted&&!g.state.isVisible||mo.isTouch||l&&l.type==="focus"?0:eM(g.props.delay,N?0:1,Er.delay)}function z(N){N===void 0&&(N=!1),T.style.pointerEvents=g.props.interactive&&!N?"":"none",T.style.zIndex=""+g.props.zIndex}function j(N,ne,pe){if(pe===void 0&&(pe=!0),E.forEach(function(_e){_e[N]&&_e[N].apply(_e,ne)}),pe){var de;(de=g.props)[N].apply(de,ne)}}function S(){var N=g.props.aria;if(!!N.content){var ne="aria-"+N.content,pe=T.id,de=Zf(g.props.triggerTarget||e);de.forEach(function(_e){var it=_e.getAttribute(ne);if(g.state.isVisible)_e.setAttribute(ne,it?it+" "+pe:pe);else{var Nn=it&&it.replace(pe,"").trim();Nn?_e.setAttribute(ne,Nn):_e.removeAttribute(ne)}})}}function _(){if(!(H||!g.props.aria.expanded)){var N=Zf(g.props.triggerTarget||e);N.forEach(function(ne){g.props.interactive?ne.setAttribute("aria-expanded",g.state.isVisible&&ne===O()?"true":"false"):ne.removeAttribute("aria-expanded")})}}function U(){R().removeEventListener("mousemove",h),o$=o$.filter(function(N){return N!==h})}function Y(N){if(!(mo.isTouch&&(s||N.type==="mousedown"))){var ne=N.composedPath&&N.composedPath()[0]||N.target;if(!(g.props.interactive&&y4(T,ne))){if(Zf(g.props.triggerTarget||e).some(function(pe){return y4(pe,ne)})){if(mo.isTouch||g.state.isVisible&&g.props.trigger.indexOf("click")>=0)return}else j("onClickOutside",[g,N]);g.props.hideOnClick===!0&&(g.clearDelayTimeouts(),g.hide(),u=!0,setTimeout(function(){u=!1}),g.state.isMounted||Qe())}}}function ge(){s=!0}function he(){s=!1}function Te(){var N=R();N.addEventListener("mousedown",Y,!0),N.addEventListener("touchend",Y,Mc),N.addEventListener("touchstart",he,Mc),N.addEventListener("touchmove",ge,Mc)}function Qe(){var N=R();N.removeEventListener("mousedown",Y,!0),N.removeEventListener("touchend",Y,Mc),N.removeEventListener("touchstart",he,Mc),N.removeEventListener("touchmove",ge,Mc)}function Ft(N,ne){Yr(N,function(){!g.state.isVisible&&T.parentNode&&T.parentNode.contains(T)&&ne()})}function Jt(N,ne){Yr(N,ne)}function Yr(N,ne){var pe=C().box;function de(_e){_e.target===pe&&(rM(pe,"remove",de),ne())}if(N===0)return ne();rM(pe,"remove",f),rM(pe,"add",de),f=de}function Wn(N,ne,pe){pe===void 0&&(pe=!1);var de=Zf(g.props.triggerTarget||e);de.forEach(function(_e){_e.addEventListener(N,ne,pe),p.push({node:_e,eventType:N,handler:ne,options:pe})})}function yo(){x()&&(Wn("touchstart",xa,{passive:!0}),Wn("touchend",ki,{passive:!0})),fMe(g.props.trigger).forEach(function(N){if(N!=="manual")switch(Wn(N,xa),N){case"mouseenter":Wn("mouseleave",ki);break;case"focus":Wn(IMe?"focusout":"blur",Zr);break;case"focusin":Wn("focusout",Zr);break}})}function Ma(){p.forEach(function(N){var ne=N.node,pe=N.eventType,de=N.handler,_e=N.options;ne.removeEventListener(pe,de,_e)}),p=[]}function xa(N){var ne,pe=!1;if(!(!g.state.isEnabled||bo(N)||u)){var de=((ne=l)==null?void 0:ne.type)==="focus";l=N,v=N.currentTarget,_(),!g.state.isVisible&&mMe(N)&&o$.forEach(function(_e){return _e(N)}),N.type==="click"&&(g.props.trigger.indexOf("mouseenter")<0||a)&&g.props.hideOnClick!==!1&&g.state.isVisible?pe=!0:Ni(N),N.type==="click"&&(a=!pe),pe&&!de&&Pi(N)}}function Ju(N){var ne=N.target,pe=O().contains(ne)||T.contains(ne);if(!(N.type==="mousemove"&&pe)){var de=Xr().concat(T).map(function(_e){var it,Nn=_e._tippy,Mr=(it=Nn.popperInstance)==null?void 0:it.state;return Mr?{popperRect:_e.getBoundingClientRect(),popperState:Mr,props:n}:null}).filter(Boolean);bMe(de,N)&&(U(),Pi(N))}}function ki(N){var ne=bo(N)||g.props.trigger.indexOf("click")>=0&&a;if(!ne){if(g.props.interactive){g.hideWithInteractivity(N);return}Pi(N)}}function Zr(N){g.props.trigger.indexOf("focusin")<0&&N.target!==O()||g.props.interactive&&N.relatedTarget&&T.contains(N.relatedTarget)||Pi(N)}function bo(N){return mo.isTouch?x()!==N.type.indexOf("touch")>=0:!1}function Ca(){Wi();var N=g.props,ne=N.popperOptions,pe=N.placement,de=N.offset,_e=N.getReferenceClientRect,it=N.moveTransition,Nn=J()?aM(T).arrow:null,Mr=_e?{getBoundingClientRect:_e,contextElement:_e.contextElement||O()}:e,ud={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(cd){var Na=cd.state;if(J()){var WM=C(),ld=WM.box;["placement","reference-hidden","escaped"].forEach(function(Wc){Wc==="placement"?ld.setAttribute("data-placement",Na.placement):Na.attributes.popper["data-popper-"+Wc]?ld.setAttribute("data-"+Wc,""):ld.removeAttribute("data-"+Wc)}),Na.attributes.popper={}}}},Fi=[{name:"offset",options:{offset:de}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!it}},ud];J()&&Nn&&Fi.push({name:"arrow",options:{element:Nn,padding:3}}),Fi.push.apply(Fi,(ne==null?void 0:ne.modifiers)||[]),g.popperInstance=aMe(Mr,T,Object.assign({},ne,{placement:pe,onFirstUpdate:d,modifiers:Fi}))}function Wi(){g.popperInstance&&(g.popperInstance.destroy(),g.popperInstance=null)}function ir(){var N=g.props.appendTo,ne,pe=O();g.props.interactive&&N===d4||N==="parent"?ne=pe.parentNode:ne=p4(N,[pe]),ne.contains(T)||ne.appendChild(T),g.state.isMounted=!0,Ca(),process.env.NODE_ENV!=="production"&&Ta(g.props.interactive&&N===Er.appendTo&&pe.nextElementSibling!==T,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",`
133
133
 
134
134
  `,"Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.",`
135
135
 
136
136
  `,"Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.",`
137
137
 
138
- `,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function Xr(){return o$(T.querySelectorAll("[data-tippy-root]"))}function Ni(A){g.clearDelayTimeouts(),A&&j("onTrigger",[g,A]),Se();var ne=L(!0),pe=K(),de=pe[0],$e=pe[1];vo.isTouch&&de==="hold"&&$e&&(ne=$e),ne?r=setTimeout(function(){g.show()},ne):g.show()}function Pi(A){if(g.clearDelayTimeouts(),j("onUntrigger",[g,A]),!g.state.isVisible){Qe();return}if(!(g.props.trigger.indexOf("mouseenter")>=0&&g.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(A.type)>=0&&a)){var ne=L(!1);ne?i=setTimeout(function(){g.state.isVisible&&g.hide()},ne):o=requestAnimationFrame(function(){g.hide()})}}function ka(){g.state.isEnabled=!0}function Wa(){g.hide(),g.state.isEnabled=!1}function Na(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function Qr(A){if(process.env.NODE_ENV!=="production"&&Ia(g.state.isDestroyed,ed("setProps")),!g.state.isDestroyed){j("onBeforeUpdate",[g,A]),xa();var ne=g.props,pe=$4(e,Object.assign({},ne,f4(A),{ignoreAttributes:!0}));g.props=pe,bo(),ne.interactiveDebounce!==pe.interactiveDebounce&&(U(),h=c4(Yu,pe.interactiveDebounce)),ne.triggerTarget&&!pe.triggerTarget?Qf(ne.triggerTarget).forEach(function(de){de.removeAttribute("aria-expanded")}):pe.triggerTarget&&e.removeAttribute("aria-expanded"),_(),z(),k&&k(ne,pe),g.popperInstance&&(Aa(),Xr().forEach(function(de){requestAnimationFrame(de._tippy.popperInstance.forceUpdate)})),j("onAfterUpdate",[g,A])}}function Zu(A){g.setProps({content:A})}function sd(){process.env.NODE_ENV!=="production"&&Ia(g.state.isDestroyed,ed("show"));var A=g.state.isVisible,ne=g.state.isDestroyed,pe=!g.state.isEnabled,de=vo.isTouch&&!g.props.touch,$e=nM(g.props.duration,0,Er.duration);if(!(A||ne||pe||de)&&!O().hasAttribute("disabled")&&(j("onShow",[g],!1),g.props.onShow(g)!==!1)){if(g.state.isVisible=!0,X()&&(T.style.visibility="visible"),z(),Se(),g.state.isMounted||(T.style.transition="none"),X()){var it=W(),Nn=it.box,Mr=it.content;iM([Nn,Mr],0)}d=function(){var Fi;if(!(!g.state.isVisible||c)){if(c=!0,T.offsetHeight,T.style.transition=g.props.moveTransition,X()&&g.props.animation){var ld=W(),fd=ld.box,Pa=ld.content;iM([fd,Pa],$e),d4([fd,Pa],"visible")}S(),_(),l4(cM,g),(Fi=g.popperInstance)==null||Fi.forceUpdate(),j("onMount",[g]),g.props.animation&&X()&&Jt($e,function(){g.state.isShown=!0,j("onShown",[g])})}},ir()}}function C(){process.env.NODE_ENV!=="production"&&Ia(g.state.isDestroyed,ed("hide"));var A=!g.state.isVisible,ne=g.state.isDestroyed,pe=!g.state.isEnabled,de=nM(g.props.duration,1,Er.duration);if(!(A||ne||pe)&&(j("onHide",[g],!1),g.props.onHide(g)!==!1)){if(g.state.isVisible=!1,g.state.isShown=!1,c=!1,a=!1,X()&&(T.style.visibility="hidden"),U(),Qe(),z(!0),X()){var $e=W(),it=$e.box,Nn=$e.content;g.props.animation&&(iM([it,Nn],de),d4([it,Nn],"hidden"))}S(),_(),g.props.animation?X()&&Ft(de,g.unmount):g.unmount()}}function M(A){process.env.NODE_ENV!=="production"&&Ia(g.state.isDestroyed,ed("hideWithInteractivity")),R().addEventListener("mousemove",h),l4(a$,h),h(A)}function D(){process.env.NODE_ENV!=="production"&&Ia(g.state.isDestroyed,ed("unmount")),g.state.isVisible&&g.hide(),g.state.isMounted&&(Wi(),Xr().forEach(function(A){A._tippy.unmount()}),T.parentNode&&T.parentNode.removeChild(T),cM=cM.filter(function(A){return A!==g}),g.state.isMounted=!1,j("onHidden",[g]))}function Me(){process.env.NODE_ENV!=="production"&&Ia(g.state.isDestroyed,ed("destroy")),!g.state.isDestroyed&&(g.clearDelayTimeouts(),g.unmount(),xa(),delete e._tippy,g.state.isDestroyed=!0,j("onDestroy",[g]))}}function tm(e,t){t===void 0&&(t={});var n=Er.plugins.concat(t.plugins||[]);process.env.NODE_ENV!=="production"&&(vMe(e),_4(t,n)),fMe();var r=Object.assign({},t,{plugins:n}),i=aMe(e);if(process.env.NODE_ENV!=="production"){var o=Qh(r.content),a=i.length>1;Ia(o&&a,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.",`
138
+ `,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function Xr(){return i$(T.querySelectorAll("[data-tippy-root]"))}function Ni(N){g.clearDelayTimeouts(),N&&j("onTrigger",[g,N]),Te();var ne=L(!0),pe=q(),de=pe[0],_e=pe[1];mo.isTouch&&de==="hold"&&_e&&(ne=_e),ne?r=setTimeout(function(){g.show()},ne):g.show()}function Pi(N){if(g.clearDelayTimeouts(),j("onUntrigger",[g,N]),!g.state.isVisible){Qe();return}if(!(g.props.trigger.indexOf("mouseenter")>=0&&g.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(N.type)>=0&&a)){var ne=L(!1);ne?i=setTimeout(function(){g.state.isVisible&&g.hide()},ne):o=requestAnimationFrame(function(){g.hide()})}}function Aa(){g.state.isEnabled=!0}function ka(){g.hide(),g.state.isEnabled=!1}function Wa(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function Qr(N){if(process.env.NODE_ENV!=="production"&&Ta(g.state.isDestroyed,Xf("setProps")),!g.state.isDestroyed){j("onBeforeUpdate",[g,N]),Ma();var ne=g.props,pe=O4(e,Object.assign({},ne,v4(N),{ignoreAttributes:!0}));g.props=pe,yo(),ne.interactiveDebounce!==pe.interactiveDebounce&&(U(),h=h4(Ju,pe.interactiveDebounce)),ne.triggerTarget&&!pe.triggerTarget?Zf(ne.triggerTarget).forEach(function(de){de.removeAttribute("aria-expanded")}):pe.triggerTarget&&e.removeAttribute("aria-expanded"),_(),z(),k&&k(ne,pe),g.popperInstance&&(Ca(),Xr().forEach(function(de){requestAnimationFrame(de._tippy.popperInstance.forceUpdate)})),j("onAfterUpdate",[g,N])}}function Gu(N){g.setProps({content:N})}function ad(){process.env.NODE_ENV!=="production"&&Ta(g.state.isDestroyed,Xf("show"));var N=g.state.isVisible,ne=g.state.isDestroyed,pe=!g.state.isEnabled,de=mo.isTouch&&!g.props.touch,_e=eM(g.props.duration,0,Er.duration);if(!(N||ne||pe||de)&&!O().hasAttribute("disabled")&&(j("onShow",[g],!1),g.props.onShow(g)!==!1)){if(g.state.isVisible=!0,J()&&(T.style.visibility="visible"),z(),Te(),g.state.isMounted||(T.style.transition="none"),J()){var it=C(),Nn=it.box,Mr=it.content;nM([Nn,Mr],0)}d=function(){var Fi;if(!(!g.state.isVisible||c)){if(c=!0,T.offsetHeight,T.style.transition=g.props.moveTransition,J()&&g.props.animation){var sd=C(),cd=sd.box,Na=sd.content;nM([cd,Na],_e),g4([cd,Na],"visible")}S(),_(),m4(uM,g),(Fi=g.popperInstance)==null||Fi.forceUpdate(),j("onMount",[g]),g.props.animation&&J()&&Jt(_e,function(){g.state.isShown=!0,j("onShown",[g])})}},ir()}}function W(){process.env.NODE_ENV!=="production"&&Ta(g.state.isDestroyed,Xf("hide"));var N=!g.state.isVisible,ne=g.state.isDestroyed,pe=!g.state.isEnabled,de=eM(g.props.duration,1,Er.duration);if(!(N||ne||pe)&&(j("onHide",[g],!1),g.props.onHide(g)!==!1)){if(g.state.isVisible=!1,g.state.isShown=!1,c=!1,a=!1,J()&&(T.style.visibility="hidden"),U(),Qe(),z(!0),J()){var _e=C(),it=_e.box,Nn=_e.content;g.props.animation&&(nM([it,Nn],de),g4([it,Nn],"hidden"))}S(),_(),g.props.animation?J()&&Ft(de,g.unmount):g.unmount()}}function M(N){process.env.NODE_ENV!=="production"&&Ta(g.state.isDestroyed,Xf("hideWithInteractivity")),R().addEventListener("mousemove",h),m4(o$,h),h(N)}function D(){process.env.NODE_ENV!=="production"&&Ta(g.state.isDestroyed,Xf("unmount")),g.state.isVisible&&g.hide(),g.state.isMounted&&(Wi(),Xr().forEach(function(N){N._tippy.unmount()}),T.parentNode&&T.parentNode.removeChild(T),uM=uM.filter(function(N){return N!==g}),g.state.isMounted=!1,j("onHidden",[g]))}function Me(){process.env.NODE_ENV!=="production"&&Ta(g.state.isDestroyed,Xf("destroy")),!g.state.isDestroyed&&(g.clearDelayTimeouts(),g.unmount(),Ma(),delete e._tippy,g.state.isDestroyed=!0,j("onDestroy",[g]))}}function nm(e,t){t===void 0&&(t={});var n=Er.plugins.concat(t.plugins||[]);process.env.NODE_ENV!=="production"&&(EMe(e),w4(t,n)),SMe();var r=Object.assign({},t,{plugins:n}),i=gMe(e);if(process.env.NODE_ENV!=="production"){var o=em(r.content),a=i.length>1;Ta(o&&a,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.",`
139
139
 
140
140
  `,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",`
141
141
 
142
142
  `,`1) content: element.innerHTML
143
- `,"2) content: () => element.cloneNode(true)"].join(" "))}var u=i.reduce(function(s,c){var l=c&&TMe(c,r);return l&&s.push(l),s},[]);return Qh(e)?u[0]:u}tm.defaultProps=Er,tm.setDefaultProps=bMe,tm.currentInput=vo,Object.assign({},j3,{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)}}),tm.setDefaultProps({render:I4});class IMe{constructor({editor:t,element:n,view:r,tippyOptions:i={},shouldShow:o}){this.preventHide=!1,this.shouldShow=({view:a,state:u,from:s,to:c})=>{const{doc:l,selection:f}=u,{empty:d}=f,p=!l.textBetween(s,c).length&&I3(u.selection),h=this.element.contains(document.activeElement);return!(!(a.hasFocus()||h)||d||p||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:a})=>{var u;if(this.preventHide){this.preventHide=!1;return}(a==null?void 0:a.relatedTarget)&&((u=this.element.parentNode)===null||u===void 0?void 0:u.contains(a.relatedTarget))||this.hide()},this.editor=t,this.element=n,this.view=r,o&&(this.shouldShow=o),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:t}=this.editor.options,n=!!t.parentElement;this.tippy||!n||(this.tippy=tm(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",r=>{this.blurHandler({event:r})}))}update(t,n){var r,i,o;const{state:a,composing:u}=t,{doc:s,selection:c}=a,l=n&&n.doc.eq(s)&&n.selection.eq(c);if(u||l)return;this.createTooltip();const{ranges:f}=c,d=Math.min(...f.map(v=>v.$from.pos)),p=Math.max(...f.map(v=>v.$to.pos));if(!((r=this.shouldShow)===null||r===void 0?void 0:r.call(this,{editor:this.editor,view:t,state:a,oldState:n,from:d,to:p}))){this.hide();return}(i=this.tippy)===null||i===void 0||i.setProps({getReferenceClientRect:((o=this.tippyOptions)===null||o===void 0?void 0:o.getReferenceClientRect)||(()=>{if(DEe(a.selection)){const v=t.nodeDOM(d);if(v)return v.getBoundingClientRect()}return LEe(t,d,p)})}),this.show()}show(){var t;(t=this.tippy)===null||t===void 0||t.show()}hide(){var t;(t=this.tippy)===null||t===void 0||t.hide()}destroy(){var t;(t=this.tippy)===null||t===void 0||t.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const O4=e=>new Kr({key:typeof e.pluginKey=="string"?new xu(e.pluginKey):e.pluginKey,view:t=>new IMe({view:t,...e})});Ir.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[O4({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});const OMe=e=>{const[t,n]=ue.useState(null);return ue.useEffect(()=>{if(!t||e.editor.isDestroyed)return;const{pluginKey:r="bubbleMenu",editor:i,tippyOptions:o={},shouldShow:a=null}=e,u=O4({pluginKey:r,editor:i,element:t,tippyOptions:o,shouldShow:a});return i.registerPlugin(u),()=>i.unregisterPlugin(r)},[e.editor,t]),N("div",{ref:n,className:e.className,style:{visibility:"hidden"},children:e.children})};class wMe extends PEe{constructor(){super(...arguments),this.contentComponent=null}}const EMe=({renderers:e})=>N(wf,{children:Array.from(e).map(([t,n])=>M5.default.createPortal(n.reactElement,n.element,t))});class RMe extends Pc.default.Component{constructor(t){super(t),this.editorContentRef=Pc.default.createRef(),this.state={renderers:new Map}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const{editor:t}=this.props;if(t&&t.options.element){if(t.contentComponent)return;const n=this.editorContentRef.current;n.append(...t.options.element.childNodes),t.setOptions({element:n}),t.contentComponent=this,t.createNodeViews()}}componentWillUnmount(){const{editor:t}=this.props;if(!t||(t.isDestroyed||t.view.setProps({nodeViews:{}}),t.contentComponent=null,!t.options.element.firstChild))return;const n=document.createElement("div");n.append(...t.options.element.childNodes),t.setOptions({element:n})}render(){const{editor:t,...n}=this.props;return He(wf,{children:[N("div",{ref:this.editorContentRef,...n}),N(EMe,{renderers:this.state.renderers})]})}}const MMe=Pc.default.memo(RMe),w4=ue.createContext({onDragStart:void 0}),xMe=()=>ue.useContext(w4),CMe=Pc.default.forwardRef((e,t)=>{const{onDragStart:n}=xMe(),r=e.as||"div";return N(r,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})});function AMe(e){return!!(typeof e=="function"&&e.prototype&&e.prototype.isReactComponent)}function kMe(e){var t;return typeof e=="object"&&((t=e.$$typeof)===null||t===void 0?void 0:t.toString())==="Symbol(react.forward_ref)"}class E4{constructor(t,{editor:n,props:r={},as:i="div",className:o=""}){this.ref=null,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=t,this.editor=n,this.props=r,this.element=document.createElement(i),this.element.classList.add("react-renderer"),o&&this.element.classList.add(...o.split(" ")),this.render()}render(){const t=this.component,n=this.props;(AMe(t)||kMe(t))&&(n.ref=r=>{this.ref=r}),this.reactElement=N(t,{...n}),um.flushSync(()=>{var r;!((r=this.editor)===null||r===void 0)&&r.contentComponent&&this.editor.contentComponent.setState({renderers:this.editor.contentComponent.state.renderers.set(this.id,this)})})}updateProps(t={}){this.props={...this.props,...t},this.render()}destroy(){um.flushSync(()=>{var t;if(!((t=this.editor)===null||t===void 0)&&t.contentComponent){const{renderers:n}=this.editor.contentComponent.state;n.delete(this.id),this.editor.contentComponent.setState({renderers:n})}})}}class WMe extends jEe{mount(){const t={editor:this.editor,node:this.node,decorations:this.decorations,selected:!1,extension:this.extension,getPos:()=>this.getPos(),updateAttributes:(o={})=>this.updateAttributes(o),deleteNode:()=>this.deleteNode()};if(!this.component.displayName){const o=a=>a.charAt(0).toUpperCase()+a.substring(1);this.component.displayName=o(this.extension.name)}const n=o=>{const a=this.component,u=this.onDragStart.bind(this),s=c=>{c&&this.contentDOMElement&&c.firstChild!==this.contentDOMElement&&c.appendChild(this.contentDOMElement)};return N(w4.Provider,{value:{onDragStart:u,nodeViewContentRef:s},children:N(a,{...o})})};n.displayName="ReactNodeView",this.contentDOMElement=this.node.isLeaf?null:document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement&&(this.contentDOMElement.style.whiteSpace="inherit");let r=this.node.isInline?"span":"div";this.options.as&&(r=this.options.as);const{className:i=""}=this.options;this.renderer=new E4(n,{editor:this.editor,props:t,as:r,className:`node-${this.node.type.name} ${i}`.trim()})}get dom(){var t;if(this.renderer.element.firstElementChild&&!(!((t=this.renderer.element.firstElementChild)===null||t===void 0)&&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){const r=i=>{this.renderer.updateProps(i)};if(t.type!==this.node.type)return!1;if(typeof this.options.update=="function"){const 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 NMe(e,t){return n=>n.editor.contentComponent?new WMe(e,n,t):{}}function PMe(){const[,e]=ue.useState(0);return()=>e(t=>t+1)}const FMe=(e={},t=[])=>{const[n,r]=ue.useState(null),i=PMe();return ue.useEffect(()=>{let o=!0;const a=new wMe(e);return r(a),a.on("transaction",()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{o&&i()})})}),()=>{a.destroy(),o=!1}},t),n},DMe=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,LMe=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,jMe=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,UMe=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,BMe=Jf.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>e.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return["strong",dn(this.options.HTMLAttributes,e),0]},addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Xb({find:DMe,type:this.type}),Xb({find:jMe,type:this.type})]},addPasteRules(){return[Qb({find:LMe,type:this.type}),Qb({find:UMe,type:this.type})]}});var zMe=Object.defineProperty,qMe=(e,t,n)=>t in e?zMe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,td=(e,t,n)=>(qMe(e,typeof t!="symbol"?t+"":t,n),n),lM=(e=>(e.Document="document",e.Mark="mark",e.Node="node",e))(lM||{}),nd=(e=>(e.Text="text",e.Embed="embed",e.Image="image",e))(nd||{});class KMe{constructor(t,n,r){this.name=t,this.component=n,this.converter=r,td(this,"extType","document")}}class R4{constructor(t,n,r,i){this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i,td(this,"extType","mark")}}class rd{constructor(t,n,r,i,o,a=!1){this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i,this.placeholder=o,this.lockedFormat=a,td(this,"extType","node"),td(this,"nodeType","text")}}class VMe{constructor(t,n,r,i){this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i,td(this,"extType","node"),td(this,"nodeType","embed")}}class HMe extends rd{constructor(t,n,r,i,o){super(t,"heading",n,i,o),this.levels=r}}class fM extends rd{constructor(t,n,r,i){super(t,n,r,i)}}const dM=BMe.extend({name:"bold"}),JMe={fromPrismic(e){return function(){var t;return(t=e.marks[dM.name])==null?void 0:t.create()}},toPrismic(){}},M4=new R4([xe.RichTextNodeType.strong],dM.name,dM,JMe),GMe=/^\s*([-+*])\s$/,YMe=Or.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:e}){return["ul",dn(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleBulletList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){return[P3({find:GMe,type:this.type})]}}),x4=Or.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:e}){return["br",dn(this.options.HTMLAttributes,e)]},renderText(){return`
144
- `},addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{selection:i,storedMarks:o}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:a}=this.options,{splittableMarks:u}=r.extensionManager,s=o||i.$to.parentOffset&&i.$from.marks();return t().insertContent({type:this.name}).command(({tr:c,dispatch:l})=>{if(l&&s&&a){const f=s.filter(d=>u.includes(d.type.name));c.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Cc={isHardBreak(e){return e.type.name===x4.name},children:{reduce(e,t,n){let r=n;return e.forEach((i,o,a)=>{r=t(r,i,a)}),r},map(e,t){return this.reduce(e,(n,r)=>[...n,t(r)],[])},exists(e,t){return this.reduce(e,(n,r)=>n||t(r),!1)},filter(e,t){return this.reduce(e,(n,r)=>[...n,...t(r)?[r]:[]],[])}},marks:{reduce(e,t,n){let r=n;return e.marks.forEach((i,o)=>{r=t(r,i,o)}),r},map(e,t){return this.reduce(e,(n,r)=>[...n,t(r)],[])},filter(e,t){return this.reduce(e,(n,r)=>[...n,...t(r)?[r]:[]],[])}}};function ZMe(e){if(!e||!e.size)return{defaultTextConverter:void 0,extensions:b5()};const t=b5(e),n=Array.from(e.values()),r=(()=>{const a=li(c=>n.some(l=>c.richTextNodeTypes.includes(l)))(t),u=a.some(c=>c instanceof fM)?[Gu,...a]:a;return u.some(c=>c instanceof rd)?u:[y5,...u]})(),i=r.find(a=>a instanceof rd)||y5;function o(a){return u=>i.converter.fromPrismic(a)({...u,type:i.richTextNodeTypes[0]})}return{defaultTextConverter:o,extensions:r}}function XMe(e){if(!(e!=null&&e.single)&&!(e!=null&&e.multi))return;const t=m((e.single||e.multi||"").split(/\s*,\s*/),cv(n=>t_(()=>{})(Jy.RichTextNodeTypeCodec.decode(n))),li(ga));return new Set(t)}function QMe(e){const t=XMe(e);return ZMe(t)}const exe=Or.create({name:"doc",topNode:!0,content:"block+"}),C4=Or.create({name:"listItem",addOptions(){return{HTMLAttributes:{}}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",dn(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}).extend({name:"listItem",content:"paragraph*",addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name)}}}),id={component:C4,converter:{fromPrismic(e){return function(t){var r;const n=Gu.converter.fromPrismic(e)(t);if(!!n)return(r=e.nodes[C4.name])==null?void 0:r.create({},n)}},toPrismic(e,t){return Cc.children.reduce(e,(n,r)=>{const i=Gu.converter.toPrismic(r),o=(()=>i instanceof Array?i.map(a=>({...a,type:t})):i?[{...i,type:t}]:[])();return[...n,...o]},[])}},placeholder:"List"};function txe(e){return e.slice(1,e.length).reduce((t,n)=>t.copy(t.content.append(n.content)),e[0])}const pM="document",nxe=e=>exe.extend({name:pM,content:e?"block+":"block"}),rxe=e=>({fromPrismic(t,n){function r(i){return function(o=void 0){return!o&&n&&Qs.TextBlock.is(i)?n(i):o}}return function(i){var a;const o=i.value.reduce((u,s)=>{const c=e.find(h=>h.richTextNodeTypes.includes(s.type)),l=(()=>{if(!!c)switch(c.nodeType){case nd.Embed:return Qs.EmbedBlock.is(s)&&c.converter.fromPrismic(t)(s);case nd.Text:return Qs.TextBlock.is(s)&&c.converter.fromPrismic(t)(s);case nd.Image:return Qs.ImageBlock.is(s)&&c.converter.fromPrismic(t)(s);default:return}})(),[f,d]=m(u,wS(u.length-1),([h,v])=>[h,IS(v)]),p=(()=>l?m(d,Ki(()=>({merged:!1,node:l}),h=>l.type.name===h.type.name&&(l.type.name===T$.name||l.type.name===w$.name)?{merged:!0,node:txe([h,l])}:{merged:!1,node:l}),({merged:h,node:v})=>({merged:h,node:r(s)(v)})):{merged:!1,node:r(s)()})();return p.node?[...p.merged?f:u,p.node]:u},[]);return(a=t.nodes[pM])==null?void 0:a.create({},o)}},toPrismic(t){const n=Cc.children.reduce(t,(r,i)=>{const o=Object.values(e).find(u=>i.type.name===u.name),a=o==null?void 0:o.converter.toPrismic(i);return a||console.warn(`Cannot convert node of type '${i.type.name}'.`),a?[...r,...a instanceof Array?a:[a]]:r},[]);return{__TYPE__:da.NestableTypes.StructuredText,value:[...n]}}}),hM=new KMe(pM,nxe,rxe),u$=x4.extend({name:"hard_break"}),s$=`
145
- `,A4={fromPrismic(e){return function(t){var n;if(t===s$)return(n=e.nodes[u$.name])==null?void 0:n.create({})}},toPrismic(e){if(e.type.name===u$.name)return s$}},mM={isEmptyLine(e){return e.length===0},isFirst(e){return e===0}};function ixe(e,t){return function(n){const r=A4.fromPrismic(e)(s$);if(!r)return[n(t)];const i=t.split(s$);return i.length===1?t.length?[n(t)]:[r]:i.reduce((o,a,u)=>mM.isFirst(u)?mM.isEmptyLine(a)?o:[...o,n(a)]:mM.isEmptyLine(a)?[...o,r]:[...o,r,n(a)],[])}}const c$={name:u$.name,component:u$,converter:A4,splitTextToNodes:ixe},oxe=Ir.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something \u2026",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new Kr({props:{decorations:({doc:e,selection:t})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=t,i=[];return n?(e.descendants((o,a)=>{const u=r>=a&&r<=a+o.nodeSize,s=!o.isLeaf&&!o.childCount;if((u||!this.options.showOnlyCurrent)&&s){const c=[this.options.emptyNodeClass];this.editor.isEmpty&&c.push(this.options.emptyEditorClass);const l=Sr.node(a,a+o.nodeSize,{class:c.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:o,pos:a,hasAnchor:u}):this.options.placeholder});i.push(l)}return this.options.includeChildren}),Vt.create(e,i)):null}}})]}}),axe=e=>oxe.configure({includeChildren:!0,placeholder:({editor:t,hasAnchor:n,node:r})=>{const i=!Cc.children.exists(t.state.doc,u=>u===r),o=(()=>{const u=t.isEditable,s=t.isFocused&&n,c=r.type.name!==Gu.name;return u&&(s||c||i)})(),a=(()=>{if(i)return id.placeholder;const u=e[r.type.name];return typeof u=="string"?u:u==null?void 0:u(r.attrs)})();return o&&a||""},showOnlyCurrent:!1,showOnlyWhenEditable:!1});function od(e){return e.split("-")[0]}function vM(e){return e.split("-")[1]}function nm(e){return["top","bottom"].includes(od(e))?"x":"y"}function k4(e){return e==="y"?"height":"width"}function W4(e,t,n){let{reference:r,floating:i}=e;const o=r.x+r.width/2-i.width/2,a=r.y+r.height/2-i.height/2,u=nm(t),s=k4(u),c=r[s]/2-i[s]/2,l=od(t),f=u==="x";let d;switch(l){case"top":d={x:o,y:r.y-i.height};break;case"bottom":d={x:o,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:a};break;case"left":d={x:r.x-i.width,y:a};break;default:d={x:r.x,y:r.y}}switch(vM(t)){case"start":d[u]-=c*(n&&f?-1:1);break;case"end":d[u]+=c*(n&&f?-1:1);break}return d}const uxe=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,u=await(a.isRTL==null?void 0:a.isRTL(t));if(process.env.NODE_ENV!=="production"&&(a==null&&console.error(["Floating UI: `platform` property was not passed to config. If you","want to use Floating UI on the web, install @floating-ui/dom","instead of the /core package. Otherwise, you can create your own","`platform`: https://floating-ui.com/docs/platform"].join(" ")),o.filter(h=>{let{name:v}=h;return v==="autoPlacement"||v==="flip"}).length>1))throw new Error(["Floating UI: duplicate `flip` and/or `autoPlacement`","middleware detected. This will lead to an infinite loop. Ensure only","one of either has been passed to the `middleware` array."].join(" "));let s=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:l}=W4(s,r,u),f=r,d={},p=0;for(let h=0;h<o.length;h++){const{name:v,fn:y}=o[h],{x:b,y:w,data:F,reset:g}=await y({x:c,y:l,initialPlacement:r,placement:f,strategy:i,middlewareData:d,rects:s,platform:a,elements:{reference:e,floating:t}});if(c=b!=null?b:c,l=w!=null?w:l,d={...d,[v]:{...d[v],...F}},process.env.NODE_ENV!=="production"&&p>50&&console.warn(["Floating UI: The middleware lifecycle appears to be running in an","infinite loop. This is usually caused by a `reset` continually","being returned without a break condition."].join(" ")),g&&p<=50){p++,typeof g=="object"&&(g.placement&&(f=g.placement),g.rects&&(s=g.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):g.rects),{x:c,y:l}=W4(s,f,u)),h=-1;continue}}return{x:c,y:l,placement:f,strategy:i,middlewareData:d}};function sxe(e){return{top:0,right:0,bottom:0,left:0,...e}}function cxe(e){return typeof e!="number"?sxe(e):{top:e,right:e,bottom:e,left:e}}function l$(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function N4(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:a,elements:u,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:l="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=t,h=cxe(p),y=u[d?f==="floating"?"reference":"floating":f],b=l$(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(y)))==null||n?y:y.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(u.floating)),boundary:c,rootBoundary:l,strategy:s})),w=l$(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:f==="floating"?{...a.floating,x:r,y:i}:a.reference,offsetParent:await(o.getOffsetParent==null?void 0:o.getOffsetParent(u.floating)),strategy:s}):a[f]);return{top:b.top-w.top+h.top,bottom:w.bottom-b.bottom+h.bottom,left:b.left-w.left+h.left,right:w.right-b.right+h.right}}const lxe=Math.min,fxe=Math.max;function P4(e,t,n){return fxe(e,lxe(t,n))}const dxe={left:"right",right:"left",bottom:"top",top:"bottom"};function f$(e){return e.replace(/left|right|bottom|top/g,t=>dxe[t])}function pxe(e,t,n){n===void 0&&(n=!1);const r=vM(e),i=nm(e),o=k4(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=f$(a)),{main:a,cross:f$(a)}}const hxe={start:"end",end:"start"};function F4(e){return e.replace(/start|end/g,t=>hxe[t])}function mxe(e){const t=f$(e);return[F4(e),t,F4(t)]}const vxe=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:i,rects:o,initialPlacement:a,platform:u,elements:s}=t,{mainAxis:c=!0,crossAxis:l=!0,fallbackPlacements:f,fallbackStrategy:d="bestFit",flipAlignment:p=!0,...h}=e,v=od(r),b=f||(v===a||!p?[f$(a)]:mxe(a)),w=[a,...b],F=await N4(t,h),g=[];let I=((n=i.flip)==null?void 0:n.overflows)||[];if(c&&g.push(F[v]),l){const{main:Y,cross:K}=pxe(r,o,await(u.isRTL==null?void 0:u.isRTL(s.floating)));g.push(F[Y],F[K])}if(I=[...I,{placement:r,overflows:g}],!g.every(Y=>Y<=0)){var T,k;const Y=((T=(k=i.flip)==null?void 0:k.index)!=null?T:0)+1,K=w[Y];if(K)return{data:{index:Y,overflows:I},reset:{placement:K}};let x="bottom";switch(d){case"bestFit":{var E;const X=(E=I.map(O=>[O,O.overflows.filter(R=>R>0).reduce((R,W)=>R+W,0)]).sort((O,R)=>O[1]-R[1])[0])==null?void 0:E[0].placement;X&&(x=X);break}case"initialPlacement":x=a;break}if(r!==x)return{reset:{placement:x}}}return{}}}};async function gxe(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=od(n),u=vM(n),s=nm(n)==="x",c=["left","top"].includes(a)?-1:1,l=o&&s?-1:1,f=typeof t=="function"?t(e):t;let{mainAxis:d,crossAxis:p,alignmentAxis:h}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return u&&typeof h=="number"&&(p=u==="end"?h*-1:h),s?{x:p*l,y:d*c}:{x:d*c,y:p*l}}const yxe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,i=await gxe(t,e);return{x:n+i.x,y:r+i.y,data:i}}}};function D4(e){return e==="x"?"y":"x"}const bxe=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:u={fn:y=>{let{x:b,y:w}=y;return{x:b,y:w}}},...s}=e,c={x:n,y:r},l=await N4(t,s),f=nm(od(i)),d=D4(f);let p=c[f],h=c[d];if(o){const y=f==="y"?"top":"left",b=f==="y"?"bottom":"right",w=p+l[y],F=p-l[b];p=P4(w,p,F)}if(a){const y=d==="y"?"top":"left",b=d==="y"?"bottom":"right",w=h+l[y],F=h-l[b];h=P4(w,h,F)}const v=u.fn({...t,[f]:p,[d]:h});return{...v,data:{x:v.x-n,y:v.y-r}}}}},$xe=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:u=0,mainAxis:s=!0,crossAxis:c=!0}=e,l={x:n,y:r},f=nm(i),d=D4(f);let p=l[f],h=l[d];const v=typeof u=="function"?u(t):u,y=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(s){const I=f==="y"?"height":"width",T=o.reference[f]-o.floating[I]+y.mainAxis,k=o.reference[f]+o.reference[I]-y.mainAxis;p<T?p=T:p>k&&(p=k)}if(c){var b,w,F,g;const I=f==="y"?"width":"height",T=["top","left"].includes(od(i)),k=o.reference[d]-o.floating[I]+(T&&(b=(w=a.offset)==null?void 0:w[d])!=null?b:0)+(T?0:y.crossAxis),E=o.reference[d]+o.reference[I]+(T?0:(F=(g=a.offset)==null?void 0:g[d])!=null?F:0)-(T?y.crossAxis:0);h<k?h=k:h>E&&(h=E)}return{[f]:p,[d]:h}}}};function L4(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function Oa(e){if(e==null)return window;if(!L4(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function qu(e){return Oa(e).getComputedStyle(e)}function wa(e){return L4(e)?"":e?(e.nodeName||"").toLowerCase():""}function j4(){const e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(t=>t.brand+"/"+t.version).join(" "):navigator.userAgent}function go(e){return e instanceof Oa(e).HTMLElement}function Ku(e){return e instanceof Oa(e).Element}function _xe(e){return e instanceof Oa(e).Node}function d$(e){if(typeof ShadowRoot>"u")return!1;const t=Oa(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function p$(e){const{overflow:t,overflowX:n,overflowY:r}=qu(e);return/auto|scroll|overlay|hidden/.test(t+r+n)}function Sxe(e){return["table","td","th"].includes(wa(e))}function U4(e){const t=/firefox/i.test(j4()),n=qu(e);return n.transform!=="none"||n.perspective!=="none"||n.contain==="paint"||["transform","perspective"].includes(n.willChange)||t&&n.willChange==="filter"||t&&(n.filter?n.filter!=="none":!1)}function B4(){return!/^((?!chrome|android).)*safari/i.test(j4())}const z4=Math.min,rm=Math.max,h$=Math.round;function Ea(e,t,n){var r,i,o,a;t===void 0&&(t=!1),n===void 0&&(n=!1);const u=e.getBoundingClientRect();let s=1,c=1;t&&go(e)&&(s=e.offsetWidth>0&&h$(u.width)/e.offsetWidth||1,c=e.offsetHeight>0&&h$(u.height)/e.offsetHeight||1);const l=Ku(e)?Oa(e):window,f=!B4()&&n,d=(u.left+(f&&(r=(i=l.visualViewport)==null?void 0:i.offsetLeft)!=null?r:0))/s,p=(u.top+(f&&(o=(a=l.visualViewport)==null?void 0:a.offsetTop)!=null?o:0))/c,h=u.width/s,v=u.height/c;return{width:h,height:v,top:p,right:d+h,bottom:p+v,left:d,x:d,y:p}}function Vu(e){return((_xe(e)?e.ownerDocument:e.document)||window.document).documentElement}function m$(e){return Ku(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function q4(e){return Ea(Vu(e)).left+m$(e).scrollLeft}function Txe(e){const t=Ea(e);return h$(t.width)!==e.offsetWidth||h$(t.height)!==e.offsetHeight}function Ixe(e,t,n){const r=go(t),i=Vu(t),o=Ea(e,r&&Txe(t),n==="fixed");let a={scrollLeft:0,scrollTop:0};const u={x:0,y:0};if(r||!r&&n!=="fixed")if((wa(t)!=="body"||p$(i))&&(a=m$(t)),go(t)){const s=Ea(t,!0);u.x=s.x+t.clientLeft,u.y=s.y+t.clientTop}else i&&(u.x=q4(i));return{x:o.left+a.scrollLeft-u.x,y:o.top+a.scrollTop-u.y,width:o.width,height:o.height}}function K4(e){return wa(e)==="html"?e:e.assignedSlot||e.parentNode||(d$(e)?e.host:null)||Vu(e)}function V4(e){return!go(e)||qu(e).position==="fixed"?null:e.offsetParent}function Oxe(e){let t=K4(e);for(d$(t)&&(t=t.host);go(t)&&!["html","body"].includes(wa(t));){if(U4(t))return t;{const n=t.parentNode;t=d$(n)?n.host:n}}return null}function gM(e){const t=Oa(e);let n=V4(e);for(;n&&Sxe(n)&&qu(n).position==="static";)n=V4(n);return n&&(wa(n)==="html"||wa(n)==="body"&&qu(n).position==="static"&&!U4(n))?t:n||Oxe(e)||t}function H4(e){if(go(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=Ea(e);return{width:t.width,height:t.height}}function wxe(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=go(n),o=Vu(n);if(n===o)return t;let a={scrollLeft:0,scrollTop:0};const u={x:0,y:0};if((i||!i&&r!=="fixed")&&((wa(n)!=="body"||p$(o))&&(a=m$(n)),go(n))){const s=Ea(n,!0);u.x=s.x+n.clientLeft,u.y=s.y+n.clientTop}return{...t,x:t.x-a.scrollLeft+u.x,y:t.y-a.scrollTop+u.y}}function Exe(e,t){const n=Oa(e),r=Vu(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,u=0,s=0;if(i){o=i.width,a=i.height;const c=B4();(c||!c&&t==="fixed")&&(u=i.offsetLeft,s=i.offsetTop)}return{width:o,height:a,x:u,y:s}}function Rxe(e){var t;const n=Vu(e),r=m$(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=rm(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=rm(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0);let u=-r.scrollLeft+q4(e);const s=-r.scrollTop;return qu(i||n).direction==="rtl"&&(u+=rm(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:u,y:s}}function J4(e){const t=K4(e);return["html","body","#document"].includes(wa(t))?e.ownerDocument.body:go(t)&&p$(t)?t:J4(t)}function ad(e,t){var n;t===void 0&&(t=[]);const r=J4(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=Oa(r),a=i?[o].concat(o.visualViewport||[],p$(r)?r:[]):r,u=t.concat(a);return i?u:u.concat(ad(a))}function Mxe(e,t){const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&d$(n)){let r=t;do{if(r&&e===r)return!0;r=r.parentNode||r.host}while(r)}return!1}function xxe(e,t){const n=Ea(e,!1,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft;return{top:r,left:i,x:i,y:r,right:i+e.clientWidth,bottom:r+e.clientHeight,width:e.clientWidth,height:e.clientHeight}}function G4(e,t,n){return t==="viewport"?l$(Exe(e,n)):Ku(t)?xxe(t,n):l$(Rxe(Vu(e)))}function Cxe(e){const t=ad(e),r=["absolute","fixed"].includes(qu(e).position)&&go(e)?gM(e):e;return Ku(r)?t.filter(i=>Ku(i)&&Mxe(i,r)&&wa(i)!=="body"):[]}function Axe(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?Cxe(t):[].concat(n),r],u=a[0],s=a.reduce((c,l)=>{const f=G4(t,l,i);return c.top=rm(f.top,c.top),c.right=z4(f.right,c.right),c.bottom=z4(f.bottom,c.bottom),c.left=rm(f.left,c.left),c},G4(t,u,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}const kxe={getClippingRect:Axe,convertOffsetParentRelativeRectToViewportRelativeRect:wxe,isElement:Ku,getDimensions:H4,getOffsetParent:gM,getDocumentElement:Vu,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:Ixe(t,gM(n),r),floating:{...H4(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>qu(e).direction==="rtl"};function Wxe(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=!0,animationFrame:u=!1}=r,s=i&&!u,c=o&&!u,l=s||c?[...Ku(e)?ad(e):[],...ad(t)]:[];l.forEach(v=>{s&&v.addEventListener("scroll",n,{passive:!0}),c&&v.addEventListener("resize",n)});let f=null;if(a){let v=!0;f=new ResizeObserver(()=>{v||n(),v=!1}),Ku(e)&&!u&&f.observe(e),f.observe(t)}let d,p=u?Ea(e):null;u&&h();function h(){const v=Ea(e);p&&(v.x!==p.x||v.y!==p.y||v.width!==p.width||v.height!==p.height)&&n(),p=v,d=requestAnimationFrame(h)}return n(),()=>{var v;l.forEach(y=>{s&&y.removeEventListener("scroll",n),c&&y.removeEventListener("resize",n)}),(v=f)==null||v.disconnect(),f=null,u&&cancelAnimationFrame(d)}}const Nxe=(e,t,n)=>uxe(e,t,{platform:kxe,...n});var yM=typeof document<"u"?ue.useLayoutEffect:ue.useEffect;function v$(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!v$(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!v$(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Pxe(e){const t=Te.useRef(e);return yM(()=>{t.current=e}),t}function Fxe(e){let{middleware:t,placement:n="bottom",strategy:r="absolute",whileElementsMounted:i}=e===void 0?{}:e;const[o,a]=Te.useState({x:null,y:null,strategy:r,placement:n,middlewareData:{}}),[u,s]=Te.useState(t);v$(u==null?void 0:u.map(g=>{let{name:I,options:T}=g;return{name:I,options:T}}),t==null?void 0:t.map(g=>{let{name:I,options:T}=g;return{name:I,options:T}}))||s(t);const c=Te.useRef(null),l=Te.useRef(null),f=Te.useRef(null),d=Te.useRef(o),p=Pxe(i),h=Te.useCallback(()=>{!c.current||!l.current||Nxe(c.current,l.current,{middleware:u,placement:n,strategy:r}).then(g=>{v.current&&!v$(d.current,g)&&(d.current=g,x5.flushSync(()=>{a(g)}))})},[u,n,r]);yM(()=>{v.current&&h()},[h]);const v=Te.useRef(!1);yM(()=>(v.current=!0,()=>{v.current=!1}),[]);const y=Te.useCallback(()=>{if(typeof f.current=="function"&&(f.current(),f.current=null),c.current&&l.current)if(p.current){const g=p.current(c.current,l.current,h);f.current=g}else h()},[h,p]),b=Te.useCallback(g=>{c.current=g,y()},[y]),w=Te.useCallback(g=>{l.current=g,y()},[y]),F=Te.useMemo(()=>({reference:c,floating:l}),[]);return Te.useMemo(()=>({...o,update:h,refs:F,reference:b,floating:w}),[o,h,F,b,w])}var Hu=typeof document<"u"?ue.useLayoutEffect:ue.useEffect;function Dxe(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(i=>i(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){e.set(t,(e.get(t)||[]).filter(r=>r!==n))}}}let bM=!1,Lxe=0;const Y4=()=>"floating-ui-"+Lxe++;function jxe(){const[e,t]=Te.useState(()=>bM?Y4():void 0);return Hu(()=>{e==null&&t(Y4())},[]),Te.useEffect(()=>{bM||(bM=!0)},[]),e}const Z4=Te["useId".toString()],X4=Z4!=null?Z4:jxe,Uxe=Te.createContext(null),Bxe=Te.createContext(null),Q4=()=>{var e,t;return(e=(t=Te.useContext(Uxe))==null?void 0:t.id)!=null?e:null},$M=()=>Te.useContext(Bxe);function _M(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function e5(e){var t;return(t=_M(e).defaultView)!=null?t:window}function g$(e){return e?e instanceof e5(e).Element:!1}function zxe(e){return e?e instanceof e5(e).HTMLElement:!1}const t5=Te["useInsertionEffect".toString()];function SM(e){const t=Te.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return t5?t5(()=>{t.current=e}):t.current=e,Te.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}function qxe(e){let{open:t=!1,onOpenChange:n,whileElementsMounted:r,placement:i,middleware:o,strategy:a,nodeId:u}=e===void 0?{}:e;const[s,c]=Te.useState(null),l=$M(),f=Te.useRef(null),d=Te.useRef({}),p=Te.useState(()=>Dxe())[0],h=Fxe({placement:i,middleware:o,strategy:a,whileElementsMounted:r}),v=SM(n),y=Te.useMemo(()=>({...h.refs,domReference:f}),[h.refs]),b=Te.useMemo(()=>({...h,refs:y,dataRef:d,nodeId:u,events:p,open:t,onOpenChange:v,_:{domReference:s}}),[h,u,p,t,v,y,s]);Hu(()=>{const g=l==null?void 0:l.nodesRef.current.find(I=>I.id===u);g&&(g.context=b)});const{reference:w}=h,F=Te.useCallback(g=>{(g$(g)||g===null)&&(b.refs.domReference.current=g,c(g)),w(g)},[w,b.refs]);return Te.useMemo(()=>({...h,context:b,refs:y,reference:F}),[h,y,b,F])}function TM(e,t,n){const r=new Map;return{...n==="floating"&&{tabIndex:-1},...e,...t.map(i=>i?i[n]:null).concat(e).reduce((i,o)=>(o&&Object.entries(o).forEach(a=>{let[u,s]=a;if(u.indexOf("on")===0){if(r.has(u)||r.set(u,[]),typeof s=="function"){var c;(c=r.get(u))==null||c.push(s),i[u]=function(){for(var l,f=arguments.length,d=new Array(f),p=0;p<f;p++)d[p]=arguments[p];(l=r.get(u))==null||l.forEach(h=>h(...d))}}}else i[u]=s}),i),{})}}const Kxe=function(e){return e===void 0&&(e=[]),{getReferenceProps:t=>TM(t,e,"reference"),getFloatingProps:t=>TM(t,e,"floating"),getItemProps:t=>TM(t,e,"item")}};function IM(e,t){var n;let r=(n=e.filter(a=>{var u;return a.parentId===t&&((u=a.context)==null?void 0:u.open)}))!=null?n:[],i=r;for(;i.length;){var o;i=(o=e.filter(a=>{var u;return(u=i)==null?void 0:u.some(s=>{var c;return a.parentId===s.id&&((c=a.context)==null?void 0:c.open)})}))!=null?o:[],r=r.concat(i)}return r}function n5(e){let t=e.activeElement;for(;((n=t)==null||(r=n.shadowRoot)==null?void 0:r.activeElement)!=null;){var n,r;t=t.shadowRoot.activeElement}return t}function Vxe(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Ju(e){e.preventDefault(),e.stopPropagation()}function Hxe(e){const t=ue.useRef(e);return Hu(()=>{t.current=e}),t}function r5(e){const t=ue.useRef();return Hu(()=>{t.current=e},[e]),t.current}const Jxe=function(e,t){let{open:n}=e,{enabled:r=!0,role:i="dialog"}=t===void 0?{}:t;const o=X4(),a=X4(),u={id:o,role:i};return r?i==="tooltip"?{reference:{"aria-describedby":n?o:void 0},floating:u}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":i==="alertdialog"?"dialog":i,"aria-controls":n?o:void 0,...i==="listbox"&&{role:"combobox"},...i==="menu"&&{id:a}},floating:{...u,...i==="menu"&&{"aria-labelledby":a}}}:{}};function OM(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}const Gxe=function(e,t){let{open:n,onOpenChange:r,refs:i,events:o,nodeId:a}=e,{enabled:u=!0,escapeKey:s=!0,outsidePointerDown:c=!0,referencePointerDown:l=!1,ancestorScroll:f=!1,bubbles:d=!0}=t===void 0?{}:t;const p=$M(),h=Q4()!=null,v=Te.useRef(!1);return Te.useEffect(()=>{if(!n||!u)return;function y(I){if(I.key==="Escape"){if(!d&&p&&IM(p.nodesRef.current,a).length>0)return;o.emit("dismiss",{preventScroll:!1}),r(!1)}}function b(I){const T=v.current;if(v.current=!1,T)return;const k=Vxe(I);if(g$(k)&&i.floating.current){var E;const K=(E=i.floating.current.ownerDocument.defaultView)!=null?E:window,x=k.scrollWidth>k.clientWidth,X=k.scrollHeight>k.clientHeight;let O=X&&I.offsetX>k.clientWidth;if(X&&K.getComputedStyle(k).direction==="rtl"&&(O=I.offsetX<=k.offsetWidth-k.clientWidth),O||x&&I.offsetY>k.clientHeight)return}const Y=p&&IM(p.nodesRef.current,a).some(K=>{var x;return OM(I,(x=K.context)==null?void 0:x.refs.floating.current)});OM(I,i.floating.current)||OM(I,i.domReference.current)||Y||!d&&p&&IM(p.nodesRef.current,a).length>0||(o.emit("dismiss",h?{preventScroll:!0}:!1),r(!1))}function w(){r(!1)}const F=_M(i.floating.current);s&&F.addEventListener("keydown",y),c&&F.addEventListener("pointerdown",b);const g=(f?[...g$(i.reference.current)?ad(i.reference.current):[],...g$(i.floating.current)?ad(i.floating.current):[]]:[]).filter(I=>{var T;return I!==((T=F.defaultView)==null?void 0:T.visualViewport)});return g.forEach(I=>I.addEventListener("scroll",w,{passive:!0})),()=>{s&&F.removeEventListener("keydown",y),c&&F.removeEventListener("pointerdown",b),g.forEach(I=>I.removeEventListener("scroll",w))}},[s,c,o,p,a,n,r,f,u,d,i,h]),u?{reference:{onPointerDown(){l&&(o.emit("dismiss"),r(!1))}},floating:{onPointerDownCapture(){v.current=!0}}}:{}},wM="ArrowUp",y$="ArrowDown",ud="ArrowLeft",im="ArrowRight";function b$(e,t,n){return Math.floor(e/t)!==n}function om(e,t){return t<0||t>=e.current.length}function $n(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:i,amount:o=1}=t===void 0?{}:t;const a=e.current;let u=n;do{var s,c;u=u+(r?-o:o)}while(u>=0&&u<=a.length-1&&(i?i.includes(u):a[u]==null||((s=a[u])==null?void 0:s.hasAttribute("disabled"))||((c=a[u])==null?void 0:c.getAttribute("aria-disabled"))==="true"));return u}function $$(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function i5(e,t){return $$(t,e===wM||e===y$,e===ud||e===im)}function EM(e,t,n){return $$(t,e===y$,n?e===ud:e===im)||e==="Enter"||e==" "||e===""}function Yxe(e,t,n){return $$(t,n?e===ud:e===im,e===y$)}function Zxe(e,t,n){return $$(t,n?e===im:e===ud,e===wM)}function RM(e,t){return $n(e,{disabledIndices:t})}function o5(e,t){return $n(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}const Xxe=function(e,t){let{open:n,onOpenChange:r,refs:i}=e,{listRef:o,activeIndex:a,onNavigate:u=()=>{},enabled:s=!0,selectedIndex:c=null,allowEscape:l=!1,loop:f=!1,nested:d=!1,rtl:p=!1,virtual:h=!1,focusItemOnOpen:v="auto",focusItemOnHover:y=!0,openOnArrowKeyDown:b=!0,disabledIndices:w=void 0,orientation:F="vertical",cols:g=1}=t===void 0?{listRef:{current:[]},activeIndex:null,onNavigate:()=>{}}:t;process.env.NODE_ENV!=="production"&&(l&&(f||console.warn(["Floating UI: `useListNavigation` looping must be enabled to allow","escaping."].join(" ")),h||console.warn(["Floating UI: `useListNavigation` must be virtual to allow","escaping."].join(" "))),F==="vertical"&&g>1&&console.warn(["Floating UI: In grid list navigation mode (`cols` > 1), the",'`orientation` should be either "horizontal" or "both".'].join(" ")));const I=Q4(),T=$M(),k=r5(n),E=SM(u),Y=SM(r5(u)),K=Te.useRef(v),x=Te.useRef(c!=null?c:-1),X=Te.useRef(null),O=Hxe(w),R=Te.useRef(!1),W=Te.useRef(-1),[L,z]=Te.useState(),j=Te.useCallback((_,U)=>{W.current=requestAnimationFrame(()=>{if(h){var G;z((G=_.current[U.current])==null?void 0:G.id)}else{var ge;(ge=_.current[U.current])==null||ge.focus({preventScroll:!0})}})},[h]);Hu(()=>{!s||(!k&&n&&K.current&&c!=null&&E(c),k&&!n&&(cancelAnimationFrame(W.current),x.current=-1,Y(null)))},[n,k,c,o,j,s,E,Y]),Hu(()=>{if(!!s&&n)if(a==null){if(c!=null)return;k&&(x.current=-1,j(o,x)),!k&&K.current&&(X.current!=null||K.current===!0&&X.current==null)&&(x.current=X.current==null||EM(X.current,F,p)||d?RM(o,O.current):o5(o,O.current),E(x.current),j(o,x))}else om(o,a)||(x.current=a,j(o,x))},[n,k,a,c,d,o,E,j,s,l,F,p,h,O]),Hu(()=>{if(!!s&&!n&&k){var _,U;const G=T==null||(_=T.nodesRef.current.find(ge=>ge.id===I))==null||(U=_.context)==null?void 0:U.refs.floating.current;G&&!G.contains(n5(_M(G)))&&G.focus({preventScroll:!0})}},[s,n,k,T,I]),Hu(()=>{X.current=null});function S(_){if(R.current=!0,d&&Zxe(_.key,F,p)){Ju(_),r(!1),zxe(i.domReference.current)&&i.domReference.current.focus();return}const U=x.current,G=RM(o,w),ge=o5(o,w);if(_.key==="Home"&&(x.current=G,E(x.current)),_.key==="End"&&(x.current=ge,E(x.current)),g>1){const he=x.current;if(_.key===wM){if(Ju(_),he===-1)x.current=ge;else if(x.current=$n(o,{startingIndex:he,amount:g,decrement:!0,disabledIndices:w}),f&&(he-g<G||x.current<0)){const Se=he%g,Qe=ge%g,Ft=ge-(Qe-Se);Qe===Se?x.current=ge:x.current=Qe>Se?Ft:Ft-g}om(o,x.current)&&(x.current=he),E(x.current)}if(_.key===y$&&(Ju(_),he===-1?x.current=G:(x.current=$n(o,{startingIndex:he,amount:g,disabledIndices:w}),f&&he+g>ge&&(x.current=$n(o,{startingIndex:he%g-g,amount:g,disabledIndices:w}))),om(o,x.current)&&(x.current=he),E(x.current)),F==="both"){const Se=Math.floor(he/g);_.key===im&&(Ju(_),he%g!==g-1?(x.current=$n(o,{startingIndex:he,disabledIndices:w}),f&&b$(x.current,g,Se)&&(x.current=$n(o,{startingIndex:he-he%g-1,disabledIndices:w}))):f&&(x.current=$n(o,{startingIndex:he-he%g-1,disabledIndices:w})),b$(x.current,g,Se)&&(x.current=he)),_.key===ud&&(Ju(_),he%g!==0?(x.current=$n(o,{startingIndex:he,disabledIndices:w,decrement:!0}),f&&b$(x.current,g,Se)&&(x.current=$n(o,{startingIndex:he+(g-he%g),decrement:!0,disabledIndices:w}))):f&&(x.current=$n(o,{startingIndex:he+(g-he%g),decrement:!0,disabledIndices:w})),b$(x.current,g,Se)&&(x.current=he));const Qe=Math.floor(ge/g)===Se;om(o,x.current)&&(f&&Qe?x.current=_.key===ud?ge:$n(o,{startingIndex:he-he%g-1,disabledIndices:w}):x.current=he),E(x.current);return}}if(i5(_.key,F)){if(Ju(_),n&&!h&&n5(_.currentTarget.ownerDocument)===_.currentTarget){x.current=EM(_.key,F,p)?G:ge,E(x.current);return}EM(_.key,F,p)?f?x.current=U>=ge?l&&U!==o.current.length?-1:G:$n(o,{startingIndex:U,disabledIndices:w}):x.current=Math.min(ge,$n(o,{startingIndex:U,disabledIndices:w})):f?x.current=U<=G?l&&U!==-1?o.current.length:ge:$n(o,{startingIndex:U,decrement:!0,disabledIndices:w}):x.current=Math.max(G,$n(o,{startingIndex:U,decrement:!0,disabledIndices:w})),om(o,x.current)?E(null):E(x.current)}}return s?{reference:{...h&&n&&a!=null&&{"aria-activedescendant":L},onKeyDown(_){if(R.current=!0,h&&n)return S(_);if((_.key.indexOf("Arrow")===0||_.key==="Enter"||_.key===" "||_.key==="")&&(X.current=_.key),d){Yxe(_.key,F,p)&&(Ju(_),n?(x.current=RM(o,w),E(x.current)):r(!0));return}i5(_.key,F)&&(c!=null&&(x.current=c),Ju(_),!n&&b?r(!0):S(_),n&&E(x.current))}},floating:{"aria-orientation":F==="both"?void 0:F,...h&&a!=null&&{"aria-activedescendant":L},onKeyDown:S,onPointerMove(){R.current=!1}},item:{onFocus(_){let{currentTarget:U}=_;const G=o.current.indexOf(U);G!==-1&&E(G)},onClick:_=>{let{currentTarget:U}=_;return U.focus({preventScroll:!0})},...y&&{onMouseMove(_){let{currentTarget:U}=_;const G=U;if(G){const ge=o.current.indexOf(G);ge!==-1&&E(ge)}},onPointerLeave(){if(!R.current&&(x.current=-1,j(o,x),E(null),!h)){var _;(_=i.floating.current)==null||_.focus({preventScroll:!0})}}}}}:{}};function Qxe(e){var t;const{char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:a}=e,u=UEe(n),s=new RegExp(`\\s${u}$`),c=o?"^":"",l=r?new RegExp(`${c}${u}.*?(?=\\s${u}|$)`,"gm"):new RegExp(`${c}(?:^)?${u}[^\\s${u}]*`,"gm"),f=((t=a.nodeBefore)===null||t===void 0?void 0:t.isText)&&a.nodeBefore.text;if(!f)return null;const d=a.pos-f.length,p=Array.from(f.matchAll(l)).pop();if(!p||p.input===void 0||p.index===void 0)return null;const h=p.input.slice(Math.max(0,p.index-1),p.index),v=new RegExp(`^[${i==null?void 0:i.join("")}\0]?$`).test(h);if(i!==null&&!v)return null;const y=d+p.index;let b=y+p[0].length;return r&&s.test(f.slice(b-1,b+1))&&(p[0]+=" ",b+=1),y<a.pos&&b>=a.pos?{range:{from:y,to:b},query:p[0].slice(n.length),text:p[0]}:null}const eCe=new xu("suggestion");function tCe({pluginKey:e=eCe,editor:t,char:n="@",allowSpaces:r=!1,allowedPrefixes:i=[" "],startOfLine:o=!1,decorationTag:a="span",decorationClass:u="suggestion",command:s=()=>null,items:c=()=>[],render:l=()=>({}),allow:f=()=>!0}){let d;const p=l==null?void 0:l(),h=new Kr({key:e,view(){return{update:async(v,y)=>{var b,w,F,g,I,T,k;const E=(b=this.key)===null||b===void 0?void 0:b.getState(y),Y=(w=this.key)===null||w===void 0?void 0:w.getState(v.state),K=E.active&&Y.active&&E.range.from!==Y.range.from,x=!E.active&&Y.active,X=E.active&&!Y.active,O=!x&&!X&&E.query!==Y.query,R=x||K,W=O&&!K,L=X||K;if(!R&&!W&&!L)return;const z=L&&!R?E:Y,j=v.dom.querySelector(`[data-decoration-id="${z.decorationId}"]`);d={editor:t,range:z.range,query:z.query,text:z.text,items:[],command:S=>{s({editor:t,range:z.range,props:S})},decorationNode:j,clientRect:j?()=>{var S;const{decorationId:_}=(S=this.key)===null||S===void 0?void 0:S.getState(t.state),U=v.dom.querySelector(`[data-decoration-id="${_}"]`);return(U==null?void 0:U.getBoundingClientRect())||null}:null},R&&((F=p==null?void 0:p.onBeforeStart)===null||F===void 0||F.call(p,d)),W&&((g=p==null?void 0:p.onBeforeUpdate)===null||g===void 0||g.call(p,d)),(W||R)&&(d.items=await c({editor:t,query:z.query})),L&&((I=p==null?void 0:p.onExit)===null||I===void 0||I.call(p,d)),W&&((T=p==null?void 0:p.onUpdate)===null||T===void 0||T.call(p,d)),R&&((k=p==null?void 0:p.onStart)===null||k===void 0||k.call(p,d))},destroy:()=>{var v;!d||(v=p==null?void 0:p.onExit)===null||v===void 0||v.call(p,d)}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(v,y,b,w){const{isEditable:F}=t,{composing:g}=t.view,{selection:I}=v,{empty:T,from:k}=I,E={...y};if(E.composing=g,F&&(T||t.view.composing)){(k<y.range.from||k>y.range.to)&&!g&&!y.composing&&(E.active=!1);const Y=Qxe({char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:I.$from}),K=`id_${Math.floor(Math.random()*4294967295)}`;Y&&f({editor:t,state:w,range:Y.range})?(E.active=!0,E.decorationId=y.decorationId?y.decorationId:K,E.range=Y.range,E.query=Y.query,E.text=Y.text):E.active=!1}else E.active=!1;return E.active||(E.decorationId=null,E.range={from:0,to:0},E.query=null,E.text=null),E}},props:{handleKeyDown(v,y){var b;const{active:w,range:F}=h.getState(v.state);return w&&((b=p==null?void 0:p.onKeyDown)===null||b===void 0?void 0:b.call(p,{view:v,event:y,range:F}))||!1},decorations(v){const{active:y,range:b,decorationId:w}=h.getState(v);return y?Vt.create(v.doc,[Sr.inline(b.from,b.to,{nodeName:a,class:u,"data-decoration-id":w})]):null}}});return h}function a5(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=a5(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function nCe(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=a5(e))&&(r&&(r+=" "),r+=t);return r}const rCe=Or.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",dn(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),yo={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"},_$=()=>(++_$.i).toString();_$.i=0;const iCe=e=>{const t=oCe(e),n=[];for(let r=0;r<t.length;r++)n.push(u5(t[r]));return{key:_$(),children:n}},am=(e,t=[])=>({key:_$(),type:e.type,text:"text"in e?e.text:void 0,node:e,children:t}),MM=e=>am({type:yo.span,text:e,spans:[]}),oCe=e=>{const t=e.slice(0);for(let n=0;n<t.length;n++){const r=t[n];if(r.type===yo.listItem||r.type===yo.oListItem){const i=[r];for(;t[n+1]&&t[n+1].type===r.type;)i.push(t[n+1]),t.splice(n,1);r.type===yo.listItem?t[n]={type:yo.list,items:i}:t[n]={type:yo.oList,items:i}}}return t},u5=e=>{if("text"in e)return am(e,s5(e.spans,e));if("items"in e){const t=[];for(let n=0;n<e.items.length;n++)t.push(u5(e.items[n]));return am(e,t)}return am(e)},s5=(e,t,n)=>{if(!e.length)return[MM(t.text)];const r=e.slice(0);r.sort((o,a)=>o.start-a.start||a.end-o.end);const i=[];for(let o=0;o<r.length;o++){const a=r[o],u=n&&n.start||0,s=a.start-u,c=a.end-u,l=t.text.slice(s,c),f=[];for(let p=o;p<r.length;p++){const h=r[p];h!==a&&h.start>=a.start&&h.end<=a.end&&(f.push(h),r.splice(p,1),p--)}o===0&&s>0&&i.push(MM(t.text.slice(0,s)));const d={...a,text:l};i.push(am(d,s5(f,{...t,text:l},a))),c<t.text.length&&i.push(MM(t.text.slice(c,r[o+1]?r[o+1].start-u:void 0)))}return i},aCe=(e,t)=>c5(iCe(e).children,t),c5=(e,t)=>{const n=[];for(let r=0;r<e.length;r++){const i=e[r],o=t(i.type,i.node,i.text,c5(i.children,t),i.key);o!=null&&n.push(o)}return n};yo.listItem+"",yo.oListItem+"",yo.list+"",yo.oList+"";const uCe=Or.create({name:"text",group:"inline"}),sCe={groupBy(e,t){return e.reduce((n,r)=>{const i=t(r),o=(n.get(i)||[]).concat(r);return n.set(i,o)},new Map)},sort(e){return[...e].sort((t,n)=>t.start-n.start)},mergeOverlap(e){const t=this.groupBy(e,r=>r.type),n=Array.from(t.entries()).map(([r,i])=>(this.sort(i).reduce((o,a)=>{if(!o.length)return[a];const u=o.length-1,s=o[u];return s.end>=a.start?[...o.slice(0,u),{...s,end:a.end}]:[...o,a]},[]),i)).reduce((r,i)=>[...r,...i],[]);return this.sort(n)}},l5={fromPrismic(e){return t=>{var n;return(n=WM.find(r=>r.richTextNodeTypes[0]===t.type))==null?void 0:n.converter.fromPrismic(e)(t)}},toPrismic(e,t,n){const[r,i]=(()=>{const o=WM.find(a=>e.type.name===a.name);if(!o)throw new Error(`Invalid mark extension '${e.type.name}'.`);return[o.richTextNodeTypes[0],o.converter.toPrismic(e)]})();return{type:r,start:t,end:n,...i?{data:i}:{}}}},f5=uCe.extend({name:"text"}),cCe={fromPrismic(e){return function(t,n,r=!1){const i={type:t,text:n.content.text,spans:n.content.spans||[]};return aCe([i],lCe(e,r))[0]}},toPrismic(e,t,n){const r=Cc.children.reduce(e,(i,o)=>{const a=(()=>o.type.name===c$.name?c$.converter.toPrismic(o):o.textContent)(),u=a?i.text+a:i.text,s=i.text.length,c=u.length,l=(()=>o.marks.length?Cc.marks.map(o,d=>l5.toPrismic(d,s,c)):void 0)();return{...i,text:u,spans:l?[...i.spans,...l]:i.spans}},{text:"",spans:[]});return{type:t,content:{text:r.text,spans:[...sCe.mergeOverlap(r.spans)].sort((i,o)=>i.type.localeCompare(o.type))},...n}}};function lCe(e,t=!1){return(n,r,i,o)=>{if(n==="span"&&i&&i.length)return t?[e.text(i)]:c$.splitTextToNodes(e,i)(a=>e.text(a));{const a=l5.fromPrismic(e)(r);return a?l0(o).map(s=>s.mark([...s.marks,a].sort((c,l)=>c.type.name.localeCompare(l.type.name)))):l0(o)}}}const Ac={name:f5.name,component:f5,converter:cCe};var d5=(e=>(e.LeftToRight="ltr",e.RightToLeft="rtl",e))(d5||{});const kc="text-direction",fCe=xe.RichTextNodeType.rtl,dCe=Ir.create({name:"textDirection",addOptions(){return{supportedExtensionNames:[]}},addGlobalAttributes(){return[{types:this.options.supportedExtensionNames,attributes:{[kc]:{default:"ltr",parseHTML:e=>e.attributes.dir?"rtl":"ltr",renderHTML:e=>e[kc]==="rtl"?{dir:"rtl"}:{dir:"ltr"}}}}]},addCommands(){return{setDirection:e=>({commands:t})=>{switch(e){case"rtl":return t.setRightToLeft();default:return t.setLeftToRight()}},toggleDirection:e=>({commands:t})=>{const n=e==="rtl"?"ltr":"rtl";return t.setDirection(n)},setRightToLeft:()=>({commands:e})=>this.options.supportedExtensionNames.every(t=>e.updateAttributes(t,{[kc]:"rtl"})),setLeftToRight:()=>({commands:e})=>this.options.supportedExtensionNames.every(t=>e.resetAttributes(t,kc))}},addKeyboardShortcuts(){return{"Mod-Shift-r":()=>this.editor.commands.setRightToLeft(),"Mod-Shift-l":()=>this.editor.commands.setLeftToRight()}}}),Ra={parseNodeAttrsDirection(e){switch(e[kc]){case"rtl":return"rtl";default:return"ltr"}},fromPrismic(e){const t=(()=>{switch(e.direction){case"rtl":return"rtl";default:return"ltr"}})();return{[kc]:t}},toPrismic(e){return{direction:this.parseNodeAttrsDirection(e.attrs)}}},S$=rCe.extend({name:"paragraph",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",dn(this.options.HTMLAttributes,e),0]}}),pCe={fromPrismic(e){return function(t){var r;const n=Ac.converter.fromPrismic(e)(S$.name,t);return(r=e.nodes[S$.name])==null?void 0:r.create(Ra.fromPrismic(t),n)}},toPrismic(e){return Ac.converter.toPrismic(e,xe.RichTextNodeType.paragraph,Ra.toPrismic(e))}},Gu=new rd([xe.RichTextNodeType.paragraph],S$.name,S$,pCe,"Type '/' for commands"),p5=["ArrowDown","ArrowUp","End","Home"],h5=["Enter"],hCe=["Escape",...p5,...h5],mCe=Ir.create({name:"slash-commands",addOptions(){return{nodeTypes:[]}},addProseMirrorPlugins(){const e=E$($5,this.options.nodeTypes);return e.length>1?[tCe({allowSpaces:!0,char:"/",editor:this.editor,startOfLine:!0,allow:({state:t})=>{const n=t.selection.$from;return n.parent.type.name===Gu.name&&n.depth===1},command:({editor:t,props:n,range:r})=>{n.runCommands(t,{deleteRange:r})},items:({query:t})=>{const n=t.toLocaleLowerCase().trim();return e.filter(r=>{var i,o;return((i=r.shortText)==null?void 0:i.toLocaleLowerCase().includes(n))||((o=r.text)==null?void 0:o.toLocaleLowerCase().includes(n))})},render:()=>{let t;return{onStart:n=>{t=new E4(vCe,{editor:n.editor,props:n}),document.body.appendChild(t.element)},onUpdate:n=>{t==null||t.updateProps(n)},onKeyDown:({event:n})=>{var r;return hCe.includes(n.key)&&((r=t==null?void 0:t.ref)==null?void 0:r.handleKeyDown(n))},onExit:()=>{t==null||t.destroy(),t==null||t.element.remove()}}}})]:[]}}),vCe=ue.forwardRef(function({command:t,decorationNode:n,editor:r,items:i},o){const[a,u]=ue.useState(!0),s=parseFloat(P.tokens.space[4]),{context:c,floating:l,reference:f,strategy:d,x:p,y:h}=qxe({middleware:[yxe(s),vxe(),bxe({limiter:$xe()})],onOpenChange:u,open:a,placement:"top-start",strategy:"fixed",whileElementsMounted:Wxe});ue.useLayoutEffect(()=>{f(n)},[f,n]),ue.useEffect(()=>{let x;const X=()=>{x=setTimeout(()=>{u(!0)})},O=()=>{u(!1)};return r.on("focus",X).on("blur",O),()=>{r.off("focus",X).off("blur",O),clearTimeout(x)}},[r]);const[v,y]=ue.useState(0),b=ue.useRef([]),[w,F]=ue.useState();i!==w&&(y(0),b.current=[],F(i));const{getFloatingProps:g,getItemProps:I,getReferenceProps:T}=Kxe([Gxe(c,{outsidePointerDown:!1}),Xxe(c,{activeIndex:v,listRef:b,onNavigate:x=>{y(X=>x!=null?x:X)},openOnArrowKeyDown:!1,virtual:!0}),Jxe(c,{role:"menu"})]),E=T().onKeyDown;ue.useImperativeHandle(o,()=>({handleKeyDown:x=>{if(a){if(p5.includes(x.key)&&E(x),h5.includes(x.key)){const X=i[v];X!==void 0&&t(X)}return!0}else return!1}}),[v,t,i,E,a]);const Y=p!==null&&h!==null,K=ue.useId();return a?He("div",{...g(),className:P.dropdownMenuStyles.content,ref:l,style:{insetBlockStart:parseFloat(P.tokens.space[0]),insetInlineStart:parseFloat(P.tokens.space[0]),minInlineSize:256,position:d,transform:Y?`translate3d(${Math.round(p)}px, ${Math.round(h)}px, 0)`:"translate3d(0, -200%, 0)"},children:[i.map((x,X)=>{var O;return ue.createElement(m5,{...I({onClick:()=>{t(x)},onPointerDown:R=>{R.preventDefault()}}),"data-highlighted":X===v?"":void 0,id:`${K}[${X}]`,key:x.nodeType,ref:R=>{b.current[X]=R},shortcut:`/${(O=x.shortText)!=null?O:""}`,startIcon:x.icon},x.text)}),i.length===0?N(m5,{...I({onPointerDown:x=>{x.preventDefault()}}),disabled:!0,id:`${K}[0]`,ref:x=>{b.current[0]=x},children:"No results"}):null]}):null}),m5=ue.forwardRef(function({children:t,disabled:n,shortcut:r,startIcon:i,...o},a){return He("div",{...o,...n?{"aria-disabled":!0,"data-disabled":!0}:{},className:P.dropdownMenuStyles.item,ref:a,role:"menuitem",children:[ue.isValidElement(i)?ue.cloneElement(i,{className:nCe(i.props.className,P.dropdownMenuStyles.itemStartIcon)}):null,N(P.Text,{className:P.dropdownMenuStyles.itemText,component:"span",children:t}),r?N(P.Text,{className:P.dropdownMenuStyles.itemShortcut,color:"inherit",component:"span",variant:"inherit",weight:"inherit",children:r}):null]})});function gCe(e,t){var o;const n=t.map(a=>a.richTextNodeTypes).flat(),r=m(t,li(a=>a.nodeType===nd.Text),fv({},(a,u)=>({...a,[u.name]:u.placeholder}))),i=n.includes(xe.RichTextNodeType.orderedList)||n.includes(xe.RichTextNodeType.list);return li(a=>a!==void 0)([hM.component(((o=e.config)==null?void 0:o.single)===void 0),Ac.component,c$.component,axe(r),i?id.component:void 0,mCe.configure({nodeTypes:n})])}const xM=YMe.extend({name:"bulletList",parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:e}){return["ul",dn(this.options.HTMLAttributes,e),0]}}).configure({itemTypeName:"listItem"}),yCe={fromPrismic(e){return function(t){var r;const n=id.converter.fromPrismic(e)(t);if(!!n)return(r=e.nodes[xM.name])==null?void 0:r.create(Ra.fromPrismic(t),n)}},toPrismic(e){return PS(Cc.children.map(e,t=>li(n=>n!==void 0)(id.converter.toPrismic(t,xe.RichTextNodeType.list))))}},T$=new fM([xe.RichTextNodeType.list],xM.name,xM,yCe),bCe=/^```([a-z]+)?[\s\n]$/,$Ce=/^~~~([a-z]+)?[\s\n]$/,I$=Or.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:e=>{var t;const{languageClassPrefix:n}=this.options,o=[...((t=e.firstElementChild)===null||t===void 0?void 0:t.classList)||[]].filter(a=>a.startsWith(n)).map(a=>a.replace(n,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:e,HTMLAttributes:t}){return["pre",dn(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const o=r.parentOffset===r.parent.nodeSize-2,a=r.parent.textContent.endsWith(`
143
+ `,"2) content: () => element.cloneNode(true)"].join(" "))}var u=i.reduce(function(s,c){var l=c&&WMe(c,r);return l&&s.push(l),s},[]);return em(e)?u[0]:u}nm.defaultProps=Er,nm.setDefaultProps=xMe,nm.currentInput=mo,Object.assign({},K3,{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)}}),nm.setDefaultProps({render:M4});class NMe{constructor({editor:t,element:n,view:r,tippyOptions:i={},shouldShow:o}){this.preventHide=!1,this.shouldShow=({view:a,state:u,from:s,to:c})=>{const{doc:l,selection:f}=u,{empty:d}=f,p=!l.textBetween(s,c).length&&M3(u.selection),h=this.element.contains(document.activeElement);return!(!(a.hasFocus()||h)||d||p||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:a})=>{var u;if(this.preventHide){this.preventHide=!1;return}(a==null?void 0:a.relatedTarget)&&((u=this.element.parentNode)===null||u===void 0?void 0:u.contains(a.relatedTarget))||this.hide()},this.editor=t,this.element=n,this.view=r,o&&(this.shouldShow=o),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:t}=this.editor.options,n=!!t.parentElement;this.tippy||!n||(this.tippy=nm(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",r=>{this.blurHandler({event:r})}))}update(t,n){var r,i,o;const{state:a,composing:u}=t,{doc:s,selection:c}=a,l=n&&n.doc.eq(s)&&n.selection.eq(c);if(u||l)return;this.createTooltip();const{ranges:f}=c,d=Math.min(...f.map(v=>v.$from.pos)),p=Math.max(...f.map(v=>v.$to.pos));if(!((r=this.shouldShow)===null||r===void 0?void 0:r.call(this,{editor:this.editor,view:t,state:a,oldState:n,from:d,to:p}))){this.hide();return}(i=this.tippy)===null||i===void 0||i.setProps({getReferenceClientRect:((o=this.tippyOptions)===null||o===void 0?void 0:o.getReferenceClientRect)||(()=>{if(GEe(a.selection)){const v=t.nodeDOM(d);if(v)return v.getBoundingClientRect()}return YEe(t,d,p)})}),this.show()}show(){var t;(t=this.tippy)===null||t===void 0||t.show()}hide(){var t;(t=this.tippy)===null||t===void 0||t.hide()}destroy(){var t;(t=this.tippy)===null||t===void 0||t.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const x4=e=>new Kr({key:typeof e.pluginKey=="string"?new Ru(e.pluginKey):e.pluginKey,view:t=>new NMe({view:t,...e})});Ir.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[x4({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});const PMe=e=>{const[t,n]=ae.useState(null);return ae.useEffect(()=>{if(!t||e.editor.isDestroyed)return;const{pluginKey:r="bubbleMenu",editor:i,tippyOptions:o={},shouldShow:a=null}=e,u=x4({pluginKey:r,editor:i,element:t,tippyOptions:o,shouldShow:a});return i.registerPlugin(u),()=>i.unregisterPlugin(r)},[e.editor,t]),A("div",{ref:n,className:e.className,style:{visibility:"hidden"},children:e.children})};class FMe extends HEe{constructor(){super(...arguments),this.contentComponent=null}}const DMe=({renderers:e})=>A(If,{children:Array.from(e).map(([t,n])=>N5.default.createPortal(n.reactElement,n.element,t))});class LMe extends Nc.default.Component{constructor(t){super(t),this.editorContentRef=Nc.default.createRef(),this.state={renderers:new Map}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const{editor:t}=this.props;if(t&&t.options.element){if(t.contentComponent)return;const n=this.editorContentRef.current;n.append(...t.options.element.childNodes),t.setOptions({element:n}),t.contentComponent=this,t.createNodeViews()}}componentWillUnmount(){const{editor:t}=this.props;if(!t||(t.isDestroyed||t.view.setProps({nodeViews:{}}),t.contentComponent=null,!t.options.element.firstChild))return;const n=document.createElement("div");n.append(...t.options.element.childNodes),t.setOptions({element:n})}render(){const{editor:t,...n}=this.props;return Ue(If,{children:[A("div",{ref:this.editorContentRef,...n}),A(DMe,{renderers:this.state.renderers})]})}}const jMe=Nc.default.memo(LMe),C4=ae.createContext({onDragStart:void 0}),UMe=()=>ae.useContext(C4),BMe=Nc.default.forwardRef((e,t)=>{const{onDragStart:n}=UMe(),r=e.as||"div";return A(r,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})});function zMe(e){return!!(typeof e=="function"&&e.prototype&&e.prototype.isReactComponent)}function qMe(e){var t;return typeof e=="object"&&((t=e.$$typeof)===null||t===void 0?void 0:t.toString())==="Symbol(react.forward_ref)"}class A4{constructor(t,{editor:n,props:r={},as:i="div",className:o=""}){this.ref=null,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=t,this.editor=n,this.props=r,this.element=document.createElement(i),this.element.classList.add("react-renderer"),o&&this.element.classList.add(...o.split(" ")),this.render()}render(){const t=this.component,n=this.props;(zMe(t)||qMe(t))&&(n.ref=r=>{this.ref=r}),this.reactElement=A(t,{...n}),sm.flushSync(()=>{var r;!((r=this.editor)===null||r===void 0)&&r.contentComponent&&this.editor.contentComponent.setState({renderers:this.editor.contentComponent.state.renderers.set(this.id,this)})})}updateProps(t={}){this.props={...this.props,...t},this.render()}destroy(){sm.flushSync(()=>{var t;if(!((t=this.editor)===null||t===void 0)&&t.contentComponent){const{renderers:n}=this.editor.contentComponent.state;n.delete(this.id),this.editor.contentComponent.setState({renderers:n})}})}}class KMe extends ZEe{mount(){const t={editor:this.editor,node:this.node,decorations:this.decorations,selected:!1,extension:this.extension,getPos:()=>this.getPos(),updateAttributes:(o={})=>this.updateAttributes(o),deleteNode:()=>this.deleteNode()};if(!this.component.displayName){const o=a=>a.charAt(0).toUpperCase()+a.substring(1);this.component.displayName=o(this.extension.name)}const n=o=>{const a=this.component,u=this.onDragStart.bind(this),s=c=>{c&&this.contentDOMElement&&c.firstChild!==this.contentDOMElement&&c.appendChild(this.contentDOMElement)};return A(C4.Provider,{value:{onDragStart:u,nodeViewContentRef:s},children:A(a,{...o})})};n.displayName="ReactNodeView",this.contentDOMElement=this.node.isLeaf?null:document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement&&(this.contentDOMElement.style.whiteSpace="inherit");let r=this.node.isInline?"span":"div";this.options.as&&(r=this.options.as);const{className:i=""}=this.options;this.renderer=new A4(n,{editor:this.editor,props:t,as:r,className:`node-${this.node.type.name} ${i}`.trim()})}get dom(){var t;if(this.renderer.element.firstElementChild&&!(!((t=this.renderer.element.firstElementChild)===null||t===void 0)&&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){const r=i=>{this.renderer.updateProps(i)};if(t.type!==this.node.type)return!1;if(typeof this.options.update=="function"){const 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 VMe(e,t){return n=>n.editor.contentComponent?new KMe(e,n,t):{}}function HMe(){const[,e]=ae.useState(0);return()=>e(t=>t+1)}const JMe=(e={},t=[])=>{const[n,r]=ae.useState(null),i=HMe();return ae.useEffect(()=>{let o=!0;const a=new FMe(e);return r(a),a.on("transaction",()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{o&&i()})})}),()=>{a.destroy(),o=!1}},t),n},GMe=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,YMe=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,ZMe=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,XMe=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,QMe=Vf.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>e.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return["strong",dn(this.options.HTMLAttributes,e),0]},addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Zb({find:GMe,type:this.type}),Zb({find:ZMe,type:this.type})]},addPasteRules(){return[Xb({find:YMe,type:this.type}),Xb({find:XMe,type:this.type})]}});var exe=Object.defineProperty,txe=(e,t,n)=>t in e?exe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Qf=(e,t,n)=>(txe(e,typeof t!="symbol"?t+"":t,n),n),sM=(e=>(e.Document="document",e.Mark="mark",e.Node="node",e))(sM||{}),ed=(e=>(e.Text="text",e.Embed="embed",e.Image="image",e))(ed||{});class nxe{constructor(t,n,r){this.name=t,this.component=n,this.converter=r,Qf(this,"extType","document")}}class k4{constructor(t,n,r,i){this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i,Qf(this,"extType","mark")}}class td{constructor(t,n,r,i,o,a=!1){this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i,this.placeholder=o,this.lockedFormat=a,Qf(this,"extType","node"),Qf(this,"nodeType","text")}}class rxe{constructor(t,n,r,i){this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i,Qf(this,"extType","node"),Qf(this,"nodeType","embed")}}class ixe extends td{constructor(t,n,r,i,o){super(t,"heading",n,i,o),this.levels=r}}class cM extends td{constructor(t,n,r,i){super(t,n,r,i)}}const lM=QMe.extend({name:"bold"}),oxe={fromPrismic(e){return function(){var t;return(t=e.marks[lM.name])==null?void 0:t.create()}},toPrismic(){}},W4=new k4([xe.RichTextNodeType.strong],lM.name,lM,oxe),axe=/^\s*([-+*])\s$/,uxe=Or.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:e}){return["ul",dn(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleBulletList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){return[U3({find:axe,type:this.type})]}}),N4=Or.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:e}){return["br",dn(this.options.HTMLAttributes,e)]},renderText(){return`
144
+ `},addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{selection:i,storedMarks:o}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:a}=this.options,{splittableMarks:u}=r.extensionManager,s=o||i.$to.parentOffset&&i.$from.marks();return t().insertContent({type:this.name}).command(({tr:c,dispatch:l})=>{if(l&&s&&a){const f=s.filter(d=>u.includes(d.type.name));c.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),xc={isHardBreak(e){return e.type.name===N4.name},children:{reduce(e,t,n){let r=n;return e.forEach((i,o,a)=>{r=t(r,i,a)}),r},map(e,t){return this.reduce(e,(n,r)=>[...n,t(r)],[])},exists(e,t){return this.reduce(e,(n,r)=>n||t(r),!1)},filter(e,t){return this.reduce(e,(n,r)=>[...n,...t(r)?[r]:[]],[])}},marks:{reduce(e,t,n){let r=n;return e.marks.forEach((i,o)=>{r=t(r,i,o)}),r},map(e,t){return this.reduce(e,(n,r)=>[...n,t(r)],[])},filter(e,t){return this.reduce(e,(n,r)=>[...n,...t(r)?[r]:[]],[])}}};function sxe(e){if(!e||!e.size)return{defaultTextConverter:void 0,extensions:I5()};const t=I5(e),n=Array.from(e.values()),r=(()=>{const a=li(c=>n.some(l=>c.richTextNodeTypes.includes(l)))(t),u=a.some(c=>c instanceof cM)?[Hu,...a]:a;return u.some(c=>c instanceof td)?u:[T5,...u]})(),i=r.find(a=>a instanceof td)||T5;function o(a){return u=>i.converter.fromPrismic(a)({...u,type:i.richTextNodeTypes[0]})}return{defaultTextConverter:o,extensions:r}}function cxe(e){if(!(e!=null&&e.single)&&!(e!=null&&e.multi))return;const t=m((e.single||e.multi||"").split(/\s*,\s*/),cv(n=>e_(()=>{})(Jy.RichTextNodeTypeCodec.decode(n))),li(va));return new Set(t)}function lxe(e){const t=cxe(e);return sxe(t)}const fxe=Or.create({name:"doc",topNode:!0,content:"block+"}),P4=Or.create({name:"listItem",addOptions(){return{HTMLAttributes:{}}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",dn(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}).extend({name:"listItem",content:"paragraph*",addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name)}}}),nd={component:P4,converter:{fromPrismic(e){return function(t){var r;const n=Hu.converter.fromPrismic(e)(t);if(!!n)return(r=e.nodes[P4.name])==null?void 0:r.create({},n)}},toPrismic(e,t){return xc.children.reduce(e,(n,r)=>{const i=Hu.converter.toPrismic(r),o=(()=>i instanceof Array?i.map(a=>({...a,type:t})):i?[{...i,type:t}]:[])();return[...n,...o]},[])}},placeholder:"List"};function dxe(e){return e.slice(1,e.length).reduce((t,n)=>t.copy(t.content.append(n.content)),e[0])}const fM="document",pxe=e=>fxe.extend({name:fM,content:e?"block+":"block"}),hxe=e=>({fromPrismic(t,n){function r(i){return function(o=void 0){return!o&&n&&Xs.TextBlock.is(i)?n(i):o}}return function(i){var a;const o=i.value.reduce((u,s)=>{const c=e.find(h=>h.richTextNodeTypes.includes(s.type)),l=(()=>{if(!!c)switch(c.nodeType){case ed.Embed:return Xs.EmbedBlock.is(s)&&c.converter.fromPrismic(t)(s);case ed.Text:return Xs.TextBlock.is(s)&&c.converter.fromPrismic(t)(s);case ed.Image:return Xs.ImageBlock.is(s)&&c.converter.fromPrismic(t)(s);default:return}})(),[f,d]=m(u,OS(u.length-1),([h,v])=>[h,IS(v)]),p=(()=>l?m(d,xo(()=>({merged:!1,node:l}),h=>l.type.name===h.type.name&&(l.type.name===S$.name||l.type.name===O$.name)?{merged:!0,node:dxe([h,l])}:{merged:!1,node:l}),({merged:h,node:v})=>({merged:h,node:r(s)(v)})):{merged:!1,node:r(s)()})();return p.node?[...p.merged?f:u,p.node]:u},[]);return(a=t.nodes[fM])==null?void 0:a.create({},o)}},toPrismic(t){const n=xc.children.reduce(t,(r,i)=>{const o=Object.values(e).find(u=>i.type.name===u.name),a=o==null?void 0:o.converter.toPrismic(i);return a||console.warn(`Cannot convert node of type '${i.type.name}'.`),a?[...r,...a instanceof Array?a:[a]]:r},[]);return{__TYPE__:fa.NestableTypes.StructuredText,value:[...n]}}}),dM=new nxe(fM,pxe,hxe),a$=N4.extend({name:"hard_break"}),u$=`
145
+ `,F4={fromPrismic(e){return function(t){var n;if(t===u$)return(n=e.nodes[a$.name])==null?void 0:n.create({})}},toPrismic(e){if(e.type.name===a$.name)return u$}},pM={isEmptyLine(e){return e.length===0},isFirst(e){return e===0}};function mxe(e,t){return function(n){const r=F4.fromPrismic(e)(u$);if(!r)return[n(t)];const i=t.split(u$);return i.length===1?t.length?[n(t)]:[r]:i.reduce((o,a,u)=>pM.isFirst(u)?pM.isEmptyLine(a)?o:[...o,n(a)]:pM.isEmptyLine(a)?[...o,r]:[...o,r,n(a)],[])}}const s$={name:a$.name,component:a$,converter:F4,splitTextToNodes:mxe},vxe=Ir.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something \u2026",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new Kr({props:{decorations:({doc:e,selection:t})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=t,i=[];return n?(e.descendants((o,a)=>{const u=r>=a&&r<=a+o.nodeSize,s=!o.isLeaf&&!o.childCount;if((u||!this.options.showOnlyCurrent)&&s){const c=[this.options.emptyNodeClass];this.editor.isEmpty&&c.push(this.options.emptyEditorClass);const l=Sr.node(a,a+o.nodeSize,{class:c.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:o,pos:a,hasAnchor:u}):this.options.placeholder});i.push(l)}return this.options.includeChildren}),Vt.create(e,i)):null}}})]}}),gxe=e=>vxe.configure({includeChildren:!0,placeholder:({editor:t,hasAnchor:n,node:r})=>{const i=!xc.children.exists(t.state.doc,u=>u===r),o=(()=>{const u=t.isEditable,s=t.isFocused&&n,c=r.type.name!==Hu.name;return u&&(s||c||i)})(),a=(()=>{if(i)return nd.placeholder;const u=e[r.type.name];return typeof u=="string"?u:u==null?void 0:u(r.attrs)})();return o&&a||""},showOnlyCurrent:!1,showOnlyWhenEditable:!1});function rd(e){return e.split("-")[0]}function hM(e){return e.split("-")[1]}function rm(e){return["top","bottom"].includes(rd(e))?"x":"y"}function D4(e){return e==="y"?"height":"width"}function L4(e,t,n){let{reference:r,floating:i}=e;const o=r.x+r.width/2-i.width/2,a=r.y+r.height/2-i.height/2,u=rm(t),s=D4(u),c=r[s]/2-i[s]/2,l=rd(t),f=u==="x";let d;switch(l){case"top":d={x:o,y:r.y-i.height};break;case"bottom":d={x:o,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:a};break;case"left":d={x:r.x-i.width,y:a};break;default:d={x:r.x,y:r.y}}switch(hM(t)){case"start":d[u]-=c*(n&&f?-1:1);break;case"end":d[u]+=c*(n&&f?-1:1);break}return d}const yxe=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,u=await(a.isRTL==null?void 0:a.isRTL(t));if(process.env.NODE_ENV!=="production"&&(a==null&&console.error(["Floating UI: `platform` property was not passed to config. If you","want to use Floating UI on the web, install @floating-ui/dom","instead of the /core package. Otherwise, you can create your own","`platform`: https://floating-ui.com/docs/platform"].join(" ")),o.filter(h=>{let{name:v}=h;return v==="autoPlacement"||v==="flip"}).length>1))throw new Error(["Floating UI: duplicate `flip` and/or `autoPlacement`","middleware detected. This will lead to an infinite loop. Ensure only","one of either has been passed to the `middleware` array."].join(" "));let s=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:l}=L4(s,r,u),f=r,d={},p=0;for(let h=0;h<o.length;h++){const{name:v,fn:y}=o[h],{x:b,y:w,data:F,reset:g}=await y({x:c,y:l,initialPlacement:r,placement:f,strategy:i,middlewareData:d,rects:s,platform:a,elements:{reference:e,floating:t}});if(c=b!=null?b:c,l=w!=null?w:l,d={...d,[v]:{...d[v],...F}},process.env.NODE_ENV!=="production"&&p>50&&console.warn(["Floating UI: The middleware lifecycle appears to be running in an","infinite loop. This is usually caused by a `reset` continually","being returned without a break condition."].join(" ")),g&&p<=50){p++,typeof g=="object"&&(g.placement&&(f=g.placement),g.rects&&(s=g.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):g.rects),{x:c,y:l}=L4(s,f,u)),h=-1;continue}}return{x:c,y:l,placement:f,strategy:i,middlewareData:d}};function bxe(e){return{top:0,right:0,bottom:0,left:0,...e}}function $xe(e){return typeof e!="number"?bxe(e):{top:e,right:e,bottom:e,left:e}}function c$(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function j4(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:a,elements:u,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:l="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=t,h=$xe(p),y=u[d?f==="floating"?"reference":"floating":f],b=c$(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(y)))==null||n?y:y.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(u.floating)),boundary:c,rootBoundary:l,strategy:s})),w=c$(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:f==="floating"?{...a.floating,x:r,y:i}:a.reference,offsetParent:await(o.getOffsetParent==null?void 0:o.getOffsetParent(u.floating)),strategy:s}):a[f]);return{top:b.top-w.top+h.top,bottom:w.bottom-b.bottom+h.bottom,left:b.left-w.left+h.left,right:w.right-b.right+h.right}}const _xe=Math.min,Sxe=Math.max;function U4(e,t,n){return Sxe(e,_xe(t,n))}const Txe={left:"right",right:"left",bottom:"top",top:"bottom"};function l$(e){return e.replace(/left|right|bottom|top/g,t=>Txe[t])}function Ixe(e,t,n){n===void 0&&(n=!1);const r=hM(e),i=rm(e),o=D4(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=l$(a)),{main:a,cross:l$(a)}}const Oxe={start:"end",end:"start"};function B4(e){return e.replace(/start|end/g,t=>Oxe[t])}function wxe(e){const t=l$(e);return[B4(e),t,B4(t)]}const Exe=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:i,rects:o,initialPlacement:a,platform:u,elements:s}=t,{mainAxis:c=!0,crossAxis:l=!0,fallbackPlacements:f,fallbackStrategy:d="bestFit",flipAlignment:p=!0,...h}=e,v=rd(r),b=f||(v===a||!p?[l$(a)]:wxe(a)),w=[a,...b],F=await j4(t,h),g=[];let I=((n=i.flip)==null?void 0:n.overflows)||[];if(c&&g.push(F[v]),l){const{main:H,cross:q}=Ixe(r,o,await(u.isRTL==null?void 0:u.isRTL(s.floating)));g.push(F[H],F[q])}if(I=[...I,{placement:r,overflows:g}],!g.every(H=>H<=0)){var T,k;const H=((T=(k=i.flip)==null?void 0:k.index)!=null?T:0)+1,q=w[H];if(q)return{data:{index:H,overflows:I},reset:{placement:q}};let x="bottom";switch(d){case"bestFit":{var E;const J=(E=I.map(O=>[O,O.overflows.filter(R=>R>0).reduce((R,C)=>R+C,0)]).sort((O,R)=>O[1]-R[1])[0])==null?void 0:E[0].placement;J&&(x=J);break}case"initialPlacement":x=a;break}if(r!==x)return{reset:{placement:x}}}return{}}}};async function Rxe(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=rd(n),u=hM(n),s=rm(n)==="x",c=["left","top"].includes(a)?-1:1,l=o&&s?-1:1,f=typeof t=="function"?t(e):t;let{mainAxis:d,crossAxis:p,alignmentAxis:h}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return u&&typeof h=="number"&&(p=u==="end"?h*-1:h),s?{x:p*l,y:d*c}:{x:d*c,y:p*l}}const Mxe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,i=await Rxe(t,e);return{x:n+i.x,y:r+i.y,data:i}}}};function z4(e){return e==="x"?"y":"x"}const xxe=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:u={fn:y=>{let{x:b,y:w}=y;return{x:b,y:w}}},...s}=e,c={x:n,y:r},l=await j4(t,s),f=rm(rd(i)),d=z4(f);let p=c[f],h=c[d];if(o){const y=f==="y"?"top":"left",b=f==="y"?"bottom":"right",w=p+l[y],F=p-l[b];p=U4(w,p,F)}if(a){const y=d==="y"?"top":"left",b=d==="y"?"bottom":"right",w=h+l[y],F=h-l[b];h=U4(w,h,F)}const v=u.fn({...t,[f]:p,[d]:h});return{...v,data:{x:v.x-n,y:v.y-r}}}}},Cxe=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:u=0,mainAxis:s=!0,crossAxis:c=!0}=e,l={x:n,y:r},f=rm(i),d=z4(f);let p=l[f],h=l[d];const v=typeof u=="function"?u(t):u,y=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(s){const I=f==="y"?"height":"width",T=o.reference[f]-o.floating[I]+y.mainAxis,k=o.reference[f]+o.reference[I]-y.mainAxis;p<T?p=T:p>k&&(p=k)}if(c){var b,w,F,g;const I=f==="y"?"width":"height",T=["top","left"].includes(rd(i)),k=o.reference[d]-o.floating[I]+(T&&(b=(w=a.offset)==null?void 0:w[d])!=null?b:0)+(T?0:y.crossAxis),E=o.reference[d]+o.reference[I]+(T?0:(F=(g=a.offset)==null?void 0:g[d])!=null?F:0)-(T?y.crossAxis:0);h<k?h=k:h>E&&(h=E)}return{[f]:p,[d]:h}}}};function q4(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function Ia(e){if(e==null)return window;if(!q4(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function Bu(e){return Ia(e).getComputedStyle(e)}function Oa(e){return q4(e)?"":e?(e.nodeName||"").toLowerCase():""}function K4(){const e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(t=>t.brand+"/"+t.version).join(" "):navigator.userAgent}function vo(e){return e instanceof Ia(e).HTMLElement}function zu(e){return e instanceof Ia(e).Element}function Axe(e){return e instanceof Ia(e).Node}function f$(e){if(typeof ShadowRoot>"u")return!1;const t=Ia(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function d$(e){const{overflow:t,overflowX:n,overflowY:r}=Bu(e);return/auto|scroll|overlay|hidden/.test(t+r+n)}function kxe(e){return["table","td","th"].includes(Oa(e))}function V4(e){const t=/firefox/i.test(K4()),n=Bu(e);return n.transform!=="none"||n.perspective!=="none"||n.contain==="paint"||["transform","perspective"].includes(n.willChange)||t&&n.willChange==="filter"||t&&(n.filter?n.filter!=="none":!1)}function H4(){return!/^((?!chrome|android).)*safari/i.test(K4())}const J4=Math.min,im=Math.max,p$=Math.round;function wa(e,t,n){var r,i,o,a;t===void 0&&(t=!1),n===void 0&&(n=!1);const u=e.getBoundingClientRect();let s=1,c=1;t&&vo(e)&&(s=e.offsetWidth>0&&p$(u.width)/e.offsetWidth||1,c=e.offsetHeight>0&&p$(u.height)/e.offsetHeight||1);const l=zu(e)?Ia(e):window,f=!H4()&&n,d=(u.left+(f&&(r=(i=l.visualViewport)==null?void 0:i.offsetLeft)!=null?r:0))/s,p=(u.top+(f&&(o=(a=l.visualViewport)==null?void 0:a.offsetTop)!=null?o:0))/c,h=u.width/s,v=u.height/c;return{width:h,height:v,top:p,right:d+h,bottom:p+v,left:d,x:d,y:p}}function qu(e){return((Axe(e)?e.ownerDocument:e.document)||window.document).documentElement}function h$(e){return zu(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function G4(e){return wa(qu(e)).left+h$(e).scrollLeft}function Wxe(e){const t=wa(e);return p$(t.width)!==e.offsetWidth||p$(t.height)!==e.offsetHeight}function Nxe(e,t,n){const r=vo(t),i=qu(t),o=wa(e,r&&Wxe(t),n==="fixed");let a={scrollLeft:0,scrollTop:0};const u={x:0,y:0};if(r||!r&&n!=="fixed")if((Oa(t)!=="body"||d$(i))&&(a=h$(t)),vo(t)){const s=wa(t,!0);u.x=s.x+t.clientLeft,u.y=s.y+t.clientTop}else i&&(u.x=G4(i));return{x:o.left+a.scrollLeft-u.x,y:o.top+a.scrollTop-u.y,width:o.width,height:o.height}}function Y4(e){return Oa(e)==="html"?e:e.assignedSlot||e.parentNode||(f$(e)?e.host:null)||qu(e)}function Z4(e){return!vo(e)||Bu(e).position==="fixed"?null:e.offsetParent}function Pxe(e){let t=Y4(e);for(f$(t)&&(t=t.host);vo(t)&&!["html","body"].includes(Oa(t));){if(V4(t))return t;{const n=t.parentNode;t=f$(n)?n.host:n}}return null}function mM(e){const t=Ia(e);let n=Z4(e);for(;n&&kxe(n)&&Bu(n).position==="static";)n=Z4(n);return n&&(Oa(n)==="html"||Oa(n)==="body"&&Bu(n).position==="static"&&!V4(n))?t:n||Pxe(e)||t}function X4(e){if(vo(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=wa(e);return{width:t.width,height:t.height}}function Fxe(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=vo(n),o=qu(n);if(n===o)return t;let a={scrollLeft:0,scrollTop:0};const u={x:0,y:0};if((i||!i&&r!=="fixed")&&((Oa(n)!=="body"||d$(o))&&(a=h$(n)),vo(n))){const s=wa(n,!0);u.x=s.x+n.clientLeft,u.y=s.y+n.clientTop}return{...t,x:t.x-a.scrollLeft+u.x,y:t.y-a.scrollTop+u.y}}function Dxe(e,t){const n=Ia(e),r=qu(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,u=0,s=0;if(i){o=i.width,a=i.height;const c=H4();(c||!c&&t==="fixed")&&(u=i.offsetLeft,s=i.offsetTop)}return{width:o,height:a,x:u,y:s}}function Lxe(e){var t;const n=qu(e),r=h$(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=im(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=im(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0);let u=-r.scrollLeft+G4(e);const s=-r.scrollTop;return Bu(i||n).direction==="rtl"&&(u+=im(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:u,y:s}}function Q4(e){const t=Y4(e);return["html","body","#document"].includes(Oa(t))?e.ownerDocument.body:vo(t)&&d$(t)?t:Q4(t)}function id(e,t){var n;t===void 0&&(t=[]);const r=Q4(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=Ia(r),a=i?[o].concat(o.visualViewport||[],d$(r)?r:[]):r,u=t.concat(a);return i?u:u.concat(id(a))}function jxe(e,t){const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&f$(n)){let r=t;do{if(r&&e===r)return!0;r=r.parentNode||r.host}while(r)}return!1}function Uxe(e,t){const n=wa(e,!1,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft;return{top:r,left:i,x:i,y:r,right:i+e.clientWidth,bottom:r+e.clientHeight,width:e.clientWidth,height:e.clientHeight}}function e5(e,t,n){return t==="viewport"?c$(Dxe(e,n)):zu(t)?Uxe(t,n):c$(Lxe(qu(e)))}function Bxe(e){const t=id(e),r=["absolute","fixed"].includes(Bu(e).position)&&vo(e)?mM(e):e;return zu(r)?t.filter(i=>zu(i)&&jxe(i,r)&&Oa(i)!=="body"):[]}function zxe(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?Bxe(t):[].concat(n),r],u=a[0],s=a.reduce((c,l)=>{const f=e5(t,l,i);return c.top=im(f.top,c.top),c.right=J4(f.right,c.right),c.bottom=J4(f.bottom,c.bottom),c.left=im(f.left,c.left),c},e5(t,u,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}const qxe={getClippingRect:zxe,convertOffsetParentRelativeRectToViewportRelativeRect:Fxe,isElement:zu,getDimensions:X4,getOffsetParent:mM,getDocumentElement:qu,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:Nxe(t,mM(n),r),floating:{...X4(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>Bu(e).direction==="rtl"};function Kxe(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=!0,animationFrame:u=!1}=r,s=i&&!u,c=o&&!u,l=s||c?[...zu(e)?id(e):[],...id(t)]:[];l.forEach(v=>{s&&v.addEventListener("scroll",n,{passive:!0}),c&&v.addEventListener("resize",n)});let f=null;if(a){let v=!0;f=new ResizeObserver(()=>{v||n(),v=!1}),zu(e)&&!u&&f.observe(e),f.observe(t)}let d,p=u?wa(e):null;u&&h();function h(){const v=wa(e);p&&(v.x!==p.x||v.y!==p.y||v.width!==p.width||v.height!==p.height)&&n(),p=v,d=requestAnimationFrame(h)}return n(),()=>{var v;l.forEach(y=>{s&&y.removeEventListener("scroll",n),c&&y.removeEventListener("resize",n)}),(v=f)==null||v.disconnect(),f=null,u&&cancelAnimationFrame(d)}}const Vxe=(e,t,n)=>yxe(e,t,{platform:qxe,...n});var vM=typeof document<"u"?ae.useLayoutEffect:ae.useEffect;function m$(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!m$(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!m$(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Hxe(e){const t=ye.useRef(e);return vM(()=>{t.current=e}),t}function Jxe(e){let{middleware:t,placement:n="bottom",strategy:r="absolute",whileElementsMounted:i}=e===void 0?{}:e;const[o,a]=ye.useState({x:null,y:null,strategy:r,placement:n,middlewareData:{}}),[u,s]=ye.useState(t);m$(u==null?void 0:u.map(g=>{let{name:I,options:T}=g;return{name:I,options:T}}),t==null?void 0:t.map(g=>{let{name:I,options:T}=g;return{name:I,options:T}}))||s(t);const c=ye.useRef(null),l=ye.useRef(null),f=ye.useRef(null),d=ye.useRef(o),p=Hxe(i),h=ye.useCallback(()=>{!c.current||!l.current||Vxe(c.current,l.current,{middleware:u,placement:n,strategy:r}).then(g=>{v.current&&!m$(d.current,g)&&(d.current=g,P5.flushSync(()=>{a(g)}))})},[u,n,r]);vM(()=>{v.current&&h()},[h]);const v=ye.useRef(!1);vM(()=>(v.current=!0,()=>{v.current=!1}),[]);const y=ye.useCallback(()=>{if(typeof f.current=="function"&&(f.current(),f.current=null),c.current&&l.current)if(p.current){const g=p.current(c.current,l.current,h);f.current=g}else h()},[h,p]),b=ye.useCallback(g=>{c.current=g,y()},[y]),w=ye.useCallback(g=>{l.current=g,y()},[y]),F=ye.useMemo(()=>({reference:c,floating:l}),[]);return ye.useMemo(()=>({...o,update:h,refs:F,reference:b,floating:w}),[o,h,F,b,w])}var Ku=typeof document<"u"?ae.useLayoutEffect:ae.useEffect;function Gxe(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(i=>i(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){e.set(t,(e.get(t)||[]).filter(r=>r!==n))}}}let gM=!1,Yxe=0;const t5=()=>"floating-ui-"+Yxe++;function Zxe(){const[e,t]=ye.useState(()=>gM?t5():void 0);return Ku(()=>{e==null&&t(t5())},[]),ye.useEffect(()=>{gM||(gM=!0)},[]),e}const n5=ye["useId".toString()],r5=n5!=null?n5:Zxe,Xxe=ye.createContext(null),Qxe=ye.createContext(null),i5=()=>{var e,t;return(e=(t=ye.useContext(Xxe))==null?void 0:t.id)!=null?e:null},yM=()=>ye.useContext(Qxe);function bM(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function o5(e){var t;return(t=bM(e).defaultView)!=null?t:window}function v$(e){return e?e instanceof o5(e).Element:!1}function eCe(e){return e?e instanceof o5(e).HTMLElement:!1}const a5=ye["useInsertionEffect".toString()];function $M(e){const t=ye.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return a5?a5(()=>{t.current=e}):t.current=e,ye.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}function tCe(e){let{open:t=!1,onOpenChange:n,whileElementsMounted:r,placement:i,middleware:o,strategy:a,nodeId:u}=e===void 0?{}:e;const[s,c]=ye.useState(null),l=yM(),f=ye.useRef(null),d=ye.useRef({}),p=ye.useState(()=>Gxe())[0],h=Jxe({placement:i,middleware:o,strategy:a,whileElementsMounted:r}),v=$M(n),y=ye.useMemo(()=>({...h.refs,domReference:f}),[h.refs]),b=ye.useMemo(()=>({...h,refs:y,dataRef:d,nodeId:u,events:p,open:t,onOpenChange:v,_:{domReference:s}}),[h,u,p,t,v,y,s]);Ku(()=>{const g=l==null?void 0:l.nodesRef.current.find(I=>I.id===u);g&&(g.context=b)});const{reference:w}=h,F=ye.useCallback(g=>{(v$(g)||g===null)&&(b.refs.domReference.current=g,c(g)),w(g)},[w,b.refs]);return ye.useMemo(()=>({...h,context:b,refs:y,reference:F}),[h,y,b,F])}function _M(e,t,n){const r=new Map;return{...n==="floating"&&{tabIndex:-1},...e,...t.map(i=>i?i[n]:null).concat(e).reduce((i,o)=>(o&&Object.entries(o).forEach(a=>{let[u,s]=a;if(u.indexOf("on")===0){if(r.has(u)||r.set(u,[]),typeof s=="function"){var c;(c=r.get(u))==null||c.push(s),i[u]=function(){for(var l,f=arguments.length,d=new Array(f),p=0;p<f;p++)d[p]=arguments[p];(l=r.get(u))==null||l.forEach(h=>h(...d))}}}else i[u]=s}),i),{})}}const nCe=function(e){return e===void 0&&(e=[]),{getReferenceProps:t=>_M(t,e,"reference"),getFloatingProps:t=>_M(t,e,"floating"),getItemProps:t=>_M(t,e,"item")}};function SM(e,t){var n;let r=(n=e.filter(a=>{var u;return a.parentId===t&&((u=a.context)==null?void 0:u.open)}))!=null?n:[],i=r;for(;i.length;){var o;i=(o=e.filter(a=>{var u;return(u=i)==null?void 0:u.some(s=>{var c;return a.parentId===s.id&&((c=a.context)==null?void 0:c.open)})}))!=null?o:[],r=r.concat(i)}return r}function u5(e){let t=e.activeElement;for(;((n=t)==null||(r=n.shadowRoot)==null?void 0:r.activeElement)!=null;){var n,r;t=t.shadowRoot.activeElement}return t}function rCe(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Vu(e){e.preventDefault(),e.stopPropagation()}function iCe(e){const t=ae.useRef(e);return Ku(()=>{t.current=e}),t}function s5(e){const t=ae.useRef();return Ku(()=>{t.current=e},[e]),t.current}const oCe=function(e,t){let{open:n}=e,{enabled:r=!0,role:i="dialog"}=t===void 0?{}:t;const o=r5(),a=r5(),u={id:o,role:i};return r?i==="tooltip"?{reference:{"aria-describedby":n?o:void 0},floating:u}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":i==="alertdialog"?"dialog":i,"aria-controls":n?o:void 0,...i==="listbox"&&{role:"combobox"},...i==="menu"&&{id:a}},floating:{...u,...i==="menu"&&{"aria-labelledby":a}}}:{}};function TM(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}const aCe=function(e,t){let{open:n,onOpenChange:r,refs:i,events:o,nodeId:a}=e,{enabled:u=!0,escapeKey:s=!0,outsidePointerDown:c=!0,referencePointerDown:l=!1,ancestorScroll:f=!1,bubbles:d=!0}=t===void 0?{}:t;const p=yM(),h=i5()!=null,v=ye.useRef(!1);return ye.useEffect(()=>{if(!n||!u)return;function y(I){if(I.key==="Escape"){if(!d&&p&&SM(p.nodesRef.current,a).length>0)return;o.emit("dismiss",{preventScroll:!1}),r(!1)}}function b(I){const T=v.current;if(v.current=!1,T)return;const k=rCe(I);if(v$(k)&&i.floating.current){var E;const q=(E=i.floating.current.ownerDocument.defaultView)!=null?E:window,x=k.scrollWidth>k.clientWidth,J=k.scrollHeight>k.clientHeight;let O=J&&I.offsetX>k.clientWidth;if(J&&q.getComputedStyle(k).direction==="rtl"&&(O=I.offsetX<=k.offsetWidth-k.clientWidth),O||x&&I.offsetY>k.clientHeight)return}const H=p&&SM(p.nodesRef.current,a).some(q=>{var x;return TM(I,(x=q.context)==null?void 0:x.refs.floating.current)});TM(I,i.floating.current)||TM(I,i.domReference.current)||H||!d&&p&&SM(p.nodesRef.current,a).length>0||(o.emit("dismiss",h?{preventScroll:!0}:!1),r(!1))}function w(){r(!1)}const F=bM(i.floating.current);s&&F.addEventListener("keydown",y),c&&F.addEventListener("pointerdown",b);const g=(f?[...v$(i.reference.current)?id(i.reference.current):[],...v$(i.floating.current)?id(i.floating.current):[]]:[]).filter(I=>{var T;return I!==((T=F.defaultView)==null?void 0:T.visualViewport)});return g.forEach(I=>I.addEventListener("scroll",w,{passive:!0})),()=>{s&&F.removeEventListener("keydown",y),c&&F.removeEventListener("pointerdown",b),g.forEach(I=>I.removeEventListener("scroll",w))}},[s,c,o,p,a,n,r,f,u,d,i,h]),u?{reference:{onPointerDown(){l&&(o.emit("dismiss"),r(!1))}},floating:{onPointerDownCapture(){v.current=!0}}}:{}},IM="ArrowUp",g$="ArrowDown",od="ArrowLeft",om="ArrowRight";function y$(e,t,n){return Math.floor(e/t)!==n}function am(e,t){return t<0||t>=e.current.length}function $n(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:i,amount:o=1}=t===void 0?{}:t;const a=e.current;let u=n;do{var s,c;u=u+(r?-o:o)}while(u>=0&&u<=a.length-1&&(i?i.includes(u):a[u]==null||((s=a[u])==null?void 0:s.hasAttribute("disabled"))||((c=a[u])==null?void 0:c.getAttribute("aria-disabled"))==="true"));return u}function b$(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function c5(e,t){return b$(t,e===IM||e===g$,e===od||e===om)}function OM(e,t,n){return b$(t,e===g$,n?e===od:e===om)||e==="Enter"||e==" "||e===""}function uCe(e,t,n){return b$(t,n?e===od:e===om,e===g$)}function sCe(e,t,n){return b$(t,n?e===om:e===od,e===IM)}function wM(e,t){return $n(e,{disabledIndices:t})}function l5(e,t){return $n(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}const cCe=function(e,t){let{open:n,onOpenChange:r,refs:i}=e,{listRef:o,activeIndex:a,onNavigate:u=()=>{},enabled:s=!0,selectedIndex:c=null,allowEscape:l=!1,loop:f=!1,nested:d=!1,rtl:p=!1,virtual:h=!1,focusItemOnOpen:v="auto",focusItemOnHover:y=!0,openOnArrowKeyDown:b=!0,disabledIndices:w=void 0,orientation:F="vertical",cols:g=1}=t===void 0?{listRef:{current:[]},activeIndex:null,onNavigate:()=>{}}:t;process.env.NODE_ENV!=="production"&&(l&&(f||console.warn(["Floating UI: `useListNavigation` looping must be enabled to allow","escaping."].join(" ")),h||console.warn(["Floating UI: `useListNavigation` must be virtual to allow","escaping."].join(" "))),F==="vertical"&&g>1&&console.warn(["Floating UI: In grid list navigation mode (`cols` > 1), the",'`orientation` should be either "horizontal" or "both".'].join(" ")));const I=i5(),T=yM(),k=s5(n),E=$M(u),H=$M(s5(u)),q=ye.useRef(v),x=ye.useRef(c!=null?c:-1),J=ye.useRef(null),O=iCe(w),R=ye.useRef(!1),C=ye.useRef(-1),[L,z]=ye.useState(),j=ye.useCallback((_,U)=>{C.current=requestAnimationFrame(()=>{if(h){var Y;z((Y=_.current[U.current])==null?void 0:Y.id)}else{var ge;(ge=_.current[U.current])==null||ge.focus({preventScroll:!0})}})},[h]);Ku(()=>{!s||(!k&&n&&q.current&&c!=null&&E(c),k&&!n&&(cancelAnimationFrame(C.current),x.current=-1,H(null)))},[n,k,c,o,j,s,E,H]),Ku(()=>{if(!!s&&n)if(a==null){if(c!=null)return;k&&(x.current=-1,j(o,x)),!k&&q.current&&(J.current!=null||q.current===!0&&J.current==null)&&(x.current=J.current==null||OM(J.current,F,p)||d?wM(o,O.current):l5(o,O.current),E(x.current),j(o,x))}else am(o,a)||(x.current=a,j(o,x))},[n,k,a,c,d,o,E,j,s,l,F,p,h,O]),Ku(()=>{if(!!s&&!n&&k){var _,U;const Y=T==null||(_=T.nodesRef.current.find(ge=>ge.id===I))==null||(U=_.context)==null?void 0:U.refs.floating.current;Y&&!Y.contains(u5(bM(Y)))&&Y.focus({preventScroll:!0})}},[s,n,k,T,I]),Ku(()=>{J.current=null});function S(_){if(R.current=!0,d&&sCe(_.key,F,p)){Vu(_),r(!1),eCe(i.domReference.current)&&i.domReference.current.focus();return}const U=x.current,Y=wM(o,w),ge=l5(o,w);if(_.key==="Home"&&(x.current=Y,E(x.current)),_.key==="End"&&(x.current=ge,E(x.current)),g>1){const he=x.current;if(_.key===IM){if(Vu(_),he===-1)x.current=ge;else if(x.current=$n(o,{startingIndex:he,amount:g,decrement:!0,disabledIndices:w}),f&&(he-g<Y||x.current<0)){const Te=he%g,Qe=ge%g,Ft=ge-(Qe-Te);Qe===Te?x.current=ge:x.current=Qe>Te?Ft:Ft-g}am(o,x.current)&&(x.current=he),E(x.current)}if(_.key===g$&&(Vu(_),he===-1?x.current=Y:(x.current=$n(o,{startingIndex:he,amount:g,disabledIndices:w}),f&&he+g>ge&&(x.current=$n(o,{startingIndex:he%g-g,amount:g,disabledIndices:w}))),am(o,x.current)&&(x.current=he),E(x.current)),F==="both"){const Te=Math.floor(he/g);_.key===om&&(Vu(_),he%g!==g-1?(x.current=$n(o,{startingIndex:he,disabledIndices:w}),f&&y$(x.current,g,Te)&&(x.current=$n(o,{startingIndex:he-he%g-1,disabledIndices:w}))):f&&(x.current=$n(o,{startingIndex:he-he%g-1,disabledIndices:w})),y$(x.current,g,Te)&&(x.current=he)),_.key===od&&(Vu(_),he%g!==0?(x.current=$n(o,{startingIndex:he,disabledIndices:w,decrement:!0}),f&&y$(x.current,g,Te)&&(x.current=$n(o,{startingIndex:he+(g-he%g),decrement:!0,disabledIndices:w}))):f&&(x.current=$n(o,{startingIndex:he+(g-he%g),decrement:!0,disabledIndices:w})),y$(x.current,g,Te)&&(x.current=he));const Qe=Math.floor(ge/g)===Te;am(o,x.current)&&(f&&Qe?x.current=_.key===od?ge:$n(o,{startingIndex:he-he%g-1,disabledIndices:w}):x.current=he),E(x.current);return}}if(c5(_.key,F)){if(Vu(_),n&&!h&&u5(_.currentTarget.ownerDocument)===_.currentTarget){x.current=OM(_.key,F,p)?Y:ge,E(x.current);return}OM(_.key,F,p)?f?x.current=U>=ge?l&&U!==o.current.length?-1:Y:$n(o,{startingIndex:U,disabledIndices:w}):x.current=Math.min(ge,$n(o,{startingIndex:U,disabledIndices:w})):f?x.current=U<=Y?l&&U!==-1?o.current.length:ge:$n(o,{startingIndex:U,decrement:!0,disabledIndices:w}):x.current=Math.max(Y,$n(o,{startingIndex:U,decrement:!0,disabledIndices:w})),am(o,x.current)?E(null):E(x.current)}}return s?{reference:{...h&&n&&a!=null&&{"aria-activedescendant":L},onKeyDown(_){if(R.current=!0,h&&n)return S(_);if((_.key.indexOf("Arrow")===0||_.key==="Enter"||_.key===" "||_.key==="")&&(J.current=_.key),d){uCe(_.key,F,p)&&(Vu(_),n?(x.current=wM(o,w),E(x.current)):r(!0));return}c5(_.key,F)&&(c!=null&&(x.current=c),Vu(_),!n&&b?r(!0):S(_),n&&E(x.current))}},floating:{"aria-orientation":F==="both"?void 0:F,...h&&a!=null&&{"aria-activedescendant":L},onKeyDown:S,onPointerMove(){R.current=!1}},item:{onFocus(_){let{currentTarget:U}=_;const Y=o.current.indexOf(U);Y!==-1&&E(Y)},onClick:_=>{let{currentTarget:U}=_;return U.focus({preventScroll:!0})},...y&&{onMouseMove(_){let{currentTarget:U}=_;const Y=U;if(Y){const ge=o.current.indexOf(Y);ge!==-1&&E(ge)}},onPointerLeave(){if(!R.current&&(x.current=-1,j(o,x),E(null),!h)){var _;(_=i.floating.current)==null||_.focus({preventScroll:!0})}}}}}:{}};function lCe(e){var t;const{char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:a}=e,u=XEe(n),s=new RegExp(`\\s${u}$`),c=o?"^":"",l=r?new RegExp(`${c}${u}.*?(?=\\s${u}|$)`,"gm"):new RegExp(`${c}(?:^)?${u}[^\\s${u}]*`,"gm"),f=((t=a.nodeBefore)===null||t===void 0?void 0:t.isText)&&a.nodeBefore.text;if(!f)return null;const d=a.pos-f.length,p=Array.from(f.matchAll(l)).pop();if(!p||p.input===void 0||p.index===void 0)return null;const h=p.input.slice(Math.max(0,p.index-1),p.index),v=new RegExp(`^[${i==null?void 0:i.join("")}\0]?$`).test(h);if(i!==null&&!v)return null;const y=d+p.index;let b=y+p[0].length;return r&&s.test(f.slice(b-1,b+1))&&(p[0]+=" ",b+=1),y<a.pos&&b>=a.pos?{range:{from:y,to:b},query:p[0].slice(n.length),text:p[0]}:null}const fCe=new Ru("suggestion");function dCe({pluginKey:e=fCe,editor:t,char:n="@",allowSpaces:r=!1,allowedPrefixes:i=[" "],startOfLine:o=!1,decorationTag:a="span",decorationClass:u="suggestion",command:s=()=>null,items:c=()=>[],render:l=()=>({}),allow:f=()=>!0}){let d;const p=l==null?void 0:l(),h=new Kr({key:e,view(){return{update:async(v,y)=>{var b,w,F,g,I,T,k;const E=(b=this.key)===null||b===void 0?void 0:b.getState(y),H=(w=this.key)===null||w===void 0?void 0:w.getState(v.state),q=E.active&&H.active&&E.range.from!==H.range.from,x=!E.active&&H.active,J=E.active&&!H.active,O=!x&&!J&&E.query!==H.query,R=x||q,C=O&&!q,L=J||q;if(!R&&!C&&!L)return;const z=L&&!R?E:H,j=v.dom.querySelector(`[data-decoration-id="${z.decorationId}"]`);d={editor:t,range:z.range,query:z.query,text:z.text,items:[],command:S=>{s({editor:t,range:z.range,props:S})},decorationNode:j,clientRect:j?()=>{var S;const{decorationId:_}=(S=this.key)===null||S===void 0?void 0:S.getState(t.state),U=v.dom.querySelector(`[data-decoration-id="${_}"]`);return(U==null?void 0:U.getBoundingClientRect())||null}:null},R&&((F=p==null?void 0:p.onBeforeStart)===null||F===void 0||F.call(p,d)),C&&((g=p==null?void 0:p.onBeforeUpdate)===null||g===void 0||g.call(p,d)),(C||R)&&(d.items=await c({editor:t,query:z.query})),L&&((I=p==null?void 0:p.onExit)===null||I===void 0||I.call(p,d)),C&&((T=p==null?void 0:p.onUpdate)===null||T===void 0||T.call(p,d)),R&&((k=p==null?void 0:p.onStart)===null||k===void 0||k.call(p,d))},destroy:()=>{var v;!d||(v=p==null?void 0:p.onExit)===null||v===void 0||v.call(p,d)}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(v,y,b,w){const{isEditable:F}=t,{composing:g}=t.view,{selection:I}=v,{empty:T,from:k}=I,E={...y};if(E.composing=g,F&&(T||t.view.composing)){(k<y.range.from||k>y.range.to)&&!g&&!y.composing&&(E.active=!1);const H=lCe({char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:I.$from}),q=`id_${Math.floor(Math.random()*4294967295)}`;H&&f({editor:t,state:w,range:H.range})?(E.active=!0,E.decorationId=y.decorationId?y.decorationId:q,E.range=H.range,E.query=H.query,E.text=H.text):E.active=!1}else E.active=!1;return E.active||(E.decorationId=null,E.range={from:0,to:0},E.query=null,E.text=null),E}},props:{handleKeyDown(v,y){var b;const{active:w,range:F}=h.getState(v.state);return w&&((b=p==null?void 0:p.onKeyDown)===null||b===void 0?void 0:b.call(p,{view:v,event:y,range:F}))||!1},decorations(v){const{active:y,range:b,decorationId:w}=h.getState(v);return y?Vt.create(v.doc,[Sr.inline(b.from,b.to,{nodeName:a,class:u,"data-decoration-id":w})]):null}}});return h}function f5(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=f5(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function pCe(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=f5(e))&&(r&&(r+=" "),r+=t);return r}const hCe=Or.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",dn(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),go={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"},$$=()=>(++$$.i).toString();$$.i=0;const mCe=e=>{const t=vCe(e),n=[];for(let r=0;r<t.length;r++)n.push(d5(t[r]));return{key:$$(),children:n}},um=(e,t=[])=>({key:$$(),type:e.type,text:"text"in e?e.text:void 0,node:e,children:t}),EM=e=>um({type:go.span,text:e,spans:[]}),vCe=e=>{const t=e.slice(0);for(let n=0;n<t.length;n++){const r=t[n];if(r.type===go.listItem||r.type===go.oListItem){const i=[r];for(;t[n+1]&&t[n+1].type===r.type;)i.push(t[n+1]),t.splice(n,1);r.type===go.listItem?t[n]={type:go.list,items:i}:t[n]={type:go.oList,items:i}}}return t},d5=e=>{if("text"in e)return um(e,p5(e.spans,e));if("items"in e){const t=[];for(let n=0;n<e.items.length;n++)t.push(d5(e.items[n]));return um(e,t)}return um(e)},p5=(e,t,n)=>{if(!e.length)return[EM(t.text)];const r=e.slice(0);r.sort((o,a)=>o.start-a.start||a.end-o.end);const i=[];for(let o=0;o<r.length;o++){const a=r[o],u=n&&n.start||0,s=a.start-u,c=a.end-u,l=t.text.slice(s,c),f=[];for(let p=o;p<r.length;p++){const h=r[p];h!==a&&h.start>=a.start&&h.end<=a.end&&(f.push(h),r.splice(p,1),p--)}o===0&&s>0&&i.push(EM(t.text.slice(0,s)));const d={...a,text:l};i.push(um(d,p5(f,{...t,text:l},a))),c<t.text.length&&i.push(EM(t.text.slice(c,r[o+1]?r[o+1].start-u:void 0)))}return i},gCe=(e,t)=>h5(mCe(e).children,t),h5=(e,t)=>{const n=[];for(let r=0;r<e.length;r++){const i=e[r],o=t(i.type,i.node,i.text,h5(i.children,t),i.key);o!=null&&n.push(o)}return n};go.listItem+"",go.oListItem+"",go.list+"",go.oList+"";const yCe=Or.create({name:"text",group:"inline"}),bCe={groupBy(e,t){return e.reduce((n,r)=>{const i=t(r),o=(n.get(i)||[]).concat(r);return n.set(i,o)},new Map)},sort(e){return[...e].sort((t,n)=>t.start-n.start)},mergeOverlap(e){const t=this.groupBy(e,r=>r.type),n=Array.from(t.entries()).map(([r,i])=>(this.sort(i).reduce((o,a)=>{if(!o.length)return[a];const u=o.length-1,s=o[u];return s.end>=a.start?[...o.slice(0,u),{...s,end:a.end}]:[...o,a]},[]),i)).reduce((r,i)=>[...r,...i],[]);return this.sort(n)}},m5={fromPrismic(e){return t=>{var n;return(n=AM.find(r=>r.richTextNodeTypes[0]===t.type))==null?void 0:n.converter.fromPrismic(e)(t)}},toPrismic(e,t,n){const[r,i]=(()=>{const o=AM.find(a=>e.type.name===a.name);if(!o)throw new Error(`Invalid mark extension '${e.type.name}'.`);return[o.richTextNodeTypes[0],o.converter.toPrismic(e)]})();return{type:r,start:t,end:n,...i?{data:i}:{}}}},v5=yCe.extend({name:"text"}),$Ce={fromPrismic(e){return function(t,n,r=!1){const i={type:t,text:n.content.text,spans:n.content.spans||[]};return gCe([i],_Ce(e,r))[0]}},toPrismic(e,t,n){const r=xc.children.reduce(e,(i,o)=>{const a=(()=>o.type.name===s$.name?s$.converter.toPrismic(o):o.textContent)(),u=a?i.text+a:i.text,s=i.text.length,c=u.length,l=(()=>o.marks.length?xc.marks.map(o,d=>m5.toPrismic(d,s,c)):void 0)();return{...i,text:u,spans:l?[...i.spans,...l]:i.spans}},{text:"",spans:[]});return{type:t,content:{text:r.text,spans:[...bCe.mergeOverlap(r.spans)].sort((i,o)=>i.type.localeCompare(o.type))},...n}}};function _Ce(e,t=!1){return(n,r,i,o)=>{if(n==="span"&&i&&i.length)return t?[e.text(i)]:s$.splitTextToNodes(e,i)(a=>e.text(a));{const a=m5.fromPrismic(e)(r);return a?s0(o).map(s=>s.mark([...s.marks,a].sort((c,l)=>c.type.name.localeCompare(l.type.name)))):s0(o)}}}const Cc={name:v5.name,component:v5,converter:$Ce};var g5=(e=>(e.LeftToRight="ltr",e.RightToLeft="rtl",e))(g5||{});const Ac="text-direction",SCe=xe.RichTextNodeType.rtl,TCe=Ir.create({name:"textDirection",addOptions(){return{supportedExtensionNames:[]}},addGlobalAttributes(){return[{types:this.options.supportedExtensionNames,attributes:{[Ac]:{default:"ltr",parseHTML:e=>e.attributes.dir?"rtl":"ltr",renderHTML:e=>e[Ac]==="rtl"?{dir:"rtl"}:{dir:"ltr"}}}}]},addCommands(){return{setDirection:e=>({commands:t})=>{switch(e){case"rtl":return t.setRightToLeft();default:return t.setLeftToRight()}},toggleDirection:e=>({commands:t})=>{const n=e==="rtl"?"ltr":"rtl";return t.setDirection(n)},setRightToLeft:()=>({commands:e})=>this.options.supportedExtensionNames.every(t=>e.updateAttributes(t,{[Ac]:"rtl"})),setLeftToRight:()=>({commands:e})=>this.options.supportedExtensionNames.every(t=>e.resetAttributes(t,Ac))}},addKeyboardShortcuts(){return{"Mod-Shift-r":()=>this.editor.commands.setRightToLeft(),"Mod-Shift-l":()=>this.editor.commands.setLeftToRight()}}}),Ea={parseNodeAttrsDirection(e){switch(e[Ac]){case"rtl":return"rtl";default:return"ltr"}},fromPrismic(e){const t=(()=>{switch(e.direction){case"rtl":return"rtl";default:return"ltr"}})();return{[Ac]:t}},toPrismic(e){return{direction:this.parseNodeAttrsDirection(e.attrs)}}},_$=hCe.extend({name:"paragraph",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",dn(this.options.HTMLAttributes,e),0]}}),ICe={fromPrismic(e){return function(t){var r;const n=Cc.converter.fromPrismic(e)(_$.name,t);return(r=e.nodes[_$.name])==null?void 0:r.create(Ea.fromPrismic(t),n)}},toPrismic(e){return Cc.converter.toPrismic(e,xe.RichTextNodeType.paragraph,Ea.toPrismic(e))}},Hu=new td([xe.RichTextNodeType.paragraph],_$.name,_$,ICe,"Type '/' for commands"),y5=["ArrowDown","ArrowUp","End","Home"],b5=["Enter"],OCe=["Escape",...y5,...b5],wCe=Ir.create({name:"slash-commands",addOptions(){return{nodeTypes:[]}},addProseMirrorPlugins(){const e=w$(O5,this.options.nodeTypes);return e.length>1?[dCe({allowSpaces:!0,char:"/",editor:this.editor,startOfLine:!0,allow:({state:t})=>{const n=t.selection.$from;return n.parent.type.name===Hu.name&&n.depth===1},command:({editor:t,props:n,range:r})=>{n.runCommands(t,{deleteRange:r})},items:({query:t})=>{const n=t.toLocaleLowerCase().trim();return e.filter(r=>{var i,o;return((i=r.shortText)==null?void 0:i.toLocaleLowerCase().includes(n))||((o=r.text)==null?void 0:o.toLocaleLowerCase().includes(n))})},render:()=>{let t;return{onStart:n=>{t=new A4(ECe,{editor:n.editor,props:n}),document.body.appendChild(t.element)},onUpdate:n=>{t==null||t.updateProps(n)},onKeyDown:({event:n})=>{var r;return OCe.includes(n.key)&&((r=t==null?void 0:t.ref)==null?void 0:r.handleKeyDown(n))},onExit:()=>{t==null||t.destroy(),t==null||t.element.remove()}}}})]:[]}}),ECe=ae.forwardRef(function({command:t,decorationNode:n,editor:r,items:i},o){const[a,u]=ae.useState(!0),s=parseFloat(P.tokens.space[4]),{context:c,floating:l,reference:f,strategy:d,x:p,y:h}=tCe({middleware:[Mxe(s),Exe(),xxe({limiter:Cxe()})],onOpenChange:u,open:a,placement:"top-start",strategy:"fixed",whileElementsMounted:Kxe});ae.useLayoutEffect(()=>{f(n)},[f,n]),ae.useEffect(()=>{let x;const J=()=>{x=setTimeout(()=>{u(!0)})},O=()=>{u(!1)};return r.on("focus",J).on("blur",O),()=>{r.off("focus",J).off("blur",O),clearTimeout(x)}},[r]);const[v,y]=ae.useState(0),b=ae.useRef([]),[w,F]=ae.useState();i!==w&&(y(0),b.current=[],F(i));const{getFloatingProps:g,getItemProps:I,getReferenceProps:T}=nCe([aCe(c,{outsidePointerDown:!1}),cCe(c,{activeIndex:v,listRef:b,onNavigate:x=>{y(J=>x!=null?x:J)},openOnArrowKeyDown:!1,virtual:!0}),oCe(c,{role:"menu"})]),E=T().onKeyDown;ae.useImperativeHandle(o,()=>({handleKeyDown:x=>{if(a){if(y5.includes(x.key)&&E(x),b5.includes(x.key)){const J=i[v];J!==void 0&&t(J)}return!0}else return!1}}),[v,t,i,E,a]);const H=p!==null&&h!==null,q=ae.useId();return a?Ue("div",{...g(),className:P.dropdownMenuStyles.content,ref:l,style:{insetBlockStart:parseFloat(P.tokens.space[0]),insetInlineStart:parseFloat(P.tokens.space[0]),minInlineSize:256,position:d,transform:H?`translate3d(${Math.round(p)}px, ${Math.round(h)}px, 0)`:"translate3d(0, -200%, 0)"},children:[i.map((x,J)=>{var O;return ae.createElement($5,{...I({onClick:()=>{t(x)},onPointerDown:R=>{R.preventDefault()}}),"data-highlighted":J===v?"":void 0,id:`${q}[${J}]`,key:x.nodeType,ref:R=>{b.current[J]=R},shortcut:`/${(O=x.shortText)!=null?O:""}`,startIcon:x.icon},x.text)}),i.length===0?A($5,{...I({onPointerDown:x=>{x.preventDefault()}}),disabled:!0,id:`${q}[0]`,ref:x=>{b.current[0]=x},children:"No results"}):null]}):null}),$5=ae.forwardRef(function({children:t,disabled:n,shortcut:r,startIcon:i,...o},a){return Ue("div",{...o,...n?{"aria-disabled":!0,"data-disabled":!0}:{},className:P.dropdownMenuStyles.item,ref:a,role:"menuitem",children:[ae.isValidElement(i)?ae.cloneElement(i,{className:pCe(i.props.className,P.dropdownMenuStyles.itemStartIcon)}):null,A(P.Text,{className:P.dropdownMenuStyles.itemText,component:"span",children:t}),r?A(P.Text,{className:P.dropdownMenuStyles.itemShortcut,color:"inherit",component:"span",variant:"inherit",weight:"inherit",children:r}):null]})});function RCe(e,t){var o;const n=t.map(a=>a.richTextNodeTypes).flat(),r=m(t,li(a=>a.nodeType===ed.Text),fv({},(a,u)=>({...a,[u.name]:u.placeholder}))),i=n.includes(xe.RichTextNodeType.orderedList)||n.includes(xe.RichTextNodeType.list);return li(a=>a!==void 0)([dM.component(((o=e.config)==null?void 0:o.single)===void 0),Cc.component,s$.component,gxe(r),i?nd.component:void 0,wCe.configure({nodeTypes:n})])}const RM=uxe.extend({name:"bulletList",parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:e}){return["ul",dn(this.options.HTMLAttributes,e),0]}}).configure({itemTypeName:"listItem"}),MCe={fromPrismic(e){return function(t){var r;const n=nd.converter.fromPrismic(e)(t);if(!!n)return(r=e.nodes[RM.name])==null?void 0:r.create(Ea.fromPrismic(t),n)}},toPrismic(e){return NS(xc.children.map(e,t=>li(n=>n!==void 0)(nd.converter.toPrismic(t,xe.RichTextNodeType.list))))}},S$=new cM([xe.RichTextNodeType.list],RM.name,RM,MCe),xCe=/^```([a-z]+)?[\s\n]$/,CCe=/^~~~([a-z]+)?[\s\n]$/,T$=Or.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:e=>{var t;const{languageClassPrefix:n}=this.options,o=[...((t=e.firstElementChild)===null||t===void 0?void 0:t.classList)||[]].filter(a=>a.startsWith(n)).map(a=>a.replace(n,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:e,HTMLAttributes:t}){return["pre",dn(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const o=r.parentOffset===r.parent.nodeSize-2,a=r.parent.textContent.endsWith(`
146
146
 
147
- `);return!o||!a?!1:e.chain().command(({tr:u})=>(u.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const u=i.after();return u===void 0||r.nodeAt(u)?!1:e.commands.exitCode()}}},addInputRules(){return[VR({find:bCe,type:this.type,getAttributes:e=>({language:e[1]})}),VR({find:$Ce,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new Kr({key:new xu("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=i==null?void 0:i.mode;if(!n||!o)return!1;const{tr:a}=e.state;return a.replaceSelectionWith(this.type.create({language:o})),a.setSelection(Ae.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.insertText(n.replace(/\r\n?/g,`
148
- `)),a.setMeta("paste",!0),e.dispatch(a),!0}}})]}}).extend({name:"preformatted",addAttributes(){return{language:{default:null,parseHTML:e=>{var o;const{languageClassPrefix:t}=this.options,i=[...((o=e.firstElementChild)==null?void 0:o.classList)||[]].filter(a=>a.startsWith(t)).map(a=>a.replace(t,""))[0];return i||null},renderHTML:e=>e.language?{class:this.options.languageClassPrefix+e.language}:null}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({HTMLAttributes:e}){return["pre",dn(this.options.HTMLAttributes),["code",e,0]]}}).configure({exitOnTripleEnter:!1}),_Ce={fromPrismic(e){return function(t){var r;const n=Ac.converter.fromPrismic(e)(I$.name,t,!0);return(r=e.nodes[I$.name])==null?void 0:r.create(Ra.fromPrismic(t),n)}},toPrismic(e){return Ac.converter.toPrismic(e,xe.RichTextNodeType.preformatted,Ra.toPrismic(e))}},v5=new rd([xe.RichTextNodeType.preformatted],I$.name,I$,_Ce,"",!0),SCe=()=>{const[e,t]=ue.useState();return N(CMe,{className:"react-component",children:He("div",{children:[N("input",{placeholder:"embed url",onChange:n=>{t(n.target.value)}}),e?N("iframe",{width:"560",height:"315",src:e,title:"YouTube video player",frameBorder:0,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"}):null]})})},CM=Or.create({name:"embed",group:"block",atom:!0,addAttributes(){return{src:{default:null}}},addNodeView(){return NMe(SCe)},addCommands(){return{setEmbed:()=>({tr:e,dispatch:t})=>{const n=this.type.create();return t&&e.replaceSelectionWith(n),!0}}}}),TCe={fromPrismic(e){return function(t){var r;return(r=e.nodes[CM.name])==null?void 0:r.create({},void 0)}},toPrismic(e){}};new VMe([xe.RichTextNodeType.embed],CM.name,CM,TCe);const ICe=Or.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,dn(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,"paragraph",e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>VR({find:new RegExp(`^(#{1,${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),O$="heading",Ma={byLevel(e){switch(e){case 1:return xe.RichTextNodeType.heading1;case 2:return xe.RichTextNodeType.heading2;case 3:return xe.RichTextNodeType.heading3;case 4:return xe.RichTextNodeType.heading4;case 5:return xe.RichTextNodeType.heading5;case 6:return xe.RichTextNodeType.heading6}},default(e){return{fullName:this.byLevel(e),level:e}},fromPrismic(e,t=[1,2,3,4,5,6]){const n=new RegExp(`^heading([${t.join(",")}]){1}$`),r=e.match(n);if(!r||!r[1])return;const i=parseInt(r[1]);return{fullName:Ma.byLevel(i),level:i}},fromProsemirror(e,t){const n=e.level;if(t.includes(n))return{fullName:Ma.byLevel(n),level:n}}},OCe=e=>ICe.extend({name:O$,addAttributes(){return{level:{default:e[0]},label:{default:null}}},addOptions(){return{levels:[...e],HTMLAttributes:{}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`}))},renderHTML({node:t,HTMLAttributes:n}){const r=t.attrs.level,o={...t.attrs.label?{label:t.attrs.label}:{}};return[`h${r}`,dn(this.options.HTMLAttributes,n,o),0]}}),wCe=e=>{const t=e[0];return{fromPrismic(n){return function(r){var a;const i=Ac.converter.fromPrismic(n)(O$,r),o=Ma.fromPrismic(r.type,e)||Ma.default(t);return(a=n.nodes[O$])==null?void 0:a.create({level:o.level,...Ra.fromPrismic(r)},i)}},toPrismic(n){const{fullName:r}=Ma.fromProsemirror(n.attrs,e)||Ma.default(t);return Ac.converter.toPrismic(n,r,Ra.toPrismic(n))}}};function ECe(e){if(!e)return[1,2,3,4,5,6];if(!e.size)return;const t=Array.from(e.values()).reduce((n,r)=>{const i=Ma.fromPrismic(r);return i?[...n,i.level]:n},[]).sort((n,r)=>n-r);return m(Cd(t),L0(()=>{}))}const Wc={name:O$,build:e=>{const t=ECe(e);if(!t)return;const n=Cd(t.map(r=>Ma.byLevel(r)));if(!Ne(n))return new HMe(n.value,OCe(t),t,wCe(t),r=>{const i=Ma.fromProsemirror(r,t);return i&&`Heading ${i.level}`})}},RCe=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,MCe=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,xCe=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,CCe=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,AM=Jf.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>e.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",dn(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Xb({find:RCe,type:this.type}),Xb({find:xCe,type:this.type})]},addPasteRules(){return[Qb({find:MCe,type:this.type}),Qb({find:CCe,type:this.type})]}}).extend({name:"em"}),ACe={fromPrismic(e){return function(){var t;return(t=e.marks[AM.name])==null?void 0:t.create()}},toPrismic(){}},g5=new R4([xe.RichTextNodeType.em],AM.name,AM,ACe),kCe=/^(\d+)\.\s$/,kM=Or.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return t===1?["ol",dn(this.options.HTMLAttributes,n),0]:["ol",dn(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){return[P3({find:kCe,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]})]}}).extend({name:"orderedList",addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1}}},renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return t===1?["ol",dn(this.options.HTMLAttributes,n),0]:["ol",dn(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}}}).configure({itemTypeName:"listItem"}),WCe={fromPrismic(e){return function(t){var r;const n=id.converter.fromPrismic(e)(t);if(!!n)return(r=e.nodes[kM.name])==null?void 0:r.create(Ra.fromPrismic(t),n)}},toPrismic(e){return PS(Cc.children.map(e,t=>li(n=>n!==void 0)(id.converter.toPrismic(t,xe.RichTextNodeType.orderedList))))}},w$=new fM([xe.RichTextNodeType.orderedList],kM.name,kM,WCe),y5=Gu,NCe=e=>m([Gu,T$,w$,Wc.build(e),v5],li(ga)),WM=[M4,g5],b5=e=>[...NCe(e),...WM],$5=[{nodeType:xe.RichTextNodeType.paragraph,icon:N(P.Icon,{name:"textFields"}),isActive:e=>e.isActive(Gu.name)&&!e.isActive(T$.name)&&!e.isActive(w$.name),runCommands:Rr((e,t)=>e.clearNodes().setDirection(Ai(t))),shortText:"par",text:"Paragraph"},{nodeType:xe.RichTextNodeType.heading1,icon:N(P.Icon,{name:"looks1"}),isActive:e=>e.isActive(Wc.name,{level:1}),runCommands:Rr((e,t)=>e.setHeading({level:1}).setDirection(Ai(t))),shortText:"h1",text:"Heading 1"},{nodeType:xe.RichTextNodeType.heading2,icon:N(P.Icon,{name:"looks2"}),isActive:e=>e.isActive(Wc.name,{level:2}),runCommands:Rr((e,t)=>e.setHeading({level:2}).setDirection(Ai(t))),shortText:"h2",text:"Heading 2"},{nodeType:xe.RichTextNodeType.heading3,icon:N(P.Icon,{name:"looks3"}),isActive:e=>e.isActive(Wc.name,{level:3}),runCommands:Rr((e,t)=>e.setHeading({level:3}).setDirection(Ai(t))),shortText:"h3",text:"Heading 3"},{nodeType:xe.RichTextNodeType.heading4,icon:N(P.Icon,{name:"looks4"}),isActive:e=>e.isActive(Wc.name,{level:4}),runCommands:Rr((e,t)=>e.setHeading({level:4}).setDirection(Ai(t))),shortText:"h4",text:"Heading 4"},{nodeType:xe.RichTextNodeType.heading5,icon:N(P.Icon,{name:"looks5"}),isActive:e=>e.isActive(Wc.name,{level:5}),runCommands:Rr((e,t)=>e.setHeading({level:5}).setDirection(Ai(t))),shortText:"h5",text:"Heading 5"},{nodeType:xe.RichTextNodeType.heading6,icon:N(P.Icon,{name:"looks6"}),isActive:e=>e.isActive(Wc.name,{level:6}),runCommands:Rr((e,t)=>e.setHeading({level:6}).setDirection(Ai(t))),shortText:"h6",text:"Heading 6"},{nodeType:xe.RichTextNodeType.list,icon:N(P.Icon,{name:"formatListBulleted"}),isActive:e=>e.isActive(T$.name),runCommands:Rr((e,t)=>e.toggleBulletList().setDirection(Ai(t))),shortText:"bull",text:"Bulleted list"},{nodeType:xe.RichTextNodeType.orderedList,icon:N(P.Icon,{name:"formatListNumbered"}),isActive:e=>e.isActive(w$.name),runCommands:Rr((e,t)=>e.toggleOrderedList().setDirection(Ai(t))),shortText:"num",text:"Numbered list"},{nodeType:xe.RichTextNodeType.preformatted,icon:N(P.Icon,{name:"dataObject"}),isActive:e=>e.isActive(v5.name),runCommands:Rr((e,t)=>e.setCodeBlock().setDirection(Ai(t))),shortText:"code",text:"Code"}],PCe=[{nodeType:xe.RichTextNodeType.strong,icon:N(P.Icon,{name:"formatBold"}),isActive:e=>e.isActive(M4.name),runCommands:Rr(e=>e.toggleBold())},{nodeType:xe.RichTextNodeType.em,icon:N(P.Icon,{name:"formatItalic"}),isActive:e=>e.isActive(g5.name),runCommands:Rr(e=>e.toggleItalic())}],FCe=[{nodeType:xe.RichTextNodeType.rtl,icon:N(P.Icon,{name:"formatTextDirectionRToL"}),isActive:e=>e.isActive({[kc]:d5.RightToLeft}),runCommands:Rr((e,t)=>e.toggleDirection(Ai(t)))}];function Rr(e){return(t,n={})=>{let r=n.can===!0?t.can().chain():t.chain().focus();return n.deleteRange!==void 0&&(r=r.deleteRange(n.deleteRange)),e(r,t).run()}}function Ai(e){const t=e.state.selection.$from.parent.attrs;return Ra.parseNodeAttrsDirection(t)}function E$(e,t){return e.filter(n=>t.includes(n.nodeType))}const DCe={duration:100,hideOnClick:!0,offset:[-48,parseFloat(P.tokens.space[4])],placement:"top-start",zIndex:parseFloat(P.tokens.zIndex[3])},LCe=({editor:e,nodeTypes:t})=>{var a,u;const n=E$($5,t),r=E$(PCe,t),i=E$(FCe,t),o=[n.length>1?N(P.ToolbarSelect,{onValueChange:s=>{var c;(c=n.find(l=>l.nodeType===s))==null||c.runCommands(e)},value:(u=(a=n.find(s=>s.isActive(e)))==null?void 0:a.nodeType)!=null?u:"",children:n.map(s=>N(P.ToolbarSelectItem,{value:s.nodeType,children:s.text},s.nodeType))},"node"):null,r.length>0?N(P.ToolbarToggleButtonGroup,{onValueChange:s=>{r.forEach(c=>{(c.isActive(e)&&!s.includes(c.nodeType)||!c.isActive(e)&&s.includes(c.nodeType))&&c.runCommands(e)})},type:"multiple",value:r.filter(s=>s.isActive(e)).map(s=>s.nodeType),children:r.map(s=>N(P.ToolbarToggleButtonGroupItem,{disabled:!s.runCommands(e,{can:!0}),startIcon:s.icon,value:s.nodeType},s.nodeType))},"mark"):null,i.length>0?N(ue.Fragment,{children:i.map(s=>N(P.ToolbarToggleButton,{disabled:!s.runCommands(e,{can:!0}),onPressedChange:()=>{s.runCommands(e)},pressed:s.isActive(e),startIcon:s.icon},s.nodeType))},"extra"):null,n.length+r.length+i.length>1?N(P.ToolbarButton,{onClick:()=>{e.chain().focus().clearNodes().unsetAllMarks().run()},startIcon:N(P.Icon,{name:"formatClear"})},"clear"):null].filter(ga).map((s,c)=>He(ue.Fragment,{children:[c===0?null:N(P.ToolbarSeparator,{}),s]},s.key));return o.length>0?N(OMe,{editor:e,tippyOptions:DCe,children:N(P.Toolbar,{children:o})}):null},jCe=e=>{var c;const{content:t,field:n,id:r,readOnly:i}=e,o=ue.useMemo(()=>{const{extensions:l,defaultTextConverter:f}=QMe(n.config),d=li(b=>b.extType===lM.Node)(l),p=l.flatMap(b=>b.richTextNodeTypes),h=l.map(b=>b.component),v=[...gCe(n,d),dCe.configure({supportedExtensionNames:li(b=>b.extType===lM.Node&&b.nodeType===nd.Text&&!b.lockedFormat)(l).map(b=>b.name)}),...h],y=FEe(v);return{allComponents:v,defaultTextConverter:f,nodeExtensions:d,names:p,schema:y}},[n]),a=t&&hM.converter(o.nodeExtensions).fromPrismic(o.schema,(c=o.defaultTextConverter)==null?void 0:c.call(o,o.schema))(t),u=ATe(e.onContentChange),s=FMe({...a?{content:a.toJSON()}:{},editable:!i,editorProps:{attributes:{class:P.contentEditableClass,id:r,tabIndex:"0"}},extensions:o.allComponents,injectCSS:!1,onUpdate({editor:l}){const f=hM.converter(o.nodeExtensions).toPrismic(l.state.doc);u(f)}},[o,u,i,r]);return He(P.Field,{children:[N(P.FieldLabel,{htmlFor:r,children:fc(n)}),N(P.FieldControl,{children:He(wf,{children:[N(MMe,{editor:s,style:{flex:1}}),(s==null?void 0:s.isEditable)&&N(LCe,{editor:s,nodeTypes:o.names.concat(fCe)})]})})]})},UCe=({content:e,field:t,id:n,onContentChange:r,readOnly:i})=>{var s,c,l;const o=pb(t),a=BCe(t),u=(s=e==null?void 0:e.value)!=null?s:a;return He(P.Field,{children:[N(P.FieldIcon,{children:N(P.Icon,{name:"arrowDropDownCircle"})}),N(P.FieldLabel,{htmlFor:n,children:fc(t)}),N(P.FieldControl,{children:He(P.Select,{id:n,onValueChange:f=>{i||r(zCe(f))},placeholder:o,...u===void 0?{}:{value:u},children:[u===void 0||a!==void 0?null:N(P.SelectItem,{value:"",children:o}),(l=(c=t.config)==null?void 0:c.options)==null?void 0:l.map(f=>N(P.SelectItem,{value:f,children:f},f))]})})]},u)};function BCe(e){var t,n;return((t=e.config)==null?void 0:t.default_value)===void 0||(n=e.config.options)==null?void 0:n[0]}function zCe(e){return e.length===0?void 0:{__TYPE__:"FieldContent",type:"Select",value:e}}const R$=({content:e,nestableWidget:t,...n})=>t.type===tt.WidgetTypes.BooleanField?N(_Te,{...n,content:vt(e,da.BooleanContent.is),field:t}):t.type===tt.WidgetTypes.Color?(vt(e,lTe),null):t.type===tt.WidgetTypes.Date?(vt(e,fTe),null):t.type===tt.WidgetTypes.Embed?(vt(e,da.EmbedContent.is),null):t.type===tt.WidgetTypes.GeoPoint?(vt(e,dTe),null):t.type===tt.WidgetTypes.Image?N(iIe,{...n,content:vt(e,pTe),field:t}):t.type===tt.WidgetTypes.IntegrationField?(vt(e,da.IntegrationFieldsContent.is),null):t.type===tt.WidgetTypes.Link?(vt(e,cTe.LinkContent.is),null):t.type===tt.WidgetTypes.Number?N(lIe,{...n,content:vt(e,mTe),field:t}):t.type===tt.WidgetTypes.Range?(vt(e,vTe),null):t.type===tt.WidgetTypes.RichText?N(jCe,{...n,content:vt(e,da.StructuredTextContent.is),field:t}):t.type===tt.WidgetTypes.Select?N(UCe,{...n,content:vt(e,gTe),field:t}):t.type===tt.WidgetTypes.Separator?(vt(e,da.SeparatorContent.is),null):t.type===tt.WidgetTypes.Text?N(sIe,{...n,content:vt(e,hTe),field:t}):(t.type===tt.WidgetTypes.Timestamp&&vt(e,yTe),null),_5=({content:e,id:t,nonRepeatableZone:n,onContentChange:r,readOnly:i})=>{const o=qCe(n);return N(wf,{children:o.map(([a,u])=>N(R$,{content:vt(e[a],db),id:`${t}.${a}`,nestableWidget:u,onContentChange:s=>{r(sTe(e,a,s))},readOnly:i},a))})};function qCe(e){return ue.useMemo(()=>$E(e),[e])}function KCe(e){return H(US(t=>!m(e,ol(Xm)(t))))}function VCe(e,t){return n=>m(n,Ro(e),eu(r=>OS(t,r)(n)),eu(r=>m(n,Ro(t),eu(i=>OS(e,i)(r)))))}function S5(e){var t,n,r;return(r=(n=(t=e.config)==null?void 0:t.label)!=null?n:e.fieldset)!=null?r:e.type}function HCe(e){var t,n;return(n=(t=e.config)==null?void 0:t.fields)!=null?n:{}}function JCe(e,t){return e===void 0?{__TYPE__:Rt.GroupContentType,value:t}:{...e,value:t}}const T5=(e=[])=>({__TYPE__:Rt.GroupItemContentType,value:e});function GCe(e){return e!=null?e:[{__TYPE__:"GroupItemContent",value:[]}]}function YCe(e,t){const[n,r]=t;return r?e.map((i,o)=>o===n?r:i):e.filter((i,o)=>o!==n)}function ZCe(e,t){const[n,r]=t,i=(()=>r?Array.from(new Map(e.value).set(n,r)):e.value.filter(([o])=>o!==n))();return T5(i)}const NM=({id:e,title:t,content:n,onContentChange:r,readOnly:i,repeatableZone:o})=>{const a=XCe(o),u=GCe(n);return N(P.Group,{title:"Group"+(t?` \u2022 ${t}`:""),addItemButtonTitle:"Add item in group",onAddItem:()=>r(u.concat(T5())),children:u.map((s,c)=>{const l=new Map(s.value);return N(P.GroupItem,{index:c,title:"Group Item",onMove:({index:f,offset:d})=>r([...m(u,VCe(f,f+d),Ki(()=>u,p=>p))]),onDelete:({index:f})=>r([...KCe([f])(u)]),children:a.map(([f,d])=>N(R$,{content:vt(l.get(f),db),id:`${e}[${c}].${f}`,nestableWidget:d,onContentChange:p=>{const h=ZCe(s,[f,p]),v=YCe(u,[c,h]);r(v)},readOnly:i},f))},c)})})};function XCe(e){return ue.useMemo(()=>$E(e),[e])}const QCe=({compositeSlice:e,content:t,onContentChange:n,...r})=>He(P.FieldSet,{children:[N(P.FieldSetLegend,{children:oTe(e)}),N(_5,{...r,content:t.nonRepeat,nonRepeatableZone:aTe(e),onContentChange:i=>{n({...t,nonRepeat:i})}}),N(NM,{...r,content:t.repeat,onContentChange:i=>{n({...t,repeat:i})},repeatableZone:uTe(e)})]});function eAe(e){return e.type===tt.WidgetTypes.Group?S5(e):fc(e)}const I5=({content:e,group:t,onContentChange:n,...r})=>N(NM,{...r,title:S5(t),content:e==null?void 0:e.value,onContentChange:i=>{n(JCe(e,i))},repeatableZone:HCe(t)}),O5=({content:e,legacySlice:t,...n})=>He(P.FieldSet,{children:[N(P.FieldSetLegend,{children:eAe(t)}),t.type===tt.WidgetTypes.Group?N(I5,{...n,content:vt(e,z2),group:t}):N(R$,{...n,content:vt(e,db),nestableWidget:t})]});function tAe(e){return{__TYPE__:"SharedSliceContent",variation:e,primary:{},items:[]}}function nAe(e,t){return e.variations.find(n=>n.id===t)}function rAe(e,t){return[e.name,t.name]}function iAe(e){var t;return(t=e.primary)!=null?t:{}}function oAe(e){var t;return(t=e.items)!=null?t:{}}const w5=({content:e,onContentChange:t,readOnly:n=!1,sharedSlice:r,...i})=>{var c;const o=aAe(r,e.variation),a=ue.useId();if(o===void 0)return null;const s={id:(c=i.id)!=null?c:a,readOnly:n};return He(P.FieldSet,{children:[N(P.FieldSetLegend,{children:rAe(r,o).join(" \u2022 ")}),N(_5,{...s,content:e.primary,nonRepeatableZone:iAe(o),onContentChange:l=>{t({...e,primary:l})}}),N(NM,{...s,content:e.items,onContentChange:l=>{t({...e,items:l})},repeatableZone:oAe(o)})]})};function aAe(e,t){return ue.useMemo(()=>nAe(e,t),[e,t])}const uAe=({content:e,id:t,onContentChange:n,readOnly:r,sliceZone:i})=>N(wf,{children:e==null?void 0:e.value.map((o,a)=>{var l,f;const u=(f=(l=i.config)==null?void 0:l.choices)==null?void 0:f[o.name];if(u===void 0)return null;const s=o.widget,c={id:`${t}[${a}]`,key:o.key,onContentChange:d=>{n(iTe(e,a,d))},readOnly:r};if(u.type===fb.SlicesTypes.SharedSlice)return eTe(s)?N(w5,{...c,content:s,sharedSlice:u}):null;if(u.type===fb.SlicesTypes.Slice)return tTe(s)?N(QCe,{...c,compositeSlice:u,content:s}):null;{const d={...c,legacySlice:u};return nTe(s)?N(O5,{...d,content:s}):rTe(s)?N(O5,{...d,content:void 0}):null}})});function sAe(){return"Static Zone"}const cAe=({content:e,id:t,onContentChange:n,readOnly:r,staticZone:i})=>{const o=lAe(i);return He(P.FieldSet,{children:[N(P.FieldSetLegend,{children:sAe()}),o.map(([a,u])=>{const s={id:`${t}.${a}`,onContentChange:l=>{n({...e,[a]:l})},readOnly:r},c=e[a];return u.type===tt.WidgetTypes.UID?(vt(c,Rt.UIDContent.is),null):u.type===tt.WidgetTypes.Group?ue.createElement(I5,{...s,content:vt(c,z2),group:u,key:a}):ue.createElement(R$,{...s,content:vt(c,db),key:a,nestableWidget:u})})]})};function lAe(e){return ue.useMemo(()=>$E(e),[e])}const fAe=({content:e,id:t,onContentChange:n,readOnly:r,section:i})=>{const[o,a]=dAe(i);return He(wf,{children:[N(cAe,{content:Q0e(o,e),id:t,onContentChange:u=>{n({...e,...u})},readOnly:r,staticZone:o}),a.map(([u,s])=>N(uAe,{content:vt(e[u],Z0e),id:`${t}.${u}`,onContentChange:c=>{n({...e,[u]:c})},readOnly:r,sliceZone:s},u))]})};function dAe(e){return ue.useMemo(()=>X0e(e),[e])}const pAe=({content:e,customType:t,onContentChange:n,readOnly:r=!1,sectionName:i,sharedSlices:o})=>{const a=hAe(t,o),u=ue.useId();if(V0e(a))return null;if(i===void 0)throw new Error("The 'sectionName' prop cannot be undefined when the provided 'customType' is non-empty.");const s=H0e(a,i);return N(fAe,{content:J0e(s,e),id:u,onContentChange:c=>{n({...e,...c})},readOnly:r,section:s})};function hAe(e,t){return ue.useMemo(()=>LM.toStatic(e,G0e(t)),[e,t])}ti.DocumentEditor=pAe,ti.SharedSliceEditor=w5,ti.defaultSharedSliceContent=tAe,Object.defineProperties(ti,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
147
+ `);return!o||!a?!1:e.chain().command(({tr:u})=>(u.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const u=i.after();return u===void 0||r.nodeAt(u)?!1:e.commands.exitCode()}}},addInputRules(){return[qR({find:xCe,type:this.type,getAttributes:e=>({language:e[1]})}),qR({find:CCe,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new Kr({key:new Ru("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=i==null?void 0:i.mode;if(!n||!o)return!1;const{tr:a}=e.state;return a.replaceSelectionWith(this.type.create({language:o})),a.setSelection(Ae.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.insertText(n.replace(/\r\n?/g,`
148
+ `)),a.setMeta("paste",!0),e.dispatch(a),!0}}})]}}).extend({name:"preformatted",addAttributes(){return{language:{default:null,parseHTML:e=>{var o;const{languageClassPrefix:t}=this.options,i=[...((o=e.firstElementChild)==null?void 0:o.classList)||[]].filter(a=>a.startsWith(t)).map(a=>a.replace(t,""))[0];return i||null},renderHTML:e=>e.language?{class:this.options.languageClassPrefix+e.language}:null}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({HTMLAttributes:e}){return["pre",dn(this.options.HTMLAttributes),["code",e,0]]}}).configure({exitOnTripleEnter:!1}),ACe={fromPrismic(e){return function(t){var r;const n=Cc.converter.fromPrismic(e)(T$.name,t,!0);return(r=e.nodes[T$.name])==null?void 0:r.create(Ea.fromPrismic(t),n)}},toPrismic(e){return Cc.converter.toPrismic(e,xe.RichTextNodeType.preformatted,Ea.toPrismic(e))}},_5=new td([xe.RichTextNodeType.preformatted],T$.name,T$,ACe,"",!0),kCe=()=>{const[e,t]=ae.useState();return A(BMe,{className:"react-component",children:Ue("div",{children:[A("input",{placeholder:"embed url",onChange:n=>{t(n.target.value)}}),e?A("iframe",{width:"560",height:"315",src:e,title:"YouTube video player",frameBorder:0,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"}):null]})})},MM=Or.create({name:"embed",group:"block",atom:!0,addAttributes(){return{src:{default:null}}},addNodeView(){return VMe(kCe)},addCommands(){return{setEmbed:()=>({tr:e,dispatch:t})=>{const n=this.type.create();return t&&e.replaceSelectionWith(n),!0}}}}),WCe={fromPrismic(e){return function(t){var r;return(r=e.nodes[MM.name])==null?void 0:r.create({},void 0)}},toPrismic(e){}};new rxe([xe.RichTextNodeType.embed],MM.name,MM,WCe);const NCe=Or.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,dn(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,"paragraph",e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>qR({find:new RegExp(`^(#{1,${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),I$="heading",Ra={byLevel(e){switch(e){case 1:return xe.RichTextNodeType.heading1;case 2:return xe.RichTextNodeType.heading2;case 3:return xe.RichTextNodeType.heading3;case 4:return xe.RichTextNodeType.heading4;case 5:return xe.RichTextNodeType.heading5;case 6:return xe.RichTextNodeType.heading6}},default(e){return{fullName:this.byLevel(e),level:e}},fromPrismic(e,t=[1,2,3,4,5,6]){const n=new RegExp(`^heading([${t.join(",")}]){1}$`),r=e.match(n);if(!r||!r[1])return;const i=parseInt(r[1]);return{fullName:Ra.byLevel(i),level:i}},fromProsemirror(e,t){const n=e.level;if(t.includes(n))return{fullName:Ra.byLevel(n),level:n}}},PCe=e=>NCe.extend({name:I$,addAttributes(){return{level:{default:e[0]},label:{default:null}}},addOptions(){return{levels:[...e],HTMLAttributes:{}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`}))},renderHTML({node:t,HTMLAttributes:n}){const r=t.attrs.level,o={...t.attrs.label?{label:t.attrs.label}:{}};return[`h${r}`,dn(this.options.HTMLAttributes,n,o),0]}}),FCe=e=>{const t=e[0];return{fromPrismic(n){return function(r){var a;const i=Cc.converter.fromPrismic(n)(I$,r),o=Ra.fromPrismic(r.type,e)||Ra.default(t);return(a=n.nodes[I$])==null?void 0:a.create({level:o.level,...Ea.fromPrismic(r)},i)}},toPrismic(n){const{fullName:r}=Ra.fromProsemirror(n.attrs,e)||Ra.default(t);return Cc.converter.toPrismic(n,r,Ea.toPrismic(n))}}};function DCe(e){if(!e)return[1,2,3,4,5,6];if(!e.size)return;const t=Array.from(e.values()).reduce((n,r)=>{const i=Ra.fromPrismic(r);return i?[...n,i.level]:n},[]).sort((n,r)=>n-r);return m(Md(t),F0(()=>{}))}const kc={name:I$,build:e=>{const t=DCe(e);if(!t)return;const n=Md(t.map(r=>Ra.byLevel(r)));if(!Ne(n))return new ixe(n.value,PCe(t),t,FCe(t),r=>{const i=Ra.fromProsemirror(r,t);return i&&`Heading ${i.level}`})}},LCe=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,jCe=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,UCe=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,BCe=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,xM=Vf.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>e.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",dn(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Zb({find:LCe,type:this.type}),Zb({find:UCe,type:this.type})]},addPasteRules(){return[Xb({find:jCe,type:this.type}),Xb({find:BCe,type:this.type})]}}).extend({name:"em"}),zCe={fromPrismic(e){return function(){var t;return(t=e.marks[xM.name])==null?void 0:t.create()}},toPrismic(){}},S5=new k4([xe.RichTextNodeType.em],xM.name,xM,zCe),qCe=/^(\d+)\.\s$/,CM=Or.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return t===1?["ol",dn(this.options.HTMLAttributes,n),0]:["ol",dn(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){return[U3({find:qCe,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]})]}}).extend({name:"orderedList",addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1}}},renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return t===1?["ol",dn(this.options.HTMLAttributes,n),0]:["ol",dn(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}}}).configure({itemTypeName:"listItem"}),KCe={fromPrismic(e){return function(t){var r;const n=nd.converter.fromPrismic(e)(t);if(!!n)return(r=e.nodes[CM.name])==null?void 0:r.create(Ea.fromPrismic(t),n)}},toPrismic(e){return NS(xc.children.map(e,t=>li(n=>n!==void 0)(nd.converter.toPrismic(t,xe.RichTextNodeType.orderedList))))}},O$=new cM([xe.RichTextNodeType.orderedList],CM.name,CM,KCe),T5=Hu,VCe=e=>m([Hu,S$,O$,kc.build(e),_5],li(va)),AM=[W4,S5],I5=e=>[...VCe(e),...AM],O5=[{nodeType:xe.RichTextNodeType.paragraph,icon:A(P.Icon,{name:"textFields"}),isActive:e=>e.isActive(Hu.name)&&!e.isActive(S$.name)&&!e.isActive(O$.name),runCommands:Rr((e,t)=>e.clearNodes().setDirection(Ai(t))),shortText:"par",text:"Paragraph"},{nodeType:xe.RichTextNodeType.heading1,icon:A(P.Icon,{name:"looks1"}),isActive:e=>e.isActive(kc.name,{level:1}),runCommands:Rr((e,t)=>e.setHeading({level:1}).setDirection(Ai(t))),shortText:"h1",text:"Heading 1"},{nodeType:xe.RichTextNodeType.heading2,icon:A(P.Icon,{name:"looks2"}),isActive:e=>e.isActive(kc.name,{level:2}),runCommands:Rr((e,t)=>e.setHeading({level:2}).setDirection(Ai(t))),shortText:"h2",text:"Heading 2"},{nodeType:xe.RichTextNodeType.heading3,icon:A(P.Icon,{name:"looks3"}),isActive:e=>e.isActive(kc.name,{level:3}),runCommands:Rr((e,t)=>e.setHeading({level:3}).setDirection(Ai(t))),shortText:"h3",text:"Heading 3"},{nodeType:xe.RichTextNodeType.heading4,icon:A(P.Icon,{name:"looks4"}),isActive:e=>e.isActive(kc.name,{level:4}),runCommands:Rr((e,t)=>e.setHeading({level:4}).setDirection(Ai(t))),shortText:"h4",text:"Heading 4"},{nodeType:xe.RichTextNodeType.heading5,icon:A(P.Icon,{name:"looks5"}),isActive:e=>e.isActive(kc.name,{level:5}),runCommands:Rr((e,t)=>e.setHeading({level:5}).setDirection(Ai(t))),shortText:"h5",text:"Heading 5"},{nodeType:xe.RichTextNodeType.heading6,icon:A(P.Icon,{name:"looks6"}),isActive:e=>e.isActive(kc.name,{level:6}),runCommands:Rr((e,t)=>e.setHeading({level:6}).setDirection(Ai(t))),shortText:"h6",text:"Heading 6"},{nodeType:xe.RichTextNodeType.list,icon:A(P.Icon,{name:"formatListBulleted"}),isActive:e=>e.isActive(S$.name),runCommands:Rr((e,t)=>e.toggleBulletList().setDirection(Ai(t))),shortText:"bull",text:"Bulleted list"},{nodeType:xe.RichTextNodeType.orderedList,icon:A(P.Icon,{name:"formatListNumbered"}),isActive:e=>e.isActive(O$.name),runCommands:Rr((e,t)=>e.toggleOrderedList().setDirection(Ai(t))),shortText:"num",text:"Numbered list"},{nodeType:xe.RichTextNodeType.preformatted,icon:A(P.Icon,{name:"dataObject"}),isActive:e=>e.isActive(_5.name),runCommands:Rr((e,t)=>e.setCodeBlock().setDirection(Ai(t))),shortText:"code",text:"Code"}],HCe=[{nodeType:xe.RichTextNodeType.strong,icon:A(P.Icon,{name:"formatBold"}),isActive:e=>e.isActive(W4.name),runCommands:Rr(e=>e.toggleBold())},{nodeType:xe.RichTextNodeType.em,icon:A(P.Icon,{name:"formatItalic"}),isActive:e=>e.isActive(S5.name),runCommands:Rr(e=>e.toggleItalic())}],JCe=[{nodeType:xe.RichTextNodeType.rtl,icon:A(P.Icon,{name:"formatTextDirectionRToL"}),isActive:e=>e.isActive({[Ac]:g5.RightToLeft}),runCommands:Rr((e,t)=>e.toggleDirection(Ai(t)))}];function Rr(e){return(t,n={})=>{let r=n.can===!0?t.can().chain():t.chain().focus();return n.deleteRange!==void 0&&(r=r.deleteRange(n.deleteRange)),e(r,t).run()}}function Ai(e){const t=e.state.selection.$from.parent.attrs;return Ea.parseNodeAttrsDirection(t)}function w$(e,t){return e.filter(n=>t.includes(n.nodeType))}const GCe={duration:100,hideOnClick:!0,offset:[-48,parseFloat(P.tokens.space[4])],placement:"top-start",zIndex:parseFloat(P.tokens.zIndex[3])},YCe=({editor:e,nodeTypes:t})=>{var a,u;const n=w$(O5,t),r=w$(HCe,t),i=w$(JCe,t),o=[n.length>1?A(P.ToolbarSelect,{onValueChange:s=>{var c;(c=n.find(l=>l.nodeType===s))==null||c.runCommands(e)},value:(u=(a=n.find(s=>s.isActive(e)))==null?void 0:a.nodeType)!=null?u:"",children:n.map(s=>A(P.ToolbarSelectItem,{value:s.nodeType,children:s.text},s.nodeType))},"node"):null,r.length>0?A(P.ToolbarToggleButtonGroup,{onValueChange:s=>{r.forEach(c=>{(c.isActive(e)&&!s.includes(c.nodeType)||!c.isActive(e)&&s.includes(c.nodeType))&&c.runCommands(e)})},type:"multiple",value:r.filter(s=>s.isActive(e)).map(s=>s.nodeType),children:r.map(s=>A(P.ToolbarToggleButtonGroupItem,{disabled:!s.runCommands(e,{can:!0}),startIcon:s.icon,value:s.nodeType},s.nodeType))},"mark"):null,i.length>0?A(ae.Fragment,{children:i.map(s=>A(P.ToolbarToggleButton,{disabled:!s.runCommands(e,{can:!0}),onPressedChange:()=>{s.runCommands(e)},pressed:s.isActive(e),startIcon:s.icon},s.nodeType))},"extra"):null,n.length+r.length+i.length>1?A(P.ToolbarButton,{onClick:()=>{e.chain().focus().clearNodes().unsetAllMarks().run()},startIcon:A(P.Icon,{name:"formatClear"})},"clear"):null].filter(va).map((s,c)=>Ue(ae.Fragment,{children:[c===0?null:A(P.ToolbarSeparator,{}),s]},s.key));return o.length>0?A(PMe,{editor:e,tippyOptions:GCe,children:A(P.Toolbar,{children:o})}):null},ZCe=e=>{var c;const{content:t,field:n,id:r,readOnly:i,config:o}=e,a=t&&dM.converter(o.nodeExtensions).fromPrismic(o.schema,(c=o.defaultTextConverter)==null?void 0:c.call(o,o.schema))(t),u=BTe(e.onContentChange),s=JMe({...a?{content:a.toJSON()}:{},editable:!i,editorProps:{attributes:{class:P.contentEditableClass,id:r,tabIndex:"0"}},extensions:o.allComponents,injectCSS:!1,onUpdate({editor:l}){const f=dM.converter(o.nodeExtensions).toPrismic(l.state.doc);u(f)}},[r,i,u]);return Ue(P.Field,{children:[A(P.FieldLabel,{htmlFor:r,children:lc(n)}),A(P.FieldControl,{children:Ue(If,{children:[A(jMe,{editor:s,style:{flex:1}}),(s==null?void 0:s.isEditable)&&A(YCe,{editor:s,nodeTypes:o.names.concat(SCe)})]})})]})},XCe=e=>{const{field:t}=e,n=ae.useMemo(()=>{const{extensions:r,defaultTextConverter:i}=lxe(t.config),o=li(f=>f.extType===sM.Node)(r),a=r.flatMap(f=>f.richTextNodeTypes),u=r.map(f=>f.component),s=[...RCe(t,o),TCe.configure({supportedExtensionNames:li(f=>f.extType===sM.Node&&f.nodeType===ed.Text&&!f.lockedFormat)(r).map(f=>f.name)}),...u],c=s.map(f=>f.name),l=JEe(s);return{allComponents:s,extensionsNames:c,defaultTextConverter:i,nodeExtensions:o,names:a,schema:l}},[t]);return A(ZCe,{...e,config:n},n.extensionsNames.join("-"))},QCe=({content:e,field:t,id:n,onContentChange:r,readOnly:i})=>{var s,c,l;const o=pb(t),a=eAe(t),u=(s=e==null?void 0:e.value)!=null?s:a;return Ue(P.Field,{children:[A(P.FieldIcon,{children:A(P.Icon,{name:"arrowDropDownCircle"})}),A(P.FieldLabel,{htmlFor:n,children:lc(t)}),A(P.FieldControl,{children:Ue(P.Select,{id:n,onValueChange:f=>{i||r(tAe(f))},placeholder:o,...u===void 0?{}:{value:u},children:[u===void 0||a!==void 0?null:A(P.SelectItem,{value:"",children:o}),(l=(c=t.config)==null?void 0:c.options)==null?void 0:l.map(f=>A(P.SelectItem,{value:f,children:f},f))]})})]},u)};function eAe(e){var t,n;return((t=e.config)==null?void 0:t.default_value)===void 0||(n=e.config.options)==null?void 0:n[0]}function tAe(e){return e.length===0?void 0:{__TYPE__:"FieldContent",type:"Select",value:e}}const E$=({content:e,nestableWidget:t,...n})=>t.type===tt.WidgetTypes.BooleanField?A(RTe,{...n,content:vt(e,fa.BooleanContent.is),field:t}):t.type===tt.WidgetTypes.Color?(vt(e,gTe),null):t.type===tt.WidgetTypes.Date?(vt(e,yTe),null):t.type===tt.WidgetTypes.Embed?(vt(e,fa.EmbedContent.is),null):t.type===tt.WidgetTypes.GeoPoint?(vt(e,bTe),null):t.type===tt.WidgetTypes.Image?A(hIe,{...n,content:vt(e,$Te),field:t}):t.type===tt.WidgetTypes.IntegrationField?(vt(e,fa.IntegrationFieldsContent.is),null):t.type===tt.WidgetTypes.Link?(vt(e,vTe.LinkContent.is),null):t.type===tt.WidgetTypes.Number?A(_Ie,{...n,content:vt(e,STe),field:t}):t.type===tt.WidgetTypes.Range?(vt(e,TTe),null):t.type===tt.WidgetTypes.RichText?A(XCe,{...n,content:vt(e,fa.StructuredTextContent.is),field:t}):t.type===tt.WidgetTypes.Select?A(QCe,{...n,content:vt(e,ITe),field:t}):t.type===tt.WidgetTypes.Separator?(vt(e,fa.SeparatorContent.is),null):t.type===tt.WidgetTypes.Text?A(bIe,{...n,content:vt(e,_Te),field:t}):(t.type===tt.WidgetTypes.Timestamp&&vt(e,OTe),null),w5=({content:e,id:t,nonRepeatableZone:n,onContentChange:r,readOnly:i})=>{const o=nAe(n);return A(If,{children:o.map(([a,u])=>A(E$,{content:vt(e[a],db),id:`${t}.${a}`,nestableWidget:u,onContentChange:s=>{r(mTe(e,a,s))},readOnly:i},a))})};function nAe(e){return ae.useMemo(()=>yE(e),[e])}function rAe(e,t){return e.filter((n,r)=>r!==t)}function iAe(e,t,n){const r=e.length;if(E5(t,r)||E5(n,r))return e;const i=[...e],o=i[t],a=i[n];return i[t]=a,i[n]=o,i}function E5(e,t){return e<0||e>=t}let oAe=0;function aAe(){return oAe++}function R5(e){var t,n,r;return(r=(n=(t=e.config)==null?void 0:t.label)!=null?n:e.fieldset)!=null?r:e.type}function uAe(e){var t,n;return(n=(t=e.config)==null?void 0:t.fields)!=null?n:{}}function sAe(e,t){return e===void 0?{__TYPE__:Rt.GroupContentType,value:t}:{...e,value:t}}const M5=(e=[])=>({__TYPE__:Rt.GroupItemContentType,value:e}),cAe={__TYPE__:"GroupItemContent",value:[]};function lAe(e){return e!=null?e:[cAe]}function fAe(e,t){const[n,r]=t;return r?e.map((i,o)=>o===n?r:i):e.filter((i,o)=>o!==n)}function dAe(e,t){const[n,r]=t,i=(()=>r?Array.from(new Map(e.value).set(n,r)):e.value.filter(([o])=>o!==n))();return M5(i)}const kM=({id:e,title:t,content:n,onContentChange:r,readOnly:i,repeatableZone:o})=>{const a=mAe(o),u=lAe(n),s=ae.useRef(new Map);return Object.keys(o).length===0?null:(pAe(s.current,u),A(P.Group,{title:"Repeatable zone"+(t?` \u2022 ${t}`:""),addItemButtonTitle:"Add item in group",items:u,getItemKey:c=>{var l;return(l=s.current.get(c))!=null?l:""},onAddItem:()=>r(u.concat(M5())),children:(c,l)=>{const f=new Map(c.value);return A(P.GroupItem,{index:l,title:"Item",onMove:({index:d,offset:p})=>{r(iAe(u,d,d+p))},onDelete:({index:d})=>r(rAe(u,d)),children:a.map(([d,p])=>A(E$,{content:vt(f.get(d),db),id:`${e}[${l}].${d}`,nestableWidget:p,onContentChange:h=>{const v=dAe(c,[d,h]),y=fAe(u,[l,v]);hAe(s.current,c,v),r(y)},readOnly:i},d))})}}))};function pAe(e,t){const n=new Set(t);t.forEach(r=>{e.has(r)||e.set(r,aAe())});for(const[r]of e)n.has(r)||e.delete(r)}function hAe(e,t,n){const r=e.get(t);r!==void 0&&e.set(n,r)}function mAe(e){return ae.useMemo(()=>yE(e),[e])}const vAe=({compositeSlice:e,content:t,onContentChange:n,...r})=>Ue(P.FieldSet,{children:[A(P.FieldSetLegend,{children:dTe(e)}),A(w5,{...r,content:t.nonRepeat,nonRepeatableZone:pTe(e),onContentChange:i=>{n({...t,nonRepeat:i})}}),A(kM,{...r,content:t.repeat,onContentChange:i=>{n({...t,repeat:i})},repeatableZone:hTe(e)})]});function gAe(e){return e.type===tt.WidgetTypes.Group?R5(e):lc(e)}const x5=({content:e,group:t,onContentChange:n,...r})=>A(kM,{...r,title:R5(t),content:e==null?void 0:e.value,onContentChange:i=>{n(sAe(e,i))},repeatableZone:uAe(t)}),C5=({content:e,legacySlice:t,...n})=>Ue(P.FieldSet,{children:[A(P.FieldSetLegend,{children:gAe(t)}),t.type===tt.WidgetTypes.Group?A(x5,{...n,content:vt(e,B2),group:t}):A(E$,{...n,content:vt(e,db),nestableWidget:t})]});function yAe(e){return{__TYPE__:"SharedSliceContent",variation:e,primary:{},items:[]}}function bAe(e,t){return e.variations.find(n=>n.id===t)}function $Ae(e,t){return[e.name,t.name]}function _Ae(e){var t;return(t=e.primary)!=null?t:{}}function SAe(e){var t;return(t=e.items)!=null?t:{}}const A5=({content:e,onContentChange:t,readOnly:n=!1,sharedSlice:r,...i})=>{var c;const o=TAe(r,e.variation),a=ae.useId();if(o===void 0)return null;const s={id:(c=i.id)!=null?c:a,readOnly:n};return Ue(P.FieldSet,{children:[A(P.FieldSetLegend,{children:$Ae(r,o).join(" \u2022 ")}),A(w5,{...s,content:e.primary,nonRepeatableZone:_Ae(o),onContentChange:l=>{t({...e,primary:l})}}),A(kM,{...s,content:e.items,onContentChange:l=>{t({...e,items:l})},repeatableZone:SAe(o)})]})};function TAe(e,t){return ae.useMemo(()=>bAe(e,t),[e,t])}const IAe=({content:e,id:t,onContentChange:n,readOnly:r,sliceZone:i})=>A(If,{children:e==null?void 0:e.value.map((o,a)=>{var l,f;const u=(f=(l=i.config)==null?void 0:l.choices)==null?void 0:f[o.name];if(u===void 0)return null;const s=o.widget,c={id:`${t}[${a}]`,key:o.key,onContentChange:d=>{n(fTe(e,a,d))},readOnly:r};if(u.type===fb.SlicesTypes.SharedSlice)return uTe(s)?A(A5,{...c,content:s,sharedSlice:u}):null;if(u.type===fb.SlicesTypes.Slice)return sTe(s)?A(vAe,{...c,compositeSlice:u,content:s}):null;{const d={...c,legacySlice:u};return cTe(s)?A(C5,{...d,content:s}):lTe(s)?A(C5,{...d,content:void 0}):null}})});function OAe(){return"Static Zone"}const wAe=({content:e,id:t,onContentChange:n,readOnly:r,staticZone:i})=>{const o=EAe(i);return Ue(P.FieldSet,{children:[A(P.FieldSetLegend,{children:OAe()}),o.map(([a,u])=>{const s={id:`${t}.${a}`,onContentChange:l=>{n({...e,[a]:l})},readOnly:r},c=e[a];return u.type===tt.WidgetTypes.UID?(vt(c,Rt.UIDContent.is),null):u.type===tt.WidgetTypes.Group?ae.createElement(x5,{...s,content:vt(c,B2),group:u,key:a}):ae.createElement(E$,{...s,content:vt(c,db),key:a,nestableWidget:u})})]})};function EAe(e){return ae.useMemo(()=>yE(e),[e])}const RAe=({content:e,id:t,onContentChange:n,readOnly:r,section:i})=>{const[o,a]=MAe(i);return Ue(If,{children:[A(wAe,{content:aTe(o,e),id:t,onContentChange:u=>{n({...e,...u})},readOnly:r,staticZone:o}),a.map(([u,s])=>A(IAe,{content:vt(e[u],iTe),id:`${t}.${u}`,onContentChange:c=>{n({...e,[u]:c})},readOnly:r,sliceZone:s},u))]})};function MAe(e){return ae.useMemo(()=>oTe(e),[e])}const xAe=({content:e,customType:t,onContentChange:n,readOnly:r=!1,sectionName:i,sharedSlices:o})=>{const a=CAe(t,o),u=ae.useId();if(Q0e(a))return null;if(i===void 0)throw new Error("The 'sectionName' prop cannot be undefined when the provided 'customType' is non-empty.");const s=eTe(a,i);return A(RAe,{content:tTe(s,e),id:u,onContentChange:c=>{n({...e,...c})},readOnly:r,section:s})};function CAe(e,t){return ae.useMemo(()=>FM.toStatic(e,nTe(t)),[e,t])}ti.DocumentEditor=xAe,ti.SharedSliceEditor=A5,ti.defaultSharedSliceContent=yAe,Object.defineProperties(ti,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});