@prismicio/editor-fields 0.4.42-alpha.dialog-key-up.0 → 0.4.42

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.cjs.js CHANGED
@@ -1,5 +1,5 @@
1
- "use strict";var pV=Object.defineProperty;var AV=(e,t,n)=>t in e?pV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var $n=(e,t,n)=>(AV(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $r=require("@prismicio/editor-support/URL"),R=require("react"),Pl=require("@prismicio/editor-support/Object"),m=require("@prismicio/editor-ui"),Xe=require("@prismicio/editor-support/React"),PC=require("@prismicio/editor-support/Date"),to=require("@prismicio/editor-support/Type"),Ip=require("@prismicio/editor-support/String"),nt=require("@prismicio/editor-support/Suspense"),gn=require("@prismicio/editor-support/Array"),_e=require("@prismicio/editor-support/Http"),Fh=require("@prismicio/editor-support/DOM"),hV=require("@prismicio/editor-support/Map"),Rn=require("@prismicio/editor-support/Set"),DC=require("react-dom"),mV=require("@prismicio/editor-support/Number");function Ck(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 we=Ck(R),gV=Ck(DC);var Ae=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ws(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):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 Ue={},I1=function(e,t){return I1=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},I1(e,t)};function vV(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");I1(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var T1=function(){return T1=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},T1.apply(this,arguments)};function yV(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function bV(e,t,n,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(a=e[u])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}function CV(e,t){return function(n,r){t(n,r,e)}}function SV(e,t,n,r,i,o){function a(S){if(S!==void 0&&typeof S!="function")throw new TypeError("Function expected");return S}for(var u=r.kind,s=u==="getter"?"get":u==="setter"?"set":"value",c=!t&&e?r.static?e:e.prototype:null,l=t||(c?Object.getOwnPropertyDescriptor(c,r.name):{}),f,p=!1,A=n.length-1;A>=0;A--){var h={};for(var v in r)h[v]=v==="access"?{}:r[v];for(var v in r.access)h.access[v]=r.access[v];h.addInitializer=function(S){if(p)throw new TypeError("Cannot add initializers after decoration has completed");o.push(a(S||null))};var _=(0,n[A])(u==="accessor"?{get:l.get,set:l.set}:l[s],h);if(u==="accessor"){if(_===void 0)continue;if(_===null||typeof _!="object")throw new TypeError("Object expected");(f=a(_.get))&&(l.get=f),(f=a(_.set))&&(l.set=f),(f=a(_.init))&&i.push(f)}else(f=a(_))&&(u==="field"?i.push(f):l[s]=f)}c&&Object.defineProperty(c,r.name,l),p=!0}function _V(e,t,n){for(var r=arguments.length>2,i=0;i<t.length;i++)n=r?t[i].call(e,n):t[i].call(e);return r?n:void 0}function IV(e){return typeof e=="symbol"?e:"".concat(e)}function TV(e,t,n){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})}function xV(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function wV(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())})}function $V(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(;a&&(a=0,c[0]&&(n=0)),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}}}var NC=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]};function EV(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&NC(t,e,n)}function x1(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Sk(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(u){a={error:u}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function RV(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Sk(arguments[t]));return e}function OV(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),i=0,t=0;t<n;t++)for(var o=arguments[t],a=0,u=o.length;a<u;a++,i++)r[i]=o[a];return r}function FV(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))}function Ud(e){return this instanceof Ud?(this.v=e,this):new Ud(e)}function MV(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(e,t||[]),i,o=[];return i={},a("next"),a("throw"),a("return"),i[Symbol.asyncIterator]=function(){return this},i;function a(p){r[p]&&(i[p]=function(A){return new Promise(function(h,v){o.push([p,A,h,v])>1||u(p,A)})})}function u(p,A){try{s(r[p](A))}catch(h){f(o[0][3],h)}}function s(p){p.value instanceof Ud?Promise.resolve(p.value.v).then(c,l):f(o[0][2],p)}function c(p){u("next",p)}function l(p){u("throw",p)}function f(p,A){p(A),o.shift(),o.length&&u(o[0][0],o[0][1])}}function kV(e){var t,n;return t={},r("next"),r("throw",function(i){throw i}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(i,o){t[i]=e[i]?function(a){return(n=!n)?{value:Ud(e[i](a)),done:!1}:o?o(a):a}:o}}function LV(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof x1=="function"?x1(e):e[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(o){n[o]=e[o]&&function(a){return new Promise(function(u,s){a=e[o](a),i(u,s,a.done,a.value)})}}function i(o,a,u,s){Promise.resolve(s).then(function(c){o({value:c,done:u})},a)}}function jV(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var UV=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function BV(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)&&NC(t,e,n);return UV(t,e),t}function WV(e){return e&&e.__esModule?e:{default:e}}function KV(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)}function PV(e,t,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(e,n):i?i.value=n:t.set(e,n),n}function DV(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}const NV=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return T1},__asyncDelegator:kV,__asyncGenerator:MV,__asyncValues:LV,__await:Ud,__awaiter:wV,__classPrivateFieldGet:KV,__classPrivateFieldIn:DV,__classPrivateFieldSet:PV,__createBinding:NC,__decorate:bV,__esDecorate:SV,__exportStar:EV,__extends:vV,__generator:$V,__importDefault:WV,__importStar:BV,__makeTemplateObject:jV,__metadata:xV,__param:CV,__propKey:IV,__read:Sk,__rest:yV,__runInitializers:_V,__setFunctionName:TV,__spread:RV,__spreadArray:FV,__spreadArrays:OV,__values:x1},Symbol.toStringTag,{value:"Module"})),Q=Ws(NV);var nr={};function _k(e){return function(t){return function(n){return n.reduce(function(r,i){return e.alt(r,function(){return i})},t)}}}const qV=Object.freeze(Object.defineProperty({__proto__:null,altAll:_k},Symbol.toStringTag,{value:"Module"}));function QV(e){return _k(e)(e.zero())}const VV=Object.freeze(Object.defineProperty({__proto__:null,altAll:QV},Symbol.toStringTag,{value:"Module"}));var Ik=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))}}}}},qC=function(e){return function(){return{concat:function(t,n){return function(r){return e.concat(t(r),n(r))}}}}},Tk=function(e){var t=qC(e);return function(){return{concat:t().concat,empty:function(){return e.empty}}}},QC=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}}},xk=function(e){var t=QC(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))}}}},zV=function(e){return function(t){return t(e)}};function P(e){return e}var ml=P;function lr(e){return function(){return e}}var VC=lr(!0),wk=lr(!1),$k=lr(null),zC=lr(void 0),HV=zC;function YV(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 Ek(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e}function GV(e){return e+1}function JV(e){return e-1}function Rk(e){throw new Error("Called `absurd` function which should be uncallable")}function ZV(e){return function(t){return e.apply(void 0,t)}}function XV(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e(t)}}function b(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 ez=Rk,fr=function(e,t){return t};function tz(e){return function(t){return!e(t)}}var nz=function(){return{concat:function(e,t){return z(e,t)},empty:P}};const Ok=Object.freeze(Object.defineProperty({__proto__:null,SK:fr,absurd:Rk,apply:zV,constFalse:wk,constNull:$k,constTrue:VC,constUndefined:zC,constVoid:HV,constant:lr,decrement:JV,flip:YV,flow:z,getBooleanAlgebra:Ik,getEndomorphismMonoid:nz,getMonoid:Tk,getRing:xk,getSemigroup:qC,getSemiring:QC,hole:ez,identity:P,increment:GV,not:tz,pipe:b,tuple:Ek,tupled:ZV,unsafeCoerce:ml,untupled:XV},Symbol.toStringTag,{value:"Module"}));var rz=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))},Nt=function(e){return e._tag==="None"},_t=function(e){return e._tag==="Some"},ye={_tag:"None"},fe=function(e){return{_tag:"Some",value:e}},Xt=function(e){return e._tag==="Left"},HC=function(e){return e._tag==="Right"},Zo=function(e){return{_tag:"Left",left:e}},hu=function(e){return{_tag:"Right",right:e}},Tp=function(e){return[e]},vt=function(e){return e.length>0},Fr=function(e){return e[0]},Dl=function(e){return e.slice(1)},bn=[],tn={},ft=Object.prototype.hasOwnProperty,hg=function(e){return rz([e[0]],e.slice(1),!0)};function ua(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 kt(e){return function(t){return function(n){return e.ap(e.map(n,function(r){return function(){return r}}),t)}}}function Lt(e){return function(t){return function(n){return e.ap(e.map(n,function(){return function(r){return r}}),t)}}}function jt(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 nn(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 YC(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):YC(e,t-1,i)}}var ob={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 iz(e){return ft.call(ob,e)||(ob[e]=YC(Ek,e-1,[])),ob[e]}function oz(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r=t.length,i=iz(r),o=e.map(t[0],i),a=1;a<r;a++)o=e.ap(o,t[a]);return o}}function az(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 YC(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 uz(e){return function(t){for(var n=Object.keys(t),r=n.length,i=az(n),o=e.map(t[n[0]],i),a=1;a<r;a++)o=e.ap(o,t[n[a]]);return o}}const sz=Object.freeze(Object.defineProperty({__proto__:null,ap:ua,apFirst:kt,apS:jt,apSecond:Lt,getApplySemigroup:nn,sequenceS:uz,sequenceT:oz},Symbol.toStringTag,{value:"Module"}));function Nl(e,t){return function(n){return function(r){return e.map(r,function(i){return t.map(i,n)})}}}function qe(e){return function(t){return function(n){return e.map(n,function(r){return r(t)})}}}function Ut(e){return function(t){return function(n){return e.map(n,function(r){var i;return i={},i[t]=r,i})}}}function ql(e,t){var n=Nl(e,t);return{map:function(r,i){return b(r,n(i))}}}const cz=Object.freeze(Object.defineProperty({__proto__:null,bindTo:Ut,flap:qe,getFunctorComposition:ql,map:Nl},Symbol.toStringTag,{value:"Module"}));function ei(e){var t=nn(e);return function(n){return{concat:t(n).concat,empty:e.of(n.empty)}}}function Fk(e,t){var n=ql(e,t).map,r=ua(e,t);return{map:n,of:function(i){return e.of(t.of(i))},ap:function(i,o){return b(i,r(o))}}}const lz=Object.freeze(Object.defineProperty({__proto__:null,getApplicativeComposition:Fk,getApplicativeMonoid:ei},Symbol.toStringTag,{value:"Module"}));function dt(e){return function(t){return function(n){return e.chain(n,function(r){return e.map(t(r),function(){return r})})}}}function Bt(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 fz=Object.freeze(Object.defineProperty({__proto__:null,bind:Bt,chainFirst:dt},Symbol.toStringTag,{value:"Module"}));function po(e){return function(t){return function(n){return e.fromEither(Nt(n)?Zo(t()):hu(n.value))}}}function mu(e){return function(t,n){return function(r){return e.fromEither(t(r)?hu(r):Zo(n(r)))}}}function Ao(e){var t=po(e);return function(n){var r=t(n);return function(i){return z(i,r)}}}function Ks(e,t){var n=Ao(e);return function(r){var i=n(r);return function(o){return function(a){return t.chain(a,i(o))}}}}function Mr(e){return function(t){return z(t,e.fromEither)}}function sa(e,t){var n=Mr(e);return function(r){return function(i){return t.chain(i,n(r))}}}function ca(e,t){return z(Mr(e),dt(t))}function Ps(e,t){return function(n,r){return function(i){return t.chain(i,function(o){return e.fromEither(n(o)?hu(o):Zo(r(o)))})}}}const dz=Object.freeze(Object.defineProperty({__proto__:null,chainEitherK:sa,chainFirstEitherK:ca,chainOptionK:Ks,filterOrElse:Ps,fromEitherK:Mr,fromOption:po,fromOptionK:Ao,fromPredicate:mu},Symbol.toStringTag,{value:"Module"}));var ti=function(e){return{equals:function(t,n){return t===n||e(t,n)}}},Mk=function(e){return ti(function(t,n){for(var r in e)if(!e[r].equals(t[r],n[r]))return!1;return!0})},kk=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return ti(function(n,r){return e.every(function(i,o){return i.equals(n[o],r[o])})})},pz=function(e,t){return b(e,Lk(t))},Lk=function(e){return function(t){return ti(function(n,r){return t.equals(e(n),e(r))})}},jk="Eq",Ql={equals:function(e,t){return e===t}},Az={equals:function(){return!0}},Uk=function(){return{concat:function(e,t){return ti(function(n,r){return e.equals(n,r)&&t.equals(n,r)})}}},hz=function(){return{concat:Uk().concat,empty:Az}},Bk={URI:jk,contramap:pz},mz=kk,gz=Mk,vz=Ql.equals,yz=Bk,bz=Ql,Cz=Ql,Sz=Ql,_z={equals:function(e,t){return e.valueOf()===t.valueOf()}};const Iz=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:Bk,URI:jk,contramap:Lk,eq:yz,eqBoolean:bz,eqDate:_z,eqNumber:Sz,eqStrict:Ql,eqString:Cz,fromEquals:ti,getMonoid:hz,getSemigroup:Uk,getStructEq:gz,getTupleEq:mz,strictEqual:vz,struct:Mk,tuple:kk},Symbol.toStringTag,{value:"Module"}));var Wk=function(e){return function(t,n){return t===n||e(t,n)===0}},Ds=function(e){return{equals:Wk(e),compare:function(t,n){return t===n?0:e(t,n)}}},Kk=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Ds(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])})},GC=function(e){return Ds(function(t,n){return e.compare(n,t)})},Tz=function(e,t){return b(e,mg(t))},mg=function(e){return function(t){return Ds(function(n,r){return t.compare(e(n),e(r))})}},Pk="Ord",Dk=function(){return{concat:function(e,t){return Ds(function(n,r){var i=e.compare(n,r);return i!==0?i:t.compare(n,r)})}}},JC=function(){return{concat:Dk().concat,empty:Ds(function(){return 0})}},Nk={URI:Pk,contramap:Tz},xz={equals:VC,compare:lr(0)},wz=function(e){return function(t){return function(n){return n===t||e.compare(n,t)===0}}},qk=function(e){return function(t,n){return e.compare(t,n)===-1}},Qk=function(e){return function(t,n){return e.compare(t,n)===1}},$z=function(e){return function(t,n){return e.compare(t,n)!==1}},Ez=function(e){return function(t,n){return e.compare(t,n)!==-1}},gg=function(e){return function(t,n){return t===n||e.compare(t,n)<1?t:n}},vg=function(e){return function(t,n){return t===n||e.compare(t,n)>-1?t:n}},Vk=function(e){var t=gg(e),n=vg(e);return function(r,i){return function(o){return n(t(o,i),r)}}},Rz=function(e){var t=qk(e),n=Qk(e);return function(r,i){return function(o){return!(t(o,r)||n(o,i))}}},Oz=Kk,Fz=GC,Mz=Nk;function kz(e,t){return e<t?-1:e>t?1:0}var ZC={equals:Ql.equals,compare:kz},Lz=ZC,jz=ZC,dm=ZC,Uz=b(dm,mg(function(e){return e.valueOf()}));const Bz=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:Nk,URI:Pk,between:Rz,clamp:Vk,contramap:mg,equals:wz,equalsDefault:Wk,fromCompare:Ds,geq:Ez,getDualOrd:Fz,getMonoid:JC,getSemigroup:Dk,getTupleOrd:Oz,gt:Qk,leq:$z,lt:qk,max:vg,min:gg,ord:Mz,ordBoolean:Lz,ordDate:Uz,ordNumber:dm,ordString:jz,reverse:GC,trivial:xz,tuple:Kk},Symbol.toStringTag,{value:"Module"}));var zk=function(e){return{concat:function(t,n){return e.concat(n,t)}}},Wz=function(e){return function(t){return{concat:function(n,r){return e(n)?t.concat(n,r):r}}}},Kz=function(e){return function(t){return{concat:function(n,r){return e(r)?t.concat(n,r):n}}}},Pz=function(e){return function(t){return{concat:function(n,r){return t.concat(e(n),e(r))}}}},Hk=function(e){return function(t){return function(n){return n.reduce(function(r,i){return e.concat(r,i)},t)}}};const Dz=Object.freeze(Object.defineProperty({__proto__:null,concatAll:Hk,endo:Pz,filterFirst:Wz,filterSecond:Kz,reverse:zk},Symbol.toStringTag,{value:"Module"}));var yg=function(e){return{concat:gg(e)}},bg=function(e){return{concat:vg(e)}},XC=function(e){return{concat:function(){return e}}},eS=zk,tS=function(e){return{concat:function(t,n){var r={};for(var i in e)ft.call(e,i)&&(r[i]=e[i].concat(t[i],n[i]));return r}}},nS=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])})}}},Yk=function(e){return function(t){return{concat:function(n,r){return t.concat(n,t.concat(e,r))}}}},rS=function(){return{concat:P}},Cg=function(){return{concat:function(e,t){return t}}},iS=Hk,Gk=XC(void 0),Nz=function(){return{concat:function(e,t){return Object.assign({},e,t)}}},qz=Cg,Qz=rS,Vz=nS,zz=tS,Hz=eS,Yz=bg,Gz=yg,Jz=Yk;function Zz(e){var t=iS(e);return function(n,r){return r===void 0?t(n):t(n)(r)}}var Jk={concat:function(e,t){return e&&t}},Zk={concat:function(e,t){return e||t}},Xz=qC,Xk={concat:function(e,t){return e+t}},eL={concat:function(e,t){return e+t}},tL={concat:function(e,t){return e*t}};const nL=Object.freeze(Object.defineProperty({__proto__:null,concatAll:iS,constant:XC,first:rS,fold:Zz,getDualSemigroup:Hz,getFirstSemigroup:Qz,getFunctionSemigroup:Xz,getIntercalateSemigroup:Jz,getJoinSemigroup:Yz,getLastSemigroup:qz,getMeetSemigroup:Gz,getObjectSemigroup:Nz,getStructSemigroup:zz,getTupleSemigroup:Vz,intercalate:Yk,last:Cg,max:bg,min:yg,reverse:eS,semigroupAll:Jk,semigroupAny:Zk,semigroupProduct:tL,semigroupString:Xk,semigroupSum:eL,semigroupVoid:Gk,struct:tS,tuple:nS},Symbol.toStringTag,{value:"Module"}));var Bd=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))},xp=bn,ho=vt,Sg=function(e,t){return e<0||e>=t.length},oS=function(e){return function(t){return Bd([e],t,!0)}},gl=oS,aS=function(e){return function(t){return Bd(Bd([],t,!0),[e],!1)}},_g=aS,Ig=function(e,t,n){if(ho(n)){var r=hg(n);return r.splice(e,0,t),r}return[t]},uS=function(e,t,n){if(n[e]===t)return n;var r=hg(n);return r[e]=t,r},sS=function(e){return function(t){if(t.length===1)return t;for(var n=[Hn(t)],r=wi(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}},rL=function(e){if(ho(e)){var t=JC();return dS(e.reduce(t.concat,t.empty))}return P},cS=function(e){var t=sS(e);return function(n){return function(r){return t(b(r,wp(n)))}}},lS=function(e){return function(t){var n=t.length,r=Math.round(e)%n;if(Sg(Math.abs(r),t)||r===0)return t;if(r<0){var i=wg(-r)(t),o=i[0],a=i[1];return b(a,wp(o))}else return lS(r-n)(t)}},fS=function(e){return ho(e)?fe(e):ye},Tg=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}},eH=function(e){return Tg(function(){return e})},iL=function(e,t){return e<=t?Tg(function(n){return e+n})(t-e+1):[e]},oL=function(e){return[Hn(e),wi(e)]},aL=function(e){return[Vl(e),vu(e)]},tH=function(e){return fS(e.slice())};function uL(e){return function(t){return t.concat(e)}}function wp(e,t){return t?e.concat(t):function(n){return n.concat(e)}}var nH=function(e){return e.length===1?e:Bd([vu(e)],e.slice(0,-1).reverse(),!0)};function sL(e){return function(t){var n=t.length;if(n===0)return xp;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 rH=function(e){return function(t){for(var n={},r=0,i=t;r<i.length;r++){var o=i[r],a=e(o);ft.call(n,a)?n[a].push(o):n[a]=[o]}return n}},dS=function(e){return function(t){return t.length===1?t:t.slice().sort(e.compare)}},iH=function(e,t){return cL(e,function(){return t})},cL=function(e,t){return function(n){return Sg(e,n)?ye:fe(uS(e,t(n[e]),n))}},lL=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 fL(e,t){return t===void 0?function(n){return fL(n,e)}:lL(e,t,function(n,r){return[n,r]})}var oH=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]},xg=function(e){return function(t){for(var n=[e,t[0]],r=1;r<t.length;r++)n.push(e,t[r]);return n}},pS=function(e){return function(t){var n=wi(t);return ho(n)?b(n,xg(e),gl(Hn(t))):t}},dL=function(e){return function(t){for(var n=hg(e(0,Hn(t))),r=1;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},AS=function(e){return function(t){for(var n=e(t),r=n[0],i=n[1],o=[r],a=i;ho(a);){var u=e(a),s=u[0],c=u[1];o.push(s),a=c}return o}},wg=function(e){return function(t){var n=Math.max(1,e);return n>=t.length?[t,xp]:[b(t.slice(1,n),gl(Hn(t))),t.slice(n)]}},pL=function(e){return AS(wg(e))},Oi=function(e,t){return b(e,SS(t))},hS=function(e,t){return b(e,_S(t))},$p=function(e,t){return b(e,yL(t))},mS=function(e,t){return b(e,$g(t))},AL=function(e,t){return b(e,CS(t))},Ep=function(e,t,n){return b(e,IS(t,n))},Rp=function(e){var t=TS(e);return function(n,r){return b(n,t(r))}},Op=function(e,t,n){return b(e,xS(t,n))},gS=function(e){var t=bL(e);return function(n,r){return b(n,t(r))}},hL=function(e,t){return b(e,vL(t))},vS=function(e,t,n){return b(e,Eg(t,n))},yS=function(e){var t=wS(e);return function(n,r){return b(n,t(r))}},bS=function(e,t,n){return b(e,Rg(t,n))},mL=function(e){var t=Fg(e);return function(n,r){return b(n,t(r))}},gu=Tp,gL=function(e){return function(t){return b(t,uL(e()))}},vL=gL,yL=function(e){return $g(function(t){return b(e,SS(t))})},$g=function(e){return dL(function(t,n){return e(n)})},CS=function(e){return function(t){for(var n=wi(t),r=[e(t)];ho(n);)r.push(e(n)),n=wi(n);return r}},aH=CS(P),uH=$g(P),SS=function(e){return _S(function(t,n){return e(n)})},_S=function(e){return function(t){for(var n=[e(0,Hn(t))],r=1;r<t.length;r++)n.push(e(r,t[r]));return n}},IS=function(e,t){return Eg(e,function(n,r,i){return t(r,i)})},TS=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]))}}},xS=function(e,t){return Rg(e,function(n,r,i){return t(r,i)})},Eg=function(e,t){return function(n){return n.reduce(function(r,i,o){return t(o,r,i)},e)}},wS=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]))}}},Rg=function(e,t){return function(n){return n.reduceRight(function(r,i,o){return t(o,i,r)},e)}},bL=function(e){var t=Fg(e);return function(n){return t(function(r,i){return n(i)})}},Og=function(e){return Fg(e)(fr)},Fg=function(e){return function(t){return function(n){for(var r=e.map(t(0,Hn(n)),gu),i=1;i<n.length;i++)r=e.ap(e.map(r,function(o){return function(a){return b(o,_g(a))}}),t(i,n[i]));return r}}},Mg=Fr,zn="ReadonlyNonEmptyArray",CL=function(e){return{show:function(t){return"[".concat(t.map(e.show).join(", "),"]")}}},sH=function(){return{concat:wp}},SL=function(e){return ti(function(t,n){return t.length===n.length&&t.every(function(r,i){return e.equals(r,n[i])})})},cH=function(e){var t=cS(e);return{concat:function(n,r){return t(r)(n)}}},$S={URI:zn,map:Oi},lH=qe($S),fH={URI:zn,of:gu},dH={URI:zn,map:Oi,mapWithIndex:hS},kg={URI:zn,map:Oi,ap:$p},pH=kt(kg),AH=Lt(kg),hH={URI:zn,map:Oi,ap:$p,of:gu},ES={URI:zn,map:Oi,ap:$p,chain:mS},mH=dt(ES),gH={URI:zn,map:Oi,ap:$p,of:gu,chain:mS},vH={URI:zn,reduce:Ep,foldMap:Rp,reduceRight:Op},yH={URI:zn,reduce:Ep,foldMap:Rp,reduceRight:Op,reduceWithIndex:vS,foldMapWithIndex:yS,reduceRightWithIndex:bS},bH={URI:zn,map:Oi,reduce:Ep,foldMap:Rp,reduceRight:Op,traverse:gS,sequence:Og},CH={URI:zn,map:Oi,mapWithIndex:hS,reduce:Ep,foldMap:Rp,reduceRight:Op,traverse:gS,sequence:Og,reduceWithIndex:vS,foldMapWithIndex:yS,reduceRightWithIndex:bS,traverseWithIndex:mL},SH={URI:zn,map:Oi,alt:hL},_H={URI:zn,map:Oi,extend:AL,extract:Mg},IH=gu(tn),TH=Ut($S),xH=Bt(ES),wH=jt(kg),Hn=Mg,wi=Dl,vu=function(e){return e[e.length-1]},Vl=function(e){return e.slice(0,-1)},_L=function(e){var t=yg(e);return function(n){return n.reduce(t.concat)}},IL=function(e){var t=bg(e);return function(n){return n.reduce(t.concat)}},Lg=function(e){return function(t){return t.reduce(e.concat)}},$H=function(e){return function(t){return e(Hn(t),wi(t))}},EH=function(e){return function(t){return e(Vl(t),vu(t))}},TL=function(e){return function(t){return Bd([e(Hn(t))],wi(t),!0)}},RH=function(e){return TL(function(){return e})},xL=function(e){return function(t){return b(Vl(t),_g(e(vu(t))))}},OH=function(e){return xL(function(){return e})},RS=function(e){var t=Lg(e);return function(n){return z(pS(n),t)}};function FH(e){var t=dS(e),n=sL(e);return function(r){return ho(r)?n(t(r)):xp}}function MH(e){return wL(function(t,n){return e(n)})}var wL=function(e){return function(t){return fS(t.filter(function(n,r){return e(r,n)}))}},kH=oL,LH=aL;function $L(e,t){return t===void 0?gl(e):b(t,gl(e))}var EL=function(e,t){return b(e,wp([t]))},jH=function(e,t){return function(n){return e<0||e>n.length?ye:fe(Ig(e,t,n))}},UH=xg,BH=Lg,WH={URI:zn,of:gu,map:Oi,mapWithIndex:hS,ap:$p,chain:mS,extend:AL,extract:Mg,reduce:Ep,foldMap:Rp,reduceRight:Op,traverse:gS,sequence:Og,reduceWithIndex:vS,foldMapWithIndex:yS,reduceRightWithIndex:bS,traverseWithIndex:mL,alt:hL};const KH=Object.freeze(Object.defineProperty({__proto__:null,Alt:SH,Applicative:hH,Apply:kg,Chain:ES,Comonad:_H,Do:IH,Foldable:vH,FoldableWithIndex:yH,Functor:$S,FunctorWithIndex:dH,Monad:gH,Pointed:fH,Traversable:bH,TraversableWithIndex:CH,URI:zn,alt:vL,altW:gL,ap:yL,apFirst:pH,apS:wH,apSecond:AH,append:_g,appendW:aS,bind:xH,bindTo:TH,chain:$g,chainFirst:mH,chainWithIndex:dL,chop:AS,chunksOf:pL,concat:wp,concatAll:Lg,concatW:uL,cons:$L,duplicate:aH,empty:xp,extend:CS,extract:Mg,filter:MH,filterWithIndex:wL,flap:lH,flatten:uH,fold:BH,foldMap:TS,foldMapWithIndex:wS,fromArray:tH,fromReadonlyArray:fS,getEq:SL,getSemigroup:sH,getShow:CL,getUnionSemigroup:cH,group:sL,groupBy:rH,groupSort:FH,head:Hn,init:Vl,insertAt:jH,intercalate:RS,intersperse:pS,isNonEmpty:ho,isOutOfBound:Sg,last:vu,makeBy:Tg,map:SS,mapWithIndex:_S,matchLeft:$H,matchRight:EH,max:IL,min:_L,modifyAt:cL,modifyHead:TL,modifyLast:xL,of:gu,prepend:gl,prependAll:xg,prependToAll:UH,prependW:oS,range:iL,readonlyNonEmptyArray:WH,reduce:IS,reduceRight:xS,reduceRightWithIndex:Rg,reduceWithIndex:Eg,replicate:eH,reverse:nH,rotate:lS,sequence:Og,snoc:EL,sort:dS,sortBy:rL,splitAt:wg,tail:wi,traverse:bL,traverseWithIndex:Fg,unappend:aL,uncons:kH,union:cS,uniq:sS,unprepend:oL,unsafeInsertAt:Ig,unsafeUpdateAt:uS,unsnoc:LH,unzip:oH,updateAt:iH,updateHead:RH,updateLast:OH,zip:fL,zipWith:lL},Symbol.toStringTag,{value:"Module"}));var Wd=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))},la=function(e){return e.length>0},jg=function(e,t){return e<0||e>=t.length},OS=function(e){return function(t){return Wd([e],t,!0)}},vl=OS,FS=function(e){return function(t){return Wd(Wd([],t,!0),[e],!1)}},Fp=FS,MS=function(e,t,n){if(la(n)){var r=Mp(n);return r.splice(e,0,t),r}return[t]},kS=function(e,t,n){var r=Mp(n);return r[e]=t,r},LS=function(e){return function(t){if(t.length===1)return zl(t);for(var n=[ni(t)],r=$i(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}},RL=function(e){if(la(e)){var t=JC();return WS(e.reduce(t.concat,t.empty))}return zl},jS=function(e){var t=LS(e);return function(n){return function(r){return t(b(r,Bg(n)))}}},US=function(e){return function(t){var n=t.length,r=Math.round(e)%n;if(jg(Math.abs(r),t)||r===0)return zl(t);if(r<0){var i=Kg(-r)(t),o=i[0],a=i[1];return b(a,Bg(o))}else return US(r-n)(t)}},Mp=hg,BS=function(e){return la(e)?fe(e):ye},Ug=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}},PH=function(e){return Ug(function(){return e})},OL=function(e,t){return e<=t?Ug(function(n){return e+n})(t-e+1):[e]},FL=function(e){return[ni(e),$i(e)]},ML=function(e){return[Yl(e),Hl(e)]};function kL(e){return function(t){return t.concat(e)}}function Bg(e,t){return t?e.concat(t):function(n){return n.concat(e)}}var DH=function(e){return Wd([Hl(e)],e.slice(0,-1).reverse(),!0)};function LL(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 NH=function(e){return function(t){for(var n={},r=0,i=t;r<i.length;r++){var o=i[r],a=e(o);ft.call(n,a)?n[a].push(o):n[a]=[o]}return n}},WS=function(e){return function(t){return t.slice().sort(e.compare)}},qH=function(e,t){return function(n){return e<0||e>n.length?ye:fe(MS(e,t,n))}},QH=function(e,t){return jL(e,function(){return t})},jL=function(e,t){return function(n){return jg(e,n)?ye:fe(kS(e,t(n[e]),n))}},zl=Mp,yu=function(e){return[e]},UL=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 BL(e,t){return t===void 0?function(n){return BL(n,e)}:UL(e,t,function(n,r){return[n,r]})}var VH=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]},Wg=function(e){return function(t){for(var n=[e,t[0]],r=1;r<t.length;r++)n.push(e,t[r]);return n}},WL=function(e){return function(t){var n=$i(t);return la(n)?b(n,Wg(e),vl(ni(t))):zl(t)}},KL=wS,PL=TS,DL=function(e){return function(t){for(var n=Mp(e(0,ni(t))),r=1;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},KS=function(e){return function(t){for(var n=e(t),r=n[0],i=n[1],o=[r],a=i;la(a);){var u=e(a),s=u[0],c=u[1];o.push(s),a=c}return o}},Kg=function(e){return function(t){var n=Math.max(1,e);return n>=t.length?[zl(t),[]]:[b(t.slice(1,n),vl(ni(t))),t.slice(n)]}},NL=function(e){return KS(Kg(e))},Fi=function(e,t){return b(e,HS(t))},PS=function(e,t){return b(e,YS(t))},kp=function(e,t){return b(e,YL(t))},DS=function(e,t){return b(e,Pg(t))},qL=function(e,t){return b(e,zS(t))},Lp=function(e,t,n){return b(e,GL(t,n))},jp=function(e){var t=PL(e);return function(n,r){return b(n,t(r))}},Up=function(e,t,n){return b(e,ZL(t,n))},NS=function(e){var t=ej(e);return function(n,r){return b(n,t(r))}},QL=function(e,t){return b(e,HL(t))},qS=function(e,t,n){return b(e,JL(t,n))},QS=function(e){var t=KL(e);return function(n,r){return b(n,t(r))}},VS=function(e,t,n){return b(e,XL(t,n))},VL=function(e){var t=Ng(e);return function(n,r){return b(n,t(r))}},zL=function(e){return function(t){return b(t,kL(e()))}},HL=zL,YL=function(e){return Pg(function(t){return b(e,HS(t))})},Pg=function(e){return DL(function(t,n){return e(n)})},zS=function(e){return function(t){for(var n=$i(t),r=[e(t)];la(n);)r.push(e(n)),n=$i(n);return r}},zH=zS(P),HH=Pg(P),HS=function(e){return YS(function(t,n){return e(n)})},YS=function(e){return function(t){for(var n=[e(0,ni(t))],r=1;r<t.length;r++)n.push(e(r,t[r]));return n}},GL=IS,JL=Eg,ZL=xS,XL=Rg,ej=function(e){var t=Ng(e);return function(n){return t(function(r,i){return n(i)})}},Dg=function(e){return Ng(e)(function(t,n){return n})},Ng=function(e){return function(t){return function(n){for(var r=e.map(t(0,ni(n)),yu),i=1;i<n.length;i++)r=e.ap(e.map(r,function(o){return function(a){return b(o,Fp(a))}}),t(i,n[i]));return r}}},GS=Hn,Yn="NonEmptyArray",YH=CL,GH=function(){return{concat:Bg}},JH=SL,ZH=function(e){var t=jS(e);return{concat:function(n,r){return t(r)(n)}}},JS={URI:Yn,map:Fi},XH=qe(JS),eY={URI:Yn,of:yu},tY={URI:Yn,map:Fi,mapWithIndex:PS},qg={URI:Yn,map:Fi,ap:kp},nY=kt(qg),rY=Lt(qg),iY={URI:Yn,map:Fi,ap:kp,of:yu},ZS={URI:Yn,map:Fi,ap:kp,chain:DS},oY=dt(ZS),aY={URI:Yn,map:Fi,ap:kp,of:yu,chain:DS},uY={URI:Yn,reduce:Lp,foldMap:jp,reduceRight:Up},sY={URI:Yn,reduce:Lp,foldMap:jp,reduceRight:Up,reduceWithIndex:qS,foldMapWithIndex:QS,reduceRightWithIndex:VS},cY={URI:Yn,map:Fi,reduce:Lp,foldMap:jp,reduceRight:Up,traverse:NS,sequence:Dg},lY={URI:Yn,map:Fi,mapWithIndex:PS,reduce:Lp,foldMap:jp,reduceRight:Up,traverse:NS,sequence:Dg,reduceWithIndex:qS,foldMapWithIndex:QS,reduceRightWithIndex:VS,traverseWithIndex:VL},fY={URI:Yn,map:Fi,alt:QL},dY={URI:Yn,map:Fi,extend:qL,extract:GS},pY=yu(tn),AY=Ut(JS),hY=Bt(ZS),mY=jt(qg),ni=Hn,$i=function(e){return e.slice(1)},Hl=vu,Yl=function(e){return e.slice(0,-1)},gY=_L,vY=IL,yY=function(e){return function(t){return t.reduce(e.concat)}},bY=function(e){return function(t){return e(ni(t),$i(t))}},CY=function(e){return function(t){return e(Yl(t),Hl(t))}},tj=function(e){return function(t){return Wd([e(ni(t))],$i(t),!0)}},SY=function(e){return tj(function(){return e})},nj=function(e){return function(t){return b(Yl(t),Fp(e(Hl(t))))}},_Y=function(e){return nj(function(){return e})},IY=RS;function TY(e){var t=WS(e),n=LL(e);return function(r){return la(r)?n(t(r)):[]}}function xY(e){return rj(function(t,n){return e(n)})}var rj=function(e){return function(t){return BS(t.filter(function(n,r){return e(r,n)}))}},wY=FL,$Y=ML;function ij(e,t){return t===void 0?vl(e):b(t,vl(e))}var oj=function(e,t){return b(e,Fp(t))},EY=Wg,RY=Lg,OY={URI:Yn,of:yu,map:Fi,mapWithIndex:PS,ap:kp,chain:DS,extend:qL,extract:GS,reduce:Lp,foldMap:jp,reduceRight:Up,traverse:NS,sequence:Dg,reduceWithIndex:qS,foldMapWithIndex:QS,reduceRightWithIndex:VS,traverseWithIndex:VL,alt:QL};const FY=Object.freeze(Object.defineProperty({__proto__:null,Alt:fY,Applicative:iY,Apply:qg,Chain:ZS,Comonad:dY,Do:pY,Foldable:uY,FoldableWithIndex:sY,Functor:JS,FunctorWithIndex:tY,Monad:aY,Pointed:eY,Traversable:cY,TraversableWithIndex:lY,URI:Yn,alt:HL,altW:zL,ap:YL,apFirst:nY,apS:mY,apSecond:rY,append:Fp,appendW:FS,bind:hY,bindTo:AY,chain:Pg,chainFirst:oY,chainWithIndex:DL,chop:KS,chunksOf:NL,concat:Bg,concatAll:yY,concatW:kL,cons:ij,copy:zl,duplicate:zH,extend:zS,extract:GS,filter:xY,filterWithIndex:rj,flap:XH,flatten:HH,fold:RY,foldMap:PL,foldMapWithIndex:KL,fromArray:BS,fromReadonlyNonEmptyArray:Mp,getEq:JH,getSemigroup:GH,getShow:YH,getUnionSemigroup:ZH,group:LL,groupBy:NH,groupSort:TY,head:ni,init:Yl,insertAt:qH,intercalate:IY,intersperse:WL,isNonEmpty:la,isOutOfBound:jg,last:Hl,makeBy:Ug,map:HS,mapWithIndex:YS,matchLeft:bY,matchRight:CY,max:vY,min:gY,modifyAt:jL,modifyHead:tj,modifyLast:nj,nonEmptyArray:OY,of:yu,prepend:vl,prependAll:Wg,prependToAll:EY,prependW:OS,range:OL,reduce:GL,reduceRight:ZL,reduceRightWithIndex:XL,reduceWithIndex:JL,replicate:PH,reverse:DH,rotate:US,sequence:Dg,snoc:oj,sort:WS,sortBy:RL,splitAt:Kg,tail:$i,traverse:ej,traverseWithIndex:Ng,unappend:ML,uncons:wY,union:jS,uniq:LS,unprepend:FL,unsafeInsertAt:MS,unsafeUpdateAt:kS,unsnoc:$Y,unzip:VH,updateAt:QH,updateHead:SY,updateLast:_Y,zip:BL,zipWith:UL},Symbol.toStringTag,{value:"Module"}));var MY=function(e){return typeof e=="number"},XS={equals:function(e,t){return e===t}},Qg={equals:XS.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},kY={equals:XS.equals,compare:Qg.compare,top:1/0,bottom:-1/0},LY={show:function(e){return JSON.stringify(e)}},aj={concat:function(e,t){return e-t}},e_={concat:function(e,t){return e+t}},t_={concat:function(e,t){return e*t}},jY={concat:e_.concat,empty:0},UY={concat:t_.concat,empty:1},BY={add:e_.concat,zero:0,mul:t_.concat,one:1,sub:aj.concat,degree:function(e){return 1},div:function(e,t){return e/t},mod:function(e,t){return e%t}};const WY=Object.freeze(Object.defineProperty({__proto__:null,Bounded:kY,Eq:XS,Field:BY,MagmaSub:aj,MonoidProduct:UY,MonoidSum:jY,Ord:Qg,SemigroupProduct:t_,SemigroupSum:e_,Show:LY,isNumber:MY},Symbol.toStringTag,{value:"Module"}));var Re=function(e,t){return{left:e,right:t}},KY=function(e,t){return b(e,uj(t))},PY=function(e,t){return b(e,sj(t))},DY=function(e,t,n){return b(e,cj(t,n))},uj=function(e){return function(t){return Re(Vg(t),e(zg(t)))}},sj=function(e){return function(t){return Re(e(Vg(t)),zg(t))}},cj=function(e,t){return function(n){return Re(e(Vg(n)),t(zg(n)))}},n_="Separated",NY={URI:n_,mapLeft:PY,bimap:DY},lj={URI:n_,map:KY},qY=qe(lj),Vg=function(e){return e.left},zg=function(e){return e.right};const QY=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:NY,Functor:lj,URI:n_,bimap:cj,flap:qY,left:Vg,map:uj,mapLeft:sj,right:zg,separated:Re},Symbol.toStringTag,{value:"Module"}));function Mi(e,t){return function(n){var r=e.traverse(n);return function(i,o){return n.map(r(i,o),t.separate)}}}function ki(e,t){return function(n){var r=e.traverse(n);return function(i,o){return n.map(r(i,o),t.compact)}}}function r_(e){return function(t){var n=e.wither(t);return function(r){return function(i){return n(i,function(o){return t.map(r(o),function(a){return a?fe(o):ye})})}}}}const VY=Object.freeze(Object.defineProperty({__proto__:null,filterE:r_,wiltDefault:Mi,witherDefault:ki},Symbol.toStringTag,{value:"Module"}));function Gl(e,t){return function(n){return n?t.of(void 0):e.zero()}}const zY=Object.freeze(Object.defineProperty({__proto__:null,guard:Gl},Symbol.toStringTag,{value:"Module"}));var HY=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))},oo=function(e){return e.length===0},Mt=ho,YY=gl,GY=oS,Hg=_g,JY=aS,fj=function(e,t){return e<=0?xt:Tg(t)(e)},ZY=function(e,t){return fj(e,function(){return t})};function XY(e){return function(t){return e(t)?[t]:xt}}var dj=function(e){return Nt(e)?xt:[e.value]},pj=function(e){return Xt(e)?xt:[e.right]},Aj=function(e,t){return function(n){return Mt(n)?t(n):e()}},hj=Aj,mj=function(e,t){return function(n){return Mt(n)?t(Hn(n),wi(n)):e()}},gj=mj,eG=gj,vj=function(e,t){return function(n){return Mt(n)?t(Vl(n),vu(n)):e()}},yj=vj,tG=yj,bj=function(e){return function(t){if(oo(t))return xt;for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},nG=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}},rG=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}},iG=function(e){return e.length},Jl=Sg;function bs(e,t){return t===void 0?function(n){return bs(e,n)}:Jl(e,t)?ye:fe(t[e])}var Cj=function(e){return Mt(e)?fe(Hn(e)):ye},Sj=function(e){return Mt(e)?fe(vu(e)):ye},oG=function(e){return Mt(e)?fe(wi(e)):ye},aG=function(e){return Mt(e)?fe(Vl(e)):ye},uG=function(e){return function(t){return Jl(e,t)?t:e===0?xt:t.slice(0,e)}},sG=function(e){return function(t){return Jl(e,t)?t:e===0?xt:t.slice(-e)}};function cG(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?xt:n}}var _j=function(e,t){for(var n=e.length,r=0;r<n&&t(e[r]);r++);return r};function lG(e){return function(t){var n=Fj(_j(t,e))(t),r=n[0],i=n[1];return{init:r,rest:i}}}var fG=function(e){return function(t){return e<=0||oo(t)?t:e>=t.length?xt:t.slice(e,t.length)}},dG=function(e){return function(t){return e<=0||oo(t)?t:e>=t.length?xt:t.slice(0,t.length-e)}};function pG(e){return function(t){var n=_j(t,e);return n===0?t:n===t.length?xt:t.slice(n)}}var Yg=function(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return fe(n);return ye}};function Gg(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return fe(t[n]);return ye}}var Ij=function(e){return function(t){for(var n=0;n<t.length;n++){var r=e(t[n]);if(_t(r))return r}return ye}};function Tj(e){return function(t){for(var n=t.length-1;n>=0;n--)if(e(t[n]))return fe(t[n]);return ye}}var xj=function(e){return function(t){for(var n=t.length-1;n>=0;n--){var r=e(t[n]);if(_t(r))return r}return ye}},wj=function(e){return function(t){for(var n=t.length-1;n>=0;n--)if(e(t[n]))return fe(n);return ye}},AG=function(e,t){return function(n){return e<0||e>n.length?ye:fe(Ig(e,t,n))}},hG=function(e,t){return $j(e,function(){return t})},mG=function(e){return function(t){return Jl(e,t)?ye:fe(iU(e,t))}},$j=function(e,t){return function(n){return Jl(e,n)?ye:fe(av(e,t(n[e]),n))}},gG=function(e){return e.length<=1?e:e.slice().reverse()},vG=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Right"&&t.push(r.right)}return t},yG=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Left"&&t.push(r.left)}return t},bG=function(e){return function(t){return t.length<=1?t:t.slice().sort(e.compare)}},Ej=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 Rj(e,t){return t===void 0?function(n){return Rj(n,e)}:Ej(e,t,function(n,r){return[n,r]})}var CG=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]},Oj=function(e){var t=xg(e);return function(n){return Mt(n)?t(n):n}},SG=function(e){var t=pS(e);return function(n){return Mt(n)?t(n):n}},_G=function(e){var t=lS(e);return function(n){return Mt(n)?t(n):n}};function Bp(e){return function(t,n){if(n===void 0){var r=Bp(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 IG=function(e){var t=sS(e);return function(n){return Mt(n)?t(n):n}},TG=function(e){var t=rL(e);return function(n){return Mt(n)?t(n):n}},xG=function(e){var t=AS(e);return function(n){return Mt(n)?t(n):xt}},Fj=function(e){return function(t){return e>=1&&Mt(t)?wg(e)(t):oo(t)?[t,xt]:[xt,t]}},wG=function(e){var t=pL(e);return function(n){return Mt(n)?t(n):xt}},$G=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return dj(e.apply(void 0,t))}};function EG(e,t,n){n===void 0&&(n=function(){return!0});var r=function(i,o){return Mt(o)?b(Hn(o),Kp(function(a){return r(b(i,Hg(a)),wi(o))})):n.apply(void 0,i)?[t.apply(void 0,i)]:xt};return r(xt,e)}var Mj=function(e){return function(t){return oo(t)?e:oo(e)?t:t.concat(e)}},RG=Mj;function i_(e){var t=cS(e);return function(n,r){if(r===void 0){var i=i_(e);return function(o){return i(o,n)}}return Mt(n)&&Mt(r)?t(r)(n):Mt(n)?n:r}}function o_(e){var t=Bp(e);return function(n,r){if(r===void 0){var i=o_(e);return function(o){return i(o,n)}}return n.filter(function(o){return t(o,r)})}}function a_(e){var t=Bp(e);return function(n,r){if(r===void 0){var i=a_(e);return function(o){return i(o,n)}}return n.filter(function(o){return!t(o,r)})}}var Cn=function(e,t){return b(e,p_(t))},Jg=function(e,t){return b(e,Nj(t))},bu=function(e,t){return b(e,Dj(t))},Wp=function(e,t){return b(e,Kp(t))},Zg=function(e,t){return b(e,qj(t))},Xg=function(e,t){return b(e,h_(t))},ev=function(e,t){return b(e,Qj(t))},tv=function(e,t){return b(e,Vj(t))},kj=function(e,t){return b(e,m_(t))},Lj=function(e,t){return b(e,g_(t))},u_=function(e,t){return b(e,Pj(t))},Ns=function(e,t,n){return b(e,y_(t,n))},Zl=function(e){var t=b_(e);return function(n,r){return b(n,t(r))}},Xl=function(e,t,n){return b(e,C_(t,n))},s_=function(e,t,n){return b(e,Pp(t,n))},c_=function(e){var t=rv(e);return function(n,r){return b(n,t(r))}},l_=function(e,t,n){return b(e,iv(t,n))},jj=function(e,t){return b(e,A_(t))},Uj=function(e,t){return b(e,zj(t))},Bj=function(e,t){return b(e,v_(t))},nv=function(e){var t=Hj(e);return function(n,r){return b(n,t(r))}},Wj=function(e){var t=S_(e);return function(n,r){return b(n,t(r))}},f_=function(e,t){return b(e,$_(t))},d_=function(e,t){return b(e,E_(t))},qs=gu,ef=function(){return xt},Kj=function(e){return function(t){return t.concat(e())}},Pj=Kj,Dj=function(e){return Kp(function(t){return b(e,p_(t))})},Kp=function(e){return function(t){return b(t,bj(function(n,r){return e(r)}))}},OG=Kp(P),p_=function(e){return function(t){return t.map(function(n){return e(n)})}},Nj=function(e){return function(t){return t.map(function(n,r){return e(r,n)})}},tf=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 Re(t,n)},qj=function(e){return function(t){return t.filter(e)}},A_=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);_t(i)&&n.push(i.value)}return n}},h_=function(e){return A_(function(t,n){return e(n)})},nf=h_(P),Qj=function(e){return m_(function(t,n){return e(n)})},m_=function(e){return function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=t[i];e(i,o)?r.push(o):n.push(o)}return Re(n,r)}},Vj=function(e){return g_(function(t,n){return e(n)})},g_=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 Re(n,r)}},zj=function(e){return function(t){return t.filter(function(n,r){return e(r,n)})}},v_=function(e){return function(t){return t.map(function(n,r){return e(t.slice(r))})}},FG=v_(P),rv=function(e){return function(t){return function(n){return n.reduce(function(r,i,o){return e.concat(r,t(o,i))},e.empty)}}},y_=function(e,t){return Pp(e,function(n,r,i){return t(r,i)})},b_=function(e){var t=rv(e);return function(n){return t(function(r,i){return n(i)})}},Pp=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}},C_=function(e,t){return iv(e,function(n,r,i){return t(r,i)})},iv=function(e,t){return function(n){return n.reduceRight(function(r,i,o){return t(o,i,r)},e)}},Hj=function(e){var t=S_(e);return function(n){return t(function(r,i){return n(i)})}},Dp=function(e){return function(t){return Ns(t,e.of(ef()),function(n,r){return e.ap(e.map(n,function(i){return function(o){return b(i,Hg(o))}}),r)})}},S_=function(e){return function(t){return Pp(e.of(ef()),function(n,r,i){return e.ap(e.map(r,function(o){return function(a){return b(o,Hg(a))}}),t(n,i))})}},MG=function(e){var t=R_(e);return function(n){return function(r){return t(r,n)}}},kG=function(e){var t=O_(e);return function(n){return function(r){return t(r,n)}}},__=function(e,t){for(var n=[],r=e;;){var i=t(r);if(_t(i)){var o=i.value,a=o[0],u=o[1];n.push(a),r=u}else break}return n},pt="ReadonlyArray",Yj=function(e){return{show:function(t){return"[".concat(t.map(e.show).join(", "),"]")}}},Gj=function(){return{concat:function(e,t){return oo(e)?t:oo(t)?e:e.concat(t)}}},LG=function(){return{concat:Gj().concat,empty:xt}},Jj=function(e){return ti(function(t,n){return t.length===n.length&&t.every(function(r,i){return e.equals(r,n[i])})})},Zj=function(e){return Ds(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 Qg.compare(r,i)})},Xj=function(e){var t=i_(e);return{concat:function(n,r){return t(r)(n)}}},jG=function(e){return{concat:Xj(e).concat,empty:xt}},UG=function(e){var t=o_(e);return{concat:function(n,r){return t(r)(n)}}},BG=function(e){var t=a_(e);return{concat:function(n,r){return t(r)(n)}}},I_={URI:pt,map:Cn},WG=qe(I_),eU={URI:pt,of:qs},KG={URI:pt,map:Cn,mapWithIndex:Jg},ov={URI:pt,map:Cn,ap:bu},PG=kt(ov),DG=Lt(ov),NG={URI:pt,map:Cn,ap:bu,of:qs},T_={URI:pt,map:Cn,ap:bu,chain:Wp},qG={URI:pt,map:Cn,ap:bu,of:qs,chain:Wp},QG=dt(T_),VG={URI:pt,unfold:__},zG={URI:pt,map:Cn,alt:u_},tU={URI:pt,zero:ef},HG=Gl(tU,eU),YG={URI:pt,map:Cn,ap:bu,of:qs,alt:u_,zero:ef},GG={URI:pt,map:Cn,extend:Bj},x_={URI:pt,compact:nf,separate:tf},JG={URI:pt,map:Cn,compact:nf,separate:tf,filter:Zg,filterMap:Xg,partition:ev,partitionMap:tv},ZG={URI:pt,map:Cn,mapWithIndex:Jg,compact:nf,separate:tf,filter:Zg,filterMap:Xg,partition:ev,partitionMap:tv,partitionMapWithIndex:Lj,partitionWithIndex:kj,filterMapWithIndex:jj,filterWithIndex:Uj},XG={URI:pt,reduce:Ns,foldMap:Zl,reduceRight:Xl},eJ={URI:pt,reduce:Ns,foldMap:Zl,reduceRight:Xl,reduceWithIndex:s_,foldMapWithIndex:c_,reduceRightWithIndex:l_},w_={URI:pt,map:Cn,reduce:Ns,foldMap:Zl,reduceRight:Xl,traverse:nv,sequence:Dp},tJ={URI:pt,map:Cn,mapWithIndex:Jg,reduce:Ns,foldMap:Zl,reduceRight:Xl,reduceWithIndex:s_,foldMapWithIndex:c_,reduceRightWithIndex:l_,traverse:nv,sequence:Dp,traverseWithIndex:Wj},$_=function(e){return function(t){for(var n=HY([],e(t),!0),r=[];n.length>0;){var i=n.shift();Xt(i)?n.unshift.apply(n,e(i.left)):r.push(i.right)}return r}},nJ={URI:pt,map:Cn,ap:bu,chain:Wp,chainRec:f_},E_=function(e){return function(t){var n=e(t),r=[],i=[];function o(c){Xt(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}},rJ={URI:pt,map:Cn,ap:bu,chain:Wp,chainRec:d_},R_=ki(w_,x_),O_=Mi(w_,x_),nU={URI:pt,map:Cn,compact:nf,separate:tf,filter:Zg,filterMap:Xg,partition:ev,partitionMap:tv,reduce:Ns,foldMap:Zl,reduceRight:Xl,traverse:nv,sequence:Dp,wither:R_,wilt:O_},iJ=r_(nU),rU={URI:pt,fromEither:pj},oJ=Mr(rU),aJ=Ig,av=function(e,t,n){return Mt(n)?uS(e,t,n):n},iU=function(e,t){var n=t.slice();return n.splice(e,1),n},uJ=function(e){return e.slice()},sJ=function(e){return oo(e)?xt:e.slice()},xt=xp;function oU(e){return function(t){return t.every(e)}}var aU=function(e){return function(t){return t.some(e)}},cJ=aU,uU=function(e){var t=RS(e);return function(n){return hj(function(){return e.empty},t(n))}},lJ=qs(tn),fJ=Ut(I_),dJ=Bt(T_),pJ=jt(ov),AJ=iL,hJ=$L,mJ=EL,gJ=Oj,vJ={URI:pt,compact:nf,separate:tf,map:Cn,ap:bu,of:qs,chain:Wp,filter:Zg,filterMap:Xg,partition:ev,partitionMap:tv,mapWithIndex:Jg,partitionMapWithIndex:Lj,partitionWithIndex:kj,filterMapWithIndex:jj,filterWithIndex:Uj,alt:u_,zero:ef,unfold:__,reduce:Ns,foldMap:Zl,reduceRight:Xl,traverse:nv,sequence:Dp,reduceWithIndex:s_,foldMapWithIndex:c_,reduceRightWithIndex:l_,traverseWithIndex:Wj,extend:Bj,wither:R_,wilt:O_};const yJ=Object.freeze(Object.defineProperty({__proto__:null,Alt:zG,Alternative:YG,Applicative:NG,Apply:ov,Chain:T_,ChainRecBreadthFirst:rJ,ChainRecDepthFirst:nJ,Compactable:x_,Do:lJ,Extend:GG,Filterable:JG,FilterableWithIndex:ZG,Foldable:XG,FoldableWithIndex:eJ,FromEither:rU,Functor:I_,FunctorWithIndex:KG,Monad:qG,Pointed:eU,Traversable:w_,TraversableWithIndex:tJ,URI:pt,Unfoldable:VG,Witherable:nU,Zero:tU,_chainRecBreadthFirst:d_,_chainRecDepthFirst:f_,alt:Pj,altW:Kj,ap:Dj,apFirst:PG,apS:pJ,apSecond:DG,append:Hg,appendW:JY,bind:dJ,bindTo:fJ,chain:Kp,chainFirst:QG,chainRecBreadthFirst:E_,chainRecDepthFirst:$_,chainWithIndex:bj,chop:xG,chunksOf:wG,compact:nf,comprehension:EG,concat:RG,concatW:Mj,cons:hJ,deleteAt:mG,difference:a_,dropLeft:fG,dropLeftWhile:pG,dropRight:dG,duplicate:FG,elem:Bp,empty:xt,every:oU,exists:cJ,extend:v_,filter:qj,filterE:iJ,filterMap:h_,filterMapWithIndex:A_,filterWithIndex:zj,findFirst:Gg,findFirstMap:Ij,findIndex:Yg,findLast:Tj,findLastIndex:wj,findLastMap:xj,flap:WG,flatten:OG,foldLeft:eG,foldMap:b_,foldMapWithIndex:rv,foldRight:tG,fromArray:sJ,fromEither:pj,fromEitherK:oJ,fromOption:dj,fromOptionK:$G,fromPredicate:XY,getDifferenceMagma:BG,getEq:Jj,getIntersectionSemigroup:UG,getMonoid:LG,getOrd:Zj,getSemigroup:Gj,getShow:Yj,getUnionMonoid:jG,getUnionSemigroup:Xj,guard:HG,head:Cj,init:aG,insertAt:AG,intercalate:uU,intersection:o_,intersperse:SG,isEmpty:oo,isNonEmpty:Mt,isOutOfBound:Jl,last:Sj,lefts:yG,lookup:bs,makeBy:fj,map:p_,mapWithIndex:Nj,match:hj,matchLeft:gj,matchLeftW:mj,matchRight:yj,matchRightW:vj,matchW:Aj,modifyAt:$j,of:qs,partition:Qj,partitionMap:Vj,partitionMapWithIndex:g_,partitionWithIndex:m_,prepend:YY,prependAll:Oj,prependToAll:gJ,prependW:GY,range:AJ,readonlyArray:vJ,reduce:y_,reduceRight:C_,reduceRightWithIndex:iv,reduceWithIndex:Pp,replicate:ZY,reverse:gG,rights:vG,rotate:_G,scanLeft:nG,scanRight:rG,separate:tf,sequence:Dp,size:iG,snoc:mJ,some:aU,sort:bG,sortBy:TG,spanLeft:lG,splitAt:Fj,tail:oG,takeLeft:uG,takeLeftWhile:cG,takeRight:sG,toArray:uJ,traverse:Hj,traverseWithIndex:S_,unfold:__,union:i_,uniq:IG,unsafeDeleteAt:iU,unsafeInsertAt:aJ,unsafeUpdateAt:av,unzip:CG,updateAt:hG,wilt:kG,wither:MG,zero:ef,zip:Rj,zipWith:Ej},Symbol.toStringTag,{value:"Module"}));var uu=function(e){return e.length===0},qt=la,bJ=vl,CJ=OS,uv=Fp,SJ=FS,sU=function(e,t){return e<=0?[]:Ug(t)(e)},_J=function(e,t){return sU(e,function(){return t})};function IJ(e){return function(t){return e(t)?[t]:[]}}var cU=function(e){return Nt(e)?[]:[e.value]},lU=function(e){return Xt(e)?[]:[e.right]},fU=function(e,t){return function(n){return qt(n)?t(n):e()}},TJ=fU,dU=function(e,t){return function(n){return qt(n)?t(ni(n),$i(n)):e()}},pU=dU,xJ=pU,AU=function(e,t){return function(n){return qt(n)?t(Yl(n),Hl(n)):e()}},hU=AU,wJ=hU,mU=function(e){return function(t){for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},$J=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}},EJ=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}},RJ=function(e){return e.length},Np=jg,OJ=bs,FJ=Cj,MJ=Sj,kJ=function(e){return qt(e)?fe($i(e)):ye},LJ=function(e){return qt(e)?fe(Yl(e)):ye},jJ=function(e){return function(t){return Np(e,t)?On(t):t.slice(0,e)}},UJ=function(e){return function(t){return Np(e,t)?On(t):e===0?[]:t.slice(-e)}};function BJ(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 gU=function(e,t){for(var n=e.length,r=0;r<n&&t(e[r]);r++);return r};function WJ(e){return function(t){var n=SU(gU(t,e))(t),r=n[0],i=n[1];return{init:r,rest:i}}}var KJ=function(e){return function(t){return e<=0||uu(t)?On(t):e>=t.length?[]:t.slice(e,t.length)}},PJ=function(e){return function(t){return e<=0||uu(t)?On(t):e>=t.length?[]:t.slice(0,t.length-e)}};function DJ(e){return function(t){return t.slice(gU(t,e))}}var NJ=Yg;function qJ(e){return Gg(e)}var QJ=Ij;function VJ(e){return Tj(e)}var zJ=xj,HJ=wj,On=function(e){return e.slice()},YJ=function(e,t){return function(n){return e<0||e>n.length?ye:fe(JU(e,t,n))}},GJ=function(e,t){return vU(e,function(){return t})},JJ=function(e){return function(t){return Np(e,t)?ye:fe(XU(e,t))}},vU=function(e,t){return function(n){return Np(e,n)?ye:fe(ZU(e,t(n[e]),n))}},ZJ=function(e){return uu(e)?[]:e.slice().reverse()},XJ=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Right"&&t.push(r.right)}return t},eZ=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Left"&&t.push(r.left)}return t},tZ=function(e){return function(t){return t.length<=1?On(t):t.slice().sort(e.compare)}},yU=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 bU(e,t){return t===void 0?function(n){return bU(n,e)}:yU(e,t,function(n,r){return[n,r]})}var nZ=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]},CU=function(e){var t=Wg(e);return function(n){return qt(n)?t(n):[]}},rZ=function(e){var t=WL(e);return function(n){return qt(n)?t(n):On(n)}},iZ=function(e){var t=US(e);return function(n){return qt(n)?t(n):On(n)}},F_=Bp,oZ=function(e){var t=LS(e);return function(n){return qt(n)?t(n):On(n)}},aZ=function(e){var t=RL(e);return function(n){return qt(n)?t(n):On(n)}},uZ=function(e){var t=KS(e);return function(n){return qt(n)?t(n):[]}},SU=function(e){return function(t){return e>=1&&qt(t)?Kg(e)(t):uu(t)?[On(t),[]]:[[],On(t)]}},sZ=function(e){var t=NL(e);return function(n){return qt(n)?t(n):[]}},cZ=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return cU(e.apply(void 0,t))}};function lZ(e,t,n){n===void 0&&(n=function(){return!0});var r=function(i,o){return qt(o)?b(ni(o),Qp(function(a){return r(b(i,uv(a)),$i(o))})):n.apply(void 0,i)?[t.apply(void 0,i)]:[]};return r([],e)}var _U=function(e){return function(t){return uu(t)?On(e):uu(e)?On(t):t.concat(e)}},fZ=_U;function M_(e){var t=jS(e);return function(n,r){if(r===void 0){var i=M_(e);return function(o){return i(o,n)}}return qt(n)&&qt(r)?t(r)(n):qt(n)?On(n):On(r)}}function k_(e){var t=F_(e);return function(n,r){if(r===void 0){var i=k_(e);return function(o){return i(o,n)}}return n.filter(function(o){return t(o,r)})}}function L_(e){var t=F_(e);return function(n,r){if(r===void 0){var i=L_(e);return function(o){return i(o,n)}}return n.filter(function(o){return!t(o,r)})}}var Sn=function(e,t){return b(e,K_(t))},sv=function(e,t){return b(e,OU(t))},Cu=function(e,t){return b(e,RU(t))},qp=function(e,t){return b(e,Qp(t))},cv=function(e,t){return b(e,FU(t))},lv=function(e,t){return b(e,D_(t))},fv=function(e,t){return b(e,MU(t))},dv=function(e,t){return b(e,kU(t))},IU=function(e,t){return b(e,N_(t))},TU=function(e,t){return b(e,q_(t))},j_=function(e,t){return b(e,jU(t))},Qs=function(e,t,n){return b(e,KU(t,n))},rf=function(e){var t=BU(e);return function(n,r){return b(n,t(r))}},of=function(e,t,n){return b(e,PU(t,n))},U_=function(e,t,n){return b(e,V_(t,n))},B_=function(e){var t=WU(e);return function(n,r){return b(n,t(r))}},W_=function(e,t,n){return b(e,DU(t,n))},xU=function(e,t){return b(e,P_(t))},wU=function(e,t){return b(e,UU(t))},$U=function(e,t){return b(e,Q_(t))},pv=function(e){var t=Av(e);return function(n,r){return b(n,t(r))}},EU=function(e){var t=z_(e);return function(n,r){return b(n,t(r))}},dZ=f_,pZ=d_,Su=yu,af=function(){return[]},K_=function(e){return function(t){return t.map(function(n){return e(n)})}},RU=function(e){return Qp(function(t){return b(e,K_(t))})},Qp=function(e){return function(t){return b(t,mU(function(n,r){return e(r)}))}},AZ=Qp(P),OU=function(e){return function(t){return t.map(function(n,r){return e(r,n)})}},P_=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);_t(i)&&n.push(i.value)}return n}},D_=function(e){return P_(function(t,n){return e(n)})},uf=D_(P),sf=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 Re(t,n)},FU=function(e){return function(t){return t.filter(e)}},MU=function(e){return N_(function(t,n){return e(n)})},N_=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 Re(n,r)}},kU=function(e){return q_(function(t,n){return e(n)})},q_=function(e){return function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=e(i,t[i]);o._tag==="Left"?n.push(o.left):r.push(o.right)}return Re(n,r)}},LU=function(e){return function(t){return t.concat(e())}},jU=LU,UU=function(e){return function(t){return t.filter(function(n,r){return e(r,n)})}},Q_=function(e){return function(t){return t.map(function(n,r){return e(t.slice(r))})}},hZ=Q_(P),BU=b_,WU=rv,KU=y_,V_=Pp,PU=C_,DU=iv,Av=function(e){var t=z_(e);return function(n){return t(function(r,i){return n(i)})}},Vp=function(e){return function(t){return Qs(t,e.of(af()),function(n,r){return e.ap(e.map(n,function(i){return function(o){return b(i,uv(o))}}),r)})}},z_=function(e){return function(t){return V_(e.of(af()),function(n,r,i){return e.ap(e.map(r,function(o){return function(a){return b(o,uv(a))}}),t(n,i))})}},mZ=function(e){var t=eI(e);return function(n){return function(r){return t(r,n)}}},gZ=function(e){var t=tI(e);return function(n){return function(r){return t(r,n)}}},H_=function(e,t){for(var n=[],r=e;;){var i=t(r);if(_t(i)){var o=i.value,a=o[0],u=o[1];n.push(a),r=u}else break}return n},At="Array",vZ=Yj,NU=function(){return{concat:function(e,t){return e.concat(t)}}},Y_=function(){return{concat:NU().concat,empty:[]}},qU=Jj,yZ=Zj,QU=function(e){var t=M_(e);return{concat:function(n,r){return t(r)(n)}}},bZ=function(e){return{concat:QU(e).concat,empty:[]}},CZ=function(e){var t=k_(e);return{concat:function(n,r){return t(r)(n)}}},SZ=function(e){var t=L_(e);return{concat:function(n,r){return t(r)(n)}}},G_={URI:At,map:Sn},_Z=qe(G_),VU={URI:At,of:Su},IZ={URI:At,map:Sn,mapWithIndex:sv},hv={URI:At,map:Sn,ap:Cu},TZ=kt(hv),xZ=Lt(hv),wZ={URI:At,map:Sn,ap:Cu,of:Su},J_={URI:At,map:Sn,ap:Cu,chain:qp},$Z=dt(J_),EZ={URI:At,map:Sn,ap:Cu,of:Su,chain:qp},RZ={URI:At,unfold:H_},OZ={URI:At,map:Sn,alt:j_},zU={URI:At,zero:af},FZ=Gl(zU,VU),MZ={URI:At,map:Sn,ap:Cu,of:Su,alt:j_,zero:af},kZ={URI:At,map:Sn,extend:$U},Z_={URI:At,compact:uf,separate:sf},LZ={URI:At,map:Sn,compact:uf,separate:sf,filter:cv,filterMap:lv,partition:fv,partitionMap:dv},jZ={URI:At,map:Sn,mapWithIndex:sv,compact:uf,separate:sf,filter:cv,filterMap:lv,partition:fv,partitionMap:dv,partitionMapWithIndex:TU,partitionWithIndex:IU,filterMapWithIndex:xU,filterWithIndex:wU},HU={URI:At,reduce:Qs,foldMap:rf,reduceRight:of},UZ={URI:At,reduce:Qs,foldMap:rf,reduceRight:of,reduceWithIndex:U_,foldMapWithIndex:B_,reduceRightWithIndex:W_},X_={URI:At,map:Sn,reduce:Qs,foldMap:rf,reduceRight:of,traverse:pv,sequence:Vp},BZ={URI:At,map:Sn,mapWithIndex:sv,reduce:Qs,foldMap:rf,reduceRight:of,reduceWithIndex:U_,foldMapWithIndex:B_,reduceRightWithIndex:W_,traverse:pv,sequence:Vp,traverseWithIndex:EU},eI=ki(X_,Z_),tI=Mi(X_,Z_),YU={URI:At,map:Sn,compact:uf,separate:sf,filter:cv,filterMap:lv,partition:fv,partitionMap:dv,reduce:Qs,foldMap:rf,reduceRight:of,traverse:pv,sequence:Vp,wither:eI,wilt:tI},WZ=$_,KZ={URI:At,map:Sn,ap:Cu,chain:qp,chainRec:dZ},PZ=E_,DZ={URI:At,map:Sn,ap:Cu,chain:qp,chainRec:pZ},NZ=r_(YU),GU={URI:At,fromEither:lU},qZ=Mr(GU),JU=MS,ZU=function(e,t,n){return qt(n)?kS(e,t,n):[]},XU=function(e,t){var n=t.slice();return n.splice(e,1),n},QZ=oU,e2=function(e){return function(t){return t.some(e)}},VZ=e2,zZ=uU,HZ=Su(tn),YZ=Ut(G_),GZ=Bt(J_),JZ=jt(hv),ZZ=OL,XZ=[],eX=ij,tX=oj,nX=CU,rX={URI:At,compact:uf,separate:sf,map:Sn,ap:Cu,of:Su,chain:qp,filter:cv,filterMap:lv,partition:fv,partitionMap:dv,mapWithIndex:sv,partitionMapWithIndex:TU,partitionWithIndex:IU,filterMapWithIndex:xU,filterWithIndex:wU,alt:j_,zero:af,unfold:H_,reduce:Qs,foldMap:rf,reduceRight:of,traverse:pv,sequence:Vp,reduceWithIndex:U_,foldMapWithIndex:B_,reduceRightWithIndex:W_,traverseWithIndex:EU,extend:$U,wither:eI,wilt:tI};const iX=Object.freeze(Object.defineProperty({__proto__:null,Alt:OZ,Alternative:MZ,Applicative:wZ,Apply:hv,Chain:J_,ChainRecBreadthFirst:DZ,ChainRecDepthFirst:KZ,Compactable:Z_,Do:HZ,Extend:kZ,Filterable:LZ,FilterableWithIndex:jZ,Foldable:HU,FoldableWithIndex:UZ,FromEither:GU,Functor:G_,FunctorWithIndex:IZ,Monad:EZ,Pointed:VU,Traversable:X_,TraversableWithIndex:BZ,URI:At,Unfoldable:RZ,Witherable:YU,Zero:zU,alt:jU,altW:LU,ap:RU,apFirst:TZ,apS:JZ,apSecond:xZ,append:uv,appendW:SJ,array:rX,bind:GZ,bindTo:YZ,chain:Qp,chainFirst:$Z,chainRecBreadthFirst:PZ,chainRecDepthFirst:WZ,chainWithIndex:mU,chop:uZ,chunksOf:sZ,compact:uf,comprehension:lZ,concat:fZ,concatW:_U,cons:eX,copy:On,deleteAt:JJ,difference:L_,dropLeft:KJ,dropLeftWhile:DJ,dropRight:PJ,duplicate:hZ,elem:F_,empty:XZ,every:QZ,exists:VZ,extend:Q_,filter:FU,filterE:NZ,filterMap:D_,filterMapWithIndex:P_,filterWithIndex:UU,findFirst:qJ,findFirstMap:QJ,findIndex:NJ,findLast:VJ,findLastIndex:HJ,findLastMap:zJ,flap:_Z,flatten:AZ,foldLeft:xJ,foldMap:BU,foldMapWithIndex:WU,foldRight:wJ,fromEither:lU,fromEitherK:qZ,fromOption:cU,fromOptionK:cZ,fromPredicate:IJ,getDifferenceMagma:SZ,getEq:qU,getIntersectionSemigroup:CZ,getMonoid:Y_,getOrd:yZ,getSemigroup:NU,getShow:vZ,getUnionMonoid:bZ,getUnionSemigroup:QU,guard:FZ,head:FJ,init:LJ,insertAt:YJ,intercalate:zZ,intersection:k_,intersperse:rZ,isEmpty:uu,isNonEmpty:qt,isOutOfBound:Np,last:MJ,lefts:eZ,lookup:OJ,makeBy:sU,map:K_,mapWithIndex:OU,match:TJ,matchLeft:pU,matchLeftW:dU,matchRight:hU,matchRightW:AU,matchW:fU,modifyAt:vU,of:Su,partition:MU,partitionMap:kU,partitionMapWithIndex:q_,partitionWithIndex:N_,prepend:bJ,prependAll:CU,prependToAll:nX,prependW:CJ,range:ZZ,reduce:KU,reduceRight:PU,reduceRightWithIndex:DU,reduceWithIndex:V_,replicate:_J,reverse:ZJ,rights:XJ,rotate:iZ,scanLeft:$J,scanRight:EJ,separate:sf,sequence:Vp,size:RJ,snoc:tX,some:e2,sort:tZ,sortBy:aZ,spanLeft:WJ,splitAt:SU,tail:kJ,takeLeft:jJ,takeLeftWhile:BJ,takeRight:UJ,traverse:Av,traverseWithIndex:z_,unfold:H_,union:M_,uniq:oZ,unsafeDeleteAt:XU,unsafeInsertAt:JU,unsafeUpdateAt:ZU,unzip:nZ,updateAt:GJ,wilt:gZ,wither:mZ,zero:af,zip:bU,zipWith:yU},Symbol.toStringTag,{value:"Module"})),oX=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var aX=function(e){return typeof e=="boolean"},t2=function(e,t){return function(n){return n?t():e()}},n2=t2,r2=n2,uX=r2,i2={equals:function(e,t){return e===t}},sX={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}},o2={concat:function(e,t){return e&&t}},a2={concat:function(e,t){return e||t}},cX={concat:o2.concat,empty:!0},lX={concat:a2.concat,empty:!1},fX={equals:i2.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},dX={show:function(e){return JSON.stringify(e)}};const pX=Object.freeze(Object.defineProperty({__proto__:null,BooleanAlgebra:sX,Eq:i2,MonoidAll:cX,MonoidAny:lX,Ord:fX,SemigroupAll:o2,SemigroupAny:a2,Show:dX,fold:uX,foldW:n2,isBoolean:aX,match:r2,matchW:t2},Symbol.toStringTag,{value:"Module"}));var u2=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}},AX={meet:function(){},join:function(){},zero:void 0,one:void 0,implies:function(){},not:function(){}},hX=u2,mX={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}},gX=Ik;const vX=Object.freeze(Object.defineProperty({__proto__:null,booleanAlgebraBoolean:mX,booleanAlgebraVoid:AX,getDualBooleanAlgebra:hX,getFunctionBooleanAlgebra:gX,reverse:u2},Symbol.toStringTag,{value:"Module"}));var yX=function(e){return Vk(e)(e.bottom,e.top)},bX=function(e){var t=GC(e);return{equals:t.equals,compare:t.compare,top:e.bottom,bottom:e.top}},CX={equals:dm.equals,compare:dm.compare,top:1/0,bottom:-1/0};const SX=Object.freeze(Object.defineProperty({__proto__:null,boundedNumber:CX,clamp:yX,reverse:bX},Symbol.toStringTag,{value:"Module"}));function s2(e){return{meet:gg(e),join:vg(e)}}const _X=Object.freeze(Object.defineProperty({__proto__:null,getMinMaxDistributiveLattice:s2},Symbol.toStringTag,{value:"Module"}));function IX(e){var t=s2(e);return function(n,r){return{join:t.join,meet:t.meet,zero:n,one:r}}}const TX=Object.freeze(Object.defineProperty({__proto__:null,getMinMaxBoundedDistributiveLattice:IX},Symbol.toStringTag,{value:"Module"})),xX=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),wX=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),$X=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),EX=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var nI=function(e,t){for(var n=t(e);n._tag==="Left";)n=t(n.left);return n.right};const RX=Object.freeze(Object.defineProperty({__proto__:null,tailRec:nI},Symbol.toStringTag,{value:"Module"}));function rI(e,t){return function(n,r){return t.compose(e.right(r),e.left(n))}}function c2(e,t){var n=rI(e,t);return function(r,i){return t.compose(e.promap(t.id(),function(o){return o._tag==="Left"?o.left:o.right},P),n(r,i))}}function OX(e){return rI(e,e)}function FX(e){return c2(e,e)}const MX=Object.freeze(Object.defineProperty({__proto__:null,fanIn:c2,fanin:FX,split:rI,splitChoice:OX},Symbol.toStringTag,{value:"Module"})),kX=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var LX=function(e,t){return b(e,l2(t))},l2=function(e){return function(t){return z(e,t)}},f2="Predicate",d2=function(){return{concat:function(e,t){return b(e,A2(t))}}},jX=function(){return{concat:d2().concat,empty:wk}},p2=function(){return{concat:function(e,t){return b(e,h2(t))}}},UX=function(){return{concat:p2().concat,empty:VC}},BX={URI:f2,contramap:LX},Kd=function(e){return function(t){return!e(t)}},A2=function(e){return function(t){return function(n){return t(n)||e(n)}}},h2=function(e){return function(t){return function(n){return t(n)&&e(n)}}};const WX=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:BX,URI:f2,and:h2,contramap:l2,getMonoidAll:UX,getMonoidAny:jX,getSemigroupAll:p2,getSemigroupAny:d2,not:Kd,or:A2},Symbol.toStringTag,{value:"Module"}));var ot=ye,It=fe;function mv(e){return function(t){return e(t)?It(t):ot}}var gv=function(e){return e._tag==="Right"?ot:It(e.left)},zp=function(e){return e._tag==="Left"?ot:It(e.right)},kr=function(e,t){return b(e,mo(t))},Vs=function(e,t){return b(e,y2(t))},vv=function(e,t){return b(e,Hp(t))},yv=function(e,t,n){return b(e,C2(t,n))},bv=function(e){var t=S2(e);return function(n,r){return b(n,t(r))}},Cv=function(e,t,n){return b(e,_2(t,n))},iI=function(e){var t=O2(e);return function(n,r){return b(n,t(r))}},oI=function(e,t){return b(e,T2(t))},Pd=function(e,t){return b(e,w2(t))},aI=function(e,t){return b(e,$2(t))},m2=function(e,t){return b(e,lI(t))},uI=function(e,t){return b(e,E2(t))},sI=function(e,t){return b(e,R2(t))},zt="Option",KX=function(e){return{show:function(t){return Ne(t)?"none":"some(".concat(e.show(t.value),")")}}},g2=function(e){return{equals:function(t,n){return t===n||(Ne(t)?Ne(n):Ne(n)?!1:e.equals(t.value,n.value))}}},PX=function(e){return{equals:g2(e).equals,compare:function(t,n){return t===n?0:pm(t)?pm(n)?e.compare(t.value,n.value):1:-1}}},cI=function(e){return{concat:function(t,n){return Ne(t)?n:Ne(n)?t:It(e.concat(t.value,n.value))},empty:ot}},mo=function(e){return function(t){return Ne(t)?ot:It(e(t.value))}},cf={URI:zt,map:kr},fa=It,v2={URI:zt,of:fa},y2=function(e){return function(t){return Ne(t)||Ne(e)?ot:It(t.value(e.value))}},lf={URI:zt,map:kr,ap:Vs},b2={URI:zt,map:kr,ap:Vs,of:fa},Hp=function(e){return function(t){return Ne(t)?ot:e(t.value)}},Yp={URI:zt,map:kr,ap:Vs,chain:vv},DX={URI:zt,map:kr,ap:Vs,of:fa,chain:vv},C2=function(e,t){return function(n){return Ne(n)?e:t(e,n.value)}},S2=function(e){return function(t){return function(n){return Ne(n)?e.empty:t(n.value)}}},_2=function(e,t){return function(n){return Ne(n)?e:t(n.value,e)}},NX={URI:zt,reduce:yv,foldMap:bv,reduceRight:Cv},I2=function(e){return function(t){return Ne(t)?e():t}},T2=I2,qX={URI:zt,map:kr,alt:oI},Sv=function(){return ot},x2={URI:zt,zero:Sv},QX=Gl(x2,v2),VX={URI:zt,map:kr,ap:Vs,of:fa,alt:oI,zero:Sv},lI=function(e){return function(t){return Ne(t)?ot:It(e(t))}},zX={URI:zt,map:kr,extend:m2},ff=Hp(P),HX=Re(ot,ot),df=function(e){return Ne(e)?HX:Re(gv(e.value),zp(e.value))},zs={URI:zt,compact:ff,separate:df},w2=function(e){return function(t){return Ne(t)?ot:e(t.value)?t:ot}},$2=function(e){return function(t){return Ne(t)?ot:e(t.value)}},E2=function(e){return function(t){return Re(Pd(t,Kd(e)),Pd(t,e))}},R2=function(e){return z(mo(e),df)},da={URI:zt,map:kr,compact:ff,separate:df,filter:Pd,filterMap:aI,partition:uI,partitionMap:sI},O2=function(e){return function(t){return function(n){return Ne(n)?e.of(ot):e.map(t(n.value),It)}}},_v=function(e){return function(t){return Ne(t)?e.of(ot):e.map(t.value,It)}},fI={URI:zt,map:kr,reduce:yv,foldMap:bv,reduceRight:Cv,traverse:iI,sequence:_v},dI=ki(fI,zs),pI=Mi(fI,zs),YX=function(e){var t=dI(e);return function(n){return function(r){return t(r,n)}}},GX=function(e){var t=pI(e);return function(n){return function(r){return t(r,n)}}},JX={URI:zt,map:kr,reduce:yv,foldMap:bv,reduceRight:Cv,traverse:iI,sequence:_v,compact:ff,separate:df,filter:Pd,filterMap:aI,partition:uI,partitionMap:sI,wither:dI,wilt:pI},AI=function(){return ot},ZX={URI:zt,map:kr,ap:Vs,of:fa,chain:vv,throwError:AI},pf=zp,Iv={URI:zt,fromEither:pf},pm=_t,Ne=function(e){return e._tag==="None"},hI=function(e,t){return function(n){return Ne(n)?e():t(n.value)}},XX=hI,pa=hI,_u=pa,F2=function(e){return function(t){return Ne(t)?e():t.value}},mI=F2,eee=qe(cf),tee=kt(lf),nee=Lt(lf),ree=ff,iee=dt(Yp),oee=lI(P),aee=Mr(Iv),uee=sa(Iv,Yp),see=ca(Iv,Yp),Hs=function(e){return e==null?ot:It(e)},M2=function(e){try{return It(e())}catch{return ot}},cee=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return M2(function(){return e.apply(void 0,t)})}},lee=function(e){return z(e,Hs)},k2=function(e){return function(t){return Ne(t)?ot:Hs(e(t.value))}},gI=pa($k,P),L2=pa(zC,P);function j2(e){return function(t,n){if(n===void 0){var r=j2(e);return function(i){return r(t,i)}}return Ne(n)?!1:e.equals(t,n.value)}}var fee=function(e){return function(t){return Ne(t)?!1:e(t.value)}},dee=fa(tn),pee=Ut(cf),Aee=Bt(Yp),hee=jt(lf),U2=fa(bn),Tv=function(e){return function(t){var n=e(0,Fr(t));if(Ne(n))return ot;for(var r=[n.value],i=1;i<t.length;i++){var o=e(i,t[i]);if(Ne(o))return ot;r.push(o.value)}return It(r)}},vI=function(e){var t=Tv(e);return function(n){return vt(n)?t(n):U2}},mee=vI,B2=function(e){return vI(function(t,n){return e(n)})},gee=B2(P);function vee(e){return function(t){return pm(e(t))}}var yee=k2,W2={URI:zt,map:kr,of:fa,ap:Vs,chain:vv,reduce:yv,foldMap:bv,reduceRight:Cv,traverse:iI,sequence:_v,zero:Sv,alt:oI,extend:m2,compact:ff,separate:df,filter:Pd,filterMap:aI,partition:uI,partitionMap:sI,wither:dI,wilt:pI,throwError:AI},bee=nn(lf),Cee=ei(b2),K2=function(){return cI(rS())},See=function(){return cI(Cg())};const _ee=Object.freeze(Object.defineProperty({__proto__:null,Alt:qX,Alternative:VX,ApT:U2,Applicative:b2,Apply:lf,Chain:Yp,Compactable:zs,Do:dee,Extend:zX,Filterable:da,Foldable:NX,FromEither:Iv,Functor:cf,Monad:DX,MonadThrow:ZX,Pointed:v2,Traversable:fI,URI:zt,Witherable:JX,Zero:x2,alt:T2,altW:I2,ap:y2,apFirst:tee,apS:hee,apSecond:nee,bind:Aee,bindTo:pee,chain:Hp,chainEitherK:uee,chainFirst:iee,chainFirstEitherK:see,chainNullableK:k2,compact:ff,duplicate:oee,elem:j2,exists:fee,extend:lI,filter:w2,filterMap:$2,flap:eee,flatten:ree,fold:_u,foldMap:S2,foldW:XX,fromEither:pf,fromEitherK:aee,fromNullable:Hs,fromNullableK:lee,fromPredicate:mv,getApplyMonoid:Cee,getApplySemigroup:bee,getEq:g2,getFirstMonoid:K2,getLastMonoid:See,getLeft:gv,getMonoid:cI,getOrElse:mI,getOrElseW:F2,getOrd:PX,getRefinement:vee,getRight:zp,getShow:KX,guard:QX,isNone:Ne,isSome:pm,map:mo,mapNullable:yee,match:pa,matchW:hI,none:ot,of:fa,option:W2,partition:E2,partitionMap:R2,reduce:C2,reduceRight:_2,separate:df,sequence:_v,sequenceArray:gee,some:It,throwError:AI,toNullable:gI,toUndefined:L2,traverse:O2,traverseArray:B2,traverseArrayWithIndex:mee,traverseReadonlyArrayWithIndex:vI,traverseReadonlyNonEmptyArrayWithIndex:Tv,tryCatch:M2,tryCatchK:cee,wilt:GX,wither:YX,zero:Sv},Symbol.toStringTag,{value:"Module"}));function go(e,t){return function(n){return e.map(n,t.compact)}}function Aa(e,t,n){var r=go(e,t),i=Nl(e,n);return function(o){return Re(r(b(o,i(gv))),r(b(o,i(zp))))}}function Iee(e,t){var n=ql(e,t).map;return{map:n,compact:go(e,t),separate:Aa(e,t,t)}}const Tee=Object.freeze(Object.defineProperty({__proto__:null,compact:go,getCompactableComposition:Iee,separate:Aa},Symbol.toStringTag,{value:"Module"}));var xee=function(e){return function(){return console.log(e)}},wee=function(e){return function(){return console.warn(e)}},$ee=function(e){return function(){return console.error(e)}},Eee=function(e){return function(){return console.info(e)}};const Ree=Object.freeze(Object.defineProperty({__proto__:null,error:$ee,info:Eee,log:xee,warn:wee},Symbol.toStringTag,{value:"Module"}));var Af=ml;function Oee(e){return{show:function(t){return"make(".concat(e.show(t),")")}}}var Fee=P,Mee=P,kee=P,Lee=P,jee=P,Uee=P,Bee=P,Wee=P,Kee=P;function P2(e){return{URI:Ys,_E:void 0,map:yI,ap:function(t,n){return Af(e.concat(t,n))}}}function D2(e){var t=P2(e);return{URI:Ys,_E:void 0,map:t.map,ap:t.ap,of:function(){return Af(e.empty)}}}var N2=function(e,t){return b(e,V2())},yI=function(e,t){return b(e,z2())},q2=function(e,t,n){return b(e,H2(t))},Q2=function(e,t){return b(e,Y2(t))},V2=function(){return ml},z2=function(){return ml},H2=function(e){return function(t){return Af(e(t))}},Y2=function(e){return function(t){return Af(e(t))}},Ys="Const",G2={URI:Ys,map:yI},Pee=qe(G2),Dee={URI:Ys,contramap:N2},Nee={URI:Ys,bimap:q2,mapLeft:Q2},qee={URI:Ys,map:yI,contramap:N2,bimap:q2,mapLeft:Q2};const Qee=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:Nee,Contravariant:Dee,Functor:G2,URI:Ys,bimap:H2,const_:qee,contramap:V2,flap:Pee,getApplicative:D2,getApply:P2,getBooleanAlgebra:Kee,getBounded:kee,getEq:Fee,getHeytingAlgebra:Wee,getMonoid:jee,getOrd:Mee,getRing:Bee,getSemigroup:Lee,getSemiring:Uee,getShow:Oee,make:Af,map:z2,mapLeft:Y2},Symbol.toStringTag,{value:"Module"})),Vee=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var zee={equals:function(e,t){return e.valueOf()===t.valueOf()}},Hee={equals:function(e,t){return e.getDate()===t.getDate()}},Yee={equals:function(e,t){return e.getMonth()===t.getMonth()}},Gee={equals:function(e,t){return e.getFullYear()===t.getFullYear()}},Jee=b(Qg,mg(function(e){return e.valueOf()})),Zee=function(){return new Date},Xee=function(){return new Date().getTime()};const ete=Object.freeze(Object.defineProperty({__proto__:null,Eq:zee,Ord:Jee,create:Zee,eqDate:Hee,eqMonth:Yee,eqYear:Gee,now:Xee},Symbol.toStringTag,{value:"Module"}));var wt=Zo,ze=hu,Ln=function(e,t){return b(e,Zs(t))},Gs=function(e,t){return b(e,eB(t))},hf=function(e,t){return b(e,ri(t))},Gp=function(e,t,n){return b(e,nB(t,n))},Jp=function(e){return function(t,n){var r=rB(e);return b(t,r(n))}},Zp=function(e,t,n){return b(e,iB(t,n))},xv=function(e){var t=oB(e);return function(n,r){return b(n,t(r))}},bI=function(e,t,n){return b(e,TI(t,n))},CI=function(e,t){return b(e,nA(t))},J2=function(e,t){return b(e,uB(t))},SI=function(e,t){return b(e,xI(t))},_I=function(e,t){return nI(t(e),function(n){return ie(n)?ze(wt(n.left)):ie(n.right)?wt(t(n.right.left)):ze(ze(n.right.right))})},$t="Either",tte=function(e,t){return{show:function(n){return ie(n)?"left(".concat(e.show(n.left),")"):"right(".concat(t.show(n.right),")")}}},nte=function(e,t){return{equals:function(n,r){return n===r||(ie(n)?ie(r)&&e.equals(n.left,r.left):wI(r)&&t.equals(n.right,r.right))}}},Xp=function(e){return{concat:function(t,n){return ie(n)?t:ie(t)?n:ze(e.concat(t.right,n.right))}}},Js=function(e){var t=wt(e.empty);return{URI:$t,_E:void 0,compact:function(n){return ie(n)?n:n.right._tag==="None"?t:ze(n.right.value)},separate:function(n){return ie(n)?Re(n,n):ie(n.right)?Re(ze(n.right.left),t):Re(t,ze(n.right.right))}}},mf=function(e){var t=wt(e.empty),n=Js(e),r=n.compact,i=n.separate,o=function(u,s){return ie(u)||s(u.right)?u:t},a=function(u,s){return ie(u)?Re(u,u):s(u.right)?Re(t,ze(u.right)):Re(ze(u.right),t)};return{URI:$t,_E:void 0,map:Ln,compact:r,separate:i,filter:o,filterMap:function(u,s){if(ie(u))return u;var c=s(u.right);return c._tag==="None"?t:ze(c.value)},partition:a,partitionMap:function(u,s){if(ie(u))return Re(u,u);var c=s(u.right);return ie(c)?Re(ze(c.left),t):Re(t,ze(c.right))}}},rte=function(e){var t=mf(e),n=Js(e);return{URI:$t,_E:void 0,map:Ln,compact:t.compact,separate:t.separate,filter:t.filter,filterMap:t.filterMap,partition:t.partition,partitionMap:t.partitionMap,traverse:xv,sequence:tA,reduce:Gp,foldMap:Jp,reduceRight:Zp,wither:ki(w1,n),wilt:Mi(w1,n)}},Iu=function(e){return{URI:$t,_E:void 0,map:Ln,ap:function(t,n){return ie(t)?ie(n)?wt(e.concat(t.left,n.left)):t:ie(n)?n:ze(t.right(n.right))},of:vo}},Z2=function(e){return{URI:$t,_E:void 0,map:Ln,alt:function(t,n){if(wI(t))return t;var r=n();return ie(r)?wt(e.concat(t.left,r.left)):r}}},Zs=function(e){return function(t){return ie(t)?t:ze(e(t.right))}},Tu={URI:$t,map:Ln},vo=ze,ite={URI:$t,of:vo},X2=function(e){return function(t){return ie(t)?t:ie(e)?e:ze(t.right(e.right))}},eB=X2,gf={URI:$t,map:Ln,ap:Gs},tB={URI:$t,map:Ln,ap:Gs,of:vo},II=function(e){return function(t){return ie(t)?t:e(t.right)}},ri=II,eA={URI:$t,map:Ln,ap:Gs,chain:hf},ote={URI:$t,map:Ln,ap:Gs,of:vo,chain:hf},nB=function(e,t){return function(n){return ie(n)?e:t(e,n.right)}},rB=function(e){return function(t){return function(n){return ie(n)?e.empty:t(n.right)}}},iB=function(e,t){return function(n){return ie(n)?e:t(n.right,e)}},ate={URI:$t,reduce:Gp,foldMap:Jp,reduceRight:Zp},oB=function(e){return function(t){return function(n){return ie(n)?e.of(wt(n.left)):e.map(t(n.right),ze)}}},tA=function(e){return function(t){return ie(t)?e.of(wt(t.left)):e.map(t.right,ze)}},w1={URI:$t,map:Ln,reduce:Gp,foldMap:Jp,reduceRight:Zp,traverse:xv,sequence:tA},TI=function(e,t){return function(n){return ie(n)?wt(e(n.left)):ze(t(n.right))}},nA=function(e){return function(t){return ie(t)?wt(e(t.left)):t}},ute={URI:$t,bimap:bI,mapLeft:CI},aB=function(e){return function(t){return ie(t)?e():t}},uB=aB,ste={URI:$t,map:Ln,alt:J2},xI=function(e){return function(t){return ie(t)?t:ze(e(t))}},cte={URI:$t,map:Ln,extend:SI},lte={URI:$t,map:Ln,ap:Gs,chain:hf,chainRec:_I},wv=wt,fte={URI:$t,map:Ln,ap:Gs,of:vo,chain:hf,throwError:wv},vf={URI:$t,fromEither:P},dte=mu(vf),sB=po(vf),ie=Xt,wI=HC,$I=function(e,t){return function(n){return ie(n)?e(n.left):t(n.right)}},cB=$I,xu=$I,EI=xu,lB=function(e){return function(t){return ie(t)?e(t.left):t.right}},pte=lB,Ate=qe(Tu),fB=kt(gf),hte=fB,dB=Lt(gf),mte=dB,pB=dt(eA),gte=pB,AB=II(P),vte=AB,yte=xI(P),bte=Ao(vf),Cte=Ks(vf,eA),hB=Ps(vf,eA),Ste=hB,mB=function(e){return ie(e)?ze(e.left):wt(e.right)},gB=function(e){return function(t){return ie(t)?e(t.left):t}},vB=gB,RI=function(e){return function(t){return t==null?wt(e):ze(t)}},Xs=function(e,t){try{return ze(e())}catch(n){return wt(t(n))}},_te=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return Xs(function(){return e.apply(void 0,n)},t)}},yB=function(e){var t=RI(e);return function(n){return z(n,t)}},Ite=function(e){var t=yB(e);return function(n){return ri(t(n))}},bB=cB(P,P);function Tte(e){return e instanceof Error?e:new Error(String(e))}function CB(e){return function(t,n){if(n===void 0){var r=CB(e);return function(i){return r(t,i)}}return ie(n)?!1:e.equals(t,n.right)}}var xte=function(e){return function(t){return ie(t)?!1:e(t.right)}},wte=vo(tn),$te=Ut(Tu),SB=Bt(eA),Ete=SB,_B=jt(gf),Rte=_B,IB=vo(bn),rA=function(e){return function(t){var n=e(0,Fr(t));if(ie(n))return n;for(var r=[n.right],i=1;i<t.length;i++){var o=e(i,t[i]);if(ie(o))return o;r.push(o.right)}return ze(r)}},OI=function(e){var t=rA(e);return function(n){return vt(n)?t(n):IB}},Ote=OI,TB=function(e){return OI(function(t,n){return e(n)})},Fte=TB(P);function Mte(e,t){return Xs(function(){return JSON.parse(e)},t)}var kte=function(e,t){return Xs(function(){var n=JSON.stringify(e);if(typeof n!="string")throw new Error("Converting unsupported structure to JSON");return n},t)},Lte={URI:$t,map:Ln,of:vo,ap:Gs,chain:hf,reduce:Gp,foldMap:Jp,reduceRight:Zp,traverse:xv,sequence:tA,bimap:bI,mapLeft:CI,alt:J2,extend:SI,chainRec:_I,throwError:wv},jte=nn(gf),Ute=ei(tB),Bte=function(e,t){return nn(Iu(e))(t)},Wte=function(e,t){return ei(Iu(e))(t)};function Kte(e){var t=Iu(e).ap,n=Z2(e).alt;return{URI:$t,_E:void 0,map:Ln,of:vo,chain:hf,bimap:bI,mapLeft:CI,reduce:Gp,foldMap:Jp,reduceRight:Zp,extend:SI,traverse:xv,sequence:tA,chainRec:_I,throwError:wv,ap:t,alt:n}}const xB=Object.freeze(Object.defineProperty({__proto__:null,Alt:ste,ApT:IB,Applicative:tB,Apply:gf,Bifunctor:ute,Chain:eA,ChainRec:lte,Do:wte,Extend:cte,Foldable:ate,FromEither:vf,Functor:Tu,Monad:ote,MonadThrow:fte,Pointed:ite,Traversable:w1,URI:$t,alt:uB,altW:aB,ap:eB,apFirst:fB,apFirstW:hte,apS:_B,apSW:Rte,apSecond:dB,apSecondW:mte,apW:X2,bimap:TI,bind:SB,bindTo:$te,bindW:Ete,chain:ri,chainFirst:pB,chainFirstW:gte,chainNullableK:Ite,chainOptionK:Cte,chainW:II,duplicate:yte,either:Lte,elem:CB,exists:xte,extend:xI,filterOrElse:hB,filterOrElseW:Ste,flap:Ate,flatten:vte,flattenW:AB,fold:EI,foldMap:rB,foldW:cB,fromNullable:RI,fromNullableK:yB,fromOption:sB,fromOptionK:bte,fromPredicate:dte,getAltValidation:Z2,getApplicativeValidation:Iu,getApplyMonoid:Ute,getApplySemigroup:jte,getCompactable:Js,getEq:nte,getFilterable:mf,getOrElse:pte,getOrElseW:lB,getSemigroup:Xp,getShow:tte,getValidation:Kte,getValidationMonoid:Wte,getValidationSemigroup:Bte,getWitherable:rte,isLeft:ie,isRight:wI,left:wt,map:Zs,mapLeft:nA,match:xu,matchW:$I,of:vo,orElse:vB,orElseW:gB,parseJSON:Mte,reduce:nB,reduceRight:iB,right:ze,sequence:tA,sequenceArray:Fte,stringifyJSON:kte,swap:mB,throwError:wv,toError:Tte,toUnion:bB,traverse:oB,traverseArray:TB,traverseArrayWithIndex:Ote,traverseReadonlyArrayWithIndex:OI,traverseReadonlyNonEmptyArrayWithIndex:rA,tryCatch:Xs,tryCatchK:_te},Symbol.toStringTag,{value:"Module"}));function ec(e){return z(ze,e.of)}function yf(e){return z(wt,e.of)}function bf(e){return function(t){return e.map(t,ze)}}function Cf(e){return function(t){return e.map(t,wt)}}function $v(e){return function(t){return z(RI(t),e.of)}}function Ev(e){var t=$v(e);return function(n){var r=t(n);return function(i){return z(i,r)}}}function FI(e){var t=tc(e),n=Ev(e);return function(r){var i=n(r);return function(o){return t(i(o))}}}function Sf(e){return Nl(e,Tu)}function _f(e){return ua(e,gf)}function tc(e){return function(t){return function(n){return e.chain(n,function(r){return ie(r)?e.of(r):t(r.right)})}}}function If(e){return function(t){return function(n){return e.chain(n,function(r){return ie(r)?t():e.of(r)})}}}function Tf(e){return function(t,n){return function(r){return e.map(r,TI(t,n))}}}function xf(e){return function(t){return function(n){return e.map(n,nA(t))}}}function iA(e,t){return function(n){return function(r){return e.chain(r,xu(function(i){return e.map(n(),nA(function(o){return t.concat(i,o)}))},ec(e)))}}}function oA(e){return function(t,n){return function(r){return e.map(r,xu(t,n))}}}function wf(e){return function(t,n){return function(r){return e.chain(r,xu(t,n))}}}function $f(e){return function(t){return function(n){return e.chain(n,xu(t,e.of))}}}function nc(e){return function(t){return function(n){return e.chain(n,function(r){return ie(r)?t(r.left):e.of(r)})}}}function aA(e){var t=nc(e);return function(n){return t(function(r){return e.map(n(r),function(i){return ie(i)?i:wt(r)})})}}function uA(e){return function(t){return function(n){return e.chain(n,xu(function(r){return e.map(t(r),wt)},function(r){return e.of(ze(r))}))}}}function Ef(e){return function(t){return e.map(t,mB)}}function sA(e){return function(t){return e.map(t,bB)}}function Pte(e){var t=_f(e),n=Sf(e),r=tc(e),i=If(e),o=Tf(e),a=xf(e),u=wf(e),s=$f(e),c=nc(e);return{map:function(l,f){return b(l,n(f))},ap:function(l,f){return b(l,t(f))},of:ec(e),chain:function(l,f){return b(l,r(f))},alt:function(l,f){return b(l,i(f))},bimap:function(l,f,p){return b(l,o(f,p))},mapLeft:function(l,f){return b(l,a(f))},fold:function(l,f,p){return b(l,u(f,p))},getOrElse:function(l,f){return b(l,s(f))},orElse:function(l,f){return b(l,c(f))},swap:Ef(e),rightM:bf(e),leftM:Cf(e),left:yf(e)}}const Dte=Object.freeze(Object.defineProperty({__proto__:null,alt:If,altValidation:iA,ap:_f,bimap:Tf,chain:tc,chainNullableK:FI,fromNullable:$v,fromNullableK:Ev,getEitherM:Pte,getOrElse:$f,left:yf,leftF:Cf,map:Sf,mapLeft:xf,match:oA,matchE:wf,orElse:nc,orElseFirst:aA,orLeft:uA,right:ec,rightF:bf,swap:Ef,toUnion:sA},Symbol.toStringTag,{value:"Module"}));var Nte="Endomorphism",wB=function(){return{concat:function(e,t){return z(e,t)}}},$B=function(){return{concat:wB().concat,empty:P}};const qte=Object.freeze(Object.defineProperty({__proto__:null,URI:Nte,getMonoid:$B,getSemigroup:wB},Symbol.toStringTag,{value:"Module"})),Qte=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function EB(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 Vte(e,t){var n=t.zero,r=EB(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 zte={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 Hte=Object.freeze(Object.defineProperty({__proto__:null,fieldNumber:zte,gcd:EB,lcm:Vte},Symbol.toStringTag,{value:"Module"}));function ha(e,t){return function(n){return function(r){return e.map(r,function(i){return t.filter(i,n)})}}}function ma(e,t){return function(n){return function(r){return e.map(r,function(i){return t.filterMap(i,n)})}}}function wu(e,t){var n=ha(e,t);return function(r){var i=n(Kd(r)),o=n(r);return function(a){return Re(i(a),o(a))}}}function $u(e,t){var n=ma(e,t);return function(r){return function(i){return Re(b(i,n(function(o){return gv(r(o))})),b(i,n(function(o){return zp(r(o))})))}}}function Yte(e,t){var n=ql(e,t).map,r=go(e,t),i=Aa(e,t,t),o=ha(e,t),a=ma(e,t),u=wu(e,t),s=$u(e,t);return{map:n,compact:r,separate:i,filter:function(c,l){return b(c,o(l))},filterMap:function(c,l){return b(c,a(l))},partition:function(c,l){return b(c,u(l))},partitionMap:function(c,l){return b(c,s(l))}}}const Gte=Object.freeze(Object.defineProperty({__proto__:null,filter:ha,filterMap:ma,getFilterableComposition:Yte,partition:wu,partitionMap:$u},Symbol.toStringTag,{value:"Module"})),Jte=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function RB(e,t){return function(n,r){return function(i){return e.reduce(i,n,function(o,a){return t.reduce(a,o,r)})}}}function OB(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 FB(e,t){return function(n,r){return function(i){return e.reduceRight(i,n,function(o,a){return t.reduceRight(o,a,r)})}}}function Zte(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 Xte(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 MB(e){return function(t){return e.reduce(t,[],function(n,r){return n.push(r),n})}}function ene(e,t){var n=function(i,o){return e.ap(e.map(i,lr),o)},r=e.of(void 0);return function(i,o){return t.reduce(i,r,function(a,u){return n(a,o(u))})}}function tne(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 nne=MB;function MI(e,t){var n=RB(e,t),r=OB(e,t),i=FB(e,t);return{reduce:function(o,a,u){return b(o,n(a,u))},foldMap:function(o){var a=r(o);return function(u,s){return b(u,a(s))}},reduceRight:function(o,a,u){return b(o,i(a,u))}}}const rne=Object.freeze(Object.defineProperty({__proto__:null,foldM:tne,foldMap:OB,getFoldableComposition:MI,intercalate:Xte,reduce:RB,reduceM:Zte,reduceRight:FB,toArray:nne,toReadonlyArray:MB,traverse_:ene},Symbol.toStringTag,{value:"Module"}));function kB(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 LB(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 jB(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 ine(e,t){var n=MI(e,t),r=kB(e,t),i=LB(e,t),o=jB(e,t);return{reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,reduceWithIndex:function(a,u,s){return b(a,r(u,s))},foldMapWithIndex:function(a){var u=i(a);return function(s,c){return b(s,u(c))}},reduceRightWithIndex:function(a,u,s){return b(a,o(u,s))}}}const one=Object.freeze(Object.defineProperty({__proto__:null,foldMapWithIndex:LB,getFoldableWithIndexComposition:ine,reduceRightWithIndex:jB,reduceWithIndex:kB},Symbol.toStringTag,{value:"Module"}));function yo(e){return function(t){return z(t,e.fromIO)}}function ga(e,t){return function(n){var r=z(n,e.fromIO);return function(i){return t.chain(i,r)}}}function va(e,t){var n=dt(t);return function(r){return n(z(r,e.fromIO))}}const ane=Object.freeze(Object.defineProperty({__proto__:null,chainFirstIOK:va,chainIOK:ga,fromIOK:yo},Symbol.toStringTag,{value:"Module"}));var UB=function(){return P},une=P,cA=function(e){return function(t){return function(n){return t(e(n))}}},lA=function(e){return function(t){return e(t)(t)}},sne=lA,ya=function(e,t){return b(e,rc(t))},fA=function(e,t){return b(e,KB(t))},kI=function(e,t){return b(e,PB(t))},BB=function(e,t){return b(e,NB(t))},Rv=function(e,t,n){return b(e,qB(t,n))},rc=function(e){return function(t){return function(n){return e(t(n))}}},WB=function(e){return function(t){return function(n){return t(n)(e(n))}}},KB=WB,bo=lr,LI=function(e){return function(t){return function(n){return e(t(n))(n)}}},PB=LI,DB=LI(P),cne=DB,NB=function(e){return function(t){return z(e,t)}},qB=function(e,t){return function(n){return function(r){return t(n(e(r)))}}},jI=function(){return P},UI=function(e){return function(t){var n=t[0],r=t[1];return[e(n),r]}},BI=function(e){return function(t){var n=t[0],r=t[1];return[n,e(r)]}},WI=function(e){return EI(function(t){return Zo(e(t))},ze)},KI=function(e){return EI(wt,function(t){return hu(e(t))})},ii="Reader",hn={URI:ii,map:ya},lne=qe(hn),PI={URI:ii,of:bo},ba={URI:ii,map:ya,ap:fA},QB=kt(ba),fne=QB,VB=Lt(ba),dne=VB,zB={URI:ii,map:ya,ap:fA,of:bo},DI={URI:ii,map:ya,ap:fA,chain:kI},Ca={URI:ii,map:ya,of:bo,ap:fA,chain:kI},HB=dt(DI),pne=HB,Ane={URI:ii,map:ya,promap:Rv},hne={URI:ii,compose:BB,id:jI},mne={URI:ii,map:ya,promap:Rv,first:UI,second:BI},gne={URI:ii,map:ya,promap:Rv,left:WI,right:KI},vne=Ut(hn),YB=Bt(DI),yne=YB,bne=bo(tn),GB=jt(ba),Cne=GB,JB=bo(bn),ic=function(e){return function(t){return function(n){for(var r=[e(0,Fr(t))(n)],i=1;i<t.length;i++)r.push(e(i,t[i])(n));return r}}},NI=function(e){var t=ic(e);return function(n){return vt(n)?t(n):JB}},Sne=NI,ZB=function(e){return NI(function(t,n){return e(n)})},_ne=ZB(P),Ine={URI:ii,map:ya,of:bo,ap:fA,chain:kI,promap:Rv,compose:BB,id:jI,first:UI,second:BI,left:WI,right:KI},Tne=nn(ba),xne=ei(zB);const wne=Object.freeze(Object.defineProperty({__proto__:null,ApT:JB,Applicative:zB,Apply:ba,Category:hne,Chain:DI,Choice:gne,Do:bne,Functor:hn,Monad:Ca,Pointed:PI,Profunctor:Ane,Strong:mne,URI:ii,ap:KB,apFirst:QB,apFirstW:fne,apS:GB,apSW:Cne,apSecond:VB,apSecondW:dne,apW:WB,ask:UB,asks:une,asksReader:sne,asksReaderW:lA,bind:YB,bindTo:vne,bindW:yne,chain:PB,chainFirst:HB,chainFirstW:pne,chainW:LI,compose:NB,first:UI,flap:lne,flatten:cne,flattenW:DB,getMonoid:xne,getSemigroup:Tne,id:jI,left:WI,local:cA,map:rc,of:bo,promap:qB,reader:Ine,right:KI,second:BI,sequenceArray:_ne,traverseArray:ZB,traverseArrayWithIndex:Sne,traverseReadonlyArrayWithIndex:NI,traverseReadonlyNonEmptyArrayWithIndex:ic},Symbol.toStringTag,{value:"Module"}));function dA(e){return function(){return e.fromReader(UB())}}function pA(e){return e.fromReader}function oc(e){return function(t){return z(t,e.fromReader)}}function AA(e,t){var n=oc(e);return function(r){return function(i){return t.chain(i,n(r))}}}function hA(e,t){return z(oc(e),dt(t))}const $ne=Object.freeze(Object.defineProperty({__proto__:null,ask:dA,asks:pA,chainFirstReaderK:hA,chainReaderK:AA,fromReaderK:oc},Symbol.toStringTag,{value:"Module"}));var XB=function(){return function(e){return[e,e]}},eW=function(e){return function(){return[void 0,e]}},tW=function(e){return function(t){return[void 0,e(t)]}},nW=function(e){return function(t){return[e(t),t]}},mA=function(e,t){return b(e,iW(t))},Ov=function(e,t){return b(e,oW(t))},rW=function(e,t){return b(e,qI(t))},iW=function(e){return function(t){return function(n){var r=t(n),i=r[0],o=r[1];return[e(i),o]}}},oW=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]}}},gA=function(e){return function(t){return[e,t]}},qI=function(e){return function(t){return function(n){var r=t(n),i=r[0],o=r[1];return e(i)(o)}}},Ene=qI(P),Eu="State",QI={URI:Eu,map:mA},Rne=qe(QI),One={URI:Eu,of:gA},Fv={URI:Eu,map:mA,ap:Ov},Fne=kt(Fv),Mne=Lt(Fv),kne={URI:Eu,map:mA,ap:Ov,of:gA},VI={URI:Eu,map:mA,ap:Ov,chain:rW},aW={URI:Eu,map:mA,ap:Ov,of:gA,chain:rW},Lne=dt(VI),jne={URI:Eu,fromState:P},Une=function(e){return function(t){return t(e)[0]}},Bne=function(e){return function(t){return t(e)[1]}},Wne=Ut(QI),Kne=Bt(VI),Pne=jt(Fv),uW=function(e){return function(t){return function(n){for(var r=e(0,Fr(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]}}},zI=function(e){var t=uW(e);return function(n){return vt(n)?t(n):gA(bn)}},Dne=zI,sW=function(e){return zI(function(t,n){return e(n)})},Nne=sW(P),qne=function(e,t){return e(t)[0]},Qne=function(e,t){return e(t)[1]},Vne=aW;const zne=Object.freeze(Object.defineProperty({__proto__:null,Applicative:kne,Apply:Fv,Chain:VI,FromState:jne,Functor:QI,Monad:aW,Pointed:One,URI:Eu,ap:oW,apFirst:Fne,apS:Pne,apSecond:Mne,bind:Kne,bindTo:Wne,chain:qI,chainFirst:Lne,evalState:qne,evaluate:Une,execState:Qne,execute:Bne,flap:Rne,flatten:Ene,get:XB,gets:nW,map:iW,modify:tW,of:gA,put:eW,sequenceArray:Nne,state:Vne,traverseArray:sW,traverseArrayWithIndex:Dne,traverseReadonlyArrayWithIndex:zI,traverseReadonlyNonEmptyArrayWithIndex:uW},Symbol.toStringTag,{value:"Module"}));function cW(e){return function(){return e.fromState(XB())}}function lW(e){return function(t){return e.fromState(eW(t))}}function fW(e){return z(tW,e.fromState)}function dW(e){return z(nW,e.fromState)}function HI(e){return function(t){return z(t,e.fromState)}}function pW(e,t){var n=HI(e);return function(r){return function(i){return t.chain(i,n(r))}}}const Hne=Object.freeze(Object.defineProperty({__proto__:null,chainStateK:pW,fromStateK:HI,get:cW,gets:dW,modify:fW,put:lW},Symbol.toStringTag,{value:"Module"}));function ac(e){return function(t){return z(t,e.fromTask)}}function Rf(e,t){return function(n){var r=z(n,e.fromTask);return function(i){return t.chain(i,r)}}}function Of(e,t){var n=dt(t);return function(r){return n(z(r,e.fromTask))}}const Yne=Object.freeze(Object.defineProperty({__proto__:null,chainFirstTaskK:Of,chainTaskK:Rf,fromTaskK:ac},Symbol.toStringTag,{value:"Module"}));function AW(e){return function(t){return z(t,e.fromThese)}}const Gne=Object.freeze(Object.defineProperty({__proto__:null,fromTheseK:AW},Symbol.toStringTag,{value:"Module"}));function hW(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 Jne(e,t){var n=ql(e,t).map,r=hW(e,t);return{map:n,mapWithIndex:function(i,o){return b(i,r(o))}}}const Zne=Object.freeze(Object.defineProperty({__proto__:null,getFunctorWithIndexComposition:Jne,mapWithIndex:hW},Symbol.toStringTag,{value:"Module"})),Xne=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),ere=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),tre=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Co=function(e,t){return b(e,bW(t))},Ff=function(e,t){return b(e,CW(t))},Mv=function(e,t){return b(e,ZI(t))},YI=function(e,t,n){return b(e,SW(t,n))},GI=function(e){return function(t,n){return b(t,_W()(n))}},JI=function(e,t,n){return b(e,IW(t,n))},mW=function(e,t){return b(e,wW())},gW=function(e,t){return b(e,XI(t))},vW=function(e){var t=TW(e);return function(n,r){return b(n,t(r))}},yW=nI,bW=function(e){return function(t){return e(t)}},CW=function(e){return function(t){return t(e)}},Mf=P,ZI=function(e){return function(t){return e(t)}},XI=function(e){return function(t){return e(t)}},eT=P,nre=XI(P),rre=ZI(P),SW=function(e,t){return function(n){return t(e,n)}},_W=function(){return function(e){return function(t){return e(t)}}},IW=function(e,t){return function(n){return t(n,e)}},TW=function(e){return function(t){return function(n){return e.map(t(n),P)}}},tT=function(e){return function(t){return e.map(t,P)}},xW=function(){return P},wW=xW,Lr="Identity",ire=P,ore=P,nT={URI:Lr,map:Co},are=qe(nT),ure={URI:Lr,of:Mf},kv={URI:Lr,map:Co,ap:Ff},sre=kt(kv),cre=Lt(kv),lre={URI:Lr,map:Co,ap:Ff,of:Mf},rT={URI:Lr,map:Co,ap:Ff,chain:Mv},fre={URI:Lr,map:Co,ap:Ff,of:Mf,chain:Mv},dre=dt(rT),pre={URI:Lr,reduce:YI,foldMap:GI,reduceRight:JI},Are={URI:Lr,map:Co,reduce:YI,foldMap:GI,reduceRight:JI,traverse:vW,sequence:tT},hre={URI:Lr,map:Co,alt:mW},mre={URI:Lr,map:Co,extend:gW,extract:eT},gre={URI:Lr,map:Co,ap:Ff,chain:Mv,chainRec:yW},vre=Mf(tn),yre=Ut(nT),bre=Bt(rT),Cre=jt(kv),Sre={URI:Lr,map:Co,ap:Ff,of:Mf,chain:Mv,reduce:YI,foldMap:GI,reduceRight:JI,traverse:vW,sequence:tT,alt:mW,extract:eT,extend:gW,chainRec:yW};const _re=Object.freeze(Object.defineProperty({__proto__:null,Alt:hre,Applicative:lre,Apply:kv,Chain:rT,ChainRec:gre,Comonad:mre,Do:vre,Foldable:pre,Functor:nT,Monad:fre,Pointed:ure,Traversable:Are,URI:Lr,alt:wW,altW:xW,ap:CW,apFirst:sre,apS:Cre,apSecond:cre,bind:bre,bindTo:yre,chain:ZI,chainFirst:dre,duplicate:nre,extend:XI,extract:eT,flap:are,flatten:rre,foldMap:_W,getEq:ore,getShow:ire,identity:Sre,map:bW,of:Mf,reduce:SW,reduceRight:IW,sequence:tT,traverse:TW},Symbol.toStringTag,{value:"Module"})),Ire=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Sa=function(e,t){return function(){return t(e())}},Ru=function(e,t){return function(){return e()(t())}},kf=function(e,t){return function(){return t(e())()}},$W=function(e,t){return function(){for(var n=t(e)();n._tag==="Left";)n=t(n.left)();return n.right}},So=function(e){return function(t){return Sa(t,e)}},Tre=function(e){return function(t){return Ru(t,e)}},Li=lr,iT=function(e){return function(t){return kf(t,e)}},xre=iT(P),ji="IO",ut={URI:ji,map:Sa},wre=qe(ut),_o={URI:ji,of:Li},_a={URI:ji,map:Sa,ap:Ru},$re=kt(_a),Ere=Lt(_a),EW={URI:ji,map:Sa,ap:Ru,of:Li},Lv={URI:ji,map:Sa,ap:Ru,chain:kf},dr={URI:ji,map:Sa,ap:Ru,of:Li,chain:kf},Rre=dt(Lv),oT=P,Ore={URI:ji,map:Sa,ap:Ru,of:Li,chain:kf,fromIO:oT},Fre={URI:ji,map:Sa,ap:Ru,chain:kf,chainRec:$W},Mre={URI:ji,fromIO:P},kre=Li(tn),Lre=Ut(ut),jre=Bt(Lv),Ure=jt(_a),RW=Li(bn),jv=function(e){return function(t){return function(){for(var n=[e(0,Fr(t))()],r=1;r<t.length;r++)n.push(e(r,t[r])());return n}}},aT=function(e){var t=jv(e);return function(n){return vt(n)?t(n):RW}},Bre=aT,OW=function(e){return aT(function(t,n){return e(n)})},Wre=OW(P),Kre={URI:ji,map:Sa,of:Li,ap:Ru,chain:kf,fromIO:oT,chainRec:$W},Pre=nn(_a),Dre=ei(EW);const Nre=Object.freeze(Object.defineProperty({__proto__:null,ApT:RW,Applicative:EW,Apply:_a,Chain:Lv,ChainRec:Fre,Do:kre,FromIO:Mre,Functor:ut,Monad:dr,MonadIO:Ore,Pointed:_o,URI:ji,ap:Tre,apFirst:$re,apS:Ure,apSecond:Ere,bind:jre,bindTo:Lre,chain:iT,chainFirst:Rre,flap:wre,flatten:xre,fromIO:oT,getMonoid:Dre,getSemigroup:Pre,io:Kre,map:So,of:Li,sequenceArray:Wre,traverseArray:OW,traverseArrayWithIndex:Bre,traverseReadonlyArrayWithIndex:aT,traverseReadonlyNonEmptyArrayWithIndex:jv},Symbol.toStringTag,{value:"Module"}));var FW=yf(_o),MW=ec(_o),kW=bf(ut),qre=Cf(ut),LW=Li,vA=kW,jW=oA(ut),Qre=jW,uT=wf(dr),Vre=uT,UW=uT,zre=UW,BW=$f(dr),Hre=BW,WW=function(e,t){return function(){return Xs(e,t)}},Yre=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return WW(function(){return e.apply(void 0,n)},t)}},Gre=sA(ut),KW=nc(dr),Jre=KW,sT=aA(dr),Zre=sT,Xre=function(e){return sT(JW(e))},eie=uA(dr),tie=Ef(ut),pr=function(e,t){return b(e,fT(t))},uc=function(e,t){return b(e,dT(t))},nie=function(e,t){return b(e,Uv(function(n){return b(t,fT(n))}))},Lf=function(e,t){return b(e,Uv(t))},cT=function(e,t,n){return b(e,DW(t,n))},lT=function(e,t){return b(e,NW(t))},PW=function(e,t){return b(e,pT(t))},fT=Sf(ut),DW=Tf(ut),NW=xf(ut),dT=_f(_a),rie=dT,oi=MW,Uv=tc(dr),Am=Uv,qW=Am(P),iie=qW,pT=If(dr),oie=pT,Bv=FW,Qt="IOEither";function QW(e){var t=ua(_a,Iu(e));return{URI:Qt,_E:void 0,map:pr,ap:function(n,r){return b(n,t(r))},of:oi}}function VW(e){var t=iA(dr,e);return{URI:Qt,_E:void 0,map:pr,alt:function(n,r){return b(n,t(r))}}}var zW=function(e){var t=Js(e);return{URI:Qt,_E:void 0,compact:go(ut,t),separate:Aa(ut,t,Tu)}};function aie(e){var t=mf(e),n=zW(e),r=ha(ut,t),i=ma(ut,t),o=wu(ut,t),a=$u(ut,t);return{URI:Qt,_E:void 0,map:pr,compact:n.compact,separate:n.separate,filter:function(u,s){return b(u,r(s))},filterMap:function(u,s){return b(u,i(s))},partition:function(u,s){return b(u,o(s))},partitionMap:function(u,s){return b(u,a(s))}}}var AT={URI:Qt,map:pr},uie=qe(AT),sie={URI:Qt,of:oi},cie={URI:Qt,bimap:cT,mapLeft:lT},yA={URI:Qt,map:pr,ap:uc},HW=kt(yA),lie=HW,YW=Lt(yA),fie=YW,hT={URI:Qt,map:pr,ap:uc,of:oi},die={URI:Qt,map:pr,ap:nie,of:oi},Ia={URI:Qt,map:pr,ap:uc,chain:Lf},pie={URI:Qt,map:pr,ap:uc,of:oi,chain:Lf},GW=dt(Ia),Aie=GW,hie={URI:Qt,map:pr,alt:PW},mie={URI:Qt,map:pr,ap:uc,of:oi,chain:Lf,fromIO:vA},gie={URI:Qt,map:pr,ap:uc,of:oi,chain:Lf,throwError:Bv},Wv={URI:Qt,fromIO:vA},JW=yo(Wv),vie=ga(Wv,Ia),yie=va(Wv,Ia),Ta={URI:Qt,fromEither:LW},bie=po(Ta),Cie=Ao(Ta),Sie=Ks(Ta,Ia),ZW=sa(Ta,Ia),_ie=ZW,XW=ca(Ta,Ia),Iie=XW,Tie=mu(Ta),eK=Ps(Ta,Ia),xie=eK,wie=Mr(Ta),$ie=function(e,t,n){return tK(e,t,n)},tK=function(e,t,n){return b(e,Am(function(r){return b(t(r),iT(function(i){return b(n(r,i),Am(function(){return Li(i)}))}))}))},Eie=oi(tn),Rie=Ut(AT),nK=Bt(Ia),Oie=nK,rK=jt(yA),Fie=rK,mT=oi(bn),iK=function(e){return z(jv(e),So(rA(fr)))},gT=function(e){var t=iK(e);return function(n){return vt(n)?t(n):mT}},oK=function(e){return function(t){return function(){var n=e(0,Fr(t))();if(Xt(n))return n;for(var r=[n.right],i=1;i<t.length;i++){var o=e(i,t[i])();if(Xt(o))return o;r.push(o.right)}return hu(r)}}},vT=function(e){var t=oK(e);return function(n){return vt(n)?t(n):mT}},Mie=gT,aK=function(e){return gT(function(t,n){return e(n)})},kie=aK(P),Lie=vT,uK=function(e){return vT(function(t,n){return e(n)})},jie=uK(P),Uie=hT,Bie={URI:Qt,bimap:cT,mapLeft:lT,map:pr,of:oi,ap:uc,chain:Lf,alt:PW,fromIO:vA,throwError:Bv},Wie=nn(yA),Kie=ei(hT),Pie=function(e){return nn(_a)(Xp(e))};function Die(e){var t=QW(e),n=VW(e);return{URI:Qt,_E:void 0,map:pr,ap:t.ap,of:oi,chain:Lf,bimap:cT,mapLeft:lT,alt:n.alt,fromIO:vA,throwError:Bv}}const Nie=Object.freeze(Object.defineProperty({__proto__:null,Alt:hie,ApT:mT,Applicative:Uie,ApplicativePar:hT,ApplicativeSeq:die,ApplyPar:yA,Bifunctor:cie,Chain:Ia,Do:Eie,FromEither:Ta,FromIO:Wv,Functor:AT,Monad:pie,MonadIO:mie,MonadThrow:gie,Pointed:sie,URI:Qt,alt:pT,altW:oie,ap:dT,apFirst:HW,apFirstW:lie,apS:rK,apSW:Fie,apSecond:YW,apSecondW:fie,apW:rie,bimap:DW,bind:nK,bindTo:Rie,bindW:Oie,bracket:$ie,bracketW:tK,chain:Uv,chainEitherK:ZW,chainEitherKW:_ie,chainFirst:GW,chainFirstEitherK:XW,chainFirstEitherKW:Iie,chainFirstIOK:yie,chainFirstW:Aie,chainIOK:vie,chainOptionK:Sie,chainW:Am,filterOrElse:eK,filterOrElseW:xie,flap:uie,flatten:iie,flattenW:qW,fold:Vre,foldW:zre,fromEither:LW,fromEitherK:wie,fromIO:vA,fromIOK:JW,fromOption:bie,fromOptionK:Cie,fromPredicate:Tie,getAltIOValidation:VW,getApplicativeIOValidation:QW,getApplyMonoid:Kie,getApplySemigroup:Wie,getCompactable:zW,getFilterable:aie,getIOValidation:Die,getOrElse:BW,getOrElseW:Hre,getSemigroup:Pie,ioEither:Bie,left:FW,leftIO:qre,map:fT,mapLeft:NW,match:jW,matchE:uT,matchEW:UW,matchW:Qre,of:oi,orElse:KW,orElseFirst:sT,orElseFirstIOK:Xre,orElseFirstW:Zre,orElseW:Jre,orLeft:eie,right:MW,rightIO:kW,sequenceArray:kie,sequenceSeqArray:jie,swap:tie,throwError:Bv,toUnion:Gre,traverseArray:aK,traverseArrayWithIndex:Mie,traverseReadonlyArrayWithIndex:gT,traverseReadonlyArrayWithIndexSeq:vT,traverseReadonlyNonEmptyArrayWithIndex:iK,traverseReadonlyNonEmptyArrayWithIndexSeq:oK,traverseSeqArray:uK,traverseSeqArrayWithIndex:Lie,tryCatch:WW,tryCatchK:Yre},Symbol.toStringTag,{value:"Module"}));function bA(e){return z(It,e.of)}function CA(e){return lr(e.of(ot))}function Kv(e){return function(t){return e.map(t,It)}}function Pv(e){return z(Hs,e.of)}function Dv(e){var t=Pv(e);return function(n){return z(n,t)}}function yT(e){var t=jf(e),n=Dv(e);return function(r){return t(n(r))}}function Nv(e){return function(t){return z(t,e.of)}}function bT(e){var t=jf(e),n=Nv(e);return function(r){return t(n(r))}}function CT(e){return function(t){return function(n){return e.of(mv(t)(n))}}}function ST(e){return z(pf,e.of)}function _T(e){return function(t,n){return function(r){return e.map(r,pa(t,n))}}}function qv(e){return function(t,n){return function(r){return e.chain(r,pa(t,n))}}}function Qv(e){return function(t){return function(n){return e.chain(n,pa(t,e.of))}}}function Vv(e){return Nl(e,cf)}function zv(e){return ua(e,lf)}function jf(e){var t=CA(e);return function(n){return function(r){return e.chain(r,pa(function(){return t()},n))}}}function Hv(e){var t=bA(e);return function(n){return function(r){return e.chain(r,pa(n,t))}}}function qie(e){var t=zv(e),n=Vv(e),r=jf(e),i=Hv(e),o=qv(e),a=Qv(e),u=CA(e);return{map:function(s,c){return b(s,n(c))},ap:function(s,c){return b(s,t(c))},of:bA(e),chain:function(s,c){return b(s,r(c))},alt:function(s,c){return b(s,i(c))},fold:function(s,c,l){return b(s,o(c,l))},getOrElse:function(s,c){return b(s,a(c))},fromM:Kv(e),none:function(){return u()}}}const Qie=Object.freeze(Object.defineProperty({__proto__:null,alt:Hv,ap:zv,chain:jf,chainNullableK:yT,chainOptionK:bT,fromEither:ST,fromF:Kv,fromNullable:Pv,fromNullableK:Dv,fromOptionK:Nv,fromPredicate:CT,getOptionM:qie,getOrElse:Qv,map:Vv,match:_T,matchE:qv,some:bA,zero:CA},Symbol.toStringTag,{value:"Module"}));var sK=bA(_o),Vie=CT(_o),zie=Li,cK=ST(_o),IT=Kv(ut),Hie=So(pf),lK=_T(ut),Yie=lK,TT=qv(Lv),Gie=TT,Jie=TT,fK=Qv(dr),Zie=fK,Xie=So(L2),eoe=So(gI),toe=Pv(_o),noe=Dv(_o),roe=yT(dr),ioe=Nv(_o),ooe=bT(dr),dK=Vv(ut),pK=zv(_a),Ou=sK,xT=jf(dr),aoe=xT(P),wT=Hv(dr),uoe=wT,Yv=CA(_o),soe=Yv(),$T=go(ut,zs),ET=Aa(ut,zs,cf),AK=ha(ut,da),hK=ma(ut,da),mK=wu(ut,da),gK=$u(ut,da),xa=function(e,t){return b(e,dK(t))},Uf=function(e,t){return b(e,pK(t))},RT=function(e,t){return b(e,xT(t))},vK=function(e,t){return b(e,wT(t))},coe=function(e,t){return b(e,AK(t))},loe=function(e,t){return b(e,hK(t))},foe=function(e,t){return b(e,mK(t))},doe=function(e,t){return b(e,gK(t))},Ar="IOOption",OT={URI:Ar,map:xa},poe=qe(OT),yK={URI:Ar,of:Ou},Gv={URI:Ar,map:xa,ap:Uf},Aoe=kt(Gv),hoe=Lt(Gv),moe={URI:Ar,map:xa,ap:Uf,of:Ou},sc={URI:Ar,map:xa,ap:Uf,chain:RT},goe=dt(sc),voe={URI:Ar,map:xa,alt:vK},bK={URI:Ar,zero:Yv},yoe=Gl(bK,yK),boe={URI:Ar,map:xa,ap:Uf,of:Ou,alt:vK,zero:Yv},Coe={URI:Ar,map:xa,ap:Uf,of:Ou,chain:RT},Soe={URI:Ar,map:xa,ap:Uf,of:Ou,chain:RT,fromIO:IT},_oe={URI:Ar,compact:$T,separate:ET},Ioe={URI:Ar,map:xa,compact:$T,separate:ET,filter:coe,filterMap:loe,partition:foe,partitionMap:doe},Jv={URI:Ar,fromIO:IT},Toe=yo(Jv),xoe=ga(Jv,sc),woe=va(Jv,sc),Zv={URI:Ar,fromEither:cK},$oe=Mr(Zv),Eoe=sa(Zv,sc),Roe=ca(Zv,sc),Ooe=Ou(tn),Foe=Ut(OT),Moe=Bt(sc),koe=jt(Gv),CK=Ou(bn),SK=function(e){return z(jv(e),So(Tv(fr)))},Loe=function(e){var t=SK(e);return function(n){return vt(n)?t(n):CK}};const joe=Object.freeze(Object.defineProperty({__proto__:null,Alt:voe,Alternative:boe,ApT:CK,Applicative:moe,Apply:Gv,Chain:sc,Compactable:_oe,Do:Ooe,Filterable:Ioe,FromEither:Zv,FromIO:Jv,Functor:OT,Monad:Coe,MonadIO:Soe,Pointed:yK,Zero:bK,alt:wT,altW:uoe,ap:pK,apFirst:Aoe,apS:koe,apSecond:hoe,bind:Moe,bindTo:Foe,chain:xT,chainEitherK:Eoe,chainFirst:goe,chainFirstEitherK:Roe,chainFirstIOK:woe,chainIOK:xoe,chainNullableK:roe,chainOptionK:ooe,compact:$T,filter:AK,filterMap:hK,flap:poe,flatten:aoe,fold:Gie,fromEither:cK,fromEitherK:$oe,fromIO:IT,fromIOEither:Hie,fromIOK:Toe,fromNullable:toe,fromNullableK:noe,fromOption:zie,fromOptionK:ioe,fromPredicate:Vie,getOrElse:fK,getOrElseW:Zie,guard:yoe,map:dK,match:lK,matchE:TT,matchEW:Jie,matchW:Yie,none:soe,of:Ou,partition:mK,partitionMap:gK,separate:ET,some:sK,toNullable:eoe,toUndefined:Xie,traverseReadonlyArrayWithIndex:Loe,traverseReadonlyNonEmptyArrayWithIndex:SK,zero:Yv},Symbol.toStringTag,{value:"Module"}));var _K=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 Uoe(e){return function(){return new _K(e)}}const Boe=Object.freeze(Object.defineProperty({__proto__:null,IORef:_K,newIORef:Uoe},Symbol.toStringTag,{value:"Module"})),Woe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Koe=function(e){return Xs(function(){return JSON.parse(e)},P)},Poe=function(e){return Xs(function(){var t=JSON.stringify(e);if(typeof t!="string")throw new Error("Converting unsupported structure to JSON");return t},P)};const Doe=Object.freeze(Object.defineProperty({__proto__:null,parse:Koe,stringify:Poe},Symbol.toStringTag,{value:"Module"})),Noe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var qoe=function(e){return new Map(e)};function Qoe(e){return new Map(e)}function IK(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 TK=function(e){return e.size},ao=function(e){return e.size===0};function Xv(e){var t=cc(e);return function(n,r){if(r===void 0){var i=Xv(e);return function(o){return i(n,o)}}return _t(t(n,r))}}function FT(e){return function(t,n){if(n===void 0){var r=FT(e);return function(u){return r(t,u)}}for(var i=n.values(),o;!(o=i.next()).done;){var a=o.value;if(e.equals(t,a))return!0}return!1}}var Bf=function(e){return function(t){return Array.from(t.keys()).sort(e.compare)}},Voe=function(e){return function(t){return Array.from(t.values()).sort(e.compare)}};function xK(e){var t=Bf(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 wK=function(e){return xK(e)(function(t,n){return[t,n]})};function zoe(e,t){var n=wK(e);return function(r){var i=n(r),o=i.length;return t.unfold(0,function(a){return a<o?fe([i[a],a+1]):ye})}}var $K=function(e){var t=wa(e);return function(n,r){var i=t(n);return function(o){var a=i(o);if(Nt(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}}},EK=function(e){var t=wa(e);return function(n){return function(r){var i=t(n,r);if(_t(i)){var o=new Map(r);return o.delete(i.value[0]),o}return r}}},Hoe=function(e){var t=RK(e);return function(n,r){return t(n,function(){return r})}},RK=function(e){var t=wa(e);return function(n,r){return function(i){var o=t(n,i);if(Nt(o))return ye;var a=o.value,u=a[0],s=a[1],c=r(s);if(c===s)return fe(i);var l=new Map(i);return l.set(u,c),fe(l)}}};function Yoe(e){var t=cc(e),n=EK(e);return function(r){var i=n(r);return function(o){return b(t(r,o),mo(function(a){return[a,i(o)]}))}}}function wa(e){return function(t,n){if(n===void 0){var r=wa(e);return function(c){return r(t,c)}}for(var i=n.entries(),o;!(o=i.next()).done;){var a=o.value,u=a[0],s=a[1];if(e.equals(u,t))return fe([u,s])}return ye}}function cc(e){var t=wa(e);return function(n,r){if(r===void 0){var i=cc(e);return function(o){return i(n,o)}}return b(t(n,r),mo(function(o){o[0];var a=o[1];return a}))}}function ey(e,t){var n=wa(e);return function(r,i){if(i===void 0){var o=ey(e,t);return function(p){return o(p,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(Nt(f)||!e.equals(c,f.value[0])||!t.equals(l,f.value[1]))return!1}return!0}}var ty=new Map;function OK(e,t){var n=ey(e,t);return ti(function(r,i){return n(r,i)&&n(i,r)})}function Goe(e,t){var n=wa(e);return{concat:function(r,i){if(ao(r))return i;if(ao(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);_t(f)?o.set(f.value[0],t.concat(f.value[1],l)):o.set(c,l)}return o},empty:ty}}var Joe=function(e,t){return new Map([[e,t]])};function Zoe(e,t,n){return function(r){var i=wa(e);return n.reduce(r,new Map,function(o,a){var u=a[0],s=a[1],c=i(u,o);return _t(c)?o.set(c.value[0],t.concat(c.value[1],s)):o.set(u,s),o})}}var Wf=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},FK=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);Xt(c)?n.set(u,c.left):r.set(u,c.right)}return Re(n,r)}};function MK(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 Re(n,r)}}var kK=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);_t(s)&&n.set(a,s.value)}return n}};function LK(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 $a=function(e,t){return Wf(e,function(n,r){return t(r)})},SA=function(e,t){return jK(e,function(n,r){return t(r)})},_A=function(e,t){return UK(e,function(n,r){return t(r)})},IA=function(e,t){return BK(e,function(n,r){return t(r)})},TA=function(e,t){return WK(e,function(n,r){return t(r)})},jK=function(e,t){return b(e,LK(t))},UK=function(e,t){return b(e,kK(t))},BK=function(e,t){return b(e,MK(t))},WK=function(e,t){return b(e,FK(t))},Kf=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];_t(a)&&t.set(o,a.value)}return t},Xoe=function(e){return function(t){return SA(t,e)}},eae=function(e){return function(t){return _A(t,e)}},tae=function(e){return function(t){return $a(t,e)}},nae=function(e){return function(t){return Wf(t,e)}},rae=function(e){return function(t){return IA(t,e)}},iae=function(e){return function(t){return TA(t,e)}},Pf=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];Xt(u)?t.set(a,u.left):n.set(a,u.right)}return Re(t,n)},ai="ReadonlyMap",KK=function(e,t){var n=BT(e,t);return{concat:function(r,i){return n(i)(r)}}},oae=function(e,t){return{concat:KK(e,t).concat,empty:ty}},aae=function(e,t){var n=WT(e,t);return{concat:function(r,i){return n(i)(r)}}},uae=function(e){return function(){var t=KT(e);return{concat:function(n,r){return t(r)(n)}}}};function sae(){return{URI:ai,_E:void 0,map:$a,mapWithIndex:Wf,compact:Kf,separate:Pf,filter:SA,filterMap:_A,partition:IA,partitionMap:TA,partitionMapWithIndex:WK,partitionWithIndex:BK,filterMapWithIndex:UK,filterWithIndex:jK}}var PK={URI:ai,map:$a},cae=qe(PK),lae=function(){return{URI:ai,_E:void 0,map:$a,mapWithIndex:Wf}},$1={URI:ai,compact:Kf,separate:Pf},fae={URI:ai,map:$a,compact:Kf,separate:Pf,filter:SA,filterMap:_A,partition:IA,partitionMap:TA},MT=function(e){var t=ry(e);return function(n,r){return t(n,function(i,o,a){return r(o,a)})}},kT=function(e){var t=iy(e);return function(n){var r=t(n);return function(i){return r(function(o,a){return i(a)})}}},LT=function(e){var t=oy(e);return function(n,r){return t(n,function(i,o,a){return r(o,a)})}},ny=function(e){var t=MT(e),n=kT(e),r=LT(e);return{URI:ai,_E:void 0,reduce:function(i,o,a){return b(i,t(o,a))},foldMap:function(i){var o=n(i);return function(a,u){return b(a,o(u))}},reduceRight:function(i,o,a){return b(i,r(o,a))}}},ry=function(e){var t=Bf(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}}},iy=function(e){var t=Bf(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}}}},oy=function(e){var t=Bf(e);return function(n,r){return function(i){for(var o=n,a=t(i),u=a.length,s=u-1;s>=0;s--){var c=a[s];o=r(c,i.get(c),o)}return o}}},jT=function(e){var t=ny(e),n=ry(e),r=iy(e),i=oy(e);return{URI:ai,_E:void 0,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,reduceWithIndex:function(o,a,u){return b(o,n(a,u))},foldMapWithIndex:function(o){var a=r(o);return function(u,s){return b(u,a(s))}},reduceRightWithIndex:function(o,a,u){return b(o,i(a,u))}}},dae=function(e){var t=UT(e),n=ny(e);return{URI:ai,_E:void 0,map:$a,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,traverse:t.traverse,sequence:t.sequence}},UT=function(e){var t=jT(e),n=Bf(e),r=function(a){return function(u,s){for(var c=a.of(new Map),l=n(u),f=l.length,p=function(h){var v=l[h],_=u.get(v);c=a.ap(a.map(c,function(S){return function(I){return S.set(v,I)}}),s(v,_))},A=0;A<f;A++)p(A);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,fr)}};return{URI:ai,_E:void 0,map:$a,mapWithIndex:Wf,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 pae(e){var t=UT(e);return{URI:ai,_E:void 0,map:$a,compact:Kf,separate:Pf,filter:SA,filterMap:_A,partition:IA,partitionMap:TA,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,traverse:t.traverse,sequence:t.sequence,mapWithIndex:Wf,reduceWithIndex:t.reduceWithIndex,foldMapWithIndex:t.foldMapWithIndex,reduceRightWithIndex:t.reduceRightWithIndex,traverseWithIndex:t.traverseWithIndex,wilt:Mi(t,$1),wither:ki(t,$1)}}var BT=function(e,t){var n=cc(e);return function(r){return function(i){if(ao(i))return r;if(ao(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);_t(f)?o.set(c,t.concat(l,f.value)):o.set(c,l)}for(var p=r.entries();!(u=p.next()).done;){var A=u.value,c=A[0],l=A[1],f=n(c)(o);Nt(f)&&o.set(c,l)}return o}}},WT=function(e,t){var n=cc(e);return function(r){return function(i){if(ao(i)||ao(r))return ty;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);_t(f)&&o.set(c,t.concat(l,f.value))}return o}}},KT=function(e){var t=Xv(e);return function(n){return function(r){if(ao(r))return n;if(ao(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}}},Aae=$K,hae={URI:ai,map:$a,compact:Kf,separate:Pf,filter:SA,filterMap:_A,partition:IA,partitionMap:TA};const mae=Object.freeze(Object.defineProperty({__proto__:null,Compactable:$1,Filterable:fae,Functor:PK,URI:ai,collect:xK,compact:Kf,deleteAt:EK,difference:KT,elem:FT,empty:ty,filter:Xoe,filterMap:eae,filterMapWithIndex:kK,filterWithIndex:LK,flap:cae,foldMap:kT,foldMapWithIndex:iy,fromFoldable:Zoe,fromMap:qoe,getDifferenceMagma:uae,getEq:OK,getFilterableWithIndex:sae,getFoldable:ny,getFoldableWithIndex:jT,getFunctorWithIndex:lae,getIntersectionSemigroup:aae,getMonoid:Goe,getShow:IK,getTraversable:dae,getTraversableWithIndex:UT,getUnionMonoid:oae,getUnionSemigroup:KK,getWitherable:pae,insertAt:Aae,intersection:WT,isEmpty:ao,isSubmap:ey,keys:Bf,lookup:cc,lookupWithKey:wa,map:tae,mapWithIndex:nae,member:Xv,modifyAt:RK,partition:rae,partitionMap:iae,partitionMapWithIndex:FK,partitionWithIndex:MK,pop:Yoe,readonlyMap:hae,reduce:MT,reduceRight:LT,reduceRightWithIndex:oy,reduceWithIndex:ry,separate:Pf,singleton:Joe,size:TK,toMap:Qoe,toReadonlyArray:wK,toUnfoldable:zoe,union:BT,updateAt:Hoe,upsertAt:$K,values:Voe},Symbol.toStringTag,{value:"Module"}));var yl=function(){return yl=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},yl.apply(this,arguments)},gae=IK,vae=TK,Xo=ao,yae=Xv,bae=FT,PT=function(e){return function(t){return Array.from(t.keys()).sort(e.compare)}},Cae=function(e){return function(t){return Array.from(t.values()).sort(e.compare)}};function DK(e){var t=PT(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 NK(e){return DK(e)(function(t,n){return[t,n]})}function Sae(e,t){var n=NK(e);return function(r){var i=n(r),o=i.length;return t.unfold(0,function(a){return a<o?fe([i[a],a+1]):ye})}}var qK=function(e){var t=lc(e);return function(n,r){var i=t(n);return function(o){var a=i(o);if(Nt(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}}},QK=function(e){var t=lc(e);return function(n){return function(r){var i=t(n,r);if(_t(i)){var o=new Map(r);return o.delete(i.value[0]),o}return r}}},_ae=function(e){var t=VK(e);return function(n,r){return t(n,function(){return r})}},VK=function(e){var t=lc(e);return function(n,r){return function(i){var o=t(n,i);if(Nt(o))return ye;var a=new Map(i);return a.set(o.value[0],r(o.value[1])),fe(a)}}};function Iae(e){var t=zK(e),n=QK(e);return function(r){var i=n(r);return function(o){return b(t(r,o),mo(function(a){return[a,i(o)]}))}}}function lc(e){return function(t,n){if(n===void 0){var r=lc(e);return function(c){return r(t,c)}}for(var i=n.entries(),o;!(o=i.next()).done;){var a=o.value,u=a[0],s=a[1];if(e.equals(u,t))return fe([u,s])}return ye}}var zK=cc,Tae=ey,xae=OK;function wae(e,t){var n=lc(e);return{concat:function(r,i){if(Xo(r))return i;if(Xo(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);_t(f)?o.set(f.value[0],t.concat(f.value[1],l)):o.set(c,l)}return o},empty:new Map}}var $ae=function(e,t){return new Map([[e,t]])};function Eae(e,t,n){return function(r){var i=lc(e);return n.reduce(r,new Map,function(o,a){var u=a[0],s=a[1],c=i(u,o);return _t(c)?o.set(c.value[0],t.concat(c.value[1],s)):o.set(u,s),o})}}var xA=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},HK=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);Xt(c)?n.set(u,c.left):r.set(u,c.right)}return Re(n,r)}};function YK(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 Re(n,r)}}var GK=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);_t(s)&&n.set(a,s.value)}return n}};function JK(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 Df=function(e,t){return xA(e,function(n,r){return t(r)})},ay=function(e,t){return ZK(e,function(n,r){return t(r)})},uy=function(e,t){return XK(e,function(n,r){return t(r)})},sy=function(e,t){return eP(e,function(n,r){return t(r)})},cy=function(e,t){return tP(e,function(n,r){return t(r)})},ZK=function(e,t){return b(e,JK(t))},XK=function(e,t){return b(e,GK(t))},eP=function(e,t){return b(e,YK(t))},tP=function(e,t){return b(e,HK(t))},wA=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];_t(a)&&t.set(o,a.value)}return t},Rae=function(e){return function(t){return ay(t,e)}},Oae=function(e){return function(t){return uy(t,e)}},Fae=function(e){return function(t){return Df(t,e)}},Mae=function(e){return function(t){return xA(t,e)}},kae=function(e){return function(t){return sy(t,e)}},Lae=function(e){return function(t){return cy(t,e)}},$A=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];Xt(u)?t.set(a,u.left):n.set(a,u.right)}return Re(t,n)},Ea="Map",nP=function(e,t){var n=uP(e,t);return{concat:function(r,i){return n(i)(r)}}},jae=function(e,t){return{concat:nP(e,t).concat,empty:new Map}},Uae=function(e,t){var n=sP(e,t);return{concat:function(r,i){return n(i)(r)}}},Bae=function(e){return function(){var t=cP(e);return{concat:function(n,r){return t(r)(n)}}}};function Wae(){return{URI:Ea,_E:void 0,map:Df,mapWithIndex:xA,compact:wA,separate:$A,filter:ay,filterMap:uy,partition:sy,partitionMap:cy,partitionMapWithIndex:tP,partitionWithIndex:eP,filterMapWithIndex:XK,filterWithIndex:ZK}}function Kae(e){var t=iP(e);return{URI:Ea,_E:void 0,map:Df,compact:wA,separate:$A,filter:ay,filterMap:uy,partition:sy,partitionMap:cy,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,traverse:t.traverse,sequence:t.sequence,mapWithIndex:xA,reduceWithIndex:t.reduceWithIndex,foldMapWithIndex:t.foldMapWithIndex,reduceRightWithIndex:t.reduceRightWithIndex,traverseWithIndex:t.traverseWithIndex,wilt:Mi(t,E1),wither:ki(t,E1)}}var Pae=MT,Dae=kT,Nae=LT,qae=function(e){return yl(yl({},ny(e)),{URI:Ea})},Qae=ry,Vae=iy,zae=oy,rP=function(e){return yl(yl({},jT(e)),{URI:Ea})},iP=function(e){var t=rP(e),n=PT(e),r=function(a){return function(u,s){for(var c=a.of(new Map),l=n(u),f=l.length,p=function(h){var v=l[h],_=u.get(v);c=a.ap(a.map(c,function(S){return function(I){return S.set(v,I)}}),s(v,_))},A=0;A<f;A++)p(A);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:Ea,_E:void 0,map:Df,mapWithIndex:xA,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,reduceWithIndex:t.reduceWithIndex,foldMapWithIndex:t.foldMapWithIndex,reduceRightWithIndex:t.reduceRightWithIndex,traverse:i,sequence:o,traverseWithIndex:r}},oP={URI:Ea,map:Df},Hae=qe(oP),E1={URI:Ea,compact:wA,separate:$A},aP={URI:Ea,map:Df,compact:wA,separate:$A,filter:ay,filterMap:uy,partition:sy,partitionMap:cy},hm=function(e){return new Map(e)},uP=function(e,t){var n=BT(e,t);return function(r){return function(i){return Xo(i)?hm(r):Xo(r)?hm(i):n(r)(i)}}},sP=function(e,t){var n=WT(e,t);return function(r){return function(i){return Xo(i)||Xo(r)?new Map:n(r)(i)}}},cP=function(e){var t=KT(e);return function(n){return function(r){return Xo(r)?hm(n):Xo(n)?hm(r):t(n)(r)}}},Yae=new Map,Gae=qK,Jae=aP;const Zae=Object.freeze(Object.defineProperty({__proto__:null,Compactable:E1,Filterable:aP,Functor:oP,URI:Ea,collect:DK,compact:wA,deleteAt:QK,difference:cP,elem:bae,empty:Yae,filter:Rae,filterMap:Oae,filterMapWithIndex:GK,filterWithIndex:JK,flap:Hae,foldMap:Dae,foldMapWithIndex:Vae,fromFoldable:Eae,getDifferenceMagma:Bae,getEq:xae,getFilterableWithIndex:Wae,getFoldable:qae,getFoldableWithIndex:rP,getIntersectionSemigroup:Uae,getMonoid:wae,getShow:gae,getTraversableWithIndex:iP,getUnionMonoid:jae,getUnionSemigroup:nP,getWitherable:Kae,insertAt:Gae,intersection:sP,isEmpty:Xo,isSubmap:Tae,keys:PT,lookup:zK,lookupWithKey:lc,map:Fae,mapWithIndex:Mae,map_:Jae,member:yae,modifyAt:VK,partition:kae,partitionMap:Lae,partitionMapWithIndex:HK,partitionWithIndex:YK,pop:Iae,reduce:Pae,reduceRight:Nae,reduceRightWithIndex:zae,reduceWithIndex:Qae,separate:$A,singleton:$ae,size:vae,toArray:NK,toUnfoldable:Sae,union:uP,updateAt:_ae,upsertAt:qK,values:Cae},Symbol.toStringTag,{value:"Module"})),Xae=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),eue=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),tue=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),nue=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),rue=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var lP=function(e){return{concat:yg(e).concat,empty:e.top}},fP=function(e){return{concat:bg(e).concat,empty:e.bottom}},DT=function(e){return{concat:eS(e).concat,empty:e.empty}},dP=function(e){var t={};for(var n in e)ft.call(e,n)&&(t[n]=e[n].empty);return{concat:tS(e).concat,empty:t}},pP=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return{concat:nS.apply(nL,e).concat,empty:e.map(function(n){return n.empty})}},AP=function(e){return iS(e)(e.empty)},iue={concat:Gk.concat,empty:void 0},oue=pP,aue=dP,uue=DT,sue=fP,cue=lP,lue=AP,hP={concat:Jk.concat,empty:!0},mP={concat:Zk.concat,empty:!1},fue=Tk,due=function(){return DT($B())},pue={concat:Xk.concat,empty:""},Aue={concat:eL.concat,empty:0},hue={concat:tL.concat,empty:1};const mue=Object.freeze(Object.defineProperty({__proto__:null,concatAll:AP,fold:lue,getDualMonoid:uue,getEndomorphismMonoid:due,getFunctionMonoid:fue,getJoinMonoid:sue,getMeetMonoid:cue,getStructMonoid:aue,getTupleMonoid:oue,max:fP,min:lP,monoidAll:hP,monoidAny:mP,monoidProduct:hue,monoidString:pue,monoidSum:Aue,monoidVoid:iue,reverse:DT,struct:dP,tuple:pP},Symbol.toStringTag,{value:"Module"})),gue=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var gP=function(e,t,n){return function(r){return r===-1?e():r===0?t():n()}},vue=gP,vP=function(e){return e===-1?1:e===1?-1:0},yP={equals:function(e,t){return e===t}},NT={concat:function(e,t){return e!==0?e:t}},bP={concat:NT.concat,empty:0},yue=function(e){return e<=-1?-1:e>=1?1:0},bue=vP,Cue=NT,Sue=yP,_ue=bP;const Iue=Object.freeze(Object.defineProperty({__proto__:null,Eq:yP,Monoid:bP,Semigroup:NT,eqOrdering:Sue,invert:bue,match:vue,matchW:gP,monoidOrdering:_ue,reverse:vP,semigroupOrdering:Cue,sign:yue},Symbol.toStringTag,{value:"Module"}));var Tue=function(e){return typeof e.map=="function"},xue=function(e){return typeof e.contramap=="function"},wue=function(e){return typeof e.mapWithIndex=="function"},$ue=function(e){return typeof e.ap=="function"},Eue=function(e){return typeof e.chain=="function"},Rue=function(e){return typeof e.bimap=="function"},Oue=function(e){return typeof e.extend=="function"},Fue=function(e){return typeof e.reduce=="function"},Mue=function(e){return typeof e.reduceWithIndex=="function"},kue=function(e){return typeof e.alt=="function"},Lue=function(e){return typeof e.compact=="function"},jue=function(e){return typeof e.filter=="function"},Uue=function(e){return typeof e.filterWithIndex=="function"},Bue=function(e){return typeof e.promap=="function"},Wue=function(e){return typeof e.compose=="function"},Kue=function(e){return typeof e.throwError=="function"};function Pue(e){var t={};if(Tue(e)){var n=function(k){return function(E){return e.map(E,k)}};t.map=n}if(xue(e)){var r=function(k){return function(E){return e.contramap(E,k)}};t.contramap=r}if(wue(e)){var i=function(k){return function(E){return e.mapWithIndex(E,k)}};t.mapWithIndex=i}if($ue(e)){var o=function(k){return function(E){return e.ap(E,k)}},a=function(k){return function(E){return e.ap(e.map(E,function(D){return function(){return D}}),k)}};t.ap=o,t.apFirst=a,t.apSecond=function(k){return function(E){return e.ap(e.map(E,function(){return function(D){return D}}),k)}}}if(Eue(e)){var u=function(k){return function(E){return e.chain(E,k)}},s=function(k){return function(E){return e.chain(E,function(D){return e.map(k(D),function(){return D})})}},c=function(k){return e.chain(k,P)};t.chain=u,t.chainFirst=s,t.flatten=c}if(Rue(e)){var l=function(k,E){return function(D){return e.bimap(D,k,E)}},f=function(k){return function(E){return e.mapLeft(E,k)}};t.bimap=l,t.mapLeft=f}if(Oue(e)){var p=function(k){return function(E){return e.extend(E,k)}},A=function(k){return e.extend(k,P)};t.extend=p,t.duplicate=A}if(Fue(e)){var h=function(k,E){return function(D){return e.reduce(D,k,E)}},v=function(k){var E=e.foldMap(k);return function(D){return function(ue){return E(ue,D)}}},_=function(k,E){return function(D){return e.reduceRight(D,k,E)}};t.reduce=h,t.foldMap=v,t.reduceRight=_}if(Mue(e)){var S=function(k,E){return function(D){return e.reduceWithIndex(D,k,E)}},I=function(k){var E=e.foldMapWithIndex(k);return function(D){return function(ue){return E(ue,D)}}},T=function(k,E){return function(D){return e.reduceRightWithIndex(D,k,E)}};t.reduceWithIndex=S,t.foldMapWithIndex=I,t.reduceRightWithIndex=T}if(kue(e)){var g=function(k){return function(E){return e.alt(E,k)}};t.alt=g}if(Lue(e)&&(t.compact=e.compact,t.separate=e.separate),jue(e)){var C=function(k){return function(E){return e.filter(E,k)}},y=function(k){return function(E){return e.filterMap(E,k)}},x=function(k){return function(E){return e.partition(E,k)}},w=function(k){return function(E){return e.partitionMap(E,k)}};t.filter=C,t.filterMap=y,t.partition=x,t.partitionMap=w}if(Uue(e)){var M=function(k){return function(E){return e.filterWithIndex(E,k)}},O=function(k){return function(E){return e.filterMapWithIndex(E,k)}},F=function(k){return function(E){return e.partitionWithIndex(E,k)}},K=function(k){return function(E){return e.partitionMapWithIndex(E,k)}};t.filterWithIndex=M,t.filterMapWithIndex=O,t.partitionWithIndex=F,t.partitionMapWithIndex=K}if(Bue(e)){var N=function(k,E){return function(D){return e.promap(D,k,E)}};t.promap=N}if(Wue(e)){var J=function(k){return function(E){return e.compose(E,k)}};t.compose=J}if(Kue(e)){var Z=function(k){return function(E){return E._tag==="None"?e.throwError(k()):e.of(E.value)}},ae=function(k){return k._tag==="Left"?e.throwError(k.left):e.of(k.right)},ge=function(k,E){return function(D){return k(D)?e.of(D):e.throwError(E(D))}},se=function(k,E){return function(D){return e.chain(D,function(ue){return k(ue)?e.of(ue):e.throwError(E(ue))})}};t.fromOption=Z,t.fromEither=ae,t.fromPredicate=ge,t.filterOrElse=se}return t}var ce=b;const Due=Object.freeze(Object.defineProperty({__proto__:null,pipe:ce,pipeable:Pue},Symbol.toStringTag,{value:"Module"})),Nue=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),que=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var ly=function(){return Math.random()};function CP(e,t){return b(ly,So(function(n){return Math.floor((t-e+1)*n+e)}))}function Que(e,t){return b(ly,So(function(n){return(t-e)*n+e}))}var Vue=b(ly,So(function(e){return e<.5})),zue=function(e){return b(CP(0,e.length-1),So(function(t){return e[t]}))};const Hue=Object.freeze(Object.defineProperty({__proto__:null,random:ly,randomBool:Vue,randomElem:zue,randomInt:CP,randomRange:Que},Symbol.toStringTag,{value:"Module"}));var qT=yf(PI),SP=ec(PI),_P=bf(hn),Yue=Cf(hn),IP=bo,TP=_P,xP=oA(hn),Gue=xP,QT=wf(Ca),Jue=QT,wP=QT,Zue=wP,$P=$f(Ca),Xue=$P,ese=sA(hn),tse=cA,EP=lA,nse=EP,RP=nc(Ca),rse=RP,OP=aA(Ca),ise=OP,ose=uA(Ca),ase=Ef(hn),ui=function(e,t){return b(e,MP(t))},VT=function(e,t,n){return b(e,kP(t,n))},zT=function(e,t){return b(e,LP(t))},Nf=function(e,t){return b(e,HT(t))},EA=function(e,t){return b(e,YT(t))},FP=function(e,t){return b(e,GT(t))},MP=Sf(hn),kP=Tf(hn),LP=xf(hn),HT=_f(ba),use=HT,Io=SP,YT=tc(Ca),jP=YT,UP=jP(P),sse=UP,GT=If(Ca),cse=GT,JT=qT,rn="ReaderEither",BP=function(e){var t=Js(e);return{URI:rn,_E:void 0,compact:go(hn,t),separate:Aa(hn,t,Tu)}};function lse(e){var t=mf(e),n=BP(e),r=ha(hn,t),i=ma(hn,t),o=wu(hn,t),a=$u(hn,t);return{URI:rn,_E:void 0,map:ui,compact:n.compact,separate:n.separate,filter:function(u,s){return b(u,r(s))},filterMap:function(u,s){return b(u,i(s))},partition:function(u,s){return b(u,o(s))},partitionMap:function(u,s){return b(u,a(s))}}}function WP(e){var t=ua(ba,Iu(e));return{URI:rn,_E:void 0,map:ui,ap:function(n,r){return b(n,t(r))},of:Io}}function KP(e){var t=iA(Ca,e);return{URI:rn,_E:void 0,map:ui,alt:function(n,r){return b(n,t(r))}}}var ZT={URI:rn,map:ui},fse=qe(ZT),dse={URI:rn,of:Io},RA={URI:rn,map:ui,ap:Nf},PP=kt(RA),pse=PP,DP=Lt(RA),Ase=DP,NP={URI:rn,map:ui,ap:Nf,of:Io},Ra={URI:rn,map:ui,ap:Nf,chain:EA},hse={URI:rn,map:ui,ap:Nf,of:Io,chain:EA},qP=dt(Ra),mse=qP,gse={URI:rn,bimap:VT,mapLeft:zT},vse={URI:rn,map:ui,alt:FP},qf={URI:rn,fromReader:TP},yse=dA(qf),bse=pA(qf),Cse=oc(qf),QP=AA(qf,Ra),Sse=QP,VP=hA(qf,Ra),_se=VP,Ise={URI:rn,map:ui,ap:Nf,of:Io,chain:EA,throwError:JT},Oa={URI:rn,fromEither:IP},Tse=po(Oa),xse=Ao(Oa),wse=Ks(Oa,Ra),zP=sa(Oa,Ra),$se=zP,HP=ca(Oa,Ra),Ese=HP,Rse=mu(Oa),YP=Ps(Oa,Ra),Ose=YP,Fse=Mr(Oa),Mse=Io(tn),kse=Ut(ZT),GP=Bt(Ra),Lse=GP,JP=jt(RA),jse=JP,ZP=Io(bn),XP=function(e){return z(ic(e),rc(rA(fr)))},XT=function(e){var t=XP(e);return function(n){return vt(n)?t(n):ZP}},Use=XT,eD=function(e){return XT(function(t,n){return e(n)})},Bse=eD(P),Wse={URI:rn,bimap:VT,mapLeft:zT,map:ui,of:Io,ap:Nf,chain:EA,alt:FP,throwError:qT},Kse=nn(RA),Pse=ei(NP),Dse=function(e){return nn(ba)(Xp(e))};function Nse(e){var t=WP(e),n=KP(e);return{URI:rn,_E:void 0,map:ui,ap:t.ap,of:Io,chain:EA,bimap:VT,mapLeft:zT,alt:n.alt,throwError:JT}}const qse=Object.freeze(Object.defineProperty({__proto__:null,Alt:vse,ApT:ZP,Applicative:NP,Apply:RA,Bifunctor:gse,Chain:Ra,Do:Mse,FromEither:Oa,FromReader:qf,Functor:ZT,Monad:hse,MonadThrow:Ise,Pointed:dse,URI:rn,alt:GT,altW:cse,ap:HT,apFirst:PP,apFirstW:pse,apS:JP,apSW:jse,apSecond:DP,apSecondW:Ase,apW:use,ask:yse,asks:bse,asksReaderEither:nse,asksReaderEitherW:EP,bimap:kP,bind:GP,bindTo:kse,bindW:Lse,chain:YT,chainEitherK:zP,chainEitherKW:$se,chainFirst:qP,chainFirstEitherK:HP,chainFirstEitherKW:Ese,chainFirstReaderK:VP,chainFirstReaderKW:_se,chainFirstW:mse,chainOptionK:wse,chainReaderK:QP,chainReaderKW:Sse,chainW:jP,filterOrElse:YP,filterOrElseW:Ose,flap:fse,flatten:sse,flattenW:UP,fold:Jue,foldW:Zue,fromEither:IP,fromEitherK:Fse,fromOption:Tse,fromOptionK:xse,fromPredicate:Rse,fromReader:TP,fromReaderK:Cse,getAltReaderValidation:KP,getApplicativeReaderValidation:WP,getApplyMonoid:Pse,getApplySemigroup:Kse,getCompactable:BP,getFilterable:lse,getOrElse:$P,getOrElseW:Xue,getReaderValidation:Nse,getSemigroup:Dse,left:qT,leftReader:Yue,local:tse,map:MP,mapLeft:LP,match:xP,matchE:QT,matchEW:wP,matchW:Gue,of:Io,orElse:RP,orElseFirst:OP,orElseFirstW:ise,orElseW:rse,orLeft:ose,readerEither:Wse,right:SP,rightReader:_P,sequenceArray:Bse,swap:ase,throwError:JT,toUnion:ese,traverseArray:eD,traverseArrayWithIndex:Use,traverseReadonlyArrayWithIndex:XT,traverseReadonlyNonEmptyArrayWithIndex:XP},Symbol.toStringTag,{value:"Module"}));function ex(e){return function(t){return function(){return e.of(t)}}}function tx(e){return function(t){return function(n){return function(r){return e.map(n(r),t)}}}}function nx(e){return function(t){return function(n){return function(r){return e.ap(n(r),t(r))}}}}function rx(e){return function(t){return function(n){return function(r){return e.chain(n(r),function(i){return t(i)(r)})}}}}function ix(e){return function(t){return z(t,e.of)}}function Qse(e){return function(t){return z(t,e)}}function Vse(e){var t=nx(e),n=tx(e),r=rx(e);return{map:function(i,o){return b(i,n(o))},ap:function(i,o){return b(i,t(o))},of:ex(e),chain:function(i,o){return b(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:ix(e),fromM:function(i){return function(){return i}}}}const zse=Object.freeze(Object.defineProperty({__proto__:null,ap:nx,chain:rx,fromNaturalTransformation:Qse,fromReader:ix,getReaderM:Vse,map:tx,of:ex},Symbol.toStringTag,{value:"Module"}));var Gn=function(e){return function(){return Promise.resolve().then(e)}};function Hse(e){return function(t){return function(){return new Promise(function(n){setTimeout(function(){Promise.resolve().then(t).then(n)},e)})}}}var Ui=function(e,t){return b(e,Fu(t))},fc=function(e,t){return b(e,tD(t))},ox=function(e,t){return b(e,OA(function(n){return b(t,Fu(n))}))},Qf=function(e,t){return b(e,OA(t))},Fu=function(e){return function(t){return function(){return Promise.resolve().then(t).then(e)}}},tD=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)})}}},jn=function(e){return function(){return Promise.resolve(e)}},OA=function(e){return function(t){return function(){return Promise.resolve().then(t).then(function(n){return e(n)()})}}},Yse=OA(P),Jn="Task";function Gse(){return{concat:function(e,t){return function(){return Promise.race([Promise.resolve().then(e),Promise.resolve().then(t)])}},empty:rD}}var We={URI:Jn,map:Ui},Jse=qe(We),_n={URI:Jn,of:jn},dc={URI:Jn,map:Ui,ap:fc},Zse=kt(dc),Xse=Lt(dc),FA={URI:Jn,map:Ui,ap:fc,of:jn},fy={URI:Jn,map:Ui,ap:ox},nD={URI:Jn,map:Ui,ap:ox,of:jn},Vf={URI:Jn,map:Ui,ap:fc,chain:Qf},on={URI:Jn,map:Ui,of:jn,ap:fc,chain:Qf},ece={URI:Jn,map:Ui,of:jn,ap:fc,chain:Qf,fromIO:Gn},MA=P,tce={URI:Jn,map:Ui,of:jn,ap:fc,chain:Qf,fromIO:Gn,fromTask:MA},nce=dt(Vf),dy={URI:Jn,fromIO:Gn},rce=yo(dy),ice=ga(dy,Vf),oce=va(dy,Vf),ace={URI:Jn,fromIO:Gn,fromTask:MA},rD=function(){return new Promise(function(e){})},uce=jn(tn),sce=Ut(We),cce=Bt(Vf),lce=jt(dc),ax=jn(bn),zf=function(e){return function(t){return function(){return Promise.all(t.map(function(n,r){return Promise.resolve().then(function(){return e(r,n)()})}))}}},ux=function(e){var t=zf(e);return function(n){return vt(n)?t(n):ax}},sx=function(e){return function(t){return function(){return Dl(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,Fr(t))).then(Tp))}}},cx=function(e){var t=sx(e);return function(n){return vt(n)?t(n):ax}},fce=ux,iD=function(e){return ux(function(t,n){return e(n)})},dce=iD(P),pce=cx,oD=function(e){return cx(function(t,n){return e(n)})},Ace=oD(P),hce={URI:Jn,map:Ui,of:jn,ap:fc,chain:Qf,fromIO:Gn,fromTask:MA},mce={URI:Jn,map:Ui,of:jn,ap:ox,chain:Qf,fromIO:Gn,fromTask:MA},gce=nn(fy),vce=ei(nD);const yce=Object.freeze(Object.defineProperty({__proto__:null,ApT:ax,ApplicativePar:FA,ApplicativeSeq:nD,ApplyPar:dc,ApplySeq:fy,Chain:Vf,Do:uce,FromIO:dy,FromTask:ace,Functor:We,Monad:on,MonadIO:ece,MonadTask:tce,Pointed:_n,URI:Jn,ap:tD,apFirst:Zse,apS:lce,apSecond:Xse,bind:cce,bindTo:sce,chain:OA,chainFirst:nce,chainFirstIOK:oce,chainIOK:ice,delay:Hse,flap:Jse,flatten:Yse,fromIO:Gn,fromIOK:rce,fromTask:MA,getMonoid:vce,getRaceMonoid:Gse,getSemigroup:gce,map:Fu,never:rD,of:jn,sequenceArray:dce,sequenceSeqArray:Ace,task:hce,taskSeq:mce,traverseArray:iD,traverseArrayWithIndex:fce,traverseReadonlyArrayWithIndex:ux,traverseReadonlyArrayWithIndexSeq:cx,traverseReadonlyNonEmptyArrayWithIndex:zf,traverseReadonlyNonEmptyArrayWithIndexSeq:sx,traverseSeqArray:oD,traverseSeqArrayWithIndex:pce},Symbol.toStringTag,{value:"Module"}));var aD=ix(_n),Hf=bo,pc=z(Gn,Hf),bce=cA,uD=lA,Cce=uD,Bi=function(e,t){return b(e,fx(t))},Ac=function(e,t){return b(e,dx(t))},lx=function(e,t){return b(e,py(function(n){return b(t,fx(n))}))},Yf=function(e,t){return b(e,py(t))},fx=tx(We),dx=nx(dc),Sce=dx,si=ex(_n),py=rx(on),sD=py,cD=sD(P),_ce=cD,Un="ReaderTask",mn={URI:Un,map:Bi},Ice=qe(mn),kA={URI:Un,of:si},LA={URI:Un,map:Bi,ap:Ac},Tce=kt(LA),xce=Lt(LA),wce={URI:Un,map:Bi,ap:Ac,of:si},px={URI:Un,map:Bi,ap:lx},lD={URI:Un,map:Bi,ap:lx,of:si},To={URI:Un,map:Bi,ap:Ac,chain:Yf},Fa={URI:Un,map:Bi,of:si,ap:Ac,chain:Yf},$ce={URI:Un,map:Bi,of:si,ap:Ac,chain:Yf,fromIO:pc},Ece={URI:Un,map:Bi,of:si,ap:Ac,chain:Yf,fromIO:pc,fromTask:Hf},fD=dt(To),Rce=fD,Ay={URI:Un,fromIO:pc},Oce=yo(Ay),Fce=ga(Ay,To),Mce=va(Ay,To),Gf={URI:Un,fromReader:aD},kce=dA(Gf),Lce=pA(Gf),jce=oc(Gf),dD=AA(Gf,To),Uce=dD,pD=hA(Gf,To),Bce=pD,hy={URI:Un,fromIO:pc,fromTask:Hf},Wce=ac(hy),Kce=Rf(hy,To),Pce=Of(hy,To),Dce=si(tn),Nce=Ut(mn),AD=Bt(To),qce=AD,hD=jt(LA),Qce=hD,Ax=si(bn),mD=function(e){return z(ic(e),rc(zf(fr)))},hx=function(e){var t=mD(e);return function(n){return vt(n)?t(n):Ax}},gD=function(e){return z(ic(e),rc(sx(fr)))},mx=function(e){var t=gD(e);return function(n){return vt(n)?t(n):Ax}},Vce=hx,vD=function(e){return hx(function(t,n){return e(n)})},zce=vD(P),Hce=mx,yD=function(e){return mx(function(t,n){return e(n)})},Yce=yD(P),Gce={URI:Un,map:Bi,of:si,ap:Ac,chain:Yf,fromIO:pc,fromTask:Hf},Jce={URI:Un,map:Bi,of:si,ap:lx,chain:Yf,fromIO:pc,fromTask:Hf},Zce=nn(px),Xce=ei(lD);function ele(e,t){return e(t)()}const tle=Object.freeze(Object.defineProperty({__proto__:null,ApT:Ax,ApplicativePar:wce,ApplicativeSeq:lD,ApplyPar:LA,ApplySeq:px,Chain:To,Do:Dce,FromIO:Ay,FromReader:Gf,FromTask:hy,Functor:mn,Monad:Fa,MonadIO:$ce,MonadTask:Ece,Pointed:kA,URI:Un,ap:dx,apFirst:Tce,apS:hD,apSW:Qce,apSecond:xce,apW:Sce,ask:kce,asks:Lce,asksReaderTask:Cce,asksReaderTaskW:uD,bind:AD,bindTo:Nce,bindW:qce,chain:py,chainFirst:fD,chainFirstIOK:Mce,chainFirstReaderK:pD,chainFirstReaderKW:Bce,chainFirstTaskK:Pce,chainFirstW:Rce,chainIOK:Fce,chainReaderK:dD,chainReaderKW:Uce,chainTaskK:Kce,chainW:sD,flap:Ice,flatten:_ce,flattenW:cD,fromIO:pc,fromIOK:Oce,fromReader:aD,fromReaderK:jce,fromTask:Hf,fromTaskK:Wce,getMonoid:Xce,getSemigroup:Zce,local:bce,map:fx,of:si,readerTask:Gce,readerTaskSeq:Jce,run:ele,sequenceArray:zce,sequenceSeqArray:Yce,traverseArray:vD,traverseArrayWithIndex:Vce,traverseReadonlyArrayWithIndex:hx,traverseReadonlyArrayWithIndexSeq:mx,traverseReadonlyNonEmptyArrayWithIndex:mD,traverseReadonlyNonEmptyArrayWithIndexSeq:gD,traverseSeqArray:yD,traverseSeqArrayWithIndex:Hce},Symbol.toStringTag,{value:"Module"}));var nle=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())})},rle=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}}},gx=yf(_n),vx=ec(_n),my=bf(We),yx=Cf(We),bx=z(Gn,my),bD=z(Gn,yx),Mu=bx,Jf=my,Cx=jn,Sx=Gn,CD=function(e){return Fu(sB(e))},SD=oA(We),ile=SD,_x=wf(on),ole=_x,_D=_x,ale=_D,ID=$f(on),ule=ID,TD=function(e,t){return function(){return nle(void 0,void 0,void 0,function(){var n;return rle(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e().then(hu)];case 1:return[2,r.sent()];case 2:return n=r.sent(),[2,Zo(t(n))];case 3:return[2]}})})}},sle=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return TD(function(){return e.apply(void 0,n)},t)}},cle=sA(We),lle=$v(_n),fle=Ev(_n),dle=FI(on),xD=nc(on),ple=xD,gy=aA(on),Ale=gy,hle=function(e){return gy(qD(e))},mle=function(e){return gy(QD(e))},gle=uA(on),vle=Ef(We),wD=function(e){var t=CD(e);return function(n){return z(n,t)}},$D=function(e){return function(t){return function(n){return b(n,jA(wD(e)(t)))}}},yle=$D,ED=function(e){return z(e,Sx)},RD=function(e){return Dd(ED(e))},ble=RD,In=function(e,t){return b(e,xx(t))},ku=function(e,t){return b(e,wx(t))},Ix=function(e,t){return b(e,jA(function(n){return b(t,xx(n))}))},Lu=function(e,t){return b(e,jA(t))},vy=function(e,t,n){return b(e,OD(t,n))},yy=function(e,t){return b(e,FD(t))},Tx=function(e,t){return b(e,$x(t))},xx=Sf(We),OD=Tf(We),FD=xf(We),wx=_f(dc),Cle=wx,jA=tc(on),Dd=jA,MD=Dd(P),Sle=MD,$x=If(on),_le=$x,hr=vx,UA=gx,yt="TaskEither";function Ex(e,t){var n=ua(e,Iu(t));return{URI:yt,_E:void 0,map:In,ap:function(r,i){return b(r,n(i))},of:hr}}function kD(e){var t=iA(on,e);return{URI:yt,_E:void 0,map:In,alt:function(n,r){return b(n,t(r))}}}var LD=function(e){var t=Js(e);return{URI:yt,_E:void 0,compact:go(We,t),separate:Aa(We,t,Tu)}};function Ile(e){var t=mf(e),n=LD(e),r=ha(We,t),i=ma(We,t),o=wu(We,t),a=$u(We,t);return{URI:yt,_E:void 0,map:In,compact:n.compact,separate:n.separate,filter:function(u,s){return b(u,r(s))},filterMap:function(u,s){return b(u,i(s))},partition:function(u,s){return b(u,o(s))},partitionMap:function(u,s){return b(u,a(s))}}}var Rx={URI:yt,map:In},Tle=qe(Rx),xle={URI:yt,of:hr},by={URI:yt,map:In,ap:ku},jD=kt(by),wle=jD,UD=Lt(by),$le=UD,Ele={URI:yt,map:In,ap:ku,of:hr},BD={URI:yt,map:In,ap:Ix},WD={URI:yt,map:In,ap:Ix,of:hr},Wi={URI:yt,map:In,ap:ku,chain:Lu},Rle={URI:yt,map:In,ap:ku,chain:Lu,of:hr},Ole={URI:yt,map:In,ap:ku,chain:Lu,of:hr,fromIO:Mu},Fle={URI:yt,map:In,ap:ku,chain:Lu,of:hr,fromIO:Mu,fromTask:Jf},Mle={URI:yt,map:In,ap:ku,chain:Lu,of:hr,throwError:UA},KD=dt(Wi),kle=KD,Lle={URI:yt,bimap:vy,mapLeft:yy},jle={URI:yt,map:In,alt:Tx},Ma={URI:yt,fromEither:Cx},Ule=po(Ma),Ble=Ao(Ma),Wle=Ks(Ma,Wi),PD=sa(Ma,Wi),Kle=PD,DD=ca(Ma,Wi),Ple=DD,Dle=mu(Ma),ND=Ps(Ma,Wi),Nle=ND,qle=Mr(Ma),Cy={URI:yt,fromIO:Mu},qD=yo(Cy),Qle=ga(Cy,Wi),Vle=va(Cy,Wi),Sy={URI:yt,fromIO:Mu,fromTask:Jf},QD=ac(Sy),zle=Rf(Sy,Wi),Hle=Of(Sy,Wi);function Yle(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(Zo(i)):n(hu(o))};e.apply(null,t.concat(r))})}}}var Gle=function(e,t,n){return Ox(e,t,n)},Ox=function(e,t,n){return b(e,Dd(function(r){return b(t(r),OA(function(i){return b(n(r,i),Dd(function(){return jn(i)}))}))}))},Jle=hr(tn),Zle=Ut(Rx),VD=Bt(Wi),Xle=VD,zD=jt(by),efe=zD,Fx=hr(bn),Mx=function(e){return z(zf(e),Fu(rA(fr)))},kx=function(e){var t=Mx(e);return function(n){return vt(n)?t(n):Fx}},Lx=function(e){return function(t){return function(){return Dl(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.right.push(a.right),o)})})},e(0,Fr(t))().then(Zs(Tp)))}}},jx=function(e){var t=Lx(e);return function(n){return vt(n)?t(n):Fx}},tfe=kx,HD=function(e){return kx(function(t,n){return e(n)})},nfe=HD(P),rfe=jx,YD=function(e){return jx(function(t,n){return e(n)})},ife=YD(P),ofe={URI:yt,bimap:vy,mapLeft:yy,map:In,of:hr,ap:ku,chain:Lu,alt:Tx,fromIO:Mu,fromTask:Jf,throwError:UA},afe={URI:yt,bimap:vy,mapLeft:yy,map:In,of:hr,ap:Ix,chain:Lu,alt:Tx,fromIO:Mu,fromTask:Jf,throwError:UA},ufe=nn(BD),sfe=ei(WD),cfe=function(e){return nn(fy)(Xp(e))};function lfe(e){var t=Ex(FA,e),n=kD(e);return{URI:yt,_E:void 0,map:In,ap:t.ap,of:hr,chain:Lu,bimap:vy,mapLeft:yy,alt:n.alt,fromIO:Mu,fromTask:Jf,throwError:UA}}const ffe=Object.freeze(Object.defineProperty({__proto__:null,Alt:jle,ApT:Fx,ApplicativePar:Ele,ApplicativeSeq:WD,ApplyPar:by,ApplySeq:BD,Bifunctor:Lle,Chain:Wi,Do:Jle,FromEither:Ma,FromIO:Cy,FromTask:Sy,Functor:Rx,Monad:Rle,MonadIO:Ole,MonadTask:Fle,MonadThrow:Mle,Pointed:xle,URI:yt,alt:$x,altW:_le,ap:wx,apFirst:jD,apFirstW:wle,apS:zD,apSW:efe,apSecond:UD,apSecondW:$le,apW:Cle,bimap:OD,bind:VD,bindTo:Zle,bindW:Xle,bracket:Gle,bracketW:Ox,chain:jA,chainEitherK:PD,chainEitherKW:Kle,chainFirst:KD,chainFirstEitherK:DD,chainFirstEitherKW:Ple,chainFirstIOK:Vle,chainFirstTaskK:Hle,chainFirstW:kle,chainIOEitherK:ble,chainIOEitherKW:RD,chainIOK:Qle,chainNullableK:dle,chainOptionK:Wle,chainTaskK:zle,chainTaskOptionK:yle,chainTaskOptionKW:$D,chainW:Dd,filterOrElse:ND,filterOrElseW:Nle,flap:Tle,flatten:Sle,flattenW:MD,fold:ole,foldW:ale,fromEither:Cx,fromEitherK:qle,fromIO:Mu,fromIOEither:Sx,fromIOEitherK:ED,fromIOK:qD,fromNullable:lle,fromNullableK:fle,fromOption:Ule,fromOptionK:Ble,fromPredicate:Dle,fromTask:Jf,fromTaskK:QD,fromTaskOption:CD,fromTaskOptionK:wD,getAltTaskValidation:kD,getApplicativeTaskValidation:Ex,getApplyMonoid:sfe,getApplySemigroup:ufe,getCompactable:LD,getFilterable:Ile,getOrElse:ID,getOrElseW:ule,getSemigroup:cfe,getTaskValidation:lfe,left:gx,leftIO:bD,leftTask:yx,map:xx,mapLeft:FD,match:SD,matchE:_x,matchEW:_D,matchW:ile,of:hr,orElse:xD,orElseFirst:gy,orElseFirstIOK:hle,orElseFirstTaskK:mle,orElseFirstW:Ale,orElseW:ple,orLeft:gle,right:vx,rightIO:bx,rightTask:my,sequenceArray:nfe,sequenceSeqArray:ife,swap:vle,taskEither:ofe,taskEitherSeq:afe,taskify:Yle,throwError:UA,toUnion:cle,traverseArray:HD,traverseArrayWithIndex:tfe,traverseReadonlyArrayWithIndex:kx,traverseReadonlyArrayWithIndexSeq:jx,traverseReadonlyNonEmptyArrayWithIndex:Mx,traverseReadonlyNonEmptyArrayWithIndexSeq:Lx,traverseSeqArray:YD,traverseSeqArrayWithIndex:rfe,tryCatch:TD,tryCatchK:sle},Symbol.toStringTag,{value:"Module"}));var ju=bo,_y=yf(kA),Ux=ec(kA),Bx=z(my,ju),GD=z(yx,ju),Wx=function(e){return z(e,vx)},JD=function(e){return z(e,gx)},ZD=bf(mn),dfe=Cf(mn),Kx=z(bx,ju),XD=z(bD,ju),e3=si,t3=Wx,Uu=Kx,Zf=Bx,Px=z(Sx,ju),Dx=function(e){return z(e,Cx)},n3=oA(mn),pfe=n3,Nx=wf(To),Afe=Nx,r3=Nx,hfe=r3,i3=$f(Fa),mfe=i3,gfe=sA(mn),vfe=$v(kA),yfe=Ev(kA),bfe=FI(Fa),Cfe=cA,o3=lA,Sfe=o3,a3=nc(Fa),_fe=a3,u3=aA(Fa),Ife=u3,Tfe=uA(Fa),xfe=Ef(mn),s3=function(e){return z(e,Px)},c3=function(e){return Xf(s3(e))},wfe=c3,qx=function(e){return z(e,ju)},l3=function(e){return Xf(qx(e))},$fe=l3,f3=function(e){return Ey(qx(e))},Efe=f3,Qx=function(e){return z(e,Dx)},d3=function(e){return Xf(Qx(e))},Rfe=d3,p3=function(e){return Ey(Qx(e))},Ofe=p3,Tn=function(e,t){return b(e,BA(t))},Bu=function(e,t){return b(e,Gx(t))},Vx=function(e,t){return b(e,xy(function(n){return b(t,BA(n))}))},Wu=function(e,t){return b(e,xy(t))},zx=function(e,t){return b(e,wy(t))},Iy=function(e,t,n){return b(e,Hx(t,n))},Ty=function(e,t){return b(e,Yx(t))},BA=Sf(mn),Hx=Tf(mn),Yx=xf(mn),Gx=_f(LA),Ffe=Gx,mr=Ux,xy=tc(Fa),Xf=xy,A3=Xf(P),Mfe=A3,wy=If(Fa),h3=wy,WA=_y,ht="ReaderTaskEither",m3=function(e){var t=Js(e);return{URI:ht,_E:void 0,compact:go(mn,t),separate:Aa(mn,t,Tu)}};function kfe(e){var t=mf(e),n=m3(e),r=ha(mn,t),i=ma(mn,t),o=wu(mn,t),a=$u(mn,t);return{URI:ht,_E:void 0,map:Tn,compact:n.compact,separate:n.separate,filter:function(u,s){return b(u,r(s))},filterMap:function(u,s){return b(u,i(s))},partition:function(u,s){return b(u,o(s))},partitionMap:function(u,s){return b(u,a(s))}}}function g3(e,t){var n=ua(ba,Ex(e,t));return{URI:ht,_E:void 0,map:Tn,ap:function(r,i){return b(r,n(i))},of:mr}}function v3(e){var t=iA(Fa,e);return{URI:ht,_E:void 0,map:Tn,alt:function(n,r){return b(n,t(r))}}}var hc={URI:ht,map:Tn},Lfe=qe(hc),Jx={URI:ht,of:mr},$y={URI:ht,map:Tn,ap:Bu},y3=kt($y),jfe=y3,b3=Lt($y),Ufe=b3,Bfe={URI:ht,map:Tn,ap:Bu,of:mr},C3={URI:ht,map:Tn,ap:Vx},S3={URI:ht,map:Tn,ap:Vx,of:mr},Zn={URI:ht,map:Tn,ap:Bu,chain:Wu},Wfe={URI:ht,map:Tn,ap:Bu,chain:Wu,of:mr},Kfe={URI:ht,map:Tn,ap:Bu,chain:Wu,of:mr,fromIO:Uu},Pfe={URI:ht,map:Tn,ap:Bu,chain:Wu,of:mr,fromIO:Uu,fromTask:Zf},Dfe={URI:ht,map:Tn,ap:Bu,chain:Wu,of:mr,throwError:WA},_3=dt(Zn),Ey=_3,Nfe={URI:ht,bimap:Iy,mapLeft:Ty},qfe={URI:ht,map:Tn,alt:zx},ed={URI:ht,fromReader:t3},Qfe=dA(ed),Vfe=pA(ed),zfe=oc(ed),I3=AA(ed,Zn),Hfe=I3,T3=hA(ed,Zn),Yfe=T3,Zx=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return ZD(e.apply(void 0,t))}},x3=function(e){return Xf(Zx(e))},Gfe=x3,w3=function(e){return Ey(Zx(e))},Jfe=w3,ka={URI:ht,fromEither:e3},Zfe=po(ka),Xfe=Ao(ka),ede=Ks(ka,Zn),$3=sa(ka,Zn),tde=$3,E3=ca(ka,Zn),nde=E3,rde=mu(ka),R3=Ps(ka,Zn),ide=R3,ode=Mr(ka),Ry={URI:ht,fromIO:Uu},ade=yo(Ry),ude=ga(Ry,Zn),sde=va(Ry,Zn),Oy={URI:ht,fromIO:Uu,fromTask:Zf},cde=ac(Oy),lde=Rf(Oy,Zn),fde=Of(Oy,Zn);function dde(e,t,n){return O3(e,t,n)}function O3(e,t,n){return function(r){return Ox(e(r),function(i){return t(i)(r)},function(i,o){return n(i,o)(r)})}}var pde=mr(tn),Ade=Ut(hc),F3=Bt(Zn),hde=F3,M3=jt($y),mde=M3,Xx=mr(bn),k3=function(e){return z(ic(e),rc(Mx(fr)))},ew=function(e){var t=k3(e);return function(n){return vt(n)?t(n):Xx}},L3=function(e){return z(ic(e),rc(Lx(fr)))},tw=function(e){var t=L3(e);return function(n){return vt(n)?t(n):Xx}},gde=ew,j3=function(e){return ew(function(t,n){return e(n)})},vde=j3(P),yde=tw,U3=function(e){return tw(function(t,n){return e(n)})},bde=U3(P),Cde={URI:ht,map:Tn,of:mr,ap:Bu,chain:Wu,alt:zx,bimap:Iy,mapLeft:Ty,fromIO:Uu,fromTask:Zf,throwError:WA},Sde={URI:ht,map:Tn,of:mr,ap:Vx,chain:Wu,alt:zx,bimap:Iy,mapLeft:Ty,fromIO:Uu,fromTask:Zf,throwError:WA},_de=nn(C3),Ide=ei(S3),Tde=function(e){return nn(px)(Xp(e))};function xde(e){var t=g3(FA,e),n=v3(e);return{URI:ht,_E:void 0,map:Tn,of:mr,chain:Wu,bimap:Iy,mapLeft:Ty,ap:t.ap,alt:n.alt,fromIO:Uu,fromTask:Zf,throwError:WA}}function wde(e,t){return e(t)()}const $de=Object.freeze(Object.defineProperty({__proto__:null,Alt:qfe,ApT:Xx,ApplicativePar:Bfe,ApplicativeSeq:S3,ApplyPar:$y,ApplySeq:C3,Bifunctor:Nfe,Chain:Zn,Do:pde,FromEither:ka,FromIO:Ry,FromReader:ed,FromTask:Oy,Functor:hc,Monad:Wfe,MonadIO:Kfe,MonadTask:Pfe,MonadThrow:Dfe,Pointed:Jx,URI:ht,alt:wy,altW:h3,ap:Gx,apFirst:y3,apFirstW:jfe,apS:M3,apSW:mde,apSecond:b3,apSecondW:Ufe,apW:Ffe,ask:Qfe,asks:Vfe,asksReaderTaskEither:Sfe,asksReaderTaskEitherW:o3,bimap:Hx,bind:F3,bindTo:Ade,bindW:hde,bracket:dde,bracketW:O3,chain:xy,chainEitherK:$3,chainEitherKW:tde,chainFirst:_3,chainFirstEitherK:E3,chainFirstEitherKW:nde,chainFirstIOK:sde,chainFirstReaderEitherK:Ofe,chainFirstReaderEitherKW:p3,chainFirstReaderK:T3,chainFirstReaderKW:Yfe,chainFirstReaderTaskK:Jfe,chainFirstReaderTaskKW:w3,chainFirstTaskEitherK:Efe,chainFirstTaskEitherKW:f3,chainFirstTaskK:fde,chainFirstW:Ey,chainIOEitherK:wfe,chainIOEitherKW:c3,chainIOK:ude,chainNullableK:bfe,chainOptionK:ede,chainReaderEitherK:Rfe,chainReaderEitherKW:d3,chainReaderK:I3,chainReaderKW:Hfe,chainReaderTaskK:Gfe,chainReaderTaskKW:x3,chainTaskEitherK:$fe,chainTaskEitherKW:l3,chainTaskK:lde,chainW:Xf,filterOrElse:R3,filterOrElseW:ide,flap:Lfe,flatten:Mfe,flattenW:A3,fold:Afe,foldW:hfe,fromEither:e3,fromEitherK:ode,fromIO:Uu,fromIOEither:Px,fromIOEitherK:s3,fromIOK:ade,fromNullable:vfe,fromNullableK:yfe,fromOption:Zfe,fromOptionK:Xfe,fromPredicate:rde,fromReader:t3,fromReaderEither:Dx,fromReaderEitherK:Qx,fromReaderK:zfe,fromReaderTaskK:Zx,fromTask:Zf,fromTaskEither:ju,fromTaskEitherK:qx,fromTaskK:cde,getAltReaderTaskValidation:v3,getApplicativeReaderTaskValidation:g3,getApplyMonoid:Ide,getApplySemigroup:_de,getCompactable:m3,getFilterable:kfe,getOrElse:i3,getOrElseW:mfe,getReaderTaskValidation:xde,getSemigroup:Tde,left:_y,leftIO:XD,leftReader:JD,leftReaderTask:dfe,leftTask:GD,local:Cfe,map:BA,mapLeft:Yx,match:n3,matchE:Nx,matchEW:r3,matchW:pfe,of:mr,orElse:a3,orElseFirst:u3,orElseFirstW:Ife,orElseW:_fe,orLeft:Tfe,readerTaskEither:Cde,readerTaskEitherSeq:Sde,right:Ux,rightIO:Kx,rightReader:Wx,rightReaderTask:ZD,rightTask:Bx,run:wde,sequenceArray:vde,sequenceSeqArray:bde,swap:xfe,throwError:WA,toUnion:gfe,traverseArray:j3,traverseArrayWithIndex:gde,traverseReadonlyArrayWithIndex:ew,traverseReadonlyArrayWithIndexSeq:tw,traverseReadonlyNonEmptyArrayWithIndex:k3,traverseReadonlyNonEmptyArrayWithIndexSeq:L3,traverseSeqArray:U3,traverseSeqArrayWithIndex:yde},Symbol.toStringTag,{value:"Module"}));var B3={equals:function(e,t){return e===t}},W3={concat:function(e,t){return e+t}},K3="",Ede={concat:W3.concat,empty:K3},V={equals:B3.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},Rde={show:function(e){return JSON.stringify(e)}},Ode=function(e){return typeof e=="string"},Fde=function(e){return e.toUpperCase()},Mde=function(e){return e.toLowerCase()},kde=function(e,t){return function(n){return n.replace(e,t)}},Lde=function(e){return e.trim()},jde=function(e){return e.trimLeft()},Ude=function(e){return e.trimRight()},Bde=function(e,t){return function(n){return n.slice(e,t)}},Wde=function(e){return e.length===0},Kde=function(e){return e.length},Pde=function(e){return function(t){var n=t.split(e);return ho(n)?n:[t]}},Dde=function(e,t){return function(n){return n.includes(e,t)}},Nde=function(e,t){return function(n){return n.startsWith(e,t)}},qde=function(e,t){return function(n){return n.endsWith(e,t)}};const Qde=Object.freeze(Object.defineProperty({__proto__:null,Eq:B3,Monoid:Ede,Ord:V,Semigroup:W3,Show:Rde,empty:K3,endsWith:qde,includes:Dde,isEmpty:Wde,isString:Ode,replace:kde,size:Kde,slice:Bde,split:Pde,startsWith:Nde,toLowerCase:Mde,toUpperCase:Fde,trim:Lde,trimLeft:jde,trimRight:Ude},Symbol.toStringTag,{value:"Module"}));var Vde=function(e){return Object.assign({},e)},zde=function(e){return Object.assign({},e)},P3=function(e){return Object.keys(e).length},uo=function(e){for(var t in e)if(ft.call(e,t))return!1;return!0},td=function(e){return function(t){return Object.keys(t).sort(e.compare)}},Hde=td(V);function Fy(e){if(typeof e=="function")return Fy(V)(e);var t=td(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 nw=Fy(V)(function(e,t){return[e,t]});function Yde(e){return function(t){var n=nw(t),r=n.length;return e.unfold(0,function(i){return i<r?fe([n[i],i+1]):ye})}}var rw=function(e,t){return function(n){if(ft.call(n,e)&&n[e]===t)return n;var r=Object.assign({},n);return r[e]=t,r}},ea=function(e,t){return ft.call(t,e)};function iw(e){return function(t){if(!ft.call(t,e))return t;var n=Object.assign({},t);return delete n[e],n}}var Gde=function(e,t){return function(n){if(!ea(e,n))return ye;if(n[e]===t)return fe(n);var r=Object.assign({},n);return r[e]=t,fe(r)}},Jde=function(e,t){return function(n){if(!ea(e,n))return ye;var r=t(n[e]);if(r===n[e])return fe(n);var i=Object.assign({},n);return i[e]=r,fe(i)}};function Zde(e){var t=iw(e);return function(n){var r=Cs(e,n);return Nt(r)?ye:fe([r.value,t(n)])}}function My(e){return function(t,n){if(n===void 0){var r=My(e);return function(o){return r(o,t)}}for(var i in t)if(!ft.call(n,i)||!e.equals(t[i],n[i]))return!1;return!0}}function Cs(e,t){return t===void 0?function(n){return Cs(e,n)}:ft.call(t,e)?fe(t[e]):ye}var KA={};function ky(e){return function(t){var n={};for(var r in t)ft.call(t,r)&&(n[r]=e(r,t[r]));return n}}function ow(e){return ky(function(t,n){return e(n)})}function bl(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===2)return bl(V).apply(void 0,e);var n=td(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 Cl(e){if("compare"in e){var t=td(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 Cl(V)(e)}function Sl(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===2)return Sl(V).apply(void 0,e);var n=td(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 D3=function(e,t){var n;return n={},n[e]=t,n};function N3(e){var t=DA(V)(e);return function(n){return function(r){return t(r,n)}}}function Ly(e){var t=xo(V)(e);return function(n){return function(r){return t(r,n)}}}function nd(e){return PA(V)(e)}var Xde=function(e){var t=Ly(e);return function(n){return function(r){return e.map(b(r,t(n)),La)}}},epe=function(e){var t=Ly(e);return function(n){return function(r){return e.map(b(r,t(n)),ja)}}};function jy(e){return function(t){var n={},r={};for(var i in t)if(ft.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 Re(n,r)}}function Uy(e){return function(t){var n={},r={};for(var i in t)if(ft.call(t,i)){var o=t[i];e(i,o)?r[i]=o:n[i]=o}return Re(n,r)}}function By(e){return function(t){var n={};for(var r in t)if(ft.call(t,r)){var i=e(r,t[r]);_t(i)&&(n[r]=i.value)}return n}}function Wy(e){return function(t){var n={},r=!1;for(var i in t)if(ft.call(t,i)){var o=t[i];e(i,o)?n[i]=o:r=!0}return r?n:t}}function q3(e,t){var n=aw(e,t);return function(r){return n(r,P)}}function aw(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]=ft.call(i,u)?e.concat(i[u],s):s,i})}}var tpe=nw,npe=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 Q3(e){return function(t){for(var n in t)if(!e(t[n]))return!1;return!0}}function V3(e){return function(t){for(var n in t)if(e(t[n]))return!0;return!1}}function uw(e){return function(t,n){if(n===void 0){var r=uw(e);return function(o){return r(t,o)}}for(var i in n)if(e.equals(n[i],t))return!0;return!1}}var sw=function(e){return function(t){return function(n){if(uo(n))return t;if(uo(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}}},cw=function(e){return function(t){return function(n){if(uo(n)||uo(t))return KA;var r={};for(var i in n)ea(i,t)&&(r[i]=e.concat(n[i],t[i]));return r}}},lw=function(e){return function(t){if(uo(t))return e;if(uo(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}},jr=function(e,t){return b(e,ow(t))},mc=function(e,t){return b(e,ky(t))},Ur=function(e){var t=Nd(e);return function(n,r,i){return b(n,t(r,i))}},Br=function(e){return function(t){var n=qd(e)(t);return function(r,i){return b(r,n(i))}}},Wr=function(e){var t=Qd(e);return function(n,r,i){return b(n,t(r,i))}},gc=function(e,t){return b(e,fw(t))},vc=function(e,t){return b(e,dw(t))},yc=function(e,t){return b(e,pw(t))},bc=function(e,t){return b(e,Aw(t))},Cc=function(e){var t=bl(e);return function(n,r,i){return b(n,t(r,i))}},Sc=function(e){var t=Cl(e);return function(n){var r=t(n);return function(i,o){return b(i,r(o))}}},_c=function(e){var t=Sl(e);return function(n,r,i){return b(n,t(r,i))}},Ky=function(e,t){return b(e,jy(t))},Py=function(e,t){return b(e,Uy(t))},Dy=function(e,t){return b(e,By(t))},Ny=function(e,t){return b(e,Wy(t))},xo=function(e){var t=DA(e);return function(n){var r=t(n);return function(i,o){return r(i,z(fr,o))}}},PA=function(e){var t=xo(e);return function(n){var r=t(n);return function(i){return r(i,P)}}},DA=function(e){return function(t){var n=td(e);return function(r,i){var o=n(r);if(o.length===0)return t.of(KA);for(var a=t.of({}),u=function(f){a=t.ap(t.map(a,function(p){return function(A){var h;return Object.assign({},p,(h={},h[f]=A,h))}}),i(f,r[f]))},s=0,c=o;s<c.length;s++){var l=c[s];u(l)}return a}}},fw=function(e){return Wy(function(t,n){return e(n)})},dw=function(e){return By(function(t,n){return e(n)})},pw=function(e){return Uy(function(t,n){return e(n)})},Aw=function(e){return jy(function(t,n){return e(n)})};function Nd(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===1){var n=bl(e[0]);return function(r,i){return n(r,function(o,a,u){return i(a,u)})}}return Nd(V).apply(void 0,e)}function qd(e){if("compare"in e){var t=Cl(e);return function(n){var r=t(n);return function(i){return r(function(o,a){return i(a)})}}}return qd(V)(e)}function Qd(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===1){var n=Sl(e[0]);return function(r,i){return n(r,function(o,a,u){return i(a,u)})}}return Qd(V).apply(void 0,e)}var La=function(e){var t={};for(var n in e)if(ft.call(e,n)){var r=e[n];_t(r)&&(t[n]=r.value)}return t},ja=function(e){var t={},n={};for(var r in e)if(ft.call(e,r)){var i=e[r];Xt(i)?t[r]=i.left:n[r]=i.right}return Re(t,n)},xn="ReadonlyRecord";function mm(e){return"compare"in e?function(t){return{show:function(n){var r=Fy(e)(function(i,o){return"".concat(JSON.stringify(i),": ").concat(t.show(o))})(n).join(", ");return r===""?"{}":"{ ".concat(r," }")}}}:mm(V)(e)}function z3(e){var t=My(e);return ti(function(n,r){return t(n)(r)&&t(r)(n)})}function H3(e){return{concat:function(t,n){if(uo(t))return n;if(uo(n))return t;var r=Object.assign({},t);for(var i in n)ft.call(n,i)&&(r[i]=ft.call(t,i)?e.concat(t[i],n[i]):n[i]);return r},empty:KA}}var Y3={URI:xn,map:jr},rpe=qe(Y3),ipe={URI:xn,map:jr,mapWithIndex:mc},ope=function(e){return{URI:xn,reduce:Ur(e),foldMap:Br(e),reduceRight:Wr(e)}},ape=function(e){return{URI:xn,reduce:Ur(e),foldMap:Br(e),reduceRight:Wr(e),reduceWithIndex:Cc(e),foldMapWithIndex:Sc(e),reduceRightWithIndex:_c(e)}},Vd={URI:xn,compact:La,separate:ja},upe={URI:xn,map:jr,compact:La,separate:ja,filter:gc,filterMap:vc,partition:yc,partitionMap:bc},spe={URI:xn,map:jr,mapWithIndex:mc,compact:La,separate:ja,filter:gc,filterMap:vc,partition:yc,partitionMap:bc,filterMapWithIndex:Dy,filterWithIndex:Ny,partitionMapWithIndex:Ky,partitionWithIndex:Py},G3=function(e){return{URI:xn,map:jr,reduce:Ur(e),foldMap:Br(e),reduceRight:Wr(e),traverse:xo(e),sequence:PA(e)}},cpe=function(e){return{URI:xn,map:jr,mapWithIndex:mc,reduce:Ur(e),foldMap:Br(e),reduceRight:Wr(e),reduceWithIndex:Cc(e),foldMapWithIndex:Sc(e),reduceRightWithIndex:_c(e),traverse:xo(e),sequence:PA(e),traverseWithIndex:DA(e)}},lpe=function(e){var t=G3(e);return{URI:xn,map:jr,reduce:Ur(e),foldMap:Br(e),reduceRight:Wr(e),traverse:t.traverse,sequence:t.sequence,compact:La,separate:ja,filter:gc,filterMap:vc,partition:yc,partitionMap:bc,wither:ki(t,Vd),wilt:Mi(t,Vd)}},J3=function(e){var t=sw(e);return{concat:function(n,r){return t(r)(n)}}},fpe=function(e){return{concat:J3(e).concat,empty:KA}},dpe=function(e){var t=cw(e);return{concat:function(n,r){return t(r)(n)}}},ppe=function(){return{concat:function(e,t){return lw(t)(e)}}},Ape={URI:xn,reduce:Ur(V),foldMap:Br(V),reduceRight:Wr(V)},hpe={URI:xn,reduce:Ur(V),foldMap:Br(V),reduceRight:Wr(V),reduceWithIndex:Cc(V),foldMapWithIndex:Sc(V),reduceRightWithIndex:_c(V)},hw={URI:xn,map:jr,reduce:Ur(V),foldMap:Br(V),reduceRight:Wr(V),traverse:xo(V),sequence:nd},mpe={URI:xn,map:jr,mapWithIndex:mc,reduce:Ur(V),foldMap:Br(V),reduceRight:Wr(V),reduceWithIndex:Cc(V),foldMapWithIndex:Sc(V),reduceRightWithIndex:_c(V),traverse:xo(V),sequence:nd,traverseWithIndex:DA(V)},Z3=ki(hw,Vd),X3=Mi(hw,Vd),gpe={URI:xn,map:jr,reduce:Ur(V),foldMap:Br(V),reduceRight:Wr(V),traverse:xo(V),sequence:nd,compact:La,separate:ja,filter:gc,filterMap:vc,partition:yc,partitionMap:bc,wither:Z3,wilt:X3},mw=rw;function e6(e,t){return ft.call(t===void 0?this:t,e)}var vpe={URI:xn,map:jr,reduce:Ur(V),foldMap:Br(V),reduceRight:Wr(V),traverse:xo(V),sequence:nd,compact:La,separate:ja,filter:gc,filterMap:vc,partition:yc,partitionMap:bc,mapWithIndex:mc,reduceWithIndex:Cc(V),foldMapWithIndex:Sc(V),reduceRightWithIndex:_c(V),filterMapWithIndex:Dy,filterWithIndex:Ny,partitionMapWithIndex:Ky,partitionWithIndex:Py,traverseWithIndex:DA(V),wither:Z3,wilt:X3};const ype=Object.freeze(Object.defineProperty({__proto__:null,Compactable:Vd,Filterable:upe,FilterableWithIndex:spe,Foldable:Ape,FoldableWithIndex:hpe,Functor:Y3,FunctorWithIndex:ipe,Traversable:hw,TraversableWithIndex:mpe,URI:xn,Witherable:gpe,_filter:gc,_filterMap:vc,_filterMapWithIndex:Dy,_filterWithIndex:Ny,_foldMap:Br,_foldMapWithIndex:Sc,_map:jr,_mapWithIndex:mc,_partition:yc,_partitionMap:bc,_partitionMapWithIndex:Ky,_partitionWithIndex:Py,_reduce:Ur,_reduceRight:Wr,_reduceRightWithIndex:_c,_reduceWithIndex:Cc,_sequence:PA,_traverse:xo,collect:Fy,compact:La,deleteAt:iw,difference:lw,elem:uw,empty:KA,every:Q3,filter:fw,filterMap:dw,filterMapWithIndex:By,filterWithIndex:Wy,flap:rpe,foldMap:qd,foldMapWithIndex:Cl,fromEntries:npe,fromFoldable:q3,fromFoldableMap:aw,fromRecord:Vde,getDifferenceMagma:ppe,getEq:z3,getFoldable:ope,getFoldableWithIndex:ape,getIntersectionSemigroup:dpe,getMonoid:H3,getShow:mm,getTraversable:G3,getTraversableWithIndex:cpe,getUnionMonoid:fpe,getUnionSemigroup:J3,getWitherable:lpe,has:ea,hasOwnProperty:e6,insertAt:mw,intersection:cw,isEmpty:uo,isSubrecord:My,keys:Hde,lookup:Cs,map:ow,mapWithIndex:ky,modifyAt:Jde,partition:pw,partitionMap:Aw,partitionMapWithIndex:jy,partitionWithIndex:Uy,pop:Zde,readonlyRecord:vpe,reduce:Nd,reduceRight:Qd,reduceRightWithIndex:Sl,reduceWithIndex:bl,separate:ja,sequence:nd,singleton:D3,size:P3,some:V3,toEntries:tpe,toReadonlyArray:nw,toRecord:zde,toUnfoldable:Yde,traverse:Ly,traverseWithIndex:N3,union:sw,updateAt:Gde,upsertAt:rw,wilt:epe,wither:Xde},Symbol.toStringTag,{value:"Module"}));var bpe=function(e){return new Set(e)},Cpe=function(e){return new Set([e])},t6=function(e){return function(t){for(var n=t.length,r=new Set,i=vn(e),o=0;o<n;o++){var a=t[o];i(a,r)||r.add(a)}return r}};function Spe(e){return new Set(e)}function _pe(e){var t=vn(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 Ipe(e){var t=vn(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 gw(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 Tpe(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 Re(o,i)}}function vw(e){var t=vn(e);return function(n,r){if(r===void 0){var i=vw(e);return function(a){return i(n,a)}}if(zd(n))return r;if(zd(r))return n;var o=new Set(n);return r.forEach(function(a){t(a,o)||o.add(a)}),o}}function yw(e){var t=vn(e);return function(n,r){if(r===void 0){var i=yw(e);return function(a){return i(a,n)}}if(zd(n)||zd(r))return Cw;var o=new Set;return n.forEach(function(a){t(a,r)&&o.add(a)}),o}}function xpe(e,t){return function(n){return function(r){for(var i=r.values(),o,a=new Set,u=new Set,s=vn(e),c=vn(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 Re(a,u)}}}function bw(e){var t=vn(e);return function(n,r){if(r===void 0){var i=bw(e);return function(o){return i(o,n)}}return gw(function(o){return!t(o,r)})(n)}}function n6(e){var t=qy(e);return function(n,r){return function(i){return t(i).reduce(r,n)}}}function r6(e,t){var n=qy(e);return function(r){return function(i){return n(i).reduce(function(o,a){return t.concat(o,r(a))},t.empty)}}}var i6=function(e){var t=qy(e);return function(n,r){return function(i){return t(i).reduceRight(function(o,a){return r(a,o)},n)}}};function o6(e){var t=vn(e);return function(n){return function(r){if(t(n)(r))return r;var i=new Set(r);return i.add(n),i}}}var a6=function(e){return function(t){return function(n){return gw(function(r){return!e.equals(t,r)})(n)}}},wpe=function(e){var t=vn(e),n=a6(e),r=o6(e);return function(i){return function(o){return(t(i,o)?n:r)(i)(o)}}},$pe=function(e){return u6(e)(P)};function Epe(e,t){return function(n){var r=vn(e),i=vn(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}}),Re(o,a)}}function u6(e){var t=vn(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 Cw=new Set,zd=function(e){return e.size===0},Rpe=function(e){return e.size},Sw=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 _w(e){return Kd(Sw(Kd(e)))}function NA(e){var t=vn(e);return function(n,r){if(r===void 0){var i=NA(e);return function(o){return i(o,n)}}return _w(function(o){return t(o,r)})(n)}}function vn(e){return function(t,n){if(n===void 0){var r=vn(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 qy=function(e){return function(t){var n=[];return t.forEach(function(r){return n.push(r)}),n.sort(e.compare)}},Ope="ReadonlySet";function s6(e){return{show:function(t){var n=[];return t.forEach(function(r){n.push(e.show(r))}),"new Set([".concat(n.sort().join(", "),"])")}}}function c6(e){var t=NA(e);return ti(function(n,r){return t(n,r)&&t(r,n)})}var l6=function(e){return{concat:vw(e)}},Fpe=function(e){return{concat:l6(e).concat,empty:Cw}},Mpe=function(e){return{concat:yw(e)}},kpe=function(e){return{concat:bw(e)}},Lpe=t6;const jpe=Object.freeze(Object.defineProperty({__proto__:null,URI:Ope,chain:Ipe,compact:$pe,difference:bw,elem:vn,empty:Cw,every:_w,filter:gw,filterMap:u6,foldMap:r6,fromArray:Lpe,fromReadonlyArray:t6,fromSet:bpe,getDifferenceMagma:kpe,getEq:c6,getIntersectionSemigroup:Mpe,getShow:s6,getUnionMonoid:Fpe,getUnionSemigroup:l6,insert:o6,intersection:yw,isEmpty:zd,isSubset:NA,map:_pe,partition:Tpe,partitionMap:xpe,reduce:n6,reduceRight:i6,remove:a6,separate:Epe,singleton:Cpe,size:Rpe,some:Sw,toReadonlyArray:qy,toSet:Spe,toggle:wpe,union:vw},Symbol.toStringTag,{value:"Module"}));function en(e){return e[0]}function Fn(e){return e[1]}var Upe=function(e){return[Fn(e),en(e)]};function Iw(e){return{URI:Kr,_E:void 0,map:qA,ap:function(t,n){return[en(t)(en(n)),e.concat(Fn(t),Fn(n))]}}}var f6=function(e){return function(t){return[t,e.empty]}};function Bpe(e){var t=Iw(e);return{URI:Kr,_E:void 0,map:t.map,ap:t.ap,of:f6(e)}}function Tw(e){var t=Iw(e);return{URI:Kr,_E:void 0,map:t.map,ap:t.ap,chain:function(n,r){var i=r(en(n)),o=i[0],a=i[1];return[o,e.concat(Fn(n),a)]}}}function Wpe(e){var t=Tw(e);return{URI:Kr,_E:void 0,map:t.map,ap:t.ap,chain:t.chain,of:f6(e)}}function Kpe(e){var t=function(r,i){for(var o=i(r),a=e.empty,u=en(o);u._tag==="Left";)a=e.concat(a,Fn(o)),o=i(u.left),u=en(o);return[u.right,e.concat(a,Fn(o))]},n=Tw(e);return{URI:Kr,_E:void 0,map:n.map,ap:n.ap,chain:n.chain,chainRec:t}}var d6=function(e,t){return b(e,v6(t))},qA=function(e,t){return b(e,Ew(t))},p6=function(e,t,n){return b(e,g6(t,n))},A6=function(e,t){return b(e,Rw(t))},h6=function(e,t){return b(e,Ow(t))},xw=function(e,t,n){return b(e,Fw(t,n))},ww=function(e){var t=Mw();return function(n,r){return b(n,t(r))}},$w=function(e,t,n){return b(e,kw(t,n))},m6=function(e){var t=y6(e);return function(n,r){return b(n,t(r))}},g6=function(e,t){return function(n){return[t(en(n)),e(Fn(n))]}},Ew=function(e){return function(t){return[e(en(t)),Fn(t)]}},Rw=function(e){return function(t){return[en(t),e(Fn(t))]}},v6=function(e){return function(t){return[en(t),Fn(e)]}},Ow=function(e){return function(t){return[e(t),Fn(t)]}},Qy=en,Ppe=Ow(P),Fw=function(e,t){return function(n){return t(e,en(n))}},Mw=function(){return function(e){return function(t){return e(en(t))}}},kw=function(e,t){return function(n){return t(en(n),e)}},y6=function(e){return function(t){return function(n){return e.map(t(en(n)),function(r){return[r,Fn(n)]})}}},Lw=function(e){return function(t){return e.map(en(t),function(n){return[n,Fn(t)]})}},Kr="ReadonlyTuple",b6={URI:Kr,map:qA},Dpe=qe(b6),Npe={URI:Kr,bimap:p6,mapLeft:A6},qpe={URI:Kr,compose:d6},Qpe={URI:Kr,map:qA,extend:h6,extract:Qy},Vpe={URI:Kr,reduce:xw,foldMap:ww,reduceRight:$w},zpe={URI:Kr,map:qA,reduce:xw,foldMap:ww,reduceRight:$w,traverse:m6,sequence:Lw},Hpe=Ew,Ype=Rw,Gpe={URI:Kr,compose:d6,map:qA,bimap:p6,mapLeft:A6,extract:Qy,extend:h6,reduce:xw,foldMap:ww,reduceRight:$w,traverse:m6,sequence:Lw};const Jpe=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:Npe,Comonad:Qpe,Foldable:Vpe,Functor:b6,Semigroupoid:qpe,Traversable:zpe,URI:Kr,bimap:g6,compose:v6,duplicate:Ppe,extend:Ow,extract:Qy,flap:Dpe,foldMap:Mw,fst:en,getApplicative:Bpe,getApply:Iw,getChain:Tw,getChainRec:Kpe,getMonad:Wpe,map:Hpe,mapFst:Ew,mapLeft:Ype,mapSnd:Rw,readonlyTuple:Gpe,reduce:Fw,reduceRight:kw,sequence:Lw,snd:Fn,swap:Upe,traverse:y6},Symbol.toStringTag,{value:"Module"}));var _l=function(){return _l=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},_l.apply(this,arguments)},Zpe=P3,Ss=uo,jw=function(e){return function(t){return Object.keys(t).sort(e.compare)}},Xpe=jw(V);function Uw(e){if(typeof e=="function")return Uw(V)(e);var t=jw(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 Bw=Uw(V)(function(e,t){return[e,t]});function eAe(e){return function(t){var n=Bw(t),r=n.length;return e.unfold(0,function(i){return i<r?fe([n[i],i+1]):ye})}}var C6=rw,S6=ea;function _6(e){return function(t){if(!ft.call(t,e))return t;var n=Object.assign({},t);return delete n[e],n}}var tAe=function(e,t){return I6(e,function(){return t})},I6=function(e,t){return function(n){if(!S6(e,n))return ye;var r=Object.assign({},n);return r[e]=t(n[e]),fe(r)}};function nAe(e){var t=_6(e);return function(n){var r=T6(e,n);return Nt(r)?ye:fe([r.value,t(n)])}}var rAe=My,T6=Cs,iAe=ky,oAe=ow;function aAe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===1?bl(e[0]):bl(V).apply(void 0,e)}function uAe(e){return"compare"in e?Cl(e):Cl(V)(e)}function sAe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===1?Sl(e[0]):Sl(V).apply(void 0,e)}var cAe=D3;function lAe(e){return N3(e)}function Ww(e){return Ly(e)}function QA(e){return nd(e)}var fAe=function(e){var t=Ww(e);return function(n){return function(r){return e.map(b(r,t(n)),Ku)}}},dAe=function(e){var t=Ww(e);return function(n){return function(r){return e.map(b(r,t(n)),Pu)}}},pAe=jy;function AAe(e){return Uy(e)}var hAe=By;function mAe(e){return Wy(e)}function x6(e,t){return q3(e,t)}var gAe=Bw,vAe=function(e){return x6(Cg(),HU)(e)};function yAe(e,t){return aw(e,t)}var bAe=Q3,CAe=V3,SAe=uw,w6=function(e){var t=sw(e);return function(n){return function(r){return Ss(r)?_l({},n):Ss(n)?_l({},r):t(n)(r)}}},$6=function(e){return function(t){return function(n){return Ss(n)||Ss(t)?{}:cw(e)(t)(n)}}},E6=function(e){return function(t){return Ss(t)?_l({},e):Ss(e)?_l({},t):lw(e)(t)}},Ki=jr,VA=mc,Pi=Ur,Di=Br,Ni=Wr,zA=gc,HA=vc,YA=yc,GA=bc,JA=Cc,ZA=Sc,XA=_c,R6=Ky,O6=Py,F6=Dy,M6=Ny,rd=xo,k6=PA,Kw=function(e){return function(t){var n=jw(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(p){return function(A){return p[f]=A,p}}),i(f,r[f]))},s=0,c=o;s<c.length;s++){var l=c[s];u(l)}return a}}},_Ae=fw,IAe=dw,TAe=pw,xAe=Aw;function wAe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===1?Nd(e[0]):Nd(V).apply(void 0,e)}function $Ae(e){return"compare"in e?qd(e):qd(V)(e)}function EAe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===1?Qd(e[0]):Qd(V).apply(void 0,e)}var Ku=La,Pu=ja,wn="Record";function RAe(e){return"compare"in e?mm(e):mm(V)(e)}var OAe=z3,FAe=H3,L6={URI:wn,map:Ki},MAe=qe(L6),kAe={URI:wn,map:Ki,mapWithIndex:VA},LAe=function(e){return{URI:wn,reduce:Pi(e),foldMap:Di(e),reduceRight:Ni(e)}},jAe=function(e){return{URI:wn,reduce:Pi(e),foldMap:Di(e),reduceRight:Ni(e),reduceWithIndex:JA(e),foldMapWithIndex:ZA(e),reduceRightWithIndex:XA(e)}},Hd={URI:wn,compact:Ku,separate:Pu},UAe={URI:wn,map:Ki,compact:Ku,separate:Pu,filter:zA,filterMap:HA,partition:YA,partitionMap:GA},BAe={URI:wn,map:Ki,mapWithIndex:VA,compact:Ku,separate:Pu,filter:zA,filterMap:HA,partition:YA,partitionMap:GA,filterMapWithIndex:F6,filterWithIndex:M6,partitionMapWithIndex:R6,partitionWithIndex:O6},j6=function(e){return{URI:wn,map:Ki,reduce:Pi(e),foldMap:Di(e),reduceRight:Ni(e),traverse:rd(e),sequence:k6(e)}},WAe=function(e){return{URI:wn,map:Ki,mapWithIndex:VA,reduce:Pi(e),foldMap:Di(e),reduceRight:Ni(e),reduceWithIndex:JA(e),foldMapWithIndex:ZA(e),reduceRightWithIndex:XA(e),traverse:rd(e),sequence:k6(e),traverseWithIndex:Kw(e)}},KAe=function(e){var t=j6(e);return{URI:wn,map:Ki,reduce:Pi(e),foldMap:Di(e),reduceRight:Ni(e),traverse:t.traverse,sequence:t.sequence,compact:Ku,separate:Pu,filter:zA,filterMap:HA,partition:YA,partitionMap:GA,wither:ki(t,Hd),wilt:Mi(t,Hd)}},U6=function(e){var t=w6(e);return{concat:function(n,r){return t(r)(n)}}},PAe=function(e){return{concat:U6(e).concat,empty:{}}},DAe=function(e){var t=$6(e);return{concat:function(n,r){return t(r)(n)}}},NAe=function(){return{concat:function(e,t){return E6(t)(e)}}},qAe={URI:wn,reduce:Pi(V),foldMap:Di(V),reduceRight:Ni(V)},QAe={URI:wn,reduce:Pi(V),foldMap:Di(V),reduceRight:Ni(V),reduceWithIndex:JA(V),foldMapWithIndex:ZA(V),reduceRightWithIndex:XA(V)},Pw={URI:wn,map:Ki,reduce:Pi(V),foldMap:Di(V),reduceRight:Ni(V),traverse:rd(V),sequence:QA},VAe={URI:wn,map:Ki,mapWithIndex:VA,reduce:Pi(V),foldMap:Di(V),reduceRight:Ni(V),reduceWithIndex:JA(V),foldMapWithIndex:ZA(V),reduceRightWithIndex:XA(V),traverse:rd(V),sequence:QA,traverseWithIndex:Kw(V)},B6=ki(Pw,Hd),W6=Mi(Pw,Hd),zAe={URI:wn,map:Ki,reduce:Pi(V),foldMap:Di(V),reduceRight:Ni(V),traverse:rd(V),sequence:QA,compact:Ku,separate:Pu,filter:zA,filterMap:HA,partition:YA,partitionMap:GA,wither:B6,wilt:W6},HAe={},YAe=C6,GAe=e6,JAe={URI:wn,map:Ki,reduce:Pi(V),foldMap:Di(V),reduceRight:Ni(V),traverse:rd(V),sequence:QA,compact:Ku,separate:Pu,filter:zA,filterMap:HA,partition:YA,partitionMap:GA,mapWithIndex:VA,reduceWithIndex:JA(V),foldMapWithIndex:ZA(V),reduceRightWithIndex:XA(V),filterMapWithIndex:F6,filterWithIndex:M6,partitionMapWithIndex:R6,partitionWithIndex:O6,traverseWithIndex:Kw(V),wither:B6,wilt:W6};const ZAe=Object.freeze(Object.defineProperty({__proto__:null,Compactable:Hd,Filterable:UAe,FilterableWithIndex:BAe,Foldable:qAe,FoldableWithIndex:QAe,Functor:L6,FunctorWithIndex:kAe,Traversable:Pw,TraversableWithIndex:VAe,URI:wn,Witherable:zAe,collect:Uw,compact:Ku,deleteAt:_6,difference:E6,elem:SAe,empty:HAe,every:bAe,filter:_Ae,filterMap:IAe,filterMapWithIndex:hAe,filterWithIndex:mAe,flap:MAe,foldMap:$Ae,foldMapWithIndex:uAe,fromEntries:vAe,fromFoldable:x6,fromFoldableMap:yAe,getDifferenceMagma:NAe,getEq:OAe,getFoldable:LAe,getFoldableWithIndex:jAe,getIntersectionSemigroup:DAe,getMonoid:FAe,getShow:RAe,getTraversable:j6,getTraversableWithIndex:WAe,getUnionMonoid:PAe,getUnionSemigroup:U6,getWitherable:KAe,has:S6,hasOwnProperty:GAe,insertAt:YAe,intersection:$6,isEmpty:Ss,isSubrecord:rAe,keys:Xpe,lookup:T6,map:oAe,mapWithIndex:iAe,modifyAt:I6,partition:TAe,partitionMap:xAe,partitionMapWithIndex:pAe,partitionWithIndex:AAe,pop:nAe,record:JAe,reduce:wAe,reduceRight:EAe,reduceRightWithIndex:sAe,reduceWithIndex:aAe,separate:Pu,sequence:QA,singleton:cAe,size:Zpe,some:CAe,toArray:Bw,toEntries:gAe,toUnfoldable:eAe,traverse:Ww,traverseWithIndex:lAe,union:w6,updateAt:tAe,upsertAt:C6,wilt:dAe,wither:fAe},Symbol.toStringTag,{value:"Module"}));var XAe=function(e){return function(t){return _t(e(t))}},ehe=function(e){return function(t){return HC(e(t))}},the=function(){return function(e){return!0}},nhe=function(e){return function(t){return!e(t)}},rhe=function(e){return function(t){return function(n){return t(n)||e(n)}}},ihe=function(e){return function(t){return function(n){return t(n)&&e(n)}}},ohe=function(){return function(e){return!1}},ahe=function(e){return function(t){return function(n){return t(n)&&e(n)}}};const uhe=Object.freeze(Object.defineProperty({__proto__:null,and:ihe,compose:ahe,fromEitherK:ehe,fromOptionK:XAe,id:the,not:nhe,or:rhe,zero:ohe},Symbol.toStringTag,{value:"Module"}));var K6=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])})}}},she=function(e){return function(t){return e.sub(e.zero,t)}},che=K6,lhe=xk;const fhe=Object.freeze(Object.defineProperty({__proto__:null,getFunctionRing:lhe,getTupleRing:che,negate:she,tuple:K6},Symbol.toStringTag,{value:"Module"})),dhe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var phe=QC;const Ahe=Object.freeze(Object.defineProperty({__proto__:null,getFunctionSemiring:phe},Symbol.toStringTag,{value:"Module"}));var hhe=s6,mhe=c6;function ghe(e){var t=ur(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 vhe(e){var t=ur(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 Dw(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 yhe(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 Re(o,i)}}function Nw(e){var t=ur(e);return function(n,r){if(r===void 0){var i=Nw(e);return function(a){return i(n,a)}}if(Yd(n))return r;if(Yd(r))return n;var o=new Set(n);return r.forEach(function(a){t(a,o)||o.add(a)}),o}}function qw(e){var t=ur(e);return function(n,r){if(r===void 0){var i=qw(e);return function(a){return i(a,n)}}if(Yd(n)||Yd(r))return new Set;var o=new Set;return n.forEach(function(a){t(a,r)&&o.add(a)}),o}}function bhe(e,t){return function(n){return function(r){for(var i=r.values(),o,a=new Set,u=new Set,s=ur(e),c=ur(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 Re(a,u)}}}function Qw(e){var t=ur(e);return function(n,r){if(r===void 0){var i=Qw(e);return function(o){return i(o,n)}}return Dw(function(o){return!t(o,r)})(n)}}var P6=function(e){return{concat:Nw(e)}},Che=function(e){return{concat:P6(e).concat,empty:new Set}},She=function(e){return{concat:qw(e)}},_he=function(e){return{concat:Qw(e)}},Ihe=n6,The=r6,xhe=i6,whe=function(e){return new Set([e])};function D6(e){var t=ur(e);return function(n){return function(r){if(t(n)(r))return r;var i=new Set(r);return i.add(n),i}}}var N6=function(e){return function(t){return function(n){return Dw(function(r){return!e.equals(t,r)})(n)}}},$he=function(e){var t=ur(e),n=N6(e),r=D6(e);return function(i){return function(o){return(t(i,o)?n:r)(i)(o)}}},q6=function(e){return function(t){for(var n=t.length,r=new Set,i=ur(e),o=0;o<n;o++){var a=t[o];i(a,r)||r.add(a)}return r}},Ehe=function(e){return Q6(e)(P)};function Rhe(e,t){return function(n){var r=ur(e),i=ur(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}}),Re(o,a)}}function Q6(e){var t=ur(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 Ohe=new Set,Yd=function(e){return e.size===0},Fhe=function(e){return e.size},Mhe=Sw,V6=_w,khe=NA,ur=vn,z6=function(e){return function(t){var n=[];return t.forEach(function(r){return n.push(r)}),n.sort(e.compare)}},Lhe=NA;const jhe=Object.freeze(Object.defineProperty({__proto__:null,chain:vhe,compact:Ehe,difference:Qw,elem:ur,empty:Ohe,every:V6,filter:Dw,filterMap:Q6,foldMap:The,fromArray:q6,getDifferenceMagma:_he,getEq:mhe,getIntersectionSemigroup:She,getShow:hhe,getUnionMonoid:Che,getUnionSemigroup:P6,insert:D6,intersection:qw,isEmpty:Yd,isSubset:khe,map:ghe,partition:yhe,partitionMap:bhe,reduce:Ihe,reduceRight:xhe,remove:N6,separate:Rhe,singleton:whe,size:Fhe,some:Mhe,subset:Lhe,toArray:z6,toggle:$he,union:Nw},Symbol.toStringTag,{value:"Module"}));var H6=function(e){return{show:function(t){var n="{";for(var r in e)ft.call(e,r)&&(n+=" ".concat(r,": ").concat(e[r].show(t[r]),","));return n.length>1&&(n=n.slice(0,-1)+" "),n+="}",n}}},Y6=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(", "),"]")}}},Uhe=Y6,Bhe=H6,Whe={show:function(e){return JSON.stringify(e)}},Khe={show:function(e){return JSON.stringify(e)}},Phe={show:function(e){return JSON.stringify(e)}};const Dhe=Object.freeze(Object.defineProperty({__proto__:null,getStructShow:Bhe,getTupleShow:Uhe,showBoolean:Whe,showNumber:Phe,showString:Khe,struct:H6,tuple:Y6},Symbol.toStringTag,{value:"Module"}));function Vw(e){return function(t){return function(n){return e.of([t,n])}}}function zw(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 Hw(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 Yw(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 Gw(e){return function(t){return function(n){return e.of(t(n))}}}function Jw(e){return function(t){return function(n){return e.map(t,function(r){return[r,n]})}}}function Zw(e){return function(t){return function(n){return e.map(n(t),function(r){var i=r[0];return i})}}}function Xw(e){return function(t){return function(n){return e.map(n(t),Fn)}}}function Nhe(e){var t=Hw(e),n=zw(e),r=Yw(e),i=Zw(e),o=Xw(e);return{map:function(a,u){return b(a,n(u))},ap:function(a,u){return b(a,t(u))},of:Vw(e),chain:function(a,u){return b(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:Gw(e),fromM:Jw(e),evalState:function(a,u){return b(a,i(u))},execState:function(a,u){return b(a,o(u))}}}const qhe=Object.freeze(Object.defineProperty({__proto__:null,ap:Hw,chain:Yw,evaluate:Zw,execute:Xw,fromF:Jw,fromState:Gw,getStateM:Nhe,map:zw,of:Vw},Symbol.toStringTag,{value:"Module"}));var e$=function(e){return function(){return _y(e)}},t$=Vw(Jx);function G6(e){return qi(Bx(e))}function Qhe(e){return qi(GD(e))}function J6(e){return qi(Wx(e))}function Vhe(e){return qi(JD(e))}function Z6(e){return qi(Kx(e))}function zhe(e){return qi(XD(e))}var Hhe=function(e){return z(e,Ux)},Yhe=function(e){return function(t){return _y(e(t)[0])}},X6=xu(function(e){return e$(e)},t$),e5=J6,Ic=Z6,eh=G6,t5=Gw(Jx),n5=function(e){return qi(ju(e))},r5=function(e){return qi(Px(e))},Ghe=function(e){return qi(Dx(e))},qi=Jw(hc),Jhe=function(e){return function(t){return z(t,cA(e))}},i5=function(e){return function(t){return function(n){return e(n)(t)(n)}}},Zhe=i5,o5=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return r5(e.apply(void 0,t))}},a5=function(e){return function(t){return b(t,th(o5(e)))}},Xhe=a5,u5=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return n5(e.apply(void 0,t))}},s5=function(e){return function(t){return b(t,th(u5(e)))}},eme=s5,c5=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return qi(e.apply(void 0,t))}},l5=function(e){return function(t){return b(t,th(c5(e)))}},tme=l5,Qi=function(e,t){return b(e,f5(t))},Ua=function(e,t){return b(e,r$(t))},Tc=function(e,t){return b(e,i$(t))},n$=function(e,t){return function(n){return b(e(n),wy(function(){return t()(n)}))}},Vy=function(e,t,n){return function(r){return b(e(r),Hx(t,function(i){var o=i[0],a=i[1];return[n(o),a]}))}},zy=function(e,t){return function(n){return b(e(n),Yx(t))}},f5=zw(hc),nme=function(e,t){return function(n){return Vy(n,e,t)}},rme=function(e){return function(t){return zy(t,e)}},r$=Hw(Zn),ime=r$,wo=t$,i$=Yw(Zn),th=i$,d5=th(P),ome=d5,p5=function(e){return function(t){return function(n){return b(t(n),h3(function(){return e()(n)}))}}},ame=p5,Hy=e$,Ht="StateReaderTaskEither",o$={URI:Ht,map:Qi},ume=qe(o$),sme={URI:Ht,of:wo},Yy={URI:Ht,map:Qi,ap:Ua},A5=kt(Yy),cme=A5,h5=Lt(Yy),lme=h5,fme={URI:Ht,map:Qi,ap:Ua,of:wo},gr={URI:Ht,map:Qi,ap:Ua,chain:Tc},xc={URI:Ht,fromState:t5},dme=cW(xc),pme=lW(xc),Ame=fW(xc),hme=dW(xc),mme=HI(xc),gme=pW(xc,gr),vme={URI:Ht,map:Qi,ap:Ua,of:wo,chain:Tc},yme={URI:Ht,map:Qi,ap:Ua,of:wo,chain:Tc,fromIO:Ic},bme={URI:Ht,map:Qi,ap:Ua,of:wo,chain:Tc,fromIO:Ic,fromTask:eh},Cme={URI:Ht,map:Qi,ap:Ua,of:wo,chain:Tc,throwError:Hy},m5=dt(gr),Sme=m5,_me={URI:Ht,bimap:Vy,mapLeft:zy},Ime={URI:Ht,map:Qi,alt:n$},id={URI:Ht,fromReader:e5},Tme=dA(id),xme=pA(id),wme=oc(id),g5=AA(id,gr),$me=g5,v5=hA(id,gr),Eme=v5,Ba={URI:Ht,fromEither:X6},Rme=po(Ba),Ome=Ao(Ba),Fme=Ks(Ba,gr),y5=sa(Ba,gr),Mme=y5,b5=ca(Ba,gr),kme=b5,Lme=mu(Ba),C5=Ps(Ba,gr),jme=C5,Ume=Mr(Ba),Gy={URI:Ht,fromIO:Ic},Bme=yo(Gy),Wme=ga(Gy,gr),Kme=va(Gy,gr),Jy={URI:Ht,fromIO:Ic,fromTask:eh},Pme=ac(Jy),Dme=Rf(Jy,gr),Nme=Of(Jy,gr),qme=Zw(hc),Qme=Xw(hc),Vme=Ut(o$),S5=Bt(gr),zme=S5,_5=jt(Yy),Hme=_5,I5=function(e){return function(t){return function(n){return function(r){return function(){return Dl(t).reduce(function(i,o,a){return i.then(function(u){return Xt(u)?i:e(a+1,o)(u.right[1])(r)().then(function(s){if(Xt(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,Fr(t))(n)(r)().then(Zs(function(i){var o=i[0],a=i[1];return[[o],a]})))}}}}},a$=function(e){var t=I5(e);return function(n){return vt(n)?t(n):wo(bn)}},Yme=a$,T5=function(e){return a$(function(t,n){return e(n)})},Gme=T5(P),Jme={URI:Ht,map:Qi,of:wo,ap:Ua,chain:Tc,bimap:Vy,mapLeft:zy,alt:n$,fromIO:Ic,fromTask:eh,throwError:Hy},Zme={URI:Ht,map:Qi,of:wo,ap:Ua,chain:Tc,bimap:Vy,mapLeft:zy,alt:n$,fromIO:Ic,fromTask:eh,throwError:Hy},Xme=function(e,t){return b(e(t),BA(function(n){var r=n[0];return r}))},ege=function(e,t){return b(e(t),BA(function(n){n[0];var r=n[1];return r}))};function tge(e,t,n){return e(t)(n)()}const nge=Object.freeze(Object.defineProperty({__proto__:null,Alt:Ime,Applicative:fme,Apply:Yy,Bifunctor:_me,Chain:gr,FromEither:Ba,FromIO:Gy,FromReader:id,FromState:xc,FromTask:Jy,Functor:o$,Monad:vme,MonadIO:yme,MonadTask:bme,MonadThrow:Cme,Pointed:sme,URI:Ht,alt:ame,altW:p5,ap:r$,apFirst:A5,apFirstW:cme,apS:_5,apSW:Hme,apSecond:h5,apSecondW:lme,apW:ime,ask:Tme,asks:xme,asksStateReaderTaskEither:Zhe,asksStateReaderTaskEitherW:i5,bimap:nme,bind:S5,bindTo:Vme,bindW:zme,chain:i$,chainEitherK:y5,chainEitherKW:Mme,chainFirst:m5,chainFirstEitherK:b5,chainFirstEitherKW:kme,chainFirstIOK:Kme,chainFirstReaderK:v5,chainFirstReaderKW:Eme,chainFirstTaskK:Nme,chainFirstW:Sme,chainIOEitherK:Xhe,chainIOEitherKW:a5,chainIOK:Wme,chainOptionK:Fme,chainReaderK:g5,chainReaderKW:$me,chainReaderTaskEitherK:tme,chainReaderTaskEitherKW:l5,chainStateK:gme,chainTaskEitherK:eme,chainTaskEitherKW:s5,chainTaskK:Dme,chainW:th,evalState:Xme,evaluate:qme,execState:ege,execute:Qme,filterOrElse:C5,filterOrElseW:jme,flap:ume,flatten:ome,flattenW:d5,fromEither:X6,fromEitherK:Ume,fromIO:Ic,fromIOEither:r5,fromIOEitherK:o5,fromIOK:Bme,fromOption:Rme,fromOptionK:Ome,fromPredicate:Lme,fromReader:e5,fromReaderEither:Ghe,fromReaderK:wme,fromReaderTaskEither:qi,fromReaderTaskEitherK:c5,fromState:t5,fromStateK:mme,fromTask:eh,fromTaskEither:n5,fromTaskEitherK:u5,fromTaskK:Pme,get:dme,gets:hme,left:e$,leftIO:zhe,leftReader:Vhe,leftState:Yhe,leftTask:Qhe,local:Jhe,map:f5,mapLeft:rme,modify:Ame,of:wo,put:pme,right:t$,rightIO:Z6,rightReader:J6,rightState:Hhe,rightTask:G6,run:tge,sequenceArray:Gme,stateReaderTaskEither:Jme,stateReaderTaskEitherSeq:Zme,throwError:Hy,traverseArray:T5,traverseArrayWithIndex:Yme,traverseReadonlyArrayWithIndex:a$,traverseReadonlyNonEmptyArrayWithIndex:I5},Symbol.toStringTag,{value:"Module"}));function rge(e){return function(t){return{peek:t.peek,pos:e}}}function ige(e){return function(t){return{peek:t.peek,pos:e(t.pos)}}}function oge(e){return function(t){return t.peek(e(t.pos))}}function age(e){return function(t){return function(n){return e.map(t(n.pos),function(r){return n.peek(r)})}}}var x5=function(e,t){return b(e,$5(t))},uge=function(e,t){return b(e,u$(t))},u$=function(e){return function(t){return{peek:function(n){return e({peek:t.peek,pos:n})},pos:t.pos}}},w5=function(e){return e.peek(e.pos)},sge=u$(P),$5=function(e){return function(t){return{peek:function(n){return e(t.peek(n))},pos:t.pos}}},s$="Store",E5={URI:s$,map:x5},cge=qe(E5),R5={URI:s$,map:x5,extend:uge,extract:w5},lge=R5;const fge=Object.freeze(Object.defineProperty({__proto__:null,Comonad:R5,Functor:E5,URI:s$,duplicate:sge,experiment:age,extend:u$,extract:w5,flap:cge,map:$5,peeks:oge,seek:rge,seeks:ige,store:lge},Symbol.toStringTag,{value:"Module"}));function c$(e,t){return function(n,r){return t.compose(e.second(r),e.first(n))}}function O5(e,t){var n=c$(e,t);return function(r,i){return t.compose(n(r,i),e.promap(t.id(),P,function(o){return[o,o]}))}}function dge(e){return c$(e,e)}function pge(e){return O5(e,e)}const Age=Object.freeze(Object.defineProperty({__proto__:null,fanOut:O5,fanout:pge,split:c$,splitStrong:dge},Symbol.toStringTag,{value:"Module"}));var hge=function(){return{concat:function(e,t){return Object.assign({},e,t)}}},mge=function(e){return function(t){var n={};for(var r in t)ft.call(t,r)&&(n[r]=e[r](t[r]));return n}};const gge=Object.freeze(Object.defineProperty({__proto__:null,evolve:mge,getAssignSemigroup:hge},Symbol.toStringTag,{value:"Module"}));var vge=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())})},yge=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}}},F5=bA(_n),bge=CT(_n),Cge=jn,M5=ST(_n),nh=function(e){return Zy(Gn(e))},Zy=Kv(We),Sge=Fu(pf),k5=_T(We),_ge=k5,l$=qv(Vf),Ige=l$,L5=l$,Tge=L5,j5=Qv(on),xge=j5,wge=Pv(_n),U5=function(e){return function(){return vge(void 0,void 0,void 0,function(){return yge(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,e().then(fe)];case 1:return[2,t.sent()];case 2:return t.sent(),[2,ye];case 3:return[2]}})})}},$ge=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return U5(function(){return e.apply(void 0,t)})}},Ege=Dv(_n),Rge=yT(on),Oge=Nv(_n),Fge=bT(on),f$=Vv(We),B5=zv(dc),$o=F5,Xy=jf(on),Mge=Xy(P),d$=Hv(on),kge=d$,e0=CA(_n),Lge=e0(),p$=go(We,zs),A$=Aa(We,zs,cf),W5=ha(We,da),K5=ma(We,da),P5=wu(We,da),D5=$u(We,da),ci=function(e,t){return b(e,f$(t))},wc=function(e,t){return b(e,B5(t))},t0=function(e,t){return b(e,Xy(t))},N5=function(e,t){return b(e,d$(t))},jge=function(e,t){return b(e,W5(t))},Uge=function(e,t){return b(e,K5(t))},Bge=function(e,t){return b(e,P5(t))},Wge=function(e,t){return b(e,D5(t))},an="TaskOption",h$={URI:an,map:ci},Kge=qe(h$),q5={URI:an,of:$o},n0={URI:an,map:ci,ap:wc},Pge=kt(n0),Dge=Lt(n0),Nge={URI:an,map:ci,ap:wc,of:$o},Q5=function(e,t){return b(e,Xy(function(n){return b(t,f$(n))}))},qge={URI:an,map:ci,ap:Q5},Qge={URI:an,map:ci,ap:Q5,of:$o},Wa={URI:an,map:ci,ap:wc,chain:t0},Vge=dt(Wa),zge={URI:an,map:ci,alt:N5},V5={URI:an,zero:e0},Hge=Gl(V5,q5),Yge={URI:an,map:ci,ap:wc,of:$o,alt:N5,zero:e0},Gge={URI:an,map:ci,ap:wc,of:$o,chain:t0},Jge={URI:an,map:ci,ap:wc,of:$o,chain:t0,fromIO:nh},Zge={URI:an,map:ci,ap:wc,of:$o,chain:t0,fromIO:nh,fromTask:Zy},Xge={URI:an,compact:p$,separate:A$},eve={URI:an,map:ci,compact:p$,separate:A$,filter:jge,filterMap:Uge,partition:Bge,partitionMap:Wge},r0={URI:an,fromIO:nh},tve=yo(r0),nve=ga(r0,Wa),rve=va(r0,Wa),i0={URI:an,fromEither:M5},ive=Mr(i0),ove=sa(i0,Wa),ave=ca(i0,Wa),o0={URI:an,fromIO:nh,fromTask:Zy},uve=ac(o0),sve=Rf(o0,Wa),cve=Of(o0,Wa),lve=$o(tn),fve=Ut(h$),dve=Bt(Wa),pve=jt(n0),m$=$o(bn),z5=function(e){return z(zf(e),Fu(Tv(fr)))},g$=function(e){var t=z5(e);return function(n){return vt(n)?t(n):m$}},H5=function(e){return function(t){return function(){return Dl(t).reduce(function(n,r,i){return n.then(function(o){return Nt(o)?n:e(i+1,r)().then(function(a){return Nt(a)?a:(o.value.push(a.value),o)})})},e(0,Fr(t))().then(mo(Tp)))}}},v$=function(e){var t=H5(e);return function(n){return vt(n)?t(n):m$}},Ave=g$,Y5=function(e){return g$(function(t,n){return e(n)})},hve=Y5(P),mve=v$,G5=function(e){return v$(function(t,n){return e(n)})},gve=G5(P);const vve=Object.freeze(Object.defineProperty({__proto__:null,Alt:zge,Alternative:Yge,ApT:m$,ApplicativePar:Nge,ApplicativeSeq:Qge,ApplyPar:n0,ApplySeq:qge,Chain:Wa,Compactable:Xge,Do:lve,Filterable:eve,FromEither:i0,FromIO:r0,FromTask:o0,Functor:h$,Monad:Gge,MonadIO:Jge,MonadTask:Zge,Pointed:q5,Zero:V5,alt:d$,altW:kge,ap:B5,apFirst:Pge,apS:pve,apSecond:Dge,bind:dve,bindTo:fve,chain:Xy,chainEitherK:ove,chainFirst:Vge,chainFirstEitherK:ave,chainFirstIOK:rve,chainFirstTaskK:cve,chainIOK:nve,chainNullableK:Rge,chainOptionK:Fge,chainTaskK:sve,compact:p$,filter:W5,filterMap:K5,flap:Kge,flatten:Mge,fold:Ige,foldW:Tge,fromEither:M5,fromEitherK:ive,fromIO:nh,fromIOK:tve,fromNullable:wge,fromNullableK:Ege,fromOption:Cge,fromOptionK:Oge,fromPredicate:bge,fromTask:Zy,fromTaskEither:Sge,fromTaskK:uve,getOrElse:j5,getOrElseW:xge,guard:Hge,map:f$,match:k5,matchE:l$,matchEW:L5,matchW:_ge,none:Lge,of:$o,partition:P5,partitionMap:D5,separate:A$,sequenceArray:hve,sequenceSeqArray:gve,some:F5,traverseArray:Y5,traverseArrayWithIndex:Ave,traverseReadonlyArrayWithIndex:g$,traverseReadonlyArrayWithIndexSeq:v$,traverseReadonlyNonEmptyArrayWithIndex:z5,traverseReadonlyNonEmptyArrayWithIndexSeq:H5,traverseSeqArray:G5,traverseSeqArrayWithIndex:mve,tryCatch:U5,tryCatchK:$ge,zero:e0},Symbol.toStringTag,{value:"Module"}));var Ge=function(e){return e._tag==="Left"},Ft=function(e){return e._tag==="Right"};function _s(e){return e._tag==="Both"}function An(e){return{_tag:"Left",left:e}}function vr(e){return{_tag:"Right",right:e}}function tt(e,t){return{_tag:"Both",left:e,right:t}}var y$=function(e,t,n){return function(r){switch(r._tag){case"Left":return e(r.left);case"Right":return t(r.right);case"Both":return n(r.left,r.right)}}},yve=y$,su=y$,bve=su,J5=su(vr,An,function(e,t){return tt(t,e)});function Cve(e,t){return{show:su(function(n){return"left(".concat(e.show(n),")")},function(n){return"right(".concat(t.show(n),")")},function(n,r){return"both(".concat(e.show(n),", ").concat(t.show(r),")")})}}function Sve(e,t){return ti(function(n,r){return Ge(n)?Ge(r)&&e.equals(n.left,r.left):Ft(n)?Ft(r)&&t.equals(n.right,r.right):_s(r)&&e.equals(n.left,r.left)&&t.equals(n.right,r.right)})}function Z5(e,t){return{concat:function(n,r){return Ge(n)?Ge(r)?An(e.concat(n.left,r.left)):Ft(r)?tt(n.left,r.right):tt(e.concat(n.left,r.left),r.right):Ft(n)?Ge(r)?tt(r.left,n.right):Ft(r)?vr(t.concat(n.right,r.right)):tt(r.left,t.concat(n.right,r.right)):Ge(r)?tt(e.concat(n.left,r.left),n.right):Ft(r)?tt(n.left,t.concat(n.right,r.right)):tt(e.concat(n.left,r.left),t.concat(n.right,r.right))}}}var a0=function(e){return{URI:Pr,_E:void 0,map:$c,ap:function(t,n){return Ge(t)?Ge(n)?An(e.concat(t.left,n.left)):Ft(n)?An(t.left):An(e.concat(t.left,n.left)):Ft(t)?Ge(n)?An(n.left):Ft(n)?vr(t.right(n.right)):tt(n.left,t.right(n.right)):Ge(n)?An(e.concat(t.left,n.left)):Ft(n)?tt(t.left,t.right(n.right)):tt(e.concat(t.left,n.left),t.right(n.right))}}};function _ve(e){var t=a0(e);return{URI:Pr,_E:void 0,map:$c,ap:t.ap,of:rh}}function X5(e){var t=a0(e),n=function(r,i){if(Ge(r))return r;if(Ft(r))return i(r.right);var o=i(r.right);return Ge(o)?An(e.concat(r.left,o.left)):Ft(o)?tt(r.left,o.right):tt(e.concat(r.left,o.left),o.right)};return{URI:Pr,_E:void 0,map:$c,ap:t.ap,chain:n}}function Ive(e){var t=X5(e);return{URI:Pr,_E:void 0,map:$c,of:rh,ap:t.ap,chain:t.chain,throwError:An}}function Tve(e){return Ge(e)?fe(e.left):Ft(e)?ye:fe(e.left)}function xve(e){return Ge(e)?ye:(Ft(e),fe(e.right))}function wve(e){return function(t){return Nt(t)?An(e):tt(e,t.value)}}function $ve(e){return function(t){return Nt(t)?vr(e):tt(t.value,e)}}function Eve(e){return Ge(e)?fe(e.left):ye}function Rve(e){return Ft(e)?fe(e.right):ye}var Ove=function(e,t){return Nt(e)?Nt(t)?ye:fe(vr(t.value)):Nt(t)?fe(An(e.value)):fe(tt(e.value,t.value))},$c=function(e,t){return b(e,T$(t))},eN=function(e,t,n){return b(e,_$(t,n))},tN=function(e,t){return b(e,I$(t))},b$=function(e,t,n){return b(e,rN(t,n))},C$=function(e){var t=iN(e);return function(n,r){return b(n,t(r))}},S$=function(e,t,n){return b(e,oN(t,n))},nN=function(e){var t=aN(e);return function(n,r){return b(n,t(r))}},_$=function(e,t){return function(n){return Ge(n)?An(e(n.left)):Ft(n)?vr(t(n.right)):tt(e(n.left),t(n.right))}},I$=function(e){return function(t){return Ge(t)?An(e(t.left)):_s(t)?tt(e(t.left),t.right):t}},T$=function(e){return function(t){return Ge(t)?t:Ft(t)?vr(e(t.right)):tt(t.left,e(t.right))}},rN=function(e,t){return function(n){return Ge(n)?e:t(e,n.right)}},iN=function(e){return function(t){return function(n){return Ge(n)?e.empty:t(n.right)}}},oN=function(e,t){return function(n){return Ge(n)?e:t(n.right,e)}},aN=function(e){return function(t){return function(n){return Ge(n)?e.of(n):Ft(n)?e.map(t(n.right),vr):e.map(t(n.right),function(r){return tt(n.left,r)})}}},x$=function(e){return function(t){return Ge(t)?e.of(t):Ft(t)?e.map(t.right,vr):e.map(t.right,function(n){return tt(t.left,n)})}},rh=vr,Pr="These",w$={URI:Pr,map:$c},Fve=qe(w$),Mve={URI:Pr,of:rh},kve={URI:Pr,bimap:eN,mapLeft:tN},Lve={URI:Pr,fromThese:P},jve={URI:Pr,reduce:b$,foldMap:C$,reduceRight:S$},Uve={URI:Pr,map:$c,reduce:b$,foldMap:C$,reduceRight:S$,traverse:nN,sequence:x$},$$={URI:Pr,fromEither:P},Bve=po($$),Wve=Ao($$),Kve=function(e){return function(t){return function(n){return Ge(n)?!1:e.equals(t,n.right)}}},Pve=function(e){return function(t){return Ge(t)?!1:e(t.right)}},E$=function(e,t){return function(n){return Ge(n)?[n.left,t()]:Ft(n)?[e(),n.right]:[n.left,n.right]}},Dve=function(e,t){return E$(function(){return e},function(){return t})},uN=rh(bn),R$=function(e){return function(t){return function(n){var r=ye,i=t(0,Fr(n));if(Ge(i))return i;_s(i)&&(r=fe(i.left));for(var o=[i.right],a=1;a<n.length;a++){var u=t(a,n[a]);if(Ge(u))return u;_s(u)&&(r=Nt(r)?fe(u.left):fe(e.concat(r.value,u.left))),o.push(u.right)}return Nt(r)?vr(o):tt(r.value,o)}}},Nve=function(e){return function(t){var n=R$(e)(t);return function(r){return vt(r)?n(r):uN}}},qve={URI:Pr,map:$c,bimap:eN,mapLeft:tN,reduce:b$,foldMap:C$,reduceRight:S$,traverse:nN,sequence:x$};const Qve=Object.freeze(Object.defineProperty({__proto__:null,ApT:uN,Bifunctor:kve,Foldable:jve,FromEither:$$,FromThese:Lve,Functor:w$,Pointed:Mve,Traversable:Uve,URI:Pr,bimap:_$,both:tt,elem:Kve,exists:Pve,flap:Fve,fold:bve,foldMap:iN,foldW:yve,fromOption:Bve,fromOptionK:Wve,fromOptions:Ove,getApplicative:_ve,getApply:a0,getChain:X5,getEq:Sve,getLeft:Tve,getLeftOnly:Eve,getMonad:Ive,getRight:xve,getRightOnly:Rve,getSemigroup:Z5,getShow:Cve,isBoth:_s,isLeft:Ge,isRight:Ft,left:An,leftOrBoth:wve,map:T$,mapLeft:I$,match:su,matchW:y$,of:rh,reduce:rN,reduceRight:oN,right:vr,rightOrBoth:$ve,sequence:x$,swap:J5,these:qve,toTuple:Dve,toTuple2:E$,traverse:aN,traverseReadonlyArrayWithIndex:Nve,traverseReadonlyNonEmptyArrayWithIndex:R$},Symbol.toStringTag,{value:"Module"}));function gm(e){return z(vr,e.of)}function u0(e){return z(An,e.of)}function O$(e){return z(tt,e.of)}function F$(e){return function(t){return e.map(t,vr)}}function M$(e){return function(t){return e.map(t,An)}}function k$(e){return Nl(e,w$)}function L$(e,t){return ua(e,a0(t))}function j$(e,t){var n=u0(e);return function(r){return function(i){return e.chain(i,su(n,r,function(o,a){return e.map(r(a),su(function(u){return An(t.concat(o,u))},function(u){return tt(o,u)},function(u,s){return tt(t.concat(o,u),s)}))}))}}}function U$(e){return function(t,n){return function(r){return e.map(r,_$(t,n))}}}function B$(e){return function(t){return function(n){return e.map(n,I$(t))}}}function sN(e){return function(t,n,r){return function(i){return e.map(i,su(t,n,r))}}}function W$(e){return function(t,n,r){return function(i){return e.chain(i,su(t,n,r))}}}function K$(e){return function(t){return e.map(t,J5)}}function P$(e){return function(t,n){return function(r){return e.map(r,E$(t,n))}}}function Vve(e){var t=k$(e),n=U$(e),r=B$(e),i=W$(e),o=P$(e),a=gm(e),u=function(s,c){return b(s,t(c))};return{map:u,bimap:function(s,c,l){return b(s,n(c,l))},mapLeft:function(s,c){return b(s,r(c))},fold:function(s,c,l,f){return b(s,i(c,l,f))},swap:K$(e),rightM:F$(e),leftM:M$(e),left:u0(e),right:gm(e),both:O$(e),toTuple:function(s,c,l){return b(s,o(function(){return c},function(){return l}))},getMonad:function(s){var c=L$(e,s),l=j$(e,s);return{_E:void 0,map:u,of:a,ap:function(f,p){return b(f,c(p))},chain:function(f,p){return b(f,l(p))}}}}}const zve=Object.freeze(Object.defineProperty({__proto__:null,ap:L$,bimap:U$,both:O$,chain:j$,getTheseM:Vve,left:u0,leftF:M$,map:k$,mapLeft:B$,match:sN,matchE:W$,right:gm,rightF:F$,swap:K$,toTuple2:P$},Symbol.toStringTag,{value:"Module"}));var Hve=u0(_n),cN=gm(_n),Yve=O$(_n),D$=F$(We),lN=M$(We),fN=z(Gn,D$),Gve=z(Gn,lN),dN=jn,pN=jn,s0=fN,Jve=Gn,N$=D$,AN=sN(We),Zve=AN,hN=W$(on),mN=hN,gN=mN,Xve=gN,eye=K$(We),Ec=function(e,t){return b(e,vN(t))},q$=function(e,t,n){return b(e,yN(t,n))},Q$=function(e,t){return b(e,bN(t))},vN=k$(We),yN=U$(We),bN=B$(We),ih=cN,Xn="TaskThese",V$=function(e,t){var n=L$(e,t);return{URI:Xn,_E:void 0,map:Ec,ap:function(r,i){return b(r,n(i))}}};function CN(e,t){var n=V$(e,t).ap;return{URI:Xn,_E:void 0,map:Ec,ap:n,of:ih}}function SN(e){var t=V$(FA,e),n=j$(on,e);return{URI:Xn,_E:void 0,map:Ec,ap:t.ap,chain:function(r,i){return b(r,n(i))}}}function tye(e){var t=CN(FA,e),n=SN(e);return{URI:Xn,_E:void 0,map:Ec,ap:t.ap,of:ih,chain:n.chain,fromIO:s0,fromTask:N$}}var _N={URI:Xn,map:Ec},nye=qe(_N),rye={URI:Xn,of:ih},iye={URI:Xn,bimap:q$,mapLeft:Q$},c0={URI:Xn,fromEither:dN},oye=po(c0),aye=Ao(c0),uye=mu(c0),IN={URI:Xn,fromThese:pN},sye=AW(IN),TN={URI:Xn,fromIO:s0},cye=yo(TN),xN={URI:Xn,fromIO:s0,fromTask:N$},lye=ac(xN),wN=P$(We),z$=ih(bn),$N=function(e){var t=R$(e);return function(n){return z(zf(n),Fu(t(fr)))}},fye=function(e){return function(t){var n=$N(e)(t);return function(r){return vt(r)?n(r):z$}}},EN=function(e){return function(t){return function(n){return function(){return Dl(n).reduce(function(r,i,o){return r.then(function(a){return Ge(a)?r:t(o+1,i)().then(function(u){if(Ge(u))return u;if(_s(u)){var s=a.right;return s.push(u.right),_s(a)?tt(e.concat(a.left,u.left),s):tt(u.left,s)}return a.right.push(u.right),a})})},t(0,Fr(n))().then(T$(Tp)))}}}},dye=function(e){return function(t){var n=EN(e)(t);return function(r){return vt(r)?n(r):z$}}},pye={URI:Xn,map:Ec},Aye={URI:Xn,bimap:q$,mapLeft:Q$},hye=function(e,t){return wN(function(){return e},function(){return t})},mye={URI:Xn,map:Ec,bimap:q$,mapLeft:Q$},gye=function(e,t){return nn(fy)(Z5(e,t))};const vye=Object.freeze(Object.defineProperty({__proto__:null,ApT:z$,Bifunctor:iye,FromEither:c0,FromIO:TN,FromTask:xN,FromThese:IN,Functor:_N,Pointed:rye,URI:Xn,bifunctorTaskThese:Aye,bimap:yN,both:Yve,flap:nye,fold:mN,foldW:Xve,fromEither:dN,fromIO:s0,fromIOEither:Jve,fromIOK:cye,fromOption:oye,fromOptionK:aye,fromPredicate:uye,fromTask:N$,fromTaskK:lye,fromThese:pN,fromTheseK:sye,functorTaskThese:pye,getApplicative:CN,getApply:V$,getChain:SN,getMonad:tye,getSemigroup:gye,left:Hve,leftIO:Gve,leftTask:lN,map:vN,mapLeft:bN,match:AN,matchE:hN,matchEW:gN,matchW:Zve,of:ih,right:cN,rightIO:fN,rightTask:D$,swap:eye,taskThese:mye,toTuple:hye,toTuple2:wN,traverseReadonlyArrayWithIndex:fye,traverseReadonlyArrayWithIndexSeq:dye,traverseReadonlyNonEmptyArrayWithIndex:$N,traverseReadonlyNonEmptyArrayWithIndexSeq:EN},Symbol.toStringTag,{value:"Module"}));function yye(e,t){return function(n){return n(t(n(e.empty)))}}function bye(e){return function(t){return[e(t),t]}}function Cye(e){return function(t){return function(n){return[t(n),e(n)]}}}function Sye(e){return function(t){return function(n){return t(e(n))}}}function _ye(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:H$,_E:void 0,map:RN,extend:t,extract:n}}var RN=function(e,t){return b(e,ON(t))},ON=function(e){return function(t){return function(n){return e(t(n))}}},H$="Traced",Y$={URI:H$,map:RN},Iye=qe(Y$),Tye=Y$;const xye=Object.freeze(Object.defineProperty({__proto__:null,Functor:Y$,URI:H$,censor:Sye,flap:Iye,getComonad:_ye,listen:bye,listens:Cye,map:ON,traced:Tye,tracks:yye},Symbol.toStringTag,{value:"Module"}));function FN(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 MN(e,t){return function(n){var r=e.sequence(n),i=t.sequence(n);return function(o){return r(e.map(o,i))}}}function wye(e,t){var n=ql(e,t).map,r=MI(e,t),i=FN(e,t),o=MN(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 b(s,u(c))}},sequence:function(a){var u=o(a);return function(s){return b(s,u)}}}}const $ye=Object.freeze(Object.defineProperty({__proto__:null,getTraversableComposition:wye,sequence:MN,traverse:FN},Symbol.toStringTag,{value:"Module"})),Eye=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function kN(e,t){return t===void 0&&(t=[]),{value:e,forest:t}}function Rye(e){var t=function(n){return uu(n.forest)?"make(".concat(e.show(n.value),")"):"make(".concat(e.show(n.value),", [").concat(n.forest.map(t).join(", "),"])")};return{show:t}}function Oye(e){var t,n=ti(function(r,i){return e.equals(r.value,i.value)&&t.equals(r.forest,i.forest)});return t=qU(n),n}var LN=function(e,t){for(var n="",r=t.length,i,o=0;o<r;o++){i=t[o];var a=o===r-1;n+=e+(a?"└":"├")+"─ "+i.value,n+=LN(e+(r>1&&!a?"│ ":" "),i.forest)}return n};function jN(e){return LN(`
2
- `,e)}function Fye(e){return e.value+jN(e.forest)}function UN(e,t){var n=t(e),r=n[0],i=n[1];return{value:r,forest:BN(i,t)}}function BN(e,t){return e.map(function(n){return UN(n,t)})}function WN(e){var t=KN(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 KN(e){var t=Av(e);return function(n,r){return b(n,t(function(i){return WN(e)(i,r)}))}}function Mye(e){var t=function(n){return e(n.value,n.forest.map(t))};return t}var Du=function(e,t){return b(e,f0(t))},od=function(e,t){return b(e,oh(function(n){return b(t,f0(n))}))},G$=function(e,t){return b(e,oh(t))},J$=function(e,t,n){return b(e,d0(t,n))},Z$=function(e){var t=NN(e);return function(n,r){return b(n,t(r))}},X$=function(e,t,n){return b(e,eE(t,n))},PN=function(e,t){return b(e,l0(t))},DN=function(e){var t=nE(e);return function(n,r){return b(n,t(r))}},kye=function(e){return function(t){return od(t,e)}},oh=function(e){return function(t){var n=e(t.value),r=n.value,i=n.forest,o=Y_().concat;return{value:r,forest:o(i,t.forest.map(oh(e)))}}},l0=function(e){return function(t){return{value:e(t),forest:t.forest.map(l0(e))}}},Lye=l0(P),jye=oh(P),f0=function(e){return function(t){return{value:e(t.value),forest:t.forest.map(f0(e))}}},d0=function(e,t){return function(n){for(var r=t(e,n.value),i=n.forest.length,o=0;o<i;o++)r=b(n.forest[o],d0(r,t));return r}},NN=function(e){return function(t){return d0(e.empty,function(n,r){return e.concat(n,t(r))})}},eE=function(e,t){return function(n){for(var r=e,i=n.forest.length,o=i-1;o>=0;o--)r=b(n.forest[o],eE(r,t));return t(n.value,r)}},tE=function(e){return e.value},nE=function(e){var t=Av(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}}}),b(i.forest,t(n(r))))}};return n},rE=function(e){return nE(e)(P)},ad=function(e){return kN(e)},Vi="Tree",iE={URI:Vi,map:Du},Uye=qe(iE),Bye={URI:Vi,of:ad},p0={URI:Vi,map:Du,ap:od},Wye=kt(p0),Kye=Lt(p0),Pye={URI:Vi,map:Du,ap:od,of:ad},oE={URI:Vi,map:Du,ap:od,chain:G$},Dye={URI:Vi,map:Du,ap:od,of:ad,chain:G$},Nye=dt(oE),qye={URI:Vi,reduce:J$,foldMap:Z$,reduceRight:X$},Qye={URI:Vi,map:Du,reduce:J$,foldMap:Z$,reduceRight:X$,traverse:DN,sequence:rE},Vye={URI:Vi,map:Du,extend:PN,extract:tE},zye=ad(tn),Hye=Ut(iE),Yye=Bt(oE),Gye=jt(p0);function Jye(e){var t=function(n,r){return e.equals(n,r.value)||r.forest.some(function(i){return t(n,i)})};return t}var qN=function(e){return function(t){return e(t.value)||t.forest.some(qN(e))}},Zye={URI:Vi,map:Du,of:ad,ap:od,chain:G$,reduce:J$,foldMap:Z$,reduceRight:X$,traverse:DN,sequence:rE,extract:tE,extend:PN};const Xye=Object.freeze(Object.defineProperty({__proto__:null,Applicative:Pye,Apply:p0,Chain:oE,Comonad:Vye,Do:zye,Foldable:qye,Functor:iE,Monad:Dye,Pointed:Bye,Traversable:Qye,URI:Vi,ap:kye,apFirst:Wye,apS:Gye,apSecond:Kye,bind:Yye,bindTo:Hye,chain:oh,chainFirst:Nye,drawForest:jN,drawTree:Fye,duplicate:Lye,elem:Jye,exists:qN,extend:l0,extract:tE,flap:Uye,flatten:jye,fold:Mye,foldMap:NN,getEq:Oye,getShow:Rye,make:kN,map:f0,of:ad,reduce:d0,reduceRight:eE,sequence:rE,traverse:nE,tree:Zye,unfoldForest:BN,unfoldForestM:KN,unfoldTree:UN,unfoldTreeM:WN},Symbol.toStringTag,{value:"Module"}));var Er=en,sr=Fn,e0e=function(e){return[sr(e),Er(e)]};function aE(e){return{URI:Dr,_E:void 0,map:ah,ap:function(t,n){return[Er(t)(Er(n)),e.concat(sr(t),sr(n))]}}}var QN=function(e){return function(t){return[t,e.empty]}};function t0e(e){var t=aE(e);return{URI:Dr,_E:void 0,map:t.map,ap:t.ap,of:QN(e)}}function uE(e){var t=aE(e);return{URI:Dr,_E:void 0,map:t.map,ap:t.ap,chain:function(n,r){var i=r(Er(n)),o=i[0],a=i[1];return[o,e.concat(sr(n),a)]}}}function n0e(e){var t=uE(e);return{URI:Dr,_E:void 0,map:t.map,ap:t.ap,chain:t.chain,of:QN(e)}}function r0e(e){var t=function(r,i){for(var o=i(r),a=e.empty,u=Er(o);u._tag==="Left";)a=e.concat(a,sr(o)),o=i(u.left),u=Er(o);return[u.right,e.concat(a,sr(o))]},n=uE(e);return{URI:Dr,_E:void 0,map:n.map,ap:n.ap,chain:n.chain,chainRec:t}}var VN=function(e,t){return b(e,ZN(t))},ah=function(e,t){return b(e,fE(t))},zN=function(e,t,n){return b(e,JN(t,n))},HN=function(e,t){return b(e,dE(t))},YN=function(e,t){return b(e,pE(t))},sE=function(e,t,n){return b(e,e4(t,n))},cE=function(e){var t=XN();return function(n,r){return b(n,t(r))}},lE=function(e,t,n){return b(e,t4(t,n))};function GN(e){var t=n4(e);return function(n,r){return b(n,t(r))}}var JN=function(e,t){return function(n){return[t(Er(n)),e(sr(n))]}},fE=function(e){return function(t){return[e(Er(t)),sr(t)]}},dE=function(e){return function(t){return[Er(t),e(sr(t))]}},ZN=function(e){return function(t){return[Er(t),sr(e)]}},pE=function(e){return function(t){return[e(t),sr(t)]}},i0e=pE(P),AE=Qy,XN=Mw,e4=Fw,t4=kw,n4=function(e){return function(t){return function(n){return e.map(t(Er(n)),function(r){return[r,sr(n)]})}}},hE=function(e){return function(t){return e.map(Er(t),function(n){return[n,sr(t)]})}},Dr="Tuple",r4={URI:Dr,map:ah},o0e=qe(r4),a0e={URI:Dr,bimap:zN,mapLeft:HN},u0e={URI:Dr,compose:VN},s0e={URI:Dr,map:ah,extend:YN,extract:AE},c0e={URI:Dr,reduce:sE,foldMap:cE,reduceRight:lE},l0e={URI:Dr,map:ah,reduce:sE,foldMap:cE,reduceRight:lE,traverse:GN,sequence:hE},f0e=fE,d0e=dE,p0e={URI:Dr,compose:VN,map:ah,bimap:zN,mapLeft:HN,extract:AE,extend:YN,reduce:sE,foldMap:cE,reduceRight:lE,traverse:GN,sequence:hE};const A0e=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:a0e,Comonad:s0e,Foldable:c0e,Functor:r4,Semigroupoid:u0e,Traversable:l0e,URI:Dr,bimap:JN,compose:ZN,duplicate:i0e,extend:pE,extract:AE,flap:o0e,foldMap:XN,fst:Er,getApplicative:t0e,getApply:aE,getChain:uE,getChainRec:r0e,getMonad:n0e,map:f0e,mapFst:fE,mapLeft:d0e,mapSnd:dE,reduce:e4,reduceRight:t4,sequence:hE,snd:sr,swap:e0e,traverse:n4,tuple:p0e},Symbol.toStringTag,{value:"Module"})),h0e=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function m0e(e,t){var n=Fk(t,Iu(e));return{map:n.map,ap:n.ap,of:n.of,chain:function(r,i){return t.chain(r,function(o){return Xt(o)?t.of(Zo(o.left)):i(o.right)})},alt:function(r,i){return t.chain(r,function(o){return HC(o)?t.of(o):t.map(i(),function(a){return Xt(a)?Zo(e.concat(o.left,a.left)):a})})}}}const g0e=Object.freeze(Object.defineProperty({__proto__:null,getValidationM:m0e},Symbol.toStringTag,{value:"Module"}));var i4=XC(void 0),v0e={concat:i4.concat,empty:void 0};const y0e=Object.freeze(Object.defineProperty({__proto__:null,Monoid:v0e,Semigroup:i4},Symbol.toStringTag,{value:"Module"}));var b0e=function(e){return function(){return[void 0,e]}},C0e=function(e){return function(){var t=e(),n=t[0],r=t[1];return[[n,r],r]}},S0e=function(e){return function(){var t=e(),n=t[0],r=n[0],i=n[1],o=t[1];return[r,i(o)]}},_0e=function(e){return function(t){return function(){var n=t(),r=n[0],i=n[1];return[[r,e(i)],i]}}},I0e=function(e){return function(t){return function(){var n=t(),r=n[0],i=n[1];return[r,e(i)]}}},uh=function(e,t){return b(e,o4(t))},o4=function(e){return function(t){return function(){var n=t(),r=n[0],i=n[1];return[e(r),i]}}},Rc="Writer",a4=function(e){return{URI:Rc,_E:void 0,of:function(t){return function(){return[t,e.empty]}}}},mE=function(e){return{URI:Rc,_E:void 0,map:uh,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)]}}}},u4=function(e){var t=mE(e),n=a4(e);return{URI:Rc,_E:void 0,map:uh,ap:t.ap,of:n.of}};function s4(e){var t=mE(e);return{URI:Rc,_E:void 0,map:uh,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 T0e(e){var t=u4(e),n=s4(e);return{URI:Rc,_E:void 0,map:uh,ap:t.ap,of:t.of,chain:n.chain}}var gE={URI:Rc,map:uh},x0e=qe(gE),w0e=function(e){return e()[0]},$0e=function(e){return e()[1]},E0e=function(e){return e()[0]},R0e=function(e){return e()[1]},O0e=gE;const F0e=Object.freeze(Object.defineProperty({__proto__:null,Functor:gE,URI:Rc,censor:I0e,evalWriter:E0e,evaluate:w0e,execWriter:R0e,execute:$0e,flap:x0e,getApplicative:u4,getApply:mE,getChain:s4,getMonad:T0e,getPointed:a4,listen:C0e,listens:_0e,map:o4,pass:S0e,tell:b0e,writer:O0e},Symbol.toStringTag,{value:"Module"}));function M0e(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 k0e=Object.freeze(Object.defineProperty({__proto__:null,getWriterM:M0e},Symbol.toStringTag,{value:"Module"})),L0e=Object.freeze(Object.defineProperty({__proto__:null,alt:qV,alternative:VV,applicative:lz,apply:sz,array:iX,bifunctor:oX,boolean:pX,booleanAlgebra:vX,bounded:SX,boundedDistributiveLattice:TX,boundedJoinSemilattice:xX,boundedLattice:wX,boundedMeetSemilattice:$X,category:EX,chain:fz,chainRec:RX,choice:MX,comonad:kX,compactable:Tee,console:Ree,const:Qee,contravariant:Vee,date:ete,distributiveLattice:_X,either:xB,eitherT:Dte,endomorphism:qte,eq:Iz,extend:Qte,field:Hte,filterable:Gte,filterableWithIndex:Jte,foldable:rne,foldableWithIndex:one,fromEither:dz,fromIO:ane,fromReader:$ne,fromState:Hne,fromTask:Yne,fromThese:Gne,function:Ok,functor:cz,functorWithIndex:Zne,group:Xne,heytingAlgebra:ere,hkt:tre,identity:_re,invariant:Ire,io:Nre,ioEither:Nie,ioOption:joe,ioRef:Boe,joinSemilattice:Woe,json:Doe,lattice:Noe,magma:Dz,map:Zae,meetSemilattice:Xae,monad:eue,monadIO:tue,monadTask:nue,monadThrow:rue,monoid:mue,naturalTransformation:gue,nonEmptyArray:FY,number:WY,option:_ee,optionT:Qie,ord:Bz,ordering:Iue,pipeable:Due,pointed:Nue,predicate:WX,profunctor:que,random:Hue,reader:wne,readerEither:qse,readerT:zse,readerTask:tle,readerTaskEither:$de,readonlyArray:yJ,readonlyMap:mae,readonlyNonEmptyArray:KH,readonlyRecord:ype,readonlySet:jpe,readonlyTuple:Jpe,record:ZAe,refinement:uhe,ring:fhe,semigroup:nL,semigroupoid:dhe,semiring:Ahe,separated:QY,set:jhe,show:Dhe,state:zne,stateReaderTaskEither:nge,stateT:qhe,store:fge,string:Qde,strong:Age,struct:gge,task:yce,taskEither:ffe,taskOption:vve,taskThese:vye,these:Qve,theseT:zve,traced:xye,traversable:$ye,traversableWithIndex:Eye,tree:Xye,tuple:A0e,unfoldable:h0e,validationT:g0e,void:y0e,witherable:VY,writer:F0e,writerT:k0e,zero:zY},Symbol.toStringTag,{value:"Module"})),st=Ws(L0e);var un={},Il={},dn={},He={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getEndomorphismMonoid=e.not=e.SK=e.hole=e.pipe=e.untupled=e.tupled=e.absurd=e.decrement=e.increment=e.tuple=e.flow=e.flip=e.constVoid=e.constUndefined=e.constNull=e.constFalse=e.constTrue=e.constant=e.unsafeCoerce=e.identity=e.apply=e.getRing=e.getSemiring=e.getMonoid=e.getSemigroup=e.getBooleanAlgebra=void 0;var t=function(C){return function(){return{meet:function(y,x){return function(w){return C.meet(y(w),x(w))}},join:function(y,x){return function(w){return C.join(y(w),x(w))}},zero:function(){return C.zero},one:function(){return C.one},implies:function(y,x){return function(w){return C.implies(y(w),x(w))}},not:function(y){return function(x){return C.not(y(x))}}}}};e.getBooleanAlgebra=t;var n=function(C){return function(){return{concat:function(y,x){return function(w){return C.concat(y(w),x(w))}}}}};e.getSemigroup=n;var r=function(C){var y=(0,e.getSemigroup)(C);return function(){return{concat:y().concat,empty:function(){return C.empty}}}};e.getMonoid=r;var i=function(C){return{add:function(y,x){return function(w){return C.add(y(w),x(w))}},zero:function(){return C.zero},mul:function(y,x){return function(w){return C.mul(y(w),x(w))}},one:function(){return C.one}}};e.getSemiring=i;var o=function(C){var y=(0,e.getSemiring)(C);return{add:y.add,mul:y.mul,one:y.one,zero:y.zero,sub:function(x,w){return function(M){return C.sub(x(M),w(M))}}}};e.getRing=o;var a=function(C){return function(y){return y(C)}};e.apply=a;function u(C){return C}e.identity=u,e.unsafeCoerce=u;function s(C){return function(){return C}}e.constant=s,e.constTrue=s(!0),e.constFalse=s(!1),e.constNull=s(null),e.constUndefined=s(void 0),e.constVoid=e.constUndefined;function c(C){return function(y,x){return C(x,y)}}e.flip=c;function l(C,y,x,w,M,O,F,K,N){switch(arguments.length){case 1:return C;case 2:return function(){return y(C.apply(this,arguments))};case 3:return function(){return x(y(C.apply(this,arguments)))};case 4:return function(){return w(x(y(C.apply(this,arguments))))};case 5:return function(){return M(w(x(y(C.apply(this,arguments)))))};case 6:return function(){return O(M(w(x(y(C.apply(this,arguments))))))};case 7:return function(){return F(O(M(w(x(y(C.apply(this,arguments)))))))};case 8:return function(){return K(F(O(M(w(x(y(C.apply(this,arguments))))))))};case 9:return function(){return N(K(F(O(M(w(x(y(C.apply(this,arguments)))))))))}}}e.flow=l;function f(){for(var C=[],y=0;y<arguments.length;y++)C[y]=arguments[y];return C}e.tuple=f;function p(C){return C+1}e.increment=p;function A(C){return C-1}e.decrement=A;function h(C){throw new Error("Called `absurd` function which should be uncallable")}e.absurd=h;function v(C){return function(y){return C.apply(void 0,y)}}e.tupled=v;function _(C){return function(){for(var y=[],x=0;x<arguments.length;x++)y[x]=arguments[x];return C(y)}}e.untupled=_;function S(C,y,x,w,M,O,F,K,N){switch(arguments.length){case 1:return C;case 2:return y(C);case 3:return x(y(C));case 4:return w(x(y(C)));case 5:return M(w(x(y(C))));case 6:return O(M(w(x(y(C)))));case 7:return F(O(M(w(x(y(C))))));case 8:return K(F(O(M(w(x(y(C)))))));case 9:return N(K(F(O(M(w(x(y(C))))))));default:{for(var J=arguments[0],Z=1;Z<arguments.length;Z++)J=arguments[Z](J);return J}}}e.pipe=S,e.hole=h;var I=function(C,y){return y};e.SK=I;function T(C){return function(y){return!C(y)}}e.not=T;var g=function(){return{concat:function(C,y){return l(C,y)},empty:u}};e.getEndomorphismMonoid=g})(He);var je={},j0e=Ae&&Ae.__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(je,"__esModule",{value:!0});je.fromReadonlyNonEmptyArray=je.has=je.emptyRecord=je.emptyReadonlyArray=je.tail=je.head=je.isNonEmpty=je.singleton=je.right=je.left=je.isRight=je.isLeft=je.some=je.none=je.isSome=je.isNone=void 0;var U0e=function(e){return e._tag==="None"};je.isNone=U0e;var B0e=function(e){return e._tag==="Some"};je.isSome=B0e;je.none={_tag:"None"};var W0e=function(e){return{_tag:"Some",value:e}};je.some=W0e;var K0e=function(e){return e._tag==="Left"};je.isLeft=K0e;var P0e=function(e){return e._tag==="Right"};je.isRight=P0e;var D0e=function(e){return{_tag:"Left",left:e}};je.left=D0e;var N0e=function(e){return{_tag:"Right",right:e}};je.right=N0e;var q0e=function(e){return[e]};je.singleton=q0e;var Q0e=function(e){return e.length>0};je.isNonEmpty=Q0e;var V0e=function(e){return e[0]};je.head=V0e;var z0e=function(e){return e.slice(1)};je.tail=z0e;je.emptyReadonlyArray=[];je.emptyRecord={};je.has=Object.prototype.hasOwnProperty;var H0e=function(e){return j0e([e[0]],e.slice(1),!0)};je.fromReadonlyNonEmptyArray=H0e;var Y0e=Ae&&Ae.__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]}),G0e=Ae&&Ae.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),J0e=Ae&&Ae.__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)&&Y0e(t,e,n);return G0e(t,e),t};Object.defineProperty(dn,"__esModule",{value:!0});dn.sequenceS=dn.sequenceT=dn.getApplySemigroup=dn.apS=dn.apSecond=dn.apFirst=dn.ap=void 0;var Z0e=He,X0e=J0e(je);function ebe(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)}}}dn.ap=ebe;function tbe(e){return function(t){return function(n){return e.ap(e.map(n,function(r){return function(){return r}}),t)}}}dn.apFirst=tbe;function nbe(e){return function(t){return function(n){return e.ap(e.map(n,function(){return function(r){return r}}),t)}}}dn.apSecond=nbe;function rbe(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)}}}dn.apS=rbe;function ibe(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)}}}}dn.getApplySemigroup=ibe;function vE(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):vE(e,t-1,i)}}var ab={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 obe(e){return X0e.has.call(ab,e)||(ab[e]=vE(Z0e.tuple,e-1,[])),ab[e]}function abe(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r=t.length,i=obe(r),o=e.map(t[0],i),a=1;a<r;a++)o=e.ap(o,t[a]);return o}}dn.sequenceT=abe;function ube(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 vE(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 sbe(e){return function(t){for(var n=Object.keys(t),r=n.length,i=ube(n),o=e.map(t[n[0]],i),a=1;a<r;a++)o=e.ap(o,t[n[a]]);return o}}dn.sequenceS=sbe;var Yr={};Object.defineProperty(Yr,"__esModule",{value:!0});Yr.getFunctorComposition=Yr.bindTo=Yr.flap=Yr.map=void 0;var cbe=He;function c4(e,t){return function(n){return function(r){return e.map(r,function(i){return t.map(i,n)})}}}Yr.map=c4;function lbe(e){return function(t){return function(n){return e.map(n,function(r){return r(t)})}}}Yr.flap=lbe;function fbe(e){return function(t){return function(n){return e.map(n,function(r){var i;return i={},i[t]=r,i})}}}Yr.bindTo=fbe;function dbe(e,t){var n=c4(e,t);return{map:function(r,i){return(0,cbe.pipe)(r,n(i))}}}Yr.getFunctorComposition=dbe;Object.defineProperty(Il,"__esModule",{value:!0});Il.getApplicativeComposition=Il.getApplicativeMonoid=void 0;var l4=dn,pbe=He,Abe=Yr;function hbe(e){var t=(0,l4.getApplySemigroup)(e);return function(n){return{concat:t(n).concat,empty:e.of(n.empty)}}}Il.getApplicativeMonoid=hbe;function mbe(e,t){var n=(0,Abe.getFunctorComposition)(e,t).map,r=(0,l4.ap)(e,t);return{map:n,of:function(i){return e.of(t.of(i))},ap:function(i,o){return(0,pbe.pipe)(i,r(o))}}}Il.getApplicativeComposition=mbe;var Is={};Object.defineProperty(Is,"__esModule",{value:!0});Is.bind=Is.chainFirst=void 0;function gbe(e){return function(t){return function(n){return e.chain(n,function(r){return e.map(t(r),function(){return r})})}}}Is.chainFirst=gbe;function vbe(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))})})}}}Is.bind=vbe;var A0={};Object.defineProperty(A0,"__esModule",{value:!0});A0.tailRec=void 0;var ybe=function(e,t){for(var n=t(e);n._tag==="Left";)n=t(n.left);return n.right};A0.tailRec=ybe;var Gt={},bbe=Ae&&Ae.__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]}),Cbe=Ae&&Ae.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Sbe=Ae&&Ae.__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)&&bbe(t,e,n);return Cbe(t,e),t};Object.defineProperty(Gt,"__esModule",{value:!0});Gt.filterOrElse=Gt.chainFirstEitherK=Gt.chainEitherK=Gt.fromEitherK=Gt.chainOptionK=Gt.fromOptionK=Gt.fromPredicate=Gt.fromOption=void 0;var _be=Is,yE=He,fs=Sbe(je);function f4(e){return function(t){return function(n){return e.fromEither(fs.isNone(n)?fs.left(t()):fs.right(n.value))}}}Gt.fromOption=f4;function Ibe(e){return function(t,n){return function(r){return e.fromEither(t(r)?fs.right(r):fs.left(n(r)))}}}Gt.fromPredicate=Ibe;function d4(e){var t=f4(e);return function(n){var r=t(n);return function(i){return(0,yE.flow)(i,r)}}}Gt.fromOptionK=d4;function Tbe(e,t){var n=d4(e);return function(r){var i=n(r);return function(o){return function(a){return t.chain(a,i(o))}}}}Gt.chainOptionK=Tbe;function bE(e){return function(t){return(0,yE.flow)(t,e.fromEither)}}Gt.fromEitherK=bE;function xbe(e,t){var n=bE(e);return function(r){return function(i){return t.chain(i,n(r))}}}Gt.chainEitherK=xbe;function wbe(e,t){return(0,yE.flow)(bE(e),(0,_be.chainFirst)(t))}Gt.chainFirstEitherK=wbe;function $be(e,t){return function(n,r){return function(i){return t.chain(i,function(o){return e.fromEither(n(o)?fs.right(o):fs.left(r(o)))})}}}Gt.filterOrElse=$be;var p4={};(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=He,n=Yr,r=function(p,A){return{left:p,right:A}};e.separated=r;var i=function(p,A){return(0,t.pipe)(p,(0,e.map)(A))},o=function(p,A){return(0,t.pipe)(p,(0,e.mapLeft)(A))},a=function(p,A,h){return(0,t.pipe)(p,(0,e.bimap)(A,h))},u=function(p){return function(A){return(0,e.separated)((0,e.left)(A),p((0,e.right)(A)))}};e.map=u;var s=function(p){return function(A){return(0,e.separated)(p((0,e.left)(A)),(0,e.right)(A))}};e.mapLeft=s;var c=function(p,A){return function(h){return(0,e.separated)(p((0,e.left)(h)),A((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(p){return p.left};e.left=l;var f=function(p){return p.right};e.right=f})(p4);var nu={},Ebe=Ae&&Ae.__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]}),Rbe=Ae&&Ae.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Obe=Ae&&Ae.__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)&&Ebe(t,e,n);return Rbe(t,e),t};Object.defineProperty(nu,"__esModule",{value:!0});nu.filterE=nu.witherDefault=nu.wiltDefault=void 0;var _O=Obe(je);function Fbe(e,t){return function(n){var r=e.traverse(n);return function(i,o){return n.map(r(i,o),t.separate)}}}nu.wiltDefault=Fbe;function Mbe(e,t){return function(n){var r=e.traverse(n);return function(i,o){return n.map(r(i,o),t.compact)}}}nu.witherDefault=Mbe;function kbe(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?_O.some(o):_O.none})})}}}}nu.filterE=kbe;(function(e){var t=Ae&&Ae.__createBinding||(Object.create?function(j,L,W,Le){Le===void 0&&(Le=W);var U=Object.getOwnPropertyDescriptor(L,W);(!U||("get"in U?!L.__esModule:U.writable||U.configurable))&&(U={enumerable:!0,get:function(){return L[W]}}),Object.defineProperty(j,Le,U)}:function(j,L,W,Le){Le===void 0&&(Le=W),j[Le]=L[W]}),n=Ae&&Ae.__setModuleDefault||(Object.create?function(j,L){Object.defineProperty(j,"default",{enumerable:!0,value:L})}:function(j,L){j.default=L}),r=Ae&&Ae.__importStar||function(j){if(j&&j.__esModule)return j;var L={};if(j!=null)for(var W in j)W!=="default"&&Object.prototype.hasOwnProperty.call(j,W)&&t(L,j,W);return n(L,j),L};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=Il,o=dn,a=Is,u=A0,s=Gt,c=He,l=Yr,f=r(je),p=p4,A=nu;e.left=f.left,e.right=f.right;var h=function(j,L){return(0,c.pipe)(j,(0,e.map)(L))},v=function(j,L){return(0,c.pipe)(j,(0,e.ap)(L))},_=function(j,L){return(0,c.pipe)(j,(0,e.chain)(L))},S=function(j,L,W){return(0,c.pipe)(j,(0,e.reduce)(L,W))},I=function(j){return function(L,W){var Le=(0,e.foldMap)(j);return(0,c.pipe)(L,Le(W))}},T=function(j,L,W){return(0,c.pipe)(j,(0,e.reduceRight)(L,W))},g=function(j){var L=(0,e.traverse)(j);return function(W,Le){return(0,c.pipe)(W,L(Le))}},C=function(j,L,W){return(0,c.pipe)(j,(0,e.bimap)(L,W))},y=function(j,L){return(0,c.pipe)(j,(0,e.mapLeft)(L))},x=function(j,L){return(0,c.pipe)(j,(0,e.alt)(L))},w=function(j,L){return(0,c.pipe)(j,(0,e.extend)(L))},M=function(j,L){return(0,u.tailRec)(L(j),function(W){return(0,e.isLeft)(W)?(0,e.right)((0,e.left)(W.left)):(0,e.isLeft)(W.right)?(0,e.left)(L(W.right.left)):(0,e.right)((0,e.right)(W.right.right))})};e.URI="Either";var O=function(j,L){return{show:function(W){return(0,e.isLeft)(W)?"left(".concat(j.show(W.left),")"):"right(".concat(L.show(W.right),")")}}};e.getShow=O;var F=function(j,L){return{equals:function(W,Le){return W===Le||((0,e.isLeft)(W)?(0,e.isLeft)(Le)&&j.equals(W.left,Le.left):(0,e.isRight)(Le)&&L.equals(W.right,Le.right))}}};e.getEq=F;var K=function(j){return{concat:function(L,W){return(0,e.isLeft)(W)?L:(0,e.isLeft)(L)?W:(0,e.right)(j.concat(L.right,W.right))}}};e.getSemigroup=K;var N=function(j){var L=(0,e.left)(j.empty);return{URI:e.URI,_E:void 0,compact:function(W){return(0,e.isLeft)(W)?W:W.right._tag==="None"?L:(0,e.right)(W.right.value)},separate:function(W){return(0,e.isLeft)(W)?(0,p.separated)(W,W):(0,e.isLeft)(W.right)?(0,p.separated)((0,e.right)(W.right.left),L):(0,p.separated)(L,(0,e.right)(W.right.right))}}};e.getCompactable=N;var J=function(j){var L=(0,e.left)(j.empty),W=(0,e.getCompactable)(j),Le=W.compact,U=W.separate,te=function(pe,Te){return(0,e.isLeft)(pe)||Te(pe.right)?pe:L},he=function(pe,Te){return(0,e.isLeft)(pe)?(0,p.separated)(pe,pe):Te(pe.right)?(0,p.separated)(L,(0,e.right)(pe.right)):(0,p.separated)((0,e.right)(pe.right),L)};return{URI:e.URI,_E:void 0,map:h,compact:Le,separate:U,filter:te,filterMap:function(pe,Te){if((0,e.isLeft)(pe))return pe;var at=Te(pe.right);return at._tag==="None"?L:(0,e.right)(at.value)},partition:he,partitionMap:function(pe,Te){if((0,e.isLeft)(pe))return(0,p.separated)(pe,pe);var at=Te(pe.right);return(0,e.isLeft)(at)?(0,p.separated)((0,e.right)(at.left),L):(0,p.separated)(L,(0,e.right)(at.right))}}};e.getFilterable=J;var Z=function(j){var L=(0,e.getFilterable)(j),W=(0,e.getCompactable)(j);return{URI:e.URI,_E:void 0,map:h,compact:L.compact,separate:L.separate,filter:L.filter,filterMap:L.filterMap,partition:L.partition,partitionMap:L.partitionMap,traverse:g,sequence:e.sequence,reduce:S,foldMap:I,reduceRight:T,wither:(0,A.witherDefault)(e.Traversable,W),wilt:(0,A.wiltDefault)(e.Traversable,W)}};e.getWitherable=Z;var ae=function(j){return{URI:e.URI,_E:void 0,map:h,ap:function(L,W){return(0,e.isLeft)(L)?(0,e.isLeft)(W)?(0,e.left)(j.concat(L.left,W.left)):L:(0,e.isLeft)(W)?W:(0,e.right)(L.right(W.right))},of:e.of}};e.getApplicativeValidation=ae;var ge=function(j){return{URI:e.URI,_E:void 0,map:h,alt:function(L,W){if((0,e.isRight)(L))return L;var Le=W();return(0,e.isLeft)(Le)?(0,e.left)(j.concat(L.left,Le.left)):Le}}};e.getAltValidation=ge;var se=function(j){return function(L){return(0,e.isLeft)(L)?L:(0,e.right)(j(L.right))}};e.map=se,e.Functor={URI:e.URI,map:h},e.of=e.right,e.Pointed={URI:e.URI,of:e.of};var k=function(j){return function(L){return(0,e.isLeft)(L)?L:(0,e.isLeft)(j)?j:(0,e.right)(L.right(j.right))}};e.apW=k,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 E=function(j){return function(L){return(0,e.isLeft)(L)?L:j(L.right)}};e.chainW=E,e.chain=e.chainW,e.Chain={URI:e.URI,map:h,ap:v,chain:_},e.Monad={URI:e.URI,map:h,ap:v,of:e.of,chain:_};var D=function(j,L){return function(W){return(0,e.isLeft)(W)?j:L(j,W.right)}};e.reduce=D;var ue=function(j){return function(L){return function(W){return(0,e.isLeft)(W)?j.empty:L(W.right)}}};e.foldMap=ue;var ke=function(j,L){return function(W){return(0,e.isLeft)(W)?j:L(W.right,j)}};e.reduceRight=ke,e.Foldable={URI:e.URI,reduce:S,foldMap:I,reduceRight:T};var Se=function(j){return function(L){return function(W){return(0,e.isLeft)(W)?j.of((0,e.left)(W.left)):j.map(L(W.right),e.right)}}};e.traverse=Se;var rt=function(j){return function(L){return(0,e.isLeft)(L)?j.of((0,e.left)(L.left)):j.map(L.right,e.right)}};e.sequence=rt,e.Traversable={URI:e.URI,map:h,reduce:S,foldMap:I,reduceRight:T,traverse:g,sequence:e.sequence};var bt=function(j,L){return function(W){return(0,e.isLeft)(W)?(0,e.left)(j(W.left)):(0,e.right)(L(W.right))}};e.bimap=bt;var Yt=function(j){return function(L){return(0,e.isLeft)(L)?(0,e.left)(j(L.left)):L}};e.mapLeft=Yt,e.Bifunctor={URI:e.URI,bimap:C,mapLeft:y};var Oe=function(j){return function(L){return(0,e.isLeft)(L)?j():L}};e.altW=Oe,e.alt=e.altW,e.Alt={URI:e.URI,map:h,alt:x};var mt=function(j){return function(L){return(0,e.isLeft)(L)?L:(0,e.right)(j(L))}};e.extend=mt,e.Extend={URI:e.URI,map:h,extend:w},e.ChainRec={URI:e.URI,map:h,ap:v,chain:_,chainRec:M},e.throwError=e.left,e.MonadThrow={URI:e.URI,map:h,ap:v,of:e.of,chain:_,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 lt=function(j,L){return function(W){return(0,e.isLeft)(W)?j(W.left):L(W.right)}};e.matchW=lt,e.foldW=e.matchW,e.match=e.matchW,e.fold=e.match;var Tt=function(j){return function(L){return(0,e.isLeft)(L)?j(L.left):L.right}};e.getOrElseW=Tt,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 sn=function(j){return(0,e.isLeft)(j)?(0,e.right)(j.left):(0,e.left)(j.right)};e.swap=sn;var Fo=function(j){return function(L){return(0,e.isLeft)(L)?j(L.left):L}};e.orElseW=Fo,e.orElse=e.orElseW;var Qa=function(j){return function(L){return L==null?(0,e.left)(j):(0,e.right)(L)}};e.fromNullable=Qa;var fi=function(j,L){try{return(0,e.right)(j())}catch(W){return(0,e.left)(L(W))}};e.tryCatch=fi;var qr=function(j,L){return function(){for(var W=[],Le=0;Le<arguments.length;Le++)W[Le]=arguments[Le];return(0,e.tryCatch)(function(){return j.apply(void 0,W)},L)}};e.tryCatchK=qr;var Zi=function(j){var L=(0,e.fromNullable)(j);return function(W){return(0,c.flow)(W,L)}};e.fromNullableK=Zi;var Mo=function(j){var L=(0,e.fromNullableK)(j);return function(W){return(0,e.chain)(L(W))}};e.chainNullableK=Mo,e.toUnion=(0,e.foldW)(c.identity,c.identity);function di(j){return j instanceof Error?j:new Error(String(j))}e.toError=di;function tr(j){return function(L,W){if(W===void 0){var Le=tr(j);return function(U){return Le(L,U)}}return(0,e.isLeft)(W)?!1:j.equals(L,W.right)}}e.elem=tr;var Qr=function(j){return function(L){return(0,e.isLeft)(L)?!1:j(L.right)}};e.exists=Qr,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 pi=function(j){return function(L){var W=j(0,f.head(L));if((0,e.isLeft)(W))return W;for(var Le=[W.right],U=1;U<L.length;U++){var te=j(U,L[U]);if((0,e.isLeft)(te))return te;Le.push(te.right)}return(0,e.right)(Le)}};e.traverseReadonlyNonEmptyArrayWithIndex=pi;var Ai=function(j){var L=(0,e.traverseReadonlyNonEmptyArrayWithIndex)(j);return function(W){return f.isNonEmpty(W)?L(W):e.ApT}};e.traverseReadonlyArrayWithIndex=Ai,e.traverseArrayWithIndex=e.traverseReadonlyArrayWithIndex;var ko=function(j){return(0,e.traverseReadonlyArrayWithIndex)(function(L,W){return j(W)})};e.traverseArray=ko,e.sequenceArray=(0,e.traverseArray)(c.identity);function Lo(j,L){return(0,e.tryCatch)(function(){return JSON.parse(j)},L)}e.parseJSON=Lo;var jo=function(j,L){return(0,e.tryCatch)(function(){var W=JSON.stringify(j);if(typeof W!="string")throw new Error("Converting unsupported structure to JSON");return W},L)};e.stringifyJSON=jo,e.either={URI:e.URI,map:h,of:e.of,ap:v,chain:_,reduce:S,foldMap:I,reduceRight:T,traverse:g,sequence:e.sequence,bimap:C,mapLeft:y,alt:x,extend:w,chainRec:M,throwError:e.throwError},e.getApplySemigroup=(0,o.getApplySemigroup)(e.Apply),e.getApplyMonoid=(0,i.getApplicativeMonoid)(e.Applicative);var Vr=function(j,L){return(0,o.getApplySemigroup)((0,e.getApplicativeValidation)(j))(L)};e.getValidationSemigroup=Vr;var Va=function(j,L){return(0,i.getApplicativeMonoid)((0,e.getApplicativeValidation)(j))(L)};e.getValidationMonoid=Va;function Dc(j){var L=(0,e.getApplicativeValidation)(j).ap,W=(0,e.getAltValidation)(j).alt;return{URI:e.URI,_E:void 0,map:h,of:e.of,chain:_,bimap:C,mapLeft:y,reduce:S,foldMap:I,reduceRight:T,extend:w,traverse:g,sequence:e.sequence,chainRec:M,throwError:e.throwError,ap:L,alt:W}}e.getValidation=Dc})(un);var Ze=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)}}(),Tl=function(){return Tl=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},Tl.apply(this,arguments)},Lbe=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=wt,et=function(e,t,n){return Eo([{value:e,context:t,message:n}])},Ee=ze,Ce=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 ie(a)?a:t.validate(a.right,o)},this.encode===Pe&&t.encode===Pe?Pe: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}(),Pe=function(e){return e};function A4(e){return e.displayName||e.name||"<function".concat(e.length,">")}function jbe(e,t){return{key:e,type:t}}function Ei(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 ta(e,t){for(var n=t.length,r=0;r<n;r++)e.push(t[r])}var Ts=Object.prototype.hasOwnProperty;function R1(e){return Object.keys(e).map(function(t){return"".concat(t,": ").concat(e[t].name)}).join(", ")}function Gd(e){for(var t=0;t<e.length;t++)if(e[t].encode!==Pe)return!1;return!0}function h4(e){return"{ ".concat(R1(e)," }")}function m4(e){return"Partial<".concat(e,">")}function Ube(e,t,n,r){r===void 0&&(r="{ [K in ".concat(t.name,"]: ").concat(n.name," }"));var i=e.length;return new IE(r,function(o){return Qn.is(o)&&e.every(function(a){return n.is(o[a])})},function(o,a){var u=Qn.validate(o,a);if(ie(u))return u;for(var s=u.right,c={},l=[],f=!1,p=0;p<i;p++){var A=e[p],h=s[A],v=n.validate(h,Ei(a,A,n,h));if(ie(v))ta(l,v.left);else{var _=v.right;f=f||_!==h,c[A]=_}}return l.length>0?Eo(l):Ee(f||Object.keys(s).length!==i?c:s)},n.encode===Pe?Pe: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 CE(e){var t;if(y4(e)){var n=e.value;if(zi.is(n))return t={},t[n]=null,t}else{if(Nbe(e))return e.keys;if(C4(e)){var r=e.types.map(function(i){return CE(i)});return r.some(vm.is)?void 0:Object.assign.apply(Object,Lbe([{}],r,!1))}}}function Bbe(e,t,n){return n===void 0&&(n="{ [K in ".concat(e.name,"]: ").concat(t.name," }")),new IE(n,function(r){return Qn.is(r)?Object.keys(r).every(function(i){return e.is(i)&&t.is(r[i])}):TO(t)&&Array.isArray(r)},function(r,i){if(Qn.is(r)){for(var o={},a=[],u=Object.keys(r),s=u.length,c=!1,l=0;l<s;l++){var f=u[l],p=r[f],A=e.validate(f,Ei(i,f,e,f));if(ie(A))ta(a,A.left);else{var h=A.right;c=c||h!==f,f=h;var v=t.validate(p,Ei(i,f,t,p));if(ie(v))ta(a,v.left);else{var _=v.right;c=c||_!==p,o[f]=_}}}return a.length>0?Eo(a):Ee(c?o:r)}return TO(t)&&Array.isArray(r)?Ee(r):et(r,i)},e.encode===Pe&&t.encode===Pe?Pe: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 g4(e){return"("+e.map(function(t){return t.name}).join(" | ")+")"}function O1(e,t){for(var n=!0,r=!0,i=!Qn.is(e),o=0,a=t;o<a.length;o++){var u=a[o];u!==e&&(n=!1),Qn.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)(!Ts.call(s,f)||i||u[f]!==e[f])&&(s[f]=u[f])}return s}function F1(e){switch(e._tag){case"RefinementType":case"ReadonlyType":return F1(e.type);case"InterfaceType":case"StrictType":case"PartialType":return e.props;case"IntersectionType":return e.types.reduce(function(t,n){return Object.assign(t,F1(n))},{})}}function IO(e,t){for(var n=Object.getOwnPropertyNames(e),r=!1,i={},o=0;o<n.length;o++){var a=n[o];Ts.call(t,a)?i[a]=e[a]:r=!0}return r?i:e}function Wbe(e){return b4(e)?"{| ".concat(R1(e.props)," |}"):qbe(e)?m4("{| ".concat(R1(e.props)," |}")):"Exact<".concat(e.name,">")}function Kbe(e){return e.length>0}var rr={};function v4(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 Pbe(e,t){if(e===rr)return t;if(t===rr)return e;var n=Object.assign({},e);for(var r in t)if(Ts.call(e,r)){var i=v4(e[r],t[r]);if(Kbe(i))n[r]=i;else{n=rr;break}}else n[r]=t[r];return n}function Dbe(e,t){if(e===rr||t===rr)return rr;var n=rr;for(var r in e)if(Ts.call(t,r)){var i=v4(e[r],t[r]);i.length===0&&(n===rr&&(n={}),n[r]=e[r].concat(t[r]))}return n}function TO(e){return e._tag==="AnyType"}function y4(e){return e._tag==="LiteralType"}function Nbe(e){return e._tag==="KeyofType"}function b4(e){return e._tag==="InterfaceType"}function qbe(e){return e._tag==="PartialType"}function Qbe(e){return e._tag==="StrictType"}function Vbe(e){return e._tag==="ExactType"}function zbe(e){return e._tag==="RefinementType"}function Hbe(e){return e._tag==="IntersectionType"}function C4(e){return e._tag==="UnionType"}function Ybe(e){return e._tag==="RecursiveType"}var ub=[];function Ga(e){if(ub.indexOf(e)!==-1)return rr;if(b4(e)||Qbe(e)){var t=rr;for(var n in e.props){var r=e.props[n];y4(r)&&(t===rr&&(t={}),t[n]=[r.value])}return t}else{if(Vbe(e)||zbe(e))return Ga(e.type);if(Hbe(e))return e.types.reduce(function(o,a){return Pbe(o,Ga(a))},rr);if(C4(e))return e.types.slice(1).reduce(function(o,a){return Dbe(o,Ga(a))},Ga(e.types[0]));if(Ybe(e)){ub.push(e);var i=Ga(e.type);return ub.pop(),i}}return rr}function S4(e){var t=Ga(e[0]),n=Object.keys(t),r=e.length,i=function(c){for(var l=t[c].slice(),f=[t[c]],p=1;p<r;p++){var A=e[p],h=Ga(A),v=h[c];if(v===void 0)return"continue-keys";if(v.some(function(_){return l.indexOf(_)!==-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 _4=function(e){Ze(t,e);function t(){var n=e.call(this,"null",function(r){return r===null},function(r,i){return n.is(r)?Ee(r):et(r,i)},Pe)||this;return n._tag="NullType",n}return t}(Ce),M1=new _4,I4=function(e){Ze(t,e);function t(){var n=e.call(this,"undefined",function(r){return r===void 0},function(r,i){return n.is(r)?Ee(r):et(r,i)},Pe)||this;return n._tag="UndefinedType",n}return t}(Ce),vm=new I4,T4=function(e){Ze(t,e);function t(){var n=e.call(this,"void",vm.is,vm.validate,Pe)||this;return n._tag="VoidType",n}return t}(Ce),xO=new T4,x4=function(e){Ze(t,e);function t(){var n=e.call(this,"unknown",function(r){return!0},Ee,Pe)||this;return n._tag="UnknownType",n}return t}(Ce),Gbe=new x4,w4=function(e){Ze(t,e);function t(){var n=e.call(this,"string",function(r){return typeof r=="string"},function(r,i){return n.is(r)?Ee(r):et(r,i)},Pe)||this;return n._tag="StringType",n}return t}(Ce),zi=new w4,$4=function(e){Ze(t,e);function t(){var n=e.call(this,"number",function(r){return typeof r=="number"},function(r,i){return n.is(r)?Ee(r):et(r,i)},Pe)||this;return n._tag="NumberType",n}return t}(Ce),Oc=new $4,E4=function(e){Ze(t,e);function t(){var n=e.call(this,"bigint",function(r){return typeof r=="bigint"},function(r,i){return n.is(r)?Ee(r):et(r,i)},Pe)||this;return n._tag="BigIntType",n}return t}(Ce),Jbe=new E4,R4=function(e){Ze(t,e);function t(){var n=e.call(this,"boolean",function(r){return typeof r=="boolean"},function(r,i){return n.is(r)?Ee(r):et(r,i)},Pe)||this;return n._tag="BooleanType",n}return t}(Ce),h0=new R4,O4=function(e){Ze(t,e);function t(){var n=e.call(this,"UnknownArray",Array.isArray,function(r,i){return n.is(r)?Ee(r):et(r,i)},Pe)||this;return n._tag="AnyArrayType",n}return t}(Ce),xl=new O4,F4=function(e){Ze(t,e);function t(){var n=e.call(this,"UnknownRecord",function(r){var i=Object.prototype.toString.call(r);return i==="[object Object]"||i==="[object Window]"},function(r,i){return n.is(r)?Ee(r):et(r,i)},Pe)||this;return n._tag="AnyDictionaryType",n}return t}(Ce),Qn=new F4,M4=function(e){Ze(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.value=a,u._tag="LiteralType",u}return t}(Ce);function sh(e,t){t===void 0&&(t=JSON.stringify(e));var n=function(r){return r===e};return new M4(t,n,function(r,i){return n(r)?Ee(e):et(r,i)},Pe,e)}var k4=function(e){Ze(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.keys=a,u._tag="KeyofType",u}return t}(Ce);function Zbe(e,t){t===void 0&&(t=Object.keys(e).map(function(r){return JSON.stringify(r)}).join(" | "));var n=function(r){return zi.is(r)&&Ts.call(e,r)};return new k4(t,n,function(r,i){return n(r)?Ee(r):et(r,i)},Pe,e)}var L4=function(e){Ze(t,e);function t(n,r,i,o,a,u){var s=e.call(this,n,r,i,o)||this;return s.type=a,s.predicate=u,s._tag="RefinementType",s}return t}(Ce);function m0(e,t,n){return wE(e,t,n)}var ym=m0(Oc,function(e){return Number.isInteger(e)},"Int"),SE=function(e){Ze(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.runDefinition=a,u._tag="RecursiveType",u}return t}(Ce);Object.defineProperty(SE.prototype,"type",{get:function(){return this.runDefinition()},enumerable:!0,configurable:!0});function _E(e,t){var n,r=function(){return n||(n=t(i),n.name=e),n},i=new SE(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 j4=function(e){Ze(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.type=a,u._tag="ArrayType",u}return t}(Ce);function g0(e,t){return t===void 0&&(t="Array<".concat(e.name,">")),new j4(t,function(n){return xl.is(n)&&n.every(e.is)},function(n,r){var i=xl.validate(n,r);if(ie(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,Ei(r,String(c),e,l));if(ie(f))ta(s,f.left);else{var p=f.right;p!==l&&(u===o&&(u=o.slice()),u[c]=p)}}return s.length>0?Eo(s):Ee(u)},e.encode===Pe?Pe:function(n){return n.map(e.encode)},e)}var U4=function(e){Ze(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.props=a,u._tag="InterfaceType",u}return t}(Ce);function k1(e,t){t===void 0&&(t=h4(e));var n=Object.keys(e),r=n.map(function(o){return e[o]}),i=n.length;return new U4(t,function(o){if(Qn.is(o)){for(var a=0;a<i;a++){var u=n[a],s=o[u];if(s===void 0&&!Ts.call(o,u)||!r[a].is(s))return!1}return!0}return!1},function(o,a){var u=Qn.validate(o,a);if(ie(u))return u;for(var s=u.right,c=s,l=[],f=0;f<i;f++){var p=n[f],A=c[p],h=r[f],v=h.validate(A,Ei(a,p,h,A));if(ie(v))ta(l,v.left);else{var _=v.right;(_!==A||_===void 0&&!Ts.call(c,p))&&(c===s&&(c=Tl({},s)),c[p]=_)}}return l.length>0?Eo(l):Ee(c)},Gd(r)?Pe:function(o){for(var a=Tl({},o),u=0;u<i;u++){var s=n[u],c=r[u].encode;c!==Pe&&(a[s]=c(o[s]))}return a},e)}var B4=function(e){Ze(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.props=a,u._tag="PartialType",u}return t}(Ce);function Xbe(e,t){t===void 0&&(t=m4(h4(e)));var n=Object.keys(e),r=n.map(function(o){return e[o]}),i=n.length;return new B4(t,function(o){if(Qn.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=Qn.validate(o,a);if(ie(u))return u;for(var s=u.right,c=s,l=[],f=0;f<i;f++){var p=n[f],A=c[p],h=e[p],v=h.validate(A,Ei(a,p,h,A));if(ie(v))A!==void 0&&ta(l,v.left);else{var _=v.right;_!==A&&(c===s&&(c=Tl({},s)),c[p]=_)}}return l.length>0?Eo(l):Ee(c)},Gd(r)?Pe:function(o){for(var a=Tl({},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 IE=function(e){Ze(t,e);function t(n,r,i,o,a,u){var s=e.call(this,n,r,i,o)||this;return s.domain=a,s.codomain=u,s._tag="DictionaryType",s}return t}(Ce);function TE(e,t,n){var r=CE(e);return r?Ube(Object.keys(r),e,t,n):Bbe(e,t,n)}var xE=function(e){Ze(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.types=a,u._tag="UnionType",u}return t}(Ce);function ch(e,t){t===void 0&&(t=g4(e));var n=S4(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 bm(t,function(u){if(Qn.is(u)){var s=a(u[r]);return s!==void 0?e[s].is(u):!1}return!1},function(u,s){var c=Qn.validate(u,s);if(ie(c))return c;var l=c.right,f=a(l[r]);if(f===void 0)return et(u,s);var p=e[f];return p.validate(l,Ei(s,String(f),p,l))},Gd(e)?Pe: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 xE(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],p=f.validate(u,Ei(s,String(l),f,u));if(ie(p))ta(c,p.left);else return Ee(p.right)}return Eo(c)},Gd(e)?Pe: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 W4=function(e){Ze(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.types=a,u._tag="IntersectionType",u}return t}(Ce);function e1e(e,t){t===void 0&&(t="(".concat(e.map(function(r){return r.name}).join(" & "),")"));var n=e.length;return new W4(t,function(r){return e.every(function(i){return i.is(r)})},e.length===0?Ee:function(r,i){for(var o=[],a=[],u=0;u<n;u++){var s=e[u],c=s.validate(r,Ei(i,String(u),s,r));ie(c)?ta(a,c.left):o.push(c.right)}return a.length>0?Eo(a):Ee(O1(r,o))},e.length===0?Pe:function(r){return O1(r,e.map(function(i){return i.encode(r)}))},e)}var K4=function(e){Ze(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.types=a,u._tag="TupleType",u}return t}(Ce);function t1e(e,t){t===void 0&&(t="[".concat(e.map(function(r){return r.name}).join(", "),"]"));var n=e.length;return new K4(t,function(r){return xl.is(r)&&r.length===n&&e.every(function(i,o){return i.is(r[o])})},function(r,i){var o=xl.validate(r,i);if(ie(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],p=f.validate(l,Ei(i,String(c),f,l));if(ie(p))ta(s,p.left);else{var A=p.right;A!==l&&(u===a&&(u=a.slice()),u[c]=A)}}return s.length>0?Eo(s):Ee(u)},Gd(e)?Pe:function(r){return e.map(function(i,o){return i.encode(r[o])})},e)}var P4=function(e){Ze(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.type=a,u._tag="ReadonlyType",u}return t}(Ce);function n1e(e,t){return t===void 0&&(t="Readonly<".concat(e.name,">")),new P4(t,e.is,e.validate,e.encode,e)}var D4=function(e){Ze(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.type=a,u._tag="ReadonlyArrayType",u}return t}(Ce);function N4(e,t){t===void 0&&(t="ReadonlyArray<".concat(e.name,">"));var n=g0(e);return new D4(t,n.is,n.validate,n.encode,e)}var Jd=function(e,t){return Q4(k1(e),t)},q4=function(e){Ze(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.type=a,u._tag="ExactType",u}return t}(Ce);function Q4(e,t){t===void 0&&(t=Wbe(e));var n=F1(e);return new q4(t,e.is,function(r,i){var o=Qn.validate(r,i);if(ie(o))return o;var a=e.validate(r,i);return ie(a)?a:ze(IO(a.right,n))},function(r){return e.encode(IO(r,n))},e)}var V4=function(e){Ze(t,e);function t(){var n=e.call(this,"Function",function(r){return typeof r=="function"},function(r,i){return n.is(r)?Ee(r):et(r,i)},Pe)||this;return n._tag="FunctionType",n}return t}(Ce),r1e=new V4,bm=function(e){Ze(t,e);function t(n,r,i,o,a,u){var s=e.call(this,n,r,i,o,a)||this;return s.tag=u,s}return t}(xE),i1e=function(e,t,n){n===void 0&&(n=g4(t));var r=ch(t,n);return r instanceof bm?r:(console.warn("[io-ts] Cannot build a tagged union for ".concat(n,", returning a de-optimized union")),new bm(n,r.is,r.validate,r.encode,t,e))},o1e=function(e,t){return{value:e,context:t}},z4=function(e){return[{key:"",type:e}]},H4=function(e){Ze(t,e);function t(){var n=e.call(this,"never",function(r){return!1},function(r,i){return et(r,i)},function(){throw new Error("cannot encode never")})||this;return n._tag="NeverType",n}return t}(Ce),a1e=new H4,Y4=function(e){Ze(t,e);function t(){var n=e.call(this,"any",function(r){return!0},Ee,Pe)||this;return n._tag="AnyType",n}return t}(Ce),u1e=new Y4,s1e=Qn,G4=function(e){Ze(t,e);function t(){var n=e.call(this,"object",function(r){return r!==null&&typeof r=="object"},function(r,i){return n.is(r)?Ee(r):et(r,i)},Pe)||this;return n._tag="ObjectType",n}return t}(Ce),c1e=new G4;function wE(e,t,n){return n===void 0&&(n="(".concat(e.name," | ").concat(A4(t),")")),new L4(n,function(r){return e.is(r)&&t(r)},function(r,i){var o=e.validate(r,i);if(ie(o))return o;var a=o.right;return t(a)?Ee(a):et(a,i)},e.encode,e,t)}var l1e=wE(Oc,Number.isInteger,"Integer"),f1e=TE,d1e=function(e){Ze(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.props=a,u._tag="StrictType",u}return t}(Ce);function p1e(e){return e}function A1e(e){return function(){return e}}const h1e=Object.freeze(Object.defineProperty({__proto__:null,AnyArrayType:O4,AnyDictionaryType:F4,AnyType:Y4,Array:xl,ArrayType:j4,BigIntType:E4,BooleanType:R4,Dictionary:s1e,DictionaryType:IE,ExactType:q4,Function:r1e,FunctionType:V4,Int:ym,Integer:l1e,InterfaceType:U4,IntersectionType:W4,KeyofType:k4,LiteralType:M4,NeverType:H4,NullType:_4,NumberType:$4,ObjectType:G4,PartialType:B4,ReadonlyArrayType:D4,ReadonlyType:P4,RecursiveType:SE,RefinementType:L4,StrictType:d1e,StringType:w4,TaggedUnionType:bm,TupleType:K4,Type:Ce,UndefinedType:I4,UnionType:xE,UnknownArray:xl,UnknownRecord:Qn,UnknownType:x4,VoidType:T4,alias:A1e,any:u1e,appendContext:Ei,array:g0,bigint:Jbe,boolean:h0,brand:m0,clean:p1e,dictionary:f1e,emptyTags:rr,exact:Q4,failure:et,failures:Eo,getContextEntry:jbe,getDefaultContext:z4,getDomainKeys:CE,getFunctionName:A4,getIndex:S4,getTags:Ga,getValidationError:o1e,identity:Pe,interface:k1,intersection:e1e,keyof:Zbe,literal:sh,mergeAll:O1,never:a1e,null:M1,nullType:M1,number:Oc,object:c1e,partial:Xbe,readonly:n1e,readonlyArray:N4,record:TE,recursion:_E,refinement:wE,strict:Jd,string:zi,success:Ee,taggedUnion:i1e,tuple:t1e,type:k1,undefined:vm,union:ch,unknown:Gbe,void:xO,voidType:xO},Symbol.toStringTag,{value:"Module"})),Y=Ws(h1e);var lh={};Object.defineProperty(lh,"__esModule",{value:!0});lh.ContentPath=void 0;const wO="::";lh.ContentPath={serialize(e){return e.map(t=>t.key).join(wO)},current(e){return e[e.length-1]},append(e,t){return e+wO+t},make(e){return e.reduce((t,{key:n,type:r})=>n?t.concat({key:n,type:r}):t,[])}};var Fc={},v0={};Object.defineProperty(v0,"__esModule",{value:!0});v0.getAssetOrThrow=void 0;const m1e=e=>t=>{const n=e[t];if(!n)throw new Error(`Missing asset with id '${t}'!`);return n};v0.getAssetOrThrow=m1e;var y0={};Object.defineProperty(y0,"__esModule",{value:!0});y0.getEmbedOrThrow=void 0;const g1e=e=>t=>{const n=e[t];if(!n)throw new Error(`Missing embed with url '${t}'`);return n};y0.getEmbedOrThrow=g1e;var b0={},Je={};const Hi=Ws(Ok);function J4(e,t,n){return n===void 0&&(n=e.name),new Ce(n,e.is,e.validate,function(r){return t(e.encode(r))})}const v1e=Object.freeze(Object.defineProperty({__proto__:null,mapOutput:J4},Symbol.toStringTag,{value:"Module"}));var Z4=m0(zi,function(e){return e.length>0},"NonEmptyString");function X4(e,t){t===void 0&&(t="NonEmptyArray<"+e.name+">");var n=g0(e);return new Ce(t,function(r){return n.is(r)&&qt(r)},function(r,i){return ce(n.validate(r,i),ri(function(o){var a=BS(o);return Ne(a)?et(r,i):Ee(a.value)}))},function(r){return n.encode(r)})}function e9(e,t,n){n===void 0&&(n="Set<"+e.name+">");var r=g0(e),i=z6(t),o=q6(t);return new Ce(n,function(a){return a instanceof Set&&V6(e.is)(a)},function(a,u){return ce(r.validate(a,u),ri(function(s){var c=o(s);return c.size!==s.length?et(a,u):Ee(c)}))},function(a){return r.encode(i(a))})}function y1e(e,t,n){return n===void 0&&(n="ReadonlySet<"+e.name+">"),e9(e,t,n)}function $E(e,t){return new Ce(e,t,function(n,r){return t(n)?Ee(n):et(n,r)},Pe)}var b1e=function(e){return e instanceof Date},C1e=$E("Date",b1e),S1e=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))},_1e=function(e,t){return{get:e,reverseGet:t}},t9=function(e){return Nu(e.get,z(e.reverseGet,lr))},I1e=function(e){return Mc(z(e.get,It),e.reverseGet)},T1e=function(e){return Ka(z(e.get,It),z(e.reverseGet,lr))},x1e=function(e){return ud(function(t){return function(n){return function(r){return t.map(n(e.get(r)),function(i){return e.reverseGet(i)})}}})},Nu=function(e,t){return{get:e,set:t}},EE=function(e){return Ka(z(e.get,It),e.set)},w1e=function(e){return ud(function(t){return function(n){return function(r){return t.map(n(e.get(r)),function(i){return e.set(i)(r)})}}})},n9=function(e){return function(t){return Nu(function(n){return e.get(t.get(n))},function(n){return function(r){return t.set(e.set(n)(t.get(r)))(r)}})}},$1e=function(e){return function(t){return Mc(z(t.getOption,Hp(e.getOption)),z(e.reverseGet,t.reverseGet))}},E1e=function(e){return function(t){return kc(RE(e))(EE(t))}},R1e=function(){return Nu(P,lr)},O1e=function(e){return function(t){return Nu(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)}})}},F1e=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(n){return Nu(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}})}},M1e=function(e){return function(t){return Nu(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)}})}},k1e=function(e){return function(t){return ce(t,n9(nCe().at(e)))}},Mc=function(e,t){return{getOption:e,reverseGet:t}},RE=function(e){return Ka(e.getOption,function(t){return i9(t)(e)})},r9=function(e){return ud(function(t){return function(n){return function(r){return ce(e.getOption(r),_u(function(){return t.of(r)},function(i){return t.map(n(i),function(o){return i9(o)(e)(r)})}))}}})},L1e=function(e){return function(t){return function(n){return ce(t.getOption(n),mo(function(r){var i=e(r);return i===r?n:t.reverseGet(i)}))}}},j1e=function(e){return function(t){var n=L1e(e)(t);return function(r){return ce(n(r),mI(function(){return r}))}}},i9=function(e){return j1e(function(){return e})},U1e=function(e){return function(t){return kc(EE(e))(RE(t))}},B1e=function(){return Mc(Hs,P)},OE=function(e){return Mc(mv(e),P)},W1e=function(){return Mc(P,It)},K1e=function(){return Mc(pf,ze)},P1e=function(){return Mc(function(e){return ie(e)?It(e.left):ot},wt)},Ka=function(e,t){return{getOption:e,set:t}},D1e=function(e){return ud(function(t){return function(n){return function(r){return ce(e.getOption(r),_u(function(){return t.of(r)},function(i){return t.map(n(i),function(o){return e.set(o)(r)})}))}}})},o9=function(e){return function(t){return function(n){return ce(t.getOption(n),mo(function(r){var i=e(r);return i===r?n:t.set(i)(n)}))}}},a9=function(e){return function(t){var n=o9(e)(t);return function(r){return ce(n(r),mI(function(){return r}))}}},kc=function(e){return function(t){return Ka(z(t.getOption,Hp(e.getOption)),function(n){return a9(e.set(n))(t)})}},N1e=function(e){return function(t){return ce(t,kc(Z1e().index(e)))}},q1e=function(e){return function(t){return ce(t,kc(X1e().index(e)))}},Q1e=function(e){return function(t){return ce(t,kc(eCe().index(e)))}},V1e=function(e){return Ka(Gg(e),function(t){return function(n){return ce(Yg(e)(n),_u(function(){return n},function(r){return av(r,t,n)}))}})},u9=function(e,t,n){if(n[e]===t)return n;var r=S1e([n[0]],n.slice(1),!0);return r[e]=t,r},z1e=function(e){return Ka(Gg(e),function(t){return function(n){return ce(Yg(e)(n),_u(function(){return n},function(r){return u9(r,t,n)}))}})},ud=function(e){return{modifyF:e}};function FE(e){return function(t){return ud(function(n){return function(r){return t.modifyF(n)(e.modifyF(n)(r))}})}}var H1e={URI:"Identity",map:function(e,t){return t(e)},of:P,ap:function(e,t){return e(t)}},Y1e=function(e){return e.URI==="Identity"};function G1e(e){return function(){return ud(function(t){var n=Y1e(t)?e.map:e.traverse(t);return function(r){return function(i){return n(i,r)}}})}}function J1e(e){return FE(G1e(e)())}var ME=function(e){return{index:e}},Z1e=function(){return ME(function(e){return Ka(function(t){return bs(e,t)},function(t){return function(n){return ce(bs(e,n),_u(function(){return n},function(){return av(e,t,n)}))}})})},X1e=function(){return ME(function(e){return Ka(function(t){return bs(e,t)},function(t){return function(n){return ce(bs(e,n),_u(function(){return n},function(){return u9(e,t,n)}))}})})},eCe=function(){return ME(function(e){return Ka(function(t){return Cs(e,t)},function(t){return function(n){return n[e]===t||Ne(Cs(e,n))?n:mw(e,t)(n)}})})},tCe=function(e){return{at:e}};function nCe(){return tCe(function(e){return Nu(function(t){return Cs(e,t)},_u(function(){return iw(e)},function(t){return mw(e,t)}))})}var s9=_1e,L1=t9,j1=I1e,U1=T1e,B1=x1e,rCe=function(e){return function(t){return s9(z(t.get,e.get),z(e.reverseGet,t.reverseGet))}},iCe=function(e){return s9(e.reverseGet,e.get)},oCe=function(e){return function(t){return function(n){return t.reverseGet(e(t.get(n)))}}},c9=Nu,Cm=R1e,cu=EE,wl=w1e,xs=n9,aCe=xs,uCe=z(t9,xs),Lc=E1e,kE=function(e){return z(cu,kc(e))},sCe=function(e){return z(wl,FE(e))},l9=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 cCe(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 lCe=function(e){return Lc(B1e())(e)};function fCe(e){return Lc(OE(e))}var f9=O1e,d9=F1e,dCe=M1e,pCe=function(e){return z(cu,N1e(e))},ACe=function(e){return z(cu,q1e(e))},hCe=function(e){return z(cu,Q1e(e))},mCe=k1e,gCe=Lc(W1e()),vCe=Lc(K1e()),yCe=Lc(P1e());function bCe(e){return z(wl,J1e(e))}function CCe(e){return kE(V1e(e))}function SCe(e){return kE(z1e(e))}var _Ce=function(e,t){return function(n){return p9(n,e,t)}},p9=function(e,t,n){return c9(z(e.get,t),z(n,e.set))},C0="monocle-ts/Lens",ICe={URI:C0,imap:p9},A9={URI:C0,compose:function(e,t){return xs(e)(t)}},TCe={URI:C0,compose:A9.compose,id:Cm};const xCe=Object.freeze(Object.defineProperty({__proto__:null,Category:TCe,Invariant:ICe,Semigroupoid:A9,URI:C0,asOptional:cu,asTraversal:wl,atKey:mCe,component:dCe,compose:xs,composeIso:uCe,composeLens:aCe,composeOptional:kE,composePrism:Lc,composeTraversal:sCe,filter:fCe,findFirst:CCe,findFirstNonEmpty:SCe,fromNullable:lCe,id:Cm,imap:_Ce,index:pCe,indexNonEmpty:ACe,key:hCe,left:yCe,lens:c9,modify:l9,modifyF:cCe,prop:f9,props:d9,right:vCe,some:gCe,traverse:bCe},Symbol.toStringTag,{value:"Module"}));var $O=D1e,is=kc,wCe=o9,$Ce=a9,ECe=OE,W1=RE,K1=r9,P1=$1e,RCe=U1e,Ho=FE,h9=function(e){return function(t){return t.modifyF(H1e)(e)}},OCe=function(e){return h9(function(){return e})};function FCe(e){return Ho(r9(OE(e)))}var EO=function(e){return new g9(e.get,e.reverseGet)},ul=function(e){return new LE(e.get,e.set)},xd=function(e){return new v9(e.getOption,e.reverseGet)},Gr=function(e){return new MCe(e.getOption,e.set)},Sr=function(e){return new kCe(e.modifyF)},m9=function(e,t,n){var r;return n===e[t]?e:Object.assign({},e,(r={},r[t]=n,r))},g9=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 EO(iCe(this))},e.prototype.modify=function(t){return oCe(t)(this)},e.prototype.asLens=function(){return ul(L1(this))},e.prototype.asPrism=function(){return xd(j1(this))},e.prototype.asOptional=function(){return Gr(U1(this))},e.prototype.asTraversal=function(){return Sr(B1(this))},e.prototype.asFold=function(){var t=this;return new sd(function(){return function(n){return function(r){return n(t.get(r))}}})},e.prototype.asGetter=function(){var t=this;return new b9(function(n){return t.get(n)})},e.prototype.asSetter=function(){var t=this;return new fh(function(n){return t.modify(n)})},e.prototype.compose=function(t){return EO(rCe(t)(this))},e.prototype.composeIso=function(t){return this.compose(t)},e.prototype.composeLens=function(t){return ul(ce(this,L1,xs(t)))},e.prototype.composePrism=function(t){return xd(ce(this,j1,P1(t)))},e.prototype.composeOptional=function(t){return Gr(ce(this,U1,is(t)))},e.prototype.composeTraversal=function(t){return Sr(ce(this,B1,Ho(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}(),LE=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 ul(ce(Cm(),f9(t)))}},e.fromProps=function(){return function(t){return ul(ce(Cm(),d9.apply(xCe,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 m9(i,t,r)}})}},e.prototype.modify=function(t){return l9(t)(this)},e.prototype.asOptional=function(){return Gr(cu(this))},e.prototype.asTraversal=function(){return Sr(wl(this))},e.prototype.asSetter=function(){var t=this;return new fh(function(n){return t.modify(n)})},e.prototype.asGetter=function(){var t=this;return new b9(function(n){return t.get(n)})},e.prototype.asFold=function(){var t=this;return new sd(function(){return function(n){return function(r){return n(t.get(r))}}})},e.prototype.compose=function(t){return ul(xs(t)(this))},e.prototype.composeLens=function(t){return this.compose(t)},e.prototype.composeGetter=function(t){return this.asGetter().compose(t)},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeOptional=function(t){return Gr(ce(this,cu,is(t)))},e.prototype.composeTraversal=function(t){return Sr(ce(this,wl,Ho(t)))},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e.prototype.composeIso=function(t){return ul(ce(this,xs(ce(t,L1))))},e.prototype.composePrism=function(t){return Gr(Lc(t)(this))},e}(),v9=function(){function e(t,n){this.getOption=t,this.reverseGet=n,this._tag="Prism"}return e.fromPredicate=function(t){return xd(ECe(t))},e.some=function(){return y9},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 W2.map(n.getOption(r),function(i){var o=t(i);return o===i?r:n.reverseGet(o)})}},e.prototype.set=function(t){return this.modify(function(){return t})},e.prototype.asOptional=function(){return Gr(W1(this))},e.prototype.asTraversal=function(){return Sr(K1(this))},e.prototype.asSetter=function(){var t=this;return new fh(function(n){return t.modify(n)})},e.prototype.asFold=function(){var t=this;return new sd(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 xd(P1(t)(this))},e.prototype.composePrism=function(t){return this.compose(t)},e.prototype.composeOptional=function(t){return Gr(ce(this,W1,is(t)))},e.prototype.composeTraversal=function(t){return Sr(ce(this,K1,Ho(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 xd(ce(this,P1(ce(t,j1))))},e.prototype.composeLens=function(t){return Gr(RCe(t)(this))},e.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},e}(),y9=new v9(P,It),MCe=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:m9(r,t,n)}})}},e.fromOptionProp=function(){var t=LE.fromProp();return function(n){return t(n).composePrism(y9)}},e.prototype.modify=function(t){return $Ce(t)(this)},e.prototype.modifyOption=function(t){return wCe(t)(this)},e.prototype.asTraversal=function(){return Sr($O(this))},e.prototype.asFold=function(){var t=this;return new sd(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 fh(function(n){return t.modify(n)})},e.prototype.compose=function(t){return Gr(is(t)(this))},e.prototype.composeOptional=function(t){return this.compose(t)},e.prototype.composeTraversal=function(t){return Sr(ce(this,$O,Ho(t)))},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e.prototype.composeLens=function(t){return Gr(ce(this,is(ce(t,cu))))},e.prototype.composePrism=function(t){return Gr(ce(this,is(ce(t,W1))))},e.prototype.composeIso=function(t){return Gr(ce(this,is(ce(t,U1))))},e.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},e}(),kCe=function(){function e(t){this.modifyF=t,this._tag="Traversal"}return e.prototype.modify=function(t){return h9(t)(this)},e.prototype.set=function(t){return OCe(t)(this)},e.prototype.filter=function(t){return Sr(FCe(t)(this))},e.prototype.asFold=function(){var t=this;return new sd(function(n){return function(r){return t.modifyF(D2(n))(function(i){return Af(r(i))})}})},e.prototype.asSetter=function(){var t=this;return new fh(function(n){return t.modify(n)})},e.prototype.compose=function(t){return Sr(Ho(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 Sr(ce(this,Ho(ce(t,wl))))},e.prototype.composePrism=function(t){return Sr(ce(this,Ho(ce(t,K1))))},e.prototype.composeIso=function(t){return Sr(ce(this,Ho(ce(t,B1))))},e.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},e}(),b9=function(){function e(t){this.get=t,this._tag="Getter"}return e.prototype.asFold=function(){var t=this;return new sd(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}(),sd=function(){function e(t){this.foldMap=t,this._tag="Fold",this.getAll=t(Y_())(Su),this.exist=t(mP),this.all=t(hP),this.foldMapFirst=t(K2())}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(mv(t))},e.prototype.headOption=function(t){return this.find(function(){return!0})(t)},e}(),fh=function(){function e(t){this.modify=t,this._tag="Setter"}return e.prototype.set=function(t){return this.modify(lr(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}(),LCe=new g9(ml,ml);function jCe(){return LCe}function UCe(e,t){t===void 0&&(t="fromNewtype("+e.name+")");var n=jCe();return new Ce(t,function(r){return e.is(r)},function(r,i){return ce(e.validate(r,i),Zs(n.wrap))},function(r){return e.encode(n.unwrap(r))})}var BCe=Jd({_tag:sh("None")}),WCe=sh("Some");function C9(e,t){return t===void 0&&(t="Option<"+e.name+">"),ch([BCe,Jd({_tag:WCe,value:e},"Some<"+e.name+">")],t)}function KCe(e,t){return t===void 0&&(t="Option<"+e.name+">"),new Ce(t,C9(e).is,function(n,r){return n==null?Ee(ot):ce(e.validate(n,r),Zs(It))},function(n){return gI(ce(n,mo(e.encode)))})}var PCe=new Ce("DateFromISOString",function(e){return e instanceof Date},function(e,t){return ce(zi.validate(e,t),ri(function(n){var r=new Date(n);return isNaN(r.getTime())?et(e,t):Ee(r)}))},function(e){return e.toISOString()});function DCe(e,t){return t===void 0&&(t="ReadonlyNonEmptyArray<"+e.name+">"),X4(e,t)}function S9(e){var t=Object.create(Object.getPrototypeOf(e));return Object.assign(t,e),t}var NCe=new Ce("DateFromNumber",function(e){return e instanceof Date},function(e,t){return ce(Oc.validate(e,t),ri(function(n){var r=new Date(n);return isNaN(r.getTime())?et(e,t):Ee(r)}))},function(e){return e.getTime()});function S0(e,t,n){n===void 0&&(n=e.name);var r=S9(e);return r.validate=t,r.decode=function(i){return t(i,z4(r))},r.name=n,r}function qCe(e,t,n){return n===void 0&&(n="withFallback("+e.name+")"),S0(e,function(r,i){return vB(function(){return Ee(t)})(e.validate(r,i))},n)}var QCe=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,VCe=m0(zi,function(e){return QCe.test(e)},"UUID");function zCe(e,t,n){return n===void 0&&(n="fromNullable("+e.name+")"),S0(e,function(r,i){return r==null?Ee(t):e.validate(r,i)},n)}var HCe=new Ce("BooleanFromString",h0.is,function(e,t){return ce(zi.validate(e,t),ri(function(n){return n==="true"?Ee(!0):n==="false"?Ee(!1):et(e,t)}))},String);function YCe(e,t){return S0(e,function(n,r){return nA(function(){return[{value:n,context:r,message:t(n,r),actual:n}]})(e.validate(n,r))})}function _9(e){switch(e._tag){case"InterfaceType":return e.props;case"ExactType":return _9(e.type)}}var GCe=LE.fromProp();function JCe(e){var t={};for(var n in _9(e))t[n]=GCe(n);return t}var ZCe=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},XCe=$E("RegExp",ZCe),eSe=new Ce("DateFromUnixTime",function(e){return e instanceof Date},function(e,t){return ce(ym.validate(e,t),ri(function(n){var r=new Date(n*1e3);return isNaN(r.getTime())?et(e,t):Ee(r)}))},function(e){return Math.floor(e.getTime()/1e3)}),D1=new Ce("NumberFromString",Oc.is,function(e,t){return ce(zi.validate(e,t),ri(function(n){var r=+n;return isNaN(r)||n.trim()===""?et(e,t):Ee(r)}))},String),tSe=new Ce("IntFromString",ym.is,function(e,t){return ce(D1.validate(e,t),ri(function(n){return ym.is(n)?Ee(n):et(e,t)}))},D1.encode),I9=_E("JsonArray",function(){return N4(_0)}),T9=_E("JsonRecord",function(){return TE(zi,_0)}),_0=ch([h0,Oc,zi,M1,I9,T9],"Json"),nSe=new Ce("JsonFromString",_0.is,function(e,t){try{return Ee(JSON.parse(e))}catch{return et(e,t)}},function(e){return JSON.stringify(e)}),rSe=sh("Left"),iSe=sh("Right");function oSe(e,t,n){return n===void 0&&(n="Either<"+e.name+", "+t.name+">"),ch([Jd({_tag:rSe,left:e},"Left<"+e.name+">"),Jd({_tag:iSe,right:t},"Right<"+e.name+">")],n)}var aSe=new Ce("BigIntFromString",function(e){return typeof e=="bigint"},function(e,t){return ce(zi.validate(e,t),ri(function(n){if(!Z4.is(n.trim()))return et(e,t);try{return Ee(BigInt(n))}catch{return et(e,t)}}))},String);function uSe(e,t,n){return n===void 0&&(n=e.name),new Ce(n,e.is,e.validate,t)}var sSe=new Ce("BooleanFromNumber",h0.is,function(e,t){return ce(Oc.validate(e,t),Zs(function(n){return n!==0}))},Number);const cSe=Object.freeze(Object.defineProperty({__proto__:null,BigIntFromString:aSe,BooleanFromNumber:sSe,BooleanFromString:HCe,DateFromISOString:PCe,DateFromNumber:NCe,DateFromUnixTime:eSe,IntFromString:tSe,Json:_0,JsonArray:I9,JsonFromString:nSe,JsonRecord:T9,NonEmptyString:Z4,NumberFromString:D1,UUID:VCe,clone:S9,date:C1e,either:oSe,fromNewtype:UCe,fromNullable:zCe,fromRefinement:$E,getLenses:JCe,mapOutput:J4,nonEmptyArray:X4,option:C9,optionFromNullable:KCe,readonlyNonEmptyArray:DCe,readonlySetFromArray:y1e,regexp:XCe,setFromArray:e9,withEncode:uSe,withFallback:qCe,withMessage:YCe,withValidate:S0},Symbol.toStringTag,{value:"Module"})),I0=Ws(cSe),lSe=Ws(v1e);Object.defineProperty(Je,"__esModule",{value:!0});Je.withCustomError=Je.addType=Je.isEmpty=Je.objectToMap=Je.grouped=Je.formatDate=Je.formatDateTime=Je.filterDouble=Je.refineType=Je.nullable=void 0;const fSe=Q,x9=st,dSe=Hi,cl=(0,fSe.__importStar)(Y),pSe=I0,ASe=lSe;function hSe(e){return cl.union([e,cl.null,cl.undefined])}Je.nullable=hSe;function mSe(e,t,n){return new cl.Type(t,e.is,(r,i)=>(0,dSe.pipe)(e.validate(r,i),x9.either.chain(o=>n(o)?cl.success(o):cl.failure(r,i))),e.encode)}Je.refineType=mSe;function gSe(e){if(e==="")return null;const t=Number(e);return Number.isNaN(t)?null:t}Je.filterDouble=gSe;function vSe(e){return e.toISOString().replace(/\.\d{3}Z$/,"+0000")}Je.formatDateTime=vSe;function ySe(e){return e.toISOString().replace(/T.*/,"")}Je.formatDate=ySe;function bSe(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=bSe;function CSe(e){return new Map(Object.entries(e))}Je.objectToMap=CSe;function SSe(e){for(const t in e)return!1;return!0}Je.isEmpty=SSe;function _Se(e,t){return(0,ASe.mapOutput)(e,n=>({...n,__TYPE__:t}))}Je.addType=_Se;function ISe(e,t){return(0,pSe.withValidate)(e,(n,r)=>x9.either.mapLeft(i=>i.find(o=>o.message)?i:[{value:n,context:r,message:t(n,r),actual:n}])(e.validate(n,r)))}Je.withCustomError=ISe;Object.defineProperty(b0,"__esModule",{value:!0});b0.WidgetKey=void 0;const TSe=Q,xSe=(0,TSe.__importStar)(Y),wSe=Je,$Se=new RegExp("^[^<>]+$");b0.WidgetKey=(0,wSe.refineType)(xSe.string,"WidgetKey",e=>e.length===0||$Se.test(e));(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Q;(0,t.__exportStar)(v0,e),(0,t.__exportStar)(y0,e),(0,t.__exportStar)(b0,e)})(Fc);var le={},w9={},cd={},T0={},x0={};Object.defineProperty(x0,"__esModule",{value:!0});x0.clone=void 0;function ESe(e){var t=Object.create(Object.getPrototypeOf(e));return Object.assign(t,e),t}x0.clone=ESe;var RSe=Ae&&Ae.__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]}),OSe=Ae&&Ae.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),FSe=Ae&&Ae.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.hasOwnProperty.call(e,n)&&RSe(t,e,n);return OSe(t,e),t};Object.defineProperty(T0,"__esModule",{value:!0});T0.withValidate=void 0;var MSe=FSe(Y),kSe=x0;function LSe(e,t,n){n===void 0&&(n=e.name);var r=kSe.clone(e);return r.validate=t,r.decode=function(i){return t(i,MSe.getDefaultContext(r))},r.name=n,r}T0.withValidate=LSe;var jSe=Ae&&Ae.__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]}),USe=Ae&&Ae.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),BSe=Ae&&Ae.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.hasOwnProperty.call(e,n)&&jSe(t,e,n);return USe(t,e),t};Object.defineProperty(cd,"__esModule",{value:!0});cd.withFallback=void 0;var WSe=BSe(Y),KSe=T0,PSe=un;function DSe(e,t,n){return n===void 0&&(n="withFallback("+e.name+")"),KSe.withValidate(e,function(r,i){return PSe.orElse(function(){return WSe.success(t)})(e.validate(r,i))},n)}cd.withFallback=DSe;var sb={},Jt={};Object.defineProperty(Jt,"__esModule",{value:!0});Jt.EmptyArray=Jt.EmptyObject=Jt.Boolean=Jt.NumberOrNull=Jt.Number=Jt.StringOrNull=Jt.String=void 0;const NSe=Q,qSe=st,QSe=He,Pt=(0,NSe.__importStar)(Y),dh=Je;Jt.String=(0,dh.withCustomError)(Pt.string,()=>"The value must be a string");Jt.StringOrNull=(0,dh.withCustomError)(Pt.union([Pt.string,Pt.null]),()=>"The value must be a string or null");Jt.Number=(0,dh.withCustomError)(Pt.number,()=>"The value must be a number");Jt.NumberOrNull=(0,dh.withCustomError)(Pt.union([Pt.number,Pt.null]),()=>"The value must be a number or null");Jt.Boolean=(0,dh.withCustomError)(Pt.boolean,()=>"The value must be a boolean");Jt.EmptyObject=Pt.UnknownRecord.pipe(new Pt.Type("emptyObject",e=>Pt.UnknownRecord.is(e),(e,t)=>Object.keys(e).length>0?Pt.failure(e,t,"The object is not empty."):Pt.success({}),Pt.identity));Jt.EmptyArray=new Pt.Type("emptyArray",e=>Pt.UnknownArray.is(e)&&e.length===0,(e,t)=>(0,QSe.pipe)(Pt.UnknownArray.decode(e),qSe.either.chain(n=>n.length>0?Pt.failure(e,t,"The array is not empty."):Pt.success(new Array))),()=>[]);var Mh={};const Pa=Ws(xB);var RO;function VSe(){if(RO)return Mh;RO=1,Object.defineProperty(Mh,"__esModule",{value:!0});const e=Q,t=Pa,n=Hi,r=(0,e.__importStar)(Y),i=ct();return Mh.default=new r.Type("dateFromString",o=>o instanceof Date,(o,a)=>(0,n.pipe)(i.String.validate(o,a),(0,t.chain)(u=>{const s=new Date(u);return isNaN(s.getTime())?r.failure(o,a):r.success(s)})),o=>o.toISOString()),Mh}var jE={};Object.defineProperty(jE,"__esModule",{value:!0});const zSe=Q,HSe=Pa,YSe=Hi,Hc=(0,zSe.__importStar)(Y);jE.default=new Hc.Type("dateFromStringOrNumber",e=>e instanceof Date,(e,t)=>(0,YSe.pipe)(Hc.union([Hc.number,Hc.string]).validate(e,t),(0,HSe.chain)(n=>{const r=new Date(n);return isNaN(r.getTime())?Hc.failure(e,t):Hc.success(r)})),e=>e);var UE={};Object.defineProperty(UE,"__esModule",{value:!0});const GSe=Q,JSe=Pa,ZSe=Hi,kh=(0,GSe.__importStar)(Y);UE.default=new kh.Type("dateFromTsMs",e=>e instanceof Date,(e,t)=>(0,ZSe.pipe)(kh.number.validate(e,t),(0,JSe.chain)(n=>{const r=new Date(n);return isNaN(r.getTime())?kh.failure(e,t):kh.success(r)})),e=>e.getTime());var $9={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EmptyArrayOrElse=e.EmptyObjectOrElse=e.NullOrElse=e.DefaultOrElse=void 0;const t=Q,n=un,r=(0,t.__importStar)(Y),i=Jt,o=c=>l=>new r.Type(`DefaultOrElse<${c.name}, ${l.name}>`,f=>f===null||l.is(f),(f,p)=>(0,n.isRight)(c.validate(f,p))?r.success(null):l.validate(f,p),f=>f?l.encode(f):void 0);e.DefaultOrElse=o;const a=c=>(0,e.DefaultOrElse)(r.null)(c);e.NullOrElse=a;const u=c=>(0,e.DefaultOrElse)(i.EmptyObject)(c);e.EmptyObjectOrElse=u;const s=c=>(0,e.DefaultOrElse)(i.EmptyArray)(c);e.EmptyArrayOrElse=s})($9);var BE={};Object.defineProperty(BE,"__esModule",{value:!0});const XSe=Q,e_e=Pa,t_e=Hi,Ju=(0,XSe.__importStar)(Y);BE.default=new Ju.Type("IntFromNumber",Ju.Int.is,(e,t)=>(0,t_e.pipe)(Ju.number.validate(e,t),(0,e_e.chain)(n=>Ju.Int.is(n)?Ju.success(n):Ju.success(Math.round(n)))),Ju.Int.encode);var WE={};Object.defineProperty(WE,"__esModule",{value:!0});const n_e=Q,r_e=Pa,i_e=Hi,Yc=(0,n_e.__importStar)(Y),o_e=/^([0-9]+)px$/;WE.default=new Yc.Type("IntFromPixels",Yc.Int.is,(e,t)=>(0,i_e.pipe)(Yc.string.validate(e,t),(0,r_e.chain)(n=>{try{const r=n.match(o_e);if(!r)return Yc.failure(e,t);const i=parseInt(r[1]);return Yc.success(i)}catch{return Yc.failure(e,t)}})),String);var KE={};Object.defineProperty(KE,"__esModule",{value:!0});const a_e=Q,u_e=(0,a_e.__importStar)(Y),OO=Je;KE.default=(0,OO.withCustomError)((0,OO.refineType)(u_e.string,"nonEmptyString",e=>e.trim().length>0),()=>"The value must be a non-empty string");var PE={},w0={};Object.defineProperty(w0,"__esModule",{value:!0});const s_e=Q,c_e=(0,s_e.__importStar)(Y),l_e=Je;w0.default=(0,l_e.nullable)(c_e.string);Object.defineProperty(PE,"__esModule",{value:!0});const f_e=Q,d_e=Pa,p_e=Hi,cb=Y,A_e=(0,f_e.__importDefault)(w0);PE.default=new cb.Type("nonEmptyStringOrNull",e=>typeof e=="string"||e===null,(e,t)=>(0,p_e.pipe)(A_e.default.validate(e,t),(0,d_e.chain)(n=>typeof n=="string"&&n.length>0?(0,cb.success)(n):(0,cb.success)(null))),e=>e);var DE={};Object.defineProperty(DE,"__esModule",{value:!0});const h_e=Q,m_e=(0,h_e.__importStar)(Y),g_e=Je;DE.default=(0,g_e.nullable)(m_e.number);var NE={};Object.defineProperty(NE,"__esModule",{value:!0});const v_e=Q,Lh=(0,v_e.__importStar)(Y),FO=Jt;NE.default=(e,t,n)=>FO.Number.pipe(new Lh.Type("numberInRange",r=>FO.Number.is(r),(r,i)=>r>t||r<e?Lh.failure(r,i,`${n} must be a number between ${e} and ${t}`):Lh.success(r),Lh.identity));var qE={};Object.defineProperty(qE,"__esModule",{value:!0});const y_e=Q,b_e=Pa,C_e=Hi,jh=(0,y_e.__importStar)(Y);qE.default=new jh.Type("StringFromInt",jh.string.is,(e,t)=>(0,C_e.pipe)(jh.boolean.validate(e,t),(0,b_e.chain)(n=>jh.success(n.toString()))),e=>e);var QE={};Object.defineProperty(QE,"__esModule",{value:!0});const S_e=Q,__e=Pa,I_e=Hi,Uh=(0,S_e.__importStar)(Y);QE.default=new Uh.Type("StringFromInt",Uh.string.is,(e,t)=>(0,I_e.pipe)(Uh.number.validate(e,t),(0,__e.chain)(n=>Uh.success(n.toString()))),e=>e);var MO;function ct(){return MO||(MO=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.StringOrNull=e.StringFromNumber=e.StringFromBoolean=e.NumberRange=e.NumberOrNull=e.NonEmptyStringOrNull=e.NonEmptyString=e.IntFromPixels=e.IntFromNumber=e.Function=e.DateFromTsMs=e.DateFromStringOrNumber=e.DateFromString=void 0;const t=Q;(0,t.__exportStar)(Jt,e);var n=VSe();Object.defineProperty(e,"DateFromString",{enumerable:!0,get:function(){return(0,t.__importDefault)(n).default}});var r=jE;Object.defineProperty(e,"DateFromStringOrNumber",{enumerable:!0,get:function(){return(0,t.__importDefault)(r).default}});var i=UE;Object.defineProperty(e,"DateFromTsMs",{enumerable:!0,get:function(){return(0,t.__importDefault)(i).default}}),(0,t.__exportStar)($9,e),e.Function=(0,t.__importStar)(Je);var o=BE;Object.defineProperty(e,"IntFromNumber",{enumerable:!0,get:function(){return(0,t.__importDefault)(o).default}});var a=WE;Object.defineProperty(e,"IntFromPixels",{enumerable:!0,get:function(){return(0,t.__importDefault)(a).default}});var u=KE;Object.defineProperty(e,"NonEmptyString",{enumerable:!0,get:function(){return(0,t.__importDefault)(u).default}});var s=PE;Object.defineProperty(e,"NonEmptyStringOrNull",{enumerable:!0,get:function(){return(0,t.__importDefault)(s).default}});var c=DE;Object.defineProperty(e,"NumberOrNull",{enumerable:!0,get:function(){return(0,t.__importDefault)(c).default}});var l=NE;Object.defineProperty(e,"NumberRange",{enumerable:!0,get:function(){return(0,t.__importDefault)(l).default}});var f=qE;Object.defineProperty(e,"StringFromBoolean",{enumerable:!0,get:function(){return(0,t.__importDefault)(f).default}});var p=QE;Object.defineProperty(e,"StringFromNumber",{enumerable:!0,get:function(){return(0,t.__importDefault)(p).default}});var A=w0;Object.defineProperty(e,"StringOrNull",{enumerable:!0,get:function(){return(0,t.__importDefault)(A).default}})}(sb)),sb}var bi={},_r={},ld={},Da={},VE={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.BooleanField=e.BooleanConfig=e.BooleanFieldType=void 0;const n=(0,Q.__importStar)(Y),r=ct();e.BooleanFieldType="Boolean",e.BooleanConfig=n.exact(n.partial({label:r.StringOrNull,default_value:n.boolean,placeholder_true:n.string,placeholder_false:n.string})),e.BooleanField=n.exact(n.intersection([n.type({type:n.literal(e.BooleanFieldType)}),n.partial({config:e.BooleanConfig})]))})(VE);var zE={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Color=e.ColorConfig=e.ColorFieldType=void 0;const n=(0,Q.__importStar)(Y),r=ct();e.ColorFieldType="Color",e.ColorConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string})),e.Color=n.exact(n.intersection([n.type({type:n.literal(e.ColorFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.ColorConfig})]))})(zE);var HE={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Date=e.DateConfig=e.DateFieldType=void 0;const n=(0,Q.__importStar)(Y),r=ct();e.DateFieldType="Date",e.DateConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,default:n.string})),e.Date=n.exact(n.intersection([n.type({type:n.literal(e.DateFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.DateConfig})]))})(HE);var YE={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Embed=e.EmbedConfig=e.EmbedFieldType=void 0;const n=(0,Q.__importStar)(Y),r=ct();e.EmbedFieldType="Embed",e.EmbedConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,useAsTitle:n.boolean})),e.Embed=n.exact(n.intersection([n.type({type:n.literal(e.EmbedFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.EmbedConfig})]))})(YE);var GE={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.GeoPoint=e.GeoPointConfig=e.GeoPointFieldType=void 0;const n=(0,Q.__importStar)(Y),r=ct();e.GeoPointFieldType="GeoPoint",e.GeoPointConfig=n.exact(n.partial({label:r.StringOrNull})),e.GeoPoint=n.exact(n.intersection([n.type({type:n.literal(e.GeoPointFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.GeoPointConfig})]))})(GE);var JE={},ph={},$0={},fd={},ws={};Object.defineProperty(ws,"__esModule",{value:!0});ws.pipe=ws.pipeable=void 0;var N1=He,T_e=function(e){return typeof e.map=="function"},x_e=function(e){return typeof e.contramap=="function"},w_e=function(e){return typeof e.mapWithIndex=="function"},$_e=function(e){return typeof e.ap=="function"},E_e=function(e){return typeof e.chain=="function"},R_e=function(e){return typeof e.bimap=="function"},O_e=function(e){return typeof e.extend=="function"},F_e=function(e){return typeof e.reduce=="function"},M_e=function(e){return typeof e.reduceWithIndex=="function"},k_e=function(e){return typeof e.alt=="function"},L_e=function(e){return typeof e.compact=="function"},j_e=function(e){return typeof e.filter=="function"},U_e=function(e){return typeof e.filterWithIndex=="function"},B_e=function(e){return typeof e.promap=="function"},W_e=function(e){return typeof e.compose=="function"},K_e=function(e){return typeof e.throwError=="function"};function P_e(e){var t={};if(T_e(e)){var n=function(k){return function(E){return e.map(E,k)}};t.map=n}if(x_e(e)){var r=function(k){return function(E){return e.contramap(E,k)}};t.contramap=r}if(w_e(e)){var i=function(k){return function(E){return e.mapWithIndex(E,k)}};t.mapWithIndex=i}if($_e(e)){var o=function(k){return function(E){return e.ap(E,k)}},a=function(k){return function(E){return e.ap(e.map(E,function(D){return function(){return D}}),k)}};t.ap=o,t.apFirst=a,t.apSecond=function(k){return function(E){return e.ap(e.map(E,function(){return function(D){return D}}),k)}}}if(E_e(e)){var u=function(k){return function(E){return e.chain(E,k)}},s=function(k){return function(E){return e.chain(E,function(D){return e.map(k(D),function(){return D})})}},c=function(k){return e.chain(k,N1.identity)};t.chain=u,t.chainFirst=s,t.flatten=c}if(R_e(e)){var l=function(k,E){return function(D){return e.bimap(D,k,E)}},f=function(k){return function(E){return e.mapLeft(E,k)}};t.bimap=l,t.mapLeft=f}if(O_e(e)){var p=function(k){return function(E){return e.extend(E,k)}},A=function(k){return e.extend(k,N1.identity)};t.extend=p,t.duplicate=A}if(F_e(e)){var h=function(k,E){return function(D){return e.reduce(D,k,E)}},v=function(k){var E=e.foldMap(k);return function(D){return function(ue){return E(ue,D)}}},_=function(k,E){return function(D){return e.reduceRight(D,k,E)}};t.reduce=h,t.foldMap=v,t.reduceRight=_}if(M_e(e)){var S=function(k,E){return function(D){return e.reduceWithIndex(D,k,E)}},I=function(k){var E=e.foldMapWithIndex(k);return function(D){return function(ue){return E(ue,D)}}},T=function(k,E){return function(D){return e.reduceRightWithIndex(D,k,E)}};t.reduceWithIndex=S,t.foldMapWithIndex=I,t.reduceRightWithIndex=T}if(k_e(e)){var g=function(k){return function(E){return e.alt(E,k)}};t.alt=g}if(L_e(e)&&(t.compact=e.compact,t.separate=e.separate),j_e(e)){var C=function(k){return function(E){return e.filter(E,k)}},y=function(k){return function(E){return e.filterMap(E,k)}},x=function(k){return function(E){return e.partition(E,k)}},w=function(k){return function(E){return e.partitionMap(E,k)}};t.filter=C,t.filterMap=y,t.partition=x,t.partitionMap=w}if(U_e(e)){var M=function(k){return function(E){return e.filterWithIndex(E,k)}},O=function(k){return function(E){return e.filterMapWithIndex(E,k)}},F=function(k){return function(E){return e.partitionWithIndex(E,k)}},K=function(k){return function(E){return e.partitionMapWithIndex(E,k)}};t.filterWithIndex=M,t.filterMapWithIndex=O,t.partitionWithIndex=F,t.partitionMapWithIndex=K}if(B_e(e)){var N=function(k,E){return function(D){return e.promap(D,k,E)}};t.promap=N}if(W_e(e)){var J=function(k){return function(E){return e.compose(E,k)}};t.compose=J}if(K_e(e)){var Z=function(k){return function(E){return E._tag==="None"?e.throwError(k()):e.of(E.value)}},ae=function(k){return k._tag==="Left"?e.throwError(k.left):e.of(k.right)},ge=function(k,E){return function(D){return k(D)?e.of(D):e.throwError(E(D))}},se=function(k,E){return function(D){return e.chain(D,function(ue){return k(ue)?e.of(ue):e.throwError(E(ue))})}};t.fromOption=Z,t.fromEither=ae,t.fromPredicate=ge,t.filterOrElse=se}return t}ws.pipeable=P_e;ws.pipe=N1.pipe;var D_e=Ae&&Ae.__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]}),N_e=Ae&&Ae.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),q_e=Ae&&Ae.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.hasOwnProperty.call(e,n)&&D_e(t,e,n);return N_e(t,e),t};Object.defineProperty(fd,"__esModule",{value:!0});fd.NumberFromString=void 0;var pd=q_e(Y),Q_e=ws,V_e=un;fd.NumberFromString=new pd.Type("NumberFromString",pd.number.is,function(e,t){return Q_e.pipe(pd.string.validate(e,t),V_e.chain(function(n){var r=+n;return isNaN(r)||n.trim()===""?pd.failure(e,t):pd.success(r)}))},String);var z_e=Ae&&Ae.__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]}),H_e=Ae&&Ae.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Y_e=Ae&&Ae.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.hasOwnProperty.call(e,n)&&z_e(t,e,n);return H_e(t,e),t};Object.defineProperty($0,"__esModule",{value:!0});$0.IntFromString=void 0;var Ad=Y_e(Y),kO=fd,G_e=ws,J_e=un;$0.IntFromString=new Ad.Type("IntFromString",Ad.Int.is,function(e,t){return G_e.pipe(kO.NumberFromString.validate(e,t),J_e.chain(function(n){return Ad.Int.is(n)?Ad.success(n):Ad.failure(e,t)}))},kO.NumberFromString.encode);Object.defineProperty(ph,"__esModule",{value:!0});const Z_e=Q,X_e=un,Do=(0,Z_e.__importStar)(Y),eIe=$0,LO=ct(),jO=new Do.Type("SideConstraints",e=>!e||typeof e=="number",(e,t)=>X_e.either.chain(Do.union([Do.literal("auto"),Do.literal(""),Do.Int,eIe.IntFromString,LO.IntFromNumber,LO.IntFromPixels,Do.null]).validate(e,t),n=>n==="auto"||n===""?Do.success(null):Do.success(n)),e=>e),tIe=Do.partial({width:jO,height:jO});ph.default=tIe;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Image=e.ImageConfig=e.Thumbnail=e.ImageFieldType=void 0;const t=Q,n=(0,t.__importStar)(Y),r=ct(),i=(0,t.__importDefault)(ph);e.ImageFieldType="Image",e.Thumbnail=n.exact(n.intersection([n.type({name:n.string}),i.default])),e.ImageConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,constraint:i.default,thumbnails:n.readonlyArray(e.Thumbnail)})),e.Image=n.exact(n.intersection([n.type({type:n.literal(e.ImageFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.ImageConfig})]))})(JE);var ZE={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.IntegrationField=e.IntegrationFieldConfig=e.IntegrationFieldType=void 0;const n=(0,Q.__importStar)(Y),r=ct();e.IntegrationFieldType="IntegrationFields",e.IntegrationFieldConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,catalog:n.string})),e.IntegrationField=n.exact(n.intersection([n.type({type:n.literal(e.IntegrationFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.IntegrationFieldConfig})]))})(ZE);var XE={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Link=e.LinkConfig=e.LinkFieldType=void 0;const t=Q,n=un,r=(0,t.__importStar)(Y),i=cd,o=ct(),a=c=>{if(c instanceof Array&&c.reduce((f,p)=>f&&typeof p=="string",!0))return r.success(c)},u=c=>{if(typeof c=="string")return r.success([c])},s=new r.Type("MasksArrayString",c=>c instanceof Array,(c,l)=>n.either.chain(r.union([r.array(r.string),r.string]).validate(c,l),f=>a(f)||u(f)||r.failure(c,l)),c=>c);e.LinkFieldType="Link",e.LinkConfig=r.exact(r.partial({label:o.StringOrNull,useAsTitle:r.boolean,placeholder:r.string,select:(0,i.withFallback)(r.union([r.literal("media"),r.literal("document"),r.literal("web"),r.null]),null),customtypes:r.readonlyArray(r.string),masks:s,tags:s,allowTargetBlank:r.boolean})),e.Link=r.exact(r.intersection([r.type({type:r.literal(e.LinkFieldType)}),r.partial({fieldset:o.StringOrNull,config:e.LinkConfig})]))})(XE);var eR={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Number=e.NumberConfig=e.NumberFieldType=void 0;const n=(0,Q.__importStar)(Y),r=fd,i=ct();e.NumberFieldType="Number",e.NumberConfig=n.exact(n.partial({label:i.StringOrNull,placeholder:n.string,min:n.union([n.number,r.NumberFromString]),max:n.union([n.number,r.NumberFromString]),step:n.union([n.number,r.NumberFromString])})),e.Number=n.exact(n.intersection([n.type({type:n.literal(e.NumberFieldType)}),n.partial({fieldset:i.StringOrNull,config:e.NumberConfig})]))})(eR);var tR={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Range=e.RangeConfig=e.RangeFieldType=void 0;const n=(0,Q.__importStar)(Y),r=fd,i=ct();e.RangeFieldType="Range",e.RangeConfig=n.exact(n.partial({label:i.StringOrNull,placeholder:n.string,min:n.union([n.number,r.NumberFromString]),max:n.union([n.number,r.NumberFromString]),step:n.union([n.number,r.NumberFromString])})),e.Range=n.exact(n.intersection([n.type({type:n.literal(e.RangeFieldType)}),n.partial({fieldset:i.StringOrNull,config:e.RangeConfig})]))})(tR);var nR={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RichText=e.RichTextConfig=e.RichTextNodeTypeCodec=e.RichTextNodeType=e.DEFAULT_OPTION=e.RichTextFieldType=void 0;const t=Q,n=st,r=un,i=He,o=(0,t.__importStar)(Y),a=ct(),u=(0,t.__importDefault)(ph);e.RichTextFieldType="StructuredText",e.DEFAULT_OPTION="paragraph",e.RichTextNodeType={heading1:"heading1",heading2:"heading2",heading3:"heading3",heading4:"heading4",heading5:"heading5",heading6:"heading6",paragraph:"paragraph",strong:"strong",em:"em",preformatted:"preformatted",hyperlink:"hyperlink",image:"image",embed:"embed",list:"list-item",orderedList:"o-list-item",rtl:"rtl"},e.RichTextNodeTypeCodec=o.keyof({[e.RichTextNodeType.heading1]:null,[e.RichTextNodeType.heading2]:null,[e.RichTextNodeType.heading3]:null,[e.RichTextNodeType.heading4]:null,[e.RichTextNodeType.heading5]:null,[e.RichTextNodeType.heading6]:null,[e.RichTextNodeType.paragraph]:null,[e.RichTextNodeType.strong]:null,[e.RichTextNodeType.em]:null,[e.RichTextNodeType.preformatted]:null,[e.RichTextNodeType.hyperlink]:null,[e.RichTextNodeType.image]:null,[e.RichTextNodeType.embed]:null,[e.RichTextNodeType.list]:null,[e.RichTextNodeType.orderedList]:null,[e.RichTextNodeType.rtl]:null});const s=new o.Type("RichTextOptions",h=>typeof h=="string",h=>(0,i.pipe)(o.union([o.string,o.null]).decode(h),n.either.map(v=>{if(!v)return e.DEFAULT_OPTION;const S=v.split(",").map(I=>I.trim()).filter(I=>(0,r.getOrElseW)(()=>{})(e.RichTextNodeTypeCodec.decode(I)));return S.length?S.join(","):e.DEFAULT_OPTION})),h=>h),c=h=>{if(!h)return o.success([])},l=h=>{if(h instanceof Object){const v=h;if(!Object.entries(v).length)return o.success([]);if(v[""])return o.success(v[""].map(S=>S.name));const _=Object.entries(v).reduce((S,[,I])=>S.concat(I.map(T=>T.name)),[]).filter(Boolean);return o.success(_)}},f=h=>{if(h instanceof Array&&h.reduce((_,S)=>_&&typeof S=="string",!0))return o.success(h)},p=h=>{if(typeof h=="string")return o.success([h])},A=new o.Type("RichTextLabels",h=>h instanceof Array,(h,v)=>{const _=o.record(o.string,o.readonlyArray(o.record(o.literal("name"),o.string))),S=o.readonlyArray(o.string);return(0,i.pipe)(o.union([_,S,o.string,o.null]).decode(h),n.either.chain(I=>c(I)||f(I)||l(I)||p(I)||o.failure(h,v)))},h=>h);e.RichTextConfig=o.exact(o.partial({label:a.StringOrNull,placeholder:o.string,useAsTitle:o.boolean,single:s,multi:s,imageConstraint:u.default,labels:A,allowTargetBlank:o.boolean})),e.RichText=o.exact(o.intersection([o.type({type:o.literal(e.RichTextFieldType)}),o.partial({fieldset:a.StringOrNull,config:e.RichTextConfig})]))})(nR);var rR={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Select=e.SelectConfig=e.SelectFieldType=void 0;const n=(0,Q.__importStar)(Y),r=ct();e.SelectFieldType="Select",e.SelectConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,default_value:n.string,options:n.readonlyArray(n.union([n.string,r.StringFromNumber,r.StringFromBoolean]))})),e.Select=n.exact(n.intersection([n.type({type:n.literal(e.SelectFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.SelectConfig})]))})(rR);var iR={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Separator=e.SeparatorConfig=e.SeparatorFieldType=void 0;const n=(0,Q.__importStar)(Y),r=ct();e.SeparatorFieldType="Separator",e.SeparatorConfig=n.exact(n.partial({label:r.StringOrNull})),e.Separator=n.exact(n.intersection([n.type({type:n.literal(e.SeparatorFieldType)}),n.partial({config:e.SeparatorConfig})]))})(iR);var oR={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Text=e.TextConfig=e.TextFieldType=void 0;const n=(0,Q.__importStar)(Y),r=ct();e.TextFieldType="Text",e.TextConfig=n.exact(n.partial({label:r.StringOrNull,useAsTitle:n.boolean,placeholder:n.string})),e.Text=n.exact(n.intersection([n.type({type:n.literal(e.TextFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.TextConfig})]))})(oR);var aR={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Timestamp=e.TimestampConfig=e.TimestampFieldType=void 0;const n=(0,Q.__importStar)(Y),r=ct();e.TimestampFieldType="Timestamp",e.TimestampConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,default:n.string})),e.Timestamp=n.exact(n.intersection([n.type({type:n.literal(e.TimestampFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.TimestampConfig})]))})(aR);Object.defineProperty(Da,"__esModule",{value:!0});Da.NestableWidget=void 0;const nIe=Q,rIe=(0,nIe.__importStar)(Y),iIe=VE,oIe=zE,aIe=HE,uIe=YE,sIe=GE,cIe=JE,lIe=ZE,fIe=XE,dIe=eR,pIe=tR,AIe=nR,hIe=rR,mIe=iR,gIe=oR,vIe=aR;Da.NestableWidget=rIe.union([oIe.Color,iIe.BooleanField,uIe.Embed,sIe.GeoPoint,aIe.Date,dIe.Number,pIe.Range,AIe.RichText,hIe.Select,mIe.Separator,gIe.Text,vIe.Timestamp,fIe.Link,cIe.Image,lIe.IntegrationField]);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Group=e.GroupConfig=e.NestedGroup=e.NestedGroupConfig=e.GroupFieldType=void 0;const n=(0,Q.__importStar)(Y),r=Fc,i=ct(),o=Da;e.GroupFieldType="Group";const a=s=>n.exact(n.partial({label:i.StringOrNull,repeat:n.boolean,fields:n.record(r.WidgetKey,s)})),u=s=>n.exact(n.intersection([n.type({type:n.literal(e.GroupFieldType)}),n.partial({fieldset:i.StringOrNull,icon:n.string,description:n.string,config:a(s)})]));e.NestedGroupConfig=a(o.NestableWidget),e.NestedGroup=u(o.NestableWidget),e.GroupConfig=a(n.union([o.NestableWidget,e.NestedGroup])),e.Group=u(n.union([o.NestableWidget,e.NestedGroup]))})(ld);var Ah={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Q;(0,t.__exportStar)(VE,e),(0,t.__exportStar)(zE,e),(0,t.__exportStar)(HE,e),(0,t.__exportStar)(YE,e),(0,t.__exportStar)(GE,e),(0,t.__exportStar)(JE,e),(0,t.__exportStar)(ZE,e),(0,t.__exportStar)(XE,e),(0,t.__exportStar)(Da,e),(0,t.__exportStar)(eR,e),(0,t.__exportStar)(tR,e),(0,t.__exportStar)(nR,e),(0,t.__exportStar)(rR,e),(0,t.__exportStar)(iR,e),(0,t.__exportStar)(oR,e),(0,t.__exportStar)(aR,e)})(Ah);var uR={},E0={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isCompositeSlice=e.CompositeSlice=e.CompositeSliceConfig=e.CompositeSliceType=void 0;const n=(0,Q.__importStar)(Y),r=Fc,i=ct(),o=Da;e.CompositeSliceType="Slice",e.CompositeSliceConfig=n.exact(n.partial({label:i.StringOrNull})),e.CompositeSlice=n.exact(n.intersection([n.type({type:n.literal(e.CompositeSliceType)}),n.partial({fieldset:i.StringOrNull,description:n.string,icon:n.string,display:n.string,"non-repeat":n.record(r.WidgetKey,o.NestableWidget),repeat:n.record(r.WidgetKey,o.NestableWidget),config:e.CompositeSliceConfig})]));function a(u){return u.type==="Slice"}e.isCompositeSlice=a})(E0);var $s={};Object.defineProperty($s,"__esModule",{value:!0});$s.isLegacySlice=$s.LegacySlice=void 0;const yIe=Q,bIe=(0,yIe.__importStar)(Y),CIe=ld,SIe=Da;$s.LegacySlice=bIe.union([SIe.NestableWidget,CIe.NestedGroup]);function _Ie(e){return e.type!=="Slice"&&e.type!=="SharedSlice"}$s.isLegacySlice=_Ie;var hh={},Es={};Object.defineProperty(Es,"__esModule",{value:!0});Es.isSlicePrimaryWidget=Es.SlicePrimaryWidget=void 0;const IIe=Q,TIe=(0,IIe.__importStar)(Y),E9=ld,R9=Ah;Es.SlicePrimaryWidget=TIe.union([R9.NestableWidget,E9.Group]);const xIe=e=>R9.NestableWidget.is(e)||E9.Group.is(e);Es.isSlicePrimaryWidget=xIe;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isDynamicSharedSlice=e.isStaticSharedSlice=e.SharedSlice=e.SharedSliceType=e.Variation=void 0;const n=(0,Q.__importStar)(Y),r=cd,i=Fc,o=Da,a=Es,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,a.SlicePrimaryWidget),items:n.record(i.WidgetKey,o.NestableWidget)})])),e.SharedSliceType="SharedSlice";const s=n.string,c=n.string;e.SharedSlice=n.exact(n.intersection([n.type({id:n.string,type:n.literal(e.SharedSliceType),name:n.string,variations:n.readonlyArray(e.Variation)}),n.partial({description:n.string,legacyPaths:n.record(s,c)})]));function l(p){return p.type==="SharedSlice"}e.isStaticSharedSlice=l;function f(p){return p.type==="SharedSlice"}e.isDynamicSharedSlice=f})(hh);var mh={};Object.defineProperty(mh,"__esModule",{value:!0});mh.SharedSliceRef=void 0;const wIe=Q,lb=(0,wIe.__importStar)(Y),$Ie=hh;mh.SharedSliceRef=lb.exact(lb.type({type:lb.literal($Ie.SharedSliceType)}));(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Slices=e.DynamicSlices=e.StaticSlices=e.slicesReader=e.DynamicSlicesConfig=e.StaticSlicesConfig=e.slicesConfigReader=e.SlicesLabels=e.SlicesFieldType=e.LegacySlicesFieldType=void 0;const n=(0,Q.__importStar)(Y),r=Fc,i=ct(),o=E0,a=$s,u=hh,s=mh;e.LegacySlicesFieldType="Choice",e.SlicesFieldType="Slices",e.SlicesLabels=n.union([n.record(n.string,n.readonlyArray(n.exact(n.intersection([n.type({name:n.string}),n.partial({display:n.string})])))),n.null]);function c(p){return n.exact(n.partial({label:i.StringOrNull,labels:e.SlicesLabels,choices:n.record(r.WidgetKey,n.union([a.LegacySlice,o.CompositeSlice,p]))}))}e.slicesConfigReader=c,e.StaticSlicesConfig=c(u.SharedSlice),e.DynamicSlicesConfig=c(s.SharedSliceRef);const l={toStatic(p,A){const h=Object.entries(p.choices||{}).reduce((v,[_,S])=>{if(S.type==="SharedSlice"){const I=A.get(_);return I?{...v,[_]:I}:v}else return{...v,[_]:S}},{});return{...p,choices:h}}};function f(p){return n.exact(n.intersection([n.type({type:n.keyof({[e.SlicesFieldType]:null,[e.LegacySlicesFieldType]:null})}),n.partial({fieldset:i.StringOrNull,config:p})]))}e.slicesReader=f,e.StaticSlices=f(e.StaticSlicesConfig),e.DynamicSlices=f(e.DynamicSlicesConfig),e.Slices={toStatic(p,A){return p.config?{...p,config:l.toStatic(p.config,A)}:p}}})(uR);var sR={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.UID=e.UIDConfig=e.UIDFieldType=void 0;const n=(0,Q.__importStar)(Y),r=ct();e.UIDFieldType="UID",e.UIDConfig=n.exact(n.partial({label:r.StringOrNull,useAsTitle:n.boolean,placeholder:n.string})),e.UID=n.exact(n.intersection([n.type({type:n.literal(e.UIDFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.UIDConfig})]))})(sR);Object.defineProperty(_r,"__esModule",{value:!0});_r.Widgets=_r.FieldType=_r.DynamicWidget=_r.StaticWidget=_r.widgetReader=void 0;const EIe=Q,O9=(0,EIe.__importStar)(Y),F9=ld,Dn=Ah,RIe=Da,Zd=uR,M9=sR;function cR(e){return O9.union([M9.UID,RIe.NestableWidget,F9.Group,e])}_r.widgetReader=cR;_r.StaticWidget=cR(Zd.StaticSlices);_r.DynamicWidget=cR(Zd.DynamicSlices);_r.FieldType=O9.keyof({[Dn.ColorFieldType]:null,[Dn.BooleanFieldType]:null,[Dn.NumberFieldType]:null,[Dn.EmbedFieldType]:null,[Dn.GeoPointFieldType]:null,[Dn.DateFieldType]:null,[Dn.RangeFieldType]:null,[Dn.RichTextFieldType]:null,[Dn.SelectFieldType]:null,[Dn.SeparatorFieldType]:null,[Dn.TextFieldType]:null,[Dn.TimestampFieldType]:null,[Dn.LinkFieldType]:null,[Dn.ImageFieldType]:null,[Dn.IntegrationFieldType]:null,[M9.UIDFieldType]:null,[F9.GroupFieldType]:null,[Zd.SlicesFieldType]:null,[Zd.LegacySlicesFieldType]:null});_r.Widgets={toStatic(e,t){switch(e.type){case"Choice":case"Slices":return Zd.Slices.toStatic(e,t);default:return e}}};Object.defineProperty(bi,"__esModule",{value:!0});bi.Sections=bi.DynamicSection=bi.StaticSection=bi.sectionReader=void 0;const OIe=Q,FIe=(0,OIe.__importStar)(Y),MIe=Fc,lR=_r;function fR(e){return FIe.record(MIe.WidgetKey,e)}bi.sectionReader=fR;bi.StaticSection=fR(lR.StaticWidget);bi.DynamicSection=fR(lR.DynamicWidget);bi.Sections={toStatic(e,t){return Object.entries(e).reduce((r,[i,o])=>({...r,[i]:lR.Widgets.toStatic(o,t)}),{})}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.collectSharedSlices=e.flattenCustomTypeFields=e.filterMissingSharedSlices=e.collectWidgets=e.validateSlices=e.toStatic=e.flattenSections=e.flattenWidgets=e.CustomType=e.StaticCustomType=e.CustomTypeFormat=void 0;const t=Q,n=un,r=(0,t.__importStar)(Y),i=cd,o=ct(),a=bi;e.CustomTypeFormat={page:"page",custom:"custom"};class u extends Error{constructor(g){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=g,this.message=this._formatError(g)}_formatError(g){return`The following slices doesn't exists in your Prismic repository:
1
+ "use strict";var pV=Object.defineProperty;var AV=(e,t,n)=>t in e?pV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var $n=(e,t,n)=>(AV(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $r=require("@prismicio/editor-support/URL"),R=require("react"),Pl=require("@prismicio/editor-support/Object"),m=require("@prismicio/editor-ui"),Xe=require("@prismicio/editor-support/React"),PC=require("@prismicio/editor-support/Date"),to=require("@prismicio/editor-support/Type"),Ip=require("@prismicio/editor-support/String"),nt=require("@prismicio/editor-support/Suspense"),gn=require("@prismicio/editor-support/Array"),we=require("@prismicio/editor-support/Http"),Fh=require("@prismicio/editor-support/DOM"),hV=require("@prismicio/editor-support/Map"),Rn=require("@prismicio/editor-support/Set"),DC=require("react-dom"),mV=require("@prismicio/editor-support/Number");function Ck(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 xe=Ck(R),gV=Ck(DC);var Ae=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ws(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):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 Ue={},I1=function(e,t){return I1=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},I1(e,t)};function vV(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");I1(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var T1=function(){return T1=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},T1.apply(this,arguments)};function yV(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function bV(e,t,n,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(a=e[u])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}function CV(e,t){return function(n,r){t(n,r,e)}}function SV(e,t,n,r,i,o){function a(S){if(S!==void 0&&typeof S!="function")throw new TypeError("Function expected");return S}for(var u=r.kind,s=u==="getter"?"get":u==="setter"?"set":"value",c=!t&&e?r.static?e:e.prototype:null,l=t||(c?Object.getOwnPropertyDescriptor(c,r.name):{}),f,p=!1,A=n.length-1;A>=0;A--){var h={};for(var v in r)h[v]=v==="access"?{}:r[v];for(var v in r.access)h.access[v]=r.access[v];h.addInitializer=function(S){if(p)throw new TypeError("Cannot add initializers after decoration has completed");o.push(a(S||null))};var _=(0,n[A])(u==="accessor"?{get:l.get,set:l.set}:l[s],h);if(u==="accessor"){if(_===void 0)continue;if(_===null||typeof _!="object")throw new TypeError("Object expected");(f=a(_.get))&&(l.get=f),(f=a(_.set))&&(l.set=f),(f=a(_.init))&&i.push(f)}else(f=a(_))&&(u==="field"?i.push(f):l[s]=f)}c&&Object.defineProperty(c,r.name,l),p=!0}function _V(e,t,n){for(var r=arguments.length>2,i=0;i<t.length;i++)n=r?t[i].call(e,n):t[i].call(e);return r?n:void 0}function IV(e){return typeof e=="symbol"?e:"".concat(e)}function TV(e,t,n){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})}function xV(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function wV(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())})}function $V(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(;a&&(a=0,c[0]&&(n=0)),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}}}var NC=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]};function EV(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&NC(t,e,n)}function x1(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Sk(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(u){a={error:u}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function RV(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Sk(arguments[t]));return e}function OV(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),i=0,t=0;t<n;t++)for(var o=arguments[t],a=0,u=o.length;a<u;a++,i++)r[i]=o[a];return r}function FV(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))}function Ud(e){return this instanceof Ud?(this.v=e,this):new Ud(e)}function MV(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(e,t||[]),i,o=[];return i={},a("next"),a("throw"),a("return"),i[Symbol.asyncIterator]=function(){return this},i;function a(p){r[p]&&(i[p]=function(A){return new Promise(function(h,v){o.push([p,A,h,v])>1||u(p,A)})})}function u(p,A){try{s(r[p](A))}catch(h){f(o[0][3],h)}}function s(p){p.value instanceof Ud?Promise.resolve(p.value.v).then(c,l):f(o[0][2],p)}function c(p){u("next",p)}function l(p){u("throw",p)}function f(p,A){p(A),o.shift(),o.length&&u(o[0][0],o[0][1])}}function kV(e){var t,n;return t={},r("next"),r("throw",function(i){throw i}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(i,o){t[i]=e[i]?function(a){return(n=!n)?{value:Ud(e[i](a)),done:!1}:o?o(a):a}:o}}function LV(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof x1=="function"?x1(e):e[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(o){n[o]=e[o]&&function(a){return new Promise(function(u,s){a=e[o](a),i(u,s,a.done,a.value)})}}function i(o,a,u,s){Promise.resolve(s).then(function(c){o({value:c,done:u})},a)}}function jV(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var UV=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function BV(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)&&NC(t,e,n);return UV(t,e),t}function WV(e){return e&&e.__esModule?e:{default:e}}function KV(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)}function PV(e,t,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(e,n):i?i.value=n:t.set(e,n),n}function DV(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}const NV=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return T1},__asyncDelegator:kV,__asyncGenerator:MV,__asyncValues:LV,__await:Ud,__awaiter:wV,__classPrivateFieldGet:KV,__classPrivateFieldIn:DV,__classPrivateFieldSet:PV,__createBinding:NC,__decorate:bV,__esDecorate:SV,__exportStar:EV,__extends:vV,__generator:$V,__importDefault:WV,__importStar:BV,__makeTemplateObject:jV,__metadata:xV,__param:CV,__propKey:IV,__read:Sk,__rest:yV,__runInitializers:_V,__setFunctionName:TV,__spread:RV,__spreadArray:FV,__spreadArrays:OV,__values:x1},Symbol.toStringTag,{value:"Module"})),Q=Ws(NV);var nr={};function _k(e){return function(t){return function(n){return n.reduce(function(r,i){return e.alt(r,function(){return i})},t)}}}const qV=Object.freeze(Object.defineProperty({__proto__:null,altAll:_k},Symbol.toStringTag,{value:"Module"}));function QV(e){return _k(e)(e.zero())}const VV=Object.freeze(Object.defineProperty({__proto__:null,altAll:QV},Symbol.toStringTag,{value:"Module"}));var Ik=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))}}}}},qC=function(e){return function(){return{concat:function(t,n){return function(r){return e.concat(t(r),n(r))}}}}},Tk=function(e){var t=qC(e);return function(){return{concat:t().concat,empty:function(){return e.empty}}}},QC=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}}},xk=function(e){var t=QC(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))}}}},zV=function(e){return function(t){return t(e)}};function P(e){return e}var ml=P;function lr(e){return function(){return e}}var VC=lr(!0),wk=lr(!1),$k=lr(null),zC=lr(void 0),HV=zC;function YV(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 Ek(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e}function GV(e){return e+1}function JV(e){return e-1}function Rk(e){throw new Error("Called `absurd` function which should be uncallable")}function ZV(e){return function(t){return e.apply(void 0,t)}}function XV(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e(t)}}function b(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 ez=Rk,fr=function(e,t){return t};function tz(e){return function(t){return!e(t)}}var nz=function(){return{concat:function(e,t){return z(e,t)},empty:P}};const Ok=Object.freeze(Object.defineProperty({__proto__:null,SK:fr,absurd:Rk,apply:zV,constFalse:wk,constNull:$k,constTrue:VC,constUndefined:zC,constVoid:HV,constant:lr,decrement:JV,flip:YV,flow:z,getBooleanAlgebra:Ik,getEndomorphismMonoid:nz,getMonoid:Tk,getRing:xk,getSemigroup:qC,getSemiring:QC,hole:ez,identity:P,increment:GV,not:tz,pipe:b,tuple:Ek,tupled:ZV,unsafeCoerce:ml,untupled:XV},Symbol.toStringTag,{value:"Module"}));var rz=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))},Nt=function(e){return e._tag==="None"},_t=function(e){return e._tag==="Some"},ye={_tag:"None"},fe=function(e){return{_tag:"Some",value:e}},Xt=function(e){return e._tag==="Left"},HC=function(e){return e._tag==="Right"},Zo=function(e){return{_tag:"Left",left:e}},hu=function(e){return{_tag:"Right",right:e}},Tp=function(e){return[e]},vt=function(e){return e.length>0},Fr=function(e){return e[0]},Dl=function(e){return e.slice(1)},bn=[],tn={},ft=Object.prototype.hasOwnProperty,hg=function(e){return rz([e[0]],e.slice(1),!0)};function ua(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 kt(e){return function(t){return function(n){return e.ap(e.map(n,function(r){return function(){return r}}),t)}}}function Lt(e){return function(t){return function(n){return e.ap(e.map(n,function(){return function(r){return r}}),t)}}}function jt(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 nn(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 YC(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):YC(e,t-1,i)}}var ob={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 iz(e){return ft.call(ob,e)||(ob[e]=YC(Ek,e-1,[])),ob[e]}function oz(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r=t.length,i=iz(r),o=e.map(t[0],i),a=1;a<r;a++)o=e.ap(o,t[a]);return o}}function az(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 YC(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 uz(e){return function(t){for(var n=Object.keys(t),r=n.length,i=az(n),o=e.map(t[n[0]],i),a=1;a<r;a++)o=e.ap(o,t[n[a]]);return o}}const sz=Object.freeze(Object.defineProperty({__proto__:null,ap:ua,apFirst:kt,apS:jt,apSecond:Lt,getApplySemigroup:nn,sequenceS:uz,sequenceT:oz},Symbol.toStringTag,{value:"Module"}));function Nl(e,t){return function(n){return function(r){return e.map(r,function(i){return t.map(i,n)})}}}function qe(e){return function(t){return function(n){return e.map(n,function(r){return r(t)})}}}function Ut(e){return function(t){return function(n){return e.map(n,function(r){var i;return i={},i[t]=r,i})}}}function ql(e,t){var n=Nl(e,t);return{map:function(r,i){return b(r,n(i))}}}const cz=Object.freeze(Object.defineProperty({__proto__:null,bindTo:Ut,flap:qe,getFunctorComposition:ql,map:Nl},Symbol.toStringTag,{value:"Module"}));function ei(e){var t=nn(e);return function(n){return{concat:t(n).concat,empty:e.of(n.empty)}}}function Fk(e,t){var n=ql(e,t).map,r=ua(e,t);return{map:n,of:function(i){return e.of(t.of(i))},ap:function(i,o){return b(i,r(o))}}}const lz=Object.freeze(Object.defineProperty({__proto__:null,getApplicativeComposition:Fk,getApplicativeMonoid:ei},Symbol.toStringTag,{value:"Module"}));function dt(e){return function(t){return function(n){return e.chain(n,function(r){return e.map(t(r),function(){return r})})}}}function Bt(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 fz=Object.freeze(Object.defineProperty({__proto__:null,bind:Bt,chainFirst:dt},Symbol.toStringTag,{value:"Module"}));function po(e){return function(t){return function(n){return e.fromEither(Nt(n)?Zo(t()):hu(n.value))}}}function mu(e){return function(t,n){return function(r){return e.fromEither(t(r)?hu(r):Zo(n(r)))}}}function Ao(e){var t=po(e);return function(n){var r=t(n);return function(i){return z(i,r)}}}function Ks(e,t){var n=Ao(e);return function(r){var i=n(r);return function(o){return function(a){return t.chain(a,i(o))}}}}function Mr(e){return function(t){return z(t,e.fromEither)}}function sa(e,t){var n=Mr(e);return function(r){return function(i){return t.chain(i,n(r))}}}function ca(e,t){return z(Mr(e),dt(t))}function Ps(e,t){return function(n,r){return function(i){return t.chain(i,function(o){return e.fromEither(n(o)?hu(o):Zo(r(o)))})}}}const dz=Object.freeze(Object.defineProperty({__proto__:null,chainEitherK:sa,chainFirstEitherK:ca,chainOptionK:Ks,filterOrElse:Ps,fromEitherK:Mr,fromOption:po,fromOptionK:Ao,fromPredicate:mu},Symbol.toStringTag,{value:"Module"}));var ti=function(e){return{equals:function(t,n){return t===n||e(t,n)}}},Mk=function(e){return ti(function(t,n){for(var r in e)if(!e[r].equals(t[r],n[r]))return!1;return!0})},kk=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return ti(function(n,r){return e.every(function(i,o){return i.equals(n[o],r[o])})})},pz=function(e,t){return b(e,Lk(t))},Lk=function(e){return function(t){return ti(function(n,r){return t.equals(e(n),e(r))})}},jk="Eq",Ql={equals:function(e,t){return e===t}},Az={equals:function(){return!0}},Uk=function(){return{concat:function(e,t){return ti(function(n,r){return e.equals(n,r)&&t.equals(n,r)})}}},hz=function(){return{concat:Uk().concat,empty:Az}},Bk={URI:jk,contramap:pz},mz=kk,gz=Mk,vz=Ql.equals,yz=Bk,bz=Ql,Cz=Ql,Sz=Ql,_z={equals:function(e,t){return e.valueOf()===t.valueOf()}};const Iz=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:Bk,URI:jk,contramap:Lk,eq:yz,eqBoolean:bz,eqDate:_z,eqNumber:Sz,eqStrict:Ql,eqString:Cz,fromEquals:ti,getMonoid:hz,getSemigroup:Uk,getStructEq:gz,getTupleEq:mz,strictEqual:vz,struct:Mk,tuple:kk},Symbol.toStringTag,{value:"Module"}));var Wk=function(e){return function(t,n){return t===n||e(t,n)===0}},Ds=function(e){return{equals:Wk(e),compare:function(t,n){return t===n?0:e(t,n)}}},Kk=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Ds(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])})},GC=function(e){return Ds(function(t,n){return e.compare(n,t)})},Tz=function(e,t){return b(e,mg(t))},mg=function(e){return function(t){return Ds(function(n,r){return t.compare(e(n),e(r))})}},Pk="Ord",Dk=function(){return{concat:function(e,t){return Ds(function(n,r){var i=e.compare(n,r);return i!==0?i:t.compare(n,r)})}}},JC=function(){return{concat:Dk().concat,empty:Ds(function(){return 0})}},Nk={URI:Pk,contramap:Tz},xz={equals:VC,compare:lr(0)},wz=function(e){return function(t){return function(n){return n===t||e.compare(n,t)===0}}},qk=function(e){return function(t,n){return e.compare(t,n)===-1}},Qk=function(e){return function(t,n){return e.compare(t,n)===1}},$z=function(e){return function(t,n){return e.compare(t,n)!==1}},Ez=function(e){return function(t,n){return e.compare(t,n)!==-1}},gg=function(e){return function(t,n){return t===n||e.compare(t,n)<1?t:n}},vg=function(e){return function(t,n){return t===n||e.compare(t,n)>-1?t:n}},Vk=function(e){var t=gg(e),n=vg(e);return function(r,i){return function(o){return n(t(o,i),r)}}},Rz=function(e){var t=qk(e),n=Qk(e);return function(r,i){return function(o){return!(t(o,r)||n(o,i))}}},Oz=Kk,Fz=GC,Mz=Nk;function kz(e,t){return e<t?-1:e>t?1:0}var ZC={equals:Ql.equals,compare:kz},Lz=ZC,jz=ZC,dm=ZC,Uz=b(dm,mg(function(e){return e.valueOf()}));const Bz=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:Nk,URI:Pk,between:Rz,clamp:Vk,contramap:mg,equals:wz,equalsDefault:Wk,fromCompare:Ds,geq:Ez,getDualOrd:Fz,getMonoid:JC,getSemigroup:Dk,getTupleOrd:Oz,gt:Qk,leq:$z,lt:qk,max:vg,min:gg,ord:Mz,ordBoolean:Lz,ordDate:Uz,ordNumber:dm,ordString:jz,reverse:GC,trivial:xz,tuple:Kk},Symbol.toStringTag,{value:"Module"}));var zk=function(e){return{concat:function(t,n){return e.concat(n,t)}}},Wz=function(e){return function(t){return{concat:function(n,r){return e(n)?t.concat(n,r):r}}}},Kz=function(e){return function(t){return{concat:function(n,r){return e(r)?t.concat(n,r):n}}}},Pz=function(e){return function(t){return{concat:function(n,r){return t.concat(e(n),e(r))}}}},Hk=function(e){return function(t){return function(n){return n.reduce(function(r,i){return e.concat(r,i)},t)}}};const Dz=Object.freeze(Object.defineProperty({__proto__:null,concatAll:Hk,endo:Pz,filterFirst:Wz,filterSecond:Kz,reverse:zk},Symbol.toStringTag,{value:"Module"}));var yg=function(e){return{concat:gg(e)}},bg=function(e){return{concat:vg(e)}},XC=function(e){return{concat:function(){return e}}},eS=zk,tS=function(e){return{concat:function(t,n){var r={};for(var i in e)ft.call(e,i)&&(r[i]=e[i].concat(t[i],n[i]));return r}}},nS=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])})}}},Yk=function(e){return function(t){return{concat:function(n,r){return t.concat(n,t.concat(e,r))}}}},rS=function(){return{concat:P}},Cg=function(){return{concat:function(e,t){return t}}},iS=Hk,Gk=XC(void 0),Nz=function(){return{concat:function(e,t){return Object.assign({},e,t)}}},qz=Cg,Qz=rS,Vz=nS,zz=tS,Hz=eS,Yz=bg,Gz=yg,Jz=Yk;function Zz(e){var t=iS(e);return function(n,r){return r===void 0?t(n):t(n)(r)}}var Jk={concat:function(e,t){return e&&t}},Zk={concat:function(e,t){return e||t}},Xz=qC,Xk={concat:function(e,t){return e+t}},eL={concat:function(e,t){return e+t}},tL={concat:function(e,t){return e*t}};const nL=Object.freeze(Object.defineProperty({__proto__:null,concatAll:iS,constant:XC,first:rS,fold:Zz,getDualSemigroup:Hz,getFirstSemigroup:Qz,getFunctionSemigroup:Xz,getIntercalateSemigroup:Jz,getJoinSemigroup:Yz,getLastSemigroup:qz,getMeetSemigroup:Gz,getObjectSemigroup:Nz,getStructSemigroup:zz,getTupleSemigroup:Vz,intercalate:Yk,last:Cg,max:bg,min:yg,reverse:eS,semigroupAll:Jk,semigroupAny:Zk,semigroupProduct:tL,semigroupString:Xk,semigroupSum:eL,semigroupVoid:Gk,struct:tS,tuple:nS},Symbol.toStringTag,{value:"Module"}));var Bd=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))},xp=bn,ho=vt,Sg=function(e,t){return e<0||e>=t.length},oS=function(e){return function(t){return Bd([e],t,!0)}},gl=oS,aS=function(e){return function(t){return Bd(Bd([],t,!0),[e],!1)}},_g=aS,Ig=function(e,t,n){if(ho(n)){var r=hg(n);return r.splice(e,0,t),r}return[t]},uS=function(e,t,n){if(n[e]===t)return n;var r=hg(n);return r[e]=t,r},sS=function(e){return function(t){if(t.length===1)return t;for(var n=[Hn(t)],r=wi(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}},rL=function(e){if(ho(e)){var t=JC();return dS(e.reduce(t.concat,t.empty))}return P},cS=function(e){var t=sS(e);return function(n){return function(r){return t(b(r,wp(n)))}}},lS=function(e){return function(t){var n=t.length,r=Math.round(e)%n;if(Sg(Math.abs(r),t)||r===0)return t;if(r<0){var i=wg(-r)(t),o=i[0],a=i[1];return b(a,wp(o))}else return lS(r-n)(t)}},fS=function(e){return ho(e)?fe(e):ye},Tg=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}},eH=function(e){return Tg(function(){return e})},iL=function(e,t){return e<=t?Tg(function(n){return e+n})(t-e+1):[e]},oL=function(e){return[Hn(e),wi(e)]},aL=function(e){return[Vl(e),vu(e)]},tH=function(e){return fS(e.slice())};function uL(e){return function(t){return t.concat(e)}}function wp(e,t){return t?e.concat(t):function(n){return n.concat(e)}}var nH=function(e){return e.length===1?e:Bd([vu(e)],e.slice(0,-1).reverse(),!0)};function sL(e){return function(t){var n=t.length;if(n===0)return xp;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 rH=function(e){return function(t){for(var n={},r=0,i=t;r<i.length;r++){var o=i[r],a=e(o);ft.call(n,a)?n[a].push(o):n[a]=[o]}return n}},dS=function(e){return function(t){return t.length===1?t:t.slice().sort(e.compare)}},iH=function(e,t){return cL(e,function(){return t})},cL=function(e,t){return function(n){return Sg(e,n)?ye:fe(uS(e,t(n[e]),n))}},lL=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 fL(e,t){return t===void 0?function(n){return fL(n,e)}:lL(e,t,function(n,r){return[n,r]})}var oH=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]},xg=function(e){return function(t){for(var n=[e,t[0]],r=1;r<t.length;r++)n.push(e,t[r]);return n}},pS=function(e){return function(t){var n=wi(t);return ho(n)?b(n,xg(e),gl(Hn(t))):t}},dL=function(e){return function(t){for(var n=hg(e(0,Hn(t))),r=1;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},AS=function(e){return function(t){for(var n=e(t),r=n[0],i=n[1],o=[r],a=i;ho(a);){var u=e(a),s=u[0],c=u[1];o.push(s),a=c}return o}},wg=function(e){return function(t){var n=Math.max(1,e);return n>=t.length?[t,xp]:[b(t.slice(1,n),gl(Hn(t))),t.slice(n)]}},pL=function(e){return AS(wg(e))},Oi=function(e,t){return b(e,SS(t))},hS=function(e,t){return b(e,_S(t))},$p=function(e,t){return b(e,yL(t))},mS=function(e,t){return b(e,$g(t))},AL=function(e,t){return b(e,CS(t))},Ep=function(e,t,n){return b(e,IS(t,n))},Rp=function(e){var t=TS(e);return function(n,r){return b(n,t(r))}},Op=function(e,t,n){return b(e,xS(t,n))},gS=function(e){var t=bL(e);return function(n,r){return b(n,t(r))}},hL=function(e,t){return b(e,vL(t))},vS=function(e,t,n){return b(e,Eg(t,n))},yS=function(e){var t=wS(e);return function(n,r){return b(n,t(r))}},bS=function(e,t,n){return b(e,Rg(t,n))},mL=function(e){var t=Fg(e);return function(n,r){return b(n,t(r))}},gu=Tp,gL=function(e){return function(t){return b(t,uL(e()))}},vL=gL,yL=function(e){return $g(function(t){return b(e,SS(t))})},$g=function(e){return dL(function(t,n){return e(n)})},CS=function(e){return function(t){for(var n=wi(t),r=[e(t)];ho(n);)r.push(e(n)),n=wi(n);return r}},aH=CS(P),uH=$g(P),SS=function(e){return _S(function(t,n){return e(n)})},_S=function(e){return function(t){for(var n=[e(0,Hn(t))],r=1;r<t.length;r++)n.push(e(r,t[r]));return n}},IS=function(e,t){return Eg(e,function(n,r,i){return t(r,i)})},TS=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]))}}},xS=function(e,t){return Rg(e,function(n,r,i){return t(r,i)})},Eg=function(e,t){return function(n){return n.reduce(function(r,i,o){return t(o,r,i)},e)}},wS=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]))}}},Rg=function(e,t){return function(n){return n.reduceRight(function(r,i,o){return t(o,i,r)},e)}},bL=function(e){var t=Fg(e);return function(n){return t(function(r,i){return n(i)})}},Og=function(e){return Fg(e)(fr)},Fg=function(e){return function(t){return function(n){for(var r=e.map(t(0,Hn(n)),gu),i=1;i<n.length;i++)r=e.ap(e.map(r,function(o){return function(a){return b(o,_g(a))}}),t(i,n[i]));return r}}},Mg=Fr,zn="ReadonlyNonEmptyArray",CL=function(e){return{show:function(t){return"[".concat(t.map(e.show).join(", "),"]")}}},sH=function(){return{concat:wp}},SL=function(e){return ti(function(t,n){return t.length===n.length&&t.every(function(r,i){return e.equals(r,n[i])})})},cH=function(e){var t=cS(e);return{concat:function(n,r){return t(r)(n)}}},$S={URI:zn,map:Oi},lH=qe($S),fH={URI:zn,of:gu},dH={URI:zn,map:Oi,mapWithIndex:hS},kg={URI:zn,map:Oi,ap:$p},pH=kt(kg),AH=Lt(kg),hH={URI:zn,map:Oi,ap:$p,of:gu},ES={URI:zn,map:Oi,ap:$p,chain:mS},mH=dt(ES),gH={URI:zn,map:Oi,ap:$p,of:gu,chain:mS},vH={URI:zn,reduce:Ep,foldMap:Rp,reduceRight:Op},yH={URI:zn,reduce:Ep,foldMap:Rp,reduceRight:Op,reduceWithIndex:vS,foldMapWithIndex:yS,reduceRightWithIndex:bS},bH={URI:zn,map:Oi,reduce:Ep,foldMap:Rp,reduceRight:Op,traverse:gS,sequence:Og},CH={URI:zn,map:Oi,mapWithIndex:hS,reduce:Ep,foldMap:Rp,reduceRight:Op,traverse:gS,sequence:Og,reduceWithIndex:vS,foldMapWithIndex:yS,reduceRightWithIndex:bS,traverseWithIndex:mL},SH={URI:zn,map:Oi,alt:hL},_H={URI:zn,map:Oi,extend:AL,extract:Mg},IH=gu(tn),TH=Ut($S),xH=Bt(ES),wH=jt(kg),Hn=Mg,wi=Dl,vu=function(e){return e[e.length-1]},Vl=function(e){return e.slice(0,-1)},_L=function(e){var t=yg(e);return function(n){return n.reduce(t.concat)}},IL=function(e){var t=bg(e);return function(n){return n.reduce(t.concat)}},Lg=function(e){return function(t){return t.reduce(e.concat)}},$H=function(e){return function(t){return e(Hn(t),wi(t))}},EH=function(e){return function(t){return e(Vl(t),vu(t))}},TL=function(e){return function(t){return Bd([e(Hn(t))],wi(t),!0)}},RH=function(e){return TL(function(){return e})},xL=function(e){return function(t){return b(Vl(t),_g(e(vu(t))))}},OH=function(e){return xL(function(){return e})},RS=function(e){var t=Lg(e);return function(n){return z(pS(n),t)}};function FH(e){var t=dS(e),n=sL(e);return function(r){return ho(r)?n(t(r)):xp}}function MH(e){return wL(function(t,n){return e(n)})}var wL=function(e){return function(t){return fS(t.filter(function(n,r){return e(r,n)}))}},kH=oL,LH=aL;function $L(e,t){return t===void 0?gl(e):b(t,gl(e))}var EL=function(e,t){return b(e,wp([t]))},jH=function(e,t){return function(n){return e<0||e>n.length?ye:fe(Ig(e,t,n))}},UH=xg,BH=Lg,WH={URI:zn,of:gu,map:Oi,mapWithIndex:hS,ap:$p,chain:mS,extend:AL,extract:Mg,reduce:Ep,foldMap:Rp,reduceRight:Op,traverse:gS,sequence:Og,reduceWithIndex:vS,foldMapWithIndex:yS,reduceRightWithIndex:bS,traverseWithIndex:mL,alt:hL};const KH=Object.freeze(Object.defineProperty({__proto__:null,Alt:SH,Applicative:hH,Apply:kg,Chain:ES,Comonad:_H,Do:IH,Foldable:vH,FoldableWithIndex:yH,Functor:$S,FunctorWithIndex:dH,Monad:gH,Pointed:fH,Traversable:bH,TraversableWithIndex:CH,URI:zn,alt:vL,altW:gL,ap:yL,apFirst:pH,apS:wH,apSecond:AH,append:_g,appendW:aS,bind:xH,bindTo:TH,chain:$g,chainFirst:mH,chainWithIndex:dL,chop:AS,chunksOf:pL,concat:wp,concatAll:Lg,concatW:uL,cons:$L,duplicate:aH,empty:xp,extend:CS,extract:Mg,filter:MH,filterWithIndex:wL,flap:lH,flatten:uH,fold:BH,foldMap:TS,foldMapWithIndex:wS,fromArray:tH,fromReadonlyArray:fS,getEq:SL,getSemigroup:sH,getShow:CL,getUnionSemigroup:cH,group:sL,groupBy:rH,groupSort:FH,head:Hn,init:Vl,insertAt:jH,intercalate:RS,intersperse:pS,isNonEmpty:ho,isOutOfBound:Sg,last:vu,makeBy:Tg,map:SS,mapWithIndex:_S,matchLeft:$H,matchRight:EH,max:IL,min:_L,modifyAt:cL,modifyHead:TL,modifyLast:xL,of:gu,prepend:gl,prependAll:xg,prependToAll:UH,prependW:oS,range:iL,readonlyNonEmptyArray:WH,reduce:IS,reduceRight:xS,reduceRightWithIndex:Rg,reduceWithIndex:Eg,replicate:eH,reverse:nH,rotate:lS,sequence:Og,snoc:EL,sort:dS,sortBy:rL,splitAt:wg,tail:wi,traverse:bL,traverseWithIndex:Fg,unappend:aL,uncons:kH,union:cS,uniq:sS,unprepend:oL,unsafeInsertAt:Ig,unsafeUpdateAt:uS,unsnoc:LH,unzip:oH,updateAt:iH,updateHead:RH,updateLast:OH,zip:fL,zipWith:lL},Symbol.toStringTag,{value:"Module"}));var Wd=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))},la=function(e){return e.length>0},jg=function(e,t){return e<0||e>=t.length},OS=function(e){return function(t){return Wd([e],t,!0)}},vl=OS,FS=function(e){return function(t){return Wd(Wd([],t,!0),[e],!1)}},Fp=FS,MS=function(e,t,n){if(la(n)){var r=Mp(n);return r.splice(e,0,t),r}return[t]},kS=function(e,t,n){var r=Mp(n);return r[e]=t,r},LS=function(e){return function(t){if(t.length===1)return zl(t);for(var n=[ni(t)],r=$i(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}},RL=function(e){if(la(e)){var t=JC();return WS(e.reduce(t.concat,t.empty))}return zl},jS=function(e){var t=LS(e);return function(n){return function(r){return t(b(r,Bg(n)))}}},US=function(e){return function(t){var n=t.length,r=Math.round(e)%n;if(jg(Math.abs(r),t)||r===0)return zl(t);if(r<0){var i=Kg(-r)(t),o=i[0],a=i[1];return b(a,Bg(o))}else return US(r-n)(t)}},Mp=hg,BS=function(e){return la(e)?fe(e):ye},Ug=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}},PH=function(e){return Ug(function(){return e})},OL=function(e,t){return e<=t?Ug(function(n){return e+n})(t-e+1):[e]},FL=function(e){return[ni(e),$i(e)]},ML=function(e){return[Yl(e),Hl(e)]};function kL(e){return function(t){return t.concat(e)}}function Bg(e,t){return t?e.concat(t):function(n){return n.concat(e)}}var DH=function(e){return Wd([Hl(e)],e.slice(0,-1).reverse(),!0)};function LL(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 NH=function(e){return function(t){for(var n={},r=0,i=t;r<i.length;r++){var o=i[r],a=e(o);ft.call(n,a)?n[a].push(o):n[a]=[o]}return n}},WS=function(e){return function(t){return t.slice().sort(e.compare)}},qH=function(e,t){return function(n){return e<0||e>n.length?ye:fe(MS(e,t,n))}},QH=function(e,t){return jL(e,function(){return t})},jL=function(e,t){return function(n){return jg(e,n)?ye:fe(kS(e,t(n[e]),n))}},zl=Mp,yu=function(e){return[e]},UL=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 BL(e,t){return t===void 0?function(n){return BL(n,e)}:UL(e,t,function(n,r){return[n,r]})}var VH=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]},Wg=function(e){return function(t){for(var n=[e,t[0]],r=1;r<t.length;r++)n.push(e,t[r]);return n}},WL=function(e){return function(t){var n=$i(t);return la(n)?b(n,Wg(e),vl(ni(t))):zl(t)}},KL=wS,PL=TS,DL=function(e){return function(t){for(var n=Mp(e(0,ni(t))),r=1;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},KS=function(e){return function(t){for(var n=e(t),r=n[0],i=n[1],o=[r],a=i;la(a);){var u=e(a),s=u[0],c=u[1];o.push(s),a=c}return o}},Kg=function(e){return function(t){var n=Math.max(1,e);return n>=t.length?[zl(t),[]]:[b(t.slice(1,n),vl(ni(t))),t.slice(n)]}},NL=function(e){return KS(Kg(e))},Fi=function(e,t){return b(e,HS(t))},PS=function(e,t){return b(e,YS(t))},kp=function(e,t){return b(e,YL(t))},DS=function(e,t){return b(e,Pg(t))},qL=function(e,t){return b(e,zS(t))},Lp=function(e,t,n){return b(e,GL(t,n))},jp=function(e){var t=PL(e);return function(n,r){return b(n,t(r))}},Up=function(e,t,n){return b(e,ZL(t,n))},NS=function(e){var t=ej(e);return function(n,r){return b(n,t(r))}},QL=function(e,t){return b(e,HL(t))},qS=function(e,t,n){return b(e,JL(t,n))},QS=function(e){var t=KL(e);return function(n,r){return b(n,t(r))}},VS=function(e,t,n){return b(e,XL(t,n))},VL=function(e){var t=Ng(e);return function(n,r){return b(n,t(r))}},zL=function(e){return function(t){return b(t,kL(e()))}},HL=zL,YL=function(e){return Pg(function(t){return b(e,HS(t))})},Pg=function(e){return DL(function(t,n){return e(n)})},zS=function(e){return function(t){for(var n=$i(t),r=[e(t)];la(n);)r.push(e(n)),n=$i(n);return r}},zH=zS(P),HH=Pg(P),HS=function(e){return YS(function(t,n){return e(n)})},YS=function(e){return function(t){for(var n=[e(0,ni(t))],r=1;r<t.length;r++)n.push(e(r,t[r]));return n}},GL=IS,JL=Eg,ZL=xS,XL=Rg,ej=function(e){var t=Ng(e);return function(n){return t(function(r,i){return n(i)})}},Dg=function(e){return Ng(e)(function(t,n){return n})},Ng=function(e){return function(t){return function(n){for(var r=e.map(t(0,ni(n)),yu),i=1;i<n.length;i++)r=e.ap(e.map(r,function(o){return function(a){return b(o,Fp(a))}}),t(i,n[i]));return r}}},GS=Hn,Yn="NonEmptyArray",YH=CL,GH=function(){return{concat:Bg}},JH=SL,ZH=function(e){var t=jS(e);return{concat:function(n,r){return t(r)(n)}}},JS={URI:Yn,map:Fi},XH=qe(JS),eY={URI:Yn,of:yu},tY={URI:Yn,map:Fi,mapWithIndex:PS},qg={URI:Yn,map:Fi,ap:kp},nY=kt(qg),rY=Lt(qg),iY={URI:Yn,map:Fi,ap:kp,of:yu},ZS={URI:Yn,map:Fi,ap:kp,chain:DS},oY=dt(ZS),aY={URI:Yn,map:Fi,ap:kp,of:yu,chain:DS},uY={URI:Yn,reduce:Lp,foldMap:jp,reduceRight:Up},sY={URI:Yn,reduce:Lp,foldMap:jp,reduceRight:Up,reduceWithIndex:qS,foldMapWithIndex:QS,reduceRightWithIndex:VS},cY={URI:Yn,map:Fi,reduce:Lp,foldMap:jp,reduceRight:Up,traverse:NS,sequence:Dg},lY={URI:Yn,map:Fi,mapWithIndex:PS,reduce:Lp,foldMap:jp,reduceRight:Up,traverse:NS,sequence:Dg,reduceWithIndex:qS,foldMapWithIndex:QS,reduceRightWithIndex:VS,traverseWithIndex:VL},fY={URI:Yn,map:Fi,alt:QL},dY={URI:Yn,map:Fi,extend:qL,extract:GS},pY=yu(tn),AY=Ut(JS),hY=Bt(ZS),mY=jt(qg),ni=Hn,$i=function(e){return e.slice(1)},Hl=vu,Yl=function(e){return e.slice(0,-1)},gY=_L,vY=IL,yY=function(e){return function(t){return t.reduce(e.concat)}},bY=function(e){return function(t){return e(ni(t),$i(t))}},CY=function(e){return function(t){return e(Yl(t),Hl(t))}},tj=function(e){return function(t){return Wd([e(ni(t))],$i(t),!0)}},SY=function(e){return tj(function(){return e})},nj=function(e){return function(t){return b(Yl(t),Fp(e(Hl(t))))}},_Y=function(e){return nj(function(){return e})},IY=RS;function TY(e){var t=WS(e),n=LL(e);return function(r){return la(r)?n(t(r)):[]}}function xY(e){return rj(function(t,n){return e(n)})}var rj=function(e){return function(t){return BS(t.filter(function(n,r){return e(r,n)}))}},wY=FL,$Y=ML;function ij(e,t){return t===void 0?vl(e):b(t,vl(e))}var oj=function(e,t){return b(e,Fp(t))},EY=Wg,RY=Lg,OY={URI:Yn,of:yu,map:Fi,mapWithIndex:PS,ap:kp,chain:DS,extend:qL,extract:GS,reduce:Lp,foldMap:jp,reduceRight:Up,traverse:NS,sequence:Dg,reduceWithIndex:qS,foldMapWithIndex:QS,reduceRightWithIndex:VS,traverseWithIndex:VL,alt:QL};const FY=Object.freeze(Object.defineProperty({__proto__:null,Alt:fY,Applicative:iY,Apply:qg,Chain:ZS,Comonad:dY,Do:pY,Foldable:uY,FoldableWithIndex:sY,Functor:JS,FunctorWithIndex:tY,Monad:aY,Pointed:eY,Traversable:cY,TraversableWithIndex:lY,URI:Yn,alt:HL,altW:zL,ap:YL,apFirst:nY,apS:mY,apSecond:rY,append:Fp,appendW:FS,bind:hY,bindTo:AY,chain:Pg,chainFirst:oY,chainWithIndex:DL,chop:KS,chunksOf:NL,concat:Bg,concatAll:yY,concatW:kL,cons:ij,copy:zl,duplicate:zH,extend:zS,extract:GS,filter:xY,filterWithIndex:rj,flap:XH,flatten:HH,fold:RY,foldMap:PL,foldMapWithIndex:KL,fromArray:BS,fromReadonlyNonEmptyArray:Mp,getEq:JH,getSemigroup:GH,getShow:YH,getUnionSemigroup:ZH,group:LL,groupBy:NH,groupSort:TY,head:ni,init:Yl,insertAt:qH,intercalate:IY,intersperse:WL,isNonEmpty:la,isOutOfBound:jg,last:Hl,makeBy:Ug,map:HS,mapWithIndex:YS,matchLeft:bY,matchRight:CY,max:vY,min:gY,modifyAt:jL,modifyHead:tj,modifyLast:nj,nonEmptyArray:OY,of:yu,prepend:vl,prependAll:Wg,prependToAll:EY,prependW:OS,range:OL,reduce:GL,reduceRight:ZL,reduceRightWithIndex:XL,reduceWithIndex:JL,replicate:PH,reverse:DH,rotate:US,sequence:Dg,snoc:oj,sort:WS,sortBy:RL,splitAt:Kg,tail:$i,traverse:ej,traverseWithIndex:Ng,unappend:ML,uncons:wY,union:jS,uniq:LS,unprepend:FL,unsafeInsertAt:MS,unsafeUpdateAt:kS,unsnoc:$Y,unzip:VH,updateAt:QH,updateHead:SY,updateLast:_Y,zip:BL,zipWith:UL},Symbol.toStringTag,{value:"Module"}));var MY=function(e){return typeof e=="number"},XS={equals:function(e,t){return e===t}},Qg={equals:XS.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},kY={equals:XS.equals,compare:Qg.compare,top:1/0,bottom:-1/0},LY={show:function(e){return JSON.stringify(e)}},aj={concat:function(e,t){return e-t}},e_={concat:function(e,t){return e+t}},t_={concat:function(e,t){return e*t}},jY={concat:e_.concat,empty:0},UY={concat:t_.concat,empty:1},BY={add:e_.concat,zero:0,mul:t_.concat,one:1,sub:aj.concat,degree:function(e){return 1},div:function(e,t){return e/t},mod:function(e,t){return e%t}};const WY=Object.freeze(Object.defineProperty({__proto__:null,Bounded:kY,Eq:XS,Field:BY,MagmaSub:aj,MonoidProduct:UY,MonoidSum:jY,Ord:Qg,SemigroupProduct:t_,SemigroupSum:e_,Show:LY,isNumber:MY},Symbol.toStringTag,{value:"Module"}));var Re=function(e,t){return{left:e,right:t}},KY=function(e,t){return b(e,uj(t))},PY=function(e,t){return b(e,sj(t))},DY=function(e,t,n){return b(e,cj(t,n))},uj=function(e){return function(t){return Re(Vg(t),e(zg(t)))}},sj=function(e){return function(t){return Re(e(Vg(t)),zg(t))}},cj=function(e,t){return function(n){return Re(e(Vg(n)),t(zg(n)))}},n_="Separated",NY={URI:n_,mapLeft:PY,bimap:DY},lj={URI:n_,map:KY},qY=qe(lj),Vg=function(e){return e.left},zg=function(e){return e.right};const QY=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:NY,Functor:lj,URI:n_,bimap:cj,flap:qY,left:Vg,map:uj,mapLeft:sj,right:zg,separated:Re},Symbol.toStringTag,{value:"Module"}));function Mi(e,t){return function(n){var r=e.traverse(n);return function(i,o){return n.map(r(i,o),t.separate)}}}function ki(e,t){return function(n){var r=e.traverse(n);return function(i,o){return n.map(r(i,o),t.compact)}}}function r_(e){return function(t){var n=e.wither(t);return function(r){return function(i){return n(i,function(o){return t.map(r(o),function(a){return a?fe(o):ye})})}}}}const VY=Object.freeze(Object.defineProperty({__proto__:null,filterE:r_,wiltDefault:Mi,witherDefault:ki},Symbol.toStringTag,{value:"Module"}));function Gl(e,t){return function(n){return n?t.of(void 0):e.zero()}}const zY=Object.freeze(Object.defineProperty({__proto__:null,guard:Gl},Symbol.toStringTag,{value:"Module"}));var HY=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))},oo=function(e){return e.length===0},Mt=ho,YY=gl,GY=oS,Hg=_g,JY=aS,fj=function(e,t){return e<=0?xt:Tg(t)(e)},ZY=function(e,t){return fj(e,function(){return t})};function XY(e){return function(t){return e(t)?[t]:xt}}var dj=function(e){return Nt(e)?xt:[e.value]},pj=function(e){return Xt(e)?xt:[e.right]},Aj=function(e,t){return function(n){return Mt(n)?t(n):e()}},hj=Aj,mj=function(e,t){return function(n){return Mt(n)?t(Hn(n),wi(n)):e()}},gj=mj,eG=gj,vj=function(e,t){return function(n){return Mt(n)?t(Vl(n),vu(n)):e()}},yj=vj,tG=yj,bj=function(e){return function(t){if(oo(t))return xt;for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},nG=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}},rG=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}},iG=function(e){return e.length},Jl=Sg;function bs(e,t){return t===void 0?function(n){return bs(e,n)}:Jl(e,t)?ye:fe(t[e])}var Cj=function(e){return Mt(e)?fe(Hn(e)):ye},Sj=function(e){return Mt(e)?fe(vu(e)):ye},oG=function(e){return Mt(e)?fe(wi(e)):ye},aG=function(e){return Mt(e)?fe(Vl(e)):ye},uG=function(e){return function(t){return Jl(e,t)?t:e===0?xt:t.slice(0,e)}},sG=function(e){return function(t){return Jl(e,t)?t:e===0?xt:t.slice(-e)}};function cG(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?xt:n}}var _j=function(e,t){for(var n=e.length,r=0;r<n&&t(e[r]);r++);return r};function lG(e){return function(t){var n=Fj(_j(t,e))(t),r=n[0],i=n[1];return{init:r,rest:i}}}var fG=function(e){return function(t){return e<=0||oo(t)?t:e>=t.length?xt:t.slice(e,t.length)}},dG=function(e){return function(t){return e<=0||oo(t)?t:e>=t.length?xt:t.slice(0,t.length-e)}};function pG(e){return function(t){var n=_j(t,e);return n===0?t:n===t.length?xt:t.slice(n)}}var Yg=function(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return fe(n);return ye}};function Gg(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return fe(t[n]);return ye}}var Ij=function(e){return function(t){for(var n=0;n<t.length;n++){var r=e(t[n]);if(_t(r))return r}return ye}};function Tj(e){return function(t){for(var n=t.length-1;n>=0;n--)if(e(t[n]))return fe(t[n]);return ye}}var xj=function(e){return function(t){for(var n=t.length-1;n>=0;n--){var r=e(t[n]);if(_t(r))return r}return ye}},wj=function(e){return function(t){for(var n=t.length-1;n>=0;n--)if(e(t[n]))return fe(n);return ye}},AG=function(e,t){return function(n){return e<0||e>n.length?ye:fe(Ig(e,t,n))}},hG=function(e,t){return $j(e,function(){return t})},mG=function(e){return function(t){return Jl(e,t)?ye:fe(iU(e,t))}},$j=function(e,t){return function(n){return Jl(e,n)?ye:fe(av(e,t(n[e]),n))}},gG=function(e){return e.length<=1?e:e.slice().reverse()},vG=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Right"&&t.push(r.right)}return t},yG=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Left"&&t.push(r.left)}return t},bG=function(e){return function(t){return t.length<=1?t:t.slice().sort(e.compare)}},Ej=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 Rj(e,t){return t===void 0?function(n){return Rj(n,e)}:Ej(e,t,function(n,r){return[n,r]})}var CG=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]},Oj=function(e){var t=xg(e);return function(n){return Mt(n)?t(n):n}},SG=function(e){var t=pS(e);return function(n){return Mt(n)?t(n):n}},_G=function(e){var t=lS(e);return function(n){return Mt(n)?t(n):n}};function Bp(e){return function(t,n){if(n===void 0){var r=Bp(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 IG=function(e){var t=sS(e);return function(n){return Mt(n)?t(n):n}},TG=function(e){var t=rL(e);return function(n){return Mt(n)?t(n):n}},xG=function(e){var t=AS(e);return function(n){return Mt(n)?t(n):xt}},Fj=function(e){return function(t){return e>=1&&Mt(t)?wg(e)(t):oo(t)?[t,xt]:[xt,t]}},wG=function(e){var t=pL(e);return function(n){return Mt(n)?t(n):xt}},$G=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return dj(e.apply(void 0,t))}};function EG(e,t,n){n===void 0&&(n=function(){return!0});var r=function(i,o){return Mt(o)?b(Hn(o),Kp(function(a){return r(b(i,Hg(a)),wi(o))})):n.apply(void 0,i)?[t.apply(void 0,i)]:xt};return r(xt,e)}var Mj=function(e){return function(t){return oo(t)?e:oo(e)?t:t.concat(e)}},RG=Mj;function i_(e){var t=cS(e);return function(n,r){if(r===void 0){var i=i_(e);return function(o){return i(o,n)}}return Mt(n)&&Mt(r)?t(r)(n):Mt(n)?n:r}}function o_(e){var t=Bp(e);return function(n,r){if(r===void 0){var i=o_(e);return function(o){return i(o,n)}}return n.filter(function(o){return t(o,r)})}}function a_(e){var t=Bp(e);return function(n,r){if(r===void 0){var i=a_(e);return function(o){return i(o,n)}}return n.filter(function(o){return!t(o,r)})}}var Cn=function(e,t){return b(e,p_(t))},Jg=function(e,t){return b(e,Nj(t))},bu=function(e,t){return b(e,Dj(t))},Wp=function(e,t){return b(e,Kp(t))},Zg=function(e,t){return b(e,qj(t))},Xg=function(e,t){return b(e,h_(t))},ev=function(e,t){return b(e,Qj(t))},tv=function(e,t){return b(e,Vj(t))},kj=function(e,t){return b(e,m_(t))},Lj=function(e,t){return b(e,g_(t))},u_=function(e,t){return b(e,Pj(t))},Ns=function(e,t,n){return b(e,y_(t,n))},Zl=function(e){var t=b_(e);return function(n,r){return b(n,t(r))}},Xl=function(e,t,n){return b(e,C_(t,n))},s_=function(e,t,n){return b(e,Pp(t,n))},c_=function(e){var t=rv(e);return function(n,r){return b(n,t(r))}},l_=function(e,t,n){return b(e,iv(t,n))},jj=function(e,t){return b(e,A_(t))},Uj=function(e,t){return b(e,zj(t))},Bj=function(e,t){return b(e,v_(t))},nv=function(e){var t=Hj(e);return function(n,r){return b(n,t(r))}},Wj=function(e){var t=S_(e);return function(n,r){return b(n,t(r))}},f_=function(e,t){return b(e,$_(t))},d_=function(e,t){return b(e,E_(t))},qs=gu,ef=function(){return xt},Kj=function(e){return function(t){return t.concat(e())}},Pj=Kj,Dj=function(e){return Kp(function(t){return b(e,p_(t))})},Kp=function(e){return function(t){return b(t,bj(function(n,r){return e(r)}))}},OG=Kp(P),p_=function(e){return function(t){return t.map(function(n){return e(n)})}},Nj=function(e){return function(t){return t.map(function(n,r){return e(r,n)})}},tf=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 Re(t,n)},qj=function(e){return function(t){return t.filter(e)}},A_=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);_t(i)&&n.push(i.value)}return n}},h_=function(e){return A_(function(t,n){return e(n)})},nf=h_(P),Qj=function(e){return m_(function(t,n){return e(n)})},m_=function(e){return function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=t[i];e(i,o)?r.push(o):n.push(o)}return Re(n,r)}},Vj=function(e){return g_(function(t,n){return e(n)})},g_=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 Re(n,r)}},zj=function(e){return function(t){return t.filter(function(n,r){return e(r,n)})}},v_=function(e){return function(t){return t.map(function(n,r){return e(t.slice(r))})}},FG=v_(P),rv=function(e){return function(t){return function(n){return n.reduce(function(r,i,o){return e.concat(r,t(o,i))},e.empty)}}},y_=function(e,t){return Pp(e,function(n,r,i){return t(r,i)})},b_=function(e){var t=rv(e);return function(n){return t(function(r,i){return n(i)})}},Pp=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}},C_=function(e,t){return iv(e,function(n,r,i){return t(r,i)})},iv=function(e,t){return function(n){return n.reduceRight(function(r,i,o){return t(o,i,r)},e)}},Hj=function(e){var t=S_(e);return function(n){return t(function(r,i){return n(i)})}},Dp=function(e){return function(t){return Ns(t,e.of(ef()),function(n,r){return e.ap(e.map(n,function(i){return function(o){return b(i,Hg(o))}}),r)})}},S_=function(e){return function(t){return Pp(e.of(ef()),function(n,r,i){return e.ap(e.map(r,function(o){return function(a){return b(o,Hg(a))}}),t(n,i))})}},MG=function(e){var t=R_(e);return function(n){return function(r){return t(r,n)}}},kG=function(e){var t=O_(e);return function(n){return function(r){return t(r,n)}}},__=function(e,t){for(var n=[],r=e;;){var i=t(r);if(_t(i)){var o=i.value,a=o[0],u=o[1];n.push(a),r=u}else break}return n},pt="ReadonlyArray",Yj=function(e){return{show:function(t){return"[".concat(t.map(e.show).join(", "),"]")}}},Gj=function(){return{concat:function(e,t){return oo(e)?t:oo(t)?e:e.concat(t)}}},LG=function(){return{concat:Gj().concat,empty:xt}},Jj=function(e){return ti(function(t,n){return t.length===n.length&&t.every(function(r,i){return e.equals(r,n[i])})})},Zj=function(e){return Ds(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 Qg.compare(r,i)})},Xj=function(e){var t=i_(e);return{concat:function(n,r){return t(r)(n)}}},jG=function(e){return{concat:Xj(e).concat,empty:xt}},UG=function(e){var t=o_(e);return{concat:function(n,r){return t(r)(n)}}},BG=function(e){var t=a_(e);return{concat:function(n,r){return t(r)(n)}}},I_={URI:pt,map:Cn},WG=qe(I_),eU={URI:pt,of:qs},KG={URI:pt,map:Cn,mapWithIndex:Jg},ov={URI:pt,map:Cn,ap:bu},PG=kt(ov),DG=Lt(ov),NG={URI:pt,map:Cn,ap:bu,of:qs},T_={URI:pt,map:Cn,ap:bu,chain:Wp},qG={URI:pt,map:Cn,ap:bu,of:qs,chain:Wp},QG=dt(T_),VG={URI:pt,unfold:__},zG={URI:pt,map:Cn,alt:u_},tU={URI:pt,zero:ef},HG=Gl(tU,eU),YG={URI:pt,map:Cn,ap:bu,of:qs,alt:u_,zero:ef},GG={URI:pt,map:Cn,extend:Bj},x_={URI:pt,compact:nf,separate:tf},JG={URI:pt,map:Cn,compact:nf,separate:tf,filter:Zg,filterMap:Xg,partition:ev,partitionMap:tv},ZG={URI:pt,map:Cn,mapWithIndex:Jg,compact:nf,separate:tf,filter:Zg,filterMap:Xg,partition:ev,partitionMap:tv,partitionMapWithIndex:Lj,partitionWithIndex:kj,filterMapWithIndex:jj,filterWithIndex:Uj},XG={URI:pt,reduce:Ns,foldMap:Zl,reduceRight:Xl},eJ={URI:pt,reduce:Ns,foldMap:Zl,reduceRight:Xl,reduceWithIndex:s_,foldMapWithIndex:c_,reduceRightWithIndex:l_},w_={URI:pt,map:Cn,reduce:Ns,foldMap:Zl,reduceRight:Xl,traverse:nv,sequence:Dp},tJ={URI:pt,map:Cn,mapWithIndex:Jg,reduce:Ns,foldMap:Zl,reduceRight:Xl,reduceWithIndex:s_,foldMapWithIndex:c_,reduceRightWithIndex:l_,traverse:nv,sequence:Dp,traverseWithIndex:Wj},$_=function(e){return function(t){for(var n=HY([],e(t),!0),r=[];n.length>0;){var i=n.shift();Xt(i)?n.unshift.apply(n,e(i.left)):r.push(i.right)}return r}},nJ={URI:pt,map:Cn,ap:bu,chain:Wp,chainRec:f_},E_=function(e){return function(t){var n=e(t),r=[],i=[];function o(c){Xt(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}},rJ={URI:pt,map:Cn,ap:bu,chain:Wp,chainRec:d_},R_=ki(w_,x_),O_=Mi(w_,x_),nU={URI:pt,map:Cn,compact:nf,separate:tf,filter:Zg,filterMap:Xg,partition:ev,partitionMap:tv,reduce:Ns,foldMap:Zl,reduceRight:Xl,traverse:nv,sequence:Dp,wither:R_,wilt:O_},iJ=r_(nU),rU={URI:pt,fromEither:pj},oJ=Mr(rU),aJ=Ig,av=function(e,t,n){return Mt(n)?uS(e,t,n):n},iU=function(e,t){var n=t.slice();return n.splice(e,1),n},uJ=function(e){return e.slice()},sJ=function(e){return oo(e)?xt:e.slice()},xt=xp;function oU(e){return function(t){return t.every(e)}}var aU=function(e){return function(t){return t.some(e)}},cJ=aU,uU=function(e){var t=RS(e);return function(n){return hj(function(){return e.empty},t(n))}},lJ=qs(tn),fJ=Ut(I_),dJ=Bt(T_),pJ=jt(ov),AJ=iL,hJ=$L,mJ=EL,gJ=Oj,vJ={URI:pt,compact:nf,separate:tf,map:Cn,ap:bu,of:qs,chain:Wp,filter:Zg,filterMap:Xg,partition:ev,partitionMap:tv,mapWithIndex:Jg,partitionMapWithIndex:Lj,partitionWithIndex:kj,filterMapWithIndex:jj,filterWithIndex:Uj,alt:u_,zero:ef,unfold:__,reduce:Ns,foldMap:Zl,reduceRight:Xl,traverse:nv,sequence:Dp,reduceWithIndex:s_,foldMapWithIndex:c_,reduceRightWithIndex:l_,traverseWithIndex:Wj,extend:Bj,wither:R_,wilt:O_};const yJ=Object.freeze(Object.defineProperty({__proto__:null,Alt:zG,Alternative:YG,Applicative:NG,Apply:ov,Chain:T_,ChainRecBreadthFirst:rJ,ChainRecDepthFirst:nJ,Compactable:x_,Do:lJ,Extend:GG,Filterable:JG,FilterableWithIndex:ZG,Foldable:XG,FoldableWithIndex:eJ,FromEither:rU,Functor:I_,FunctorWithIndex:KG,Monad:qG,Pointed:eU,Traversable:w_,TraversableWithIndex:tJ,URI:pt,Unfoldable:VG,Witherable:nU,Zero:tU,_chainRecBreadthFirst:d_,_chainRecDepthFirst:f_,alt:Pj,altW:Kj,ap:Dj,apFirst:PG,apS:pJ,apSecond:DG,append:Hg,appendW:JY,bind:dJ,bindTo:fJ,chain:Kp,chainFirst:QG,chainRecBreadthFirst:E_,chainRecDepthFirst:$_,chainWithIndex:bj,chop:xG,chunksOf:wG,compact:nf,comprehension:EG,concat:RG,concatW:Mj,cons:hJ,deleteAt:mG,difference:a_,dropLeft:fG,dropLeftWhile:pG,dropRight:dG,duplicate:FG,elem:Bp,empty:xt,every:oU,exists:cJ,extend:v_,filter:qj,filterE:iJ,filterMap:h_,filterMapWithIndex:A_,filterWithIndex:zj,findFirst:Gg,findFirstMap:Ij,findIndex:Yg,findLast:Tj,findLastIndex:wj,findLastMap:xj,flap:WG,flatten:OG,foldLeft:eG,foldMap:b_,foldMapWithIndex:rv,foldRight:tG,fromArray:sJ,fromEither:pj,fromEitherK:oJ,fromOption:dj,fromOptionK:$G,fromPredicate:XY,getDifferenceMagma:BG,getEq:Jj,getIntersectionSemigroup:UG,getMonoid:LG,getOrd:Zj,getSemigroup:Gj,getShow:Yj,getUnionMonoid:jG,getUnionSemigroup:Xj,guard:HG,head:Cj,init:aG,insertAt:AG,intercalate:uU,intersection:o_,intersperse:SG,isEmpty:oo,isNonEmpty:Mt,isOutOfBound:Jl,last:Sj,lefts:yG,lookup:bs,makeBy:fj,map:p_,mapWithIndex:Nj,match:hj,matchLeft:gj,matchLeftW:mj,matchRight:yj,matchRightW:vj,matchW:Aj,modifyAt:$j,of:qs,partition:Qj,partitionMap:Vj,partitionMapWithIndex:g_,partitionWithIndex:m_,prepend:YY,prependAll:Oj,prependToAll:gJ,prependW:GY,range:AJ,readonlyArray:vJ,reduce:y_,reduceRight:C_,reduceRightWithIndex:iv,reduceWithIndex:Pp,replicate:ZY,reverse:gG,rights:vG,rotate:_G,scanLeft:nG,scanRight:rG,separate:tf,sequence:Dp,size:iG,snoc:mJ,some:aU,sort:bG,sortBy:TG,spanLeft:lG,splitAt:Fj,tail:oG,takeLeft:uG,takeLeftWhile:cG,takeRight:sG,toArray:uJ,traverse:Hj,traverseWithIndex:S_,unfold:__,union:i_,uniq:IG,unsafeDeleteAt:iU,unsafeInsertAt:aJ,unsafeUpdateAt:av,unzip:CG,updateAt:hG,wilt:kG,wither:MG,zero:ef,zip:Rj,zipWith:Ej},Symbol.toStringTag,{value:"Module"}));var uu=function(e){return e.length===0},qt=la,bJ=vl,CJ=OS,uv=Fp,SJ=FS,sU=function(e,t){return e<=0?[]:Ug(t)(e)},_J=function(e,t){return sU(e,function(){return t})};function IJ(e){return function(t){return e(t)?[t]:[]}}var cU=function(e){return Nt(e)?[]:[e.value]},lU=function(e){return Xt(e)?[]:[e.right]},fU=function(e,t){return function(n){return qt(n)?t(n):e()}},TJ=fU,dU=function(e,t){return function(n){return qt(n)?t(ni(n),$i(n)):e()}},pU=dU,xJ=pU,AU=function(e,t){return function(n){return qt(n)?t(Yl(n),Hl(n)):e()}},hU=AU,wJ=hU,mU=function(e){return function(t){for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},$J=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}},EJ=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}},RJ=function(e){return e.length},Np=jg,OJ=bs,FJ=Cj,MJ=Sj,kJ=function(e){return qt(e)?fe($i(e)):ye},LJ=function(e){return qt(e)?fe(Yl(e)):ye},jJ=function(e){return function(t){return Np(e,t)?On(t):t.slice(0,e)}},UJ=function(e){return function(t){return Np(e,t)?On(t):e===0?[]:t.slice(-e)}};function BJ(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 gU=function(e,t){for(var n=e.length,r=0;r<n&&t(e[r]);r++);return r};function WJ(e){return function(t){var n=SU(gU(t,e))(t),r=n[0],i=n[1];return{init:r,rest:i}}}var KJ=function(e){return function(t){return e<=0||uu(t)?On(t):e>=t.length?[]:t.slice(e,t.length)}},PJ=function(e){return function(t){return e<=0||uu(t)?On(t):e>=t.length?[]:t.slice(0,t.length-e)}};function DJ(e){return function(t){return t.slice(gU(t,e))}}var NJ=Yg;function qJ(e){return Gg(e)}var QJ=Ij;function VJ(e){return Tj(e)}var zJ=xj,HJ=wj,On=function(e){return e.slice()},YJ=function(e,t){return function(n){return e<0||e>n.length?ye:fe(JU(e,t,n))}},GJ=function(e,t){return vU(e,function(){return t})},JJ=function(e){return function(t){return Np(e,t)?ye:fe(XU(e,t))}},vU=function(e,t){return function(n){return Np(e,n)?ye:fe(ZU(e,t(n[e]),n))}},ZJ=function(e){return uu(e)?[]:e.slice().reverse()},XJ=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Right"&&t.push(r.right)}return t},eZ=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Left"&&t.push(r.left)}return t},tZ=function(e){return function(t){return t.length<=1?On(t):t.slice().sort(e.compare)}},yU=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 bU(e,t){return t===void 0?function(n){return bU(n,e)}:yU(e,t,function(n,r){return[n,r]})}var nZ=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]},CU=function(e){var t=Wg(e);return function(n){return qt(n)?t(n):[]}},rZ=function(e){var t=WL(e);return function(n){return qt(n)?t(n):On(n)}},iZ=function(e){var t=US(e);return function(n){return qt(n)?t(n):On(n)}},F_=Bp,oZ=function(e){var t=LS(e);return function(n){return qt(n)?t(n):On(n)}},aZ=function(e){var t=RL(e);return function(n){return qt(n)?t(n):On(n)}},uZ=function(e){var t=KS(e);return function(n){return qt(n)?t(n):[]}},SU=function(e){return function(t){return e>=1&&qt(t)?Kg(e)(t):uu(t)?[On(t),[]]:[[],On(t)]}},sZ=function(e){var t=NL(e);return function(n){return qt(n)?t(n):[]}},cZ=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return cU(e.apply(void 0,t))}};function lZ(e,t,n){n===void 0&&(n=function(){return!0});var r=function(i,o){return qt(o)?b(ni(o),Qp(function(a){return r(b(i,uv(a)),$i(o))})):n.apply(void 0,i)?[t.apply(void 0,i)]:[]};return r([],e)}var _U=function(e){return function(t){return uu(t)?On(e):uu(e)?On(t):t.concat(e)}},fZ=_U;function M_(e){var t=jS(e);return function(n,r){if(r===void 0){var i=M_(e);return function(o){return i(o,n)}}return qt(n)&&qt(r)?t(r)(n):qt(n)?On(n):On(r)}}function k_(e){var t=F_(e);return function(n,r){if(r===void 0){var i=k_(e);return function(o){return i(o,n)}}return n.filter(function(o){return t(o,r)})}}function L_(e){var t=F_(e);return function(n,r){if(r===void 0){var i=L_(e);return function(o){return i(o,n)}}return n.filter(function(o){return!t(o,r)})}}var Sn=function(e,t){return b(e,K_(t))},sv=function(e,t){return b(e,OU(t))},Cu=function(e,t){return b(e,RU(t))},qp=function(e,t){return b(e,Qp(t))},cv=function(e,t){return b(e,FU(t))},lv=function(e,t){return b(e,D_(t))},fv=function(e,t){return b(e,MU(t))},dv=function(e,t){return b(e,kU(t))},IU=function(e,t){return b(e,N_(t))},TU=function(e,t){return b(e,q_(t))},j_=function(e,t){return b(e,jU(t))},Qs=function(e,t,n){return b(e,KU(t,n))},rf=function(e){var t=BU(e);return function(n,r){return b(n,t(r))}},of=function(e,t,n){return b(e,PU(t,n))},U_=function(e,t,n){return b(e,V_(t,n))},B_=function(e){var t=WU(e);return function(n,r){return b(n,t(r))}},W_=function(e,t,n){return b(e,DU(t,n))},xU=function(e,t){return b(e,P_(t))},wU=function(e,t){return b(e,UU(t))},$U=function(e,t){return b(e,Q_(t))},pv=function(e){var t=Av(e);return function(n,r){return b(n,t(r))}},EU=function(e){var t=z_(e);return function(n,r){return b(n,t(r))}},dZ=f_,pZ=d_,Su=yu,af=function(){return[]},K_=function(e){return function(t){return t.map(function(n){return e(n)})}},RU=function(e){return Qp(function(t){return b(e,K_(t))})},Qp=function(e){return function(t){return b(t,mU(function(n,r){return e(r)}))}},AZ=Qp(P),OU=function(e){return function(t){return t.map(function(n,r){return e(r,n)})}},P_=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);_t(i)&&n.push(i.value)}return n}},D_=function(e){return P_(function(t,n){return e(n)})},uf=D_(P),sf=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 Re(t,n)},FU=function(e){return function(t){return t.filter(e)}},MU=function(e){return N_(function(t,n){return e(n)})},N_=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 Re(n,r)}},kU=function(e){return q_(function(t,n){return e(n)})},q_=function(e){return function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=e(i,t[i]);o._tag==="Left"?n.push(o.left):r.push(o.right)}return Re(n,r)}},LU=function(e){return function(t){return t.concat(e())}},jU=LU,UU=function(e){return function(t){return t.filter(function(n,r){return e(r,n)})}},Q_=function(e){return function(t){return t.map(function(n,r){return e(t.slice(r))})}},hZ=Q_(P),BU=b_,WU=rv,KU=y_,V_=Pp,PU=C_,DU=iv,Av=function(e){var t=z_(e);return function(n){return t(function(r,i){return n(i)})}},Vp=function(e){return function(t){return Qs(t,e.of(af()),function(n,r){return e.ap(e.map(n,function(i){return function(o){return b(i,uv(o))}}),r)})}},z_=function(e){return function(t){return V_(e.of(af()),function(n,r,i){return e.ap(e.map(r,function(o){return function(a){return b(o,uv(a))}}),t(n,i))})}},mZ=function(e){var t=eI(e);return function(n){return function(r){return t(r,n)}}},gZ=function(e){var t=tI(e);return function(n){return function(r){return t(r,n)}}},H_=function(e,t){for(var n=[],r=e;;){var i=t(r);if(_t(i)){var o=i.value,a=o[0],u=o[1];n.push(a),r=u}else break}return n},At="Array",vZ=Yj,NU=function(){return{concat:function(e,t){return e.concat(t)}}},Y_=function(){return{concat:NU().concat,empty:[]}},qU=Jj,yZ=Zj,QU=function(e){var t=M_(e);return{concat:function(n,r){return t(r)(n)}}},bZ=function(e){return{concat:QU(e).concat,empty:[]}},CZ=function(e){var t=k_(e);return{concat:function(n,r){return t(r)(n)}}},SZ=function(e){var t=L_(e);return{concat:function(n,r){return t(r)(n)}}},G_={URI:At,map:Sn},_Z=qe(G_),VU={URI:At,of:Su},IZ={URI:At,map:Sn,mapWithIndex:sv},hv={URI:At,map:Sn,ap:Cu},TZ=kt(hv),xZ=Lt(hv),wZ={URI:At,map:Sn,ap:Cu,of:Su},J_={URI:At,map:Sn,ap:Cu,chain:qp},$Z=dt(J_),EZ={URI:At,map:Sn,ap:Cu,of:Su,chain:qp},RZ={URI:At,unfold:H_},OZ={URI:At,map:Sn,alt:j_},zU={URI:At,zero:af},FZ=Gl(zU,VU),MZ={URI:At,map:Sn,ap:Cu,of:Su,alt:j_,zero:af},kZ={URI:At,map:Sn,extend:$U},Z_={URI:At,compact:uf,separate:sf},LZ={URI:At,map:Sn,compact:uf,separate:sf,filter:cv,filterMap:lv,partition:fv,partitionMap:dv},jZ={URI:At,map:Sn,mapWithIndex:sv,compact:uf,separate:sf,filter:cv,filterMap:lv,partition:fv,partitionMap:dv,partitionMapWithIndex:TU,partitionWithIndex:IU,filterMapWithIndex:xU,filterWithIndex:wU},HU={URI:At,reduce:Qs,foldMap:rf,reduceRight:of},UZ={URI:At,reduce:Qs,foldMap:rf,reduceRight:of,reduceWithIndex:U_,foldMapWithIndex:B_,reduceRightWithIndex:W_},X_={URI:At,map:Sn,reduce:Qs,foldMap:rf,reduceRight:of,traverse:pv,sequence:Vp},BZ={URI:At,map:Sn,mapWithIndex:sv,reduce:Qs,foldMap:rf,reduceRight:of,reduceWithIndex:U_,foldMapWithIndex:B_,reduceRightWithIndex:W_,traverse:pv,sequence:Vp,traverseWithIndex:EU},eI=ki(X_,Z_),tI=Mi(X_,Z_),YU={URI:At,map:Sn,compact:uf,separate:sf,filter:cv,filterMap:lv,partition:fv,partitionMap:dv,reduce:Qs,foldMap:rf,reduceRight:of,traverse:pv,sequence:Vp,wither:eI,wilt:tI},WZ=$_,KZ={URI:At,map:Sn,ap:Cu,chain:qp,chainRec:dZ},PZ=E_,DZ={URI:At,map:Sn,ap:Cu,chain:qp,chainRec:pZ},NZ=r_(YU),GU={URI:At,fromEither:lU},qZ=Mr(GU),JU=MS,ZU=function(e,t,n){return qt(n)?kS(e,t,n):[]},XU=function(e,t){var n=t.slice();return n.splice(e,1),n},QZ=oU,e2=function(e){return function(t){return t.some(e)}},VZ=e2,zZ=uU,HZ=Su(tn),YZ=Ut(G_),GZ=Bt(J_),JZ=jt(hv),ZZ=OL,XZ=[],eX=ij,tX=oj,nX=CU,rX={URI:At,compact:uf,separate:sf,map:Sn,ap:Cu,of:Su,chain:qp,filter:cv,filterMap:lv,partition:fv,partitionMap:dv,mapWithIndex:sv,partitionMapWithIndex:TU,partitionWithIndex:IU,filterMapWithIndex:xU,filterWithIndex:wU,alt:j_,zero:af,unfold:H_,reduce:Qs,foldMap:rf,reduceRight:of,traverse:pv,sequence:Vp,reduceWithIndex:U_,foldMapWithIndex:B_,reduceRightWithIndex:W_,traverseWithIndex:EU,extend:$U,wither:eI,wilt:tI};const iX=Object.freeze(Object.defineProperty({__proto__:null,Alt:OZ,Alternative:MZ,Applicative:wZ,Apply:hv,Chain:J_,ChainRecBreadthFirst:DZ,ChainRecDepthFirst:KZ,Compactable:Z_,Do:HZ,Extend:kZ,Filterable:LZ,FilterableWithIndex:jZ,Foldable:HU,FoldableWithIndex:UZ,FromEither:GU,Functor:G_,FunctorWithIndex:IZ,Monad:EZ,Pointed:VU,Traversable:X_,TraversableWithIndex:BZ,URI:At,Unfoldable:RZ,Witherable:YU,Zero:zU,alt:jU,altW:LU,ap:RU,apFirst:TZ,apS:JZ,apSecond:xZ,append:uv,appendW:SJ,array:rX,bind:GZ,bindTo:YZ,chain:Qp,chainFirst:$Z,chainRecBreadthFirst:PZ,chainRecDepthFirst:WZ,chainWithIndex:mU,chop:uZ,chunksOf:sZ,compact:uf,comprehension:lZ,concat:fZ,concatW:_U,cons:eX,copy:On,deleteAt:JJ,difference:L_,dropLeft:KJ,dropLeftWhile:DJ,dropRight:PJ,duplicate:hZ,elem:F_,empty:XZ,every:QZ,exists:VZ,extend:Q_,filter:FU,filterE:NZ,filterMap:D_,filterMapWithIndex:P_,filterWithIndex:UU,findFirst:qJ,findFirstMap:QJ,findIndex:NJ,findLast:VJ,findLastIndex:HJ,findLastMap:zJ,flap:_Z,flatten:AZ,foldLeft:xJ,foldMap:BU,foldMapWithIndex:WU,foldRight:wJ,fromEither:lU,fromEitherK:qZ,fromOption:cU,fromOptionK:cZ,fromPredicate:IJ,getDifferenceMagma:SZ,getEq:qU,getIntersectionSemigroup:CZ,getMonoid:Y_,getOrd:yZ,getSemigroup:NU,getShow:vZ,getUnionMonoid:bZ,getUnionSemigroup:QU,guard:FZ,head:FJ,init:LJ,insertAt:YJ,intercalate:zZ,intersection:k_,intersperse:rZ,isEmpty:uu,isNonEmpty:qt,isOutOfBound:Np,last:MJ,lefts:eZ,lookup:OJ,makeBy:sU,map:K_,mapWithIndex:OU,match:TJ,matchLeft:pU,matchLeftW:dU,matchRight:hU,matchRightW:AU,matchW:fU,modifyAt:vU,of:Su,partition:MU,partitionMap:kU,partitionMapWithIndex:q_,partitionWithIndex:N_,prepend:bJ,prependAll:CU,prependToAll:nX,prependW:CJ,range:ZZ,reduce:KU,reduceRight:PU,reduceRightWithIndex:DU,reduceWithIndex:V_,replicate:_J,reverse:ZJ,rights:XJ,rotate:iZ,scanLeft:$J,scanRight:EJ,separate:sf,sequence:Vp,size:RJ,snoc:tX,some:e2,sort:tZ,sortBy:aZ,spanLeft:WJ,splitAt:SU,tail:kJ,takeLeft:jJ,takeLeftWhile:BJ,takeRight:UJ,traverse:Av,traverseWithIndex:z_,unfold:H_,union:M_,uniq:oZ,unsafeDeleteAt:XU,unsafeInsertAt:JU,unsafeUpdateAt:ZU,unzip:nZ,updateAt:GJ,wilt:gZ,wither:mZ,zero:af,zip:bU,zipWith:yU},Symbol.toStringTag,{value:"Module"})),oX=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var aX=function(e){return typeof e=="boolean"},t2=function(e,t){return function(n){return n?t():e()}},n2=t2,r2=n2,uX=r2,i2={equals:function(e,t){return e===t}},sX={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}},o2={concat:function(e,t){return e&&t}},a2={concat:function(e,t){return e||t}},cX={concat:o2.concat,empty:!0},lX={concat:a2.concat,empty:!1},fX={equals:i2.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},dX={show:function(e){return JSON.stringify(e)}};const pX=Object.freeze(Object.defineProperty({__proto__:null,BooleanAlgebra:sX,Eq:i2,MonoidAll:cX,MonoidAny:lX,Ord:fX,SemigroupAll:o2,SemigroupAny:a2,Show:dX,fold:uX,foldW:n2,isBoolean:aX,match:r2,matchW:t2},Symbol.toStringTag,{value:"Module"}));var u2=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}},AX={meet:function(){},join:function(){},zero:void 0,one:void 0,implies:function(){},not:function(){}},hX=u2,mX={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}},gX=Ik;const vX=Object.freeze(Object.defineProperty({__proto__:null,booleanAlgebraBoolean:mX,booleanAlgebraVoid:AX,getDualBooleanAlgebra:hX,getFunctionBooleanAlgebra:gX,reverse:u2},Symbol.toStringTag,{value:"Module"}));var yX=function(e){return Vk(e)(e.bottom,e.top)},bX=function(e){var t=GC(e);return{equals:t.equals,compare:t.compare,top:e.bottom,bottom:e.top}},CX={equals:dm.equals,compare:dm.compare,top:1/0,bottom:-1/0};const SX=Object.freeze(Object.defineProperty({__proto__:null,boundedNumber:CX,clamp:yX,reverse:bX},Symbol.toStringTag,{value:"Module"}));function s2(e){return{meet:gg(e),join:vg(e)}}const _X=Object.freeze(Object.defineProperty({__proto__:null,getMinMaxDistributiveLattice:s2},Symbol.toStringTag,{value:"Module"}));function IX(e){var t=s2(e);return function(n,r){return{join:t.join,meet:t.meet,zero:n,one:r}}}const TX=Object.freeze(Object.defineProperty({__proto__:null,getMinMaxBoundedDistributiveLattice:IX},Symbol.toStringTag,{value:"Module"})),xX=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),wX=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),$X=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),EX=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var nI=function(e,t){for(var n=t(e);n._tag==="Left";)n=t(n.left);return n.right};const RX=Object.freeze(Object.defineProperty({__proto__:null,tailRec:nI},Symbol.toStringTag,{value:"Module"}));function rI(e,t){return function(n,r){return t.compose(e.right(r),e.left(n))}}function c2(e,t){var n=rI(e,t);return function(r,i){return t.compose(e.promap(t.id(),function(o){return o._tag==="Left"?o.left:o.right},P),n(r,i))}}function OX(e){return rI(e,e)}function FX(e){return c2(e,e)}const MX=Object.freeze(Object.defineProperty({__proto__:null,fanIn:c2,fanin:FX,split:rI,splitChoice:OX},Symbol.toStringTag,{value:"Module"})),kX=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var LX=function(e,t){return b(e,l2(t))},l2=function(e){return function(t){return z(e,t)}},f2="Predicate",d2=function(){return{concat:function(e,t){return b(e,A2(t))}}},jX=function(){return{concat:d2().concat,empty:wk}},p2=function(){return{concat:function(e,t){return b(e,h2(t))}}},UX=function(){return{concat:p2().concat,empty:VC}},BX={URI:f2,contramap:LX},Kd=function(e){return function(t){return!e(t)}},A2=function(e){return function(t){return function(n){return t(n)||e(n)}}},h2=function(e){return function(t){return function(n){return t(n)&&e(n)}}};const WX=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:BX,URI:f2,and:h2,contramap:l2,getMonoidAll:UX,getMonoidAny:jX,getSemigroupAll:p2,getSemigroupAny:d2,not:Kd,or:A2},Symbol.toStringTag,{value:"Module"}));var ot=ye,It=fe;function mv(e){return function(t){return e(t)?It(t):ot}}var gv=function(e){return e._tag==="Right"?ot:It(e.left)},zp=function(e){return e._tag==="Left"?ot:It(e.right)},kr=function(e,t){return b(e,mo(t))},Vs=function(e,t){return b(e,y2(t))},vv=function(e,t){return b(e,Hp(t))},yv=function(e,t,n){return b(e,C2(t,n))},bv=function(e){var t=S2(e);return function(n,r){return b(n,t(r))}},Cv=function(e,t,n){return b(e,_2(t,n))},iI=function(e){var t=O2(e);return function(n,r){return b(n,t(r))}},oI=function(e,t){return b(e,T2(t))},Pd=function(e,t){return b(e,w2(t))},aI=function(e,t){return b(e,$2(t))},m2=function(e,t){return b(e,lI(t))},uI=function(e,t){return b(e,E2(t))},sI=function(e,t){return b(e,R2(t))},zt="Option",KX=function(e){return{show:function(t){return Ne(t)?"none":"some(".concat(e.show(t.value),")")}}},g2=function(e){return{equals:function(t,n){return t===n||(Ne(t)?Ne(n):Ne(n)?!1:e.equals(t.value,n.value))}}},PX=function(e){return{equals:g2(e).equals,compare:function(t,n){return t===n?0:pm(t)?pm(n)?e.compare(t.value,n.value):1:-1}}},cI=function(e){return{concat:function(t,n){return Ne(t)?n:Ne(n)?t:It(e.concat(t.value,n.value))},empty:ot}},mo=function(e){return function(t){return Ne(t)?ot:It(e(t.value))}},cf={URI:zt,map:kr},fa=It,v2={URI:zt,of:fa},y2=function(e){return function(t){return Ne(t)||Ne(e)?ot:It(t.value(e.value))}},lf={URI:zt,map:kr,ap:Vs},b2={URI:zt,map:kr,ap:Vs,of:fa},Hp=function(e){return function(t){return Ne(t)?ot:e(t.value)}},Yp={URI:zt,map:kr,ap:Vs,chain:vv},DX={URI:zt,map:kr,ap:Vs,of:fa,chain:vv},C2=function(e,t){return function(n){return Ne(n)?e:t(e,n.value)}},S2=function(e){return function(t){return function(n){return Ne(n)?e.empty:t(n.value)}}},_2=function(e,t){return function(n){return Ne(n)?e:t(n.value,e)}},NX={URI:zt,reduce:yv,foldMap:bv,reduceRight:Cv},I2=function(e){return function(t){return Ne(t)?e():t}},T2=I2,qX={URI:zt,map:kr,alt:oI},Sv=function(){return ot},x2={URI:zt,zero:Sv},QX=Gl(x2,v2),VX={URI:zt,map:kr,ap:Vs,of:fa,alt:oI,zero:Sv},lI=function(e){return function(t){return Ne(t)?ot:It(e(t))}},zX={URI:zt,map:kr,extend:m2},ff=Hp(P),HX=Re(ot,ot),df=function(e){return Ne(e)?HX:Re(gv(e.value),zp(e.value))},zs={URI:zt,compact:ff,separate:df},w2=function(e){return function(t){return Ne(t)?ot:e(t.value)?t:ot}},$2=function(e){return function(t){return Ne(t)?ot:e(t.value)}},E2=function(e){return function(t){return Re(Pd(t,Kd(e)),Pd(t,e))}},R2=function(e){return z(mo(e),df)},da={URI:zt,map:kr,compact:ff,separate:df,filter:Pd,filterMap:aI,partition:uI,partitionMap:sI},O2=function(e){return function(t){return function(n){return Ne(n)?e.of(ot):e.map(t(n.value),It)}}},_v=function(e){return function(t){return Ne(t)?e.of(ot):e.map(t.value,It)}},fI={URI:zt,map:kr,reduce:yv,foldMap:bv,reduceRight:Cv,traverse:iI,sequence:_v},dI=ki(fI,zs),pI=Mi(fI,zs),YX=function(e){var t=dI(e);return function(n){return function(r){return t(r,n)}}},GX=function(e){var t=pI(e);return function(n){return function(r){return t(r,n)}}},JX={URI:zt,map:kr,reduce:yv,foldMap:bv,reduceRight:Cv,traverse:iI,sequence:_v,compact:ff,separate:df,filter:Pd,filterMap:aI,partition:uI,partitionMap:sI,wither:dI,wilt:pI},AI=function(){return ot},ZX={URI:zt,map:kr,ap:Vs,of:fa,chain:vv,throwError:AI},pf=zp,Iv={URI:zt,fromEither:pf},pm=_t,Ne=function(e){return e._tag==="None"},hI=function(e,t){return function(n){return Ne(n)?e():t(n.value)}},XX=hI,pa=hI,_u=pa,F2=function(e){return function(t){return Ne(t)?e():t.value}},mI=F2,eee=qe(cf),tee=kt(lf),nee=Lt(lf),ree=ff,iee=dt(Yp),oee=lI(P),aee=Mr(Iv),uee=sa(Iv,Yp),see=ca(Iv,Yp),Hs=function(e){return e==null?ot:It(e)},M2=function(e){try{return It(e())}catch{return ot}},cee=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return M2(function(){return e.apply(void 0,t)})}},lee=function(e){return z(e,Hs)},k2=function(e){return function(t){return Ne(t)?ot:Hs(e(t.value))}},gI=pa($k,P),L2=pa(zC,P);function j2(e){return function(t,n){if(n===void 0){var r=j2(e);return function(i){return r(t,i)}}return Ne(n)?!1:e.equals(t,n.value)}}var fee=function(e){return function(t){return Ne(t)?!1:e(t.value)}},dee=fa(tn),pee=Ut(cf),Aee=Bt(Yp),hee=jt(lf),U2=fa(bn),Tv=function(e){return function(t){var n=e(0,Fr(t));if(Ne(n))return ot;for(var r=[n.value],i=1;i<t.length;i++){var o=e(i,t[i]);if(Ne(o))return ot;r.push(o.value)}return It(r)}},vI=function(e){var t=Tv(e);return function(n){return vt(n)?t(n):U2}},mee=vI,B2=function(e){return vI(function(t,n){return e(n)})},gee=B2(P);function vee(e){return function(t){return pm(e(t))}}var yee=k2,W2={URI:zt,map:kr,of:fa,ap:Vs,chain:vv,reduce:yv,foldMap:bv,reduceRight:Cv,traverse:iI,sequence:_v,zero:Sv,alt:oI,extend:m2,compact:ff,separate:df,filter:Pd,filterMap:aI,partition:uI,partitionMap:sI,wither:dI,wilt:pI,throwError:AI},bee=nn(lf),Cee=ei(b2),K2=function(){return cI(rS())},See=function(){return cI(Cg())};const _ee=Object.freeze(Object.defineProperty({__proto__:null,Alt:qX,Alternative:VX,ApT:U2,Applicative:b2,Apply:lf,Chain:Yp,Compactable:zs,Do:dee,Extend:zX,Filterable:da,Foldable:NX,FromEither:Iv,Functor:cf,Monad:DX,MonadThrow:ZX,Pointed:v2,Traversable:fI,URI:zt,Witherable:JX,Zero:x2,alt:T2,altW:I2,ap:y2,apFirst:tee,apS:hee,apSecond:nee,bind:Aee,bindTo:pee,chain:Hp,chainEitherK:uee,chainFirst:iee,chainFirstEitherK:see,chainNullableK:k2,compact:ff,duplicate:oee,elem:j2,exists:fee,extend:lI,filter:w2,filterMap:$2,flap:eee,flatten:ree,fold:_u,foldMap:S2,foldW:XX,fromEither:pf,fromEitherK:aee,fromNullable:Hs,fromNullableK:lee,fromPredicate:mv,getApplyMonoid:Cee,getApplySemigroup:bee,getEq:g2,getFirstMonoid:K2,getLastMonoid:See,getLeft:gv,getMonoid:cI,getOrElse:mI,getOrElseW:F2,getOrd:PX,getRefinement:vee,getRight:zp,getShow:KX,guard:QX,isNone:Ne,isSome:pm,map:mo,mapNullable:yee,match:pa,matchW:hI,none:ot,of:fa,option:W2,partition:E2,partitionMap:R2,reduce:C2,reduceRight:_2,separate:df,sequence:_v,sequenceArray:gee,some:It,throwError:AI,toNullable:gI,toUndefined:L2,traverse:O2,traverseArray:B2,traverseArrayWithIndex:mee,traverseReadonlyArrayWithIndex:vI,traverseReadonlyNonEmptyArrayWithIndex:Tv,tryCatch:M2,tryCatchK:cee,wilt:GX,wither:YX,zero:Sv},Symbol.toStringTag,{value:"Module"}));function go(e,t){return function(n){return e.map(n,t.compact)}}function Aa(e,t,n){var r=go(e,t),i=Nl(e,n);return function(o){return Re(r(b(o,i(gv))),r(b(o,i(zp))))}}function Iee(e,t){var n=ql(e,t).map;return{map:n,compact:go(e,t),separate:Aa(e,t,t)}}const Tee=Object.freeze(Object.defineProperty({__proto__:null,compact:go,getCompactableComposition:Iee,separate:Aa},Symbol.toStringTag,{value:"Module"}));var xee=function(e){return function(){return console.log(e)}},wee=function(e){return function(){return console.warn(e)}},$ee=function(e){return function(){return console.error(e)}},Eee=function(e){return function(){return console.info(e)}};const Ree=Object.freeze(Object.defineProperty({__proto__:null,error:$ee,info:Eee,log:xee,warn:wee},Symbol.toStringTag,{value:"Module"}));var Af=ml;function Oee(e){return{show:function(t){return"make(".concat(e.show(t),")")}}}var Fee=P,Mee=P,kee=P,Lee=P,jee=P,Uee=P,Bee=P,Wee=P,Kee=P;function P2(e){return{URI:Ys,_E:void 0,map:yI,ap:function(t,n){return Af(e.concat(t,n))}}}function D2(e){var t=P2(e);return{URI:Ys,_E:void 0,map:t.map,ap:t.ap,of:function(){return Af(e.empty)}}}var N2=function(e,t){return b(e,V2())},yI=function(e,t){return b(e,z2())},q2=function(e,t,n){return b(e,H2(t))},Q2=function(e,t){return b(e,Y2(t))},V2=function(){return ml},z2=function(){return ml},H2=function(e){return function(t){return Af(e(t))}},Y2=function(e){return function(t){return Af(e(t))}},Ys="Const",G2={URI:Ys,map:yI},Pee=qe(G2),Dee={URI:Ys,contramap:N2},Nee={URI:Ys,bimap:q2,mapLeft:Q2},qee={URI:Ys,map:yI,contramap:N2,bimap:q2,mapLeft:Q2};const Qee=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:Nee,Contravariant:Dee,Functor:G2,URI:Ys,bimap:H2,const_:qee,contramap:V2,flap:Pee,getApplicative:D2,getApply:P2,getBooleanAlgebra:Kee,getBounded:kee,getEq:Fee,getHeytingAlgebra:Wee,getMonoid:jee,getOrd:Mee,getRing:Bee,getSemigroup:Lee,getSemiring:Uee,getShow:Oee,make:Af,map:z2,mapLeft:Y2},Symbol.toStringTag,{value:"Module"})),Vee=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var zee={equals:function(e,t){return e.valueOf()===t.valueOf()}},Hee={equals:function(e,t){return e.getDate()===t.getDate()}},Yee={equals:function(e,t){return e.getMonth()===t.getMonth()}},Gee={equals:function(e,t){return e.getFullYear()===t.getFullYear()}},Jee=b(Qg,mg(function(e){return e.valueOf()})),Zee=function(){return new Date},Xee=function(){return new Date().getTime()};const ete=Object.freeze(Object.defineProperty({__proto__:null,Eq:zee,Ord:Jee,create:Zee,eqDate:Hee,eqMonth:Yee,eqYear:Gee,now:Xee},Symbol.toStringTag,{value:"Module"}));var wt=Zo,ze=hu,Ln=function(e,t){return b(e,Zs(t))},Gs=function(e,t){return b(e,eB(t))},hf=function(e,t){return b(e,ri(t))},Gp=function(e,t,n){return b(e,nB(t,n))},Jp=function(e){return function(t,n){var r=rB(e);return b(t,r(n))}},Zp=function(e,t,n){return b(e,iB(t,n))},xv=function(e){var t=oB(e);return function(n,r){return b(n,t(r))}},bI=function(e,t,n){return b(e,TI(t,n))},CI=function(e,t){return b(e,nA(t))},J2=function(e,t){return b(e,uB(t))},SI=function(e,t){return b(e,xI(t))},_I=function(e,t){return nI(t(e),function(n){return ie(n)?ze(wt(n.left)):ie(n.right)?wt(t(n.right.left)):ze(ze(n.right.right))})},$t="Either",tte=function(e,t){return{show:function(n){return ie(n)?"left(".concat(e.show(n.left),")"):"right(".concat(t.show(n.right),")")}}},nte=function(e,t){return{equals:function(n,r){return n===r||(ie(n)?ie(r)&&e.equals(n.left,r.left):wI(r)&&t.equals(n.right,r.right))}}},Xp=function(e){return{concat:function(t,n){return ie(n)?t:ie(t)?n:ze(e.concat(t.right,n.right))}}},Js=function(e){var t=wt(e.empty);return{URI:$t,_E:void 0,compact:function(n){return ie(n)?n:n.right._tag==="None"?t:ze(n.right.value)},separate:function(n){return ie(n)?Re(n,n):ie(n.right)?Re(ze(n.right.left),t):Re(t,ze(n.right.right))}}},mf=function(e){var t=wt(e.empty),n=Js(e),r=n.compact,i=n.separate,o=function(u,s){return ie(u)||s(u.right)?u:t},a=function(u,s){return ie(u)?Re(u,u):s(u.right)?Re(t,ze(u.right)):Re(ze(u.right),t)};return{URI:$t,_E:void 0,map:Ln,compact:r,separate:i,filter:o,filterMap:function(u,s){if(ie(u))return u;var c=s(u.right);return c._tag==="None"?t:ze(c.value)},partition:a,partitionMap:function(u,s){if(ie(u))return Re(u,u);var c=s(u.right);return ie(c)?Re(ze(c.left),t):Re(t,ze(c.right))}}},rte=function(e){var t=mf(e),n=Js(e);return{URI:$t,_E:void 0,map:Ln,compact:t.compact,separate:t.separate,filter:t.filter,filterMap:t.filterMap,partition:t.partition,partitionMap:t.partitionMap,traverse:xv,sequence:tA,reduce:Gp,foldMap:Jp,reduceRight:Zp,wither:ki(w1,n),wilt:Mi(w1,n)}},Iu=function(e){return{URI:$t,_E:void 0,map:Ln,ap:function(t,n){return ie(t)?ie(n)?wt(e.concat(t.left,n.left)):t:ie(n)?n:ze(t.right(n.right))},of:vo}},Z2=function(e){return{URI:$t,_E:void 0,map:Ln,alt:function(t,n){if(wI(t))return t;var r=n();return ie(r)?wt(e.concat(t.left,r.left)):r}}},Zs=function(e){return function(t){return ie(t)?t:ze(e(t.right))}},Tu={URI:$t,map:Ln},vo=ze,ite={URI:$t,of:vo},X2=function(e){return function(t){return ie(t)?t:ie(e)?e:ze(t.right(e.right))}},eB=X2,gf={URI:$t,map:Ln,ap:Gs},tB={URI:$t,map:Ln,ap:Gs,of:vo},II=function(e){return function(t){return ie(t)?t:e(t.right)}},ri=II,eA={URI:$t,map:Ln,ap:Gs,chain:hf},ote={URI:$t,map:Ln,ap:Gs,of:vo,chain:hf},nB=function(e,t){return function(n){return ie(n)?e:t(e,n.right)}},rB=function(e){return function(t){return function(n){return ie(n)?e.empty:t(n.right)}}},iB=function(e,t){return function(n){return ie(n)?e:t(n.right,e)}},ate={URI:$t,reduce:Gp,foldMap:Jp,reduceRight:Zp},oB=function(e){return function(t){return function(n){return ie(n)?e.of(wt(n.left)):e.map(t(n.right),ze)}}},tA=function(e){return function(t){return ie(t)?e.of(wt(t.left)):e.map(t.right,ze)}},w1={URI:$t,map:Ln,reduce:Gp,foldMap:Jp,reduceRight:Zp,traverse:xv,sequence:tA},TI=function(e,t){return function(n){return ie(n)?wt(e(n.left)):ze(t(n.right))}},nA=function(e){return function(t){return ie(t)?wt(e(t.left)):t}},ute={URI:$t,bimap:bI,mapLeft:CI},aB=function(e){return function(t){return ie(t)?e():t}},uB=aB,ste={URI:$t,map:Ln,alt:J2},xI=function(e){return function(t){return ie(t)?t:ze(e(t))}},cte={URI:$t,map:Ln,extend:SI},lte={URI:$t,map:Ln,ap:Gs,chain:hf,chainRec:_I},wv=wt,fte={URI:$t,map:Ln,ap:Gs,of:vo,chain:hf,throwError:wv},vf={URI:$t,fromEither:P},dte=mu(vf),sB=po(vf),ie=Xt,wI=HC,$I=function(e,t){return function(n){return ie(n)?e(n.left):t(n.right)}},cB=$I,xu=$I,EI=xu,lB=function(e){return function(t){return ie(t)?e(t.left):t.right}},pte=lB,Ate=qe(Tu),fB=kt(gf),hte=fB,dB=Lt(gf),mte=dB,pB=dt(eA),gte=pB,AB=II(P),vte=AB,yte=xI(P),bte=Ao(vf),Cte=Ks(vf,eA),hB=Ps(vf,eA),Ste=hB,mB=function(e){return ie(e)?ze(e.left):wt(e.right)},gB=function(e){return function(t){return ie(t)?e(t.left):t}},vB=gB,RI=function(e){return function(t){return t==null?wt(e):ze(t)}},Xs=function(e,t){try{return ze(e())}catch(n){return wt(t(n))}},_te=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return Xs(function(){return e.apply(void 0,n)},t)}},yB=function(e){var t=RI(e);return function(n){return z(n,t)}},Ite=function(e){var t=yB(e);return function(n){return ri(t(n))}},bB=cB(P,P);function Tte(e){return e instanceof Error?e:new Error(String(e))}function CB(e){return function(t,n){if(n===void 0){var r=CB(e);return function(i){return r(t,i)}}return ie(n)?!1:e.equals(t,n.right)}}var xte=function(e){return function(t){return ie(t)?!1:e(t.right)}},wte=vo(tn),$te=Ut(Tu),SB=Bt(eA),Ete=SB,_B=jt(gf),Rte=_B,IB=vo(bn),rA=function(e){return function(t){var n=e(0,Fr(t));if(ie(n))return n;for(var r=[n.right],i=1;i<t.length;i++){var o=e(i,t[i]);if(ie(o))return o;r.push(o.right)}return ze(r)}},OI=function(e){var t=rA(e);return function(n){return vt(n)?t(n):IB}},Ote=OI,TB=function(e){return OI(function(t,n){return e(n)})},Fte=TB(P);function Mte(e,t){return Xs(function(){return JSON.parse(e)},t)}var kte=function(e,t){return Xs(function(){var n=JSON.stringify(e);if(typeof n!="string")throw new Error("Converting unsupported structure to JSON");return n},t)},Lte={URI:$t,map:Ln,of:vo,ap:Gs,chain:hf,reduce:Gp,foldMap:Jp,reduceRight:Zp,traverse:xv,sequence:tA,bimap:bI,mapLeft:CI,alt:J2,extend:SI,chainRec:_I,throwError:wv},jte=nn(gf),Ute=ei(tB),Bte=function(e,t){return nn(Iu(e))(t)},Wte=function(e,t){return ei(Iu(e))(t)};function Kte(e){var t=Iu(e).ap,n=Z2(e).alt;return{URI:$t,_E:void 0,map:Ln,of:vo,chain:hf,bimap:bI,mapLeft:CI,reduce:Gp,foldMap:Jp,reduceRight:Zp,extend:SI,traverse:xv,sequence:tA,chainRec:_I,throwError:wv,ap:t,alt:n}}const xB=Object.freeze(Object.defineProperty({__proto__:null,Alt:ste,ApT:IB,Applicative:tB,Apply:gf,Bifunctor:ute,Chain:eA,ChainRec:lte,Do:wte,Extend:cte,Foldable:ate,FromEither:vf,Functor:Tu,Monad:ote,MonadThrow:fte,Pointed:ite,Traversable:w1,URI:$t,alt:uB,altW:aB,ap:eB,apFirst:fB,apFirstW:hte,apS:_B,apSW:Rte,apSecond:dB,apSecondW:mte,apW:X2,bimap:TI,bind:SB,bindTo:$te,bindW:Ete,chain:ri,chainFirst:pB,chainFirstW:gte,chainNullableK:Ite,chainOptionK:Cte,chainW:II,duplicate:yte,either:Lte,elem:CB,exists:xte,extend:xI,filterOrElse:hB,filterOrElseW:Ste,flap:Ate,flatten:vte,flattenW:AB,fold:EI,foldMap:rB,foldW:cB,fromNullable:RI,fromNullableK:yB,fromOption:sB,fromOptionK:bte,fromPredicate:dte,getAltValidation:Z2,getApplicativeValidation:Iu,getApplyMonoid:Ute,getApplySemigroup:jte,getCompactable:Js,getEq:nte,getFilterable:mf,getOrElse:pte,getOrElseW:lB,getSemigroup:Xp,getShow:tte,getValidation:Kte,getValidationMonoid:Wte,getValidationSemigroup:Bte,getWitherable:rte,isLeft:ie,isRight:wI,left:wt,map:Zs,mapLeft:nA,match:xu,matchW:$I,of:vo,orElse:vB,orElseW:gB,parseJSON:Mte,reduce:nB,reduceRight:iB,right:ze,sequence:tA,sequenceArray:Fte,stringifyJSON:kte,swap:mB,throwError:wv,toError:Tte,toUnion:bB,traverse:oB,traverseArray:TB,traverseArrayWithIndex:Ote,traverseReadonlyArrayWithIndex:OI,traverseReadonlyNonEmptyArrayWithIndex:rA,tryCatch:Xs,tryCatchK:_te},Symbol.toStringTag,{value:"Module"}));function ec(e){return z(ze,e.of)}function yf(e){return z(wt,e.of)}function bf(e){return function(t){return e.map(t,ze)}}function Cf(e){return function(t){return e.map(t,wt)}}function $v(e){return function(t){return z(RI(t),e.of)}}function Ev(e){var t=$v(e);return function(n){var r=t(n);return function(i){return z(i,r)}}}function FI(e){var t=tc(e),n=Ev(e);return function(r){var i=n(r);return function(o){return t(i(o))}}}function Sf(e){return Nl(e,Tu)}function _f(e){return ua(e,gf)}function tc(e){return function(t){return function(n){return e.chain(n,function(r){return ie(r)?e.of(r):t(r.right)})}}}function If(e){return function(t){return function(n){return e.chain(n,function(r){return ie(r)?t():e.of(r)})}}}function Tf(e){return function(t,n){return function(r){return e.map(r,TI(t,n))}}}function xf(e){return function(t){return function(n){return e.map(n,nA(t))}}}function iA(e,t){return function(n){return function(r){return e.chain(r,xu(function(i){return e.map(n(),nA(function(o){return t.concat(i,o)}))},ec(e)))}}}function oA(e){return function(t,n){return function(r){return e.map(r,xu(t,n))}}}function wf(e){return function(t,n){return function(r){return e.chain(r,xu(t,n))}}}function $f(e){return function(t){return function(n){return e.chain(n,xu(t,e.of))}}}function nc(e){return function(t){return function(n){return e.chain(n,function(r){return ie(r)?t(r.left):e.of(r)})}}}function aA(e){var t=nc(e);return function(n){return t(function(r){return e.map(n(r),function(i){return ie(i)?i:wt(r)})})}}function uA(e){return function(t){return function(n){return e.chain(n,xu(function(r){return e.map(t(r),wt)},function(r){return e.of(ze(r))}))}}}function Ef(e){return function(t){return e.map(t,mB)}}function sA(e){return function(t){return e.map(t,bB)}}function Pte(e){var t=_f(e),n=Sf(e),r=tc(e),i=If(e),o=Tf(e),a=xf(e),u=wf(e),s=$f(e),c=nc(e);return{map:function(l,f){return b(l,n(f))},ap:function(l,f){return b(l,t(f))},of:ec(e),chain:function(l,f){return b(l,r(f))},alt:function(l,f){return b(l,i(f))},bimap:function(l,f,p){return b(l,o(f,p))},mapLeft:function(l,f){return b(l,a(f))},fold:function(l,f,p){return b(l,u(f,p))},getOrElse:function(l,f){return b(l,s(f))},orElse:function(l,f){return b(l,c(f))},swap:Ef(e),rightM:bf(e),leftM:Cf(e),left:yf(e)}}const Dte=Object.freeze(Object.defineProperty({__proto__:null,alt:If,altValidation:iA,ap:_f,bimap:Tf,chain:tc,chainNullableK:FI,fromNullable:$v,fromNullableK:Ev,getEitherM:Pte,getOrElse:$f,left:yf,leftF:Cf,map:Sf,mapLeft:xf,match:oA,matchE:wf,orElse:nc,orElseFirst:aA,orLeft:uA,right:ec,rightF:bf,swap:Ef,toUnion:sA},Symbol.toStringTag,{value:"Module"}));var Nte="Endomorphism",wB=function(){return{concat:function(e,t){return z(e,t)}}},$B=function(){return{concat:wB().concat,empty:P}};const qte=Object.freeze(Object.defineProperty({__proto__:null,URI:Nte,getMonoid:$B,getSemigroup:wB},Symbol.toStringTag,{value:"Module"})),Qte=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function EB(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 Vte(e,t){var n=t.zero,r=EB(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 zte={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 Hte=Object.freeze(Object.defineProperty({__proto__:null,fieldNumber:zte,gcd:EB,lcm:Vte},Symbol.toStringTag,{value:"Module"}));function ha(e,t){return function(n){return function(r){return e.map(r,function(i){return t.filter(i,n)})}}}function ma(e,t){return function(n){return function(r){return e.map(r,function(i){return t.filterMap(i,n)})}}}function wu(e,t){var n=ha(e,t);return function(r){var i=n(Kd(r)),o=n(r);return function(a){return Re(i(a),o(a))}}}function $u(e,t){var n=ma(e,t);return function(r){return function(i){return Re(b(i,n(function(o){return gv(r(o))})),b(i,n(function(o){return zp(r(o))})))}}}function Yte(e,t){var n=ql(e,t).map,r=go(e,t),i=Aa(e,t,t),o=ha(e,t),a=ma(e,t),u=wu(e,t),s=$u(e,t);return{map:n,compact:r,separate:i,filter:function(c,l){return b(c,o(l))},filterMap:function(c,l){return b(c,a(l))},partition:function(c,l){return b(c,u(l))},partitionMap:function(c,l){return b(c,s(l))}}}const Gte=Object.freeze(Object.defineProperty({__proto__:null,filter:ha,filterMap:ma,getFilterableComposition:Yte,partition:wu,partitionMap:$u},Symbol.toStringTag,{value:"Module"})),Jte=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function RB(e,t){return function(n,r){return function(i){return e.reduce(i,n,function(o,a){return t.reduce(a,o,r)})}}}function OB(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 FB(e,t){return function(n,r){return function(i){return e.reduceRight(i,n,function(o,a){return t.reduceRight(o,a,r)})}}}function Zte(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 Xte(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 MB(e){return function(t){return e.reduce(t,[],function(n,r){return n.push(r),n})}}function ene(e,t){var n=function(i,o){return e.ap(e.map(i,lr),o)},r=e.of(void 0);return function(i,o){return t.reduce(i,r,function(a,u){return n(a,o(u))})}}function tne(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 nne=MB;function MI(e,t){var n=RB(e,t),r=OB(e,t),i=FB(e,t);return{reduce:function(o,a,u){return b(o,n(a,u))},foldMap:function(o){var a=r(o);return function(u,s){return b(u,a(s))}},reduceRight:function(o,a,u){return b(o,i(a,u))}}}const rne=Object.freeze(Object.defineProperty({__proto__:null,foldM:tne,foldMap:OB,getFoldableComposition:MI,intercalate:Xte,reduce:RB,reduceM:Zte,reduceRight:FB,toArray:nne,toReadonlyArray:MB,traverse_:ene},Symbol.toStringTag,{value:"Module"}));function kB(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 LB(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 jB(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 ine(e,t){var n=MI(e,t),r=kB(e,t),i=LB(e,t),o=jB(e,t);return{reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,reduceWithIndex:function(a,u,s){return b(a,r(u,s))},foldMapWithIndex:function(a){var u=i(a);return function(s,c){return b(s,u(c))}},reduceRightWithIndex:function(a,u,s){return b(a,o(u,s))}}}const one=Object.freeze(Object.defineProperty({__proto__:null,foldMapWithIndex:LB,getFoldableWithIndexComposition:ine,reduceRightWithIndex:jB,reduceWithIndex:kB},Symbol.toStringTag,{value:"Module"}));function yo(e){return function(t){return z(t,e.fromIO)}}function ga(e,t){return function(n){var r=z(n,e.fromIO);return function(i){return t.chain(i,r)}}}function va(e,t){var n=dt(t);return function(r){return n(z(r,e.fromIO))}}const ane=Object.freeze(Object.defineProperty({__proto__:null,chainFirstIOK:va,chainIOK:ga,fromIOK:yo},Symbol.toStringTag,{value:"Module"}));var UB=function(){return P},une=P,cA=function(e){return function(t){return function(n){return t(e(n))}}},lA=function(e){return function(t){return e(t)(t)}},sne=lA,ya=function(e,t){return b(e,rc(t))},fA=function(e,t){return b(e,KB(t))},kI=function(e,t){return b(e,PB(t))},BB=function(e,t){return b(e,NB(t))},Rv=function(e,t,n){return b(e,qB(t,n))},rc=function(e){return function(t){return function(n){return e(t(n))}}},WB=function(e){return function(t){return function(n){return t(n)(e(n))}}},KB=WB,bo=lr,LI=function(e){return function(t){return function(n){return e(t(n))(n)}}},PB=LI,DB=LI(P),cne=DB,NB=function(e){return function(t){return z(e,t)}},qB=function(e,t){return function(n){return function(r){return t(n(e(r)))}}},jI=function(){return P},UI=function(e){return function(t){var n=t[0],r=t[1];return[e(n),r]}},BI=function(e){return function(t){var n=t[0],r=t[1];return[n,e(r)]}},WI=function(e){return EI(function(t){return Zo(e(t))},ze)},KI=function(e){return EI(wt,function(t){return hu(e(t))})},ii="Reader",hn={URI:ii,map:ya},lne=qe(hn),PI={URI:ii,of:bo},ba={URI:ii,map:ya,ap:fA},QB=kt(ba),fne=QB,VB=Lt(ba),dne=VB,zB={URI:ii,map:ya,ap:fA,of:bo},DI={URI:ii,map:ya,ap:fA,chain:kI},Ca={URI:ii,map:ya,of:bo,ap:fA,chain:kI},HB=dt(DI),pne=HB,Ane={URI:ii,map:ya,promap:Rv},hne={URI:ii,compose:BB,id:jI},mne={URI:ii,map:ya,promap:Rv,first:UI,second:BI},gne={URI:ii,map:ya,promap:Rv,left:WI,right:KI},vne=Ut(hn),YB=Bt(DI),yne=YB,bne=bo(tn),GB=jt(ba),Cne=GB,JB=bo(bn),ic=function(e){return function(t){return function(n){for(var r=[e(0,Fr(t))(n)],i=1;i<t.length;i++)r.push(e(i,t[i])(n));return r}}},NI=function(e){var t=ic(e);return function(n){return vt(n)?t(n):JB}},Sne=NI,ZB=function(e){return NI(function(t,n){return e(n)})},_ne=ZB(P),Ine={URI:ii,map:ya,of:bo,ap:fA,chain:kI,promap:Rv,compose:BB,id:jI,first:UI,second:BI,left:WI,right:KI},Tne=nn(ba),xne=ei(zB);const wne=Object.freeze(Object.defineProperty({__proto__:null,ApT:JB,Applicative:zB,Apply:ba,Category:hne,Chain:DI,Choice:gne,Do:bne,Functor:hn,Monad:Ca,Pointed:PI,Profunctor:Ane,Strong:mne,URI:ii,ap:KB,apFirst:QB,apFirstW:fne,apS:GB,apSW:Cne,apSecond:VB,apSecondW:dne,apW:WB,ask:UB,asks:une,asksReader:sne,asksReaderW:lA,bind:YB,bindTo:vne,bindW:yne,chain:PB,chainFirst:HB,chainFirstW:pne,chainW:LI,compose:NB,first:UI,flap:lne,flatten:cne,flattenW:DB,getMonoid:xne,getSemigroup:Tne,id:jI,left:WI,local:cA,map:rc,of:bo,promap:qB,reader:Ine,right:KI,second:BI,sequenceArray:_ne,traverseArray:ZB,traverseArrayWithIndex:Sne,traverseReadonlyArrayWithIndex:NI,traverseReadonlyNonEmptyArrayWithIndex:ic},Symbol.toStringTag,{value:"Module"}));function dA(e){return function(){return e.fromReader(UB())}}function pA(e){return e.fromReader}function oc(e){return function(t){return z(t,e.fromReader)}}function AA(e,t){var n=oc(e);return function(r){return function(i){return t.chain(i,n(r))}}}function hA(e,t){return z(oc(e),dt(t))}const $ne=Object.freeze(Object.defineProperty({__proto__:null,ask:dA,asks:pA,chainFirstReaderK:hA,chainReaderK:AA,fromReaderK:oc},Symbol.toStringTag,{value:"Module"}));var XB=function(){return function(e){return[e,e]}},eW=function(e){return function(){return[void 0,e]}},tW=function(e){return function(t){return[void 0,e(t)]}},nW=function(e){return function(t){return[e(t),t]}},mA=function(e,t){return b(e,iW(t))},Ov=function(e,t){return b(e,oW(t))},rW=function(e,t){return b(e,qI(t))},iW=function(e){return function(t){return function(n){var r=t(n),i=r[0],o=r[1];return[e(i),o]}}},oW=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]}}},gA=function(e){return function(t){return[e,t]}},qI=function(e){return function(t){return function(n){var r=t(n),i=r[0],o=r[1];return e(i)(o)}}},Ene=qI(P),Eu="State",QI={URI:Eu,map:mA},Rne=qe(QI),One={URI:Eu,of:gA},Fv={URI:Eu,map:mA,ap:Ov},Fne=kt(Fv),Mne=Lt(Fv),kne={URI:Eu,map:mA,ap:Ov,of:gA},VI={URI:Eu,map:mA,ap:Ov,chain:rW},aW={URI:Eu,map:mA,ap:Ov,of:gA,chain:rW},Lne=dt(VI),jne={URI:Eu,fromState:P},Une=function(e){return function(t){return t(e)[0]}},Bne=function(e){return function(t){return t(e)[1]}},Wne=Ut(QI),Kne=Bt(VI),Pne=jt(Fv),uW=function(e){return function(t){return function(n){for(var r=e(0,Fr(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]}}},zI=function(e){var t=uW(e);return function(n){return vt(n)?t(n):gA(bn)}},Dne=zI,sW=function(e){return zI(function(t,n){return e(n)})},Nne=sW(P),qne=function(e,t){return e(t)[0]},Qne=function(e,t){return e(t)[1]},Vne=aW;const zne=Object.freeze(Object.defineProperty({__proto__:null,Applicative:kne,Apply:Fv,Chain:VI,FromState:jne,Functor:QI,Monad:aW,Pointed:One,URI:Eu,ap:oW,apFirst:Fne,apS:Pne,apSecond:Mne,bind:Kne,bindTo:Wne,chain:qI,chainFirst:Lne,evalState:qne,evaluate:Une,execState:Qne,execute:Bne,flap:Rne,flatten:Ene,get:XB,gets:nW,map:iW,modify:tW,of:gA,put:eW,sequenceArray:Nne,state:Vne,traverseArray:sW,traverseArrayWithIndex:Dne,traverseReadonlyArrayWithIndex:zI,traverseReadonlyNonEmptyArrayWithIndex:uW},Symbol.toStringTag,{value:"Module"}));function cW(e){return function(){return e.fromState(XB())}}function lW(e){return function(t){return e.fromState(eW(t))}}function fW(e){return z(tW,e.fromState)}function dW(e){return z(nW,e.fromState)}function HI(e){return function(t){return z(t,e.fromState)}}function pW(e,t){var n=HI(e);return function(r){return function(i){return t.chain(i,n(r))}}}const Hne=Object.freeze(Object.defineProperty({__proto__:null,chainStateK:pW,fromStateK:HI,get:cW,gets:dW,modify:fW,put:lW},Symbol.toStringTag,{value:"Module"}));function ac(e){return function(t){return z(t,e.fromTask)}}function Rf(e,t){return function(n){var r=z(n,e.fromTask);return function(i){return t.chain(i,r)}}}function Of(e,t){var n=dt(t);return function(r){return n(z(r,e.fromTask))}}const Yne=Object.freeze(Object.defineProperty({__proto__:null,chainFirstTaskK:Of,chainTaskK:Rf,fromTaskK:ac},Symbol.toStringTag,{value:"Module"}));function AW(e){return function(t){return z(t,e.fromThese)}}const Gne=Object.freeze(Object.defineProperty({__proto__:null,fromTheseK:AW},Symbol.toStringTag,{value:"Module"}));function hW(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 Jne(e,t){var n=ql(e,t).map,r=hW(e,t);return{map:n,mapWithIndex:function(i,o){return b(i,r(o))}}}const Zne=Object.freeze(Object.defineProperty({__proto__:null,getFunctorWithIndexComposition:Jne,mapWithIndex:hW},Symbol.toStringTag,{value:"Module"})),Xne=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),ere=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),tre=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Co=function(e,t){return b(e,bW(t))},Ff=function(e,t){return b(e,CW(t))},Mv=function(e,t){return b(e,ZI(t))},YI=function(e,t,n){return b(e,SW(t,n))},GI=function(e){return function(t,n){return b(t,_W()(n))}},JI=function(e,t,n){return b(e,IW(t,n))},mW=function(e,t){return b(e,wW())},gW=function(e,t){return b(e,XI(t))},vW=function(e){var t=TW(e);return function(n,r){return b(n,t(r))}},yW=nI,bW=function(e){return function(t){return e(t)}},CW=function(e){return function(t){return t(e)}},Mf=P,ZI=function(e){return function(t){return e(t)}},XI=function(e){return function(t){return e(t)}},eT=P,nre=XI(P),rre=ZI(P),SW=function(e,t){return function(n){return t(e,n)}},_W=function(){return function(e){return function(t){return e(t)}}},IW=function(e,t){return function(n){return t(n,e)}},TW=function(e){return function(t){return function(n){return e.map(t(n),P)}}},tT=function(e){return function(t){return e.map(t,P)}},xW=function(){return P},wW=xW,Lr="Identity",ire=P,ore=P,nT={URI:Lr,map:Co},are=qe(nT),ure={URI:Lr,of:Mf},kv={URI:Lr,map:Co,ap:Ff},sre=kt(kv),cre=Lt(kv),lre={URI:Lr,map:Co,ap:Ff,of:Mf},rT={URI:Lr,map:Co,ap:Ff,chain:Mv},fre={URI:Lr,map:Co,ap:Ff,of:Mf,chain:Mv},dre=dt(rT),pre={URI:Lr,reduce:YI,foldMap:GI,reduceRight:JI},Are={URI:Lr,map:Co,reduce:YI,foldMap:GI,reduceRight:JI,traverse:vW,sequence:tT},hre={URI:Lr,map:Co,alt:mW},mre={URI:Lr,map:Co,extend:gW,extract:eT},gre={URI:Lr,map:Co,ap:Ff,chain:Mv,chainRec:yW},vre=Mf(tn),yre=Ut(nT),bre=Bt(rT),Cre=jt(kv),Sre={URI:Lr,map:Co,ap:Ff,of:Mf,chain:Mv,reduce:YI,foldMap:GI,reduceRight:JI,traverse:vW,sequence:tT,alt:mW,extract:eT,extend:gW,chainRec:yW};const _re=Object.freeze(Object.defineProperty({__proto__:null,Alt:hre,Applicative:lre,Apply:kv,Chain:rT,ChainRec:gre,Comonad:mre,Do:vre,Foldable:pre,Functor:nT,Monad:fre,Pointed:ure,Traversable:Are,URI:Lr,alt:wW,altW:xW,ap:CW,apFirst:sre,apS:Cre,apSecond:cre,bind:bre,bindTo:yre,chain:ZI,chainFirst:dre,duplicate:nre,extend:XI,extract:eT,flap:are,flatten:rre,foldMap:_W,getEq:ore,getShow:ire,identity:Sre,map:bW,of:Mf,reduce:SW,reduceRight:IW,sequence:tT,traverse:TW},Symbol.toStringTag,{value:"Module"})),Ire=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Sa=function(e,t){return function(){return t(e())}},Ru=function(e,t){return function(){return e()(t())}},kf=function(e,t){return function(){return t(e())()}},$W=function(e,t){return function(){for(var n=t(e)();n._tag==="Left";)n=t(n.left)();return n.right}},So=function(e){return function(t){return Sa(t,e)}},Tre=function(e){return function(t){return Ru(t,e)}},Li=lr,iT=function(e){return function(t){return kf(t,e)}},xre=iT(P),ji="IO",ut={URI:ji,map:Sa},wre=qe(ut),_o={URI:ji,of:Li},_a={URI:ji,map:Sa,ap:Ru},$re=kt(_a),Ere=Lt(_a),EW={URI:ji,map:Sa,ap:Ru,of:Li},Lv={URI:ji,map:Sa,ap:Ru,chain:kf},dr={URI:ji,map:Sa,ap:Ru,of:Li,chain:kf},Rre=dt(Lv),oT=P,Ore={URI:ji,map:Sa,ap:Ru,of:Li,chain:kf,fromIO:oT},Fre={URI:ji,map:Sa,ap:Ru,chain:kf,chainRec:$W},Mre={URI:ji,fromIO:P},kre=Li(tn),Lre=Ut(ut),jre=Bt(Lv),Ure=jt(_a),RW=Li(bn),jv=function(e){return function(t){return function(){for(var n=[e(0,Fr(t))()],r=1;r<t.length;r++)n.push(e(r,t[r])());return n}}},aT=function(e){var t=jv(e);return function(n){return vt(n)?t(n):RW}},Bre=aT,OW=function(e){return aT(function(t,n){return e(n)})},Wre=OW(P),Kre={URI:ji,map:Sa,of:Li,ap:Ru,chain:kf,fromIO:oT,chainRec:$W},Pre=nn(_a),Dre=ei(EW);const Nre=Object.freeze(Object.defineProperty({__proto__:null,ApT:RW,Applicative:EW,Apply:_a,Chain:Lv,ChainRec:Fre,Do:kre,FromIO:Mre,Functor:ut,Monad:dr,MonadIO:Ore,Pointed:_o,URI:ji,ap:Tre,apFirst:$re,apS:Ure,apSecond:Ere,bind:jre,bindTo:Lre,chain:iT,chainFirst:Rre,flap:wre,flatten:xre,fromIO:oT,getMonoid:Dre,getSemigroup:Pre,io:Kre,map:So,of:Li,sequenceArray:Wre,traverseArray:OW,traverseArrayWithIndex:Bre,traverseReadonlyArrayWithIndex:aT,traverseReadonlyNonEmptyArrayWithIndex:jv},Symbol.toStringTag,{value:"Module"}));var FW=yf(_o),MW=ec(_o),kW=bf(ut),qre=Cf(ut),LW=Li,vA=kW,jW=oA(ut),Qre=jW,uT=wf(dr),Vre=uT,UW=uT,zre=UW,BW=$f(dr),Hre=BW,WW=function(e,t){return function(){return Xs(e,t)}},Yre=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return WW(function(){return e.apply(void 0,n)},t)}},Gre=sA(ut),KW=nc(dr),Jre=KW,sT=aA(dr),Zre=sT,Xre=function(e){return sT(JW(e))},eie=uA(dr),tie=Ef(ut),pr=function(e,t){return b(e,fT(t))},uc=function(e,t){return b(e,dT(t))},nie=function(e,t){return b(e,Uv(function(n){return b(t,fT(n))}))},Lf=function(e,t){return b(e,Uv(t))},cT=function(e,t,n){return b(e,DW(t,n))},lT=function(e,t){return b(e,NW(t))},PW=function(e,t){return b(e,pT(t))},fT=Sf(ut),DW=Tf(ut),NW=xf(ut),dT=_f(_a),rie=dT,oi=MW,Uv=tc(dr),Am=Uv,qW=Am(P),iie=qW,pT=If(dr),oie=pT,Bv=FW,Qt="IOEither";function QW(e){var t=ua(_a,Iu(e));return{URI:Qt,_E:void 0,map:pr,ap:function(n,r){return b(n,t(r))},of:oi}}function VW(e){var t=iA(dr,e);return{URI:Qt,_E:void 0,map:pr,alt:function(n,r){return b(n,t(r))}}}var zW=function(e){var t=Js(e);return{URI:Qt,_E:void 0,compact:go(ut,t),separate:Aa(ut,t,Tu)}};function aie(e){var t=mf(e),n=zW(e),r=ha(ut,t),i=ma(ut,t),o=wu(ut,t),a=$u(ut,t);return{URI:Qt,_E:void 0,map:pr,compact:n.compact,separate:n.separate,filter:function(u,s){return b(u,r(s))},filterMap:function(u,s){return b(u,i(s))},partition:function(u,s){return b(u,o(s))},partitionMap:function(u,s){return b(u,a(s))}}}var AT={URI:Qt,map:pr},uie=qe(AT),sie={URI:Qt,of:oi},cie={URI:Qt,bimap:cT,mapLeft:lT},yA={URI:Qt,map:pr,ap:uc},HW=kt(yA),lie=HW,YW=Lt(yA),fie=YW,hT={URI:Qt,map:pr,ap:uc,of:oi},die={URI:Qt,map:pr,ap:nie,of:oi},Ia={URI:Qt,map:pr,ap:uc,chain:Lf},pie={URI:Qt,map:pr,ap:uc,of:oi,chain:Lf},GW=dt(Ia),Aie=GW,hie={URI:Qt,map:pr,alt:PW},mie={URI:Qt,map:pr,ap:uc,of:oi,chain:Lf,fromIO:vA},gie={URI:Qt,map:pr,ap:uc,of:oi,chain:Lf,throwError:Bv},Wv={URI:Qt,fromIO:vA},JW=yo(Wv),vie=ga(Wv,Ia),yie=va(Wv,Ia),Ta={URI:Qt,fromEither:LW},bie=po(Ta),Cie=Ao(Ta),Sie=Ks(Ta,Ia),ZW=sa(Ta,Ia),_ie=ZW,XW=ca(Ta,Ia),Iie=XW,Tie=mu(Ta),eK=Ps(Ta,Ia),xie=eK,wie=Mr(Ta),$ie=function(e,t,n){return tK(e,t,n)},tK=function(e,t,n){return b(e,Am(function(r){return b(t(r),iT(function(i){return b(n(r,i),Am(function(){return Li(i)}))}))}))},Eie=oi(tn),Rie=Ut(AT),nK=Bt(Ia),Oie=nK,rK=jt(yA),Fie=rK,mT=oi(bn),iK=function(e){return z(jv(e),So(rA(fr)))},gT=function(e){var t=iK(e);return function(n){return vt(n)?t(n):mT}},oK=function(e){return function(t){return function(){var n=e(0,Fr(t))();if(Xt(n))return n;for(var r=[n.right],i=1;i<t.length;i++){var o=e(i,t[i])();if(Xt(o))return o;r.push(o.right)}return hu(r)}}},vT=function(e){var t=oK(e);return function(n){return vt(n)?t(n):mT}},Mie=gT,aK=function(e){return gT(function(t,n){return e(n)})},kie=aK(P),Lie=vT,uK=function(e){return vT(function(t,n){return e(n)})},jie=uK(P),Uie=hT,Bie={URI:Qt,bimap:cT,mapLeft:lT,map:pr,of:oi,ap:uc,chain:Lf,alt:PW,fromIO:vA,throwError:Bv},Wie=nn(yA),Kie=ei(hT),Pie=function(e){return nn(_a)(Xp(e))};function Die(e){var t=QW(e),n=VW(e);return{URI:Qt,_E:void 0,map:pr,ap:t.ap,of:oi,chain:Lf,bimap:cT,mapLeft:lT,alt:n.alt,fromIO:vA,throwError:Bv}}const Nie=Object.freeze(Object.defineProperty({__proto__:null,Alt:hie,ApT:mT,Applicative:Uie,ApplicativePar:hT,ApplicativeSeq:die,ApplyPar:yA,Bifunctor:cie,Chain:Ia,Do:Eie,FromEither:Ta,FromIO:Wv,Functor:AT,Monad:pie,MonadIO:mie,MonadThrow:gie,Pointed:sie,URI:Qt,alt:pT,altW:oie,ap:dT,apFirst:HW,apFirstW:lie,apS:rK,apSW:Fie,apSecond:YW,apSecondW:fie,apW:rie,bimap:DW,bind:nK,bindTo:Rie,bindW:Oie,bracket:$ie,bracketW:tK,chain:Uv,chainEitherK:ZW,chainEitherKW:_ie,chainFirst:GW,chainFirstEitherK:XW,chainFirstEitherKW:Iie,chainFirstIOK:yie,chainFirstW:Aie,chainIOK:vie,chainOptionK:Sie,chainW:Am,filterOrElse:eK,filterOrElseW:xie,flap:uie,flatten:iie,flattenW:qW,fold:Vre,foldW:zre,fromEither:LW,fromEitherK:wie,fromIO:vA,fromIOK:JW,fromOption:bie,fromOptionK:Cie,fromPredicate:Tie,getAltIOValidation:VW,getApplicativeIOValidation:QW,getApplyMonoid:Kie,getApplySemigroup:Wie,getCompactable:zW,getFilterable:aie,getIOValidation:Die,getOrElse:BW,getOrElseW:Hre,getSemigroup:Pie,ioEither:Bie,left:FW,leftIO:qre,map:fT,mapLeft:NW,match:jW,matchE:uT,matchEW:UW,matchW:Qre,of:oi,orElse:KW,orElseFirst:sT,orElseFirstIOK:Xre,orElseFirstW:Zre,orElseW:Jre,orLeft:eie,right:MW,rightIO:kW,sequenceArray:kie,sequenceSeqArray:jie,swap:tie,throwError:Bv,toUnion:Gre,traverseArray:aK,traverseArrayWithIndex:Mie,traverseReadonlyArrayWithIndex:gT,traverseReadonlyArrayWithIndexSeq:vT,traverseReadonlyNonEmptyArrayWithIndex:iK,traverseReadonlyNonEmptyArrayWithIndexSeq:oK,traverseSeqArray:uK,traverseSeqArrayWithIndex:Lie,tryCatch:WW,tryCatchK:Yre},Symbol.toStringTag,{value:"Module"}));function bA(e){return z(It,e.of)}function CA(e){return lr(e.of(ot))}function Kv(e){return function(t){return e.map(t,It)}}function Pv(e){return z(Hs,e.of)}function Dv(e){var t=Pv(e);return function(n){return z(n,t)}}function yT(e){var t=jf(e),n=Dv(e);return function(r){return t(n(r))}}function Nv(e){return function(t){return z(t,e.of)}}function bT(e){var t=jf(e),n=Nv(e);return function(r){return t(n(r))}}function CT(e){return function(t){return function(n){return e.of(mv(t)(n))}}}function ST(e){return z(pf,e.of)}function _T(e){return function(t,n){return function(r){return e.map(r,pa(t,n))}}}function qv(e){return function(t,n){return function(r){return e.chain(r,pa(t,n))}}}function Qv(e){return function(t){return function(n){return e.chain(n,pa(t,e.of))}}}function Vv(e){return Nl(e,cf)}function zv(e){return ua(e,lf)}function jf(e){var t=CA(e);return function(n){return function(r){return e.chain(r,pa(function(){return t()},n))}}}function Hv(e){var t=bA(e);return function(n){return function(r){return e.chain(r,pa(n,t))}}}function qie(e){var t=zv(e),n=Vv(e),r=jf(e),i=Hv(e),o=qv(e),a=Qv(e),u=CA(e);return{map:function(s,c){return b(s,n(c))},ap:function(s,c){return b(s,t(c))},of:bA(e),chain:function(s,c){return b(s,r(c))},alt:function(s,c){return b(s,i(c))},fold:function(s,c,l){return b(s,o(c,l))},getOrElse:function(s,c){return b(s,a(c))},fromM:Kv(e),none:function(){return u()}}}const Qie=Object.freeze(Object.defineProperty({__proto__:null,alt:Hv,ap:zv,chain:jf,chainNullableK:yT,chainOptionK:bT,fromEither:ST,fromF:Kv,fromNullable:Pv,fromNullableK:Dv,fromOptionK:Nv,fromPredicate:CT,getOptionM:qie,getOrElse:Qv,map:Vv,match:_T,matchE:qv,some:bA,zero:CA},Symbol.toStringTag,{value:"Module"}));var sK=bA(_o),Vie=CT(_o),zie=Li,cK=ST(_o),IT=Kv(ut),Hie=So(pf),lK=_T(ut),Yie=lK,TT=qv(Lv),Gie=TT,Jie=TT,fK=Qv(dr),Zie=fK,Xie=So(L2),eoe=So(gI),toe=Pv(_o),noe=Dv(_o),roe=yT(dr),ioe=Nv(_o),ooe=bT(dr),dK=Vv(ut),pK=zv(_a),Ou=sK,xT=jf(dr),aoe=xT(P),wT=Hv(dr),uoe=wT,Yv=CA(_o),soe=Yv(),$T=go(ut,zs),ET=Aa(ut,zs,cf),AK=ha(ut,da),hK=ma(ut,da),mK=wu(ut,da),gK=$u(ut,da),xa=function(e,t){return b(e,dK(t))},Uf=function(e,t){return b(e,pK(t))},RT=function(e,t){return b(e,xT(t))},vK=function(e,t){return b(e,wT(t))},coe=function(e,t){return b(e,AK(t))},loe=function(e,t){return b(e,hK(t))},foe=function(e,t){return b(e,mK(t))},doe=function(e,t){return b(e,gK(t))},Ar="IOOption",OT={URI:Ar,map:xa},poe=qe(OT),yK={URI:Ar,of:Ou},Gv={URI:Ar,map:xa,ap:Uf},Aoe=kt(Gv),hoe=Lt(Gv),moe={URI:Ar,map:xa,ap:Uf,of:Ou},sc={URI:Ar,map:xa,ap:Uf,chain:RT},goe=dt(sc),voe={URI:Ar,map:xa,alt:vK},bK={URI:Ar,zero:Yv},yoe=Gl(bK,yK),boe={URI:Ar,map:xa,ap:Uf,of:Ou,alt:vK,zero:Yv},Coe={URI:Ar,map:xa,ap:Uf,of:Ou,chain:RT},Soe={URI:Ar,map:xa,ap:Uf,of:Ou,chain:RT,fromIO:IT},_oe={URI:Ar,compact:$T,separate:ET},Ioe={URI:Ar,map:xa,compact:$T,separate:ET,filter:coe,filterMap:loe,partition:foe,partitionMap:doe},Jv={URI:Ar,fromIO:IT},Toe=yo(Jv),xoe=ga(Jv,sc),woe=va(Jv,sc),Zv={URI:Ar,fromEither:cK},$oe=Mr(Zv),Eoe=sa(Zv,sc),Roe=ca(Zv,sc),Ooe=Ou(tn),Foe=Ut(OT),Moe=Bt(sc),koe=jt(Gv),CK=Ou(bn),SK=function(e){return z(jv(e),So(Tv(fr)))},Loe=function(e){var t=SK(e);return function(n){return vt(n)?t(n):CK}};const joe=Object.freeze(Object.defineProperty({__proto__:null,Alt:voe,Alternative:boe,ApT:CK,Applicative:moe,Apply:Gv,Chain:sc,Compactable:_oe,Do:Ooe,Filterable:Ioe,FromEither:Zv,FromIO:Jv,Functor:OT,Monad:Coe,MonadIO:Soe,Pointed:yK,Zero:bK,alt:wT,altW:uoe,ap:pK,apFirst:Aoe,apS:koe,apSecond:hoe,bind:Moe,bindTo:Foe,chain:xT,chainEitherK:Eoe,chainFirst:goe,chainFirstEitherK:Roe,chainFirstIOK:woe,chainIOK:xoe,chainNullableK:roe,chainOptionK:ooe,compact:$T,filter:AK,filterMap:hK,flap:poe,flatten:aoe,fold:Gie,fromEither:cK,fromEitherK:$oe,fromIO:IT,fromIOEither:Hie,fromIOK:Toe,fromNullable:toe,fromNullableK:noe,fromOption:zie,fromOptionK:ioe,fromPredicate:Vie,getOrElse:fK,getOrElseW:Zie,guard:yoe,map:dK,match:lK,matchE:TT,matchEW:Jie,matchW:Yie,none:soe,of:Ou,partition:mK,partitionMap:gK,separate:ET,some:sK,toNullable:eoe,toUndefined:Xie,traverseReadonlyArrayWithIndex:Loe,traverseReadonlyNonEmptyArrayWithIndex:SK,zero:Yv},Symbol.toStringTag,{value:"Module"}));var _K=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 Uoe(e){return function(){return new _K(e)}}const Boe=Object.freeze(Object.defineProperty({__proto__:null,IORef:_K,newIORef:Uoe},Symbol.toStringTag,{value:"Module"})),Woe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Koe=function(e){return Xs(function(){return JSON.parse(e)},P)},Poe=function(e){return Xs(function(){var t=JSON.stringify(e);if(typeof t!="string")throw new Error("Converting unsupported structure to JSON");return t},P)};const Doe=Object.freeze(Object.defineProperty({__proto__:null,parse:Koe,stringify:Poe},Symbol.toStringTag,{value:"Module"})),Noe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var qoe=function(e){return new Map(e)};function Qoe(e){return new Map(e)}function IK(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 TK=function(e){return e.size},ao=function(e){return e.size===0};function Xv(e){var t=cc(e);return function(n,r){if(r===void 0){var i=Xv(e);return function(o){return i(n,o)}}return _t(t(n,r))}}function FT(e){return function(t,n){if(n===void 0){var r=FT(e);return function(u){return r(t,u)}}for(var i=n.values(),o;!(o=i.next()).done;){var a=o.value;if(e.equals(t,a))return!0}return!1}}var Bf=function(e){return function(t){return Array.from(t.keys()).sort(e.compare)}},Voe=function(e){return function(t){return Array.from(t.values()).sort(e.compare)}};function xK(e){var t=Bf(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 wK=function(e){return xK(e)(function(t,n){return[t,n]})};function zoe(e,t){var n=wK(e);return function(r){var i=n(r),o=i.length;return t.unfold(0,function(a){return a<o?fe([i[a],a+1]):ye})}}var $K=function(e){var t=wa(e);return function(n,r){var i=t(n);return function(o){var a=i(o);if(Nt(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}}},EK=function(e){var t=wa(e);return function(n){return function(r){var i=t(n,r);if(_t(i)){var o=new Map(r);return o.delete(i.value[0]),o}return r}}},Hoe=function(e){var t=RK(e);return function(n,r){return t(n,function(){return r})}},RK=function(e){var t=wa(e);return function(n,r){return function(i){var o=t(n,i);if(Nt(o))return ye;var a=o.value,u=a[0],s=a[1],c=r(s);if(c===s)return fe(i);var l=new Map(i);return l.set(u,c),fe(l)}}};function Yoe(e){var t=cc(e),n=EK(e);return function(r){var i=n(r);return function(o){return b(t(r,o),mo(function(a){return[a,i(o)]}))}}}function wa(e){return function(t,n){if(n===void 0){var r=wa(e);return function(c){return r(t,c)}}for(var i=n.entries(),o;!(o=i.next()).done;){var a=o.value,u=a[0],s=a[1];if(e.equals(u,t))return fe([u,s])}return ye}}function cc(e){var t=wa(e);return function(n,r){if(r===void 0){var i=cc(e);return function(o){return i(n,o)}}return b(t(n,r),mo(function(o){o[0];var a=o[1];return a}))}}function ey(e,t){var n=wa(e);return function(r,i){if(i===void 0){var o=ey(e,t);return function(p){return o(p,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(Nt(f)||!e.equals(c,f.value[0])||!t.equals(l,f.value[1]))return!1}return!0}}var ty=new Map;function OK(e,t){var n=ey(e,t);return ti(function(r,i){return n(r,i)&&n(i,r)})}function Goe(e,t){var n=wa(e);return{concat:function(r,i){if(ao(r))return i;if(ao(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);_t(f)?o.set(f.value[0],t.concat(f.value[1],l)):o.set(c,l)}return o},empty:ty}}var Joe=function(e,t){return new Map([[e,t]])};function Zoe(e,t,n){return function(r){var i=wa(e);return n.reduce(r,new Map,function(o,a){var u=a[0],s=a[1],c=i(u,o);return _t(c)?o.set(c.value[0],t.concat(c.value[1],s)):o.set(u,s),o})}}var Wf=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},FK=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);Xt(c)?n.set(u,c.left):r.set(u,c.right)}return Re(n,r)}};function MK(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 Re(n,r)}}var kK=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);_t(s)&&n.set(a,s.value)}return n}};function LK(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 $a=function(e,t){return Wf(e,function(n,r){return t(r)})},SA=function(e,t){return jK(e,function(n,r){return t(r)})},_A=function(e,t){return UK(e,function(n,r){return t(r)})},IA=function(e,t){return BK(e,function(n,r){return t(r)})},TA=function(e,t){return WK(e,function(n,r){return t(r)})},jK=function(e,t){return b(e,LK(t))},UK=function(e,t){return b(e,kK(t))},BK=function(e,t){return b(e,MK(t))},WK=function(e,t){return b(e,FK(t))},Kf=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];_t(a)&&t.set(o,a.value)}return t},Xoe=function(e){return function(t){return SA(t,e)}},eae=function(e){return function(t){return _A(t,e)}},tae=function(e){return function(t){return $a(t,e)}},nae=function(e){return function(t){return Wf(t,e)}},rae=function(e){return function(t){return IA(t,e)}},iae=function(e){return function(t){return TA(t,e)}},Pf=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];Xt(u)?t.set(a,u.left):n.set(a,u.right)}return Re(t,n)},ai="ReadonlyMap",KK=function(e,t){var n=BT(e,t);return{concat:function(r,i){return n(i)(r)}}},oae=function(e,t){return{concat:KK(e,t).concat,empty:ty}},aae=function(e,t){var n=WT(e,t);return{concat:function(r,i){return n(i)(r)}}},uae=function(e){return function(){var t=KT(e);return{concat:function(n,r){return t(r)(n)}}}};function sae(){return{URI:ai,_E:void 0,map:$a,mapWithIndex:Wf,compact:Kf,separate:Pf,filter:SA,filterMap:_A,partition:IA,partitionMap:TA,partitionMapWithIndex:WK,partitionWithIndex:BK,filterMapWithIndex:UK,filterWithIndex:jK}}var PK={URI:ai,map:$a},cae=qe(PK),lae=function(){return{URI:ai,_E:void 0,map:$a,mapWithIndex:Wf}},$1={URI:ai,compact:Kf,separate:Pf},fae={URI:ai,map:$a,compact:Kf,separate:Pf,filter:SA,filterMap:_A,partition:IA,partitionMap:TA},MT=function(e){var t=ry(e);return function(n,r){return t(n,function(i,o,a){return r(o,a)})}},kT=function(e){var t=iy(e);return function(n){var r=t(n);return function(i){return r(function(o,a){return i(a)})}}},LT=function(e){var t=oy(e);return function(n,r){return t(n,function(i,o,a){return r(o,a)})}},ny=function(e){var t=MT(e),n=kT(e),r=LT(e);return{URI:ai,_E:void 0,reduce:function(i,o,a){return b(i,t(o,a))},foldMap:function(i){var o=n(i);return function(a,u){return b(a,o(u))}},reduceRight:function(i,o,a){return b(i,r(o,a))}}},ry=function(e){var t=Bf(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}}},iy=function(e){var t=Bf(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}}}},oy=function(e){var t=Bf(e);return function(n,r){return function(i){for(var o=n,a=t(i),u=a.length,s=u-1;s>=0;s--){var c=a[s];o=r(c,i.get(c),o)}return o}}},jT=function(e){var t=ny(e),n=ry(e),r=iy(e),i=oy(e);return{URI:ai,_E:void 0,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,reduceWithIndex:function(o,a,u){return b(o,n(a,u))},foldMapWithIndex:function(o){var a=r(o);return function(u,s){return b(u,a(s))}},reduceRightWithIndex:function(o,a,u){return b(o,i(a,u))}}},dae=function(e){var t=UT(e),n=ny(e);return{URI:ai,_E:void 0,map:$a,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,traverse:t.traverse,sequence:t.sequence}},UT=function(e){var t=jT(e),n=Bf(e),r=function(a){return function(u,s){for(var c=a.of(new Map),l=n(u),f=l.length,p=function(h){var v=l[h],_=u.get(v);c=a.ap(a.map(c,function(S){return function(I){return S.set(v,I)}}),s(v,_))},A=0;A<f;A++)p(A);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,fr)}};return{URI:ai,_E:void 0,map:$a,mapWithIndex:Wf,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 pae(e){var t=UT(e);return{URI:ai,_E:void 0,map:$a,compact:Kf,separate:Pf,filter:SA,filterMap:_A,partition:IA,partitionMap:TA,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,traverse:t.traverse,sequence:t.sequence,mapWithIndex:Wf,reduceWithIndex:t.reduceWithIndex,foldMapWithIndex:t.foldMapWithIndex,reduceRightWithIndex:t.reduceRightWithIndex,traverseWithIndex:t.traverseWithIndex,wilt:Mi(t,$1),wither:ki(t,$1)}}var BT=function(e,t){var n=cc(e);return function(r){return function(i){if(ao(i))return r;if(ao(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);_t(f)?o.set(c,t.concat(l,f.value)):o.set(c,l)}for(var p=r.entries();!(u=p.next()).done;){var A=u.value,c=A[0],l=A[1],f=n(c)(o);Nt(f)&&o.set(c,l)}return o}}},WT=function(e,t){var n=cc(e);return function(r){return function(i){if(ao(i)||ao(r))return ty;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);_t(f)&&o.set(c,t.concat(l,f.value))}return o}}},KT=function(e){var t=Xv(e);return function(n){return function(r){if(ao(r))return n;if(ao(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}}},Aae=$K,hae={URI:ai,map:$a,compact:Kf,separate:Pf,filter:SA,filterMap:_A,partition:IA,partitionMap:TA};const mae=Object.freeze(Object.defineProperty({__proto__:null,Compactable:$1,Filterable:fae,Functor:PK,URI:ai,collect:xK,compact:Kf,deleteAt:EK,difference:KT,elem:FT,empty:ty,filter:Xoe,filterMap:eae,filterMapWithIndex:kK,filterWithIndex:LK,flap:cae,foldMap:kT,foldMapWithIndex:iy,fromFoldable:Zoe,fromMap:qoe,getDifferenceMagma:uae,getEq:OK,getFilterableWithIndex:sae,getFoldable:ny,getFoldableWithIndex:jT,getFunctorWithIndex:lae,getIntersectionSemigroup:aae,getMonoid:Goe,getShow:IK,getTraversable:dae,getTraversableWithIndex:UT,getUnionMonoid:oae,getUnionSemigroup:KK,getWitherable:pae,insertAt:Aae,intersection:WT,isEmpty:ao,isSubmap:ey,keys:Bf,lookup:cc,lookupWithKey:wa,map:tae,mapWithIndex:nae,member:Xv,modifyAt:RK,partition:rae,partitionMap:iae,partitionMapWithIndex:FK,partitionWithIndex:MK,pop:Yoe,readonlyMap:hae,reduce:MT,reduceRight:LT,reduceRightWithIndex:oy,reduceWithIndex:ry,separate:Pf,singleton:Joe,size:TK,toMap:Qoe,toReadonlyArray:wK,toUnfoldable:zoe,union:BT,updateAt:Hoe,upsertAt:$K,values:Voe},Symbol.toStringTag,{value:"Module"}));var yl=function(){return yl=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},yl.apply(this,arguments)},gae=IK,vae=TK,Xo=ao,yae=Xv,bae=FT,PT=function(e){return function(t){return Array.from(t.keys()).sort(e.compare)}},Cae=function(e){return function(t){return Array.from(t.values()).sort(e.compare)}};function DK(e){var t=PT(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 NK(e){return DK(e)(function(t,n){return[t,n]})}function Sae(e,t){var n=NK(e);return function(r){var i=n(r),o=i.length;return t.unfold(0,function(a){return a<o?fe([i[a],a+1]):ye})}}var qK=function(e){var t=lc(e);return function(n,r){var i=t(n);return function(o){var a=i(o);if(Nt(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}}},QK=function(e){var t=lc(e);return function(n){return function(r){var i=t(n,r);if(_t(i)){var o=new Map(r);return o.delete(i.value[0]),o}return r}}},_ae=function(e){var t=VK(e);return function(n,r){return t(n,function(){return r})}},VK=function(e){var t=lc(e);return function(n,r){return function(i){var o=t(n,i);if(Nt(o))return ye;var a=new Map(i);return a.set(o.value[0],r(o.value[1])),fe(a)}}};function Iae(e){var t=zK(e),n=QK(e);return function(r){var i=n(r);return function(o){return b(t(r,o),mo(function(a){return[a,i(o)]}))}}}function lc(e){return function(t,n){if(n===void 0){var r=lc(e);return function(c){return r(t,c)}}for(var i=n.entries(),o;!(o=i.next()).done;){var a=o.value,u=a[0],s=a[1];if(e.equals(u,t))return fe([u,s])}return ye}}var zK=cc,Tae=ey,xae=OK;function wae(e,t){var n=lc(e);return{concat:function(r,i){if(Xo(r))return i;if(Xo(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);_t(f)?o.set(f.value[0],t.concat(f.value[1],l)):o.set(c,l)}return o},empty:new Map}}var $ae=function(e,t){return new Map([[e,t]])};function Eae(e,t,n){return function(r){var i=lc(e);return n.reduce(r,new Map,function(o,a){var u=a[0],s=a[1],c=i(u,o);return _t(c)?o.set(c.value[0],t.concat(c.value[1],s)):o.set(u,s),o})}}var xA=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},HK=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);Xt(c)?n.set(u,c.left):r.set(u,c.right)}return Re(n,r)}};function YK(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 Re(n,r)}}var GK=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);_t(s)&&n.set(a,s.value)}return n}};function JK(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 Df=function(e,t){return xA(e,function(n,r){return t(r)})},ay=function(e,t){return ZK(e,function(n,r){return t(r)})},uy=function(e,t){return XK(e,function(n,r){return t(r)})},sy=function(e,t){return eP(e,function(n,r){return t(r)})},cy=function(e,t){return tP(e,function(n,r){return t(r)})},ZK=function(e,t){return b(e,JK(t))},XK=function(e,t){return b(e,GK(t))},eP=function(e,t){return b(e,YK(t))},tP=function(e,t){return b(e,HK(t))},wA=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];_t(a)&&t.set(o,a.value)}return t},Rae=function(e){return function(t){return ay(t,e)}},Oae=function(e){return function(t){return uy(t,e)}},Fae=function(e){return function(t){return Df(t,e)}},Mae=function(e){return function(t){return xA(t,e)}},kae=function(e){return function(t){return sy(t,e)}},Lae=function(e){return function(t){return cy(t,e)}},$A=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];Xt(u)?t.set(a,u.left):n.set(a,u.right)}return Re(t,n)},Ea="Map",nP=function(e,t){var n=uP(e,t);return{concat:function(r,i){return n(i)(r)}}},jae=function(e,t){return{concat:nP(e,t).concat,empty:new Map}},Uae=function(e,t){var n=sP(e,t);return{concat:function(r,i){return n(i)(r)}}},Bae=function(e){return function(){var t=cP(e);return{concat:function(n,r){return t(r)(n)}}}};function Wae(){return{URI:Ea,_E:void 0,map:Df,mapWithIndex:xA,compact:wA,separate:$A,filter:ay,filterMap:uy,partition:sy,partitionMap:cy,partitionMapWithIndex:tP,partitionWithIndex:eP,filterMapWithIndex:XK,filterWithIndex:ZK}}function Kae(e){var t=iP(e);return{URI:Ea,_E:void 0,map:Df,compact:wA,separate:$A,filter:ay,filterMap:uy,partition:sy,partitionMap:cy,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,traverse:t.traverse,sequence:t.sequence,mapWithIndex:xA,reduceWithIndex:t.reduceWithIndex,foldMapWithIndex:t.foldMapWithIndex,reduceRightWithIndex:t.reduceRightWithIndex,traverseWithIndex:t.traverseWithIndex,wilt:Mi(t,E1),wither:ki(t,E1)}}var Pae=MT,Dae=kT,Nae=LT,qae=function(e){return yl(yl({},ny(e)),{URI:Ea})},Qae=ry,Vae=iy,zae=oy,rP=function(e){return yl(yl({},jT(e)),{URI:Ea})},iP=function(e){var t=rP(e),n=PT(e),r=function(a){return function(u,s){for(var c=a.of(new Map),l=n(u),f=l.length,p=function(h){var v=l[h],_=u.get(v);c=a.ap(a.map(c,function(S){return function(I){return S.set(v,I)}}),s(v,_))},A=0;A<f;A++)p(A);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:Ea,_E:void 0,map:Df,mapWithIndex:xA,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,reduceWithIndex:t.reduceWithIndex,foldMapWithIndex:t.foldMapWithIndex,reduceRightWithIndex:t.reduceRightWithIndex,traverse:i,sequence:o,traverseWithIndex:r}},oP={URI:Ea,map:Df},Hae=qe(oP),E1={URI:Ea,compact:wA,separate:$A},aP={URI:Ea,map:Df,compact:wA,separate:$A,filter:ay,filterMap:uy,partition:sy,partitionMap:cy},hm=function(e){return new Map(e)},uP=function(e,t){var n=BT(e,t);return function(r){return function(i){return Xo(i)?hm(r):Xo(r)?hm(i):n(r)(i)}}},sP=function(e,t){var n=WT(e,t);return function(r){return function(i){return Xo(i)||Xo(r)?new Map:n(r)(i)}}},cP=function(e){var t=KT(e);return function(n){return function(r){return Xo(r)?hm(n):Xo(n)?hm(r):t(n)(r)}}},Yae=new Map,Gae=qK,Jae=aP;const Zae=Object.freeze(Object.defineProperty({__proto__:null,Compactable:E1,Filterable:aP,Functor:oP,URI:Ea,collect:DK,compact:wA,deleteAt:QK,difference:cP,elem:bae,empty:Yae,filter:Rae,filterMap:Oae,filterMapWithIndex:GK,filterWithIndex:JK,flap:Hae,foldMap:Dae,foldMapWithIndex:Vae,fromFoldable:Eae,getDifferenceMagma:Bae,getEq:xae,getFilterableWithIndex:Wae,getFoldable:qae,getFoldableWithIndex:rP,getIntersectionSemigroup:Uae,getMonoid:wae,getShow:gae,getTraversableWithIndex:iP,getUnionMonoid:jae,getUnionSemigroup:nP,getWitherable:Kae,insertAt:Gae,intersection:sP,isEmpty:Xo,isSubmap:Tae,keys:PT,lookup:zK,lookupWithKey:lc,map:Fae,mapWithIndex:Mae,map_:Jae,member:yae,modifyAt:VK,partition:kae,partitionMap:Lae,partitionMapWithIndex:HK,partitionWithIndex:YK,pop:Iae,reduce:Pae,reduceRight:Nae,reduceRightWithIndex:zae,reduceWithIndex:Qae,separate:$A,singleton:$ae,size:vae,toArray:NK,toUnfoldable:Sae,union:uP,updateAt:_ae,upsertAt:qK,values:Cae},Symbol.toStringTag,{value:"Module"})),Xae=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),eue=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),tue=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),nue=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),rue=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var lP=function(e){return{concat:yg(e).concat,empty:e.top}},fP=function(e){return{concat:bg(e).concat,empty:e.bottom}},DT=function(e){return{concat:eS(e).concat,empty:e.empty}},dP=function(e){var t={};for(var n in e)ft.call(e,n)&&(t[n]=e[n].empty);return{concat:tS(e).concat,empty:t}},pP=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return{concat:nS.apply(nL,e).concat,empty:e.map(function(n){return n.empty})}},AP=function(e){return iS(e)(e.empty)},iue={concat:Gk.concat,empty:void 0},oue=pP,aue=dP,uue=DT,sue=fP,cue=lP,lue=AP,hP={concat:Jk.concat,empty:!0},mP={concat:Zk.concat,empty:!1},fue=Tk,due=function(){return DT($B())},pue={concat:Xk.concat,empty:""},Aue={concat:eL.concat,empty:0},hue={concat:tL.concat,empty:1};const mue=Object.freeze(Object.defineProperty({__proto__:null,concatAll:AP,fold:lue,getDualMonoid:uue,getEndomorphismMonoid:due,getFunctionMonoid:fue,getJoinMonoid:sue,getMeetMonoid:cue,getStructMonoid:aue,getTupleMonoid:oue,max:fP,min:lP,monoidAll:hP,monoidAny:mP,monoidProduct:hue,monoidString:pue,monoidSum:Aue,monoidVoid:iue,reverse:DT,struct:dP,tuple:pP},Symbol.toStringTag,{value:"Module"})),gue=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var gP=function(e,t,n){return function(r){return r===-1?e():r===0?t():n()}},vue=gP,vP=function(e){return e===-1?1:e===1?-1:0},yP={equals:function(e,t){return e===t}},NT={concat:function(e,t){return e!==0?e:t}},bP={concat:NT.concat,empty:0},yue=function(e){return e<=-1?-1:e>=1?1:0},bue=vP,Cue=NT,Sue=yP,_ue=bP;const Iue=Object.freeze(Object.defineProperty({__proto__:null,Eq:yP,Monoid:bP,Semigroup:NT,eqOrdering:Sue,invert:bue,match:vue,matchW:gP,monoidOrdering:_ue,reverse:vP,semigroupOrdering:Cue,sign:yue},Symbol.toStringTag,{value:"Module"}));var Tue=function(e){return typeof e.map=="function"},xue=function(e){return typeof e.contramap=="function"},wue=function(e){return typeof e.mapWithIndex=="function"},$ue=function(e){return typeof e.ap=="function"},Eue=function(e){return typeof e.chain=="function"},Rue=function(e){return typeof e.bimap=="function"},Oue=function(e){return typeof e.extend=="function"},Fue=function(e){return typeof e.reduce=="function"},Mue=function(e){return typeof e.reduceWithIndex=="function"},kue=function(e){return typeof e.alt=="function"},Lue=function(e){return typeof e.compact=="function"},jue=function(e){return typeof e.filter=="function"},Uue=function(e){return typeof e.filterWithIndex=="function"},Bue=function(e){return typeof e.promap=="function"},Wue=function(e){return typeof e.compose=="function"},Kue=function(e){return typeof e.throwError=="function"};function Pue(e){var t={};if(Tue(e)){var n=function(k){return function(E){return e.map(E,k)}};t.map=n}if(xue(e)){var r=function(k){return function(E){return e.contramap(E,k)}};t.contramap=r}if(wue(e)){var i=function(k){return function(E){return e.mapWithIndex(E,k)}};t.mapWithIndex=i}if($ue(e)){var o=function(k){return function(E){return e.ap(E,k)}},a=function(k){return function(E){return e.ap(e.map(E,function(D){return function(){return D}}),k)}};t.ap=o,t.apFirst=a,t.apSecond=function(k){return function(E){return e.ap(e.map(E,function(){return function(D){return D}}),k)}}}if(Eue(e)){var u=function(k){return function(E){return e.chain(E,k)}},s=function(k){return function(E){return e.chain(E,function(D){return e.map(k(D),function(){return D})})}},c=function(k){return e.chain(k,P)};t.chain=u,t.chainFirst=s,t.flatten=c}if(Rue(e)){var l=function(k,E){return function(D){return e.bimap(D,k,E)}},f=function(k){return function(E){return e.mapLeft(E,k)}};t.bimap=l,t.mapLeft=f}if(Oue(e)){var p=function(k){return function(E){return e.extend(E,k)}},A=function(k){return e.extend(k,P)};t.extend=p,t.duplicate=A}if(Fue(e)){var h=function(k,E){return function(D){return e.reduce(D,k,E)}},v=function(k){var E=e.foldMap(k);return function(D){return function(ue){return E(ue,D)}}},_=function(k,E){return function(D){return e.reduceRight(D,k,E)}};t.reduce=h,t.foldMap=v,t.reduceRight=_}if(Mue(e)){var S=function(k,E){return function(D){return e.reduceWithIndex(D,k,E)}},I=function(k){var E=e.foldMapWithIndex(k);return function(D){return function(ue){return E(ue,D)}}},T=function(k,E){return function(D){return e.reduceRightWithIndex(D,k,E)}};t.reduceWithIndex=S,t.foldMapWithIndex=I,t.reduceRightWithIndex=T}if(kue(e)){var g=function(k){return function(E){return e.alt(E,k)}};t.alt=g}if(Lue(e)&&(t.compact=e.compact,t.separate=e.separate),jue(e)){var C=function(k){return function(E){return e.filter(E,k)}},y=function(k){return function(E){return e.filterMap(E,k)}},x=function(k){return function(E){return e.partition(E,k)}},w=function(k){return function(E){return e.partitionMap(E,k)}};t.filter=C,t.filterMap=y,t.partition=x,t.partitionMap=w}if(Uue(e)){var M=function(k){return function(E){return e.filterWithIndex(E,k)}},O=function(k){return function(E){return e.filterMapWithIndex(E,k)}},F=function(k){return function(E){return e.partitionWithIndex(E,k)}},K=function(k){return function(E){return e.partitionMapWithIndex(E,k)}};t.filterWithIndex=M,t.filterMapWithIndex=O,t.partitionWithIndex=F,t.partitionMapWithIndex=K}if(Bue(e)){var N=function(k,E){return function(D){return e.promap(D,k,E)}};t.promap=N}if(Wue(e)){var J=function(k){return function(E){return e.compose(E,k)}};t.compose=J}if(Kue(e)){var Z=function(k){return function(E){return E._tag==="None"?e.throwError(k()):e.of(E.value)}},ae=function(k){return k._tag==="Left"?e.throwError(k.left):e.of(k.right)},ge=function(k,E){return function(D){return k(D)?e.of(D):e.throwError(E(D))}},se=function(k,E){return function(D){return e.chain(D,function(ue){return k(ue)?e.of(ue):e.throwError(E(ue))})}};t.fromOption=Z,t.fromEither=ae,t.fromPredicate=ge,t.filterOrElse=se}return t}var ce=b;const Due=Object.freeze(Object.defineProperty({__proto__:null,pipe:ce,pipeable:Pue},Symbol.toStringTag,{value:"Module"})),Nue=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),que=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var ly=function(){return Math.random()};function CP(e,t){return b(ly,So(function(n){return Math.floor((t-e+1)*n+e)}))}function Que(e,t){return b(ly,So(function(n){return(t-e)*n+e}))}var Vue=b(ly,So(function(e){return e<.5})),zue=function(e){return b(CP(0,e.length-1),So(function(t){return e[t]}))};const Hue=Object.freeze(Object.defineProperty({__proto__:null,random:ly,randomBool:Vue,randomElem:zue,randomInt:CP,randomRange:Que},Symbol.toStringTag,{value:"Module"}));var qT=yf(PI),SP=ec(PI),_P=bf(hn),Yue=Cf(hn),IP=bo,TP=_P,xP=oA(hn),Gue=xP,QT=wf(Ca),Jue=QT,wP=QT,Zue=wP,$P=$f(Ca),Xue=$P,ese=sA(hn),tse=cA,EP=lA,nse=EP,RP=nc(Ca),rse=RP,OP=aA(Ca),ise=OP,ose=uA(Ca),ase=Ef(hn),ui=function(e,t){return b(e,MP(t))},VT=function(e,t,n){return b(e,kP(t,n))},zT=function(e,t){return b(e,LP(t))},Nf=function(e,t){return b(e,HT(t))},EA=function(e,t){return b(e,YT(t))},FP=function(e,t){return b(e,GT(t))},MP=Sf(hn),kP=Tf(hn),LP=xf(hn),HT=_f(ba),use=HT,Io=SP,YT=tc(Ca),jP=YT,UP=jP(P),sse=UP,GT=If(Ca),cse=GT,JT=qT,rn="ReaderEither",BP=function(e){var t=Js(e);return{URI:rn,_E:void 0,compact:go(hn,t),separate:Aa(hn,t,Tu)}};function lse(e){var t=mf(e),n=BP(e),r=ha(hn,t),i=ma(hn,t),o=wu(hn,t),a=$u(hn,t);return{URI:rn,_E:void 0,map:ui,compact:n.compact,separate:n.separate,filter:function(u,s){return b(u,r(s))},filterMap:function(u,s){return b(u,i(s))},partition:function(u,s){return b(u,o(s))},partitionMap:function(u,s){return b(u,a(s))}}}function WP(e){var t=ua(ba,Iu(e));return{URI:rn,_E:void 0,map:ui,ap:function(n,r){return b(n,t(r))},of:Io}}function KP(e){var t=iA(Ca,e);return{URI:rn,_E:void 0,map:ui,alt:function(n,r){return b(n,t(r))}}}var ZT={URI:rn,map:ui},fse=qe(ZT),dse={URI:rn,of:Io},RA={URI:rn,map:ui,ap:Nf},PP=kt(RA),pse=PP,DP=Lt(RA),Ase=DP,NP={URI:rn,map:ui,ap:Nf,of:Io},Ra={URI:rn,map:ui,ap:Nf,chain:EA},hse={URI:rn,map:ui,ap:Nf,of:Io,chain:EA},qP=dt(Ra),mse=qP,gse={URI:rn,bimap:VT,mapLeft:zT},vse={URI:rn,map:ui,alt:FP},qf={URI:rn,fromReader:TP},yse=dA(qf),bse=pA(qf),Cse=oc(qf),QP=AA(qf,Ra),Sse=QP,VP=hA(qf,Ra),_se=VP,Ise={URI:rn,map:ui,ap:Nf,of:Io,chain:EA,throwError:JT},Oa={URI:rn,fromEither:IP},Tse=po(Oa),xse=Ao(Oa),wse=Ks(Oa,Ra),zP=sa(Oa,Ra),$se=zP,HP=ca(Oa,Ra),Ese=HP,Rse=mu(Oa),YP=Ps(Oa,Ra),Ose=YP,Fse=Mr(Oa),Mse=Io(tn),kse=Ut(ZT),GP=Bt(Ra),Lse=GP,JP=jt(RA),jse=JP,ZP=Io(bn),XP=function(e){return z(ic(e),rc(rA(fr)))},XT=function(e){var t=XP(e);return function(n){return vt(n)?t(n):ZP}},Use=XT,eD=function(e){return XT(function(t,n){return e(n)})},Bse=eD(P),Wse={URI:rn,bimap:VT,mapLeft:zT,map:ui,of:Io,ap:Nf,chain:EA,alt:FP,throwError:qT},Kse=nn(RA),Pse=ei(NP),Dse=function(e){return nn(ba)(Xp(e))};function Nse(e){var t=WP(e),n=KP(e);return{URI:rn,_E:void 0,map:ui,ap:t.ap,of:Io,chain:EA,bimap:VT,mapLeft:zT,alt:n.alt,throwError:JT}}const qse=Object.freeze(Object.defineProperty({__proto__:null,Alt:vse,ApT:ZP,Applicative:NP,Apply:RA,Bifunctor:gse,Chain:Ra,Do:Mse,FromEither:Oa,FromReader:qf,Functor:ZT,Monad:hse,MonadThrow:Ise,Pointed:dse,URI:rn,alt:GT,altW:cse,ap:HT,apFirst:PP,apFirstW:pse,apS:JP,apSW:jse,apSecond:DP,apSecondW:Ase,apW:use,ask:yse,asks:bse,asksReaderEither:nse,asksReaderEitherW:EP,bimap:kP,bind:GP,bindTo:kse,bindW:Lse,chain:YT,chainEitherK:zP,chainEitherKW:$se,chainFirst:qP,chainFirstEitherK:HP,chainFirstEitherKW:Ese,chainFirstReaderK:VP,chainFirstReaderKW:_se,chainFirstW:mse,chainOptionK:wse,chainReaderK:QP,chainReaderKW:Sse,chainW:jP,filterOrElse:YP,filterOrElseW:Ose,flap:fse,flatten:sse,flattenW:UP,fold:Jue,foldW:Zue,fromEither:IP,fromEitherK:Fse,fromOption:Tse,fromOptionK:xse,fromPredicate:Rse,fromReader:TP,fromReaderK:Cse,getAltReaderValidation:KP,getApplicativeReaderValidation:WP,getApplyMonoid:Pse,getApplySemigroup:Kse,getCompactable:BP,getFilterable:lse,getOrElse:$P,getOrElseW:Xue,getReaderValidation:Nse,getSemigroup:Dse,left:qT,leftReader:Yue,local:tse,map:MP,mapLeft:LP,match:xP,matchE:QT,matchEW:wP,matchW:Gue,of:Io,orElse:RP,orElseFirst:OP,orElseFirstW:ise,orElseW:rse,orLeft:ose,readerEither:Wse,right:SP,rightReader:_P,sequenceArray:Bse,swap:ase,throwError:JT,toUnion:ese,traverseArray:eD,traverseArrayWithIndex:Use,traverseReadonlyArrayWithIndex:XT,traverseReadonlyNonEmptyArrayWithIndex:XP},Symbol.toStringTag,{value:"Module"}));function ex(e){return function(t){return function(){return e.of(t)}}}function tx(e){return function(t){return function(n){return function(r){return e.map(n(r),t)}}}}function nx(e){return function(t){return function(n){return function(r){return e.ap(n(r),t(r))}}}}function rx(e){return function(t){return function(n){return function(r){return e.chain(n(r),function(i){return t(i)(r)})}}}}function ix(e){return function(t){return z(t,e.of)}}function Qse(e){return function(t){return z(t,e)}}function Vse(e){var t=nx(e),n=tx(e),r=rx(e);return{map:function(i,o){return b(i,n(o))},ap:function(i,o){return b(i,t(o))},of:ex(e),chain:function(i,o){return b(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:ix(e),fromM:function(i){return function(){return i}}}}const zse=Object.freeze(Object.defineProperty({__proto__:null,ap:nx,chain:rx,fromNaturalTransformation:Qse,fromReader:ix,getReaderM:Vse,map:tx,of:ex},Symbol.toStringTag,{value:"Module"}));var Gn=function(e){return function(){return Promise.resolve().then(e)}};function Hse(e){return function(t){return function(){return new Promise(function(n){setTimeout(function(){Promise.resolve().then(t).then(n)},e)})}}}var Ui=function(e,t){return b(e,Fu(t))},fc=function(e,t){return b(e,tD(t))},ox=function(e,t){return b(e,OA(function(n){return b(t,Fu(n))}))},Qf=function(e,t){return b(e,OA(t))},Fu=function(e){return function(t){return function(){return Promise.resolve().then(t).then(e)}}},tD=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)})}}},jn=function(e){return function(){return Promise.resolve(e)}},OA=function(e){return function(t){return function(){return Promise.resolve().then(t).then(function(n){return e(n)()})}}},Yse=OA(P),Jn="Task";function Gse(){return{concat:function(e,t){return function(){return Promise.race([Promise.resolve().then(e),Promise.resolve().then(t)])}},empty:rD}}var We={URI:Jn,map:Ui},Jse=qe(We),_n={URI:Jn,of:jn},dc={URI:Jn,map:Ui,ap:fc},Zse=kt(dc),Xse=Lt(dc),FA={URI:Jn,map:Ui,ap:fc,of:jn},fy={URI:Jn,map:Ui,ap:ox},nD={URI:Jn,map:Ui,ap:ox,of:jn},Vf={URI:Jn,map:Ui,ap:fc,chain:Qf},on={URI:Jn,map:Ui,of:jn,ap:fc,chain:Qf},ece={URI:Jn,map:Ui,of:jn,ap:fc,chain:Qf,fromIO:Gn},MA=P,tce={URI:Jn,map:Ui,of:jn,ap:fc,chain:Qf,fromIO:Gn,fromTask:MA},nce=dt(Vf),dy={URI:Jn,fromIO:Gn},rce=yo(dy),ice=ga(dy,Vf),oce=va(dy,Vf),ace={URI:Jn,fromIO:Gn,fromTask:MA},rD=function(){return new Promise(function(e){})},uce=jn(tn),sce=Ut(We),cce=Bt(Vf),lce=jt(dc),ax=jn(bn),zf=function(e){return function(t){return function(){return Promise.all(t.map(function(n,r){return Promise.resolve().then(function(){return e(r,n)()})}))}}},ux=function(e){var t=zf(e);return function(n){return vt(n)?t(n):ax}},sx=function(e){return function(t){return function(){return Dl(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,Fr(t))).then(Tp))}}},cx=function(e){var t=sx(e);return function(n){return vt(n)?t(n):ax}},fce=ux,iD=function(e){return ux(function(t,n){return e(n)})},dce=iD(P),pce=cx,oD=function(e){return cx(function(t,n){return e(n)})},Ace=oD(P),hce={URI:Jn,map:Ui,of:jn,ap:fc,chain:Qf,fromIO:Gn,fromTask:MA},mce={URI:Jn,map:Ui,of:jn,ap:ox,chain:Qf,fromIO:Gn,fromTask:MA},gce=nn(fy),vce=ei(nD);const yce=Object.freeze(Object.defineProperty({__proto__:null,ApT:ax,ApplicativePar:FA,ApplicativeSeq:nD,ApplyPar:dc,ApplySeq:fy,Chain:Vf,Do:uce,FromIO:dy,FromTask:ace,Functor:We,Monad:on,MonadIO:ece,MonadTask:tce,Pointed:_n,URI:Jn,ap:tD,apFirst:Zse,apS:lce,apSecond:Xse,bind:cce,bindTo:sce,chain:OA,chainFirst:nce,chainFirstIOK:oce,chainIOK:ice,delay:Hse,flap:Jse,flatten:Yse,fromIO:Gn,fromIOK:rce,fromTask:MA,getMonoid:vce,getRaceMonoid:Gse,getSemigroup:gce,map:Fu,never:rD,of:jn,sequenceArray:dce,sequenceSeqArray:Ace,task:hce,taskSeq:mce,traverseArray:iD,traverseArrayWithIndex:fce,traverseReadonlyArrayWithIndex:ux,traverseReadonlyArrayWithIndexSeq:cx,traverseReadonlyNonEmptyArrayWithIndex:zf,traverseReadonlyNonEmptyArrayWithIndexSeq:sx,traverseSeqArray:oD,traverseSeqArrayWithIndex:pce},Symbol.toStringTag,{value:"Module"}));var aD=ix(_n),Hf=bo,pc=z(Gn,Hf),bce=cA,uD=lA,Cce=uD,Bi=function(e,t){return b(e,fx(t))},Ac=function(e,t){return b(e,dx(t))},lx=function(e,t){return b(e,py(function(n){return b(t,fx(n))}))},Yf=function(e,t){return b(e,py(t))},fx=tx(We),dx=nx(dc),Sce=dx,si=ex(_n),py=rx(on),sD=py,cD=sD(P),_ce=cD,Un="ReaderTask",mn={URI:Un,map:Bi},Ice=qe(mn),kA={URI:Un,of:si},LA={URI:Un,map:Bi,ap:Ac},Tce=kt(LA),xce=Lt(LA),wce={URI:Un,map:Bi,ap:Ac,of:si},px={URI:Un,map:Bi,ap:lx},lD={URI:Un,map:Bi,ap:lx,of:si},To={URI:Un,map:Bi,ap:Ac,chain:Yf},Fa={URI:Un,map:Bi,of:si,ap:Ac,chain:Yf},$ce={URI:Un,map:Bi,of:si,ap:Ac,chain:Yf,fromIO:pc},Ece={URI:Un,map:Bi,of:si,ap:Ac,chain:Yf,fromIO:pc,fromTask:Hf},fD=dt(To),Rce=fD,Ay={URI:Un,fromIO:pc},Oce=yo(Ay),Fce=ga(Ay,To),Mce=va(Ay,To),Gf={URI:Un,fromReader:aD},kce=dA(Gf),Lce=pA(Gf),jce=oc(Gf),dD=AA(Gf,To),Uce=dD,pD=hA(Gf,To),Bce=pD,hy={URI:Un,fromIO:pc,fromTask:Hf},Wce=ac(hy),Kce=Rf(hy,To),Pce=Of(hy,To),Dce=si(tn),Nce=Ut(mn),AD=Bt(To),qce=AD,hD=jt(LA),Qce=hD,Ax=si(bn),mD=function(e){return z(ic(e),rc(zf(fr)))},hx=function(e){var t=mD(e);return function(n){return vt(n)?t(n):Ax}},gD=function(e){return z(ic(e),rc(sx(fr)))},mx=function(e){var t=gD(e);return function(n){return vt(n)?t(n):Ax}},Vce=hx,vD=function(e){return hx(function(t,n){return e(n)})},zce=vD(P),Hce=mx,yD=function(e){return mx(function(t,n){return e(n)})},Yce=yD(P),Gce={URI:Un,map:Bi,of:si,ap:Ac,chain:Yf,fromIO:pc,fromTask:Hf},Jce={URI:Un,map:Bi,of:si,ap:lx,chain:Yf,fromIO:pc,fromTask:Hf},Zce=nn(px),Xce=ei(lD);function ele(e,t){return e(t)()}const tle=Object.freeze(Object.defineProperty({__proto__:null,ApT:Ax,ApplicativePar:wce,ApplicativeSeq:lD,ApplyPar:LA,ApplySeq:px,Chain:To,Do:Dce,FromIO:Ay,FromReader:Gf,FromTask:hy,Functor:mn,Monad:Fa,MonadIO:$ce,MonadTask:Ece,Pointed:kA,URI:Un,ap:dx,apFirst:Tce,apS:hD,apSW:Qce,apSecond:xce,apW:Sce,ask:kce,asks:Lce,asksReaderTask:Cce,asksReaderTaskW:uD,bind:AD,bindTo:Nce,bindW:qce,chain:py,chainFirst:fD,chainFirstIOK:Mce,chainFirstReaderK:pD,chainFirstReaderKW:Bce,chainFirstTaskK:Pce,chainFirstW:Rce,chainIOK:Fce,chainReaderK:dD,chainReaderKW:Uce,chainTaskK:Kce,chainW:sD,flap:Ice,flatten:_ce,flattenW:cD,fromIO:pc,fromIOK:Oce,fromReader:aD,fromReaderK:jce,fromTask:Hf,fromTaskK:Wce,getMonoid:Xce,getSemigroup:Zce,local:bce,map:fx,of:si,readerTask:Gce,readerTaskSeq:Jce,run:ele,sequenceArray:zce,sequenceSeqArray:Yce,traverseArray:vD,traverseArrayWithIndex:Vce,traverseReadonlyArrayWithIndex:hx,traverseReadonlyArrayWithIndexSeq:mx,traverseReadonlyNonEmptyArrayWithIndex:mD,traverseReadonlyNonEmptyArrayWithIndexSeq:gD,traverseSeqArray:yD,traverseSeqArrayWithIndex:Hce},Symbol.toStringTag,{value:"Module"}));var nle=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())})},rle=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}}},gx=yf(_n),vx=ec(_n),my=bf(We),yx=Cf(We),bx=z(Gn,my),bD=z(Gn,yx),Mu=bx,Jf=my,Cx=jn,Sx=Gn,CD=function(e){return Fu(sB(e))},SD=oA(We),ile=SD,_x=wf(on),ole=_x,_D=_x,ale=_D,ID=$f(on),ule=ID,TD=function(e,t){return function(){return nle(void 0,void 0,void 0,function(){var n;return rle(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e().then(hu)];case 1:return[2,r.sent()];case 2:return n=r.sent(),[2,Zo(t(n))];case 3:return[2]}})})}},sle=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return TD(function(){return e.apply(void 0,n)},t)}},cle=sA(We),lle=$v(_n),fle=Ev(_n),dle=FI(on),xD=nc(on),ple=xD,gy=aA(on),Ale=gy,hle=function(e){return gy(qD(e))},mle=function(e){return gy(QD(e))},gle=uA(on),vle=Ef(We),wD=function(e){var t=CD(e);return function(n){return z(n,t)}},$D=function(e){return function(t){return function(n){return b(n,jA(wD(e)(t)))}}},yle=$D,ED=function(e){return z(e,Sx)},RD=function(e){return Dd(ED(e))},ble=RD,In=function(e,t){return b(e,xx(t))},ku=function(e,t){return b(e,wx(t))},Ix=function(e,t){return b(e,jA(function(n){return b(t,xx(n))}))},Lu=function(e,t){return b(e,jA(t))},vy=function(e,t,n){return b(e,OD(t,n))},yy=function(e,t){return b(e,FD(t))},Tx=function(e,t){return b(e,$x(t))},xx=Sf(We),OD=Tf(We),FD=xf(We),wx=_f(dc),Cle=wx,jA=tc(on),Dd=jA,MD=Dd(P),Sle=MD,$x=If(on),_le=$x,hr=vx,UA=gx,yt="TaskEither";function Ex(e,t){var n=ua(e,Iu(t));return{URI:yt,_E:void 0,map:In,ap:function(r,i){return b(r,n(i))},of:hr}}function kD(e){var t=iA(on,e);return{URI:yt,_E:void 0,map:In,alt:function(n,r){return b(n,t(r))}}}var LD=function(e){var t=Js(e);return{URI:yt,_E:void 0,compact:go(We,t),separate:Aa(We,t,Tu)}};function Ile(e){var t=mf(e),n=LD(e),r=ha(We,t),i=ma(We,t),o=wu(We,t),a=$u(We,t);return{URI:yt,_E:void 0,map:In,compact:n.compact,separate:n.separate,filter:function(u,s){return b(u,r(s))},filterMap:function(u,s){return b(u,i(s))},partition:function(u,s){return b(u,o(s))},partitionMap:function(u,s){return b(u,a(s))}}}var Rx={URI:yt,map:In},Tle=qe(Rx),xle={URI:yt,of:hr},by={URI:yt,map:In,ap:ku},jD=kt(by),wle=jD,UD=Lt(by),$le=UD,Ele={URI:yt,map:In,ap:ku,of:hr},BD={URI:yt,map:In,ap:Ix},WD={URI:yt,map:In,ap:Ix,of:hr},Wi={URI:yt,map:In,ap:ku,chain:Lu},Rle={URI:yt,map:In,ap:ku,chain:Lu,of:hr},Ole={URI:yt,map:In,ap:ku,chain:Lu,of:hr,fromIO:Mu},Fle={URI:yt,map:In,ap:ku,chain:Lu,of:hr,fromIO:Mu,fromTask:Jf},Mle={URI:yt,map:In,ap:ku,chain:Lu,of:hr,throwError:UA},KD=dt(Wi),kle=KD,Lle={URI:yt,bimap:vy,mapLeft:yy},jle={URI:yt,map:In,alt:Tx},Ma={URI:yt,fromEither:Cx},Ule=po(Ma),Ble=Ao(Ma),Wle=Ks(Ma,Wi),PD=sa(Ma,Wi),Kle=PD,DD=ca(Ma,Wi),Ple=DD,Dle=mu(Ma),ND=Ps(Ma,Wi),Nle=ND,qle=Mr(Ma),Cy={URI:yt,fromIO:Mu},qD=yo(Cy),Qle=ga(Cy,Wi),Vle=va(Cy,Wi),Sy={URI:yt,fromIO:Mu,fromTask:Jf},QD=ac(Sy),zle=Rf(Sy,Wi),Hle=Of(Sy,Wi);function Yle(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(Zo(i)):n(hu(o))};e.apply(null,t.concat(r))})}}}var Gle=function(e,t,n){return Ox(e,t,n)},Ox=function(e,t,n){return b(e,Dd(function(r){return b(t(r),OA(function(i){return b(n(r,i),Dd(function(){return jn(i)}))}))}))},Jle=hr(tn),Zle=Ut(Rx),VD=Bt(Wi),Xle=VD,zD=jt(by),efe=zD,Fx=hr(bn),Mx=function(e){return z(zf(e),Fu(rA(fr)))},kx=function(e){var t=Mx(e);return function(n){return vt(n)?t(n):Fx}},Lx=function(e){return function(t){return function(){return Dl(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.right.push(a.right),o)})})},e(0,Fr(t))().then(Zs(Tp)))}}},jx=function(e){var t=Lx(e);return function(n){return vt(n)?t(n):Fx}},tfe=kx,HD=function(e){return kx(function(t,n){return e(n)})},nfe=HD(P),rfe=jx,YD=function(e){return jx(function(t,n){return e(n)})},ife=YD(P),ofe={URI:yt,bimap:vy,mapLeft:yy,map:In,of:hr,ap:ku,chain:Lu,alt:Tx,fromIO:Mu,fromTask:Jf,throwError:UA},afe={URI:yt,bimap:vy,mapLeft:yy,map:In,of:hr,ap:Ix,chain:Lu,alt:Tx,fromIO:Mu,fromTask:Jf,throwError:UA},ufe=nn(BD),sfe=ei(WD),cfe=function(e){return nn(fy)(Xp(e))};function lfe(e){var t=Ex(FA,e),n=kD(e);return{URI:yt,_E:void 0,map:In,ap:t.ap,of:hr,chain:Lu,bimap:vy,mapLeft:yy,alt:n.alt,fromIO:Mu,fromTask:Jf,throwError:UA}}const ffe=Object.freeze(Object.defineProperty({__proto__:null,Alt:jle,ApT:Fx,ApplicativePar:Ele,ApplicativeSeq:WD,ApplyPar:by,ApplySeq:BD,Bifunctor:Lle,Chain:Wi,Do:Jle,FromEither:Ma,FromIO:Cy,FromTask:Sy,Functor:Rx,Monad:Rle,MonadIO:Ole,MonadTask:Fle,MonadThrow:Mle,Pointed:xle,URI:yt,alt:$x,altW:_le,ap:wx,apFirst:jD,apFirstW:wle,apS:zD,apSW:efe,apSecond:UD,apSecondW:$le,apW:Cle,bimap:OD,bind:VD,bindTo:Zle,bindW:Xle,bracket:Gle,bracketW:Ox,chain:jA,chainEitherK:PD,chainEitherKW:Kle,chainFirst:KD,chainFirstEitherK:DD,chainFirstEitherKW:Ple,chainFirstIOK:Vle,chainFirstTaskK:Hle,chainFirstW:kle,chainIOEitherK:ble,chainIOEitherKW:RD,chainIOK:Qle,chainNullableK:dle,chainOptionK:Wle,chainTaskK:zle,chainTaskOptionK:yle,chainTaskOptionKW:$D,chainW:Dd,filterOrElse:ND,filterOrElseW:Nle,flap:Tle,flatten:Sle,flattenW:MD,fold:ole,foldW:ale,fromEither:Cx,fromEitherK:qle,fromIO:Mu,fromIOEither:Sx,fromIOEitherK:ED,fromIOK:qD,fromNullable:lle,fromNullableK:fle,fromOption:Ule,fromOptionK:Ble,fromPredicate:Dle,fromTask:Jf,fromTaskK:QD,fromTaskOption:CD,fromTaskOptionK:wD,getAltTaskValidation:kD,getApplicativeTaskValidation:Ex,getApplyMonoid:sfe,getApplySemigroup:ufe,getCompactable:LD,getFilterable:Ile,getOrElse:ID,getOrElseW:ule,getSemigroup:cfe,getTaskValidation:lfe,left:gx,leftIO:bD,leftTask:yx,map:xx,mapLeft:FD,match:SD,matchE:_x,matchEW:_D,matchW:ile,of:hr,orElse:xD,orElseFirst:gy,orElseFirstIOK:hle,orElseFirstTaskK:mle,orElseFirstW:Ale,orElseW:ple,orLeft:gle,right:vx,rightIO:bx,rightTask:my,sequenceArray:nfe,sequenceSeqArray:ife,swap:vle,taskEither:ofe,taskEitherSeq:afe,taskify:Yle,throwError:UA,toUnion:cle,traverseArray:HD,traverseArrayWithIndex:tfe,traverseReadonlyArrayWithIndex:kx,traverseReadonlyArrayWithIndexSeq:jx,traverseReadonlyNonEmptyArrayWithIndex:Mx,traverseReadonlyNonEmptyArrayWithIndexSeq:Lx,traverseSeqArray:YD,traverseSeqArrayWithIndex:rfe,tryCatch:TD,tryCatchK:sle},Symbol.toStringTag,{value:"Module"}));var ju=bo,_y=yf(kA),Ux=ec(kA),Bx=z(my,ju),GD=z(yx,ju),Wx=function(e){return z(e,vx)},JD=function(e){return z(e,gx)},ZD=bf(mn),dfe=Cf(mn),Kx=z(bx,ju),XD=z(bD,ju),e3=si,t3=Wx,Uu=Kx,Zf=Bx,Px=z(Sx,ju),Dx=function(e){return z(e,Cx)},n3=oA(mn),pfe=n3,Nx=wf(To),Afe=Nx,r3=Nx,hfe=r3,i3=$f(Fa),mfe=i3,gfe=sA(mn),vfe=$v(kA),yfe=Ev(kA),bfe=FI(Fa),Cfe=cA,o3=lA,Sfe=o3,a3=nc(Fa),_fe=a3,u3=aA(Fa),Ife=u3,Tfe=uA(Fa),xfe=Ef(mn),s3=function(e){return z(e,Px)},c3=function(e){return Xf(s3(e))},wfe=c3,qx=function(e){return z(e,ju)},l3=function(e){return Xf(qx(e))},$fe=l3,f3=function(e){return Ey(qx(e))},Efe=f3,Qx=function(e){return z(e,Dx)},d3=function(e){return Xf(Qx(e))},Rfe=d3,p3=function(e){return Ey(Qx(e))},Ofe=p3,Tn=function(e,t){return b(e,BA(t))},Bu=function(e,t){return b(e,Gx(t))},Vx=function(e,t){return b(e,xy(function(n){return b(t,BA(n))}))},Wu=function(e,t){return b(e,xy(t))},zx=function(e,t){return b(e,wy(t))},Iy=function(e,t,n){return b(e,Hx(t,n))},Ty=function(e,t){return b(e,Yx(t))},BA=Sf(mn),Hx=Tf(mn),Yx=xf(mn),Gx=_f(LA),Ffe=Gx,mr=Ux,xy=tc(Fa),Xf=xy,A3=Xf(P),Mfe=A3,wy=If(Fa),h3=wy,WA=_y,ht="ReaderTaskEither",m3=function(e){var t=Js(e);return{URI:ht,_E:void 0,compact:go(mn,t),separate:Aa(mn,t,Tu)}};function kfe(e){var t=mf(e),n=m3(e),r=ha(mn,t),i=ma(mn,t),o=wu(mn,t),a=$u(mn,t);return{URI:ht,_E:void 0,map:Tn,compact:n.compact,separate:n.separate,filter:function(u,s){return b(u,r(s))},filterMap:function(u,s){return b(u,i(s))},partition:function(u,s){return b(u,o(s))},partitionMap:function(u,s){return b(u,a(s))}}}function g3(e,t){var n=ua(ba,Ex(e,t));return{URI:ht,_E:void 0,map:Tn,ap:function(r,i){return b(r,n(i))},of:mr}}function v3(e){var t=iA(Fa,e);return{URI:ht,_E:void 0,map:Tn,alt:function(n,r){return b(n,t(r))}}}var hc={URI:ht,map:Tn},Lfe=qe(hc),Jx={URI:ht,of:mr},$y={URI:ht,map:Tn,ap:Bu},y3=kt($y),jfe=y3,b3=Lt($y),Ufe=b3,Bfe={URI:ht,map:Tn,ap:Bu,of:mr},C3={URI:ht,map:Tn,ap:Vx},S3={URI:ht,map:Tn,ap:Vx,of:mr},Zn={URI:ht,map:Tn,ap:Bu,chain:Wu},Wfe={URI:ht,map:Tn,ap:Bu,chain:Wu,of:mr},Kfe={URI:ht,map:Tn,ap:Bu,chain:Wu,of:mr,fromIO:Uu},Pfe={URI:ht,map:Tn,ap:Bu,chain:Wu,of:mr,fromIO:Uu,fromTask:Zf},Dfe={URI:ht,map:Tn,ap:Bu,chain:Wu,of:mr,throwError:WA},_3=dt(Zn),Ey=_3,Nfe={URI:ht,bimap:Iy,mapLeft:Ty},qfe={URI:ht,map:Tn,alt:zx},ed={URI:ht,fromReader:t3},Qfe=dA(ed),Vfe=pA(ed),zfe=oc(ed),I3=AA(ed,Zn),Hfe=I3,T3=hA(ed,Zn),Yfe=T3,Zx=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return ZD(e.apply(void 0,t))}},x3=function(e){return Xf(Zx(e))},Gfe=x3,w3=function(e){return Ey(Zx(e))},Jfe=w3,ka={URI:ht,fromEither:e3},Zfe=po(ka),Xfe=Ao(ka),ede=Ks(ka,Zn),$3=sa(ka,Zn),tde=$3,E3=ca(ka,Zn),nde=E3,rde=mu(ka),R3=Ps(ka,Zn),ide=R3,ode=Mr(ka),Ry={URI:ht,fromIO:Uu},ade=yo(Ry),ude=ga(Ry,Zn),sde=va(Ry,Zn),Oy={URI:ht,fromIO:Uu,fromTask:Zf},cde=ac(Oy),lde=Rf(Oy,Zn),fde=Of(Oy,Zn);function dde(e,t,n){return O3(e,t,n)}function O3(e,t,n){return function(r){return Ox(e(r),function(i){return t(i)(r)},function(i,o){return n(i,o)(r)})}}var pde=mr(tn),Ade=Ut(hc),F3=Bt(Zn),hde=F3,M3=jt($y),mde=M3,Xx=mr(bn),k3=function(e){return z(ic(e),rc(Mx(fr)))},ew=function(e){var t=k3(e);return function(n){return vt(n)?t(n):Xx}},L3=function(e){return z(ic(e),rc(Lx(fr)))},tw=function(e){var t=L3(e);return function(n){return vt(n)?t(n):Xx}},gde=ew,j3=function(e){return ew(function(t,n){return e(n)})},vde=j3(P),yde=tw,U3=function(e){return tw(function(t,n){return e(n)})},bde=U3(P),Cde={URI:ht,map:Tn,of:mr,ap:Bu,chain:Wu,alt:zx,bimap:Iy,mapLeft:Ty,fromIO:Uu,fromTask:Zf,throwError:WA},Sde={URI:ht,map:Tn,of:mr,ap:Vx,chain:Wu,alt:zx,bimap:Iy,mapLeft:Ty,fromIO:Uu,fromTask:Zf,throwError:WA},_de=nn(C3),Ide=ei(S3),Tde=function(e){return nn(px)(Xp(e))};function xde(e){var t=g3(FA,e),n=v3(e);return{URI:ht,_E:void 0,map:Tn,of:mr,chain:Wu,bimap:Iy,mapLeft:Ty,ap:t.ap,alt:n.alt,fromIO:Uu,fromTask:Zf,throwError:WA}}function wde(e,t){return e(t)()}const $de=Object.freeze(Object.defineProperty({__proto__:null,Alt:qfe,ApT:Xx,ApplicativePar:Bfe,ApplicativeSeq:S3,ApplyPar:$y,ApplySeq:C3,Bifunctor:Nfe,Chain:Zn,Do:pde,FromEither:ka,FromIO:Ry,FromReader:ed,FromTask:Oy,Functor:hc,Monad:Wfe,MonadIO:Kfe,MonadTask:Pfe,MonadThrow:Dfe,Pointed:Jx,URI:ht,alt:wy,altW:h3,ap:Gx,apFirst:y3,apFirstW:jfe,apS:M3,apSW:mde,apSecond:b3,apSecondW:Ufe,apW:Ffe,ask:Qfe,asks:Vfe,asksReaderTaskEither:Sfe,asksReaderTaskEitherW:o3,bimap:Hx,bind:F3,bindTo:Ade,bindW:hde,bracket:dde,bracketW:O3,chain:xy,chainEitherK:$3,chainEitherKW:tde,chainFirst:_3,chainFirstEitherK:E3,chainFirstEitherKW:nde,chainFirstIOK:sde,chainFirstReaderEitherK:Ofe,chainFirstReaderEitherKW:p3,chainFirstReaderK:T3,chainFirstReaderKW:Yfe,chainFirstReaderTaskK:Jfe,chainFirstReaderTaskKW:w3,chainFirstTaskEitherK:Efe,chainFirstTaskEitherKW:f3,chainFirstTaskK:fde,chainFirstW:Ey,chainIOEitherK:wfe,chainIOEitherKW:c3,chainIOK:ude,chainNullableK:bfe,chainOptionK:ede,chainReaderEitherK:Rfe,chainReaderEitherKW:d3,chainReaderK:I3,chainReaderKW:Hfe,chainReaderTaskK:Gfe,chainReaderTaskKW:x3,chainTaskEitherK:$fe,chainTaskEitherKW:l3,chainTaskK:lde,chainW:Xf,filterOrElse:R3,filterOrElseW:ide,flap:Lfe,flatten:Mfe,flattenW:A3,fold:Afe,foldW:hfe,fromEither:e3,fromEitherK:ode,fromIO:Uu,fromIOEither:Px,fromIOEitherK:s3,fromIOK:ade,fromNullable:vfe,fromNullableK:yfe,fromOption:Zfe,fromOptionK:Xfe,fromPredicate:rde,fromReader:t3,fromReaderEither:Dx,fromReaderEitherK:Qx,fromReaderK:zfe,fromReaderTaskK:Zx,fromTask:Zf,fromTaskEither:ju,fromTaskEitherK:qx,fromTaskK:cde,getAltReaderTaskValidation:v3,getApplicativeReaderTaskValidation:g3,getApplyMonoid:Ide,getApplySemigroup:_de,getCompactable:m3,getFilterable:kfe,getOrElse:i3,getOrElseW:mfe,getReaderTaskValidation:xde,getSemigroup:Tde,left:_y,leftIO:XD,leftReader:JD,leftReaderTask:dfe,leftTask:GD,local:Cfe,map:BA,mapLeft:Yx,match:n3,matchE:Nx,matchEW:r3,matchW:pfe,of:mr,orElse:a3,orElseFirst:u3,orElseFirstW:Ife,orElseW:_fe,orLeft:Tfe,readerTaskEither:Cde,readerTaskEitherSeq:Sde,right:Ux,rightIO:Kx,rightReader:Wx,rightReaderTask:ZD,rightTask:Bx,run:wde,sequenceArray:vde,sequenceSeqArray:bde,swap:xfe,throwError:WA,toUnion:gfe,traverseArray:j3,traverseArrayWithIndex:gde,traverseReadonlyArrayWithIndex:ew,traverseReadonlyArrayWithIndexSeq:tw,traverseReadonlyNonEmptyArrayWithIndex:k3,traverseReadonlyNonEmptyArrayWithIndexSeq:L3,traverseSeqArray:U3,traverseSeqArrayWithIndex:yde},Symbol.toStringTag,{value:"Module"}));var B3={equals:function(e,t){return e===t}},W3={concat:function(e,t){return e+t}},K3="",Ede={concat:W3.concat,empty:K3},V={equals:B3.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},Rde={show:function(e){return JSON.stringify(e)}},Ode=function(e){return typeof e=="string"},Fde=function(e){return e.toUpperCase()},Mde=function(e){return e.toLowerCase()},kde=function(e,t){return function(n){return n.replace(e,t)}},Lde=function(e){return e.trim()},jde=function(e){return e.trimLeft()},Ude=function(e){return e.trimRight()},Bde=function(e,t){return function(n){return n.slice(e,t)}},Wde=function(e){return e.length===0},Kde=function(e){return e.length},Pde=function(e){return function(t){var n=t.split(e);return ho(n)?n:[t]}},Dde=function(e,t){return function(n){return n.includes(e,t)}},Nde=function(e,t){return function(n){return n.startsWith(e,t)}},qde=function(e,t){return function(n){return n.endsWith(e,t)}};const Qde=Object.freeze(Object.defineProperty({__proto__:null,Eq:B3,Monoid:Ede,Ord:V,Semigroup:W3,Show:Rde,empty:K3,endsWith:qde,includes:Dde,isEmpty:Wde,isString:Ode,replace:kde,size:Kde,slice:Bde,split:Pde,startsWith:Nde,toLowerCase:Mde,toUpperCase:Fde,trim:Lde,trimLeft:jde,trimRight:Ude},Symbol.toStringTag,{value:"Module"}));var Vde=function(e){return Object.assign({},e)},zde=function(e){return Object.assign({},e)},P3=function(e){return Object.keys(e).length},uo=function(e){for(var t in e)if(ft.call(e,t))return!1;return!0},td=function(e){return function(t){return Object.keys(t).sort(e.compare)}},Hde=td(V);function Fy(e){if(typeof e=="function")return Fy(V)(e);var t=td(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 nw=Fy(V)(function(e,t){return[e,t]});function Yde(e){return function(t){var n=nw(t),r=n.length;return e.unfold(0,function(i){return i<r?fe([n[i],i+1]):ye})}}var rw=function(e,t){return function(n){if(ft.call(n,e)&&n[e]===t)return n;var r=Object.assign({},n);return r[e]=t,r}},ea=function(e,t){return ft.call(t,e)};function iw(e){return function(t){if(!ft.call(t,e))return t;var n=Object.assign({},t);return delete n[e],n}}var Gde=function(e,t){return function(n){if(!ea(e,n))return ye;if(n[e]===t)return fe(n);var r=Object.assign({},n);return r[e]=t,fe(r)}},Jde=function(e,t){return function(n){if(!ea(e,n))return ye;var r=t(n[e]);if(r===n[e])return fe(n);var i=Object.assign({},n);return i[e]=r,fe(i)}};function Zde(e){var t=iw(e);return function(n){var r=Cs(e,n);return Nt(r)?ye:fe([r.value,t(n)])}}function My(e){return function(t,n){if(n===void 0){var r=My(e);return function(o){return r(o,t)}}for(var i in t)if(!ft.call(n,i)||!e.equals(t[i],n[i]))return!1;return!0}}function Cs(e,t){return t===void 0?function(n){return Cs(e,n)}:ft.call(t,e)?fe(t[e]):ye}var KA={};function ky(e){return function(t){var n={};for(var r in t)ft.call(t,r)&&(n[r]=e(r,t[r]));return n}}function ow(e){return ky(function(t,n){return e(n)})}function bl(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===2)return bl(V).apply(void 0,e);var n=td(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 Cl(e){if("compare"in e){var t=td(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 Cl(V)(e)}function Sl(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===2)return Sl(V).apply(void 0,e);var n=td(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 D3=function(e,t){var n;return n={},n[e]=t,n};function N3(e){var t=DA(V)(e);return function(n){return function(r){return t(r,n)}}}function Ly(e){var t=xo(V)(e);return function(n){return function(r){return t(r,n)}}}function nd(e){return PA(V)(e)}var Xde=function(e){var t=Ly(e);return function(n){return function(r){return e.map(b(r,t(n)),La)}}},epe=function(e){var t=Ly(e);return function(n){return function(r){return e.map(b(r,t(n)),ja)}}};function jy(e){return function(t){var n={},r={};for(var i in t)if(ft.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 Re(n,r)}}function Uy(e){return function(t){var n={},r={};for(var i in t)if(ft.call(t,i)){var o=t[i];e(i,o)?r[i]=o:n[i]=o}return Re(n,r)}}function By(e){return function(t){var n={};for(var r in t)if(ft.call(t,r)){var i=e(r,t[r]);_t(i)&&(n[r]=i.value)}return n}}function Wy(e){return function(t){var n={},r=!1;for(var i in t)if(ft.call(t,i)){var o=t[i];e(i,o)?n[i]=o:r=!0}return r?n:t}}function q3(e,t){var n=aw(e,t);return function(r){return n(r,P)}}function aw(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]=ft.call(i,u)?e.concat(i[u],s):s,i})}}var tpe=nw,npe=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 Q3(e){return function(t){for(var n in t)if(!e(t[n]))return!1;return!0}}function V3(e){return function(t){for(var n in t)if(e(t[n]))return!0;return!1}}function uw(e){return function(t,n){if(n===void 0){var r=uw(e);return function(o){return r(t,o)}}for(var i in n)if(e.equals(n[i],t))return!0;return!1}}var sw=function(e){return function(t){return function(n){if(uo(n))return t;if(uo(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}}},cw=function(e){return function(t){return function(n){if(uo(n)||uo(t))return KA;var r={};for(var i in n)ea(i,t)&&(r[i]=e.concat(n[i],t[i]));return r}}},lw=function(e){return function(t){if(uo(t))return e;if(uo(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}},jr=function(e,t){return b(e,ow(t))},mc=function(e,t){return b(e,ky(t))},Ur=function(e){var t=Nd(e);return function(n,r,i){return b(n,t(r,i))}},Br=function(e){return function(t){var n=qd(e)(t);return function(r,i){return b(r,n(i))}}},Wr=function(e){var t=Qd(e);return function(n,r,i){return b(n,t(r,i))}},gc=function(e,t){return b(e,fw(t))},vc=function(e,t){return b(e,dw(t))},yc=function(e,t){return b(e,pw(t))},bc=function(e,t){return b(e,Aw(t))},Cc=function(e){var t=bl(e);return function(n,r,i){return b(n,t(r,i))}},Sc=function(e){var t=Cl(e);return function(n){var r=t(n);return function(i,o){return b(i,r(o))}}},_c=function(e){var t=Sl(e);return function(n,r,i){return b(n,t(r,i))}},Ky=function(e,t){return b(e,jy(t))},Py=function(e,t){return b(e,Uy(t))},Dy=function(e,t){return b(e,By(t))},Ny=function(e,t){return b(e,Wy(t))},xo=function(e){var t=DA(e);return function(n){var r=t(n);return function(i,o){return r(i,z(fr,o))}}},PA=function(e){var t=xo(e);return function(n){var r=t(n);return function(i){return r(i,P)}}},DA=function(e){return function(t){var n=td(e);return function(r,i){var o=n(r);if(o.length===0)return t.of(KA);for(var a=t.of({}),u=function(f){a=t.ap(t.map(a,function(p){return function(A){var h;return Object.assign({},p,(h={},h[f]=A,h))}}),i(f,r[f]))},s=0,c=o;s<c.length;s++){var l=c[s];u(l)}return a}}},fw=function(e){return Wy(function(t,n){return e(n)})},dw=function(e){return By(function(t,n){return e(n)})},pw=function(e){return Uy(function(t,n){return e(n)})},Aw=function(e){return jy(function(t,n){return e(n)})};function Nd(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===1){var n=bl(e[0]);return function(r,i){return n(r,function(o,a,u){return i(a,u)})}}return Nd(V).apply(void 0,e)}function qd(e){if("compare"in e){var t=Cl(e);return function(n){var r=t(n);return function(i){return r(function(o,a){return i(a)})}}}return qd(V)(e)}function Qd(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===1){var n=Sl(e[0]);return function(r,i){return n(r,function(o,a,u){return i(a,u)})}}return Qd(V).apply(void 0,e)}var La=function(e){var t={};for(var n in e)if(ft.call(e,n)){var r=e[n];_t(r)&&(t[n]=r.value)}return t},ja=function(e){var t={},n={};for(var r in e)if(ft.call(e,r)){var i=e[r];Xt(i)?t[r]=i.left:n[r]=i.right}return Re(t,n)},xn="ReadonlyRecord";function mm(e){return"compare"in e?function(t){return{show:function(n){var r=Fy(e)(function(i,o){return"".concat(JSON.stringify(i),": ").concat(t.show(o))})(n).join(", ");return r===""?"{}":"{ ".concat(r," }")}}}:mm(V)(e)}function z3(e){var t=My(e);return ti(function(n,r){return t(n)(r)&&t(r)(n)})}function H3(e){return{concat:function(t,n){if(uo(t))return n;if(uo(n))return t;var r=Object.assign({},t);for(var i in n)ft.call(n,i)&&(r[i]=ft.call(t,i)?e.concat(t[i],n[i]):n[i]);return r},empty:KA}}var Y3={URI:xn,map:jr},rpe=qe(Y3),ipe={URI:xn,map:jr,mapWithIndex:mc},ope=function(e){return{URI:xn,reduce:Ur(e),foldMap:Br(e),reduceRight:Wr(e)}},ape=function(e){return{URI:xn,reduce:Ur(e),foldMap:Br(e),reduceRight:Wr(e),reduceWithIndex:Cc(e),foldMapWithIndex:Sc(e),reduceRightWithIndex:_c(e)}},Vd={URI:xn,compact:La,separate:ja},upe={URI:xn,map:jr,compact:La,separate:ja,filter:gc,filterMap:vc,partition:yc,partitionMap:bc},spe={URI:xn,map:jr,mapWithIndex:mc,compact:La,separate:ja,filter:gc,filterMap:vc,partition:yc,partitionMap:bc,filterMapWithIndex:Dy,filterWithIndex:Ny,partitionMapWithIndex:Ky,partitionWithIndex:Py},G3=function(e){return{URI:xn,map:jr,reduce:Ur(e),foldMap:Br(e),reduceRight:Wr(e),traverse:xo(e),sequence:PA(e)}},cpe=function(e){return{URI:xn,map:jr,mapWithIndex:mc,reduce:Ur(e),foldMap:Br(e),reduceRight:Wr(e),reduceWithIndex:Cc(e),foldMapWithIndex:Sc(e),reduceRightWithIndex:_c(e),traverse:xo(e),sequence:PA(e),traverseWithIndex:DA(e)}},lpe=function(e){var t=G3(e);return{URI:xn,map:jr,reduce:Ur(e),foldMap:Br(e),reduceRight:Wr(e),traverse:t.traverse,sequence:t.sequence,compact:La,separate:ja,filter:gc,filterMap:vc,partition:yc,partitionMap:bc,wither:ki(t,Vd),wilt:Mi(t,Vd)}},J3=function(e){var t=sw(e);return{concat:function(n,r){return t(r)(n)}}},fpe=function(e){return{concat:J3(e).concat,empty:KA}},dpe=function(e){var t=cw(e);return{concat:function(n,r){return t(r)(n)}}},ppe=function(){return{concat:function(e,t){return lw(t)(e)}}},Ape={URI:xn,reduce:Ur(V),foldMap:Br(V),reduceRight:Wr(V)},hpe={URI:xn,reduce:Ur(V),foldMap:Br(V),reduceRight:Wr(V),reduceWithIndex:Cc(V),foldMapWithIndex:Sc(V),reduceRightWithIndex:_c(V)},hw={URI:xn,map:jr,reduce:Ur(V),foldMap:Br(V),reduceRight:Wr(V),traverse:xo(V),sequence:nd},mpe={URI:xn,map:jr,mapWithIndex:mc,reduce:Ur(V),foldMap:Br(V),reduceRight:Wr(V),reduceWithIndex:Cc(V),foldMapWithIndex:Sc(V),reduceRightWithIndex:_c(V),traverse:xo(V),sequence:nd,traverseWithIndex:DA(V)},Z3=ki(hw,Vd),X3=Mi(hw,Vd),gpe={URI:xn,map:jr,reduce:Ur(V),foldMap:Br(V),reduceRight:Wr(V),traverse:xo(V),sequence:nd,compact:La,separate:ja,filter:gc,filterMap:vc,partition:yc,partitionMap:bc,wither:Z3,wilt:X3},mw=rw;function e6(e,t){return ft.call(t===void 0?this:t,e)}var vpe={URI:xn,map:jr,reduce:Ur(V),foldMap:Br(V),reduceRight:Wr(V),traverse:xo(V),sequence:nd,compact:La,separate:ja,filter:gc,filterMap:vc,partition:yc,partitionMap:bc,mapWithIndex:mc,reduceWithIndex:Cc(V),foldMapWithIndex:Sc(V),reduceRightWithIndex:_c(V),filterMapWithIndex:Dy,filterWithIndex:Ny,partitionMapWithIndex:Ky,partitionWithIndex:Py,traverseWithIndex:DA(V),wither:Z3,wilt:X3};const ype=Object.freeze(Object.defineProperty({__proto__:null,Compactable:Vd,Filterable:upe,FilterableWithIndex:spe,Foldable:Ape,FoldableWithIndex:hpe,Functor:Y3,FunctorWithIndex:ipe,Traversable:hw,TraversableWithIndex:mpe,URI:xn,Witherable:gpe,_filter:gc,_filterMap:vc,_filterMapWithIndex:Dy,_filterWithIndex:Ny,_foldMap:Br,_foldMapWithIndex:Sc,_map:jr,_mapWithIndex:mc,_partition:yc,_partitionMap:bc,_partitionMapWithIndex:Ky,_partitionWithIndex:Py,_reduce:Ur,_reduceRight:Wr,_reduceRightWithIndex:_c,_reduceWithIndex:Cc,_sequence:PA,_traverse:xo,collect:Fy,compact:La,deleteAt:iw,difference:lw,elem:uw,empty:KA,every:Q3,filter:fw,filterMap:dw,filterMapWithIndex:By,filterWithIndex:Wy,flap:rpe,foldMap:qd,foldMapWithIndex:Cl,fromEntries:npe,fromFoldable:q3,fromFoldableMap:aw,fromRecord:Vde,getDifferenceMagma:ppe,getEq:z3,getFoldable:ope,getFoldableWithIndex:ape,getIntersectionSemigroup:dpe,getMonoid:H3,getShow:mm,getTraversable:G3,getTraversableWithIndex:cpe,getUnionMonoid:fpe,getUnionSemigroup:J3,getWitherable:lpe,has:ea,hasOwnProperty:e6,insertAt:mw,intersection:cw,isEmpty:uo,isSubrecord:My,keys:Hde,lookup:Cs,map:ow,mapWithIndex:ky,modifyAt:Jde,partition:pw,partitionMap:Aw,partitionMapWithIndex:jy,partitionWithIndex:Uy,pop:Zde,readonlyRecord:vpe,reduce:Nd,reduceRight:Qd,reduceRightWithIndex:Sl,reduceWithIndex:bl,separate:ja,sequence:nd,singleton:D3,size:P3,some:V3,toEntries:tpe,toReadonlyArray:nw,toRecord:zde,toUnfoldable:Yde,traverse:Ly,traverseWithIndex:N3,union:sw,updateAt:Gde,upsertAt:rw,wilt:epe,wither:Xde},Symbol.toStringTag,{value:"Module"}));var bpe=function(e){return new Set(e)},Cpe=function(e){return new Set([e])},t6=function(e){return function(t){for(var n=t.length,r=new Set,i=vn(e),o=0;o<n;o++){var a=t[o];i(a,r)||r.add(a)}return r}};function Spe(e){return new Set(e)}function _pe(e){var t=vn(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 Ipe(e){var t=vn(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 gw(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 Tpe(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 Re(o,i)}}function vw(e){var t=vn(e);return function(n,r){if(r===void 0){var i=vw(e);return function(a){return i(n,a)}}if(zd(n))return r;if(zd(r))return n;var o=new Set(n);return r.forEach(function(a){t(a,o)||o.add(a)}),o}}function yw(e){var t=vn(e);return function(n,r){if(r===void 0){var i=yw(e);return function(a){return i(a,n)}}if(zd(n)||zd(r))return Cw;var o=new Set;return n.forEach(function(a){t(a,r)&&o.add(a)}),o}}function xpe(e,t){return function(n){return function(r){for(var i=r.values(),o,a=new Set,u=new Set,s=vn(e),c=vn(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 Re(a,u)}}}function bw(e){var t=vn(e);return function(n,r){if(r===void 0){var i=bw(e);return function(o){return i(o,n)}}return gw(function(o){return!t(o,r)})(n)}}function n6(e){var t=qy(e);return function(n,r){return function(i){return t(i).reduce(r,n)}}}function r6(e,t){var n=qy(e);return function(r){return function(i){return n(i).reduce(function(o,a){return t.concat(o,r(a))},t.empty)}}}var i6=function(e){var t=qy(e);return function(n,r){return function(i){return t(i).reduceRight(function(o,a){return r(a,o)},n)}}};function o6(e){var t=vn(e);return function(n){return function(r){if(t(n)(r))return r;var i=new Set(r);return i.add(n),i}}}var a6=function(e){return function(t){return function(n){return gw(function(r){return!e.equals(t,r)})(n)}}},wpe=function(e){var t=vn(e),n=a6(e),r=o6(e);return function(i){return function(o){return(t(i,o)?n:r)(i)(o)}}},$pe=function(e){return u6(e)(P)};function Epe(e,t){return function(n){var r=vn(e),i=vn(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}}),Re(o,a)}}function u6(e){var t=vn(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 Cw=new Set,zd=function(e){return e.size===0},Rpe=function(e){return e.size},Sw=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 _w(e){return Kd(Sw(Kd(e)))}function NA(e){var t=vn(e);return function(n,r){if(r===void 0){var i=NA(e);return function(o){return i(o,n)}}return _w(function(o){return t(o,r)})(n)}}function vn(e){return function(t,n){if(n===void 0){var r=vn(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 qy=function(e){return function(t){var n=[];return t.forEach(function(r){return n.push(r)}),n.sort(e.compare)}},Ope="ReadonlySet";function s6(e){return{show:function(t){var n=[];return t.forEach(function(r){n.push(e.show(r))}),"new Set([".concat(n.sort().join(", "),"])")}}}function c6(e){var t=NA(e);return ti(function(n,r){return t(n,r)&&t(r,n)})}var l6=function(e){return{concat:vw(e)}},Fpe=function(e){return{concat:l6(e).concat,empty:Cw}},Mpe=function(e){return{concat:yw(e)}},kpe=function(e){return{concat:bw(e)}},Lpe=t6;const jpe=Object.freeze(Object.defineProperty({__proto__:null,URI:Ope,chain:Ipe,compact:$pe,difference:bw,elem:vn,empty:Cw,every:_w,filter:gw,filterMap:u6,foldMap:r6,fromArray:Lpe,fromReadonlyArray:t6,fromSet:bpe,getDifferenceMagma:kpe,getEq:c6,getIntersectionSemigroup:Mpe,getShow:s6,getUnionMonoid:Fpe,getUnionSemigroup:l6,insert:o6,intersection:yw,isEmpty:zd,isSubset:NA,map:_pe,partition:Tpe,partitionMap:xpe,reduce:n6,reduceRight:i6,remove:a6,separate:Epe,singleton:Cpe,size:Rpe,some:Sw,toReadonlyArray:qy,toSet:Spe,toggle:wpe,union:vw},Symbol.toStringTag,{value:"Module"}));function en(e){return e[0]}function Fn(e){return e[1]}var Upe=function(e){return[Fn(e),en(e)]};function Iw(e){return{URI:Kr,_E:void 0,map:qA,ap:function(t,n){return[en(t)(en(n)),e.concat(Fn(t),Fn(n))]}}}var f6=function(e){return function(t){return[t,e.empty]}};function Bpe(e){var t=Iw(e);return{URI:Kr,_E:void 0,map:t.map,ap:t.ap,of:f6(e)}}function Tw(e){var t=Iw(e);return{URI:Kr,_E:void 0,map:t.map,ap:t.ap,chain:function(n,r){var i=r(en(n)),o=i[0],a=i[1];return[o,e.concat(Fn(n),a)]}}}function Wpe(e){var t=Tw(e);return{URI:Kr,_E:void 0,map:t.map,ap:t.ap,chain:t.chain,of:f6(e)}}function Kpe(e){var t=function(r,i){for(var o=i(r),a=e.empty,u=en(o);u._tag==="Left";)a=e.concat(a,Fn(o)),o=i(u.left),u=en(o);return[u.right,e.concat(a,Fn(o))]},n=Tw(e);return{URI:Kr,_E:void 0,map:n.map,ap:n.ap,chain:n.chain,chainRec:t}}var d6=function(e,t){return b(e,v6(t))},qA=function(e,t){return b(e,Ew(t))},p6=function(e,t,n){return b(e,g6(t,n))},A6=function(e,t){return b(e,Rw(t))},h6=function(e,t){return b(e,Ow(t))},xw=function(e,t,n){return b(e,Fw(t,n))},ww=function(e){var t=Mw();return function(n,r){return b(n,t(r))}},$w=function(e,t,n){return b(e,kw(t,n))},m6=function(e){var t=y6(e);return function(n,r){return b(n,t(r))}},g6=function(e,t){return function(n){return[t(en(n)),e(Fn(n))]}},Ew=function(e){return function(t){return[e(en(t)),Fn(t)]}},Rw=function(e){return function(t){return[en(t),e(Fn(t))]}},v6=function(e){return function(t){return[en(t),Fn(e)]}},Ow=function(e){return function(t){return[e(t),Fn(t)]}},Qy=en,Ppe=Ow(P),Fw=function(e,t){return function(n){return t(e,en(n))}},Mw=function(){return function(e){return function(t){return e(en(t))}}},kw=function(e,t){return function(n){return t(en(n),e)}},y6=function(e){return function(t){return function(n){return e.map(t(en(n)),function(r){return[r,Fn(n)]})}}},Lw=function(e){return function(t){return e.map(en(t),function(n){return[n,Fn(t)]})}},Kr="ReadonlyTuple",b6={URI:Kr,map:qA},Dpe=qe(b6),Npe={URI:Kr,bimap:p6,mapLeft:A6},qpe={URI:Kr,compose:d6},Qpe={URI:Kr,map:qA,extend:h6,extract:Qy},Vpe={URI:Kr,reduce:xw,foldMap:ww,reduceRight:$w},zpe={URI:Kr,map:qA,reduce:xw,foldMap:ww,reduceRight:$w,traverse:m6,sequence:Lw},Hpe=Ew,Ype=Rw,Gpe={URI:Kr,compose:d6,map:qA,bimap:p6,mapLeft:A6,extract:Qy,extend:h6,reduce:xw,foldMap:ww,reduceRight:$w,traverse:m6,sequence:Lw};const Jpe=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:Npe,Comonad:Qpe,Foldable:Vpe,Functor:b6,Semigroupoid:qpe,Traversable:zpe,URI:Kr,bimap:g6,compose:v6,duplicate:Ppe,extend:Ow,extract:Qy,flap:Dpe,foldMap:Mw,fst:en,getApplicative:Bpe,getApply:Iw,getChain:Tw,getChainRec:Kpe,getMonad:Wpe,map:Hpe,mapFst:Ew,mapLeft:Ype,mapSnd:Rw,readonlyTuple:Gpe,reduce:Fw,reduceRight:kw,sequence:Lw,snd:Fn,swap:Upe,traverse:y6},Symbol.toStringTag,{value:"Module"}));var _l=function(){return _l=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},_l.apply(this,arguments)},Zpe=P3,Ss=uo,jw=function(e){return function(t){return Object.keys(t).sort(e.compare)}},Xpe=jw(V);function Uw(e){if(typeof e=="function")return Uw(V)(e);var t=jw(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 Bw=Uw(V)(function(e,t){return[e,t]});function eAe(e){return function(t){var n=Bw(t),r=n.length;return e.unfold(0,function(i){return i<r?fe([n[i],i+1]):ye})}}var C6=rw,S6=ea;function _6(e){return function(t){if(!ft.call(t,e))return t;var n=Object.assign({},t);return delete n[e],n}}var tAe=function(e,t){return I6(e,function(){return t})},I6=function(e,t){return function(n){if(!S6(e,n))return ye;var r=Object.assign({},n);return r[e]=t(n[e]),fe(r)}};function nAe(e){var t=_6(e);return function(n){var r=T6(e,n);return Nt(r)?ye:fe([r.value,t(n)])}}var rAe=My,T6=Cs,iAe=ky,oAe=ow;function aAe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===1?bl(e[0]):bl(V).apply(void 0,e)}function uAe(e){return"compare"in e?Cl(e):Cl(V)(e)}function sAe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===1?Sl(e[0]):Sl(V).apply(void 0,e)}var cAe=D3;function lAe(e){return N3(e)}function Ww(e){return Ly(e)}function QA(e){return nd(e)}var fAe=function(e){var t=Ww(e);return function(n){return function(r){return e.map(b(r,t(n)),Ku)}}},dAe=function(e){var t=Ww(e);return function(n){return function(r){return e.map(b(r,t(n)),Pu)}}},pAe=jy;function AAe(e){return Uy(e)}var hAe=By;function mAe(e){return Wy(e)}function x6(e,t){return q3(e,t)}var gAe=Bw,vAe=function(e){return x6(Cg(),HU)(e)};function yAe(e,t){return aw(e,t)}var bAe=Q3,CAe=V3,SAe=uw,w6=function(e){var t=sw(e);return function(n){return function(r){return Ss(r)?_l({},n):Ss(n)?_l({},r):t(n)(r)}}},$6=function(e){return function(t){return function(n){return Ss(n)||Ss(t)?{}:cw(e)(t)(n)}}},E6=function(e){return function(t){return Ss(t)?_l({},e):Ss(e)?_l({},t):lw(e)(t)}},Ki=jr,VA=mc,Pi=Ur,Di=Br,Ni=Wr,zA=gc,HA=vc,YA=yc,GA=bc,JA=Cc,ZA=Sc,XA=_c,R6=Ky,O6=Py,F6=Dy,M6=Ny,rd=xo,k6=PA,Kw=function(e){return function(t){var n=jw(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(p){return function(A){return p[f]=A,p}}),i(f,r[f]))},s=0,c=o;s<c.length;s++){var l=c[s];u(l)}return a}}},_Ae=fw,IAe=dw,TAe=pw,xAe=Aw;function wAe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===1?Nd(e[0]):Nd(V).apply(void 0,e)}function $Ae(e){return"compare"in e?qd(e):qd(V)(e)}function EAe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===1?Qd(e[0]):Qd(V).apply(void 0,e)}var Ku=La,Pu=ja,wn="Record";function RAe(e){return"compare"in e?mm(e):mm(V)(e)}var OAe=z3,FAe=H3,L6={URI:wn,map:Ki},MAe=qe(L6),kAe={URI:wn,map:Ki,mapWithIndex:VA},LAe=function(e){return{URI:wn,reduce:Pi(e),foldMap:Di(e),reduceRight:Ni(e)}},jAe=function(e){return{URI:wn,reduce:Pi(e),foldMap:Di(e),reduceRight:Ni(e),reduceWithIndex:JA(e),foldMapWithIndex:ZA(e),reduceRightWithIndex:XA(e)}},Hd={URI:wn,compact:Ku,separate:Pu},UAe={URI:wn,map:Ki,compact:Ku,separate:Pu,filter:zA,filterMap:HA,partition:YA,partitionMap:GA},BAe={URI:wn,map:Ki,mapWithIndex:VA,compact:Ku,separate:Pu,filter:zA,filterMap:HA,partition:YA,partitionMap:GA,filterMapWithIndex:F6,filterWithIndex:M6,partitionMapWithIndex:R6,partitionWithIndex:O6},j6=function(e){return{URI:wn,map:Ki,reduce:Pi(e),foldMap:Di(e),reduceRight:Ni(e),traverse:rd(e),sequence:k6(e)}},WAe=function(e){return{URI:wn,map:Ki,mapWithIndex:VA,reduce:Pi(e),foldMap:Di(e),reduceRight:Ni(e),reduceWithIndex:JA(e),foldMapWithIndex:ZA(e),reduceRightWithIndex:XA(e),traverse:rd(e),sequence:k6(e),traverseWithIndex:Kw(e)}},KAe=function(e){var t=j6(e);return{URI:wn,map:Ki,reduce:Pi(e),foldMap:Di(e),reduceRight:Ni(e),traverse:t.traverse,sequence:t.sequence,compact:Ku,separate:Pu,filter:zA,filterMap:HA,partition:YA,partitionMap:GA,wither:ki(t,Hd),wilt:Mi(t,Hd)}},U6=function(e){var t=w6(e);return{concat:function(n,r){return t(r)(n)}}},PAe=function(e){return{concat:U6(e).concat,empty:{}}},DAe=function(e){var t=$6(e);return{concat:function(n,r){return t(r)(n)}}},NAe=function(){return{concat:function(e,t){return E6(t)(e)}}},qAe={URI:wn,reduce:Pi(V),foldMap:Di(V),reduceRight:Ni(V)},QAe={URI:wn,reduce:Pi(V),foldMap:Di(V),reduceRight:Ni(V),reduceWithIndex:JA(V),foldMapWithIndex:ZA(V),reduceRightWithIndex:XA(V)},Pw={URI:wn,map:Ki,reduce:Pi(V),foldMap:Di(V),reduceRight:Ni(V),traverse:rd(V),sequence:QA},VAe={URI:wn,map:Ki,mapWithIndex:VA,reduce:Pi(V),foldMap:Di(V),reduceRight:Ni(V),reduceWithIndex:JA(V),foldMapWithIndex:ZA(V),reduceRightWithIndex:XA(V),traverse:rd(V),sequence:QA,traverseWithIndex:Kw(V)},B6=ki(Pw,Hd),W6=Mi(Pw,Hd),zAe={URI:wn,map:Ki,reduce:Pi(V),foldMap:Di(V),reduceRight:Ni(V),traverse:rd(V),sequence:QA,compact:Ku,separate:Pu,filter:zA,filterMap:HA,partition:YA,partitionMap:GA,wither:B6,wilt:W6},HAe={},YAe=C6,GAe=e6,JAe={URI:wn,map:Ki,reduce:Pi(V),foldMap:Di(V),reduceRight:Ni(V),traverse:rd(V),sequence:QA,compact:Ku,separate:Pu,filter:zA,filterMap:HA,partition:YA,partitionMap:GA,mapWithIndex:VA,reduceWithIndex:JA(V),foldMapWithIndex:ZA(V),reduceRightWithIndex:XA(V),filterMapWithIndex:F6,filterWithIndex:M6,partitionMapWithIndex:R6,partitionWithIndex:O6,traverseWithIndex:Kw(V),wither:B6,wilt:W6};const ZAe=Object.freeze(Object.defineProperty({__proto__:null,Compactable:Hd,Filterable:UAe,FilterableWithIndex:BAe,Foldable:qAe,FoldableWithIndex:QAe,Functor:L6,FunctorWithIndex:kAe,Traversable:Pw,TraversableWithIndex:VAe,URI:wn,Witherable:zAe,collect:Uw,compact:Ku,deleteAt:_6,difference:E6,elem:SAe,empty:HAe,every:bAe,filter:_Ae,filterMap:IAe,filterMapWithIndex:hAe,filterWithIndex:mAe,flap:MAe,foldMap:$Ae,foldMapWithIndex:uAe,fromEntries:vAe,fromFoldable:x6,fromFoldableMap:yAe,getDifferenceMagma:NAe,getEq:OAe,getFoldable:LAe,getFoldableWithIndex:jAe,getIntersectionSemigroup:DAe,getMonoid:FAe,getShow:RAe,getTraversable:j6,getTraversableWithIndex:WAe,getUnionMonoid:PAe,getUnionSemigroup:U6,getWitherable:KAe,has:S6,hasOwnProperty:GAe,insertAt:YAe,intersection:$6,isEmpty:Ss,isSubrecord:rAe,keys:Xpe,lookup:T6,map:oAe,mapWithIndex:iAe,modifyAt:I6,partition:TAe,partitionMap:xAe,partitionMapWithIndex:pAe,partitionWithIndex:AAe,pop:nAe,record:JAe,reduce:wAe,reduceRight:EAe,reduceRightWithIndex:sAe,reduceWithIndex:aAe,separate:Pu,sequence:QA,singleton:cAe,size:Zpe,some:CAe,toArray:Bw,toEntries:gAe,toUnfoldable:eAe,traverse:Ww,traverseWithIndex:lAe,union:w6,updateAt:tAe,upsertAt:C6,wilt:dAe,wither:fAe},Symbol.toStringTag,{value:"Module"}));var XAe=function(e){return function(t){return _t(e(t))}},ehe=function(e){return function(t){return HC(e(t))}},the=function(){return function(e){return!0}},nhe=function(e){return function(t){return!e(t)}},rhe=function(e){return function(t){return function(n){return t(n)||e(n)}}},ihe=function(e){return function(t){return function(n){return t(n)&&e(n)}}},ohe=function(){return function(e){return!1}},ahe=function(e){return function(t){return function(n){return t(n)&&e(n)}}};const uhe=Object.freeze(Object.defineProperty({__proto__:null,and:ihe,compose:ahe,fromEitherK:ehe,fromOptionK:XAe,id:the,not:nhe,or:rhe,zero:ohe},Symbol.toStringTag,{value:"Module"}));var K6=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])})}}},she=function(e){return function(t){return e.sub(e.zero,t)}},che=K6,lhe=xk;const fhe=Object.freeze(Object.defineProperty({__proto__:null,getFunctionRing:lhe,getTupleRing:che,negate:she,tuple:K6},Symbol.toStringTag,{value:"Module"})),dhe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var phe=QC;const Ahe=Object.freeze(Object.defineProperty({__proto__:null,getFunctionSemiring:phe},Symbol.toStringTag,{value:"Module"}));var hhe=s6,mhe=c6;function ghe(e){var t=ur(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 vhe(e){var t=ur(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 Dw(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 yhe(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 Re(o,i)}}function Nw(e){var t=ur(e);return function(n,r){if(r===void 0){var i=Nw(e);return function(a){return i(n,a)}}if(Yd(n))return r;if(Yd(r))return n;var o=new Set(n);return r.forEach(function(a){t(a,o)||o.add(a)}),o}}function qw(e){var t=ur(e);return function(n,r){if(r===void 0){var i=qw(e);return function(a){return i(a,n)}}if(Yd(n)||Yd(r))return new Set;var o=new Set;return n.forEach(function(a){t(a,r)&&o.add(a)}),o}}function bhe(e,t){return function(n){return function(r){for(var i=r.values(),o,a=new Set,u=new Set,s=ur(e),c=ur(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 Re(a,u)}}}function Qw(e){var t=ur(e);return function(n,r){if(r===void 0){var i=Qw(e);return function(o){return i(o,n)}}return Dw(function(o){return!t(o,r)})(n)}}var P6=function(e){return{concat:Nw(e)}},Che=function(e){return{concat:P6(e).concat,empty:new Set}},She=function(e){return{concat:qw(e)}},_he=function(e){return{concat:Qw(e)}},Ihe=n6,The=r6,xhe=i6,whe=function(e){return new Set([e])};function D6(e){var t=ur(e);return function(n){return function(r){if(t(n)(r))return r;var i=new Set(r);return i.add(n),i}}}var N6=function(e){return function(t){return function(n){return Dw(function(r){return!e.equals(t,r)})(n)}}},$he=function(e){var t=ur(e),n=N6(e),r=D6(e);return function(i){return function(o){return(t(i,o)?n:r)(i)(o)}}},q6=function(e){return function(t){for(var n=t.length,r=new Set,i=ur(e),o=0;o<n;o++){var a=t[o];i(a,r)||r.add(a)}return r}},Ehe=function(e){return Q6(e)(P)};function Rhe(e,t){return function(n){var r=ur(e),i=ur(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}}),Re(o,a)}}function Q6(e){var t=ur(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 Ohe=new Set,Yd=function(e){return e.size===0},Fhe=function(e){return e.size},Mhe=Sw,V6=_w,khe=NA,ur=vn,z6=function(e){return function(t){var n=[];return t.forEach(function(r){return n.push(r)}),n.sort(e.compare)}},Lhe=NA;const jhe=Object.freeze(Object.defineProperty({__proto__:null,chain:vhe,compact:Ehe,difference:Qw,elem:ur,empty:Ohe,every:V6,filter:Dw,filterMap:Q6,foldMap:The,fromArray:q6,getDifferenceMagma:_he,getEq:mhe,getIntersectionSemigroup:She,getShow:hhe,getUnionMonoid:Che,getUnionSemigroup:P6,insert:D6,intersection:qw,isEmpty:Yd,isSubset:khe,map:ghe,partition:yhe,partitionMap:bhe,reduce:Ihe,reduceRight:xhe,remove:N6,separate:Rhe,singleton:whe,size:Fhe,some:Mhe,subset:Lhe,toArray:z6,toggle:$he,union:Nw},Symbol.toStringTag,{value:"Module"}));var H6=function(e){return{show:function(t){var n="{";for(var r in e)ft.call(e,r)&&(n+=" ".concat(r,": ").concat(e[r].show(t[r]),","));return n.length>1&&(n=n.slice(0,-1)+" "),n+="}",n}}},Y6=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(", "),"]")}}},Uhe=Y6,Bhe=H6,Whe={show:function(e){return JSON.stringify(e)}},Khe={show:function(e){return JSON.stringify(e)}},Phe={show:function(e){return JSON.stringify(e)}};const Dhe=Object.freeze(Object.defineProperty({__proto__:null,getStructShow:Bhe,getTupleShow:Uhe,showBoolean:Whe,showNumber:Phe,showString:Khe,struct:H6,tuple:Y6},Symbol.toStringTag,{value:"Module"}));function Vw(e){return function(t){return function(n){return e.of([t,n])}}}function zw(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 Hw(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 Yw(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 Gw(e){return function(t){return function(n){return e.of(t(n))}}}function Jw(e){return function(t){return function(n){return e.map(t,function(r){return[r,n]})}}}function Zw(e){return function(t){return function(n){return e.map(n(t),function(r){var i=r[0];return i})}}}function Xw(e){return function(t){return function(n){return e.map(n(t),Fn)}}}function Nhe(e){var t=Hw(e),n=zw(e),r=Yw(e),i=Zw(e),o=Xw(e);return{map:function(a,u){return b(a,n(u))},ap:function(a,u){return b(a,t(u))},of:Vw(e),chain:function(a,u){return b(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:Gw(e),fromM:Jw(e),evalState:function(a,u){return b(a,i(u))},execState:function(a,u){return b(a,o(u))}}}const qhe=Object.freeze(Object.defineProperty({__proto__:null,ap:Hw,chain:Yw,evaluate:Zw,execute:Xw,fromF:Jw,fromState:Gw,getStateM:Nhe,map:zw,of:Vw},Symbol.toStringTag,{value:"Module"}));var e$=function(e){return function(){return _y(e)}},t$=Vw(Jx);function G6(e){return qi(Bx(e))}function Qhe(e){return qi(GD(e))}function J6(e){return qi(Wx(e))}function Vhe(e){return qi(JD(e))}function Z6(e){return qi(Kx(e))}function zhe(e){return qi(XD(e))}var Hhe=function(e){return z(e,Ux)},Yhe=function(e){return function(t){return _y(e(t)[0])}},X6=xu(function(e){return e$(e)},t$),e5=J6,Ic=Z6,eh=G6,t5=Gw(Jx),n5=function(e){return qi(ju(e))},r5=function(e){return qi(Px(e))},Ghe=function(e){return qi(Dx(e))},qi=Jw(hc),Jhe=function(e){return function(t){return z(t,cA(e))}},i5=function(e){return function(t){return function(n){return e(n)(t)(n)}}},Zhe=i5,o5=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return r5(e.apply(void 0,t))}},a5=function(e){return function(t){return b(t,th(o5(e)))}},Xhe=a5,u5=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return n5(e.apply(void 0,t))}},s5=function(e){return function(t){return b(t,th(u5(e)))}},eme=s5,c5=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return qi(e.apply(void 0,t))}},l5=function(e){return function(t){return b(t,th(c5(e)))}},tme=l5,Qi=function(e,t){return b(e,f5(t))},Ua=function(e,t){return b(e,r$(t))},Tc=function(e,t){return b(e,i$(t))},n$=function(e,t){return function(n){return b(e(n),wy(function(){return t()(n)}))}},Vy=function(e,t,n){return function(r){return b(e(r),Hx(t,function(i){var o=i[0],a=i[1];return[n(o),a]}))}},zy=function(e,t){return function(n){return b(e(n),Yx(t))}},f5=zw(hc),nme=function(e,t){return function(n){return Vy(n,e,t)}},rme=function(e){return function(t){return zy(t,e)}},r$=Hw(Zn),ime=r$,wo=t$,i$=Yw(Zn),th=i$,d5=th(P),ome=d5,p5=function(e){return function(t){return function(n){return b(t(n),h3(function(){return e()(n)}))}}},ame=p5,Hy=e$,Ht="StateReaderTaskEither",o$={URI:Ht,map:Qi},ume=qe(o$),sme={URI:Ht,of:wo},Yy={URI:Ht,map:Qi,ap:Ua},A5=kt(Yy),cme=A5,h5=Lt(Yy),lme=h5,fme={URI:Ht,map:Qi,ap:Ua,of:wo},gr={URI:Ht,map:Qi,ap:Ua,chain:Tc},xc={URI:Ht,fromState:t5},dme=cW(xc),pme=lW(xc),Ame=fW(xc),hme=dW(xc),mme=HI(xc),gme=pW(xc,gr),vme={URI:Ht,map:Qi,ap:Ua,of:wo,chain:Tc},yme={URI:Ht,map:Qi,ap:Ua,of:wo,chain:Tc,fromIO:Ic},bme={URI:Ht,map:Qi,ap:Ua,of:wo,chain:Tc,fromIO:Ic,fromTask:eh},Cme={URI:Ht,map:Qi,ap:Ua,of:wo,chain:Tc,throwError:Hy},m5=dt(gr),Sme=m5,_me={URI:Ht,bimap:Vy,mapLeft:zy},Ime={URI:Ht,map:Qi,alt:n$},id={URI:Ht,fromReader:e5},Tme=dA(id),xme=pA(id),wme=oc(id),g5=AA(id,gr),$me=g5,v5=hA(id,gr),Eme=v5,Ba={URI:Ht,fromEither:X6},Rme=po(Ba),Ome=Ao(Ba),Fme=Ks(Ba,gr),y5=sa(Ba,gr),Mme=y5,b5=ca(Ba,gr),kme=b5,Lme=mu(Ba),C5=Ps(Ba,gr),jme=C5,Ume=Mr(Ba),Gy={URI:Ht,fromIO:Ic},Bme=yo(Gy),Wme=ga(Gy,gr),Kme=va(Gy,gr),Jy={URI:Ht,fromIO:Ic,fromTask:eh},Pme=ac(Jy),Dme=Rf(Jy,gr),Nme=Of(Jy,gr),qme=Zw(hc),Qme=Xw(hc),Vme=Ut(o$),S5=Bt(gr),zme=S5,_5=jt(Yy),Hme=_5,I5=function(e){return function(t){return function(n){return function(r){return function(){return Dl(t).reduce(function(i,o,a){return i.then(function(u){return Xt(u)?i:e(a+1,o)(u.right[1])(r)().then(function(s){if(Xt(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,Fr(t))(n)(r)().then(Zs(function(i){var o=i[0],a=i[1];return[[o],a]})))}}}}},a$=function(e){var t=I5(e);return function(n){return vt(n)?t(n):wo(bn)}},Yme=a$,T5=function(e){return a$(function(t,n){return e(n)})},Gme=T5(P),Jme={URI:Ht,map:Qi,of:wo,ap:Ua,chain:Tc,bimap:Vy,mapLeft:zy,alt:n$,fromIO:Ic,fromTask:eh,throwError:Hy},Zme={URI:Ht,map:Qi,of:wo,ap:Ua,chain:Tc,bimap:Vy,mapLeft:zy,alt:n$,fromIO:Ic,fromTask:eh,throwError:Hy},Xme=function(e,t){return b(e(t),BA(function(n){var r=n[0];return r}))},ege=function(e,t){return b(e(t),BA(function(n){n[0];var r=n[1];return r}))};function tge(e,t,n){return e(t)(n)()}const nge=Object.freeze(Object.defineProperty({__proto__:null,Alt:Ime,Applicative:fme,Apply:Yy,Bifunctor:_me,Chain:gr,FromEither:Ba,FromIO:Gy,FromReader:id,FromState:xc,FromTask:Jy,Functor:o$,Monad:vme,MonadIO:yme,MonadTask:bme,MonadThrow:Cme,Pointed:sme,URI:Ht,alt:ame,altW:p5,ap:r$,apFirst:A5,apFirstW:cme,apS:_5,apSW:Hme,apSecond:h5,apSecondW:lme,apW:ime,ask:Tme,asks:xme,asksStateReaderTaskEither:Zhe,asksStateReaderTaskEitherW:i5,bimap:nme,bind:S5,bindTo:Vme,bindW:zme,chain:i$,chainEitherK:y5,chainEitherKW:Mme,chainFirst:m5,chainFirstEitherK:b5,chainFirstEitherKW:kme,chainFirstIOK:Kme,chainFirstReaderK:v5,chainFirstReaderKW:Eme,chainFirstTaskK:Nme,chainFirstW:Sme,chainIOEitherK:Xhe,chainIOEitherKW:a5,chainIOK:Wme,chainOptionK:Fme,chainReaderK:g5,chainReaderKW:$me,chainReaderTaskEitherK:tme,chainReaderTaskEitherKW:l5,chainStateK:gme,chainTaskEitherK:eme,chainTaskEitherKW:s5,chainTaskK:Dme,chainW:th,evalState:Xme,evaluate:qme,execState:ege,execute:Qme,filterOrElse:C5,filterOrElseW:jme,flap:ume,flatten:ome,flattenW:d5,fromEither:X6,fromEitherK:Ume,fromIO:Ic,fromIOEither:r5,fromIOEitherK:o5,fromIOK:Bme,fromOption:Rme,fromOptionK:Ome,fromPredicate:Lme,fromReader:e5,fromReaderEither:Ghe,fromReaderK:wme,fromReaderTaskEither:qi,fromReaderTaskEitherK:c5,fromState:t5,fromStateK:mme,fromTask:eh,fromTaskEither:n5,fromTaskEitherK:u5,fromTaskK:Pme,get:dme,gets:hme,left:e$,leftIO:zhe,leftReader:Vhe,leftState:Yhe,leftTask:Qhe,local:Jhe,map:f5,mapLeft:rme,modify:Ame,of:wo,put:pme,right:t$,rightIO:Z6,rightReader:J6,rightState:Hhe,rightTask:G6,run:tge,sequenceArray:Gme,stateReaderTaskEither:Jme,stateReaderTaskEitherSeq:Zme,throwError:Hy,traverseArray:T5,traverseArrayWithIndex:Yme,traverseReadonlyArrayWithIndex:a$,traverseReadonlyNonEmptyArrayWithIndex:I5},Symbol.toStringTag,{value:"Module"}));function rge(e){return function(t){return{peek:t.peek,pos:e}}}function ige(e){return function(t){return{peek:t.peek,pos:e(t.pos)}}}function oge(e){return function(t){return t.peek(e(t.pos))}}function age(e){return function(t){return function(n){return e.map(t(n.pos),function(r){return n.peek(r)})}}}var x5=function(e,t){return b(e,$5(t))},uge=function(e,t){return b(e,u$(t))},u$=function(e){return function(t){return{peek:function(n){return e({peek:t.peek,pos:n})},pos:t.pos}}},w5=function(e){return e.peek(e.pos)},sge=u$(P),$5=function(e){return function(t){return{peek:function(n){return e(t.peek(n))},pos:t.pos}}},s$="Store",E5={URI:s$,map:x5},cge=qe(E5),R5={URI:s$,map:x5,extend:uge,extract:w5},lge=R5;const fge=Object.freeze(Object.defineProperty({__proto__:null,Comonad:R5,Functor:E5,URI:s$,duplicate:sge,experiment:age,extend:u$,extract:w5,flap:cge,map:$5,peeks:oge,seek:rge,seeks:ige,store:lge},Symbol.toStringTag,{value:"Module"}));function c$(e,t){return function(n,r){return t.compose(e.second(r),e.first(n))}}function O5(e,t){var n=c$(e,t);return function(r,i){return t.compose(n(r,i),e.promap(t.id(),P,function(o){return[o,o]}))}}function dge(e){return c$(e,e)}function pge(e){return O5(e,e)}const Age=Object.freeze(Object.defineProperty({__proto__:null,fanOut:O5,fanout:pge,split:c$,splitStrong:dge},Symbol.toStringTag,{value:"Module"}));var hge=function(){return{concat:function(e,t){return Object.assign({},e,t)}}},mge=function(e){return function(t){var n={};for(var r in t)ft.call(t,r)&&(n[r]=e[r](t[r]));return n}};const gge=Object.freeze(Object.defineProperty({__proto__:null,evolve:mge,getAssignSemigroup:hge},Symbol.toStringTag,{value:"Module"}));var vge=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())})},yge=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}}},F5=bA(_n),bge=CT(_n),Cge=jn,M5=ST(_n),nh=function(e){return Zy(Gn(e))},Zy=Kv(We),Sge=Fu(pf),k5=_T(We),_ge=k5,l$=qv(Vf),Ige=l$,L5=l$,Tge=L5,j5=Qv(on),xge=j5,wge=Pv(_n),U5=function(e){return function(){return vge(void 0,void 0,void 0,function(){return yge(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,e().then(fe)];case 1:return[2,t.sent()];case 2:return t.sent(),[2,ye];case 3:return[2]}})})}},$ge=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return U5(function(){return e.apply(void 0,t)})}},Ege=Dv(_n),Rge=yT(on),Oge=Nv(_n),Fge=bT(on),f$=Vv(We),B5=zv(dc),$o=F5,Xy=jf(on),Mge=Xy(P),d$=Hv(on),kge=d$,e0=CA(_n),Lge=e0(),p$=go(We,zs),A$=Aa(We,zs,cf),W5=ha(We,da),K5=ma(We,da),P5=wu(We,da),D5=$u(We,da),ci=function(e,t){return b(e,f$(t))},wc=function(e,t){return b(e,B5(t))},t0=function(e,t){return b(e,Xy(t))},N5=function(e,t){return b(e,d$(t))},jge=function(e,t){return b(e,W5(t))},Uge=function(e,t){return b(e,K5(t))},Bge=function(e,t){return b(e,P5(t))},Wge=function(e,t){return b(e,D5(t))},an="TaskOption",h$={URI:an,map:ci},Kge=qe(h$),q5={URI:an,of:$o},n0={URI:an,map:ci,ap:wc},Pge=kt(n0),Dge=Lt(n0),Nge={URI:an,map:ci,ap:wc,of:$o},Q5=function(e,t){return b(e,Xy(function(n){return b(t,f$(n))}))},qge={URI:an,map:ci,ap:Q5},Qge={URI:an,map:ci,ap:Q5,of:$o},Wa={URI:an,map:ci,ap:wc,chain:t0},Vge=dt(Wa),zge={URI:an,map:ci,alt:N5},V5={URI:an,zero:e0},Hge=Gl(V5,q5),Yge={URI:an,map:ci,ap:wc,of:$o,alt:N5,zero:e0},Gge={URI:an,map:ci,ap:wc,of:$o,chain:t0},Jge={URI:an,map:ci,ap:wc,of:$o,chain:t0,fromIO:nh},Zge={URI:an,map:ci,ap:wc,of:$o,chain:t0,fromIO:nh,fromTask:Zy},Xge={URI:an,compact:p$,separate:A$},eve={URI:an,map:ci,compact:p$,separate:A$,filter:jge,filterMap:Uge,partition:Bge,partitionMap:Wge},r0={URI:an,fromIO:nh},tve=yo(r0),nve=ga(r0,Wa),rve=va(r0,Wa),i0={URI:an,fromEither:M5},ive=Mr(i0),ove=sa(i0,Wa),ave=ca(i0,Wa),o0={URI:an,fromIO:nh,fromTask:Zy},uve=ac(o0),sve=Rf(o0,Wa),cve=Of(o0,Wa),lve=$o(tn),fve=Ut(h$),dve=Bt(Wa),pve=jt(n0),m$=$o(bn),z5=function(e){return z(zf(e),Fu(Tv(fr)))},g$=function(e){var t=z5(e);return function(n){return vt(n)?t(n):m$}},H5=function(e){return function(t){return function(){return Dl(t).reduce(function(n,r,i){return n.then(function(o){return Nt(o)?n:e(i+1,r)().then(function(a){return Nt(a)?a:(o.value.push(a.value),o)})})},e(0,Fr(t))().then(mo(Tp)))}}},v$=function(e){var t=H5(e);return function(n){return vt(n)?t(n):m$}},Ave=g$,Y5=function(e){return g$(function(t,n){return e(n)})},hve=Y5(P),mve=v$,G5=function(e){return v$(function(t,n){return e(n)})},gve=G5(P);const vve=Object.freeze(Object.defineProperty({__proto__:null,Alt:zge,Alternative:Yge,ApT:m$,ApplicativePar:Nge,ApplicativeSeq:Qge,ApplyPar:n0,ApplySeq:qge,Chain:Wa,Compactable:Xge,Do:lve,Filterable:eve,FromEither:i0,FromIO:r0,FromTask:o0,Functor:h$,Monad:Gge,MonadIO:Jge,MonadTask:Zge,Pointed:q5,Zero:V5,alt:d$,altW:kge,ap:B5,apFirst:Pge,apS:pve,apSecond:Dge,bind:dve,bindTo:fve,chain:Xy,chainEitherK:ove,chainFirst:Vge,chainFirstEitherK:ave,chainFirstIOK:rve,chainFirstTaskK:cve,chainIOK:nve,chainNullableK:Rge,chainOptionK:Fge,chainTaskK:sve,compact:p$,filter:W5,filterMap:K5,flap:Kge,flatten:Mge,fold:Ige,foldW:Tge,fromEither:M5,fromEitherK:ive,fromIO:nh,fromIOK:tve,fromNullable:wge,fromNullableK:Ege,fromOption:Cge,fromOptionK:Oge,fromPredicate:bge,fromTask:Zy,fromTaskEither:Sge,fromTaskK:uve,getOrElse:j5,getOrElseW:xge,guard:Hge,map:f$,match:k5,matchE:l$,matchEW:L5,matchW:_ge,none:Lge,of:$o,partition:P5,partitionMap:D5,separate:A$,sequenceArray:hve,sequenceSeqArray:gve,some:F5,traverseArray:Y5,traverseArrayWithIndex:Ave,traverseReadonlyArrayWithIndex:g$,traverseReadonlyArrayWithIndexSeq:v$,traverseReadonlyNonEmptyArrayWithIndex:z5,traverseReadonlyNonEmptyArrayWithIndexSeq:H5,traverseSeqArray:G5,traverseSeqArrayWithIndex:mve,tryCatch:U5,tryCatchK:$ge,zero:e0},Symbol.toStringTag,{value:"Module"}));var Ge=function(e){return e._tag==="Left"},Ft=function(e){return e._tag==="Right"};function _s(e){return e._tag==="Both"}function An(e){return{_tag:"Left",left:e}}function vr(e){return{_tag:"Right",right:e}}function tt(e,t){return{_tag:"Both",left:e,right:t}}var y$=function(e,t,n){return function(r){switch(r._tag){case"Left":return e(r.left);case"Right":return t(r.right);case"Both":return n(r.left,r.right)}}},yve=y$,su=y$,bve=su,J5=su(vr,An,function(e,t){return tt(t,e)});function Cve(e,t){return{show:su(function(n){return"left(".concat(e.show(n),")")},function(n){return"right(".concat(t.show(n),")")},function(n,r){return"both(".concat(e.show(n),", ").concat(t.show(r),")")})}}function Sve(e,t){return ti(function(n,r){return Ge(n)?Ge(r)&&e.equals(n.left,r.left):Ft(n)?Ft(r)&&t.equals(n.right,r.right):_s(r)&&e.equals(n.left,r.left)&&t.equals(n.right,r.right)})}function Z5(e,t){return{concat:function(n,r){return Ge(n)?Ge(r)?An(e.concat(n.left,r.left)):Ft(r)?tt(n.left,r.right):tt(e.concat(n.left,r.left),r.right):Ft(n)?Ge(r)?tt(r.left,n.right):Ft(r)?vr(t.concat(n.right,r.right)):tt(r.left,t.concat(n.right,r.right)):Ge(r)?tt(e.concat(n.left,r.left),n.right):Ft(r)?tt(n.left,t.concat(n.right,r.right)):tt(e.concat(n.left,r.left),t.concat(n.right,r.right))}}}var a0=function(e){return{URI:Pr,_E:void 0,map:$c,ap:function(t,n){return Ge(t)?Ge(n)?An(e.concat(t.left,n.left)):Ft(n)?An(t.left):An(e.concat(t.left,n.left)):Ft(t)?Ge(n)?An(n.left):Ft(n)?vr(t.right(n.right)):tt(n.left,t.right(n.right)):Ge(n)?An(e.concat(t.left,n.left)):Ft(n)?tt(t.left,t.right(n.right)):tt(e.concat(t.left,n.left),t.right(n.right))}}};function _ve(e){var t=a0(e);return{URI:Pr,_E:void 0,map:$c,ap:t.ap,of:rh}}function X5(e){var t=a0(e),n=function(r,i){if(Ge(r))return r;if(Ft(r))return i(r.right);var o=i(r.right);return Ge(o)?An(e.concat(r.left,o.left)):Ft(o)?tt(r.left,o.right):tt(e.concat(r.left,o.left),o.right)};return{URI:Pr,_E:void 0,map:$c,ap:t.ap,chain:n}}function Ive(e){var t=X5(e);return{URI:Pr,_E:void 0,map:$c,of:rh,ap:t.ap,chain:t.chain,throwError:An}}function Tve(e){return Ge(e)?fe(e.left):Ft(e)?ye:fe(e.left)}function xve(e){return Ge(e)?ye:(Ft(e),fe(e.right))}function wve(e){return function(t){return Nt(t)?An(e):tt(e,t.value)}}function $ve(e){return function(t){return Nt(t)?vr(e):tt(t.value,e)}}function Eve(e){return Ge(e)?fe(e.left):ye}function Rve(e){return Ft(e)?fe(e.right):ye}var Ove=function(e,t){return Nt(e)?Nt(t)?ye:fe(vr(t.value)):Nt(t)?fe(An(e.value)):fe(tt(e.value,t.value))},$c=function(e,t){return b(e,T$(t))},eN=function(e,t,n){return b(e,_$(t,n))},tN=function(e,t){return b(e,I$(t))},b$=function(e,t,n){return b(e,rN(t,n))},C$=function(e){var t=iN(e);return function(n,r){return b(n,t(r))}},S$=function(e,t,n){return b(e,oN(t,n))},nN=function(e){var t=aN(e);return function(n,r){return b(n,t(r))}},_$=function(e,t){return function(n){return Ge(n)?An(e(n.left)):Ft(n)?vr(t(n.right)):tt(e(n.left),t(n.right))}},I$=function(e){return function(t){return Ge(t)?An(e(t.left)):_s(t)?tt(e(t.left),t.right):t}},T$=function(e){return function(t){return Ge(t)?t:Ft(t)?vr(e(t.right)):tt(t.left,e(t.right))}},rN=function(e,t){return function(n){return Ge(n)?e:t(e,n.right)}},iN=function(e){return function(t){return function(n){return Ge(n)?e.empty:t(n.right)}}},oN=function(e,t){return function(n){return Ge(n)?e:t(n.right,e)}},aN=function(e){return function(t){return function(n){return Ge(n)?e.of(n):Ft(n)?e.map(t(n.right),vr):e.map(t(n.right),function(r){return tt(n.left,r)})}}},x$=function(e){return function(t){return Ge(t)?e.of(t):Ft(t)?e.map(t.right,vr):e.map(t.right,function(n){return tt(t.left,n)})}},rh=vr,Pr="These",w$={URI:Pr,map:$c},Fve=qe(w$),Mve={URI:Pr,of:rh},kve={URI:Pr,bimap:eN,mapLeft:tN},Lve={URI:Pr,fromThese:P},jve={URI:Pr,reduce:b$,foldMap:C$,reduceRight:S$},Uve={URI:Pr,map:$c,reduce:b$,foldMap:C$,reduceRight:S$,traverse:nN,sequence:x$},$$={URI:Pr,fromEither:P},Bve=po($$),Wve=Ao($$),Kve=function(e){return function(t){return function(n){return Ge(n)?!1:e.equals(t,n.right)}}},Pve=function(e){return function(t){return Ge(t)?!1:e(t.right)}},E$=function(e,t){return function(n){return Ge(n)?[n.left,t()]:Ft(n)?[e(),n.right]:[n.left,n.right]}},Dve=function(e,t){return E$(function(){return e},function(){return t})},uN=rh(bn),R$=function(e){return function(t){return function(n){var r=ye,i=t(0,Fr(n));if(Ge(i))return i;_s(i)&&(r=fe(i.left));for(var o=[i.right],a=1;a<n.length;a++){var u=t(a,n[a]);if(Ge(u))return u;_s(u)&&(r=Nt(r)?fe(u.left):fe(e.concat(r.value,u.left))),o.push(u.right)}return Nt(r)?vr(o):tt(r.value,o)}}},Nve=function(e){return function(t){var n=R$(e)(t);return function(r){return vt(r)?n(r):uN}}},qve={URI:Pr,map:$c,bimap:eN,mapLeft:tN,reduce:b$,foldMap:C$,reduceRight:S$,traverse:nN,sequence:x$};const Qve=Object.freeze(Object.defineProperty({__proto__:null,ApT:uN,Bifunctor:kve,Foldable:jve,FromEither:$$,FromThese:Lve,Functor:w$,Pointed:Mve,Traversable:Uve,URI:Pr,bimap:_$,both:tt,elem:Kve,exists:Pve,flap:Fve,fold:bve,foldMap:iN,foldW:yve,fromOption:Bve,fromOptionK:Wve,fromOptions:Ove,getApplicative:_ve,getApply:a0,getChain:X5,getEq:Sve,getLeft:Tve,getLeftOnly:Eve,getMonad:Ive,getRight:xve,getRightOnly:Rve,getSemigroup:Z5,getShow:Cve,isBoth:_s,isLeft:Ge,isRight:Ft,left:An,leftOrBoth:wve,map:T$,mapLeft:I$,match:su,matchW:y$,of:rh,reduce:rN,reduceRight:oN,right:vr,rightOrBoth:$ve,sequence:x$,swap:J5,these:qve,toTuple:Dve,toTuple2:E$,traverse:aN,traverseReadonlyArrayWithIndex:Nve,traverseReadonlyNonEmptyArrayWithIndex:R$},Symbol.toStringTag,{value:"Module"}));function gm(e){return z(vr,e.of)}function u0(e){return z(An,e.of)}function O$(e){return z(tt,e.of)}function F$(e){return function(t){return e.map(t,vr)}}function M$(e){return function(t){return e.map(t,An)}}function k$(e){return Nl(e,w$)}function L$(e,t){return ua(e,a0(t))}function j$(e,t){var n=u0(e);return function(r){return function(i){return e.chain(i,su(n,r,function(o,a){return e.map(r(a),su(function(u){return An(t.concat(o,u))},function(u){return tt(o,u)},function(u,s){return tt(t.concat(o,u),s)}))}))}}}function U$(e){return function(t,n){return function(r){return e.map(r,_$(t,n))}}}function B$(e){return function(t){return function(n){return e.map(n,I$(t))}}}function sN(e){return function(t,n,r){return function(i){return e.map(i,su(t,n,r))}}}function W$(e){return function(t,n,r){return function(i){return e.chain(i,su(t,n,r))}}}function K$(e){return function(t){return e.map(t,J5)}}function P$(e){return function(t,n){return function(r){return e.map(r,E$(t,n))}}}function Vve(e){var t=k$(e),n=U$(e),r=B$(e),i=W$(e),o=P$(e),a=gm(e),u=function(s,c){return b(s,t(c))};return{map:u,bimap:function(s,c,l){return b(s,n(c,l))},mapLeft:function(s,c){return b(s,r(c))},fold:function(s,c,l,f){return b(s,i(c,l,f))},swap:K$(e),rightM:F$(e),leftM:M$(e),left:u0(e),right:gm(e),both:O$(e),toTuple:function(s,c,l){return b(s,o(function(){return c},function(){return l}))},getMonad:function(s){var c=L$(e,s),l=j$(e,s);return{_E:void 0,map:u,of:a,ap:function(f,p){return b(f,c(p))},chain:function(f,p){return b(f,l(p))}}}}}const zve=Object.freeze(Object.defineProperty({__proto__:null,ap:L$,bimap:U$,both:O$,chain:j$,getTheseM:Vve,left:u0,leftF:M$,map:k$,mapLeft:B$,match:sN,matchE:W$,right:gm,rightF:F$,swap:K$,toTuple2:P$},Symbol.toStringTag,{value:"Module"}));var Hve=u0(_n),cN=gm(_n),Yve=O$(_n),D$=F$(We),lN=M$(We),fN=z(Gn,D$),Gve=z(Gn,lN),dN=jn,pN=jn,s0=fN,Jve=Gn,N$=D$,AN=sN(We),Zve=AN,hN=W$(on),mN=hN,gN=mN,Xve=gN,eye=K$(We),Ec=function(e,t){return b(e,vN(t))},q$=function(e,t,n){return b(e,yN(t,n))},Q$=function(e,t){return b(e,bN(t))},vN=k$(We),yN=U$(We),bN=B$(We),ih=cN,Xn="TaskThese",V$=function(e,t){var n=L$(e,t);return{URI:Xn,_E:void 0,map:Ec,ap:function(r,i){return b(r,n(i))}}};function CN(e,t){var n=V$(e,t).ap;return{URI:Xn,_E:void 0,map:Ec,ap:n,of:ih}}function SN(e){var t=V$(FA,e),n=j$(on,e);return{URI:Xn,_E:void 0,map:Ec,ap:t.ap,chain:function(r,i){return b(r,n(i))}}}function tye(e){var t=CN(FA,e),n=SN(e);return{URI:Xn,_E:void 0,map:Ec,ap:t.ap,of:ih,chain:n.chain,fromIO:s0,fromTask:N$}}var _N={URI:Xn,map:Ec},nye=qe(_N),rye={URI:Xn,of:ih},iye={URI:Xn,bimap:q$,mapLeft:Q$},c0={URI:Xn,fromEither:dN},oye=po(c0),aye=Ao(c0),uye=mu(c0),IN={URI:Xn,fromThese:pN},sye=AW(IN),TN={URI:Xn,fromIO:s0},cye=yo(TN),xN={URI:Xn,fromIO:s0,fromTask:N$},lye=ac(xN),wN=P$(We),z$=ih(bn),$N=function(e){var t=R$(e);return function(n){return z(zf(n),Fu(t(fr)))}},fye=function(e){return function(t){var n=$N(e)(t);return function(r){return vt(r)?n(r):z$}}},EN=function(e){return function(t){return function(n){return function(){return Dl(n).reduce(function(r,i,o){return r.then(function(a){return Ge(a)?r:t(o+1,i)().then(function(u){if(Ge(u))return u;if(_s(u)){var s=a.right;return s.push(u.right),_s(a)?tt(e.concat(a.left,u.left),s):tt(u.left,s)}return a.right.push(u.right),a})})},t(0,Fr(n))().then(T$(Tp)))}}}},dye=function(e){return function(t){var n=EN(e)(t);return function(r){return vt(r)?n(r):z$}}},pye={URI:Xn,map:Ec},Aye={URI:Xn,bimap:q$,mapLeft:Q$},hye=function(e,t){return wN(function(){return e},function(){return t})},mye={URI:Xn,map:Ec,bimap:q$,mapLeft:Q$},gye=function(e,t){return nn(fy)(Z5(e,t))};const vye=Object.freeze(Object.defineProperty({__proto__:null,ApT:z$,Bifunctor:iye,FromEither:c0,FromIO:TN,FromTask:xN,FromThese:IN,Functor:_N,Pointed:rye,URI:Xn,bifunctorTaskThese:Aye,bimap:yN,both:Yve,flap:nye,fold:mN,foldW:Xve,fromEither:dN,fromIO:s0,fromIOEither:Jve,fromIOK:cye,fromOption:oye,fromOptionK:aye,fromPredicate:uye,fromTask:N$,fromTaskK:lye,fromThese:pN,fromTheseK:sye,functorTaskThese:pye,getApplicative:CN,getApply:V$,getChain:SN,getMonad:tye,getSemigroup:gye,left:Hve,leftIO:Gve,leftTask:lN,map:vN,mapLeft:bN,match:AN,matchE:hN,matchEW:gN,matchW:Zve,of:ih,right:cN,rightIO:fN,rightTask:D$,swap:eye,taskThese:mye,toTuple:hye,toTuple2:wN,traverseReadonlyArrayWithIndex:fye,traverseReadonlyArrayWithIndexSeq:dye,traverseReadonlyNonEmptyArrayWithIndex:$N,traverseReadonlyNonEmptyArrayWithIndexSeq:EN},Symbol.toStringTag,{value:"Module"}));function yye(e,t){return function(n){return n(t(n(e.empty)))}}function bye(e){return function(t){return[e(t),t]}}function Cye(e){return function(t){return function(n){return[t(n),e(n)]}}}function Sye(e){return function(t){return function(n){return t(e(n))}}}function _ye(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:H$,_E:void 0,map:RN,extend:t,extract:n}}var RN=function(e,t){return b(e,ON(t))},ON=function(e){return function(t){return function(n){return e(t(n))}}},H$="Traced",Y$={URI:H$,map:RN},Iye=qe(Y$),Tye=Y$;const xye=Object.freeze(Object.defineProperty({__proto__:null,Functor:Y$,URI:H$,censor:Sye,flap:Iye,getComonad:_ye,listen:bye,listens:Cye,map:ON,traced:Tye,tracks:yye},Symbol.toStringTag,{value:"Module"}));function FN(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 MN(e,t){return function(n){var r=e.sequence(n),i=t.sequence(n);return function(o){return r(e.map(o,i))}}}function wye(e,t){var n=ql(e,t).map,r=MI(e,t),i=FN(e,t),o=MN(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 b(s,u(c))}},sequence:function(a){var u=o(a);return function(s){return b(s,u)}}}}const $ye=Object.freeze(Object.defineProperty({__proto__:null,getTraversableComposition:wye,sequence:MN,traverse:FN},Symbol.toStringTag,{value:"Module"})),Eye=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function kN(e,t){return t===void 0&&(t=[]),{value:e,forest:t}}function Rye(e){var t=function(n){return uu(n.forest)?"make(".concat(e.show(n.value),")"):"make(".concat(e.show(n.value),", [").concat(n.forest.map(t).join(", "),"])")};return{show:t}}function Oye(e){var t,n=ti(function(r,i){return e.equals(r.value,i.value)&&t.equals(r.forest,i.forest)});return t=qU(n),n}var LN=function(e,t){for(var n="",r=t.length,i,o=0;o<r;o++){i=t[o];var a=o===r-1;n+=e+(a?"└":"├")+"─ "+i.value,n+=LN(e+(r>1&&!a?"│ ":" "),i.forest)}return n};function jN(e){return LN(`
2
+ `,e)}function Fye(e){return e.value+jN(e.forest)}function UN(e,t){var n=t(e),r=n[0],i=n[1];return{value:r,forest:BN(i,t)}}function BN(e,t){return e.map(function(n){return UN(n,t)})}function WN(e){var t=KN(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 KN(e){var t=Av(e);return function(n,r){return b(n,t(function(i){return WN(e)(i,r)}))}}function Mye(e){var t=function(n){return e(n.value,n.forest.map(t))};return t}var Du=function(e,t){return b(e,f0(t))},od=function(e,t){return b(e,oh(function(n){return b(t,f0(n))}))},G$=function(e,t){return b(e,oh(t))},J$=function(e,t,n){return b(e,d0(t,n))},Z$=function(e){var t=NN(e);return function(n,r){return b(n,t(r))}},X$=function(e,t,n){return b(e,eE(t,n))},PN=function(e,t){return b(e,l0(t))},DN=function(e){var t=nE(e);return function(n,r){return b(n,t(r))}},kye=function(e){return function(t){return od(t,e)}},oh=function(e){return function(t){var n=e(t.value),r=n.value,i=n.forest,o=Y_().concat;return{value:r,forest:o(i,t.forest.map(oh(e)))}}},l0=function(e){return function(t){return{value:e(t),forest:t.forest.map(l0(e))}}},Lye=l0(P),jye=oh(P),f0=function(e){return function(t){return{value:e(t.value),forest:t.forest.map(f0(e))}}},d0=function(e,t){return function(n){for(var r=t(e,n.value),i=n.forest.length,o=0;o<i;o++)r=b(n.forest[o],d0(r,t));return r}},NN=function(e){return function(t){return d0(e.empty,function(n,r){return e.concat(n,t(r))})}},eE=function(e,t){return function(n){for(var r=e,i=n.forest.length,o=i-1;o>=0;o--)r=b(n.forest[o],eE(r,t));return t(n.value,r)}},tE=function(e){return e.value},nE=function(e){var t=Av(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}}}),b(i.forest,t(n(r))))}};return n},rE=function(e){return nE(e)(P)},ad=function(e){return kN(e)},Vi="Tree",iE={URI:Vi,map:Du},Uye=qe(iE),Bye={URI:Vi,of:ad},p0={URI:Vi,map:Du,ap:od},Wye=kt(p0),Kye=Lt(p0),Pye={URI:Vi,map:Du,ap:od,of:ad},oE={URI:Vi,map:Du,ap:od,chain:G$},Dye={URI:Vi,map:Du,ap:od,of:ad,chain:G$},Nye=dt(oE),qye={URI:Vi,reduce:J$,foldMap:Z$,reduceRight:X$},Qye={URI:Vi,map:Du,reduce:J$,foldMap:Z$,reduceRight:X$,traverse:DN,sequence:rE},Vye={URI:Vi,map:Du,extend:PN,extract:tE},zye=ad(tn),Hye=Ut(iE),Yye=Bt(oE),Gye=jt(p0);function Jye(e){var t=function(n,r){return e.equals(n,r.value)||r.forest.some(function(i){return t(n,i)})};return t}var qN=function(e){return function(t){return e(t.value)||t.forest.some(qN(e))}},Zye={URI:Vi,map:Du,of:ad,ap:od,chain:G$,reduce:J$,foldMap:Z$,reduceRight:X$,traverse:DN,sequence:rE,extract:tE,extend:PN};const Xye=Object.freeze(Object.defineProperty({__proto__:null,Applicative:Pye,Apply:p0,Chain:oE,Comonad:Vye,Do:zye,Foldable:qye,Functor:iE,Monad:Dye,Pointed:Bye,Traversable:Qye,URI:Vi,ap:kye,apFirst:Wye,apS:Gye,apSecond:Kye,bind:Yye,bindTo:Hye,chain:oh,chainFirst:Nye,drawForest:jN,drawTree:Fye,duplicate:Lye,elem:Jye,exists:qN,extend:l0,extract:tE,flap:Uye,flatten:jye,fold:Mye,foldMap:NN,getEq:Oye,getShow:Rye,make:kN,map:f0,of:ad,reduce:d0,reduceRight:eE,sequence:rE,traverse:nE,tree:Zye,unfoldForest:BN,unfoldForestM:KN,unfoldTree:UN,unfoldTreeM:WN},Symbol.toStringTag,{value:"Module"}));var Er=en,sr=Fn,e0e=function(e){return[sr(e),Er(e)]};function aE(e){return{URI:Dr,_E:void 0,map:ah,ap:function(t,n){return[Er(t)(Er(n)),e.concat(sr(t),sr(n))]}}}var QN=function(e){return function(t){return[t,e.empty]}};function t0e(e){var t=aE(e);return{URI:Dr,_E:void 0,map:t.map,ap:t.ap,of:QN(e)}}function uE(e){var t=aE(e);return{URI:Dr,_E:void 0,map:t.map,ap:t.ap,chain:function(n,r){var i=r(Er(n)),o=i[0],a=i[1];return[o,e.concat(sr(n),a)]}}}function n0e(e){var t=uE(e);return{URI:Dr,_E:void 0,map:t.map,ap:t.ap,chain:t.chain,of:QN(e)}}function r0e(e){var t=function(r,i){for(var o=i(r),a=e.empty,u=Er(o);u._tag==="Left";)a=e.concat(a,sr(o)),o=i(u.left),u=Er(o);return[u.right,e.concat(a,sr(o))]},n=uE(e);return{URI:Dr,_E:void 0,map:n.map,ap:n.ap,chain:n.chain,chainRec:t}}var VN=function(e,t){return b(e,ZN(t))},ah=function(e,t){return b(e,fE(t))},zN=function(e,t,n){return b(e,JN(t,n))},HN=function(e,t){return b(e,dE(t))},YN=function(e,t){return b(e,pE(t))},sE=function(e,t,n){return b(e,e4(t,n))},cE=function(e){var t=XN();return function(n,r){return b(n,t(r))}},lE=function(e,t,n){return b(e,t4(t,n))};function GN(e){var t=n4(e);return function(n,r){return b(n,t(r))}}var JN=function(e,t){return function(n){return[t(Er(n)),e(sr(n))]}},fE=function(e){return function(t){return[e(Er(t)),sr(t)]}},dE=function(e){return function(t){return[Er(t),e(sr(t))]}},ZN=function(e){return function(t){return[Er(t),sr(e)]}},pE=function(e){return function(t){return[e(t),sr(t)]}},i0e=pE(P),AE=Qy,XN=Mw,e4=Fw,t4=kw,n4=function(e){return function(t){return function(n){return e.map(t(Er(n)),function(r){return[r,sr(n)]})}}},hE=function(e){return function(t){return e.map(Er(t),function(n){return[n,sr(t)]})}},Dr="Tuple",r4={URI:Dr,map:ah},o0e=qe(r4),a0e={URI:Dr,bimap:zN,mapLeft:HN},u0e={URI:Dr,compose:VN},s0e={URI:Dr,map:ah,extend:YN,extract:AE},c0e={URI:Dr,reduce:sE,foldMap:cE,reduceRight:lE},l0e={URI:Dr,map:ah,reduce:sE,foldMap:cE,reduceRight:lE,traverse:GN,sequence:hE},f0e=fE,d0e=dE,p0e={URI:Dr,compose:VN,map:ah,bimap:zN,mapLeft:HN,extract:AE,extend:YN,reduce:sE,foldMap:cE,reduceRight:lE,traverse:GN,sequence:hE};const A0e=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:a0e,Comonad:s0e,Foldable:c0e,Functor:r4,Semigroupoid:u0e,Traversable:l0e,URI:Dr,bimap:JN,compose:ZN,duplicate:i0e,extend:pE,extract:AE,flap:o0e,foldMap:XN,fst:Er,getApplicative:t0e,getApply:aE,getChain:uE,getChainRec:r0e,getMonad:n0e,map:f0e,mapFst:fE,mapLeft:d0e,mapSnd:dE,reduce:e4,reduceRight:t4,sequence:hE,snd:sr,swap:e0e,traverse:n4,tuple:p0e},Symbol.toStringTag,{value:"Module"})),h0e=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function m0e(e,t){var n=Fk(t,Iu(e));return{map:n.map,ap:n.ap,of:n.of,chain:function(r,i){return t.chain(r,function(o){return Xt(o)?t.of(Zo(o.left)):i(o.right)})},alt:function(r,i){return t.chain(r,function(o){return HC(o)?t.of(o):t.map(i(),function(a){return Xt(a)?Zo(e.concat(o.left,a.left)):a})})}}}const g0e=Object.freeze(Object.defineProperty({__proto__:null,getValidationM:m0e},Symbol.toStringTag,{value:"Module"}));var i4=XC(void 0),v0e={concat:i4.concat,empty:void 0};const y0e=Object.freeze(Object.defineProperty({__proto__:null,Monoid:v0e,Semigroup:i4},Symbol.toStringTag,{value:"Module"}));var b0e=function(e){return function(){return[void 0,e]}},C0e=function(e){return function(){var t=e(),n=t[0],r=t[1];return[[n,r],r]}},S0e=function(e){return function(){var t=e(),n=t[0],r=n[0],i=n[1],o=t[1];return[r,i(o)]}},_0e=function(e){return function(t){return function(){var n=t(),r=n[0],i=n[1];return[[r,e(i)],i]}}},I0e=function(e){return function(t){return function(){var n=t(),r=n[0],i=n[1];return[r,e(i)]}}},uh=function(e,t){return b(e,o4(t))},o4=function(e){return function(t){return function(){var n=t(),r=n[0],i=n[1];return[e(r),i]}}},Rc="Writer",a4=function(e){return{URI:Rc,_E:void 0,of:function(t){return function(){return[t,e.empty]}}}},mE=function(e){return{URI:Rc,_E:void 0,map:uh,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)]}}}},u4=function(e){var t=mE(e),n=a4(e);return{URI:Rc,_E:void 0,map:uh,ap:t.ap,of:n.of}};function s4(e){var t=mE(e);return{URI:Rc,_E:void 0,map:uh,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 T0e(e){var t=u4(e),n=s4(e);return{URI:Rc,_E:void 0,map:uh,ap:t.ap,of:t.of,chain:n.chain}}var gE={URI:Rc,map:uh},x0e=qe(gE),w0e=function(e){return e()[0]},$0e=function(e){return e()[1]},E0e=function(e){return e()[0]},R0e=function(e){return e()[1]},O0e=gE;const F0e=Object.freeze(Object.defineProperty({__proto__:null,Functor:gE,URI:Rc,censor:I0e,evalWriter:E0e,evaluate:w0e,execWriter:R0e,execute:$0e,flap:x0e,getApplicative:u4,getApply:mE,getChain:s4,getMonad:T0e,getPointed:a4,listen:C0e,listens:_0e,map:o4,pass:S0e,tell:b0e,writer:O0e},Symbol.toStringTag,{value:"Module"}));function M0e(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 k0e=Object.freeze(Object.defineProperty({__proto__:null,getWriterM:M0e},Symbol.toStringTag,{value:"Module"})),L0e=Object.freeze(Object.defineProperty({__proto__:null,alt:qV,alternative:VV,applicative:lz,apply:sz,array:iX,bifunctor:oX,boolean:pX,booleanAlgebra:vX,bounded:SX,boundedDistributiveLattice:TX,boundedJoinSemilattice:xX,boundedLattice:wX,boundedMeetSemilattice:$X,category:EX,chain:fz,chainRec:RX,choice:MX,comonad:kX,compactable:Tee,console:Ree,const:Qee,contravariant:Vee,date:ete,distributiveLattice:_X,either:xB,eitherT:Dte,endomorphism:qte,eq:Iz,extend:Qte,field:Hte,filterable:Gte,filterableWithIndex:Jte,foldable:rne,foldableWithIndex:one,fromEither:dz,fromIO:ane,fromReader:$ne,fromState:Hne,fromTask:Yne,fromThese:Gne,function:Ok,functor:cz,functorWithIndex:Zne,group:Xne,heytingAlgebra:ere,hkt:tre,identity:_re,invariant:Ire,io:Nre,ioEither:Nie,ioOption:joe,ioRef:Boe,joinSemilattice:Woe,json:Doe,lattice:Noe,magma:Dz,map:Zae,meetSemilattice:Xae,monad:eue,monadIO:tue,monadTask:nue,monadThrow:rue,monoid:mue,naturalTransformation:gue,nonEmptyArray:FY,number:WY,option:_ee,optionT:Qie,ord:Bz,ordering:Iue,pipeable:Due,pointed:Nue,predicate:WX,profunctor:que,random:Hue,reader:wne,readerEither:qse,readerT:zse,readerTask:tle,readerTaskEither:$de,readonlyArray:yJ,readonlyMap:mae,readonlyNonEmptyArray:KH,readonlyRecord:ype,readonlySet:jpe,readonlyTuple:Jpe,record:ZAe,refinement:uhe,ring:fhe,semigroup:nL,semigroupoid:dhe,semiring:Ahe,separated:QY,set:jhe,show:Dhe,state:zne,stateReaderTaskEither:nge,stateT:qhe,store:fge,string:Qde,strong:Age,struct:gge,task:yce,taskEither:ffe,taskOption:vve,taskThese:vye,these:Qve,theseT:zve,traced:xye,traversable:$ye,traversableWithIndex:Eye,tree:Xye,tuple:A0e,unfoldable:h0e,validationT:g0e,void:y0e,witherable:VY,writer:F0e,writerT:k0e,zero:zY},Symbol.toStringTag,{value:"Module"})),st=Ws(L0e);var un={},Il={},dn={},He={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getEndomorphismMonoid=e.not=e.SK=e.hole=e.pipe=e.untupled=e.tupled=e.absurd=e.decrement=e.increment=e.tuple=e.flow=e.flip=e.constVoid=e.constUndefined=e.constNull=e.constFalse=e.constTrue=e.constant=e.unsafeCoerce=e.identity=e.apply=e.getRing=e.getSemiring=e.getMonoid=e.getSemigroup=e.getBooleanAlgebra=void 0;var t=function(C){return function(){return{meet:function(y,x){return function(w){return C.meet(y(w),x(w))}},join:function(y,x){return function(w){return C.join(y(w),x(w))}},zero:function(){return C.zero},one:function(){return C.one},implies:function(y,x){return function(w){return C.implies(y(w),x(w))}},not:function(y){return function(x){return C.not(y(x))}}}}};e.getBooleanAlgebra=t;var n=function(C){return function(){return{concat:function(y,x){return function(w){return C.concat(y(w),x(w))}}}}};e.getSemigroup=n;var r=function(C){var y=(0,e.getSemigroup)(C);return function(){return{concat:y().concat,empty:function(){return C.empty}}}};e.getMonoid=r;var i=function(C){return{add:function(y,x){return function(w){return C.add(y(w),x(w))}},zero:function(){return C.zero},mul:function(y,x){return function(w){return C.mul(y(w),x(w))}},one:function(){return C.one}}};e.getSemiring=i;var o=function(C){var y=(0,e.getSemiring)(C);return{add:y.add,mul:y.mul,one:y.one,zero:y.zero,sub:function(x,w){return function(M){return C.sub(x(M),w(M))}}}};e.getRing=o;var a=function(C){return function(y){return y(C)}};e.apply=a;function u(C){return C}e.identity=u,e.unsafeCoerce=u;function s(C){return function(){return C}}e.constant=s,e.constTrue=s(!0),e.constFalse=s(!1),e.constNull=s(null),e.constUndefined=s(void 0),e.constVoid=e.constUndefined;function c(C){return function(y,x){return C(x,y)}}e.flip=c;function l(C,y,x,w,M,O,F,K,N){switch(arguments.length){case 1:return C;case 2:return function(){return y(C.apply(this,arguments))};case 3:return function(){return x(y(C.apply(this,arguments)))};case 4:return function(){return w(x(y(C.apply(this,arguments))))};case 5:return function(){return M(w(x(y(C.apply(this,arguments)))))};case 6:return function(){return O(M(w(x(y(C.apply(this,arguments))))))};case 7:return function(){return F(O(M(w(x(y(C.apply(this,arguments)))))))};case 8:return function(){return K(F(O(M(w(x(y(C.apply(this,arguments))))))))};case 9:return function(){return N(K(F(O(M(w(x(y(C.apply(this,arguments)))))))))}}}e.flow=l;function f(){for(var C=[],y=0;y<arguments.length;y++)C[y]=arguments[y];return C}e.tuple=f;function p(C){return C+1}e.increment=p;function A(C){return C-1}e.decrement=A;function h(C){throw new Error("Called `absurd` function which should be uncallable")}e.absurd=h;function v(C){return function(y){return C.apply(void 0,y)}}e.tupled=v;function _(C){return function(){for(var y=[],x=0;x<arguments.length;x++)y[x]=arguments[x];return C(y)}}e.untupled=_;function S(C,y,x,w,M,O,F,K,N){switch(arguments.length){case 1:return C;case 2:return y(C);case 3:return x(y(C));case 4:return w(x(y(C)));case 5:return M(w(x(y(C))));case 6:return O(M(w(x(y(C)))));case 7:return F(O(M(w(x(y(C))))));case 8:return K(F(O(M(w(x(y(C)))))));case 9:return N(K(F(O(M(w(x(y(C))))))));default:{for(var J=arguments[0],Z=1;Z<arguments.length;Z++)J=arguments[Z](J);return J}}}e.pipe=S,e.hole=h;var I=function(C,y){return y};e.SK=I;function T(C){return function(y){return!C(y)}}e.not=T;var g=function(){return{concat:function(C,y){return l(C,y)},empty:u}};e.getEndomorphismMonoid=g})(He);var je={},j0e=Ae&&Ae.__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(je,"__esModule",{value:!0});je.fromReadonlyNonEmptyArray=je.has=je.emptyRecord=je.emptyReadonlyArray=je.tail=je.head=je.isNonEmpty=je.singleton=je.right=je.left=je.isRight=je.isLeft=je.some=je.none=je.isSome=je.isNone=void 0;var U0e=function(e){return e._tag==="None"};je.isNone=U0e;var B0e=function(e){return e._tag==="Some"};je.isSome=B0e;je.none={_tag:"None"};var W0e=function(e){return{_tag:"Some",value:e}};je.some=W0e;var K0e=function(e){return e._tag==="Left"};je.isLeft=K0e;var P0e=function(e){return e._tag==="Right"};je.isRight=P0e;var D0e=function(e){return{_tag:"Left",left:e}};je.left=D0e;var N0e=function(e){return{_tag:"Right",right:e}};je.right=N0e;var q0e=function(e){return[e]};je.singleton=q0e;var Q0e=function(e){return e.length>0};je.isNonEmpty=Q0e;var V0e=function(e){return e[0]};je.head=V0e;var z0e=function(e){return e.slice(1)};je.tail=z0e;je.emptyReadonlyArray=[];je.emptyRecord={};je.has=Object.prototype.hasOwnProperty;var H0e=function(e){return j0e([e[0]],e.slice(1),!0)};je.fromReadonlyNonEmptyArray=H0e;var Y0e=Ae&&Ae.__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]}),G0e=Ae&&Ae.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),J0e=Ae&&Ae.__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)&&Y0e(t,e,n);return G0e(t,e),t};Object.defineProperty(dn,"__esModule",{value:!0});dn.sequenceS=dn.sequenceT=dn.getApplySemigroup=dn.apS=dn.apSecond=dn.apFirst=dn.ap=void 0;var Z0e=He,X0e=J0e(je);function ebe(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)}}}dn.ap=ebe;function tbe(e){return function(t){return function(n){return e.ap(e.map(n,function(r){return function(){return r}}),t)}}}dn.apFirst=tbe;function nbe(e){return function(t){return function(n){return e.ap(e.map(n,function(){return function(r){return r}}),t)}}}dn.apSecond=nbe;function rbe(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)}}}dn.apS=rbe;function ibe(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)}}}}dn.getApplySemigroup=ibe;function vE(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):vE(e,t-1,i)}}var ab={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 obe(e){return X0e.has.call(ab,e)||(ab[e]=vE(Z0e.tuple,e-1,[])),ab[e]}function abe(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r=t.length,i=obe(r),o=e.map(t[0],i),a=1;a<r;a++)o=e.ap(o,t[a]);return o}}dn.sequenceT=abe;function ube(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 vE(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 sbe(e){return function(t){for(var n=Object.keys(t),r=n.length,i=ube(n),o=e.map(t[n[0]],i),a=1;a<r;a++)o=e.ap(o,t[n[a]]);return o}}dn.sequenceS=sbe;var Yr={};Object.defineProperty(Yr,"__esModule",{value:!0});Yr.getFunctorComposition=Yr.bindTo=Yr.flap=Yr.map=void 0;var cbe=He;function c4(e,t){return function(n){return function(r){return e.map(r,function(i){return t.map(i,n)})}}}Yr.map=c4;function lbe(e){return function(t){return function(n){return e.map(n,function(r){return r(t)})}}}Yr.flap=lbe;function fbe(e){return function(t){return function(n){return e.map(n,function(r){var i;return i={},i[t]=r,i})}}}Yr.bindTo=fbe;function dbe(e,t){var n=c4(e,t);return{map:function(r,i){return(0,cbe.pipe)(r,n(i))}}}Yr.getFunctorComposition=dbe;Object.defineProperty(Il,"__esModule",{value:!0});Il.getApplicativeComposition=Il.getApplicativeMonoid=void 0;var l4=dn,pbe=He,Abe=Yr;function hbe(e){var t=(0,l4.getApplySemigroup)(e);return function(n){return{concat:t(n).concat,empty:e.of(n.empty)}}}Il.getApplicativeMonoid=hbe;function mbe(e,t){var n=(0,Abe.getFunctorComposition)(e,t).map,r=(0,l4.ap)(e,t);return{map:n,of:function(i){return e.of(t.of(i))},ap:function(i,o){return(0,pbe.pipe)(i,r(o))}}}Il.getApplicativeComposition=mbe;var Is={};Object.defineProperty(Is,"__esModule",{value:!0});Is.bind=Is.chainFirst=void 0;function gbe(e){return function(t){return function(n){return e.chain(n,function(r){return e.map(t(r),function(){return r})})}}}Is.chainFirst=gbe;function vbe(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))})})}}}Is.bind=vbe;var A0={};Object.defineProperty(A0,"__esModule",{value:!0});A0.tailRec=void 0;var ybe=function(e,t){for(var n=t(e);n._tag==="Left";)n=t(n.left);return n.right};A0.tailRec=ybe;var Gt={},bbe=Ae&&Ae.__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]}),Cbe=Ae&&Ae.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Sbe=Ae&&Ae.__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)&&bbe(t,e,n);return Cbe(t,e),t};Object.defineProperty(Gt,"__esModule",{value:!0});Gt.filterOrElse=Gt.chainFirstEitherK=Gt.chainEitherK=Gt.fromEitherK=Gt.chainOptionK=Gt.fromOptionK=Gt.fromPredicate=Gt.fromOption=void 0;var _be=Is,yE=He,fs=Sbe(je);function f4(e){return function(t){return function(n){return e.fromEither(fs.isNone(n)?fs.left(t()):fs.right(n.value))}}}Gt.fromOption=f4;function Ibe(e){return function(t,n){return function(r){return e.fromEither(t(r)?fs.right(r):fs.left(n(r)))}}}Gt.fromPredicate=Ibe;function d4(e){var t=f4(e);return function(n){var r=t(n);return function(i){return(0,yE.flow)(i,r)}}}Gt.fromOptionK=d4;function Tbe(e,t){var n=d4(e);return function(r){var i=n(r);return function(o){return function(a){return t.chain(a,i(o))}}}}Gt.chainOptionK=Tbe;function bE(e){return function(t){return(0,yE.flow)(t,e.fromEither)}}Gt.fromEitherK=bE;function xbe(e,t){var n=bE(e);return function(r){return function(i){return t.chain(i,n(r))}}}Gt.chainEitherK=xbe;function wbe(e,t){return(0,yE.flow)(bE(e),(0,_be.chainFirst)(t))}Gt.chainFirstEitherK=wbe;function $be(e,t){return function(n,r){return function(i){return t.chain(i,function(o){return e.fromEither(n(o)?fs.right(o):fs.left(r(o)))})}}}Gt.filterOrElse=$be;var p4={};(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=He,n=Yr,r=function(p,A){return{left:p,right:A}};e.separated=r;var i=function(p,A){return(0,t.pipe)(p,(0,e.map)(A))},o=function(p,A){return(0,t.pipe)(p,(0,e.mapLeft)(A))},a=function(p,A,h){return(0,t.pipe)(p,(0,e.bimap)(A,h))},u=function(p){return function(A){return(0,e.separated)((0,e.left)(A),p((0,e.right)(A)))}};e.map=u;var s=function(p){return function(A){return(0,e.separated)(p((0,e.left)(A)),(0,e.right)(A))}};e.mapLeft=s;var c=function(p,A){return function(h){return(0,e.separated)(p((0,e.left)(h)),A((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(p){return p.left};e.left=l;var f=function(p){return p.right};e.right=f})(p4);var nu={},Ebe=Ae&&Ae.__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]}),Rbe=Ae&&Ae.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Obe=Ae&&Ae.__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)&&Ebe(t,e,n);return Rbe(t,e),t};Object.defineProperty(nu,"__esModule",{value:!0});nu.filterE=nu.witherDefault=nu.wiltDefault=void 0;var _O=Obe(je);function Fbe(e,t){return function(n){var r=e.traverse(n);return function(i,o){return n.map(r(i,o),t.separate)}}}nu.wiltDefault=Fbe;function Mbe(e,t){return function(n){var r=e.traverse(n);return function(i,o){return n.map(r(i,o),t.compact)}}}nu.witherDefault=Mbe;function kbe(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?_O.some(o):_O.none})})}}}}nu.filterE=kbe;(function(e){var t=Ae&&Ae.__createBinding||(Object.create?function(j,L,W,Le){Le===void 0&&(Le=W);var U=Object.getOwnPropertyDescriptor(L,W);(!U||("get"in U?!L.__esModule:U.writable||U.configurable))&&(U={enumerable:!0,get:function(){return L[W]}}),Object.defineProperty(j,Le,U)}:function(j,L,W,Le){Le===void 0&&(Le=W),j[Le]=L[W]}),n=Ae&&Ae.__setModuleDefault||(Object.create?function(j,L){Object.defineProperty(j,"default",{enumerable:!0,value:L})}:function(j,L){j.default=L}),r=Ae&&Ae.__importStar||function(j){if(j&&j.__esModule)return j;var L={};if(j!=null)for(var W in j)W!=="default"&&Object.prototype.hasOwnProperty.call(j,W)&&t(L,j,W);return n(L,j),L};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=Il,o=dn,a=Is,u=A0,s=Gt,c=He,l=Yr,f=r(je),p=p4,A=nu;e.left=f.left,e.right=f.right;var h=function(j,L){return(0,c.pipe)(j,(0,e.map)(L))},v=function(j,L){return(0,c.pipe)(j,(0,e.ap)(L))},_=function(j,L){return(0,c.pipe)(j,(0,e.chain)(L))},S=function(j,L,W){return(0,c.pipe)(j,(0,e.reduce)(L,W))},I=function(j){return function(L,W){var Le=(0,e.foldMap)(j);return(0,c.pipe)(L,Le(W))}},T=function(j,L,W){return(0,c.pipe)(j,(0,e.reduceRight)(L,W))},g=function(j){var L=(0,e.traverse)(j);return function(W,Le){return(0,c.pipe)(W,L(Le))}},C=function(j,L,W){return(0,c.pipe)(j,(0,e.bimap)(L,W))},y=function(j,L){return(0,c.pipe)(j,(0,e.mapLeft)(L))},x=function(j,L){return(0,c.pipe)(j,(0,e.alt)(L))},w=function(j,L){return(0,c.pipe)(j,(0,e.extend)(L))},M=function(j,L){return(0,u.tailRec)(L(j),function(W){return(0,e.isLeft)(W)?(0,e.right)((0,e.left)(W.left)):(0,e.isLeft)(W.right)?(0,e.left)(L(W.right.left)):(0,e.right)((0,e.right)(W.right.right))})};e.URI="Either";var O=function(j,L){return{show:function(W){return(0,e.isLeft)(W)?"left(".concat(j.show(W.left),")"):"right(".concat(L.show(W.right),")")}}};e.getShow=O;var F=function(j,L){return{equals:function(W,Le){return W===Le||((0,e.isLeft)(W)?(0,e.isLeft)(Le)&&j.equals(W.left,Le.left):(0,e.isRight)(Le)&&L.equals(W.right,Le.right))}}};e.getEq=F;var K=function(j){return{concat:function(L,W){return(0,e.isLeft)(W)?L:(0,e.isLeft)(L)?W:(0,e.right)(j.concat(L.right,W.right))}}};e.getSemigroup=K;var N=function(j){var L=(0,e.left)(j.empty);return{URI:e.URI,_E:void 0,compact:function(W){return(0,e.isLeft)(W)?W:W.right._tag==="None"?L:(0,e.right)(W.right.value)},separate:function(W){return(0,e.isLeft)(W)?(0,p.separated)(W,W):(0,e.isLeft)(W.right)?(0,p.separated)((0,e.right)(W.right.left),L):(0,p.separated)(L,(0,e.right)(W.right.right))}}};e.getCompactable=N;var J=function(j){var L=(0,e.left)(j.empty),W=(0,e.getCompactable)(j),Le=W.compact,U=W.separate,te=function(pe,Ie){return(0,e.isLeft)(pe)||Ie(pe.right)?pe:L},he=function(pe,Ie){return(0,e.isLeft)(pe)?(0,p.separated)(pe,pe):Ie(pe.right)?(0,p.separated)(L,(0,e.right)(pe.right)):(0,p.separated)((0,e.right)(pe.right),L)};return{URI:e.URI,_E:void 0,map:h,compact:Le,separate:U,filter:te,filterMap:function(pe,Ie){if((0,e.isLeft)(pe))return pe;var at=Ie(pe.right);return at._tag==="None"?L:(0,e.right)(at.value)},partition:he,partitionMap:function(pe,Ie){if((0,e.isLeft)(pe))return(0,p.separated)(pe,pe);var at=Ie(pe.right);return(0,e.isLeft)(at)?(0,p.separated)((0,e.right)(at.left),L):(0,p.separated)(L,(0,e.right)(at.right))}}};e.getFilterable=J;var Z=function(j){var L=(0,e.getFilterable)(j),W=(0,e.getCompactable)(j);return{URI:e.URI,_E:void 0,map:h,compact:L.compact,separate:L.separate,filter:L.filter,filterMap:L.filterMap,partition:L.partition,partitionMap:L.partitionMap,traverse:g,sequence:e.sequence,reduce:S,foldMap:I,reduceRight:T,wither:(0,A.witherDefault)(e.Traversable,W),wilt:(0,A.wiltDefault)(e.Traversable,W)}};e.getWitherable=Z;var ae=function(j){return{URI:e.URI,_E:void 0,map:h,ap:function(L,W){return(0,e.isLeft)(L)?(0,e.isLeft)(W)?(0,e.left)(j.concat(L.left,W.left)):L:(0,e.isLeft)(W)?W:(0,e.right)(L.right(W.right))},of:e.of}};e.getApplicativeValidation=ae;var ge=function(j){return{URI:e.URI,_E:void 0,map:h,alt:function(L,W){if((0,e.isRight)(L))return L;var Le=W();return(0,e.isLeft)(Le)?(0,e.left)(j.concat(L.left,Le.left)):Le}}};e.getAltValidation=ge;var se=function(j){return function(L){return(0,e.isLeft)(L)?L:(0,e.right)(j(L.right))}};e.map=se,e.Functor={URI:e.URI,map:h},e.of=e.right,e.Pointed={URI:e.URI,of:e.of};var k=function(j){return function(L){return(0,e.isLeft)(L)?L:(0,e.isLeft)(j)?j:(0,e.right)(L.right(j.right))}};e.apW=k,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 E=function(j){return function(L){return(0,e.isLeft)(L)?L:j(L.right)}};e.chainW=E,e.chain=e.chainW,e.Chain={URI:e.URI,map:h,ap:v,chain:_},e.Monad={URI:e.URI,map:h,ap:v,of:e.of,chain:_};var D=function(j,L){return function(W){return(0,e.isLeft)(W)?j:L(j,W.right)}};e.reduce=D;var ue=function(j){return function(L){return function(W){return(0,e.isLeft)(W)?j.empty:L(W.right)}}};e.foldMap=ue;var ke=function(j,L){return function(W){return(0,e.isLeft)(W)?j:L(W.right,j)}};e.reduceRight=ke,e.Foldable={URI:e.URI,reduce:S,foldMap:I,reduceRight:T};var Se=function(j){return function(L){return function(W){return(0,e.isLeft)(W)?j.of((0,e.left)(W.left)):j.map(L(W.right),e.right)}}};e.traverse=Se;var rt=function(j){return function(L){return(0,e.isLeft)(L)?j.of((0,e.left)(L.left)):j.map(L.right,e.right)}};e.sequence=rt,e.Traversable={URI:e.URI,map:h,reduce:S,foldMap:I,reduceRight:T,traverse:g,sequence:e.sequence};var bt=function(j,L){return function(W){return(0,e.isLeft)(W)?(0,e.left)(j(W.left)):(0,e.right)(L(W.right))}};e.bimap=bt;var Yt=function(j){return function(L){return(0,e.isLeft)(L)?(0,e.left)(j(L.left)):L}};e.mapLeft=Yt,e.Bifunctor={URI:e.URI,bimap:C,mapLeft:y};var Oe=function(j){return function(L){return(0,e.isLeft)(L)?j():L}};e.altW=Oe,e.alt=e.altW,e.Alt={URI:e.URI,map:h,alt:x};var mt=function(j){return function(L){return(0,e.isLeft)(L)?L:(0,e.right)(j(L))}};e.extend=mt,e.Extend={URI:e.URI,map:h,extend:w},e.ChainRec={URI:e.URI,map:h,ap:v,chain:_,chainRec:M},e.throwError=e.left,e.MonadThrow={URI:e.URI,map:h,ap:v,of:e.of,chain:_,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 lt=function(j,L){return function(W){return(0,e.isLeft)(W)?j(W.left):L(W.right)}};e.matchW=lt,e.foldW=e.matchW,e.match=e.matchW,e.fold=e.match;var Tt=function(j){return function(L){return(0,e.isLeft)(L)?j(L.left):L.right}};e.getOrElseW=Tt,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 sn=function(j){return(0,e.isLeft)(j)?(0,e.right)(j.left):(0,e.left)(j.right)};e.swap=sn;var Fo=function(j){return function(L){return(0,e.isLeft)(L)?j(L.left):L}};e.orElseW=Fo,e.orElse=e.orElseW;var Qa=function(j){return function(L){return L==null?(0,e.left)(j):(0,e.right)(L)}};e.fromNullable=Qa;var fi=function(j,L){try{return(0,e.right)(j())}catch(W){return(0,e.left)(L(W))}};e.tryCatch=fi;var qr=function(j,L){return function(){for(var W=[],Le=0;Le<arguments.length;Le++)W[Le]=arguments[Le];return(0,e.tryCatch)(function(){return j.apply(void 0,W)},L)}};e.tryCatchK=qr;var Zi=function(j){var L=(0,e.fromNullable)(j);return function(W){return(0,c.flow)(W,L)}};e.fromNullableK=Zi;var Mo=function(j){var L=(0,e.fromNullableK)(j);return function(W){return(0,e.chain)(L(W))}};e.chainNullableK=Mo,e.toUnion=(0,e.foldW)(c.identity,c.identity);function di(j){return j instanceof Error?j:new Error(String(j))}e.toError=di;function tr(j){return function(L,W){if(W===void 0){var Le=tr(j);return function(U){return Le(L,U)}}return(0,e.isLeft)(W)?!1:j.equals(L,W.right)}}e.elem=tr;var Qr=function(j){return function(L){return(0,e.isLeft)(L)?!1:j(L.right)}};e.exists=Qr,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 pi=function(j){return function(L){var W=j(0,f.head(L));if((0,e.isLeft)(W))return W;for(var Le=[W.right],U=1;U<L.length;U++){var te=j(U,L[U]);if((0,e.isLeft)(te))return te;Le.push(te.right)}return(0,e.right)(Le)}};e.traverseReadonlyNonEmptyArrayWithIndex=pi;var Ai=function(j){var L=(0,e.traverseReadonlyNonEmptyArrayWithIndex)(j);return function(W){return f.isNonEmpty(W)?L(W):e.ApT}};e.traverseReadonlyArrayWithIndex=Ai,e.traverseArrayWithIndex=e.traverseReadonlyArrayWithIndex;var ko=function(j){return(0,e.traverseReadonlyArrayWithIndex)(function(L,W){return j(W)})};e.traverseArray=ko,e.sequenceArray=(0,e.traverseArray)(c.identity);function Lo(j,L){return(0,e.tryCatch)(function(){return JSON.parse(j)},L)}e.parseJSON=Lo;var jo=function(j,L){return(0,e.tryCatch)(function(){var W=JSON.stringify(j);if(typeof W!="string")throw new Error("Converting unsupported structure to JSON");return W},L)};e.stringifyJSON=jo,e.either={URI:e.URI,map:h,of:e.of,ap:v,chain:_,reduce:S,foldMap:I,reduceRight:T,traverse:g,sequence:e.sequence,bimap:C,mapLeft:y,alt:x,extend:w,chainRec:M,throwError:e.throwError},e.getApplySemigroup=(0,o.getApplySemigroup)(e.Apply),e.getApplyMonoid=(0,i.getApplicativeMonoid)(e.Applicative);var Vr=function(j,L){return(0,o.getApplySemigroup)((0,e.getApplicativeValidation)(j))(L)};e.getValidationSemigroup=Vr;var Va=function(j,L){return(0,i.getApplicativeMonoid)((0,e.getApplicativeValidation)(j))(L)};e.getValidationMonoid=Va;function Dc(j){var L=(0,e.getApplicativeValidation)(j).ap,W=(0,e.getAltValidation)(j).alt;return{URI:e.URI,_E:void 0,map:h,of:e.of,chain:_,bimap:C,mapLeft:y,reduce:S,foldMap:I,reduceRight:T,extend:w,traverse:g,sequence:e.sequence,chainRec:M,throwError:e.throwError,ap:L,alt:W}}e.getValidation=Dc})(un);var Ze=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)}}(),Tl=function(){return Tl=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},Tl.apply(this,arguments)},Lbe=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=wt,et=function(e,t,n){return Eo([{value:e,context:t,message:n}])},Ee=ze,Ce=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 ie(a)?a:t.validate(a.right,o)},this.encode===Pe&&t.encode===Pe?Pe: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}(),Pe=function(e){return e};function A4(e){return e.displayName||e.name||"<function".concat(e.length,">")}function jbe(e,t){return{key:e,type:t}}function Ei(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 ta(e,t){for(var n=t.length,r=0;r<n;r++)e.push(t[r])}var Ts=Object.prototype.hasOwnProperty;function R1(e){return Object.keys(e).map(function(t){return"".concat(t,": ").concat(e[t].name)}).join(", ")}function Gd(e){for(var t=0;t<e.length;t++)if(e[t].encode!==Pe)return!1;return!0}function h4(e){return"{ ".concat(R1(e)," }")}function m4(e){return"Partial<".concat(e,">")}function Ube(e,t,n,r){r===void 0&&(r="{ [K in ".concat(t.name,"]: ").concat(n.name," }"));var i=e.length;return new IE(r,function(o){return Qn.is(o)&&e.every(function(a){return n.is(o[a])})},function(o,a){var u=Qn.validate(o,a);if(ie(u))return u;for(var s=u.right,c={},l=[],f=!1,p=0;p<i;p++){var A=e[p],h=s[A],v=n.validate(h,Ei(a,A,n,h));if(ie(v))ta(l,v.left);else{var _=v.right;f=f||_!==h,c[A]=_}}return l.length>0?Eo(l):Ee(f||Object.keys(s).length!==i?c:s)},n.encode===Pe?Pe: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 CE(e){var t;if(y4(e)){var n=e.value;if(zi.is(n))return t={},t[n]=null,t}else{if(Nbe(e))return e.keys;if(C4(e)){var r=e.types.map(function(i){return CE(i)});return r.some(vm.is)?void 0:Object.assign.apply(Object,Lbe([{}],r,!1))}}}function Bbe(e,t,n){return n===void 0&&(n="{ [K in ".concat(e.name,"]: ").concat(t.name," }")),new IE(n,function(r){return Qn.is(r)?Object.keys(r).every(function(i){return e.is(i)&&t.is(r[i])}):TO(t)&&Array.isArray(r)},function(r,i){if(Qn.is(r)){for(var o={},a=[],u=Object.keys(r),s=u.length,c=!1,l=0;l<s;l++){var f=u[l],p=r[f],A=e.validate(f,Ei(i,f,e,f));if(ie(A))ta(a,A.left);else{var h=A.right;c=c||h!==f,f=h;var v=t.validate(p,Ei(i,f,t,p));if(ie(v))ta(a,v.left);else{var _=v.right;c=c||_!==p,o[f]=_}}}return a.length>0?Eo(a):Ee(c?o:r)}return TO(t)&&Array.isArray(r)?Ee(r):et(r,i)},e.encode===Pe&&t.encode===Pe?Pe: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 g4(e){return"("+e.map(function(t){return t.name}).join(" | ")+")"}function O1(e,t){for(var n=!0,r=!0,i=!Qn.is(e),o=0,a=t;o<a.length;o++){var u=a[o];u!==e&&(n=!1),Qn.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)(!Ts.call(s,f)||i||u[f]!==e[f])&&(s[f]=u[f])}return s}function F1(e){switch(e._tag){case"RefinementType":case"ReadonlyType":return F1(e.type);case"InterfaceType":case"StrictType":case"PartialType":return e.props;case"IntersectionType":return e.types.reduce(function(t,n){return Object.assign(t,F1(n))},{})}}function IO(e,t){for(var n=Object.getOwnPropertyNames(e),r=!1,i={},o=0;o<n.length;o++){var a=n[o];Ts.call(t,a)?i[a]=e[a]:r=!0}return r?i:e}function Wbe(e){return b4(e)?"{| ".concat(R1(e.props)," |}"):qbe(e)?m4("{| ".concat(R1(e.props)," |}")):"Exact<".concat(e.name,">")}function Kbe(e){return e.length>0}var rr={};function v4(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 Pbe(e,t){if(e===rr)return t;if(t===rr)return e;var n=Object.assign({},e);for(var r in t)if(Ts.call(e,r)){var i=v4(e[r],t[r]);if(Kbe(i))n[r]=i;else{n=rr;break}}else n[r]=t[r];return n}function Dbe(e,t){if(e===rr||t===rr)return rr;var n=rr;for(var r in e)if(Ts.call(t,r)){var i=v4(e[r],t[r]);i.length===0&&(n===rr&&(n={}),n[r]=e[r].concat(t[r]))}return n}function TO(e){return e._tag==="AnyType"}function y4(e){return e._tag==="LiteralType"}function Nbe(e){return e._tag==="KeyofType"}function b4(e){return e._tag==="InterfaceType"}function qbe(e){return e._tag==="PartialType"}function Qbe(e){return e._tag==="StrictType"}function Vbe(e){return e._tag==="ExactType"}function zbe(e){return e._tag==="RefinementType"}function Hbe(e){return e._tag==="IntersectionType"}function C4(e){return e._tag==="UnionType"}function Ybe(e){return e._tag==="RecursiveType"}var ub=[];function Ga(e){if(ub.indexOf(e)!==-1)return rr;if(b4(e)||Qbe(e)){var t=rr;for(var n in e.props){var r=e.props[n];y4(r)&&(t===rr&&(t={}),t[n]=[r.value])}return t}else{if(Vbe(e)||zbe(e))return Ga(e.type);if(Hbe(e))return e.types.reduce(function(o,a){return Pbe(o,Ga(a))},rr);if(C4(e))return e.types.slice(1).reduce(function(o,a){return Dbe(o,Ga(a))},Ga(e.types[0]));if(Ybe(e)){ub.push(e);var i=Ga(e.type);return ub.pop(),i}}return rr}function S4(e){var t=Ga(e[0]),n=Object.keys(t),r=e.length,i=function(c){for(var l=t[c].slice(),f=[t[c]],p=1;p<r;p++){var A=e[p],h=Ga(A),v=h[c];if(v===void 0)return"continue-keys";if(v.some(function(_){return l.indexOf(_)!==-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 _4=function(e){Ze(t,e);function t(){var n=e.call(this,"null",function(r){return r===null},function(r,i){return n.is(r)?Ee(r):et(r,i)},Pe)||this;return n._tag="NullType",n}return t}(Ce),M1=new _4,I4=function(e){Ze(t,e);function t(){var n=e.call(this,"undefined",function(r){return r===void 0},function(r,i){return n.is(r)?Ee(r):et(r,i)},Pe)||this;return n._tag="UndefinedType",n}return t}(Ce),vm=new I4,T4=function(e){Ze(t,e);function t(){var n=e.call(this,"void",vm.is,vm.validate,Pe)||this;return n._tag="VoidType",n}return t}(Ce),xO=new T4,x4=function(e){Ze(t,e);function t(){var n=e.call(this,"unknown",function(r){return!0},Ee,Pe)||this;return n._tag="UnknownType",n}return t}(Ce),Gbe=new x4,w4=function(e){Ze(t,e);function t(){var n=e.call(this,"string",function(r){return typeof r=="string"},function(r,i){return n.is(r)?Ee(r):et(r,i)},Pe)||this;return n._tag="StringType",n}return t}(Ce),zi=new w4,$4=function(e){Ze(t,e);function t(){var n=e.call(this,"number",function(r){return typeof r=="number"},function(r,i){return n.is(r)?Ee(r):et(r,i)},Pe)||this;return n._tag="NumberType",n}return t}(Ce),Oc=new $4,E4=function(e){Ze(t,e);function t(){var n=e.call(this,"bigint",function(r){return typeof r=="bigint"},function(r,i){return n.is(r)?Ee(r):et(r,i)},Pe)||this;return n._tag="BigIntType",n}return t}(Ce),Jbe=new E4,R4=function(e){Ze(t,e);function t(){var n=e.call(this,"boolean",function(r){return typeof r=="boolean"},function(r,i){return n.is(r)?Ee(r):et(r,i)},Pe)||this;return n._tag="BooleanType",n}return t}(Ce),h0=new R4,O4=function(e){Ze(t,e);function t(){var n=e.call(this,"UnknownArray",Array.isArray,function(r,i){return n.is(r)?Ee(r):et(r,i)},Pe)||this;return n._tag="AnyArrayType",n}return t}(Ce),xl=new O4,F4=function(e){Ze(t,e);function t(){var n=e.call(this,"UnknownRecord",function(r){var i=Object.prototype.toString.call(r);return i==="[object Object]"||i==="[object Window]"},function(r,i){return n.is(r)?Ee(r):et(r,i)},Pe)||this;return n._tag="AnyDictionaryType",n}return t}(Ce),Qn=new F4,M4=function(e){Ze(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.value=a,u._tag="LiteralType",u}return t}(Ce);function sh(e,t){t===void 0&&(t=JSON.stringify(e));var n=function(r){return r===e};return new M4(t,n,function(r,i){return n(r)?Ee(e):et(r,i)},Pe,e)}var k4=function(e){Ze(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.keys=a,u._tag="KeyofType",u}return t}(Ce);function Zbe(e,t){t===void 0&&(t=Object.keys(e).map(function(r){return JSON.stringify(r)}).join(" | "));var n=function(r){return zi.is(r)&&Ts.call(e,r)};return new k4(t,n,function(r,i){return n(r)?Ee(r):et(r,i)},Pe,e)}var L4=function(e){Ze(t,e);function t(n,r,i,o,a,u){var s=e.call(this,n,r,i,o)||this;return s.type=a,s.predicate=u,s._tag="RefinementType",s}return t}(Ce);function m0(e,t,n){return wE(e,t,n)}var ym=m0(Oc,function(e){return Number.isInteger(e)},"Int"),SE=function(e){Ze(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.runDefinition=a,u._tag="RecursiveType",u}return t}(Ce);Object.defineProperty(SE.prototype,"type",{get:function(){return this.runDefinition()},enumerable:!0,configurable:!0});function _E(e,t){var n,r=function(){return n||(n=t(i),n.name=e),n},i=new SE(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 j4=function(e){Ze(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.type=a,u._tag="ArrayType",u}return t}(Ce);function g0(e,t){return t===void 0&&(t="Array<".concat(e.name,">")),new j4(t,function(n){return xl.is(n)&&n.every(e.is)},function(n,r){var i=xl.validate(n,r);if(ie(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,Ei(r,String(c),e,l));if(ie(f))ta(s,f.left);else{var p=f.right;p!==l&&(u===o&&(u=o.slice()),u[c]=p)}}return s.length>0?Eo(s):Ee(u)},e.encode===Pe?Pe:function(n){return n.map(e.encode)},e)}var U4=function(e){Ze(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.props=a,u._tag="InterfaceType",u}return t}(Ce);function k1(e,t){t===void 0&&(t=h4(e));var n=Object.keys(e),r=n.map(function(o){return e[o]}),i=n.length;return new U4(t,function(o){if(Qn.is(o)){for(var a=0;a<i;a++){var u=n[a],s=o[u];if(s===void 0&&!Ts.call(o,u)||!r[a].is(s))return!1}return!0}return!1},function(o,a){var u=Qn.validate(o,a);if(ie(u))return u;for(var s=u.right,c=s,l=[],f=0;f<i;f++){var p=n[f],A=c[p],h=r[f],v=h.validate(A,Ei(a,p,h,A));if(ie(v))ta(l,v.left);else{var _=v.right;(_!==A||_===void 0&&!Ts.call(c,p))&&(c===s&&(c=Tl({},s)),c[p]=_)}}return l.length>0?Eo(l):Ee(c)},Gd(r)?Pe:function(o){for(var a=Tl({},o),u=0;u<i;u++){var s=n[u],c=r[u].encode;c!==Pe&&(a[s]=c(o[s]))}return a},e)}var B4=function(e){Ze(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.props=a,u._tag="PartialType",u}return t}(Ce);function Xbe(e,t){t===void 0&&(t=m4(h4(e)));var n=Object.keys(e),r=n.map(function(o){return e[o]}),i=n.length;return new B4(t,function(o){if(Qn.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=Qn.validate(o,a);if(ie(u))return u;for(var s=u.right,c=s,l=[],f=0;f<i;f++){var p=n[f],A=c[p],h=e[p],v=h.validate(A,Ei(a,p,h,A));if(ie(v))A!==void 0&&ta(l,v.left);else{var _=v.right;_!==A&&(c===s&&(c=Tl({},s)),c[p]=_)}}return l.length>0?Eo(l):Ee(c)},Gd(r)?Pe:function(o){for(var a=Tl({},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 IE=function(e){Ze(t,e);function t(n,r,i,o,a,u){var s=e.call(this,n,r,i,o)||this;return s.domain=a,s.codomain=u,s._tag="DictionaryType",s}return t}(Ce);function TE(e,t,n){var r=CE(e);return r?Ube(Object.keys(r),e,t,n):Bbe(e,t,n)}var xE=function(e){Ze(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.types=a,u._tag="UnionType",u}return t}(Ce);function ch(e,t){t===void 0&&(t=g4(e));var n=S4(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 bm(t,function(u){if(Qn.is(u)){var s=a(u[r]);return s!==void 0?e[s].is(u):!1}return!1},function(u,s){var c=Qn.validate(u,s);if(ie(c))return c;var l=c.right,f=a(l[r]);if(f===void 0)return et(u,s);var p=e[f];return p.validate(l,Ei(s,String(f),p,l))},Gd(e)?Pe: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 xE(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],p=f.validate(u,Ei(s,String(l),f,u));if(ie(p))ta(c,p.left);else return Ee(p.right)}return Eo(c)},Gd(e)?Pe: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 W4=function(e){Ze(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.types=a,u._tag="IntersectionType",u}return t}(Ce);function e1e(e,t){t===void 0&&(t="(".concat(e.map(function(r){return r.name}).join(" & "),")"));var n=e.length;return new W4(t,function(r){return e.every(function(i){return i.is(r)})},e.length===0?Ee:function(r,i){for(var o=[],a=[],u=0;u<n;u++){var s=e[u],c=s.validate(r,Ei(i,String(u),s,r));ie(c)?ta(a,c.left):o.push(c.right)}return a.length>0?Eo(a):Ee(O1(r,o))},e.length===0?Pe:function(r){return O1(r,e.map(function(i){return i.encode(r)}))},e)}var K4=function(e){Ze(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.types=a,u._tag="TupleType",u}return t}(Ce);function t1e(e,t){t===void 0&&(t="[".concat(e.map(function(r){return r.name}).join(", "),"]"));var n=e.length;return new K4(t,function(r){return xl.is(r)&&r.length===n&&e.every(function(i,o){return i.is(r[o])})},function(r,i){var o=xl.validate(r,i);if(ie(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],p=f.validate(l,Ei(i,String(c),f,l));if(ie(p))ta(s,p.left);else{var A=p.right;A!==l&&(u===a&&(u=a.slice()),u[c]=A)}}return s.length>0?Eo(s):Ee(u)},Gd(e)?Pe:function(r){return e.map(function(i,o){return i.encode(r[o])})},e)}var P4=function(e){Ze(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.type=a,u._tag="ReadonlyType",u}return t}(Ce);function n1e(e,t){return t===void 0&&(t="Readonly<".concat(e.name,">")),new P4(t,e.is,e.validate,e.encode,e)}var D4=function(e){Ze(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.type=a,u._tag="ReadonlyArrayType",u}return t}(Ce);function N4(e,t){t===void 0&&(t="ReadonlyArray<".concat(e.name,">"));var n=g0(e);return new D4(t,n.is,n.validate,n.encode,e)}var Jd=function(e,t){return Q4(k1(e),t)},q4=function(e){Ze(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.type=a,u._tag="ExactType",u}return t}(Ce);function Q4(e,t){t===void 0&&(t=Wbe(e));var n=F1(e);return new q4(t,e.is,function(r,i){var o=Qn.validate(r,i);if(ie(o))return o;var a=e.validate(r,i);return ie(a)?a:ze(IO(a.right,n))},function(r){return e.encode(IO(r,n))},e)}var V4=function(e){Ze(t,e);function t(){var n=e.call(this,"Function",function(r){return typeof r=="function"},function(r,i){return n.is(r)?Ee(r):et(r,i)},Pe)||this;return n._tag="FunctionType",n}return t}(Ce),r1e=new V4,bm=function(e){Ze(t,e);function t(n,r,i,o,a,u){var s=e.call(this,n,r,i,o,a)||this;return s.tag=u,s}return t}(xE),i1e=function(e,t,n){n===void 0&&(n=g4(t));var r=ch(t,n);return r instanceof bm?r:(console.warn("[io-ts] Cannot build a tagged union for ".concat(n,", returning a de-optimized union")),new bm(n,r.is,r.validate,r.encode,t,e))},o1e=function(e,t){return{value:e,context:t}},z4=function(e){return[{key:"",type:e}]},H4=function(e){Ze(t,e);function t(){var n=e.call(this,"never",function(r){return!1},function(r,i){return et(r,i)},function(){throw new Error("cannot encode never")})||this;return n._tag="NeverType",n}return t}(Ce),a1e=new H4,Y4=function(e){Ze(t,e);function t(){var n=e.call(this,"any",function(r){return!0},Ee,Pe)||this;return n._tag="AnyType",n}return t}(Ce),u1e=new Y4,s1e=Qn,G4=function(e){Ze(t,e);function t(){var n=e.call(this,"object",function(r){return r!==null&&typeof r=="object"},function(r,i){return n.is(r)?Ee(r):et(r,i)},Pe)||this;return n._tag="ObjectType",n}return t}(Ce),c1e=new G4;function wE(e,t,n){return n===void 0&&(n="(".concat(e.name," | ").concat(A4(t),")")),new L4(n,function(r){return e.is(r)&&t(r)},function(r,i){var o=e.validate(r,i);if(ie(o))return o;var a=o.right;return t(a)?Ee(a):et(a,i)},e.encode,e,t)}var l1e=wE(Oc,Number.isInteger,"Integer"),f1e=TE,d1e=function(e){Ze(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.props=a,u._tag="StrictType",u}return t}(Ce);function p1e(e){return e}function A1e(e){return function(){return e}}const h1e=Object.freeze(Object.defineProperty({__proto__:null,AnyArrayType:O4,AnyDictionaryType:F4,AnyType:Y4,Array:xl,ArrayType:j4,BigIntType:E4,BooleanType:R4,Dictionary:s1e,DictionaryType:IE,ExactType:q4,Function:r1e,FunctionType:V4,Int:ym,Integer:l1e,InterfaceType:U4,IntersectionType:W4,KeyofType:k4,LiteralType:M4,NeverType:H4,NullType:_4,NumberType:$4,ObjectType:G4,PartialType:B4,ReadonlyArrayType:D4,ReadonlyType:P4,RecursiveType:SE,RefinementType:L4,StrictType:d1e,StringType:w4,TaggedUnionType:bm,TupleType:K4,Type:Ce,UndefinedType:I4,UnionType:xE,UnknownArray:xl,UnknownRecord:Qn,UnknownType:x4,VoidType:T4,alias:A1e,any:u1e,appendContext:Ei,array:g0,bigint:Jbe,boolean:h0,brand:m0,clean:p1e,dictionary:f1e,emptyTags:rr,exact:Q4,failure:et,failures:Eo,getContextEntry:jbe,getDefaultContext:z4,getDomainKeys:CE,getFunctionName:A4,getIndex:S4,getTags:Ga,getValidationError:o1e,identity:Pe,interface:k1,intersection:e1e,keyof:Zbe,literal:sh,mergeAll:O1,never:a1e,null:M1,nullType:M1,number:Oc,object:c1e,partial:Xbe,readonly:n1e,readonlyArray:N4,record:TE,recursion:_E,refinement:wE,strict:Jd,string:zi,success:Ee,taggedUnion:i1e,tuple:t1e,type:k1,undefined:vm,union:ch,unknown:Gbe,void:xO,voidType:xO},Symbol.toStringTag,{value:"Module"})),Y=Ws(h1e);var lh={};Object.defineProperty(lh,"__esModule",{value:!0});lh.ContentPath=void 0;const wO="::";lh.ContentPath={serialize(e){return e.map(t=>t.key).join(wO)},current(e){return e[e.length-1]},append(e,t){return e+wO+t},make(e){return e.reduce((t,{key:n,type:r})=>n?t.concat({key:n,type:r}):t,[])}};var Fc={},v0={};Object.defineProperty(v0,"__esModule",{value:!0});v0.getAssetOrThrow=void 0;const m1e=e=>t=>{const n=e[t];if(!n)throw new Error(`Missing asset with id '${t}'!`);return n};v0.getAssetOrThrow=m1e;var y0={};Object.defineProperty(y0,"__esModule",{value:!0});y0.getEmbedOrThrow=void 0;const g1e=e=>t=>{const n=e[t];if(!n)throw new Error(`Missing embed with url '${t}'`);return n};y0.getEmbedOrThrow=g1e;var b0={},Je={};const Hi=Ws(Ok);function J4(e,t,n){return n===void 0&&(n=e.name),new Ce(n,e.is,e.validate,function(r){return t(e.encode(r))})}const v1e=Object.freeze(Object.defineProperty({__proto__:null,mapOutput:J4},Symbol.toStringTag,{value:"Module"}));var Z4=m0(zi,function(e){return e.length>0},"NonEmptyString");function X4(e,t){t===void 0&&(t="NonEmptyArray<"+e.name+">");var n=g0(e);return new Ce(t,function(r){return n.is(r)&&qt(r)},function(r,i){return ce(n.validate(r,i),ri(function(o){var a=BS(o);return Ne(a)?et(r,i):Ee(a.value)}))},function(r){return n.encode(r)})}function e9(e,t,n){n===void 0&&(n="Set<"+e.name+">");var r=g0(e),i=z6(t),o=q6(t);return new Ce(n,function(a){return a instanceof Set&&V6(e.is)(a)},function(a,u){return ce(r.validate(a,u),ri(function(s){var c=o(s);return c.size!==s.length?et(a,u):Ee(c)}))},function(a){return r.encode(i(a))})}function y1e(e,t,n){return n===void 0&&(n="ReadonlySet<"+e.name+">"),e9(e,t,n)}function $E(e,t){return new Ce(e,t,function(n,r){return t(n)?Ee(n):et(n,r)},Pe)}var b1e=function(e){return e instanceof Date},C1e=$E("Date",b1e),S1e=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))},_1e=function(e,t){return{get:e,reverseGet:t}},t9=function(e){return Nu(e.get,z(e.reverseGet,lr))},I1e=function(e){return Mc(z(e.get,It),e.reverseGet)},T1e=function(e){return Ka(z(e.get,It),z(e.reverseGet,lr))},x1e=function(e){return ud(function(t){return function(n){return function(r){return t.map(n(e.get(r)),function(i){return e.reverseGet(i)})}}})},Nu=function(e,t){return{get:e,set:t}},EE=function(e){return Ka(z(e.get,It),e.set)},w1e=function(e){return ud(function(t){return function(n){return function(r){return t.map(n(e.get(r)),function(i){return e.set(i)(r)})}}})},n9=function(e){return function(t){return Nu(function(n){return e.get(t.get(n))},function(n){return function(r){return t.set(e.set(n)(t.get(r)))(r)}})}},$1e=function(e){return function(t){return Mc(z(t.getOption,Hp(e.getOption)),z(e.reverseGet,t.reverseGet))}},E1e=function(e){return function(t){return kc(RE(e))(EE(t))}},R1e=function(){return Nu(P,lr)},O1e=function(e){return function(t){return Nu(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)}})}},F1e=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(n){return Nu(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}})}},M1e=function(e){return function(t){return Nu(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)}})}},k1e=function(e){return function(t){return ce(t,n9(nCe().at(e)))}},Mc=function(e,t){return{getOption:e,reverseGet:t}},RE=function(e){return Ka(e.getOption,function(t){return i9(t)(e)})},r9=function(e){return ud(function(t){return function(n){return function(r){return ce(e.getOption(r),_u(function(){return t.of(r)},function(i){return t.map(n(i),function(o){return i9(o)(e)(r)})}))}}})},L1e=function(e){return function(t){return function(n){return ce(t.getOption(n),mo(function(r){var i=e(r);return i===r?n:t.reverseGet(i)}))}}},j1e=function(e){return function(t){var n=L1e(e)(t);return function(r){return ce(n(r),mI(function(){return r}))}}},i9=function(e){return j1e(function(){return e})},U1e=function(e){return function(t){return kc(EE(e))(RE(t))}},B1e=function(){return Mc(Hs,P)},OE=function(e){return Mc(mv(e),P)},W1e=function(){return Mc(P,It)},K1e=function(){return Mc(pf,ze)},P1e=function(){return Mc(function(e){return ie(e)?It(e.left):ot},wt)},Ka=function(e,t){return{getOption:e,set:t}},D1e=function(e){return ud(function(t){return function(n){return function(r){return ce(e.getOption(r),_u(function(){return t.of(r)},function(i){return t.map(n(i),function(o){return e.set(o)(r)})}))}}})},o9=function(e){return function(t){return function(n){return ce(t.getOption(n),mo(function(r){var i=e(r);return i===r?n:t.set(i)(n)}))}}},a9=function(e){return function(t){var n=o9(e)(t);return function(r){return ce(n(r),mI(function(){return r}))}}},kc=function(e){return function(t){return Ka(z(t.getOption,Hp(e.getOption)),function(n){return a9(e.set(n))(t)})}},N1e=function(e){return function(t){return ce(t,kc(Z1e().index(e)))}},q1e=function(e){return function(t){return ce(t,kc(X1e().index(e)))}},Q1e=function(e){return function(t){return ce(t,kc(eCe().index(e)))}},V1e=function(e){return Ka(Gg(e),function(t){return function(n){return ce(Yg(e)(n),_u(function(){return n},function(r){return av(r,t,n)}))}})},u9=function(e,t,n){if(n[e]===t)return n;var r=S1e([n[0]],n.slice(1),!0);return r[e]=t,r},z1e=function(e){return Ka(Gg(e),function(t){return function(n){return ce(Yg(e)(n),_u(function(){return n},function(r){return u9(r,t,n)}))}})},ud=function(e){return{modifyF:e}};function FE(e){return function(t){return ud(function(n){return function(r){return t.modifyF(n)(e.modifyF(n)(r))}})}}var H1e={URI:"Identity",map:function(e,t){return t(e)},of:P,ap:function(e,t){return e(t)}},Y1e=function(e){return e.URI==="Identity"};function G1e(e){return function(){return ud(function(t){var n=Y1e(t)?e.map:e.traverse(t);return function(r){return function(i){return n(i,r)}}})}}function J1e(e){return FE(G1e(e)())}var ME=function(e){return{index:e}},Z1e=function(){return ME(function(e){return Ka(function(t){return bs(e,t)},function(t){return function(n){return ce(bs(e,n),_u(function(){return n},function(){return av(e,t,n)}))}})})},X1e=function(){return ME(function(e){return Ka(function(t){return bs(e,t)},function(t){return function(n){return ce(bs(e,n),_u(function(){return n},function(){return u9(e,t,n)}))}})})},eCe=function(){return ME(function(e){return Ka(function(t){return Cs(e,t)},function(t){return function(n){return n[e]===t||Ne(Cs(e,n))?n:mw(e,t)(n)}})})},tCe=function(e){return{at:e}};function nCe(){return tCe(function(e){return Nu(function(t){return Cs(e,t)},_u(function(){return iw(e)},function(t){return mw(e,t)}))})}var s9=_1e,L1=t9,j1=I1e,U1=T1e,B1=x1e,rCe=function(e){return function(t){return s9(z(t.get,e.get),z(e.reverseGet,t.reverseGet))}},iCe=function(e){return s9(e.reverseGet,e.get)},oCe=function(e){return function(t){return function(n){return t.reverseGet(e(t.get(n)))}}},c9=Nu,Cm=R1e,cu=EE,wl=w1e,xs=n9,aCe=xs,uCe=z(t9,xs),Lc=E1e,kE=function(e){return z(cu,kc(e))},sCe=function(e){return z(wl,FE(e))},l9=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 cCe(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 lCe=function(e){return Lc(B1e())(e)};function fCe(e){return Lc(OE(e))}var f9=O1e,d9=F1e,dCe=M1e,pCe=function(e){return z(cu,N1e(e))},ACe=function(e){return z(cu,q1e(e))},hCe=function(e){return z(cu,Q1e(e))},mCe=k1e,gCe=Lc(W1e()),vCe=Lc(K1e()),yCe=Lc(P1e());function bCe(e){return z(wl,J1e(e))}function CCe(e){return kE(V1e(e))}function SCe(e){return kE(z1e(e))}var _Ce=function(e,t){return function(n){return p9(n,e,t)}},p9=function(e,t,n){return c9(z(e.get,t),z(n,e.set))},C0="monocle-ts/Lens",ICe={URI:C0,imap:p9},A9={URI:C0,compose:function(e,t){return xs(e)(t)}},TCe={URI:C0,compose:A9.compose,id:Cm};const xCe=Object.freeze(Object.defineProperty({__proto__:null,Category:TCe,Invariant:ICe,Semigroupoid:A9,URI:C0,asOptional:cu,asTraversal:wl,atKey:mCe,component:dCe,compose:xs,composeIso:uCe,composeLens:aCe,composeOptional:kE,composePrism:Lc,composeTraversal:sCe,filter:fCe,findFirst:CCe,findFirstNonEmpty:SCe,fromNullable:lCe,id:Cm,imap:_Ce,index:pCe,indexNonEmpty:ACe,key:hCe,left:yCe,lens:c9,modify:l9,modifyF:cCe,prop:f9,props:d9,right:vCe,some:gCe,traverse:bCe},Symbol.toStringTag,{value:"Module"}));var $O=D1e,is=kc,wCe=o9,$Ce=a9,ECe=OE,W1=RE,K1=r9,P1=$1e,RCe=U1e,Ho=FE,h9=function(e){return function(t){return t.modifyF(H1e)(e)}},OCe=function(e){return h9(function(){return e})};function FCe(e){return Ho(r9(OE(e)))}var EO=function(e){return new g9(e.get,e.reverseGet)},ul=function(e){return new LE(e.get,e.set)},xd=function(e){return new v9(e.getOption,e.reverseGet)},Gr=function(e){return new MCe(e.getOption,e.set)},Sr=function(e){return new kCe(e.modifyF)},m9=function(e,t,n){var r;return n===e[t]?e:Object.assign({},e,(r={},r[t]=n,r))},g9=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 EO(iCe(this))},e.prototype.modify=function(t){return oCe(t)(this)},e.prototype.asLens=function(){return ul(L1(this))},e.prototype.asPrism=function(){return xd(j1(this))},e.prototype.asOptional=function(){return Gr(U1(this))},e.prototype.asTraversal=function(){return Sr(B1(this))},e.prototype.asFold=function(){var t=this;return new sd(function(){return function(n){return function(r){return n(t.get(r))}}})},e.prototype.asGetter=function(){var t=this;return new b9(function(n){return t.get(n)})},e.prototype.asSetter=function(){var t=this;return new fh(function(n){return t.modify(n)})},e.prototype.compose=function(t){return EO(rCe(t)(this))},e.prototype.composeIso=function(t){return this.compose(t)},e.prototype.composeLens=function(t){return ul(ce(this,L1,xs(t)))},e.prototype.composePrism=function(t){return xd(ce(this,j1,P1(t)))},e.prototype.composeOptional=function(t){return Gr(ce(this,U1,is(t)))},e.prototype.composeTraversal=function(t){return Sr(ce(this,B1,Ho(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}(),LE=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 ul(ce(Cm(),f9(t)))}},e.fromProps=function(){return function(t){return ul(ce(Cm(),d9.apply(xCe,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 m9(i,t,r)}})}},e.prototype.modify=function(t){return l9(t)(this)},e.prototype.asOptional=function(){return Gr(cu(this))},e.prototype.asTraversal=function(){return Sr(wl(this))},e.prototype.asSetter=function(){var t=this;return new fh(function(n){return t.modify(n)})},e.prototype.asGetter=function(){var t=this;return new b9(function(n){return t.get(n)})},e.prototype.asFold=function(){var t=this;return new sd(function(){return function(n){return function(r){return n(t.get(r))}}})},e.prototype.compose=function(t){return ul(xs(t)(this))},e.prototype.composeLens=function(t){return this.compose(t)},e.prototype.composeGetter=function(t){return this.asGetter().compose(t)},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeOptional=function(t){return Gr(ce(this,cu,is(t)))},e.prototype.composeTraversal=function(t){return Sr(ce(this,wl,Ho(t)))},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e.prototype.composeIso=function(t){return ul(ce(this,xs(ce(t,L1))))},e.prototype.composePrism=function(t){return Gr(Lc(t)(this))},e}(),v9=function(){function e(t,n){this.getOption=t,this.reverseGet=n,this._tag="Prism"}return e.fromPredicate=function(t){return xd(ECe(t))},e.some=function(){return y9},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 W2.map(n.getOption(r),function(i){var o=t(i);return o===i?r:n.reverseGet(o)})}},e.prototype.set=function(t){return this.modify(function(){return t})},e.prototype.asOptional=function(){return Gr(W1(this))},e.prototype.asTraversal=function(){return Sr(K1(this))},e.prototype.asSetter=function(){var t=this;return new fh(function(n){return t.modify(n)})},e.prototype.asFold=function(){var t=this;return new sd(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 xd(P1(t)(this))},e.prototype.composePrism=function(t){return this.compose(t)},e.prototype.composeOptional=function(t){return Gr(ce(this,W1,is(t)))},e.prototype.composeTraversal=function(t){return Sr(ce(this,K1,Ho(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 xd(ce(this,P1(ce(t,j1))))},e.prototype.composeLens=function(t){return Gr(RCe(t)(this))},e.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},e}(),y9=new v9(P,It),MCe=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:m9(r,t,n)}})}},e.fromOptionProp=function(){var t=LE.fromProp();return function(n){return t(n).composePrism(y9)}},e.prototype.modify=function(t){return $Ce(t)(this)},e.prototype.modifyOption=function(t){return wCe(t)(this)},e.prototype.asTraversal=function(){return Sr($O(this))},e.prototype.asFold=function(){var t=this;return new sd(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 fh(function(n){return t.modify(n)})},e.prototype.compose=function(t){return Gr(is(t)(this))},e.prototype.composeOptional=function(t){return this.compose(t)},e.prototype.composeTraversal=function(t){return Sr(ce(this,$O,Ho(t)))},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e.prototype.composeLens=function(t){return Gr(ce(this,is(ce(t,cu))))},e.prototype.composePrism=function(t){return Gr(ce(this,is(ce(t,W1))))},e.prototype.composeIso=function(t){return Gr(ce(this,is(ce(t,U1))))},e.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},e}(),kCe=function(){function e(t){this.modifyF=t,this._tag="Traversal"}return e.prototype.modify=function(t){return h9(t)(this)},e.prototype.set=function(t){return OCe(t)(this)},e.prototype.filter=function(t){return Sr(FCe(t)(this))},e.prototype.asFold=function(){var t=this;return new sd(function(n){return function(r){return t.modifyF(D2(n))(function(i){return Af(r(i))})}})},e.prototype.asSetter=function(){var t=this;return new fh(function(n){return t.modify(n)})},e.prototype.compose=function(t){return Sr(Ho(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 Sr(ce(this,Ho(ce(t,wl))))},e.prototype.composePrism=function(t){return Sr(ce(this,Ho(ce(t,K1))))},e.prototype.composeIso=function(t){return Sr(ce(this,Ho(ce(t,B1))))},e.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},e}(),b9=function(){function e(t){this.get=t,this._tag="Getter"}return e.prototype.asFold=function(){var t=this;return new sd(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}(),sd=function(){function e(t){this.foldMap=t,this._tag="Fold",this.getAll=t(Y_())(Su),this.exist=t(mP),this.all=t(hP),this.foldMapFirst=t(K2())}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(mv(t))},e.prototype.headOption=function(t){return this.find(function(){return!0})(t)},e}(),fh=function(){function e(t){this.modify=t,this._tag="Setter"}return e.prototype.set=function(t){return this.modify(lr(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}(),LCe=new g9(ml,ml);function jCe(){return LCe}function UCe(e,t){t===void 0&&(t="fromNewtype("+e.name+")");var n=jCe();return new Ce(t,function(r){return e.is(r)},function(r,i){return ce(e.validate(r,i),Zs(n.wrap))},function(r){return e.encode(n.unwrap(r))})}var BCe=Jd({_tag:sh("None")}),WCe=sh("Some");function C9(e,t){return t===void 0&&(t="Option<"+e.name+">"),ch([BCe,Jd({_tag:WCe,value:e},"Some<"+e.name+">")],t)}function KCe(e,t){return t===void 0&&(t="Option<"+e.name+">"),new Ce(t,C9(e).is,function(n,r){return n==null?Ee(ot):ce(e.validate(n,r),Zs(It))},function(n){return gI(ce(n,mo(e.encode)))})}var PCe=new Ce("DateFromISOString",function(e){return e instanceof Date},function(e,t){return ce(zi.validate(e,t),ri(function(n){var r=new Date(n);return isNaN(r.getTime())?et(e,t):Ee(r)}))},function(e){return e.toISOString()});function DCe(e,t){return t===void 0&&(t="ReadonlyNonEmptyArray<"+e.name+">"),X4(e,t)}function S9(e){var t=Object.create(Object.getPrototypeOf(e));return Object.assign(t,e),t}var NCe=new Ce("DateFromNumber",function(e){return e instanceof Date},function(e,t){return ce(Oc.validate(e,t),ri(function(n){var r=new Date(n);return isNaN(r.getTime())?et(e,t):Ee(r)}))},function(e){return e.getTime()});function S0(e,t,n){n===void 0&&(n=e.name);var r=S9(e);return r.validate=t,r.decode=function(i){return t(i,z4(r))},r.name=n,r}function qCe(e,t,n){return n===void 0&&(n="withFallback("+e.name+")"),S0(e,function(r,i){return vB(function(){return Ee(t)})(e.validate(r,i))},n)}var QCe=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,VCe=m0(zi,function(e){return QCe.test(e)},"UUID");function zCe(e,t,n){return n===void 0&&(n="fromNullable("+e.name+")"),S0(e,function(r,i){return r==null?Ee(t):e.validate(r,i)},n)}var HCe=new Ce("BooleanFromString",h0.is,function(e,t){return ce(zi.validate(e,t),ri(function(n){return n==="true"?Ee(!0):n==="false"?Ee(!1):et(e,t)}))},String);function YCe(e,t){return S0(e,function(n,r){return nA(function(){return[{value:n,context:r,message:t(n,r),actual:n}]})(e.validate(n,r))})}function _9(e){switch(e._tag){case"InterfaceType":return e.props;case"ExactType":return _9(e.type)}}var GCe=LE.fromProp();function JCe(e){var t={};for(var n in _9(e))t[n]=GCe(n);return t}var ZCe=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},XCe=$E("RegExp",ZCe),eSe=new Ce("DateFromUnixTime",function(e){return e instanceof Date},function(e,t){return ce(ym.validate(e,t),ri(function(n){var r=new Date(n*1e3);return isNaN(r.getTime())?et(e,t):Ee(r)}))},function(e){return Math.floor(e.getTime()/1e3)}),D1=new Ce("NumberFromString",Oc.is,function(e,t){return ce(zi.validate(e,t),ri(function(n){var r=+n;return isNaN(r)||n.trim()===""?et(e,t):Ee(r)}))},String),tSe=new Ce("IntFromString",ym.is,function(e,t){return ce(D1.validate(e,t),ri(function(n){return ym.is(n)?Ee(n):et(e,t)}))},D1.encode),I9=_E("JsonArray",function(){return N4(_0)}),T9=_E("JsonRecord",function(){return TE(zi,_0)}),_0=ch([h0,Oc,zi,M1,I9,T9],"Json"),nSe=new Ce("JsonFromString",_0.is,function(e,t){try{return Ee(JSON.parse(e))}catch{return et(e,t)}},function(e){return JSON.stringify(e)}),rSe=sh("Left"),iSe=sh("Right");function oSe(e,t,n){return n===void 0&&(n="Either<"+e.name+", "+t.name+">"),ch([Jd({_tag:rSe,left:e},"Left<"+e.name+">"),Jd({_tag:iSe,right:t},"Right<"+e.name+">")],n)}var aSe=new Ce("BigIntFromString",function(e){return typeof e=="bigint"},function(e,t){return ce(zi.validate(e,t),ri(function(n){if(!Z4.is(n.trim()))return et(e,t);try{return Ee(BigInt(n))}catch{return et(e,t)}}))},String);function uSe(e,t,n){return n===void 0&&(n=e.name),new Ce(n,e.is,e.validate,t)}var sSe=new Ce("BooleanFromNumber",h0.is,function(e,t){return ce(Oc.validate(e,t),Zs(function(n){return n!==0}))},Number);const cSe=Object.freeze(Object.defineProperty({__proto__:null,BigIntFromString:aSe,BooleanFromNumber:sSe,BooleanFromString:HCe,DateFromISOString:PCe,DateFromNumber:NCe,DateFromUnixTime:eSe,IntFromString:tSe,Json:_0,JsonArray:I9,JsonFromString:nSe,JsonRecord:T9,NonEmptyString:Z4,NumberFromString:D1,UUID:VCe,clone:S9,date:C1e,either:oSe,fromNewtype:UCe,fromNullable:zCe,fromRefinement:$E,getLenses:JCe,mapOutput:J4,nonEmptyArray:X4,option:C9,optionFromNullable:KCe,readonlyNonEmptyArray:DCe,readonlySetFromArray:y1e,regexp:XCe,setFromArray:e9,withEncode:uSe,withFallback:qCe,withMessage:YCe,withValidate:S0},Symbol.toStringTag,{value:"Module"})),I0=Ws(cSe),lSe=Ws(v1e);Object.defineProperty(Je,"__esModule",{value:!0});Je.withCustomError=Je.addType=Je.isEmpty=Je.objectToMap=Je.grouped=Je.formatDate=Je.formatDateTime=Je.filterDouble=Je.refineType=Je.nullable=void 0;const fSe=Q,x9=st,dSe=Hi,cl=(0,fSe.__importStar)(Y),pSe=I0,ASe=lSe;function hSe(e){return cl.union([e,cl.null,cl.undefined])}Je.nullable=hSe;function mSe(e,t,n){return new cl.Type(t,e.is,(r,i)=>(0,dSe.pipe)(e.validate(r,i),x9.either.chain(o=>n(o)?cl.success(o):cl.failure(r,i))),e.encode)}Je.refineType=mSe;function gSe(e){if(e==="")return null;const t=Number(e);return Number.isNaN(t)?null:t}Je.filterDouble=gSe;function vSe(e){return e.toISOString().replace(/\.\d{3}Z$/,"+0000")}Je.formatDateTime=vSe;function ySe(e){return e.toISOString().replace(/T.*/,"")}Je.formatDate=ySe;function bSe(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=bSe;function CSe(e){return new Map(Object.entries(e))}Je.objectToMap=CSe;function SSe(e){for(const t in e)return!1;return!0}Je.isEmpty=SSe;function _Se(e,t){return(0,ASe.mapOutput)(e,n=>({...n,__TYPE__:t}))}Je.addType=_Se;function ISe(e,t){return(0,pSe.withValidate)(e,(n,r)=>x9.either.mapLeft(i=>i.find(o=>o.message)?i:[{value:n,context:r,message:t(n,r),actual:n}])(e.validate(n,r)))}Je.withCustomError=ISe;Object.defineProperty(b0,"__esModule",{value:!0});b0.WidgetKey=void 0;const TSe=Q,xSe=(0,TSe.__importStar)(Y),wSe=Je,$Se=new RegExp("^[^<>]+$");b0.WidgetKey=(0,wSe.refineType)(xSe.string,"WidgetKey",e=>e.length===0||$Se.test(e));(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Q;(0,t.__exportStar)(v0,e),(0,t.__exportStar)(y0,e),(0,t.__exportStar)(b0,e)})(Fc);var le={},w9={},cd={},T0={},x0={};Object.defineProperty(x0,"__esModule",{value:!0});x0.clone=void 0;function ESe(e){var t=Object.create(Object.getPrototypeOf(e));return Object.assign(t,e),t}x0.clone=ESe;var RSe=Ae&&Ae.__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]}),OSe=Ae&&Ae.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),FSe=Ae&&Ae.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.hasOwnProperty.call(e,n)&&RSe(t,e,n);return OSe(t,e),t};Object.defineProperty(T0,"__esModule",{value:!0});T0.withValidate=void 0;var MSe=FSe(Y),kSe=x0;function LSe(e,t,n){n===void 0&&(n=e.name);var r=kSe.clone(e);return r.validate=t,r.decode=function(i){return t(i,MSe.getDefaultContext(r))},r.name=n,r}T0.withValidate=LSe;var jSe=Ae&&Ae.__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]}),USe=Ae&&Ae.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),BSe=Ae&&Ae.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.hasOwnProperty.call(e,n)&&jSe(t,e,n);return USe(t,e),t};Object.defineProperty(cd,"__esModule",{value:!0});cd.withFallback=void 0;var WSe=BSe(Y),KSe=T0,PSe=un;function DSe(e,t,n){return n===void 0&&(n="withFallback("+e.name+")"),KSe.withValidate(e,function(r,i){return PSe.orElse(function(){return WSe.success(t)})(e.validate(r,i))},n)}cd.withFallback=DSe;var sb={},Jt={};Object.defineProperty(Jt,"__esModule",{value:!0});Jt.EmptyArray=Jt.EmptyObject=Jt.Boolean=Jt.NumberOrNull=Jt.Number=Jt.StringOrNull=Jt.String=void 0;const NSe=Q,qSe=st,QSe=He,Pt=(0,NSe.__importStar)(Y),dh=Je;Jt.String=(0,dh.withCustomError)(Pt.string,()=>"The value must be a string");Jt.StringOrNull=(0,dh.withCustomError)(Pt.union([Pt.string,Pt.null]),()=>"The value must be a string or null");Jt.Number=(0,dh.withCustomError)(Pt.number,()=>"The value must be a number");Jt.NumberOrNull=(0,dh.withCustomError)(Pt.union([Pt.number,Pt.null]),()=>"The value must be a number or null");Jt.Boolean=(0,dh.withCustomError)(Pt.boolean,()=>"The value must be a boolean");Jt.EmptyObject=Pt.UnknownRecord.pipe(new Pt.Type("emptyObject",e=>Pt.UnknownRecord.is(e),(e,t)=>Object.keys(e).length>0?Pt.failure(e,t,"The object is not empty."):Pt.success({}),Pt.identity));Jt.EmptyArray=new Pt.Type("emptyArray",e=>Pt.UnknownArray.is(e)&&e.length===0,(e,t)=>(0,QSe.pipe)(Pt.UnknownArray.decode(e),qSe.either.chain(n=>n.length>0?Pt.failure(e,t,"The array is not empty."):Pt.success(new Array))),()=>[]);var Mh={};const Pa=Ws(xB);var RO;function VSe(){if(RO)return Mh;RO=1,Object.defineProperty(Mh,"__esModule",{value:!0});const e=Q,t=Pa,n=Hi,r=(0,e.__importStar)(Y),i=ct();return Mh.default=new r.Type("dateFromString",o=>o instanceof Date,(o,a)=>(0,n.pipe)(i.String.validate(o,a),(0,t.chain)(u=>{const s=new Date(u);return isNaN(s.getTime())?r.failure(o,a):r.success(s)})),o=>o.toISOString()),Mh}var jE={};Object.defineProperty(jE,"__esModule",{value:!0});const zSe=Q,HSe=Pa,YSe=Hi,Hc=(0,zSe.__importStar)(Y);jE.default=new Hc.Type("dateFromStringOrNumber",e=>e instanceof Date,(e,t)=>(0,YSe.pipe)(Hc.union([Hc.number,Hc.string]).validate(e,t),(0,HSe.chain)(n=>{const r=new Date(n);return isNaN(r.getTime())?Hc.failure(e,t):Hc.success(r)})),e=>e);var UE={};Object.defineProperty(UE,"__esModule",{value:!0});const GSe=Q,JSe=Pa,ZSe=Hi,kh=(0,GSe.__importStar)(Y);UE.default=new kh.Type("dateFromTsMs",e=>e instanceof Date,(e,t)=>(0,ZSe.pipe)(kh.number.validate(e,t),(0,JSe.chain)(n=>{const r=new Date(n);return isNaN(r.getTime())?kh.failure(e,t):kh.success(r)})),e=>e.getTime());var $9={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EmptyArrayOrElse=e.EmptyObjectOrElse=e.NullOrElse=e.DefaultOrElse=void 0;const t=Q,n=un,r=(0,t.__importStar)(Y),i=Jt,o=c=>l=>new r.Type(`DefaultOrElse<${c.name}, ${l.name}>`,f=>f===null||l.is(f),(f,p)=>(0,n.isRight)(c.validate(f,p))?r.success(null):l.validate(f,p),f=>f?l.encode(f):void 0);e.DefaultOrElse=o;const a=c=>(0,e.DefaultOrElse)(r.null)(c);e.NullOrElse=a;const u=c=>(0,e.DefaultOrElse)(i.EmptyObject)(c);e.EmptyObjectOrElse=u;const s=c=>(0,e.DefaultOrElse)(i.EmptyArray)(c);e.EmptyArrayOrElse=s})($9);var BE={};Object.defineProperty(BE,"__esModule",{value:!0});const XSe=Q,e_e=Pa,t_e=Hi,Ju=(0,XSe.__importStar)(Y);BE.default=new Ju.Type("IntFromNumber",Ju.Int.is,(e,t)=>(0,t_e.pipe)(Ju.number.validate(e,t),(0,e_e.chain)(n=>Ju.Int.is(n)?Ju.success(n):Ju.success(Math.round(n)))),Ju.Int.encode);var WE={};Object.defineProperty(WE,"__esModule",{value:!0});const n_e=Q,r_e=Pa,i_e=Hi,Yc=(0,n_e.__importStar)(Y),o_e=/^([0-9]+)px$/;WE.default=new Yc.Type("IntFromPixels",Yc.Int.is,(e,t)=>(0,i_e.pipe)(Yc.string.validate(e,t),(0,r_e.chain)(n=>{try{const r=n.match(o_e);if(!r)return Yc.failure(e,t);const i=parseInt(r[1]);return Yc.success(i)}catch{return Yc.failure(e,t)}})),String);var KE={};Object.defineProperty(KE,"__esModule",{value:!0});const a_e=Q,u_e=(0,a_e.__importStar)(Y),OO=Je;KE.default=(0,OO.withCustomError)((0,OO.refineType)(u_e.string,"nonEmptyString",e=>e.trim().length>0),()=>"The value must be a non-empty string");var PE={},w0={};Object.defineProperty(w0,"__esModule",{value:!0});const s_e=Q,c_e=(0,s_e.__importStar)(Y),l_e=Je;w0.default=(0,l_e.nullable)(c_e.string);Object.defineProperty(PE,"__esModule",{value:!0});const f_e=Q,d_e=Pa,p_e=Hi,cb=Y,A_e=(0,f_e.__importDefault)(w0);PE.default=new cb.Type("nonEmptyStringOrNull",e=>typeof e=="string"||e===null,(e,t)=>(0,p_e.pipe)(A_e.default.validate(e,t),(0,d_e.chain)(n=>typeof n=="string"&&n.length>0?(0,cb.success)(n):(0,cb.success)(null))),e=>e);var DE={};Object.defineProperty(DE,"__esModule",{value:!0});const h_e=Q,m_e=(0,h_e.__importStar)(Y),g_e=Je;DE.default=(0,g_e.nullable)(m_e.number);var NE={};Object.defineProperty(NE,"__esModule",{value:!0});const v_e=Q,Lh=(0,v_e.__importStar)(Y),FO=Jt;NE.default=(e,t,n)=>FO.Number.pipe(new Lh.Type("numberInRange",r=>FO.Number.is(r),(r,i)=>r>t||r<e?Lh.failure(r,i,`${n} must be a number between ${e} and ${t}`):Lh.success(r),Lh.identity));var qE={};Object.defineProperty(qE,"__esModule",{value:!0});const y_e=Q,b_e=Pa,C_e=Hi,jh=(0,y_e.__importStar)(Y);qE.default=new jh.Type("StringFromInt",jh.string.is,(e,t)=>(0,C_e.pipe)(jh.boolean.validate(e,t),(0,b_e.chain)(n=>jh.success(n.toString()))),e=>e);var QE={};Object.defineProperty(QE,"__esModule",{value:!0});const S_e=Q,__e=Pa,I_e=Hi,Uh=(0,S_e.__importStar)(Y);QE.default=new Uh.Type("StringFromInt",Uh.string.is,(e,t)=>(0,I_e.pipe)(Uh.number.validate(e,t),(0,__e.chain)(n=>Uh.success(n.toString()))),e=>e);var MO;function ct(){return MO||(MO=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.StringOrNull=e.StringFromNumber=e.StringFromBoolean=e.NumberRange=e.NumberOrNull=e.NonEmptyStringOrNull=e.NonEmptyString=e.IntFromPixels=e.IntFromNumber=e.Function=e.DateFromTsMs=e.DateFromStringOrNumber=e.DateFromString=void 0;const t=Q;(0,t.__exportStar)(Jt,e);var n=VSe();Object.defineProperty(e,"DateFromString",{enumerable:!0,get:function(){return(0,t.__importDefault)(n).default}});var r=jE;Object.defineProperty(e,"DateFromStringOrNumber",{enumerable:!0,get:function(){return(0,t.__importDefault)(r).default}});var i=UE;Object.defineProperty(e,"DateFromTsMs",{enumerable:!0,get:function(){return(0,t.__importDefault)(i).default}}),(0,t.__exportStar)($9,e),e.Function=(0,t.__importStar)(Je);var o=BE;Object.defineProperty(e,"IntFromNumber",{enumerable:!0,get:function(){return(0,t.__importDefault)(o).default}});var a=WE;Object.defineProperty(e,"IntFromPixels",{enumerable:!0,get:function(){return(0,t.__importDefault)(a).default}});var u=KE;Object.defineProperty(e,"NonEmptyString",{enumerable:!0,get:function(){return(0,t.__importDefault)(u).default}});var s=PE;Object.defineProperty(e,"NonEmptyStringOrNull",{enumerable:!0,get:function(){return(0,t.__importDefault)(s).default}});var c=DE;Object.defineProperty(e,"NumberOrNull",{enumerable:!0,get:function(){return(0,t.__importDefault)(c).default}});var l=NE;Object.defineProperty(e,"NumberRange",{enumerable:!0,get:function(){return(0,t.__importDefault)(l).default}});var f=qE;Object.defineProperty(e,"StringFromBoolean",{enumerable:!0,get:function(){return(0,t.__importDefault)(f).default}});var p=QE;Object.defineProperty(e,"StringFromNumber",{enumerable:!0,get:function(){return(0,t.__importDefault)(p).default}});var A=w0;Object.defineProperty(e,"StringOrNull",{enumerable:!0,get:function(){return(0,t.__importDefault)(A).default}})}(sb)),sb}var bi={},_r={},ld={},Da={},VE={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.BooleanField=e.BooleanConfig=e.BooleanFieldType=void 0;const n=(0,Q.__importStar)(Y),r=ct();e.BooleanFieldType="Boolean",e.BooleanConfig=n.exact(n.partial({label:r.StringOrNull,default_value:n.boolean,placeholder_true:n.string,placeholder_false:n.string})),e.BooleanField=n.exact(n.intersection([n.type({type:n.literal(e.BooleanFieldType)}),n.partial({config:e.BooleanConfig})]))})(VE);var zE={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Color=e.ColorConfig=e.ColorFieldType=void 0;const n=(0,Q.__importStar)(Y),r=ct();e.ColorFieldType="Color",e.ColorConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string})),e.Color=n.exact(n.intersection([n.type({type:n.literal(e.ColorFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.ColorConfig})]))})(zE);var HE={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Date=e.DateConfig=e.DateFieldType=void 0;const n=(0,Q.__importStar)(Y),r=ct();e.DateFieldType="Date",e.DateConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,default:n.string})),e.Date=n.exact(n.intersection([n.type({type:n.literal(e.DateFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.DateConfig})]))})(HE);var YE={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Embed=e.EmbedConfig=e.EmbedFieldType=void 0;const n=(0,Q.__importStar)(Y),r=ct();e.EmbedFieldType="Embed",e.EmbedConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,useAsTitle:n.boolean})),e.Embed=n.exact(n.intersection([n.type({type:n.literal(e.EmbedFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.EmbedConfig})]))})(YE);var GE={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.GeoPoint=e.GeoPointConfig=e.GeoPointFieldType=void 0;const n=(0,Q.__importStar)(Y),r=ct();e.GeoPointFieldType="GeoPoint",e.GeoPointConfig=n.exact(n.partial({label:r.StringOrNull})),e.GeoPoint=n.exact(n.intersection([n.type({type:n.literal(e.GeoPointFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.GeoPointConfig})]))})(GE);var JE={},ph={},$0={},fd={},ws={};Object.defineProperty(ws,"__esModule",{value:!0});ws.pipe=ws.pipeable=void 0;var N1=He,T_e=function(e){return typeof e.map=="function"},x_e=function(e){return typeof e.contramap=="function"},w_e=function(e){return typeof e.mapWithIndex=="function"},$_e=function(e){return typeof e.ap=="function"},E_e=function(e){return typeof e.chain=="function"},R_e=function(e){return typeof e.bimap=="function"},O_e=function(e){return typeof e.extend=="function"},F_e=function(e){return typeof e.reduce=="function"},M_e=function(e){return typeof e.reduceWithIndex=="function"},k_e=function(e){return typeof e.alt=="function"},L_e=function(e){return typeof e.compact=="function"},j_e=function(e){return typeof e.filter=="function"},U_e=function(e){return typeof e.filterWithIndex=="function"},B_e=function(e){return typeof e.promap=="function"},W_e=function(e){return typeof e.compose=="function"},K_e=function(e){return typeof e.throwError=="function"};function P_e(e){var t={};if(T_e(e)){var n=function(k){return function(E){return e.map(E,k)}};t.map=n}if(x_e(e)){var r=function(k){return function(E){return e.contramap(E,k)}};t.contramap=r}if(w_e(e)){var i=function(k){return function(E){return e.mapWithIndex(E,k)}};t.mapWithIndex=i}if($_e(e)){var o=function(k){return function(E){return e.ap(E,k)}},a=function(k){return function(E){return e.ap(e.map(E,function(D){return function(){return D}}),k)}};t.ap=o,t.apFirst=a,t.apSecond=function(k){return function(E){return e.ap(e.map(E,function(){return function(D){return D}}),k)}}}if(E_e(e)){var u=function(k){return function(E){return e.chain(E,k)}},s=function(k){return function(E){return e.chain(E,function(D){return e.map(k(D),function(){return D})})}},c=function(k){return e.chain(k,N1.identity)};t.chain=u,t.chainFirst=s,t.flatten=c}if(R_e(e)){var l=function(k,E){return function(D){return e.bimap(D,k,E)}},f=function(k){return function(E){return e.mapLeft(E,k)}};t.bimap=l,t.mapLeft=f}if(O_e(e)){var p=function(k){return function(E){return e.extend(E,k)}},A=function(k){return e.extend(k,N1.identity)};t.extend=p,t.duplicate=A}if(F_e(e)){var h=function(k,E){return function(D){return e.reduce(D,k,E)}},v=function(k){var E=e.foldMap(k);return function(D){return function(ue){return E(ue,D)}}},_=function(k,E){return function(D){return e.reduceRight(D,k,E)}};t.reduce=h,t.foldMap=v,t.reduceRight=_}if(M_e(e)){var S=function(k,E){return function(D){return e.reduceWithIndex(D,k,E)}},I=function(k){var E=e.foldMapWithIndex(k);return function(D){return function(ue){return E(ue,D)}}},T=function(k,E){return function(D){return e.reduceRightWithIndex(D,k,E)}};t.reduceWithIndex=S,t.foldMapWithIndex=I,t.reduceRightWithIndex=T}if(k_e(e)){var g=function(k){return function(E){return e.alt(E,k)}};t.alt=g}if(L_e(e)&&(t.compact=e.compact,t.separate=e.separate),j_e(e)){var C=function(k){return function(E){return e.filter(E,k)}},y=function(k){return function(E){return e.filterMap(E,k)}},x=function(k){return function(E){return e.partition(E,k)}},w=function(k){return function(E){return e.partitionMap(E,k)}};t.filter=C,t.filterMap=y,t.partition=x,t.partitionMap=w}if(U_e(e)){var M=function(k){return function(E){return e.filterWithIndex(E,k)}},O=function(k){return function(E){return e.filterMapWithIndex(E,k)}},F=function(k){return function(E){return e.partitionWithIndex(E,k)}},K=function(k){return function(E){return e.partitionMapWithIndex(E,k)}};t.filterWithIndex=M,t.filterMapWithIndex=O,t.partitionWithIndex=F,t.partitionMapWithIndex=K}if(B_e(e)){var N=function(k,E){return function(D){return e.promap(D,k,E)}};t.promap=N}if(W_e(e)){var J=function(k){return function(E){return e.compose(E,k)}};t.compose=J}if(K_e(e)){var Z=function(k){return function(E){return E._tag==="None"?e.throwError(k()):e.of(E.value)}},ae=function(k){return k._tag==="Left"?e.throwError(k.left):e.of(k.right)},ge=function(k,E){return function(D){return k(D)?e.of(D):e.throwError(E(D))}},se=function(k,E){return function(D){return e.chain(D,function(ue){return k(ue)?e.of(ue):e.throwError(E(ue))})}};t.fromOption=Z,t.fromEither=ae,t.fromPredicate=ge,t.filterOrElse=se}return t}ws.pipeable=P_e;ws.pipe=N1.pipe;var D_e=Ae&&Ae.__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]}),N_e=Ae&&Ae.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),q_e=Ae&&Ae.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.hasOwnProperty.call(e,n)&&D_e(t,e,n);return N_e(t,e),t};Object.defineProperty(fd,"__esModule",{value:!0});fd.NumberFromString=void 0;var pd=q_e(Y),Q_e=ws,V_e=un;fd.NumberFromString=new pd.Type("NumberFromString",pd.number.is,function(e,t){return Q_e.pipe(pd.string.validate(e,t),V_e.chain(function(n){var r=+n;return isNaN(r)||n.trim()===""?pd.failure(e,t):pd.success(r)}))},String);var z_e=Ae&&Ae.__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]}),H_e=Ae&&Ae.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Y_e=Ae&&Ae.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.hasOwnProperty.call(e,n)&&z_e(t,e,n);return H_e(t,e),t};Object.defineProperty($0,"__esModule",{value:!0});$0.IntFromString=void 0;var Ad=Y_e(Y),kO=fd,G_e=ws,J_e=un;$0.IntFromString=new Ad.Type("IntFromString",Ad.Int.is,function(e,t){return G_e.pipe(kO.NumberFromString.validate(e,t),J_e.chain(function(n){return Ad.Int.is(n)?Ad.success(n):Ad.failure(e,t)}))},kO.NumberFromString.encode);Object.defineProperty(ph,"__esModule",{value:!0});const Z_e=Q,X_e=un,Do=(0,Z_e.__importStar)(Y),eIe=$0,LO=ct(),jO=new Do.Type("SideConstraints",e=>!e||typeof e=="number",(e,t)=>X_e.either.chain(Do.union([Do.literal("auto"),Do.literal(""),Do.Int,eIe.IntFromString,LO.IntFromNumber,LO.IntFromPixels,Do.null]).validate(e,t),n=>n==="auto"||n===""?Do.success(null):Do.success(n)),e=>e),tIe=Do.partial({width:jO,height:jO});ph.default=tIe;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Image=e.ImageConfig=e.Thumbnail=e.ImageFieldType=void 0;const t=Q,n=(0,t.__importStar)(Y),r=ct(),i=(0,t.__importDefault)(ph);e.ImageFieldType="Image",e.Thumbnail=n.exact(n.intersection([n.type({name:n.string}),i.default])),e.ImageConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,constraint:i.default,thumbnails:n.readonlyArray(e.Thumbnail)})),e.Image=n.exact(n.intersection([n.type({type:n.literal(e.ImageFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.ImageConfig})]))})(JE);var ZE={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.IntegrationField=e.IntegrationFieldConfig=e.IntegrationFieldType=void 0;const n=(0,Q.__importStar)(Y),r=ct();e.IntegrationFieldType="IntegrationFields",e.IntegrationFieldConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,catalog:n.string})),e.IntegrationField=n.exact(n.intersection([n.type({type:n.literal(e.IntegrationFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.IntegrationFieldConfig})]))})(ZE);var XE={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Link=e.LinkConfig=e.LinkFieldType=void 0;const t=Q,n=un,r=(0,t.__importStar)(Y),i=cd,o=ct(),a=c=>{if(c instanceof Array&&c.reduce((f,p)=>f&&typeof p=="string",!0))return r.success(c)},u=c=>{if(typeof c=="string")return r.success([c])},s=new r.Type("MasksArrayString",c=>c instanceof Array,(c,l)=>n.either.chain(r.union([r.array(r.string),r.string]).validate(c,l),f=>a(f)||u(f)||r.failure(c,l)),c=>c);e.LinkFieldType="Link",e.LinkConfig=r.exact(r.partial({label:o.StringOrNull,useAsTitle:r.boolean,placeholder:r.string,select:(0,i.withFallback)(r.union([r.literal("media"),r.literal("document"),r.literal("web"),r.null]),null),customtypes:r.readonlyArray(r.string),masks:s,tags:s,allowTargetBlank:r.boolean})),e.Link=r.exact(r.intersection([r.type({type:r.literal(e.LinkFieldType)}),r.partial({fieldset:o.StringOrNull,config:e.LinkConfig})]))})(XE);var eR={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Number=e.NumberConfig=e.NumberFieldType=void 0;const n=(0,Q.__importStar)(Y),r=fd,i=ct();e.NumberFieldType="Number",e.NumberConfig=n.exact(n.partial({label:i.StringOrNull,placeholder:n.string,min:n.union([n.number,r.NumberFromString]),max:n.union([n.number,r.NumberFromString]),step:n.union([n.number,r.NumberFromString])})),e.Number=n.exact(n.intersection([n.type({type:n.literal(e.NumberFieldType)}),n.partial({fieldset:i.StringOrNull,config:e.NumberConfig})]))})(eR);var tR={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Range=e.RangeConfig=e.RangeFieldType=void 0;const n=(0,Q.__importStar)(Y),r=fd,i=ct();e.RangeFieldType="Range",e.RangeConfig=n.exact(n.partial({label:i.StringOrNull,placeholder:n.string,min:n.union([n.number,r.NumberFromString]),max:n.union([n.number,r.NumberFromString]),step:n.union([n.number,r.NumberFromString])})),e.Range=n.exact(n.intersection([n.type({type:n.literal(e.RangeFieldType)}),n.partial({fieldset:i.StringOrNull,config:e.RangeConfig})]))})(tR);var nR={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RichText=e.RichTextConfig=e.RichTextNodeTypeCodec=e.RichTextNodeType=e.DEFAULT_OPTION=e.RichTextFieldType=void 0;const t=Q,n=st,r=un,i=He,o=(0,t.__importStar)(Y),a=ct(),u=(0,t.__importDefault)(ph);e.RichTextFieldType="StructuredText",e.DEFAULT_OPTION="paragraph",e.RichTextNodeType={heading1:"heading1",heading2:"heading2",heading3:"heading3",heading4:"heading4",heading5:"heading5",heading6:"heading6",paragraph:"paragraph",strong:"strong",em:"em",preformatted:"preformatted",hyperlink:"hyperlink",image:"image",embed:"embed",list:"list-item",orderedList:"o-list-item",rtl:"rtl"},e.RichTextNodeTypeCodec=o.keyof({[e.RichTextNodeType.heading1]:null,[e.RichTextNodeType.heading2]:null,[e.RichTextNodeType.heading3]:null,[e.RichTextNodeType.heading4]:null,[e.RichTextNodeType.heading5]:null,[e.RichTextNodeType.heading6]:null,[e.RichTextNodeType.paragraph]:null,[e.RichTextNodeType.strong]:null,[e.RichTextNodeType.em]:null,[e.RichTextNodeType.preformatted]:null,[e.RichTextNodeType.hyperlink]:null,[e.RichTextNodeType.image]:null,[e.RichTextNodeType.embed]:null,[e.RichTextNodeType.list]:null,[e.RichTextNodeType.orderedList]:null,[e.RichTextNodeType.rtl]:null});const s=new o.Type("RichTextOptions",h=>typeof h=="string",h=>(0,i.pipe)(o.union([o.string,o.null]).decode(h),n.either.map(v=>{if(!v)return e.DEFAULT_OPTION;const S=v.split(",").map(I=>I.trim()).filter(I=>(0,r.getOrElseW)(()=>{})(e.RichTextNodeTypeCodec.decode(I)));return S.length?S.join(","):e.DEFAULT_OPTION})),h=>h),c=h=>{if(!h)return o.success([])},l=h=>{if(h instanceof Object){const v=h;if(!Object.entries(v).length)return o.success([]);if(v[""])return o.success(v[""].map(S=>S.name));const _=Object.entries(v).reduce((S,[,I])=>S.concat(I.map(T=>T.name)),[]).filter(Boolean);return o.success(_)}},f=h=>{if(h instanceof Array&&h.reduce((_,S)=>_&&typeof S=="string",!0))return o.success(h)},p=h=>{if(typeof h=="string")return o.success([h])},A=new o.Type("RichTextLabels",h=>h instanceof Array,(h,v)=>{const _=o.record(o.string,o.readonlyArray(o.record(o.literal("name"),o.string))),S=o.readonlyArray(o.string);return(0,i.pipe)(o.union([_,S,o.string,o.null]).decode(h),n.either.chain(I=>c(I)||f(I)||l(I)||p(I)||o.failure(h,v)))},h=>h);e.RichTextConfig=o.exact(o.partial({label:a.StringOrNull,placeholder:o.string,useAsTitle:o.boolean,single:s,multi:s,imageConstraint:u.default,labels:A,allowTargetBlank:o.boolean})),e.RichText=o.exact(o.intersection([o.type({type:o.literal(e.RichTextFieldType)}),o.partial({fieldset:a.StringOrNull,config:e.RichTextConfig})]))})(nR);var rR={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Select=e.SelectConfig=e.SelectFieldType=void 0;const n=(0,Q.__importStar)(Y),r=ct();e.SelectFieldType="Select",e.SelectConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,default_value:n.string,options:n.readonlyArray(n.union([n.string,r.StringFromNumber,r.StringFromBoolean]))})),e.Select=n.exact(n.intersection([n.type({type:n.literal(e.SelectFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.SelectConfig})]))})(rR);var iR={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Separator=e.SeparatorConfig=e.SeparatorFieldType=void 0;const n=(0,Q.__importStar)(Y),r=ct();e.SeparatorFieldType="Separator",e.SeparatorConfig=n.exact(n.partial({label:r.StringOrNull})),e.Separator=n.exact(n.intersection([n.type({type:n.literal(e.SeparatorFieldType)}),n.partial({config:e.SeparatorConfig})]))})(iR);var oR={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Text=e.TextConfig=e.TextFieldType=void 0;const n=(0,Q.__importStar)(Y),r=ct();e.TextFieldType="Text",e.TextConfig=n.exact(n.partial({label:r.StringOrNull,useAsTitle:n.boolean,placeholder:n.string})),e.Text=n.exact(n.intersection([n.type({type:n.literal(e.TextFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.TextConfig})]))})(oR);var aR={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Timestamp=e.TimestampConfig=e.TimestampFieldType=void 0;const n=(0,Q.__importStar)(Y),r=ct();e.TimestampFieldType="Timestamp",e.TimestampConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,default:n.string})),e.Timestamp=n.exact(n.intersection([n.type({type:n.literal(e.TimestampFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.TimestampConfig})]))})(aR);Object.defineProperty(Da,"__esModule",{value:!0});Da.NestableWidget=void 0;const nIe=Q,rIe=(0,nIe.__importStar)(Y),iIe=VE,oIe=zE,aIe=HE,uIe=YE,sIe=GE,cIe=JE,lIe=ZE,fIe=XE,dIe=eR,pIe=tR,AIe=nR,hIe=rR,mIe=iR,gIe=oR,vIe=aR;Da.NestableWidget=rIe.union([oIe.Color,iIe.BooleanField,uIe.Embed,sIe.GeoPoint,aIe.Date,dIe.Number,pIe.Range,AIe.RichText,hIe.Select,mIe.Separator,gIe.Text,vIe.Timestamp,fIe.Link,cIe.Image,lIe.IntegrationField]);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Group=e.GroupConfig=e.NestedGroup=e.NestedGroupConfig=e.GroupFieldType=void 0;const n=(0,Q.__importStar)(Y),r=Fc,i=ct(),o=Da;e.GroupFieldType="Group";const a=s=>n.exact(n.partial({label:i.StringOrNull,repeat:n.boolean,fields:n.record(r.WidgetKey,s)})),u=s=>n.exact(n.intersection([n.type({type:n.literal(e.GroupFieldType)}),n.partial({fieldset:i.StringOrNull,icon:n.string,description:n.string,config:a(s)})]));e.NestedGroupConfig=a(o.NestableWidget),e.NestedGroup=u(o.NestableWidget),e.GroupConfig=a(n.union([o.NestableWidget,e.NestedGroup])),e.Group=u(n.union([o.NestableWidget,e.NestedGroup]))})(ld);var Ah={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Q;(0,t.__exportStar)(VE,e),(0,t.__exportStar)(zE,e),(0,t.__exportStar)(HE,e),(0,t.__exportStar)(YE,e),(0,t.__exportStar)(GE,e),(0,t.__exportStar)(JE,e),(0,t.__exportStar)(ZE,e),(0,t.__exportStar)(XE,e),(0,t.__exportStar)(Da,e),(0,t.__exportStar)(eR,e),(0,t.__exportStar)(tR,e),(0,t.__exportStar)(nR,e),(0,t.__exportStar)(rR,e),(0,t.__exportStar)(iR,e),(0,t.__exportStar)(oR,e),(0,t.__exportStar)(aR,e)})(Ah);var uR={},E0={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isCompositeSlice=e.CompositeSlice=e.CompositeSliceConfig=e.CompositeSliceType=void 0;const n=(0,Q.__importStar)(Y),r=Fc,i=ct(),o=Da;e.CompositeSliceType="Slice",e.CompositeSliceConfig=n.exact(n.partial({label:i.StringOrNull})),e.CompositeSlice=n.exact(n.intersection([n.type({type:n.literal(e.CompositeSliceType)}),n.partial({fieldset:i.StringOrNull,description:n.string,icon:n.string,display:n.string,"non-repeat":n.record(r.WidgetKey,o.NestableWidget),repeat:n.record(r.WidgetKey,o.NestableWidget),config:e.CompositeSliceConfig})]));function a(u){return u.type==="Slice"}e.isCompositeSlice=a})(E0);var $s={};Object.defineProperty($s,"__esModule",{value:!0});$s.isLegacySlice=$s.LegacySlice=void 0;const yIe=Q,bIe=(0,yIe.__importStar)(Y),CIe=ld,SIe=Da;$s.LegacySlice=bIe.union([SIe.NestableWidget,CIe.NestedGroup]);function _Ie(e){return e.type!=="Slice"&&e.type!=="SharedSlice"}$s.isLegacySlice=_Ie;var hh={},Es={};Object.defineProperty(Es,"__esModule",{value:!0});Es.isSlicePrimaryWidget=Es.SlicePrimaryWidget=void 0;const IIe=Q,TIe=(0,IIe.__importStar)(Y),E9=ld,R9=Ah;Es.SlicePrimaryWidget=TIe.union([R9.NestableWidget,E9.Group]);const xIe=e=>R9.NestableWidget.is(e)||E9.Group.is(e);Es.isSlicePrimaryWidget=xIe;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isDynamicSharedSlice=e.isStaticSharedSlice=e.SharedSlice=e.SharedSliceType=e.Variation=void 0;const n=(0,Q.__importStar)(Y),r=cd,i=Fc,o=Da,a=Es,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,a.SlicePrimaryWidget),items:n.record(i.WidgetKey,o.NestableWidget)})])),e.SharedSliceType="SharedSlice";const s=n.string,c=n.string;e.SharedSlice=n.exact(n.intersection([n.type({id:n.string,type:n.literal(e.SharedSliceType),name:n.string,variations:n.readonlyArray(e.Variation)}),n.partial({description:n.string,legacyPaths:n.record(s,c)})]));function l(p){return p.type==="SharedSlice"}e.isStaticSharedSlice=l;function f(p){return p.type==="SharedSlice"}e.isDynamicSharedSlice=f})(hh);var mh={};Object.defineProperty(mh,"__esModule",{value:!0});mh.SharedSliceRef=void 0;const wIe=Q,lb=(0,wIe.__importStar)(Y),$Ie=hh;mh.SharedSliceRef=lb.exact(lb.type({type:lb.literal($Ie.SharedSliceType)}));(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Slices=e.DynamicSlices=e.StaticSlices=e.slicesReader=e.DynamicSlicesConfig=e.StaticSlicesConfig=e.slicesConfigReader=e.SlicesLabels=e.SlicesFieldType=e.LegacySlicesFieldType=void 0;const n=(0,Q.__importStar)(Y),r=Fc,i=ct(),o=E0,a=$s,u=hh,s=mh;e.LegacySlicesFieldType="Choice",e.SlicesFieldType="Slices",e.SlicesLabels=n.union([n.record(n.string,n.readonlyArray(n.exact(n.intersection([n.type({name:n.string}),n.partial({display:n.string})])))),n.null]);function c(p){return n.exact(n.partial({label:i.StringOrNull,labels:e.SlicesLabels,choices:n.record(r.WidgetKey,n.union([a.LegacySlice,o.CompositeSlice,p]))}))}e.slicesConfigReader=c,e.StaticSlicesConfig=c(u.SharedSlice),e.DynamicSlicesConfig=c(s.SharedSliceRef);const l={toStatic(p,A){const h=Object.entries(p.choices||{}).reduce((v,[_,S])=>{if(S.type==="SharedSlice"){const I=A.get(_);return I?{...v,[_]:I}:v}else return{...v,[_]:S}},{});return{...p,choices:h}}};function f(p){return n.exact(n.intersection([n.type({type:n.keyof({[e.SlicesFieldType]:null,[e.LegacySlicesFieldType]:null})}),n.partial({fieldset:i.StringOrNull,config:p})]))}e.slicesReader=f,e.StaticSlices=f(e.StaticSlicesConfig),e.DynamicSlices=f(e.DynamicSlicesConfig),e.Slices={toStatic(p,A){return p.config?{...p,config:l.toStatic(p.config,A)}:p}}})(uR);var sR={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.UID=e.UIDConfig=e.UIDFieldType=void 0;const n=(0,Q.__importStar)(Y),r=ct();e.UIDFieldType="UID",e.UIDConfig=n.exact(n.partial({label:r.StringOrNull,useAsTitle:n.boolean,placeholder:n.string})),e.UID=n.exact(n.intersection([n.type({type:n.literal(e.UIDFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.UIDConfig})]))})(sR);Object.defineProperty(_r,"__esModule",{value:!0});_r.Widgets=_r.FieldType=_r.DynamicWidget=_r.StaticWidget=_r.widgetReader=void 0;const EIe=Q,O9=(0,EIe.__importStar)(Y),F9=ld,Dn=Ah,RIe=Da,Zd=uR,M9=sR;function cR(e){return O9.union([M9.UID,RIe.NestableWidget,F9.Group,e])}_r.widgetReader=cR;_r.StaticWidget=cR(Zd.StaticSlices);_r.DynamicWidget=cR(Zd.DynamicSlices);_r.FieldType=O9.keyof({[Dn.ColorFieldType]:null,[Dn.BooleanFieldType]:null,[Dn.NumberFieldType]:null,[Dn.EmbedFieldType]:null,[Dn.GeoPointFieldType]:null,[Dn.DateFieldType]:null,[Dn.RangeFieldType]:null,[Dn.RichTextFieldType]:null,[Dn.SelectFieldType]:null,[Dn.SeparatorFieldType]:null,[Dn.TextFieldType]:null,[Dn.TimestampFieldType]:null,[Dn.LinkFieldType]:null,[Dn.ImageFieldType]:null,[Dn.IntegrationFieldType]:null,[M9.UIDFieldType]:null,[F9.GroupFieldType]:null,[Zd.SlicesFieldType]:null,[Zd.LegacySlicesFieldType]:null});_r.Widgets={toStatic(e,t){switch(e.type){case"Choice":case"Slices":return Zd.Slices.toStatic(e,t);default:return e}}};Object.defineProperty(bi,"__esModule",{value:!0});bi.Sections=bi.DynamicSection=bi.StaticSection=bi.sectionReader=void 0;const OIe=Q,FIe=(0,OIe.__importStar)(Y),MIe=Fc,lR=_r;function fR(e){return FIe.record(MIe.WidgetKey,e)}bi.sectionReader=fR;bi.StaticSection=fR(lR.StaticWidget);bi.DynamicSection=fR(lR.DynamicWidget);bi.Sections={toStatic(e,t){return Object.entries(e).reduce((r,[i,o])=>({...r,[i]:lR.Widgets.toStatic(o,t)}),{})}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.collectSharedSlices=e.flattenCustomTypeFields=e.filterMissingSharedSlices=e.collectWidgets=e.validateSlices=e.toStatic=e.flattenSections=e.flattenWidgets=e.CustomType=e.StaticCustomType=e.CustomTypeFormat=void 0;const t=Q,n=un,r=(0,t.__importStar)(Y),i=cd,o=ct(),a=bi;e.CustomTypeFormat={page:"page",custom:"custom"};class u extends Error{constructor(g){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=g,this.message=this._formatError(g)}_formatError(g){return`The following slices doesn't exists in your Prismic repository:
3
3
  ${g.map(y=>` - ${y}`).join(`
4
4
  `)}
5
5
  `}}function s(T){return r.exact(r.intersection([r.type({id:r.string,label:o.StringOrNull,repeatable:(0,i.withFallback)(r.boolean,!0),json:r.record(r.string,T),status:(0,i.withFallback)(r.boolean,!0)}),r.partial({hash:r.string,format:(0,i.withFallback)(r.keyof(e.CustomTypeFormat),"custom")})]))}e.StaticCustomType=s(a.StaticSection),e.CustomType=s(a.DynamicSection);function c(T){return Object.entries(T.json).reduce((g,[,C])=>{const y=Object.entries(C);return g.concat(y)},[])}e.flattenWidgets=c;function l(T){return Object.entries(T.json).reduce((g,[,C])=>{const y=Object.entries(C);return g.concat(y)},[])}e.flattenSections=l;function f(T){return c(T).filter(([,y])=>y.type==="Slices").reduce((y,[,x])=>{const w=Object.entries(x.config&&x.config.choices?x.config.choices:{}).filter(([,M])=>M.type==="SharedSlice").map(([M])=>M);return y.concat(w)},[])}function p(T){const g=f(T);return function(C){return g.map(C)}}function A(T,g){const C=Object.entries(T.json).reduce((y,[x,w])=>({...y,[x]:a.Sections.toStatic(w,g)}),{});return{...T,json:C}}e.toStatic=A;function h(T,g){const C=p(T)(y=>{if(!g.get(y))return y}).filter(Boolean);return C.length>0?(0,n.left)(new u(C)):(0,n.right)(T)}e.validateSlices=h;function v(T,g){const C=Object.entries(T.json).reduce((y,[x,w])=>{const M=Object.entries(w).reduce((O,[F,K])=>{const N=g(F,K);return N?{...O,[F]:N}:O},{});return{...y,[x]:M}},{});return{...T,json:C}}e.collectWidgets=v;function _(T,g){return v(T,(C,y)=>{if(y.type==="Slices"){if(!y.config||!y.config.choices)return y;const x=Object.entries(y.config.choices).reduce((M,[O,F])=>F.type==="SharedSlice"&&!g.get(O)?M:{...M,[O]:F},{}),w={...y.config,choices:x};return{...y,config:w}}return y})}e.filterMissingSharedSlices=_;function S(T){return Object.values(T.json).reduce((g,C)=>({...g,...C}),{})}e.flattenCustomTypeFields=S;function I(T){return Object.entries(T.fields).reduce((g,[,C])=>{var y;return C.type==="Slices"||C.type==="Choice"?{...g,...Object.entries(((y=C.config)===null||y===void 0?void 0:y.choices)||{}).reduce((x,[w,M])=>M.type==="SharedSlice"?{...x,[w]:M}:x,{})}:g},{})}e.collectSharedSlices=I})(w9);var k9={},R0={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DiffOperation=void 0,function(t){t.Added="added",t.Removed="removed",t.Updated="updated"}(e.DiffOperation||(e.DiffOperation={}))})(R0);var O0={},Go={},F0={};Object.defineProperty(F0,"__esModule",{value:!0});F0.HexaColor=void 0;const kIe=/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;F0.HexaColor={is:e=>kIe.test(e)};var M0={};Object.defineProperty(M0,"__esModule",{value:!0});M0.toRecord=void 0;function LIe(e,t){return e.reduce((n,r)=>{const i=t(r);return{...n,[i]:r}},{})}M0.toRecord=LIe;var Ir={};Object.defineProperty(Ir,"__esModule",{value:!0});Ir.mapValues=Ir.isObject=Ir.withOptionals=Ir.isNotEmpty=Ir.zipObjects=void 0;const jIe=Q,UIe=un,fb=(0,jIe.__importStar)(Y);function BIe(e,t){return[...new Set(Object.keys(e||{}).concat(Object.keys(t||{})))].reduce((r,i)=>{const o=e==null?void 0:e[i],a=t==null?void 0:t[i];return{...r,[i]:{left:o,right:a}}},{})}Ir.zipObjects=BIe;function WIe(e){return!!Object.keys(e).length}Ir.isNotEmpty=WIe;function KIe(e,t){return{...e,...t.reduce((n,[r,i])=>i?{...n,[r]:i}:n,{})}}Ir.withOptionals=KIe;const PIe=fb.record(fb.string,fb.unknown);function DIe(e){return(0,UIe.isRight)(PIe.decode(e))}Ir.isObject=DIe;function NIe(e,t){return Object.entries(e).reduce((n,[r,i])=>({...n,[r]:t(i,r)}),{})}Ir.mapValues=NIe;Object.defineProperty(Go,"__esModule",{value:!0});Go.Objects=Go.Arrays=Go.HexaColorCode=void 0;const dR=Q;Go.HexaColorCode=(0,dR.__importStar)(F0);Go.Arrays=(0,dR.__importStar)(M0);Go.Objects=(0,dR.__importStar)(Ir);var gh={};Object.defineProperty(gh,"__esModule",{value:!0});gh.VariationComparator=void 0;const Sm=Go,db=ld,Ja=R0;function qIe(e,t){const n=Sm.Objects.zipObjects(e,t);return Object.entries(n).reduce((r,[i,o])=>i==="primary"||i==="items"||(o==null?void 0:o.left)===(o==null?void 0:o.right)?r:{...r,[i]:o==null?void 0:o.right},{})}function _m(e,t){const n=Sm.Objects.zipObjects(e,t),r=Object.entries(n).reduce((i,[o,a])=>{if(JSON.stringify(a==null?void 0:a.left)===JSON.stringify(a==null?void 0:a.right))return i;const u=(()=>{var s,c,l,f,p,A,h;if(!(!(a!=null&&a.left)&&!(a!=null&&a.right))){if(a!=null&&a.left&&!a.right)return{op:Ja.DiffOperation.Removed};if(!(a!=null&&a.left)&&(a!=null&&a.right)){if(((s=a.right)===null||s===void 0?void 0:s.type)===db.GroupFieldType){const v={...a.right,config:{...a.right.config,fields:{}}};return v.config.fields=_m(void 0,(c=a.right.config)===null||c===void 0?void 0:c.fields)||{},{op:Ja.DiffOperation.Added,value:v}}return{op:Ja.DiffOperation.Added,value:a.right}}if(((l=a.right)===null||l===void 0?void 0:l.type)===db.GroupFieldType){const v={...a.right,config:{...a.right.config,fields:{}}};return v.config.fields=_m(((f=a.left)===null||f===void 0?void 0:f.type)===db.GroupFieldType?(A=(p=a.left)===null||p===void 0?void 0:p.config)===null||A===void 0?void 0:A.fields:void 0,(h=a.right.config)===null||h===void 0?void 0:h.fields)||{},{op:Ja.DiffOperation.Updated,value:v}}return{op:Ja.DiffOperation.Updated,value:a.right}}})();return u?{...i,[o]:u}:i},{});return Sm.Objects.isNotEmpty(r)?r:void 0}gh.VariationComparator={compare(e,t){if(e&&!t)return{op:Ja.DiffOperation.Removed};if(!e&&t)return{op:Ja.DiffOperation.Added,value:t};const n=qIe(e,t),r=_m(e==null?void 0:e.primary,t==null?void 0:t.primary),i=_m(e==null?void 0:e.items,t==null?void 0:t.items),o={...n,...r?{primary:r}:{},...i?{items:i}:{}};if(Sm.Objects.isNotEmpty(o))return{op:Ja.DiffOperation.Updated,value:o}}};Object.defineProperty(O0,"__esModule",{value:!0});O0.SliceComparator=void 0;const Zc=Go,pb=R0,QIe=gh;function VIe(e,t){const n=Zc.Objects.zipObjects(e,t);return Object.entries(n).reduce((r,[i,o])=>i==="variations"||(o==null?void 0:o.left)===(o==null?void 0:o.right)?r:{...r,[i]:o==null?void 0:o.right},{})}O0.SliceComparator={compare(e,t){if(!e&&t)return{op:pb.DiffOperation.Added,value:t};if(e&&!t)return{op:pb.DiffOperation.Removed};const n=VIe(e,t),r=Zc.Objects.zipObjects(e&&Zc.Arrays.toRecord(e.variations,a=>a.id),t&&Zc.Arrays.toRecord(t.variations,a=>a.id)),i=Object.entries(r).reduce((a,[u,s])=>{if(!s)return a;const c=QIe.VariationComparator.compare(s.left,s.right);return c?{...a,[u]:c}:a},{}),o={...n,...Zc.Objects.isNotEmpty(i)?{variations:i}:{}};if(Zc.Objects.isNotEmpty(o))return{op:pb.DiffOperation.Updated,value:o}}};var L9={};Object.defineProperty(L9,"__esModule",{value:!0});(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Q;(0,t.__exportStar)(R0,e),(0,t.__exportStar)(O0,e),(0,t.__exportStar)(gh,e),(0,t.__exportStar)(L9,e)})(k9);var Ro={},j9={};(function(e){var t=Ae&&Ae.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(e,"__esModule",{value:!0}),e.ImageConstraint=void 0;var n=ph;Object.defineProperty(e,"ImageConstraint",{enumerable:!0,get:function(){return t(n).default}})})(j9);var U9={},B9={};Object.defineProperty(B9,"__esModule",{value:!0});var k0={};Object.defineProperty(k0,"__esModule",{value:!0});k0.SlicesTypes=void 0;const zIe=Q,HIe=(0,zIe.__importStar)(Y),YIe=E0,GIe=hh;k0.SlicesTypes=HIe.keyof({[YIe.CompositeSliceType]:null,[GIe.SharedSliceType]:null});(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Q;(0,t.__exportStar)(E0,e),(0,t.__exportStar)($s,e),(0,t.__exportStar)(hh,e),(0,t.__exportStar)(mh,e),(0,t.__exportStar)(B9,e),(0,t.__exportStar)(Es,e),(0,t.__exportStar)(uR,e),(0,t.__exportStar)(k0,e)})(U9);(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Q;(0,t.__exportStar)(ld,e),(0,t.__exportStar)(Ah,e),(0,t.__exportStar)(j9,e),(0,t.__exportStar)(U9,e),(0,t.__exportStar)(sR,e),(0,t.__exportStar)(_r,e)})(Ro);(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Q;(0,t.__exportStar)(w9,e),(0,t.__exportStar)(k9,e),(0,t.__exportStar)(bi,e),(0,t.__exportStar)(Ro,e)})(le);var Ab={},hb={},Zu={},UO;function Wt(){if(UO)return Zu;UO=1,Object.defineProperty(Zu,"__esModule",{value:!0}),Zu.hasContentType=Zu.hasFieldContentType=void 0;const e=un,t=gR();function n(i){var o;return r(i)&&i.__TYPE__===t.FieldContentType&&((o=i)===null||o===void 0?void 0:o.type)!==void 0&&typeof i.type=="string"&&(0,e.isRight)(t.FieldType.decode(i.type))}Zu.hasFieldContentType=n;function r(i){return typeof i=="object"&&i!==null&&"__TYPE__"in i}return Zu.hasContentType=r,Zu}var BO;function W9(){return BO||(BO=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EmptyContent=e.EmptyLegacy=e.isEmptyContent=e.EmptyContentType=void 0;const t=Q,n=st,r=He,i=(0,t.__importStar)(Y),o=Wt();e.EmptyContentType="EmptyContent";const a=c=>(0,o.hasContentType)(c)&&c.__TYPE__===e.EmptyContentType;e.isEmptyContent=a;const u=i.union([i.null,i.type({value:i.null})]),s=c=>new i.Type("EmptyLegacy",e.isEmptyContent,l=>(0,r.pipe)(u.decode(l),n.either.map(()=>({type:c,__TYPE__:e.EmptyContentType}))),()=>null);e.EmptyLegacy=s,e.EmptyContent=i.strict({type:i.string,__TYPE__:i.literal(e.EmptyContentType)})}(hb)),hb}var mb={},qn={};Object.defineProperty(qn,"__esModule",{value:!0});qn.defaultCtx=qn.getFieldCtx=qn.LegacyContentCtx=qn.FieldOrSliceType=void 0;const JIe=Q,ZIe=(0,JIe.__importStar)(Y),WO=Ro;qn.FieldOrSliceType=ZIe.union([WO.FieldType,WO.SlicesTypes]);class pR{constructor(t,n,r){Object.defineProperty(this,"fieldKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"prefixedKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"keyOfType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fieldPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fieldType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"allTypes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.fieldKey=t,this.fieldPath=n||[],this.allTypes=r||new Map;const i=Array.of(this.fieldPath,[this.fieldKey]).flat().join(".");this.prefixedKey=i,this.keyOfType=`${i}_TYPE`,this.fieldType=this.allTypes.get(this.prefixedKey)}}qn.LegacyContentCtx=pR;function XIe(e,t,n){return new pR(e,[...t.fieldPath,t.fieldKey,...n||[]],t.allTypes)}qn.getFieldCtx=XIe;function eTe(e,t=new Map){return new pR(e,[],t)}qn.defaultCtx=eTe;var gb={},vb={},KO;function K9(){return KO||(KO=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.BooleanContentDefaultValue=e.BooleanContent=e.BooleanLegacy=e.isBooleanContent=e.BooleanContentType=void 0;const t=Q,n=st,r=He,i=(0,t.__importStar)(Y),o=Wt();e.BooleanContentType="BooleanContent";const a=c=>(0,o.hasContentType)(c)&&c.__TYPE__===e.BooleanContentType;e.isBooleanContent=a;const u=c=>new i.Type("BooleanLegacy",e.isBooleanContent,l=>(0,r.pipe)(i.boolean.decode(l),n.either.map(f=>e.BooleanContent.encode({value:f,__TYPE__:e.BooleanContentType}))),l=>({content:l.value,types:{[c.keyOfType]:"Boolean"}}));e.BooleanLegacy=u,e.BooleanContent=i.strict({__TYPE__:i.literal(e.BooleanContentType),value:i.boolean});const s=c=>{var l;return((l=c.config)===null||l===void 0?void 0:l.default_value)!==void 0?{__TYPE__:e.BooleanContentType,value:c.config.default_value||!1}:void 0};e.BooleanContentDefaultValue=s}(vb)),vb}var yb={},PO;function AR(){return PO||(PO=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EmbedContent=e.EmbedLegacy=e.EmbedContentLegacy=e.isEmbedContent=e.EmbedContentType=void 0;const t=Q,n=st,r=He,i=(0,t.__importStar)(Y),o=ct(),a=Wt();e.EmbedContentType="EmbedContent";const u=c=>(0,a.hasContentType)(c)&&c.__TYPE__===e.EmbedContentType;e.isEmbedContent=u,e.EmbedContentLegacy=i.exact(i.intersection([i.type({embed_url:i.string,type:i.string}),i.partial({version:i.union([i.string,i.number,i.null]),title:o.StringOrNull,author_name:o.StringOrNull,author_url:o.StringOrNull,provider_name:o.StringOrNull,provider_url:o.StringOrNull,cache_age:i.union([i.string,i.number,i.null]),thumbnail_url:o.StringOrNull,thumbnail_width:o.NumberOrNull,thumbnail_height:o.NumberOrNull,html:o.StringOrNull})]));const s=c=>new i.Type("EmbedLegacy",e.isEmbedContent,l=>(0,r.pipe)(e.EmbedContentLegacy.decode(l),n.either.map(f=>({...f,all:l,__TYPE__:e.EmbedContentType}))),l=>({content:l.all,types:{[c.keyOfType]:"Embed"}}));e.EmbedLegacy=s,e.EmbedContent=i.intersection([e.EmbedContentLegacy,i.strict({__TYPE__:i.literal(e.EmbedContentType),all:i.unknown})])}(yb)),yb}var bb={},Cb={},Na={};Object.defineProperty(Na,"__esModule",{value:!0});const tTe=Q,nTe=Pa,rTe=Hi,Bh=(0,tTe.__importStar)(Y);function iTe(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)}Na.default=new Bh.Type("TrimmedString",Bh.string.is,(e,t)=>(0,rTe.pipe)(Bh.string.validate(e,t),(0,nTe.chain)(n=>Bh.success(iTe(n)))),e=>e);var li={};Object.defineProperty(li,"__esModule",{value:!0});li.FieldContentType=void 0;li.FieldContentType="FieldContent";var DO;function NO(){return DO||(DO=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ColorContent=e.ColorLegacy=e.isColorContent=void 0;const t=Q,n=st,r=He,i=(0,t.__importStar)(Y),o=Ro,a=(0,t.__importDefault)(Na),u=Wt(),s=li,c=f=>(0,u.hasContentType)(f)&&f.__TYPE__===s.FieldContentType&&(0,u.hasFieldContentType)(f)&&f.type==="Color";e.isColorContent=c;const l=f=>new i.Type("ColorLegacy",e.isColorContent,p=>(0,r.pipe)(a.default.decode(p),n.either.map(A=>e.ColorContent.encode({value:A,type:o.ColorFieldType,__TYPE__:s.FieldContentType}))),p=>({content:p.value,types:{[f.keyOfType]:o.ColorFieldType}}));e.ColorLegacy=l,e.ColorContent=i.strict({type:i.literal(o.ColorFieldType),value:a.default,__TYPE__:i.literal(s.FieldContentType)})}(Cb)),Cb}var Sb={},qO;function QO(){return qO||(qO=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DateContent=e.DateLegacy=e.isDateContent=void 0;const t=Q,n=st,r=He,i=(0,t.__importStar)(Y),o=Ro,a=(0,t.__importDefault)(Na),u=Wt(),s=li,c=f=>(0,u.hasContentType)(f)&&f.__TYPE__===s.FieldContentType&&(0,u.hasFieldContentType)(f)&&f.type==="Date";e.isDateContent=c;const l=f=>new i.Type("DateLegacy",e.isDateContent,p=>(0,r.pipe)(a.default.decode(p),n.either.map(A=>e.DateContent.encode({value:A,type:o.DateFieldType,__TYPE__:s.FieldContentType}))),p=>({content:p.value,types:{[f.keyOfType]:o.DateFieldType}}));e.DateLegacy=l,e.DateContent=i.strict({type:i.literal(o.DateFieldType),value:a.default,__TYPE__:i.literal(s.FieldContentType)})}(Sb)),Sb}var _b={},VO;function zO(){return VO||(VO=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.NumberContent=e.NumberLegacy=e.isNumberContent=void 0;const t=Q,n=st,r=He,i=(0,t.__importStar)(Y),o=Ro,a=(0,t.__importDefault)(Na),u=Wt(),s=li,c=f=>(0,u.hasContentType)(f)&&f.__TYPE__===s.FieldContentType&&(0,u.hasFieldContentType)(f)&&f.type==="Number";e.isNumberContent=c;const l=f=>new i.Type("NumberLegacy",e.isNumberContent,p=>(0,r.pipe)(a.default.decode(p),n.either.map(A=>e.NumberContent.encode({value:A,type:o.NumberFieldType,__TYPE__:s.FieldContentType}))),p=>({content:p.value,types:{[f.keyOfType]:o.NumberFieldType}}));e.NumberLegacy=l,e.NumberContent=i.strict({type:i.literal(o.NumberFieldType),value:a.default,__TYPE__:i.literal(s.FieldContentType)})}(_b)),_b}var Ib={},HO;function YO(){return HO||(HO=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RangeContent=e.RangeLegacy=e.isRangeContent=void 0;const t=Q,n=st,r=He,i=(0,t.__importStar)(Y),o=Ro,a=(0,t.__importDefault)(Na),u=Wt(),s=li,c=f=>(0,u.hasContentType)(f)&&f.__TYPE__===s.FieldContentType&&(0,u.hasFieldContentType)(f)&&f.type==="Range";e.isRangeContent=c;const l=f=>new i.Type("RangeLegacy",e.isRangeContent,p=>(0,r.pipe)(a.default.decode(p),n.either.map(A=>e.RangeContent.encode({value:A,type:o.RangeFieldType,__TYPE__:s.FieldContentType}))),p=>({content:p.value,types:{[f.keyOfType]:o.RangeFieldType}}));e.RangeLegacy=l,e.RangeContent=i.strict({type:i.literal(o.RangeFieldType),value:a.default,__TYPE__:i.literal(s.FieldContentType)})}(Ib)),Ib}var Tb={},GO;function JO(){return GO||(GO=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SelectContentDefaultValue=e.SelectContent=e.SelectLegacy=e.isSelectContent=void 0;const t=Q,n=st,r=He,i=(0,t.__importStar)(Y),o=Ro,a=(0,t.__importDefault)(Na),u=Wt(),s=li,c=p=>(0,u.hasContentType)(p)&&p.__TYPE__===s.FieldContentType&&(0,u.hasFieldContentType)(p)&&p.type==="Select";e.isSelectContent=c;const l=p=>new i.Type("SelectLegacy",e.isSelectContent,A=>(0,r.pipe)(a.default.decode(A),n.either.map(h=>e.SelectContent.encode({value:h,type:o.SelectFieldType,__TYPE__:s.FieldContentType}))),A=>({content:A.value,types:{[p.keyOfType]:o.SelectFieldType}}));e.SelectLegacy=l,e.SelectContent=i.strict({type:i.literal(o.SelectFieldType),value:a.default,__TYPE__:i.literal(s.FieldContentType)});const f=p=>{var A;return!((A=p.config)===null||A===void 0)&&A.default_value?{__TYPE__:s.FieldContentType,type:o.SelectFieldType,value:p.config.default_value||""}:void 0};e.SelectContentDefaultValue=f}(Tb)),Tb}var xb={},ZO;function XO(){return ZO||(ZO=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TextContent=e.TextLegacy=e.isTextContent=void 0;const t=Q,n=st,r=He,i=(0,t.__importStar)(Y),o=Ro,a=(0,t.__importDefault)(Na),u=Wt(),s=li,c=f=>(0,u.hasContentType)(f)&&f.__TYPE__===s.FieldContentType&&(0,u.hasFieldContentType)(f)&&f.type==="Text";e.isTextContent=c;const l=f=>new i.Type("TextLegacy",e.isTextContent,p=>(0,r.pipe)(a.default.decode(p),n.either.map(A=>e.TextContent.encode({value:A,type:o.TextFieldType,__TYPE__:s.FieldContentType}))),p=>({content:p.value,types:{[f.keyOfType]:o.TextFieldType}}));e.TextLegacy=l,e.TextContent=i.strict({type:i.literal(o.TextFieldType),value:a.default,__TYPE__:i.literal(s.FieldContentType)})}(xb)),xb}var wb={},eF;function tF(){return eF||(eF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TimestampContent=e.TimestampLegacy=e.isTimestampContent=void 0;const t=Q,n=st,r=He,i=(0,t.__importStar)(Y),o=Ro,a=(0,t.__importDefault)(Na),u=Wt(),s=li,c=f=>(0,u.hasContentType)(f)&&f.__TYPE__===s.FieldContentType&&(0,u.hasFieldContentType)(f)&&f.type==="Timestamp";e.isTimestampContent=c;const l=f=>new i.Type("TimestampLegacy",e.isTimestampContent,p=>(0,r.pipe)(a.default.decode(p),n.either.map(A=>e.TimestampContent.encode({value:A,type:o.TimestampFieldType,__TYPE__:s.FieldContentType}))),p=>({content:p.value,types:{[f.keyOfType]:o.TimestampFieldType}}));e.TimestampLegacy=l,e.TimestampContent=i.strict({type:i.literal(o.TimestampFieldType),value:a.default,__TYPE__:i.literal(s.FieldContentType)})}(wb)),wb}var nF;function P9(){return nF||(nF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FieldContent=e.FieldType=void 0;const t=Q,n=(0,t.__importStar)(Y),r=NO(),i=QO(),o=zO(),a=YO(),u=JO(),s=XO(),c=tF();e.FieldType=n.keyof({Text:null,Date:null,Timestamp:null,Color:null,Number:null,Range:null,Select:null}),e.FieldContent=n.union([i.DateContent,r.ColorContent,o.NumberContent,a.RangeContent,u.SelectContent,s.TextContent,c.TimestampContent]),(0,t.__exportStar)(NO(),e),(0,t.__exportStar)(li,e),(0,t.__exportStar)(QO(),e),(0,t.__exportStar)(zO(),e),(0,t.__exportStar)(YO(),e),(0,t.__exportStar)(JO(),e),(0,t.__exportStar)(XO(),e),(0,t.__exportStar)(tF(),e)}(bb)),bb}var $b={},rF;function D9(){return rF||(rF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.GeoPointContent=e.GeoPointLegacy=e.isGeoPointContent=e.GeoPointContentType=void 0;const t=Q,n=st,r=Hi,i=(0,t.__importStar)(Y),o=Wt();e.GeoPointContentType="GeoPointContent";const a=c=>(0,o.hasContentType)(c)&&c.__TYPE__===e.GeoPointContentType;e.isGeoPointContent=a;const u=i.strict({position:i.strict({lat:i.number,lng:i.number})}),s=c=>new i.Type("GeoPointLegacy",e.isGeoPointContent,l=>(0,r.pipe)(u.decode(l),n.either.map(f=>e.GeoPointContent.encode({...f,__TYPE__:e.GeoPointContentType}))),l=>({content:{position:l.position},types:{[c.keyOfType]:"GeoPoint"}}));e.GeoPointLegacy=s,e.GeoPointContent=i.intersection([u,i.strict({__TYPE__:i.literal(e.GeoPointContentType)})])}($b)),$b}var Eb={},iF;function hR(){return iF||(iF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ImageContent=e.ImageLegacy=e.ImageContentView=e.isImageContent=e.ImageContentType=void 0;const t=Q,n=st,r=He,i=(0,t.__importStar)(Y),o=Ir,a=ct(),u=Wt();e.ImageContentType="ImageContent";const s=p=>(0,u.hasContentType)(p)&&p.__TYPE__===e.ImageContentType;e.isImageContent=s;const c=i.exact(i.type({id:i.string,url:i.string,width:i.number,height:i.number}));e.ImageContentView=i.exact(i.intersection([i.type({origin:c,width:i.number,height:i.number,edit:i.type({zoom:i.number,crop:i.type({x:i.number,y:i.number}),background:i.string})}),i.partial({url:i.string,credits:a.NonEmptyStringOrNull,alt:a.NonEmptyStringOrNull,provider:a.StringOrNull})]));const l=i.intersection([e.ImageContentView,i.partial({thumbnails:i.record(i.string,e.ImageContentView)})]),f=p=>new i.Type("ImageLegacy",e.isImageContent,A=>(0,r.pipe)(l.decode(A),n.either.map(h=>e.ImageContent.encode({...h,__TYPE__:e.ImageContentType}))),A=>({content:(0,o.withOptionals)({edit:A.edit,height:A.height,origin:A.origin,width:A.width},[["alt",A.alt],["credits",A.credits],["provider",A.provider],["thumbnails",A.thumbnails],["url",A.url]]),types:{[p.keyOfType]:"Image"}}));e.ImageLegacy=f,e.ImageContent=i.intersection([l,i.strict({__TYPE__:i.literal(e.ImageContentType)})])}(Eb)),Eb}var Rb={},oF;function N9(){return oF||(oF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.IntegrationFieldContent=e.IntegrationFieldLegacy=e.isIntegrationFieldContent=e.IntegrationFieldContentType=void 0;const t=Q,n=st,r=He,i=(0,t.__importStar)(Y),o=Wt();e.IntegrationFieldContentType="IntegrationFieldsContent";const a=s=>(0,o.hasContentType)(s)&&s.__TYPE__===e.IntegrationFieldContentType;e.isIntegrationFieldContent=a;const u=s=>new i.Type("IntegrationFieldLegacy",e.isIntegrationFieldContent,c=>(0,r.pipe)(i.string.decode(c),n.either.map(l=>e.IntegrationFieldContent.encode({value:l,__TYPE__:e.IntegrationFieldContentType}))),c=>({content:c.value,types:{[s.keyOfType]:"IntegrationFields"}}));e.IntegrationFieldLegacy=u,e.IntegrationFieldContent=i.strict({__TYPE__:i.literal(e.IntegrationFieldContentType),value:i.string})}(Rb)),Rb}var Ob={},aF;function mR(){return aF||(aF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.LinkContent=e.Link=e.LinkContentLegacy=e.LinkLegacy=e.isLinkContent=e.LinkContentType=e.ExternalLinkContent=e.ExternalLinkType=e.DocumentLinkContent=e.DocumentLinkType=e.FileLinkContent=e.FileLinkType=e.ImageLinkContent=e.ImageLinkType=void 0;const t=Q,n=st,r=He,i=(0,t.__importStar)(Y),o=I0,a=ct(),u=Je,s=Wt();e.ImageLinkType="ImageLink";const c=i.exact(i.intersection([i.type({id:i.string,url:i.string,height:i.string,width:i.string,size:i.string,name:i.string,kind:i.string}),i.partial({date:a.StringOrNull})])),l=new i.Type("ImageLink",T=>(0,s.hasContentType)(T)&&T.__TYPE__===e.ImageLinkType,T=>(0,r.pipe)(c.decode(T),n.either.map(g=>e.ImageLinkContent.encode({...g,__TYPE__:e.ImageLinkType}))),T=>c.encode(T));e.ImageLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.ImageLinkType)}),c]),e.FileLinkType="FileLink";const f=i.exact(i.intersection([i.type({id:i.string,url:i.string,name:i.string,kind:i.string,size:(0,o.withFallback)(i.string,"0")}),i.partial({date:(0,u.nullable)(i.string)})])),p=new i.Type("FileLink",T=>(0,s.hasContentType)(T)&&T.__TYPE__===e.FileLinkType,T=>(0,r.pipe)(f.decode(T),n.either.map(g=>e.FileLinkContent.encode({...g,__TYPE__:e.FileLinkType}))),T=>f.encode(T));e.FileLinkContent=i.intersection([f,i.exact(i.intersection([i.type({__TYPE__:i.literal(e.FileLinkType)}),i.partial({size:(0,o.withFallback)(i.string,"0")})]))]),e.DocumentLinkType="DocumentLink";const A=i.strict({id:a.NonEmptyString}),h=new i.Type("DocumentLink",T=>(0,s.hasContentType)(T)&&T.__TYPE__===e.DocumentLinkType,T=>(0,r.pipe)(A.decode(T),n.either.map(g=>e.DocumentLinkContent.encode({...g,__TYPE__:e.DocumentLinkType}))),T=>A.encode(T));e.DocumentLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.DocumentLinkType)}),A]),e.ExternalLinkType="ExternalLink";const v=i.exact(i.intersection([i.type({url:i.string}),i.partial({kind:i.literal("web"),target:a.StringOrNull,preview:(0,u.nullable)(i.partial({title:i.string}))})])),_=new i.Type("ExternalLink",T=>(0,s.hasContentType)(T)&&T.__TYPE__===e.ExternalLinkType,T=>(0,r.pipe)(v.decode(T),n.either.map(g=>e.ExternalLinkContent.encode({...g,__TYPE__:e.ExternalLinkType}))),T=>v.encode(T));e.ExternalLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.ExternalLinkType)}),v]),e.LinkContentType="LinkContent";const S=T=>(0,s.hasContentType)(T)&&T.__TYPE__===e.LinkContentType;e.isLinkContent=S,e.LinkLegacy=i.union([l,p,h,_]);const I=T=>new i.Type("LinkLegacy",e.isLinkContent,g=>(0,r.pipe)(e.LinkLegacy.decode(g),n.either.map(C=>e.LinkContent.encode({value:C,__TYPE__:e.LinkContentType}))),g=>({content:e.LinkLegacy.encode(g.value),types:{[T.keyOfType]:"Link"}}));e.LinkContentLegacy=I,e.Link=i.union([e.ImageLinkContent,e.FileLinkContent,e.DocumentLinkContent,e.ExternalLinkContent]),e.LinkContent=i.strict({__TYPE__:i.literal(e.LinkContentType),value:e.Link})}(Ob)),Ob}var mi={},Fb={},Mb={},uF;function sF(){return uF||(uF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Block=e.BlockLegacy=e.TextBlock=e.checkEmbedBlock=e.EmbedBlock=e.checkImageBlock=e.ImageBlock=e.ValidatedSpans=e.SpanLegacy=e.Span=void 0;const t=Q,n=st,r=un,i=He,o=(0,t.__importStar)(Y),a=I0,u=Ah,s=ct(),c=Je,l=AR(),f=hR(),p=mR(),A=O=>o.strict({data:O,start:o.number,end:o.number,type:o.literal(u.RichTextNodeType.hyperlink)}),h=o.strict({data:(0,a.withFallback)(o.string,""),start:o.number,end:o.number,type:o.literal("label")}),v=o.strict({start:o.number,end:o.number,type:o.keyof({[u.RichTextNodeType.strong]:null,[u.RichTextNodeType.em]:null,"list-item":null})});e.Span=o.union([A(p.Link),h,v]),e.SpanLegacy=o.union([A(p.LinkLegacy),h,v]);const _=O=>new o.Type("ValidatedSpans",F=>Array.isArray(F)&&F.every(O.is),(F,K)=>{if(Array.isArray(F)){const N=F.reduce((J,Z)=>{const ae=O.decode(Z);return(0,r.isLeft)(ae)?J:[...J,ae.right]},[]).sort((J,Z)=>J.start-Z.start);return o.success(N)}else return o.failure(F,K)},F=>F.reduce((K,N)=>{const J=O.encode(N);return[...K,J]},[]));e.ValidatedSpans=_;const S=O=>o.exact(o.intersection([o.type({type:o.literal(u.RichTextNodeType.image),data:o.intersection([f.ImageContentView,o.partial({linkTo:(0,c.nullable)(O)})])}),o.partial({label:s.StringOrNull,direction:s.StringOrNull})]));e.ImageBlock=S(p.Link);const I=S(p.LinkLegacy);function T(O){return O.type===u.RichTextNodeType.image}e.checkImageBlock=T;const g=o.exact(o.intersection([o.type({type:o.literal(u.RichTextNodeType.embed),data:o.unknown}),o.partial({label:s.StringOrNull,direction:s.StringOrNull})])),C=new o.Type("EmbedBlockLegacy",O=>O.type==="embed",O=>(0,i.pipe)(g.decode(O),n.either.chain(F=>n.either.map(K=>[F,K])(l.EmbedContentLegacy.decode(F.data))),n.either.map(([F,K])=>e.EmbedBlock.encode({...F,data:{...K,__TYPE__:l.EmbedContentType,all:F.data}}))),O=>({...g.encode(O),data:l.EmbedContentLegacy.encode(O.data)}));e.EmbedBlock=o.exact(o.intersection([o.type({type:o.literal(u.RichTextNodeType.embed),data:l.EmbedContent}),o.partial({label:s.StringOrNull,direction:s.StringOrNull})]));function y(O){return O.type===u.RichTextNodeType.embed}e.checkEmbedBlock=y;const x=O=>o.exact(o.intersection([o.type({type:(0,c.refineType)(u.RichTextNodeTypeCodec,`string which isn't ${u.RichTextNodeType.image} ${u.RichTextNodeType.embed}`,F=>F!==u.RichTextNodeType.image&&F!==u.RichTextNodeType.embed),content:o.intersection([o.type({text:o.string}),o.partial({spans:(0,e.ValidatedSpans)(O)})])}),o.partial({label:o.string,direction:o.string})]));e.TextBlock=x(e.Span);const w=x(e.SpanLegacy),M=o.union([C,I,w]);e.BlockLegacy=new o.Type("BlockLegacy",O=>C.is(O)||I.is(O)||w.is(O),O=>M.decode(O),O=>(()=>e.ImageBlock.is(O)?I.encode(O):e.EmbedBlock.is(O)?C.encode(O):w.encode(O))()),e.Block=o.union([e.ImageBlock,e.EmbedBlock,e.TextBlock])}(Mb)),Mb}var cF;function q9(){return cF||(cF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RichTextLegacy=e.RichTextContent=e.isRichTextContent=e.RichTextContentType=void 0;const t=Q,n=st,r=He,i=(0,t.__importStar)(Y),o=Wt(),a=sF();e.RichTextContentType="StructuredTextContent";const u=l=>(0,o.hasContentType)(l)&&l.__TYPE__===e.RichTextContentType;e.isRichTextContent=u;const s=i.array(a.BlockLegacy);e.RichTextContent=i.strict({__TYPE__:i.literal(e.RichTextContentType),value:i.array(a.Block)}),(0,t.__exportStar)(sF(),e);const c=l=>new i.Type("RichTextLegacy",e.isRichTextContent,f=>(0,r.pipe)(s.decode(f),n.either.map(p=>({value:p,__TYPE__:e.RichTextContentType}))),f=>({content:s.encode(f.value),types:{[l.keyOfType]:"StructuredText"}}));e.RichTextLegacy=c}(Fb)),Fb}var kb={},lF;function Q9(){return lF||(lF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SeparatorContent=e.SeparatorLegacy=e.isSeparatorContent=e.SeparatorContentType=void 0;const n=(0,Q.__importStar)(Y),r=Wt();e.SeparatorContentType="SeparatorContent";const i=a=>(0,r.hasContentType)(a)&&a.__TYPE__===e.SeparatorContentType;e.isSeparatorContent=i;const o=a=>new n.Type("SeparatorLegacy",e.isSeparatorContent,()=>n.success(e.SeparatorContent.encode({__TYPE__:e.SeparatorContentType})),()=>({content:{},types:{[a.keyOfType]:"Separator"}}));e.SeparatorLegacy=o,e.SeparatorContent=n.strict({__TYPE__:n.literal(e.SeparatorContentType)})}(kb)),kb}var fF;function oTe(){if(fF)return mi;fF=1,Object.defineProperty(mi,"__esModule",{value:!0}),mi.NestableLegacy=mi.isNestableContent=mi.NestableContentDefaultValue=mi.NestableContent=void 0;const e=Q,t=un,n=(0,e.__importStar)(Y),r=W9(),i=K9(),o=AR(),a=P9(),u=li,s=D9(),c=hR(),l=N9(),f=mR(),p=q9(),A=Q9();mi.NestableContent=n.union([r.EmptyContent,i.BooleanContent,o.EmbedContent,a.TextContent,a.TimestampContent,a.SelectContent,a.RangeContent,a.NumberContent,a.DateContent,a.ColorContent,s.GeoPointContent,c.ImageContent,l.IntegrationFieldContent,f.LinkContent,p.RichTextContent,A.SeparatorContent]);const h=S=>{switch(S.type){case"Boolean":return(0,i.BooleanContentDefaultValue)(S);case"Select":return(0,a.SelectContentDefaultValue)(S);default:return}};mi.NestableContentDefaultValue=h;const v=S=>(0,a.isTextContent)(S)||(0,a.isColorContent)(S)||(0,a.isDateContent)(S)||(0,a.isTimestampContent)(S)||(0,a.isNumberContent)(S)||(0,a.isRangeContent)(S)||(0,a.isSelectContent)(S)||(0,s.isGeoPointContent)(S)||(0,p.isRichTextContent)(S)||(0,i.isBooleanContent)(S)||(0,o.isEmbedContent)(S)||(0,c.isImageContent)(S)||(0,l.isIntegrationFieldContent)(S)||(0,f.isLinkContent)(S)||(0,A.isSeparatorContent)(S)||(0,r.isEmptyContent)(S);mi.isNestableContent=v;const _=S=>({decode(I){if(!S.fieldType)return;const T=(0,r.EmptyLegacy)(S.fieldType).decode(I);if((0,t.isRight)(T))return T;const g=(()=>{switch(S.fieldType){case"Text":return(0,a.TextLegacy)(S);case"Color":return(0,a.ColorLegacy)(S);case"Date":return(0,a.DateLegacy)(S);case"Timestamp":return(0,a.TimestampLegacy)(S);case"Number":return(0,a.NumberLegacy)(S);case"Range":return(0,a.RangeLegacy)(S);case"Select":return(0,a.SelectLegacy)(S);case"GeoPoint":return(0,s.GeoPointLegacy)(S);case"StructuredText":return(0,p.RichTextLegacy)(S);case"Boolean":return(0,i.BooleanLegacy)(S);case"Embed":return(0,o.EmbedLegacy)(S);case"Image":return(0,c.ImageLegacy)(S);case"IntegrationFields":return(0,l.IntegrationFieldLegacy)(S);case"Link":return(0,f.LinkContentLegacy)(S);case"Separator":return(0,A.SeparatorLegacy)(S);default:return}})();if(g)return g.decode(I)},encode(I){switch(I.__TYPE__){case u.FieldContentType:return I.type==="Text"?(0,a.TextLegacy)(S).encode(I):I.type==="Color"?(0,a.ColorLegacy)(S).encode(I):I.type==="Range"?(0,a.RangeLegacy)(S).encode(I):I.type==="Date"?(0,a.DateLegacy)(S).encode(I):I.type==="Number"?(0,a.NumberLegacy)(S).encode(I):I.type==="Timestamp"?(0,a.TimestampLegacy)(S).encode(I):I.type==="Select"?(0,a.SelectLegacy)(S).encode(I):void 0;case s.GeoPointContentType:return(0,s.GeoPointLegacy)(S).encode(I);case p.RichTextContentType:return(0,p.RichTextLegacy)(S).encode(I);case o.EmbedContentType:return(0,o.EmbedLegacy)(S).encode(I);case i.BooleanContentType:return(0,i.BooleanLegacy)(S).encode(I);case c.ImageContentType:return(0,c.ImageLegacy)(S).encode(I);case l.IntegrationFieldContentType:return(0,l.IntegrationFieldLegacy)(S).encode(I);case f.LinkContentType:return(0,f.LinkContentLegacy)(S).encode(I);case A.SeparatorContentType:return(0,A.SeparatorLegacy)(S).encode(I);default:return}}});return mi.NestableLegacy=_,mi}var dF;function Oo(){return dF||(dF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Q;(0,t.__exportStar)(K9(),e),(0,t.__exportStar)(AR(),e),(0,t.__exportStar)(P9(),e),(0,t.__exportStar)(D9(),e),(0,t.__exportStar)(hR(),e),(0,t.__exportStar)(N9(),e),(0,t.__exportStar)(mR(),e),(0,t.__exportStar)(oTe(),e),(0,t.__exportStar)(q9(),e),(0,t.__exportStar)(Q9(),e)}(gb)),gb}var Wo={},pF;function L0(){if(pF)return Wo;pF=1,Object.defineProperty(Wo,"__esModule",{value:!0}),Wo.repeatableContentWithDefaultNestableContentValues=Wo.withDefaultNestableContentValues=Wo.withDefaultSlicePrimaryContentValues=void 0;const e=le,t=qa(),n=Oo();function r(a,u){const s=u;for(const[c,l]of Object.entries(a)){const f=u[c];if(f===void 0){if(l.type===e.GroupFieldType)s[c]=(0,t.groupContentWithDefaultValues)(l,t.GroupContentDefaultValue);else{const p=(0,n.NestableContentDefaultValue)(l);p&&(s[c]=p)}continue}l.type===e.GroupFieldType&&(0,t.isGroupContent)(f)&&(s[c]=(0,t.groupContentWithDefaultValues)(l,f))}return s}Wo.withDefaultSlicePrimaryContentValues=r;function i(a,u){return Object.entries(a).reduce((s,[c,l])=>{if(u[c]===void 0){const f=(0,n.NestableContentDefaultValue)(l);return f!==void 0?{...s,[c]:f}:s}return s},u)}Wo.withDefaultNestableContentValues=i;function o(a,u){const s=Object.entries(a);return u.map(c=>s.reduce((l,[f,p])=>{var A;const h=c.value.find(([v])=>v===f);if(p.type==="Group"){const v=(0,t.groupContentWithDefaultValues)(p,(A=h==null?void 0:h[1])!==null&&A!==void 0?A:{__TYPE__:t.GroupContentType,value:[]});return{...l,value:[...l.value.filter(([_])=>_!==f),...v?[[f,v]]:[]]}}else if(!h){const v=(0,n.NestableContentDefaultValue)(p);return{...l,value:[...l.value,...v?[[f,v]]:[]]}}return l},c))}return Wo.repeatableContentWithDefaultNestableContentValues=o,Wo}var AF;function qa(){return AF||(AF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.traverseGroupItemsContent=e.traverseGroupContent=e.groupContentWithDefaultValues=e.GroupLegacy=e.GroupItemLegacy=e.GroupContentDefaultValue=e.isGroupContent=e.GroupContent=e.GroupItemContent=e.GroupContentType=e.GroupItemContentType=void 0;const t=Q,n=st,r=un,i=He,o=(0,t.__importStar)(Y),a=le,u=qn,s=Wt(),c=Oo(),l=L0();e.GroupItemContentType="GroupItemContent",e.GroupContentType="GroupContentType",e.GroupItemContent=o.recursion("GroupItemContent",()=>o.strict({__TYPE__:o.literal(e.GroupItemContentType),value:o.array(o.tuple([o.string,o.union([c.NestableContent,e.GroupContent])]))})),e.GroupContent=o.recursion("GroupContent",()=>o.strict({__TYPE__:o.literal(e.GroupContentType),value:o.array(e.GroupItemContent)})),e.isGroupContent=e.GroupContent.is,e.GroupContentDefaultValue={__TYPE__:e.GroupContentType,value:[]};const f=o.record(o.string,o.unknown),p=S=>new o.Type("GroupItemLegacy",I=>(0,s.hasContentType)(I)&&I.__TYPE__===e.GroupItemContentType,I=>(0,i.pipe)(f.decode(I),n.either.map(g=>({value:Object.entries(g).reduce((y,[x,w])=>{const M=(0,u.getFieldCtx)(x,S),O=M.fieldType===a.GroupFieldType?(0,e.GroupLegacy)(M).decode(w):(0,c.NestableLegacy)(M).decode(w);return!O||(0,r.isLeft)(O)?y:[...y,[x,O.right]]},[]),__TYPE__:e.GroupItemContentType}))),I=>I.value.reduce((T,[g,C])=>{const y=(0,u.getFieldCtx)(g,S),x=(0,e.isGroupContent)(C)?(0,e.GroupLegacy)(y).encode(C):(0,c.NestableLegacy)(y).encode(C);return x?{content:{...T.content,[g]:x.content},types:{...T.types,...x.types}}:T},{content:{},types:{}}));e.GroupItemLegacy=p;const A=S=>{const I=o.array(o.union([o.null,(0,e.GroupItemLegacy)(S)])),T=o.array((0,e.GroupItemLegacy)(S));return new o.Type("GroupLegacy",e.isGroupContent,g=>(0,i.pipe)(I.decode(g),n.either.map(C=>({value:C.map(y=>y===null?{__TYPE__:e.GroupItemContentType,value:[]}:y),__TYPE__:e.GroupContentType}))),g=>{const C=T.encode(g.value);return{content:C.map(y=>y.content),types:C.reduce((y,x)=>({...y,...x.types}),{[S.keyOfType]:a.GroupFieldType})}})};e.GroupLegacy=A;function h(S,I){var T;const g=(T=S.config)===null||T===void 0?void 0:T.fields;return g?{...I,value:(0,l.repeatableContentWithDefaultNestableContentValues)(g,I.value)}:I}e.groupContentWithDefaultValues=h;function v({path:S,key:I,apiId:T,model:g,content:C}){return y=>{var x;const w=_({path:S,model:(x=g==null?void 0:g.config)===null||x===void 0?void 0:x.fields,content:C.value})(y);return y({path:S,key:I,apiId:T,model:g,content:{__TYPE__:C.__TYPE__,value:w}})}}e.traverseGroupContent=v;function _({path:S,model:I,content:T}){return g=>T.map((C,y)=>{const x=S.concat([{key:y.toString(),type:"GroupItem"}]),w=C.value.reduce((M,[O,F])=>{const K=I==null?void 0:I[O];let N;return(!K||(K==null?void 0:K.type)===a.GroupFieldType)&&F.__TYPE__===e.GroupContentType?N=v({path:x.concat([{key:O,type:"Widget"}]),key:O,apiId:O,model:K,content:F})(g):N=g({path:x.concat([{key:O,type:"Widget"}]),key:O,apiId:O,model:K,content:F}),!N||!((0,c.isNestableContent)(N)||(0,e.isGroupContent)(N))?M:M.concat([[O,N]])},[]);return{__TYPE__:C.__TYPE__,value:w}})}e.traverseGroupItemsContent=_}(mb)),mb}var Lb={},jb={},Ub={},Xu={},hF;function V9(){if(hF)return Xu;hF=1,Object.defineProperty(Xu,"__esModule",{value:!0}),Xu.RepeatableWidgets=Xu.RepeatableWidgetsLegacy=void 0;const t=(0,Q.__importStar)(Y),n=qa(),r=Oo(),i=u=>t.array((0,n.GroupItemLegacy)(u));Xu.RepeatableWidgetsLegacy=i;const o=t.tuple([t.string,t.union([r.NestableContent,n.GroupContent])]),a=t.strict({__TYPE__:t.literal(n.GroupItemContentType),value:t.array(o)});return Xu.RepeatableWidgets=t.array(a),Xu}var mF;function Im(){return mF||(mF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.migrateCompositeSlice=e.traverseCompositeSliceContent=e.compositeSliceContentWithDefaultValues=e.CompositeSliceContent=e.CompositeSliceLegacy=e.isCompositeSliceContent=e.CompositeSliceContentType=void 0;const t=Q,n=st,r=un,i=He,o=(0,t.__importStar)(Y),a=qn,u=Wt(),s=qa(),c=Oo(),l=L0(),f=V9();e.CompositeSliceContentType="CompositeSliceContent";const p=I=>(0,u.hasContentType)(I)&&I.__TYPE__===e.CompositeSliceContentType;e.isCompositeSliceContent=p;const A=o.exact(o.partial({repeat:o.array(o.unknown),"non-repeat":o.UnknownRecord})),h=I=>new o.Type("CompositeSliceLegacy",e.isCompositeSliceContent,T=>(0,i.pipe)(A.decode(T),n.either.map(g=>{const C=(()=>{const x=(0,a.getFieldCtx)("repeat",I),w=(0,f.RepeatableWidgetsLegacy)(x).decode(g.repeat);if(!(!w||(0,r.isLeft)(w)))return w.right})()||[];return{nonRepeat:Object.entries(g["non-repeat"]||{}).reduce((x,[w,M])=>{const O=(0,a.getFieldCtx)(w,I,["non-repeat"]);if(!O)return x;const F=(0,c.NestableLegacy)(O).decode(M);return!F||(0,r.isLeft)(F)?x:{...x,[w]:F.right}},{}),repeat:C,__TYPE__:e.CompositeSliceContentType}})),T=>{const g=Object.entries(T.nonRepeat).reduce((y,[x,w])=>{const M=(0,a.getFieldCtx)(x,I,["non-repeat"]),O=(0,c.NestableLegacy)(M).encode(w);return O?{content:{...y.content,[x]:O.content},types:{...y.types,...O.types}}:y},{content:{},types:{}}),C=(()=>{const y=(0,a.getFieldCtx)("repeat",I);return(0,f.RepeatableWidgetsLegacy)(y).encode(T.repeat)})()||[];return{content:{"non-repeat":g.content,repeat:C.map(y=>y.content)},types:{[I.keyOfType]:"Slice",...g.types,...C.reduce((y,x)=>({...y,...x.types}),{})}}});e.CompositeSliceLegacy=h,e.CompositeSliceContent=o.strict({__TYPE__:o.literal(e.CompositeSliceContentType),nonRepeat:o.record(o.string,c.NestableContent),repeat:f.RepeatableWidgets});function v(I,T){var g,C;const y=(0,l.withDefaultNestableContentValues)((g=I["non-repeat"])!==null&&g!==void 0?g:{},T.nonRepeat),x=(0,l.repeatableContentWithDefaultNestableContentValues)((C=I.repeat)!==null&&C!==void 0?C:{},T.repeat);return{...T,nonRepeat:y,repeat:x}}e.compositeSliceContentWithDefaultValues=v;function _({path:I,sliceKey:T,sliceName:g,model:C,content:y}){return(x,w)=>{const M=Object.entries(y.widget.nonRepeat).reduce((F,[K,N])=>{const J=(()=>{var ae,ge,se;return(C==null?void 0:C.type)==="SharedSlice"?(ge=(ae=C==null?void 0:C.fields)===null||ae===void 0?void 0:ae.primary)===null||ge===void 0?void 0:ge[K]:(se=C==null?void 0:C["non-repeat"])===null||se===void 0?void 0:se[K]})(),Z=x({path:I.concat([{key:"non-repeat",type:"primary"},{key:K,type:"Widget"}]),key:K,apiId:g,model:J,content:N});return Z?(0,c.isNestableContent)(Z)?{...F,[K]:Z}:(console.warn(`Warn: Non nestable content with key [${K}] detected in a composite slice [${g}] with key [${T}]`),F):F},{}),O=(0,s.traverseGroupItemsContent)({path:I.concat([{key:"repeat",type:"items"}]),model:(C==null?void 0:C.type)==="SharedSlice"?C==null?void 0:C.fields.items:C==null?void 0:C.repeat,content:y.widget.repeat})(x);return w({key:T,apiId:g,path:I,model:C,content:{...y,widget:{__TYPE__:"CompositeSliceContent",repeat:O,nonRepeat:M}}})}}e.traverseCompositeSliceContent=_;function S(I,T){const[,g]=T.key.split("$");return{key:`${I.sliceName}$${g}`,name:I.sliceName,maybeLabel:T.maybeLabel,widget:{__TYPE__:"SharedSliceContent",variation:I.variationId,primary:Object.entries(T.widget.nonRepeat).reduce((C,[y,x])=>{var w;return!((w=I.fields.primary)===null||w===void 0)&&w[y]?{...C,[y]:x}:(console.warn(`The widget ${y} in the non-repeat zone of the composite slice [${I.sliceName}] with key [${T.key}] doesn't exist in the model.`),C)},{}),items:T.widget.repeat.map(C=>({__TYPE__:"GroupItemContent",value:C.value.reduce((y,[x,w])=>{var M;return!((M=I.fields.items)===null||M===void 0)&&M[x]?y.concat([[x,w]]):(console.warn(`The widget ${x} in the repeat zone of the composite slice [${I.sliceName}] with key [${T.key}] doesn't exist in the model.`),y)},[])}),[])}}}e.migrateCompositeSlice=S}(Ub)),Ub}var Bb={},Ko={},gF;function z9(){if(gF)return Ko;gF=1,Object.defineProperty(Ko,"__esModule",{value:!0}),Ko.isSlicePrimaryContent=Ko.SlicePrimaryLegacy=Ko.SlicePrimaryContent=void 0;const t=(0,Q.__importStar)(Y),n=le,r=qa(),i=Oo();Ko.SlicePrimaryContent=t.union([i.NestableContent,r.GroupContent]);const o=u=>{const s=(0,r.GroupLegacy)(u),c=(0,i.NestableLegacy)(u);return{decode(l){return u.fieldType===n.GroupFieldType?s.decode(l):c.decode(l)},encode(l){return(0,r.isGroupContent)(l)?s.encode(l):c.encode(l)}}};Ko.SlicePrimaryLegacy=o;const a=u=>(0,i.isNestableContent)(u)||(0,r.isGroupContent)(u);return Ko.isSlicePrimaryContent=a,Ko}var vF;function Tm(){return vF||(vF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.traverseSharedSliceContent=e.sharedSliceContentWithDefaultValues=e.SharedSliceContent=e.SharedSliceLegacy=e.isSharedSliceContent=e.SharedSliceContentType=void 0;const t=Q,n=st,r=un,i=He,o=(0,t.__importStar)(Y),a=I0,u=le,s=qn,c=Wt(),l=qa(),f=Oo(),p=L0(),A=V9(),h=z9();e.SharedSliceContentType="SharedSliceContent";const v=g=>(0,c.hasContentType)(g)&&g.__TYPE__===e.SharedSliceContentType;e.isSharedSliceContent=v;const _=o.exact(o.type({variation:o.string,items:(0,a.withFallback)(o.array(o.unknown),[]),primary:(0,a.withFallback)(o.UnknownRecord,{})})),S=g=>new o.Type("SharedSliceLegacy",e.isSharedSliceContent,C=>(0,i.pipe)(_.decode(C),n.either.map(y=>{const x=(()=>{const M=(0,s.getFieldCtx)("items",g,["variations",y.variation]),O=(0,A.RepeatableWidgetsLegacy)(M).decode(y.items);if(!(!O||(0,r.isLeft)(O)))return O.right})()||[],w=Object.entries(y.primary).reduce((M,[O,F])=>{const K=(0,s.getFieldCtx)(O,g,["variations",y.variation,"primary"]),N=(0,h.SlicePrimaryLegacy)(K).decode(F);return!N||(0,r.isLeft)(N)?M:{...M,[O]:N.right}},{});return{variation:y.variation,primary:w,items:x,__TYPE__:e.SharedSliceContentType}})),C=>{const y=Object.entries(C.primary).reduce((w,[M,O])=>{const F=(0,s.getFieldCtx)(M,g,["variations",C.variation,"primary"]),K=(0,h.SlicePrimaryLegacy)(F).encode(O);return K?{content:{...w.content,[M]:K.content},types:{...w.types,...K.types}}:w},{content:{},types:{}}),x=(()=>{const w=(0,s.getFieldCtx)("items",g,["variations",C.variation]);return(0,A.RepeatableWidgetsLegacy)(w).encode(C.items)})()||[];return{content:{primary:y.content,items:x.map(w=>w.content),variation:C.variation},types:{[g.keyOfType]:"SharedSlice",...y.types,...x.reduce((w,M)=>({...w,...M.types}),{})}}});e.SharedSliceLegacy=S,e.SharedSliceContent=o.strict({__TYPE__:o.literal(e.SharedSliceContentType),variation:o.string,primary:o.record(o.string,h.SlicePrimaryContent),items:A.RepeatableWidgets});function I(g,C){var y,x;const w=g.variations.find(N=>N.id===C.variation),M=(y=w==null?void 0:w.primary)!==null&&y!==void 0?y:{},O=(x=w==null?void 0:w.items)!==null&&x!==void 0?x:{},F=(0,p.withDefaultSlicePrimaryContentValues)(M,C.primary),K=(0,p.repeatableContentWithDefaultNestableContentValues)(O,C.items);return{...C,primary:F,items:K}}e.sharedSliceContentWithDefaultValues=I;function T({path:g,sliceKey:C,sliceName:y,model:x,content:w}){return(M,O)=>{const F=Object.entries(w.widget.primary).reduce((N,[J,Z])=>{var ae,ge;const se=(ge=(ae=x==null?void 0:x.fields)===null||ae===void 0?void 0:ae.primary)===null||ge===void 0?void 0:ge[J],k=(()=>(0,l.isGroupContent)(Z)?(0,l.traverseGroupContent)({path:g.concat([{key:"primary",type:"primary"},{key:J,type:"Widget"}]),key:J,apiId:J,content:Z,model:(se==null?void 0:se.type)===u.GroupFieldType?se:void 0})(M):(0,f.isNestableContent)(Z)?M({path:g.concat([{key:"primary",type:"primary"},{key:J,type:"Widget"}]),key:J,apiId:J,model:se,content:Z}):void 0)();return k?((0,h.isSlicePrimaryContent)(k)||console.warn(`Warn: Non nestable or group content with key [${J}] detected in a shared slice [${y}] with key [${C}]`),{...N,[J]:k}):N},{}),K=(0,l.traverseGroupItemsContent)({path:g.concat([{key:"items",type:"items"}]),model:x==null?void 0:x.fields.items,content:w.widget.items})(M);return O({key:C,apiId:y,path:g,model:x,content:{...w,widget:{__TYPE__:"SharedSliceContent",variation:w.widget.variation,primary:F,items:K}}})}}e.traverseSharedSliceContent=T}(Bb)),Bb}var Cr={},yF;function xm(){if(yF)return Cr;yF=1,Object.defineProperty(Cr,"__esModule",{value:!0}),Cr.migrateSimpleSlice=Cr.traverseSimpleSliceContent=Cr.SimpleSliceLegacy=Cr.isSimpleSliceContent=Cr.SimpleSliceContent=void 0;const t=(0,Q.__importStar)(Y),n=qa(),r=Oo();Cr.SimpleSliceContent=t.union([r.NestableContent,n.GroupContent]);const i=s=>(0,r.isNestableContent)(s)||(0,n.isGroupContent)(s);Cr.isSimpleSliceContent=i;const o=s=>({decode:(()=>s.fieldType==="Group"?(0,n.GroupLegacy)(s).decode.bind(null):(0,r.NestableLegacy)(s).decode.bind(null))(),encode:c=>{switch(c.__TYPE__){case"GroupContentType":return(0,n.GroupLegacy)(s).encode(c);default:return(0,r.NestableLegacy)(s).encode(c)}}});Cr.SimpleSliceLegacy=o;function a({path:s,sliceKey:c,sliceName:l,model:f,content:p}){return(A,h)=>{if((0,n.isGroupContent)(p.widget)){const _=(0,n.traverseGroupContent)({path:s,key:p.key,apiId:p.name,model:(()=>{if((f==null?void 0:f.type)==="Group")return f;if((f==null?void 0:f.type)==="SharedSlice")return{type:"Group",config:{fields:f.fields.items||{}}}})(),content:p.widget})(A);return _&&h({key:p.key,apiId:p.name,path:s,model:f,content:{...p,widget:_}})}const v=A({key:p.key,apiId:p.name,path:s,model:(()=>{var _;if((f==null?void 0:f.type)==="SharedSlice")return(_=f.fields.primary)===null||_===void 0?void 0:_[p.name];if((f==null?void 0:f.type)!=="Group")return f})(),content:p.widget});return v&&h({key:c,apiId:l,path:s,model:f,content:{...p,widget:v}})}}Cr.traverseSimpleSliceContent=a;function u(s,c){var l;const[,f]=c.key.split("$"),p=`${s.sliceName}$${f}`;return c.widget.__TYPE__==="GroupContentType"?{key:p,name:s.sliceName,maybeLabel:c.maybeLabel,widget:{__TYPE__:"SharedSliceContent",variation:s.variationId,primary:{},items:c.widget.value.map(A=>({__TYPE__:"GroupItemContent",value:A.value.reduce((h,[v,_])=>{var S;return!((S=s.fields.items)===null||S===void 0)&&S[v]?h.concat([[v,_]]):h},[])}),[])}}:{key:p,name:s.sliceName,maybeLabel:c.maybeLabel,widget:{__TYPE__:"SharedSliceContent",variation:s.variationId,primary:!((l=s.fields.primary)===null||l===void 0)&&l[c.name]?{[c.name]:c.widget}:{},items:[]}}}return Cr.migrateSimpleSlice=u,Cr}var bF;function H9(){return bF||(bF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SliceContent=e.SliceLegacy=void 0;const t=Q,n=(0,t.__importStar)(Y),r=Im(),i=Tm(),o=xm(),a=u=>({decode:s=>(()=>{switch(u.fieldType){case"Slice":return(0,r.CompositeSliceLegacy)(u);case"SharedSlice":return(0,i.SharedSliceLegacy)(u);default:return(0,o.SimpleSliceLegacy)(u)}})().decode(s),encode:s=>{switch(s.__TYPE__){case"SharedSliceContent":return(0,i.SharedSliceLegacy)(u).encode(s);case"CompositeSliceContent":return(0,r.CompositeSliceLegacy)(u).encode(s);default:return(0,o.SimpleSliceLegacy)(u).encode(s)}}});e.SliceLegacy=a,e.SliceContent=n.union([r.CompositeSliceContent,i.SharedSliceContent,o.SimpleSliceContent]),(0,t.__exportStar)(Im(),e),(0,t.__exportStar)(Tm(),e),(0,t.__exportStar)(xm(),e),(0,t.__exportStar)(z9(),e)}(jb)),jb}var cn={},CF;function Y9(){if(CF)return cn;CF=1,Object.defineProperty(cn,"__esModule",{value:!0}),cn.migrateSliceItem=cn.SlicesItemLegacy=cn.sliceItemContentWithDefaultValues=cn.isSimpleSliceItemContent=cn.isCompositeSliceItemContent=cn.isSharedSliceItemContent=cn.SliceItemContent=void 0;const e=Q,t=st,n=un,r=He,i=(0,e.__importStar)(Y),o=Je,a=qn,u=qa(),s=Oo(),c=L0(),l=H9(),f=Im(),p=Tm(),A=xm();cn.SliceItemContent=i.type({key:i.string,name:i.string,maybeLabel:i.union([i.string,i.undefined]),widget:l.SliceContent});function h(C){return(0,p.isSharedSliceContent)(C.widget)}cn.isSharedSliceItemContent=h;function v(C){return(0,f.isCompositeSliceContent)(C.widget)}cn.isCompositeSliceItemContent=v;function _(C){return(0,u.isGroupContent)(C.widget)||(0,s.isNestableContent)(C.widget)}cn.isSimpleSliceItemContent=_;function S(C,y){var x;if(C.type==="SharedSlice"&&(0,p.isSharedSliceContent)(y))return(0,l.sharedSliceContentWithDefaultValues)(C,y);if(C.type==="Slice"&&(0,f.isCompositeSliceContent)(y))return(0,l.compositeSliceContentWithDefaultValues)(C,y);if(C.type==="Group"&&(0,u.isGroupContent)(y)&&(!((x=C.config)===null||x===void 0)&&x.fields)){const w=(0,c.repeatableContentWithDefaultNestableContentValues)(C.config.fields,y.value);return{...y,value:w}}return y}cn.sliceItemContentWithDefaultValues=S;const I=i.exact(i.intersection([i.type({key:i.string,value:i.unknown}),i.partial({label:(0,o.nullable)(i.string)})])),T=C=>new i.Type("SlicesItemLegacy",y=>((0,p.isSharedSliceContent)(y.widget),(0,f.isCompositeSliceContent)(y.widget),(0,A.isSimpleSliceContent)(y.widget)),(y,x)=>(0,r.pipe)(I.decode(y),t.either.chain(w=>{var M;const O=w.key.indexOf("$"),F=w.key.substring(0,O>0?O:void 0),K=(0,a.getFieldCtx)(F,C),N=(0,l.SliceLegacy)(K).decode(w.value);return!N||(0,n.isLeft)(N)?i.failure(y,x):i.success({key:w.key,name:F,maybeLabel:(M=w.label)!==null&&M!==void 0?M:void 0,widget:N.right})})),y=>{const x=(0,a.getFieldCtx)(y.name,C),w=(0,l.SliceLegacy)(x).encode(y.widget);return{content:{key:y.key,label:y.maybeLabel,value:(w==null?void 0:w.content)||{}},types:(w==null?void 0:w.types)||{}}});cn.SlicesItemLegacy=T;const g=({model:C,content:y})=>v(y)&&(C==null?void 0:C.type)==="SharedSlice"?(0,f.migrateCompositeSlice)(C,y):_(y)&&(C==null?void 0:C.type)==="SharedSlice"?(0,A.migrateSimpleSlice)(C,y):y;return cn.migrateSliceItem=g,cn}var Wb={},SF;function aTe(){return SF||(SF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.traverseSlices=e.slicesContentWithDefaultValues=e.SlicesContent=e.SlicesLegacy=e.isSlicesContent=e.SlicesContentType=void 0;const t=Q,n=st,r=He,i=(0,t.__importStar)(Y),o=lh,a=le,u=Wt(),s=Im(),c=Tm(),l=xm(),f=Y9();e.SlicesContentType="SliceContentType";const p=S=>(0,u.hasContentType)(S)&&S.__TYPE__===e.SlicesContentType;e.isSlicesContent=p;const A=S=>{const I=i.array((0,f.SlicesItemLegacy)(S));return new i.Type("SlicesLegacy",e.isSlicesContent,T=>(0,r.pipe)(I.decode(T),n.either.map(g=>({__TYPE__:e.SlicesContentType,value:g}))),T=>{const g=I.encode(T.value);return{content:g.map(C=>C.content),types:g.reduce((C,y)=>({...C,...y.types}),{[S.keyOfType]:"Slices"})}})};e.SlicesLegacy=A,e.SlicesContent=i.type({__TYPE__:i.literal(e.SlicesContentType),value:i.array(f.SliceItemContent)});function h(S,I){var T;const g=(T=S==null?void 0:S.config)===null||T===void 0?void 0:T.choices;if(g===void 0)return I;const C=I.value.map(y=>{const x=g[y.name];if(x){const w=(0,f.sliceItemContentWithDefaultValues)(x,y.widget);return{...y,widget:w}}return y});return{...I,value:C}}e.slicesContentWithDefaultValues=h;function v(S,I,T){var g,C;const y=(C=(g=I==null?void 0:I.config)===null||g===void 0?void 0:g.choices)===null||C===void 0?void 0:C[T.name],x=()=>{if((0,f.isSharedSliceItemContent)(T)&&y&&(0,a.isStaticSharedSlice)(y)){const O=y.variations.find(F=>F.id===T.widget.variation);return O?{type:"SharedSlice",sliceName:y.id,variationId:O.id,fields:{primary:O.primary||{},items:O.items||{}}}:void 0}},w=()=>{var O;const F=o.ContentPath.append(o.ContentPath.serialize(S),T.name),K=Object.values(((O=I==null?void 0:I.config)===null||O===void 0?void 0:O.choices)||{}).find(J=>{var Z;return(0,a.isStaticSharedSlice)(J)?!!(!((Z=J.legacyPaths)===null||Z===void 0)&&Z[F]):!1});if(!K)return;const N=K==null?void 0:K.variations.find(J=>{var Z;return J.id===((Z=K.legacyPaths)===null||Z===void 0?void 0:Z[F])});if(N)return{type:"SharedSlice",sliceName:K.id,variationId:N.id,fields:{primary:N.primary||{},items:N.items||{}}}},M=()=>{if(y){if((0,a.isCompositeSlice)(y))return{type:"Slice","non-repeat":y["non-repeat"]||{},repeat:y.repeat||{}};if((0,a.isLegacySlice)(y))return y}};return x()||w()||M()}function _({path:S,key:I,model:T,content:g}){return({transformWidget:C=({content:x})=>x,transformSlice:y=({content:x})=>x})=>{const x=g.value.reduce((w,M)=>{const O=T&&v(S,T,M),F=(()=>{if((0,f.isSharedSliceItemContent)(M))return(0,c.traverseSharedSliceContent)({path:S.concat({key:M.key,type:"SharedSlice"}),sliceKey:M.key,sliceName:M.name,model:(O==null?void 0:O.type)==="SharedSlice"?O:void 0,content:M})(C,y);if((0,f.isCompositeSliceItemContent)(M))return(0,s.traverseCompositeSliceContent)({path:S.concat({key:M.key,type:"Slice"}),sliceKey:M.key,sliceName:M.name,model:(O==null?void 0:O.type)==="Slice"||(O==null?void 0:O.type)==="SharedSlice"?O:void 0,content:M})(C,y);if((0,f.isSimpleSliceItemContent)(M))return(0,l.traverseSimpleSliceContent)({path:S.concat({key:M.key,type:"LegacySlice"}),sliceKey:M.key,sliceName:M.name,model:O&&(O==null?void 0:O.type)!=="Slice"?O:void 0,content:M})(C,y)})();return F?w.concat(F):w},[]);return C({path:S,key:I,apiId:I,model:T,content:{__TYPE__:g.__TYPE__,value:x}})}}e.traverseSlices=_}(Wb)),Wb}var _F;function G9(){return _F||(_F=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Q;(0,t.__exportStar)(H9(),e),(0,t.__exportStar)(Y9(),e),(0,t.__exportStar)(aTe(),e)}(Lb)),Lb}var Kb={},IF;function J9(){return IF||(IF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.UIDContent=e.UIDLegacy=e.isUIDContent=e.UIDContentType=void 0;const t=Q,n=st,r=He,i=(0,t.__importStar)(Y),o=Wt();e.UIDContentType="UIDContent";const a=s=>(0,o.hasContentType)(s)&&s.__TYPE__===e.UIDContentType;e.isUIDContent=a;const u=s=>new i.Type("UIDLegacy",e.isUIDContent,c=>(0,r.pipe)(i.string.decode(c),n.either.map(l=>e.UIDContent.encode({value:l,__TYPE__:e.UIDContentType}))),c=>({content:c.value,types:{[s.keyOfType]:"UID"}}));e.UIDLegacy=u,e.UIDContent=i.type({__TYPE__:i.literal(e.UIDContentType),value:i.string})}(Kb)),Kb}var Po={},TF;function uTe(){if(TF)return Po;TF=1,Object.defineProperty(Po,"__esModule",{value:!0}),Po.WidgetLegacy=Po.isWidgetContent=Po.WidgetContent=void 0;const t=(0,Q.__importStar)(Y),n=qa(),r=Oo(),i=G9(),o=J9();Po.WidgetContent=t.union([n.GroupContent,r.NestableContent,o.UIDContent,i.SlicesContent]);const a=s=>(0,n.isGroupContent)(s)||(0,r.isNestableContent)(s)||(0,o.isUIDContent)(s)||(0,i.isSlicesContent)(s);Po.isWidgetContent=a;const u=s=>({decode(c){if(!s.fieldType)return;const l=(()=>{switch(s.fieldType){case"UID":return(0,o.UIDLegacy)(s);case"Group":return(0,n.GroupLegacy)(s);case"Choice":case"Slices":return(0,i.SlicesLegacy)(s);default:return(0,r.NestableLegacy)(s)}})();if(l)return l.decode(c)},encode(c){switch(c.__TYPE__){case o.UIDContentType:return(0,o.UIDLegacy)(s).encode(c);case n.GroupContentType:return(0,n.GroupLegacy)(s).encode(c);case i.SlicesContentType:return(0,i.SlicesLegacy)(s).encode(c);default:return(0,r.NestableLegacy)(s).encode(c)}}});return Po.WidgetLegacy=u,Po}var xF;function gR(){return xF||(xF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Q;(0,t.__exportStar)(W9(),e),(0,t.__exportStar)(qa(),e),(0,t.__exportStar)(Oo(),e),(0,t.__exportStar)(G9(),e),(0,t.__exportStar)(J9(),e),(0,t.__exportStar)(uTe(),e)}(Ab)),Ab}Object.defineProperty(nr,"__esModule",{value:!0});nr.migrateDocument=nr.collectWidgets=nr.traverseDocument=nr.fillDocumentWithDefaultValues=nr.DocumentLegacy=nr.Document=void 0;const sTe=Q,Z9=st,vR=un,X9=He,$l=(0,sTe.__importStar)(Y),eq=lh,yR=Fc,El=le,vi=gR(),q1=qn;nr.Document=$l.record(yR.WidgetKey,vi.WidgetContent);const cTe=$l.record(yR.WidgetKey,$l.unknown),bR=e=>new $l.Type("Document",t=>!!t&&typeof t=="object",t=>(0,X9.pipe)(cTe.decode(t),Z9.either.map(n=>Object.entries(n).reduce((r,[i,o])=>{const a=(0,q1.defaultCtx)(i,e),u=(0,vi.WidgetLegacy)(a).decode(o);return!u||(0,vR.isLeft)(u)?r:{...r,[i]:u.right}},{}))),t=>Object.entries(t).reduce((n,[r,i])=>{const o=(0,q1.defaultCtx)(r,e),a=(0,vi.WidgetLegacy)(o).encode(i);return a?{content:{...n.content,[r]:a.content},types:{...n.types,...a.types}}:n},{content:{},types:{}}));function tq(e){const t=Object.entries(e),{types:n,widgets:r}=t.reduce((a,[u,s])=>{if(u.endsWith("_TYPE")){const c=q1.FieldOrSliceType.decode(s);if((0,vR.isRight)(c))return{...a,types:a.types.set(u.substring(0,u.length-5),c.right)}}return!u.endsWith("_POSITION")&&!u.endsWith("_TYPE")?{...a,widgets:{...a.widgets,[u]:s}}:a},{types:new Map,widgets:{}}),i=e.slugs_INTERNAL||[],o=e.uid;return{widgets:r,types:n,uid:o,slugs:i}}function lTe(e,t){const n=(0,X9.pipe)($l.record(yR.WidgetKey,$l.unknown).decode(e),Z9.either.chain(r=>{const{types:i,widgets:o}=tq(r);return bR(i).decode(o)}));return(0,vR.isLeft)(n)?void 0:nq(n.right,t)}function fTe(e){const t=bR().encode(e);return{...t.content,...t.types}}nr.DocumentLegacy={_codec:bR,extractMetadata:tq,parse:lTe,encode:fTe};function CR(e){return{customTypeId:e==null?void 0:e.id,fields:Object.fromEntries((0,El.flattenSections)(e))}}function dTe(e,t){const{fields:n}=e&&El.StaticCustomType.is(e)?CR(e):e;return Object.entries(n).reduce((r,[i,o])=>{const a=t[i],u=(()=>{switch(o.type){case"Group":return(0,vi.isGroupContent)(a)?(0,vi.groupContentWithDefaultValues)(o,a):a;case"Choice":case"Slices":return(0,vi.isSlicesContent)(a)?(0,vi.slicesContentWithDefaultValues)(o,a):a;default:return a===void 0&&El.NestableWidget.is(o)?(0,vi.NestableContentDefaultValue)(o):a}})();return u?{...r,[i]:u}:r},t)}nr.fillDocumentWithDefaultValues=dTe;function SR({document:e,customType:t}){const n=t&&El.StaticCustomType.is(t)?CR(t):t;return({transformWidget:r=({content:o})=>o,transformSlice:i=({content:o})=>o})=>{const o=n&&Object.entries(n.fields).reduce((a,[u,s])=>({...a,[u]:s}),{});return Object.entries(e).reduce((a,[u,s])=>{const c=o&&o[u],l=eq.ContentPath.make([{key:n==null?void 0:n.customTypeId,type:"CustomType"},{key:u,type:"Widget"}]),f=(()=>{switch(s.__TYPE__){case"SliceContentType":return(0,vi.traverseSlices)({path:l,key:u,model:(c==null?void 0:c.type)==="Slices"||(c==null?void 0:c.type)==="Choice"?c:void 0,content:s})({transformWidget:r,transformSlice:i});case"GroupContentType":return(0,vi.traverseGroupContent)({path:l,key:u,apiId:u,model:(c==null?void 0:c.type)==="Group"?c:void 0,content:s})(r);default:return r({path:l,key:u,apiId:u,model:(c==null?void 0:c.type)!=="Group"&&(c==null?void 0:c.type)!=="Slices"&&(c==null?void 0:c.type)!=="Choice"?c:void 0,content:s})}})();return{...a,...f?{[u]:f}:{}}},{})}}nr.traverseDocument=SR;function pTe(e,t){const n={};return SR({document:e})({transformWidget:({content:r,path:i})=>{const o=eq.ContentPath.serialize(i);return t(r,i)&&(n[o]=r),r}}),n}nr.collectWidgets=pTe;function nq(e,t){const n=El.StaticCustomType.is(t)?CR(t):t;return Object.values((0,El.collectSharedSlices)(n)).some(i=>!!i.legacyPaths)?SR({document:e,customType:t})({transformSlice:vi.migrateSliceItem}):e}nr.migrateDocument=nq;(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Q;(0,t.__exportStar)(nr,e),(0,t.__exportStar)(gR(),e),(0,t.__exportStar)(qn,e)})(Ue);function ATe(e,t){const n=hTe(e,t),r=mTe(e,n);return Ue.fillDocumentWithDefaultValues(e,r)}function hTe(e,t){return le.flattenSections(e).reduce((r,[i,o])=>!t[i]&&o.type==="Group"?{...r,[i]:rq}:r,t)}function mTe(e,t){return Ue.traverseDocument({document:t,customType:e})({transformWidget({model:n,content:r}){return n?r:void 0},transformSlice(n){return n.model?n.content:void 0}})}const rq={__TYPE__:"GroupContentType",value:[{__TYPE__:"GroupItemContent",value:[]}]},iq={unclassified:{title:"Draft",color:"amber"},published:{title:"Live",color:"green"},release:{title:"Planned",color:"purple"},archived:{title:"Archived",color:"grey"}},oq={unclassified:["unclassified","published"],archived:["unclassified","published"],release:["release","published"],published:["published"]};function _R(e){const{documentId:t,versionId:n,baseUrl:r,status:i,releaseId:o}=e,a={s:i,v:n,r:o},u=$r.createRouteParams({params:a}),s=new URLSearchParams(u).toString();return new URL(`pages/${t}?${s}`,r)}var Q1={exports:{}},hd={};/**
@@ -14,13 +14,13 @@ ${g.map(y=>` - ${y}`).join(`
14
14
  `+Yt+$}}var mt=!1,lt;{var Tt=typeof WeakMap=="function"?WeakMap:Map;lt=new Tt}function sn($,q){if(!$||mt)return"";{var X=lt.get($);if(X!==void 0)return X}var be;mt=!0;var Ye=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var it;it=bt.current,bt.current=null,Se();try{if(q){var De=function(){throw Error()};if(Object.defineProperty(De.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(De,[])}catch(Bo){be=Bo}Reflect.construct($,[],De)}else{try{De.call()}catch(Bo){be=Bo}$.call(De.prototype)}}else{try{throw Error()}catch(Bo){be=Bo}$()}}catch(Bo){if(Bo&&be&&typeof Bo.stack=="string"){for(var Be=Bo.stack.split(`
15
15
  `),Pn=be.stack.split(`
16
16
  `),Rt=Be.length-1,Kt=Pn.length-1;Rt>=1&&Kt>=0&&Be[Rt]!==Pn[Kt];)Kt--;for(;Rt>=1&&Kt>=0;Rt--,Kt--)if(Be[Rt]!==Pn[Kt]){if(Rt!==1||Kt!==1)do if(Rt--,Kt--,Kt<0||Be[Rt]!==Pn[Kt]){var zr=`
17
- `+Be[Rt].replace(" at new "," at ");return $.displayName&&zr.includes("<anonymous>")&&(zr=zr.replace("<anonymous>",$.displayName)),typeof $=="function"&&lt.set($,zr),zr}while(Rt>=1&&Kt>=0);break}}}finally{mt=!1,bt.current=it,rt(),Error.prepareStackTrace=Ye}var zc=$?$.displayName||$.name:"",SO=zc?Oe(zc):"";return typeof $=="function"&&lt.set($,SO),SO}function Fo($,q,X){return sn($,!1)}function Qa($){var q=$.prototype;return!!(q&&q.isReactComponent)}function fi($,q,X){if($==null)return"";if(typeof $=="function")return sn($,Qa($));if(typeof $=="string")return Oe($);switch($){case c:return Oe("Suspense");case l:return Oe("SuspenseList")}if(typeof $=="object")switch($.$$typeof){case s:return Fo($.render);case f:return fi($.type,q,X);case p:{var be=$,Ye=be._payload,it=be._init;try{return fi(it(Ye),q,X)}catch{}}}return""}var qr=Object.prototype.hasOwnProperty,Zi={},Mo=S.ReactDebugCurrentFrame;function di($){if($){var q=$._owner,X=fi($.type,$._source,q?q.type:null);Mo.setExtraStackFrame(X)}else Mo.setExtraStackFrame(null)}function tr($,q,X,be,Ye){{var it=Function.call.bind(qr);for(var De in $)if(it($,De)){var Be=void 0;try{if(typeof $[De]!="function"){var Pn=Error((be||"React class")+": "+X+" type `"+De+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof $[De]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Pn.name="Invariant Violation",Pn}Be=$[De](q,De,be,X,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Rt){Be=Rt}Be&&!(Be instanceof Error)&&(di(Ye),I("%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",X,De,typeof Be),di(null)),Be instanceof Error&&!(Be.message in Zi)&&(Zi[Be.message]=!0,di(Ye),I("Failed %s type: %s",X,Be.message),di(null))}}}var Qr=Array.isArray;function pi($){return Qr($)}function Ai($){{var q=typeof Symbol=="function"&&Symbol.toStringTag,X=q&&$[Symbol.toStringTag]||$.constructor.name||"Object";return X}}function ko($){try{return Lo($),!1}catch{return!0}}function Lo($){return""+$}function jo($){if(ko($))return I("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ai($)),Lo($)}var Vr=S.ReactCurrentOwner,Va={key:!0,ref:!0,__self:!0,__source:!0},Dc,j,L;L={};function W($){if(qr.call($,"ref")){var q=Object.getOwnPropertyDescriptor($,"ref").get;if(q&&q.isReactWarning)return!1}return $.ref!==void 0}function Le($){if(qr.call($,"key")){var q=Object.getOwnPropertyDescriptor($,"key").get;if(q&&q.isReactWarning)return!1}return $.key!==void 0}function U($,q){if(typeof $.ref=="string"&&Vr.current&&q&&Vr.current.stateNode!==q){var X=N(Vr.current.type);L[X]||(I('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',N(Vr.current.type),$.ref),L[X]=!0)}}function te($,q){{var X=function(){Dc||(Dc=!0,I("%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))};X.isReactWarning=!0,Object.defineProperty($,"key",{get:X,configurable:!0})}}function he($,q){{var X=function(){j||(j=!0,I("%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))};X.isReactWarning=!0,Object.defineProperty($,"ref",{get:X,configurable:!0})}}var pe=function($,q,X,be,Ye,it,De){var Be={$$typeof:t,type:$,key:q,ref:X,props:De,_owner:it};return Be._store={},Object.defineProperty(Be._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Be,"_self",{configurable:!1,enumerable:!1,writable:!1,value:be}),Object.defineProperty(Be,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Ye}),Object.freeze&&(Object.freeze(Be.props),Object.freeze(Be)),Be};function Te($,q,X,be,Ye){{var it,De={},Be=null,Pn=null;X!==void 0&&(jo(X),Be=""+X),Le(q)&&(jo(q.key),Be=""+q.key),W(q)&&(Pn=q.ref,U(q,Ye));for(it in q)qr.call(q,it)&&!Va.hasOwnProperty(it)&&(De[it]=q[it]);if($&&$.defaultProps){var Rt=$.defaultProps;for(it in Rt)De[it]===void 0&&(De[it]=Rt[it])}if(Be||Pn){var Kt=typeof $=="function"?$.displayName||$.name||"Unknown":$;Be&&te(De,Kt),Pn&&he(De,Kt)}return pe($,Be,Pn,Ye,be,Vr.current,De)}}var at=S.ReactCurrentOwner,Kn=S.ReactDebugCurrentFrame;function br($){if($){var q=$._owner,X=fi($.type,$._source,q?q.type:null);Kn.setExtraStackFrame(X)}else Kn.setExtraStackFrame(null)}var Nc;Nc=!1;function hi($){return typeof $=="object"&&$!==null&&$.$$typeof===t}function qc(){{if(at.current){var $=N(at.current.type);if($)return`
17
+ `+Be[Rt].replace(" at new "," at ");return $.displayName&&zr.includes("<anonymous>")&&(zr=zr.replace("<anonymous>",$.displayName)),typeof $=="function"&&lt.set($,zr),zr}while(Rt>=1&&Kt>=0);break}}}finally{mt=!1,bt.current=it,rt(),Error.prepareStackTrace=Ye}var zc=$?$.displayName||$.name:"",SO=zc?Oe(zc):"";return typeof $=="function"&&lt.set($,SO),SO}function Fo($,q,X){return sn($,!1)}function Qa($){var q=$.prototype;return!!(q&&q.isReactComponent)}function fi($,q,X){if($==null)return"";if(typeof $=="function")return sn($,Qa($));if(typeof $=="string")return Oe($);switch($){case c:return Oe("Suspense");case l:return Oe("SuspenseList")}if(typeof $=="object")switch($.$$typeof){case s:return Fo($.render);case f:return fi($.type,q,X);case p:{var be=$,Ye=be._payload,it=be._init;try{return fi(it(Ye),q,X)}catch{}}}return""}var qr=Object.prototype.hasOwnProperty,Zi={},Mo=S.ReactDebugCurrentFrame;function di($){if($){var q=$._owner,X=fi($.type,$._source,q?q.type:null);Mo.setExtraStackFrame(X)}else Mo.setExtraStackFrame(null)}function tr($,q,X,be,Ye){{var it=Function.call.bind(qr);for(var De in $)if(it($,De)){var Be=void 0;try{if(typeof $[De]!="function"){var Pn=Error((be||"React class")+": "+X+" type `"+De+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof $[De]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Pn.name="Invariant Violation",Pn}Be=$[De](q,De,be,X,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Rt){Be=Rt}Be&&!(Be instanceof Error)&&(di(Ye),I("%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",X,De,typeof Be),di(null)),Be instanceof Error&&!(Be.message in Zi)&&(Zi[Be.message]=!0,di(Ye),I("Failed %s type: %s",X,Be.message),di(null))}}}var Qr=Array.isArray;function pi($){return Qr($)}function Ai($){{var q=typeof Symbol=="function"&&Symbol.toStringTag,X=q&&$[Symbol.toStringTag]||$.constructor.name||"Object";return X}}function ko($){try{return Lo($),!1}catch{return!0}}function Lo($){return""+$}function jo($){if(ko($))return I("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ai($)),Lo($)}var Vr=S.ReactCurrentOwner,Va={key:!0,ref:!0,__self:!0,__source:!0},Dc,j,L;L={};function W($){if(qr.call($,"ref")){var q=Object.getOwnPropertyDescriptor($,"ref").get;if(q&&q.isReactWarning)return!1}return $.ref!==void 0}function Le($){if(qr.call($,"key")){var q=Object.getOwnPropertyDescriptor($,"key").get;if(q&&q.isReactWarning)return!1}return $.key!==void 0}function U($,q){if(typeof $.ref=="string"&&Vr.current&&q&&Vr.current.stateNode!==q){var X=N(Vr.current.type);L[X]||(I('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',N(Vr.current.type),$.ref),L[X]=!0)}}function te($,q){{var X=function(){Dc||(Dc=!0,I("%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))};X.isReactWarning=!0,Object.defineProperty($,"key",{get:X,configurable:!0})}}function he($,q){{var X=function(){j||(j=!0,I("%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))};X.isReactWarning=!0,Object.defineProperty($,"ref",{get:X,configurable:!0})}}var pe=function($,q,X,be,Ye,it,De){var Be={$$typeof:t,type:$,key:q,ref:X,props:De,_owner:it};return Be._store={},Object.defineProperty(Be._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Be,"_self",{configurable:!1,enumerable:!1,writable:!1,value:be}),Object.defineProperty(Be,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Ye}),Object.freeze&&(Object.freeze(Be.props),Object.freeze(Be)),Be};function Ie($,q,X,be,Ye){{var it,De={},Be=null,Pn=null;X!==void 0&&(jo(X),Be=""+X),Le(q)&&(jo(q.key),Be=""+q.key),W(q)&&(Pn=q.ref,U(q,Ye));for(it in q)qr.call(q,it)&&!Va.hasOwnProperty(it)&&(De[it]=q[it]);if($&&$.defaultProps){var Rt=$.defaultProps;for(it in Rt)De[it]===void 0&&(De[it]=Rt[it])}if(Be||Pn){var Kt=typeof $=="function"?$.displayName||$.name||"Unknown":$;Be&&te(De,Kt),Pn&&he(De,Kt)}return pe($,Be,Pn,Ye,be,Vr.current,De)}}var at=S.ReactCurrentOwner,Kn=S.ReactDebugCurrentFrame;function br($){if($){var q=$._owner,X=fi($.type,$._source,q?q.type:null);Kn.setExtraStackFrame(X)}else Kn.setExtraStackFrame(null)}var Nc;Nc=!1;function hi($){return typeof $=="object"&&$!==null&&$.$$typeof===t}function qc(){{if(at.current){var $=N(at.current.type);if($)return`
18
18
 
19
19
  Check the render method of \``+$+"`."}return""}}function Qc($){{if($!==void 0){var q=$.fileName.replace(/^.*[\\\/]/,""),X=$.lineNumber;return`
20
20
 
21
21
  Check your code at `+q+":"+X+"."}return""}}var Uo={};function ib($){{var q=qc();if(!q){var X=typeof $=="string"?$:$.displayName||$.name;X&&(q=`
22
22
 
23
- Check the top-level render call using <`+X+">.")}return q}}function Vc($,q){{if(!$._store||$._store.validated||$.key!=null)return;$._store.validated=!0;var X=ib(q);if(Uo[X])return;Uo[X]=!0;var be="";$&&$._owner&&$._owner!==at.current&&(be=" It was passed a child from "+N($._owner.type)+"."),br($),I('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',X,be),br(null)}}function Gu($,q){{if(typeof $!="object")return;if(pi($))for(var X=0;X<$.length;X++){var be=$[X];hi(be)&&Vc(be,q)}else if(hi($))$._store&&($._store.validated=!0);else if($){var Ye=_($);if(typeof Ye=="function"&&Ye!==$.entries)for(var it=Ye.call($),De;!(De=it.next()).done;)hi(De.value)&&Vc(De.value,q)}}}function uV($){{var q=$.type;if(q==null||typeof q=="string")return;var X;if(typeof q=="function")X=q.propTypes;else if(typeof q=="object"&&(q.$$typeof===s||q.$$typeof===f))X=q.propTypes;else return;if(X){var be=N(q);tr(X,$.props,"prop",be,$)}else if(q.PropTypes!==void 0&&!Nc){Nc=!0;var Ye=N(q);I("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Ye||"Unknown")}typeof q.getDefaultProps=="function"&&!q.getDefaultProps.isReactClassApproved&&I("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function sV($){{for(var q=Object.keys($.props),X=0;X<q.length;X++){var be=q[X];if(be!=="children"&&be!=="key"){br($),I("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",be),br(null);break}}$.ref!==null&&(br($),I("Invalid attribute `ref` supplied to `React.Fragment`."),br(null))}}function CO($,q,X,be,Ye,it){{var De=O($);if(!De){var Be="";($===void 0||typeof $=="object"&&$!==null&&Object.keys($).length===0)&&(Be+=" 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=Qc(Ye);Pn?Be+=Pn:Be+=qc();var Rt;$===null?Rt="null":pi($)?Rt="array":$!==void 0&&$.$$typeof===t?(Rt="<"+(N($.type)||"Unknown")+" />",Be=" Did you accidentally export a JSX literal instead of a component?"):Rt=typeof $,I("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Rt,Be)}var Kt=Te($,q,X,Ye,it);if(Kt==null)return Kt;if(De){var zr=q.children;if(zr!==void 0)if(be)if(pi(zr)){for(var zc=0;zc<zr.length;zc++)Gu(zr[zc],$);Object.freeze&&Object.freeze(zr)}else I("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 Gu(zr,$)}return $===r?sV(Kt):uV(Kt),Kt}}function cV($,q,X){return CO($,q,X,!0)}function lV($,q,X){return CO($,q,X,!1)}var fV=lV,dV=cV;hd.Fragment=r,hd.jsx=fV,hd.jsxs=dV}()),hd}var md={};/**
23
+ Check the top-level render call using <`+X+">.")}return q}}function Vc($,q){{if(!$._store||$._store.validated||$.key!=null)return;$._store.validated=!0;var X=ib(q);if(Uo[X])return;Uo[X]=!0;var be="";$&&$._owner&&$._owner!==at.current&&(be=" It was passed a child from "+N($._owner.type)+"."),br($),I('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',X,be),br(null)}}function Gu($,q){{if(typeof $!="object")return;if(pi($))for(var X=0;X<$.length;X++){var be=$[X];hi(be)&&Vc(be,q)}else if(hi($))$._store&&($._store.validated=!0);else if($){var Ye=_($);if(typeof Ye=="function"&&Ye!==$.entries)for(var it=Ye.call($),De;!(De=it.next()).done;)hi(De.value)&&Vc(De.value,q)}}}function uV($){{var q=$.type;if(q==null||typeof q=="string")return;var X;if(typeof q=="function")X=q.propTypes;else if(typeof q=="object"&&(q.$$typeof===s||q.$$typeof===f))X=q.propTypes;else return;if(X){var be=N(q);tr(X,$.props,"prop",be,$)}else if(q.PropTypes!==void 0&&!Nc){Nc=!0;var Ye=N(q);I("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Ye||"Unknown")}typeof q.getDefaultProps=="function"&&!q.getDefaultProps.isReactClassApproved&&I("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function sV($){{for(var q=Object.keys($.props),X=0;X<q.length;X++){var be=q[X];if(be!=="children"&&be!=="key"){br($),I("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",be),br(null);break}}$.ref!==null&&(br($),I("Invalid attribute `ref` supplied to `React.Fragment`."),br(null))}}function CO($,q,X,be,Ye,it){{var De=O($);if(!De){var Be="";($===void 0||typeof $=="object"&&$!==null&&Object.keys($).length===0)&&(Be+=" 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=Qc(Ye);Pn?Be+=Pn:Be+=qc();var Rt;$===null?Rt="null":pi($)?Rt="array":$!==void 0&&$.$$typeof===t?(Rt="<"+(N($.type)||"Unknown")+" />",Be=" Did you accidentally export a JSX literal instead of a component?"):Rt=typeof $,I("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Rt,Be)}var Kt=Ie($,q,X,Ye,it);if(Kt==null)return Kt;if(De){var zr=q.children;if(zr!==void 0)if(be)if(pi(zr)){for(var zc=0;zc<zr.length;zc++)Gu(zr[zc],$);Object.freeze&&Object.freeze(zr)}else I("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 Gu(zr,$)}return $===r?sV(Kt):uV(Kt),Kt}}function cV($,q,X){return CO($,q,X,!0)}function lV($,q,X){return CO($,q,X,!1)}var fV=lV,dV=cV;hd.Fragment=r,hd.jsx=fV,hd.jsxs=dV}()),hd}var md={};/**
24
24
  * @license React
25
25
  * react-jsx-runtime.production.min.js
26
26
  *
@@ -28,41 +28,41 @@ Check the top-level render call using <`+X+">.")}return q}}function Vc($,q){{if(
28
28
  *
29
29
  * This source code is licensed under the MIT license found in the
30
30
  * LICENSE file in the root directory of this source tree.
31
- */var $F;function vTe(){if($F)return md;$F=1;var e=R,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={},p=null,A=null;c!==void 0&&(p=""+c),s.key!==void 0&&(p=""+s.key),s.ref!==void 0&&(A=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:p,ref:A,props:f,_owner:i.current}}return md.Fragment=n,md.jsx=a,md.jsxs=a,md}process.env.NODE_ENV==="production"?Q1.exports=vTe():Q1.exports=gTe();var d=Q1.exports;const yTe="media-library-",EF=`${yTe}newMediaLibraryFeaturesBannerClosed`;function aq(e){const{maxWidth:t}=e,[n,r]=R.useState(()=>!(Fh.localStorage.isAvailable()&&Fh.localStorage.read(EF)));function i(){r(!1),Fh.localStorage.isAvailable()&&Fh.localStorage.write(EF,String(Date.now()))}return n?d.jsx(m.Box,{justifyContent:"center",padding:{inline:16,block:12},backgroundColor:"purple9",children:d.jsxs(m.Box,{maxWidth:t,width:"100%",alignItems:"center",gap:8,children:[d.jsx(m.Box,{borderRadius:"100%",alignItems:"center",justifyContent:"center",width:28,height:28,border:!0,borderColor:"purple8",flexShrink:0,children:d.jsx(m.Icon,{name:"autoFixHigh",color:"white",size:"small"})}),d.jsxs("div",{children:[d.jsx(m.Text,{color:"white",variant:"bold",children:"New features on the Media Library now available!"}),d.jsxs(m.Box,{gap:4,flexWrap:"wrap",children:[d.jsx(m.Text,{color:"white",children:"Media Tagging, Filtering, Improved Search & Bulk Deletion"}),d.jsx(m.Text,{color:"white",variant:"bold",href:"https://prismic.io/lp/new-media-library",target:"_blank",rel:"noopener noreferrer",underline:!0,children:"Find out More →"})]})]}),d.jsx(m.Button,{invisible:!0,color:"white",sx:{marginLeft:"auto",marginBottom:"auto",flexShrink:0},underline:!0,onClick:i,children:"Close"})]})}):null}const uq=R.createContext(void 0),bTe={selectedIds:new Set,excludedIds:new Set,isAllSelected:!1};function sq(e){const{children:t,initialTotalItemCount:n,isSelectAllEnabled:r=!1}=e,[i,o]=R.useState(bTe),a=R.useRef(),u=R.useRef(n||0),s=R.useMemo(()=>{const{selectedIds:C,excludedIds:y,isAllSelected:x}=i;return x?u.current-y.size:C.size},[i]),c=R.useCallback(C=>{const{isAllSelected:y,selectedIds:x,excludedIds:w}=i;return y?!w.has(C):x.has(C)},[i]),l=Xe.useStableCallback(()=>{const{isAllSelected:C,selectedIds:y,excludedIds:x}=i;return{selectedIds:[...y],excludedIds:[...x],isAllSelected:C,selectedCount:s}}),f=Xe.useStableCallback(()=>{r&&o({isAllSelected:!0,selectedIds:new Set,excludedIds:new Set})}),p=Xe.useStableCallback(()=>{o({isAllSelected:!1,selectedIds:new Set,excludedIds:new Set})});R.useEffect(()=>{const{isAllSelected:C,selectedIds:y,excludedIds:x}=i,w=u.current;if(!(w===0||!r)){if(C&&x.size===w){p();return}if(!C&&y.size===w){f();return}}},[i,r,f,p]);const A=Xe.useStableCallback(C=>{const{id:y,isSingleSelection:x,metaKey:w,shiftKey:M,ids:O}=C;return M&&O&&O.length>0&&a.current?v(y,O,a.current):x&&!w?h(y):c(y)?I([y]):S([y]),a.current=y,c(y)});function h(C){c(C)&&s===1?o(y=>({...y,selectedIds:new Set})):o({isAllSelected:!1,selectedIds:new Set([C]),excludedIds:new Set})}function v(C,y,x){const w=CTe(y,x,C),M=c(C);return M?I(w):S(w),M}const _=Xe.useStableCallback(()=>{s>0?p():f()});function S(C){const{isAllSelected:y}=i;if(y){o(x=>({...x,excludedIds:RF(x.excludedIds,C)}));return}o(x=>({...x,selectedIds:OF(x.selectedIds,C)}))}function I(C){const{isAllSelected:y}=i;if(y){o(x=>({...x,excludedIds:OF(x.excludedIds,C)}));return}o(x=>({...x,selectedIds:RF(x.selectedIds,C)}))}function T(C){u.current=C}const g=R.useMemo(()=>({selectedCount:s,state:i,totalItemCount:u.current,isSelected:c,isSelectAllEnabled:r,getSelectionState:l,toggleSelection:A,toggleSelectAll:_,clearSelection:p,setTotalItemCount:T}),[i,p,l,r,c,s,_,A]);return d.jsx(uq.Provider,{value:g,children:t})}function qu(e){const t=R.useContext(uq);if(t===void 0)throw new Error("useSelectionManagerContext must be used within a SelectionManagerProvider");const{totalItemCount:n,onChangeSelection:r}=e||{},{setTotalItemCount:i,totalItemCount:o,state:a,getSelectionState:u,...s}=t;n!==void 0&&n!==o&&i(n);const c=Xe.useStableCallback(r);return R.useEffect(()=>{c==null||c(u())},[u,c,a]),{...s,getSelectionState:u,isAllSelected:a.isAllSelected}}function CTe(e,t,n){const r=e.indexOf(t),i=e.indexOf(n);if(r===-1||i===-1)throw new Error("Both startValue and endValue must be in the array");return r<=i?e.slice(r,i+1):e.slice(i,r+1)}function RF(e,t){const n=new Set(e);return t.forEach(r=>n.delete(r)),n}function OF(e,t){return new Set([...e,...t])}function cq(){return d.jsx(m.Box,{justifyContent:"center",flexDirection:"column",height:"100%",backgroundColor:"grey3",children:d.jsxs(m.BlankSlate,{children:[d.jsx(m.BlankSlateIcon,{name:"close",lineColor:"purple10",backgroundColor:"purple3",borderColor:"purple6",borderStyle:"dashed",size:"xlarge"}),d.jsx(m.BlankSlateTitle,{size:"big",children:'"Oops!"'}),d.jsx(m.BlankSlateDescription,{width:360,children:`"We can't find any items with that name"`})]})})}const Rl={warning:{uploadWhileUploading:{title:"Hang tight!",description:"Your current images are still being uploaded. Once they're all set, you'll be free to upload more."}}},j0=R.createContext(void 0);function xe(){const e=R.useContext(j0);if(!e)throw new Error("Missing EditorConfigContext.Provider");return e}class V1 extends Error{}function Bn(e){throw new V1(`Missing EditorConfig.${e}`)}function STe(){if(new URL(location.href).searchParams.has("debug"))return;const n=console.error.bind(console);console.error=(...r)=>{r[0]instanceof V1||_Te(r)||n(...r)},window.addEventListener("error",r=>{r.error instanceof V1&&r.preventDefault(),ITe(r.error)&&r.preventDefault()})}function _Te(e){const t="Warning: flushSync was called from inside a lifecycle method",n=typeof e[0]=="string"&&e[0].includes(t),r=typeof e[1]=="string"&&e[1].includes("RichTextField");return n&&r}function ITe(e){const t=/Invalid content for node document: <(bulletList|orderedList)\(listItem*/,n=e.message;return!!(typeof n=="string"&&n.match(t))}const TTe="https://prismic.io/docs/guides/manage-images#supported-media";var Ve;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const o={};for(const a of i)o[a]=a;return o},e.getValidEnumValues=i=>{const o=e.objectKeys(i).filter(u=>typeof i[i[u]]!="number"),a={};for(const u of o)a[u]=i[u];return e.objectValues(a)},e.objectValues=i=>e.objectKeys(i).map(function(o){return i[o]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const o=[];for(const a in i)Object.prototype.hasOwnProperty.call(i,a)&&o.push(a);return o},e.find=(i,o)=>{for(const a of i)if(o(a))return a},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}e.joinValues=r,e.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(Ve||(Ve={}));var z1;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(z1||(z1={}));const ee=Ve.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Za=e=>{switch(typeof e){case"undefined":return ee.undefined;case"string":return ee.string;case"number":return isNaN(e)?ee.nan:ee.number;case"boolean":return ee.boolean;case"function":return ee.function;case"bigint":return ee.bigint;case"symbol":return ee.symbol;case"object":return Array.isArray(e)?ee.array:e===null?ee.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ee.promise:typeof Map<"u"&&e instanceof Map?ee.map:typeof Set<"u"&&e instanceof Set?ee.set:typeof Date<"u"&&e instanceof Date?ee.date:ee.object;default:return ee.unknown}},H=Ve.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),xTe=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class _i extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(o){return o.message},r={_errors:[]},i=o=>{for(const a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let u=r,s=0;for(;s<a.path.length;){const c=a.path[s];s===a.path.length-1?(u[c]=u[c]||{_errors:[]},u[c]._errors.push(n(a))):u[c]=u[c]||{_errors:[]},u=u[c],s++}}};return i(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ve.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}_i.create=e=>new _i(e);const Xd=(e,t)=>{let n;switch(e.code){case H.invalid_type:e.received===ee.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case H.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Ve.jsonStringifyReplacer)}`;break;case H.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ve.joinValues(e.keys,", ")}`;break;case H.invalid_union:n="Invalid input";break;case H.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ve.joinValues(e.options)}`;break;case H.invalid_enum_value:n=`Invalid enum value. Expected ${Ve.joinValues(e.options)}, received '${e.received}'`;break;case H.invalid_arguments:n="Invalid function arguments";break;case H.invalid_return_type:n="Invalid function return type";break;case H.invalid_date:n="Invalid date";break;case H.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Ve.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case H.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case H.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case H.custom:n="Invalid input";break;case H.invalid_intersection_types:n="Intersection results could not be merged";break;case H.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case H.not_finite:n="Number must be finite";break;default:n=t.defaultError,Ve.assertNever(e)}return{message:n}};let lq=Xd;function wTe(e){lq=e}function wm(){return lq}const $m=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}},$Te=[];function ne(e,t){const n=$m({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,wm(),Xd].filter(r=>!!r)});e.common.issues.push(n)}class Mn{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 Ie;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 Mn.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 Ie;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 Ie=Object.freeze({status:"aborted"}),fq=e=>({status:"dirty",value:e}),Vn=e=>({status:"valid",value:e}),H1=e=>e.status==="aborted",Y1=e=>e.status==="dirty",Em=e=>e.status==="valid",Rm=e=>typeof Promise<"u"&&e instanceof Promise;var de;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(de||(de={}));class so{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const FF=(e,t)=>{if(Em(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new _i(e.common.issues);return this._error=n,this._error}}};function $e(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(a,u)=>a.code!=="invalid_type"?{message:u.defaultError}:typeof u.data>"u"?{message:r??u.defaultError}:{message:n??u.defaultError},description:i}}class Fe{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return Za(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Za(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Mn,ctx:{common:t.parent.common,data:t.data,parsedType:Za(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(Rm(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:Za(t)},o=this._parseSync({data:t,path:i.path,parent:i});return FF(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:Za(t)},i=this._parse({data:t,path:r.path,parent:r}),o=await(Rm(i)?i:Promise.resolve(i));return FF(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:H.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 Ri({schema:this,typeName:ve.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Jo.create(this,this._def)}nullable(){return Fs.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ii.create(this,this._def)}promise(){return Fl.create(this,this._def)}or(t){return rp.create([this,t],this._def)}and(t){return ip.create(this,t,this._def)}transform(t){return new Ri({...$e(this._def),schema:this,typeName:ve.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new cp({...$e(this._def),innerType:this,defaultValue:n,typeName:ve.ZodDefault})}brand(){return new pq({typeName:ve.ZodBranded,type:this,...$e(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new km({...$e(this._def),innerType:this,catchValue:n,typeName:ve.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return vh.create(this,t)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const ETe=/^c[^\s-]{8,}$/i,RTe=/^[a-z][a-z0-9]*$/,OTe=/[0-9A-HJKMNP-TV-Z]{26}/,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,MTe=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\])|(\[IPv6:(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))\])|([A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])*(\.[A-Za-z]{2,})+))$/,kTe=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u"),LTe=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,jTe=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,UTe=e=>e.precision?e.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):e.precision===0?e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function BTe(e,t){return!!((t==="v4"||!t)&&LTe.test(e)||(t==="v6"||!t)&&jTe.test(e))}class Ci extends Fe{constructor(){super(...arguments),this._regex=(t,n,r)=>this.refinement(i=>t.test(i),{validation:n,code:H.invalid_string,...de.errToObj(r)}),this.nonempty=t=>this.min(1,de.errToObj(t)),this.trim=()=>new Ci({...this._def,checks:[...this._def.checks,{kind:"trim"}]}),this.toLowerCase=()=>new Ci({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]}),this.toUpperCase=()=>new Ci({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ee.string){const o=this._getOrReturnCtx(t);return ne(o,{code:H.invalid_type,expected:ee.string,received:o.parsedType}),Ie}const r=new Mn;let i;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(i=this._getOrReturnCtx(t,i),ne(i,{code:H.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")t.data.length>o.value&&(i=this._getOrReturnCtx(t,i),ne(i,{code:H.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const a=t.data.length>o.value,u=t.data.length<o.value;(a||u)&&(i=this._getOrReturnCtx(t,i),a?ne(i,{code:H.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):u&&ne(i,{code:H.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")MTe.test(t.data)||(i=this._getOrReturnCtx(t,i),ne(i,{validation:"email",code:H.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")kTe.test(t.data)||(i=this._getOrReturnCtx(t,i),ne(i,{validation:"emoji",code:H.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")FTe.test(t.data)||(i=this._getOrReturnCtx(t,i),ne(i,{validation:"uuid",code:H.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")ETe.test(t.data)||(i=this._getOrReturnCtx(t,i),ne(i,{validation:"cuid",code:H.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")RTe.test(t.data)||(i=this._getOrReturnCtx(t,i),ne(i,{validation:"cuid2",code:H.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")OTe.test(t.data)||(i=this._getOrReturnCtx(t,i),ne(i,{validation:"ulid",code:H.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),ne(i,{validation:"url",code:H.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),ne(i,{validation:"regex",code:H.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(t,i),ne(i,{code:H.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(i=this._getOrReturnCtx(t,i),ne(i,{code:H.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(i=this._getOrReturnCtx(t,i),ne(i,{code:H.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?UTe(o).test(t.data)||(i=this._getOrReturnCtx(t,i),ne(i,{code:H.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="ip"?BTe(t.data,o.version)||(i=this._getOrReturnCtx(t,i),ne(i,{validation:"ip",code:H.invalid_string,message:o.message}),r.dirty()):Ve.assertNever(o);return{status:r.value,value:t.data}}_addCheck(t){return new Ci({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...de.errToObj(t)})}url(t){return this._addCheck({kind:"url",...de.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...de.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...de.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...de.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...de.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...de.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...de.errToObj(t)})}datetime(t){var n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,...de.errToObj(t==null?void 0:t.message)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...de.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...de.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...de.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...de.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...de.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...de.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...de.errToObj(n)})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Ci.create=e=>{var t;return new Ci({checks:[],typeName:ve.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...$e(e)})};function WTe(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 lu extends Fe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==ee.number){const o=this._getOrReturnCtx(t);return ne(o,{code:H.invalid_type,expected:ee.number,received:o.parsedType}),Ie}let r;const i=new Mn;for(const o of this._def.checks)o.kind==="int"?Ve.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),ne(r,{code:H.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),ne(r,{code:H.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),ne(r,{code:H.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?WTe(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),ne(r,{code:H.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),ne(r,{code:H.not_finite,message:o.message}),i.dirty()):Ve.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,de.toString(n))}gt(t,n){return this.setLimit("min",t,!1,de.toString(n))}lte(t,n){return this.setLimit("max",t,!0,de.toString(n))}lt(t,n){return this.setLimit("max",t,!1,de.toString(n))}setLimit(t,n,r,i){return new lu({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:de.toString(i)}]})}_addCheck(t){return new lu({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:de.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:de.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:de.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:de.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:de.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:de.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:de.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:de.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:de.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Ve.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}lu.create=e=>new lu({checks:[],typeName:ve.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...$e(e)});class fu extends Fe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==ee.bigint){const o=this._getOrReturnCtx(t);return ne(o,{code:H.invalid_type,expected:ee.bigint,received:o.parsedType}),Ie}let r;const i=new Mn;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),ne(r,{code:H.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),ne(r,{code:H.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),ne(r,{code:H.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):Ve.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,de.toString(n))}gt(t,n){return this.setLimit("min",t,!1,de.toString(n))}lte(t,n){return this.setLimit("max",t,!0,de.toString(n))}lt(t,n){return this.setLimit("max",t,!1,de.toString(n))}setLimit(t,n,r,i){return new fu({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:de.toString(i)}]})}_addCheck(t){return new fu({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:de.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:de.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:de.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:de.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:de.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}}fu.create=e=>{var t;return new fu({checks:[],typeName:ve.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...$e(e)})};class ep extends Fe{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ee.boolean){const r=this._getOrReturnCtx(t);return ne(r,{code:H.invalid_type,expected:ee.boolean,received:r.parsedType}),Ie}return Vn(t.data)}}ep.create=e=>new ep({typeName:ve.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...$e(e)});class Rs extends Fe{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ee.date){const o=this._getOrReturnCtx(t);return ne(o,{code:H.invalid_type,expected:ee.date,received:o.parsedType}),Ie}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return ne(o,{code:H.invalid_date}),Ie}const r=new Mn;let i;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(i=this._getOrReturnCtx(t,i),ne(i,{code:H.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(i=this._getOrReturnCtx(t,i),ne(i,{code:H.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):Ve.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Rs({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:de.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:de.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}}Rs.create=e=>new Rs({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:ve.ZodDate,...$e(e)});class Om extends Fe{_parse(t){if(this._getType(t)!==ee.symbol){const r=this._getOrReturnCtx(t);return ne(r,{code:H.invalid_type,expected:ee.symbol,received:r.parsedType}),Ie}return Vn(t.data)}}Om.create=e=>new Om({typeName:ve.ZodSymbol,...$e(e)});class tp extends Fe{_parse(t){if(this._getType(t)!==ee.undefined){const r=this._getOrReturnCtx(t);return ne(r,{code:H.invalid_type,expected:ee.undefined,received:r.parsedType}),Ie}return Vn(t.data)}}tp.create=e=>new tp({typeName:ve.ZodUndefined,...$e(e)});class np extends Fe{_parse(t){if(this._getType(t)!==ee.null){const r=this._getOrReturnCtx(t);return ne(r,{code:H.invalid_type,expected:ee.null,received:r.parsedType}),Ie}return Vn(t.data)}}np.create=e=>new np({typeName:ve.ZodNull,...$e(e)});class Ol extends Fe{constructor(){super(...arguments),this._any=!0}_parse(t){return Vn(t.data)}}Ol.create=e=>new Ol({typeName:ve.ZodAny,...$e(e)});class ds extends Fe{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Vn(t.data)}}ds.create=e=>new ds({typeName:ve.ZodUnknown,...$e(e)});class na extends Fe{_parse(t){const n=this._getOrReturnCtx(t);return ne(n,{code:H.invalid_type,expected:ee.never,received:n.parsedType}),Ie}}na.create=e=>new na({typeName:ve.ZodNever,...$e(e)});class Fm extends Fe{_parse(t){if(this._getType(t)!==ee.undefined){const r=this._getOrReturnCtx(t);return ne(r,{code:H.invalid_type,expected:ee.void,received:r.parsedType}),Ie}return Vn(t.data)}}Fm.create=e=>new Fm({typeName:ve.ZodVoid,...$e(e)});class Ii extends Fe{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==ee.array)return ne(n,{code:H.invalid_type,expected:ee.array,received:n.parsedType}),Ie;if(i.exactLength!==null){const a=n.data.length>i.exactLength.value,u=n.data.length<i.exactLength.value;(a||u)&&(ne(n,{code:a?H.too_big:H.too_small,minimum:u?i.exactLength.value:void 0,maximum:a?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(ne(n,{code:H.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(ne(n,{code:H.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,u)=>i.type._parseAsync(new so(n,a,n.path,u)))).then(a=>Mn.mergeArray(r,a));const o=[...n.data].map((a,u)=>i.type._parseSync(new so(n,a,n.path,u)));return Mn.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new Ii({...this._def,minLength:{value:t,message:de.toString(n)}})}max(t,n){return new Ii({...this._def,maxLength:{value:t,message:de.toString(n)}})}length(t,n){return new Ii({...this._def,exactLength:{value:t,message:de.toString(n)}})}nonempty(t){return this.min(1,t)}}Ii.create=(e,t)=>new Ii({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ve.ZodArray,...$e(t)});function Xc(e){if(e instanceof Ct){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Jo.create(Xc(r))}return new Ct({...e._def,shape:()=>t})}else return e instanceof Ii?new Ii({...e._def,type:Xc(e.element)}):e instanceof Jo?Jo.create(Xc(e.unwrap())):e instanceof Fs?Fs.create(Xc(e.unwrap())):e instanceof co?co.create(e.items.map(t=>Xc(t))):e}class Ct extends Fe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Ve.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==ee.object){const c=this._getOrReturnCtx(t);return ne(c,{code:H.invalid_type,expected:ee.object,received:c.parsedType}),Ie}const{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),u=[];if(!(this._def.catchall instanceof na&&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 so(i,f,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof na){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&&(ne(i,{code:H.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 so(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=>Mn.mergeObjectSync(r,c)):Mn.mergeObjectSync(r,s)}get shape(){return this._def.shape()}strict(t){return de.errToObj,new Ct({...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=de.errToObj(t).message)!==null&&u!==void 0?u:s}:{message:s}}}:{}})}strip(){return new Ct({...this._def,unknownKeys:"strip"})}passthrough(){return new Ct({...this._def,unknownKeys:"passthrough"})}extend(t){return new Ct({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Ct({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:ve.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Ct({...this._def,catchall:t})}pick(t){const n={};return Ve.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new Ct({...this._def,shape:()=>n})}omit(t){const n={};return Ve.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new Ct({...this._def,shape:()=>n})}deepPartial(){return Xc(this)}partial(t){const n={};return Ve.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new Ct({...this._def,shape:()=>n})}required(t){const n={};return Ve.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof Jo;)o=o._def.innerType;n[r]=o}}),new Ct({...this._def,shape:()=>n})}keyof(){return dq(Ve.objectKeys(this.shape))}}Ct.create=(e,t)=>new Ct({shape:()=>e,unknownKeys:"strip",catchall:na.create(),typeName:ve.ZodObject,...$e(t)});Ct.strictCreate=(e,t)=>new Ct({shape:()=>e,unknownKeys:"strict",catchall:na.create(),typeName:ve.ZodObject,...$e(t)});Ct.lazycreate=(e,t)=>new Ct({shape:e,unknownKeys:"strip",catchall:na.create(),typeName:ve.ZodObject,...$e(t)});class rp extends Fe{_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 _i(u.ctx.common.issues));return ne(n,{code:H.invalid_union,unionErrors:a}),Ie}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 _i(s));return ne(n,{code:H.invalid_union,unionErrors:u}),Ie}}get options(){return this._def.options}}rp.create=(e,t)=>new rp({options:e,typeName:ve.ZodUnion,...$e(t)});const Zh=e=>e instanceof ap?Zh(e.schema):e instanceof Ri?Zh(e.innerType()):e instanceof up?[e.value]:e instanceof du?e.options:e instanceof sp?Object.keys(e.enum):e instanceof cp?Zh(e._def.innerType):e instanceof tp?[void 0]:e instanceof np?[null]:null;class U0 extends Fe{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ee.object)return ne(n,{code:H.invalid_type,expected:ee.object,received:n.parsedType}),Ie;const r=this.discriminator,i=n.data[r],o=this.optionsMap.get(i);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(ne(n,{code:H.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Ie)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const i=new Map;for(const o of n){const a=Zh(o.shape[t]);if(!a)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const u of a){if(i.has(u))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(u)}`);i.set(u,o)}}return new U0({typeName:ve.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...$e(r)})}}function G1(e,t){const n=Za(e),r=Za(t);if(e===t)return{valid:!0,data:e};if(n===ee.object&&r===ee.object){const i=Ve.objectKeys(t),o=Ve.objectKeys(e).filter(u=>i.indexOf(u)!==-1),a={...e,...t};for(const u of o){const s=G1(e[u],t[u]);if(!s.valid)return{valid:!1};a[u]=s.data}return{valid:!0,data:a}}else if(n===ee.array&&r===ee.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=G1(a,u);if(!s.valid)return{valid:!1};i.push(s.data)}return{valid:!0,data:i}}else return n===ee.date&&r===ee.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class ip extends Fe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=(o,a)=>{if(H1(o)||H1(a))return Ie;const u=G1(o.value,a.value);return u.valid?((Y1(o)||Y1(a))&&n.dirty(),{status:n.value,value:u.data}):(ne(r,{code:H.invalid_intersection_types}),Ie)};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}))}}ip.create=(e,t,n)=>new ip({left:e,right:t,typeName:ve.ZodIntersection,...$e(n)});class co extends Fe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ee.array)return ne(r,{code:H.invalid_type,expected:ee.array,received:r.parsedType}),Ie;if(r.data.length<this._def.items.length)return ne(r,{code:H.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ie;!this._def.rest&&r.data.length>this._def.items.length&&(ne(r,{code:H.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((a,u)=>{const s=this._def.items[u]||this._def.rest;return s?s._parse(new so(r,a,r.path,u)):null}).filter(a=>!!a);return r.common.async?Promise.all(o).then(a=>Mn.mergeArray(n,a)):Mn.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new co({...this._def,rest:t})}}co.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new co({items:e,typeName:ve.ZodTuple,rest:null,...$e(t)})};class op extends Fe{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!==ee.object)return ne(r,{code:H.invalid_type,expected:ee.object,received:r.parsedType}),Ie;const i=[],o=this._def.keyType,a=this._def.valueType;for(const u in r.data)i.push({key:o._parse(new so(r,u,r.path,u)),value:a._parse(new so(r,r.data[u],r.path,u))});return r.common.async?Mn.mergeObjectAsync(n,i):Mn.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Fe?new op({keyType:t,valueType:n,typeName:ve.ZodRecord,...$e(r)}):new op({keyType:Ci.create(),valueType:t,typeName:ve.ZodRecord,...$e(n)})}}class Mm extends Fe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ee.map)return ne(r,{code:H.invalid_type,expected:ee.map,received:r.parsedType}),Ie;const i=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([u,s],c)=>({key:i._parse(new so(r,u,r.path,[c,"key"])),value:o._parse(new so(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 Ie;(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 Ie;(c.status==="dirty"||l.status==="dirty")&&n.dirty(),u.set(c.value,l.value)}return{status:n.value,value:u}}}}Mm.create=(e,t,n)=>new Mm({valueType:t,keyType:e,typeName:ve.ZodMap,...$e(n)});class Os extends Fe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ee.set)return ne(r,{code:H.invalid_type,expected:ee.set,received:r.parsedType}),Ie;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(ne(r,{code:H.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(ne(r,{code:H.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const o=this._def.valueType;function a(s){const c=new Set;for(const l of s){if(l.status==="aborted")return Ie;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 so(r,s,r.path,c)));return r.common.async?Promise.all(u).then(s=>a(s)):a(u)}min(t,n){return new Os({...this._def,minSize:{value:t,message:de.toString(n)}})}max(t,n){return new Os({...this._def,maxSize:{value:t,message:de.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}Os.create=(e,t)=>new Os({valueType:e,minSize:null,maxSize:null,typeName:ve.ZodSet,...$e(t)});class ll extends Fe{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ee.function)return ne(n,{code:H.invalid_type,expected:ee.function,received:n.parsedType}),Ie;function r(u,s){return $m({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,wm(),Xd].filter(c=>!!c),issueData:{code:H.invalid_arguments,argumentsError:s}})}function i(u,s){return $m({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,wm(),Xd].filter(c=>!!c),issueData:{code:H.invalid_return_type,returnTypeError:s}})}const o={errorMap:n.common.contextualErrorMap},a=n.data;return this._def.returns instanceof Fl?Vn(async(...u)=>{const s=new _i([]),c=await this._def.args.parseAsync(u,o).catch(p=>{throw s.addIssue(r(u,p)),s}),l=await a(...c);return await this._def.returns._def.type.parseAsync(l,o).catch(p=>{throw s.addIssue(i(l,p)),s})}):Vn((...u)=>{const s=this._def.args.safeParse(u,o);if(!s.success)throw new _i([r(u,s.error)]);const c=a(...s.data),l=this._def.returns.safeParse(c,o);if(!l.success)throw new _i([i(c,l.error)]);return l.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new ll({...this._def,args:co.create(t).rest(ds.create())})}returns(t){return new ll({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new ll({args:t||co.create([]).rest(ds.create()),returns:n||ds.create(),typeName:ve.ZodFunction,...$e(r)})}}class ap extends Fe{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})}}ap.create=(e,t)=>new ap({getter:e,typeName:ve.ZodLazy,...$e(t)});class up extends Fe{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return ne(n,{received:n.data,code:H.invalid_literal,expected:this._def.value}),Ie}return{status:"valid",value:t.data}}get value(){return this._def.value}}up.create=(e,t)=>new up({value:e,typeName:ve.ZodLiteral,...$e(t)});function dq(e,t){return new du({values:e,typeName:ve.ZodEnum,...$e(t)})}class du extends Fe{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return ne(n,{expected:Ve.joinValues(r),received:n.parsedType,code:H.invalid_type}),Ie}if(this._def.values.indexOf(t.data)===-1){const n=this._getOrReturnCtx(t),r=this._def.values;return ne(n,{received:n.data,code:H.invalid_enum_value,options:r}),Ie}return Vn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t){return du.create(t)}exclude(t){return du.create(this.options.filter(n=>!t.includes(n)))}}du.create=dq;class sp extends Fe{_parse(t){const n=Ve.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==ee.string&&r.parsedType!==ee.number){const i=Ve.objectValues(n);return ne(r,{expected:Ve.joinValues(i),received:r.parsedType,code:H.invalid_type}),Ie}if(n.indexOf(t.data)===-1){const i=Ve.objectValues(n);return ne(r,{received:r.data,code:H.invalid_enum_value,options:i}),Ie}return Vn(t.data)}get enum(){return this._def.values}}sp.create=(e,t)=>new sp({values:e,typeName:ve.ZodNativeEnum,...$e(t)});class Fl extends Fe{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ee.promise&&n.common.async===!1)return ne(n,{code:H.invalid_type,expected:ee.promise,received:n.parsedType}),Ie;const r=n.parsedType===ee.promise?n.data:Promise.resolve(n.data);return Vn(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Fl.create=(e,t)=>new Fl({type:e,typeName:ve.ZodPromise,...$e(t)});class Ri extends Fe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ve.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null;if(i.type==="preprocess"){const a=i.transform(r.data);return r.common.async?Promise.resolve(a).then(u=>this._def.schema._parseAsync({data:u,path:r.path,parent:r})):this._def.schema._parseSync({data:a,path:r.path,parent:r})}const o={addIssue:a=>{ne(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"?Ie:(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"?Ie:(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(!Em(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=>Em(a)?Promise.resolve(i.transform(a.value,o)).then(u=>({status:n.value,value:u})):a);Ve.assertNever(i)}}Ri.create=(e,t,n)=>new Ri({schema:e,typeName:ve.ZodEffects,effect:t,...$e(n)});Ri.createWithPreprocess=(e,t,n)=>new Ri({schema:t,effect:{type:"preprocess",transform:e},typeName:ve.ZodEffects,...$e(n)});class Jo extends Fe{_parse(t){return this._getType(t)===ee.undefined?Vn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Jo.create=(e,t)=>new Jo({innerType:e,typeName:ve.ZodOptional,...$e(t)});class Fs extends Fe{_parse(t){return this._getType(t)===ee.null?Vn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Fs.create=(e,t)=>new Fs({innerType:e,typeName:ve.ZodNullable,...$e(t)});class cp extends Fe{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===ee.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}cp.create=(e,t)=>new cp({innerType:e,typeName:ve.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...$e(t)});class km extends Fe{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Rm(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new _i(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new _i(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}km.create=(e,t)=>new km({innerType:e,typeName:ve.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...$e(t)});class Lm extends Fe{_parse(t){if(this._getType(t)!==ee.nan){const r=this._getOrReturnCtx(t);return ne(r,{code:H.invalid_type,expected:ee.nan,received:r.parsedType}),Ie}return{status:"valid",value:t.data}}}Lm.create=e=>new Lm({typeName:ve.ZodNaN,...$e(e)});const KTe=Symbol("zod_brand");class pq extends Fe{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class vh extends Fe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?Ie:o.status==="dirty"?(n.dirty(),fq(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?Ie:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new vh({in:t,out:n,typeName:ve.ZodPipeline})}}const Aq=(e,t={},n)=>e?Ol.create().superRefine((r,i)=>{var o,a;if(!e(r)){const u=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,s=(a=(o=u.fatal)!==null&&o!==void 0?o:n)!==null&&a!==void 0?a:!0,c=typeof u=="string"?{message:u}:u;i.addIssue({code:"custom",...c,fatal:s})}}):Ol.create(),PTe={object:Ct.lazycreate};var ve;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline"})(ve||(ve={}));const DTe=(e,t={message:`Input not instance of ${e.name}`})=>Aq(n=>n instanceof e,t),zo=Ci.create,jm=lu.create,NTe=Lm.create,qTe=fu.create,hq=ep.create,QTe=Rs.create,VTe=Om.create,zTe=tp.create,HTe=np.create,YTe=Ol.create,GTe=ds.create,JTe=na.create,ZTe=Fm.create,mq=Ii.create,lp=Ct.create,XTe=Ct.strictCreate,exe=rp.create,txe=U0.create,nxe=ip.create,rxe=co.create,ixe=op.create,oxe=Mm.create,axe=Os.create,uxe=ll.create,sxe=ap.create,cxe=up.create,lxe=du.create,fxe=sp.create,dxe=Fl.create,MF=Ri.create,pxe=Jo.create,Axe=Fs.create,hxe=Ri.createWithPreprocess,mxe=vh.create,gxe=()=>zo().optional(),vxe=()=>jm().optional(),yxe=()=>hq().optional(),bxe={string:e=>Ci.create({...e,coerce:!0}),number:e=>lu.create({...e,coerce:!0}),boolean:e=>ep.create({...e,coerce:!0}),bigint:e=>fu.create({...e,coerce:!0}),date:e=>Rs.create({...e,coerce:!0})},Cxe=Ie;var B=Object.freeze({__proto__:null,defaultErrorMap:Xd,setErrorMap:wTe,getErrorMap:wm,makeIssue:$m,EMPTY_PATH:$Te,addIssueToContext:ne,ParseStatus:Mn,INVALID:Ie,DIRTY:fq,OK:Vn,isAborted:H1,isDirty:Y1,isValid:Em,isAsync:Rm,get util(){return Ve},get objectUtil(){return z1},ZodParsedType:ee,getParsedType:Za,ZodType:Fe,ZodString:Ci,ZodNumber:lu,ZodBigInt:fu,ZodBoolean:ep,ZodDate:Rs,ZodSymbol:Om,ZodUndefined:tp,ZodNull:np,ZodAny:Ol,ZodUnknown:ds,ZodNever:na,ZodVoid:Fm,ZodArray:Ii,ZodObject:Ct,ZodUnion:rp,ZodDiscriminatedUnion:U0,ZodIntersection:ip,ZodTuple:co,ZodRecord:op,ZodMap:Mm,ZodSet:Os,ZodFunction:ll,ZodLazy:ap,ZodLiteral:up,ZodEnum:du,ZodNativeEnum:sp,ZodPromise:Fl,ZodEffects:Ri,ZodTransformer:Ri,ZodOptional:Jo,ZodNullable:Fs,ZodDefault:cp,ZodCatch:km,ZodNaN:Lm,BRAND:KTe,ZodBranded:pq,ZodPipeline:vh,custom:Aq,Schema:Fe,ZodSchema:Fe,late:PTe,get ZodFirstPartyTypeKind(){return ve},coerce:bxe,any:YTe,array:mq,bigint:qTe,boolean:hq,date:QTe,discriminatedUnion:txe,effect:MF,enum:lxe,function:uxe,instanceof:DTe,intersection:nxe,lazy:sxe,literal:cxe,map:oxe,nan:NTe,nativeEnum:fxe,never:JTe,null:HTe,nullable:Axe,number:jm,object:lp,oboolean:yxe,onumber:vxe,optional:pxe,ostring:gxe,pipeline:mxe,preprocess:hxe,promise:dxe,record:ixe,set:axe,strictObject:XTe,string:zo,symbol:VTe,transformer:MF,tuple:rxe,undefined:zTe,union:exe,unknown:GTe,void:ZTe,NEVER:Cxe,ZodIssueCode:H,quotelessJson:xTe,ZodError:_i});const Sxe=B.object({id:B.string(),label:B.string(),repeatable:B.boolean(),status:B.boolean()}),_xe=B.array(Sxe);function gq(e,t,n){return _e.request(new URL("customtypes",e),{headers:{repository:t},credentials:_e.getRequestCredentials(n),okType:_xe})}const Ixe=B.object({first_name:B.string().optional(),last_name:B.string().optional(),email:B.string().optional()}),IR=B.object({id:B.string(),name:B.string(),is_master:B.boolean().optional()}),Txe=B.discriminatedUnion("status",[B.object({status:B.literal("unclassified")}),B.object({status:B.literal("published")}),B.object({status:B.literal("release"),release_id:B.string()}),B.object({status:B.literal("archived")})]).and(B.object({version_id:B.string(),tags:B.array(B.string()),custom_type_label:B.string(),preview_summary:B.string().optional(),preview_image:B.string().optional(),last_modified_date:B.coerce.date(),author:Ixe,uid:B.string().optional()})),TR=B.object({id:B.string(),title:B.string().nullish().transform(e=>e??"Untitled"),custom_type_id:B.string(),group_lang_id:B.string(),language:IR,versions:B.array(Txe)}),vq=B.object({total:B.number(),cursor:B.string().optional(),results:B.array(TR)}),xxe=B.object({id:B.string(),title:B.string(),repository_id:B.string(),tags:B.array(B.string()).optional()}).passthrough(),wxe=B.object({results:B.array(xxe)});function B0(e,t,n,r,i){const o=new URL("documents",e);return r&&o.searchParams.set("limit",r.toString()),i&&o.searchParams.set("cursor",i),o.search+=`&${n}`,_e.request(o,{credentials:_e.getRequestCredentials(t),okType:vq})}function yq(e,t,n,r){const i=new URL(e);return i.search=n,_e.request(i,{credentials:_e.getRequestCredentials(t),okType:wxe,...r})}function bq(e){const{repository:t,searchTerm:n,tags:r,localeId:i,customTypesIds:o}=e,a=new URLSearchParams;return a.append("repository",t),n&&a.append("searchTerm",n),r!=null&&r.length&&a.append("tags",r.toString()),i&&a.append("localeId",i),o!=null&&o.length&&a.append("customTypesIds",o.toString()),a.toString()}function xR(e){return e.reduce((t,n)=>{if(n.values.every(i=>i===""))return t;const r=n.values.map(i=>[n.name,i]);return t.concat(r)},[])}function Cq(e,t,n){return _e.request(new URL(`documents/${n}`,e),{credentials:_e.getRequestCredentials(t),okType:TR})}function $xe(e,t,n,r){const i=new URL(`documents?status=release:${n}`,e);return r&&i.searchParams.set("limit",r.toString()),_e.request(i,{credentials:_e.getRequestCredentials(t),okType:vq})}function Sq(e,t,n){const r=W0({document_id:n});return B0(e,t,r,n.length)}const Exe=B.custom().transform((e,t)=>{const n=Ue.Document.decode(e);return n._tag==="Left"?(t.addIssue({code:B.ZodIssueCode.custom,message:"Invalid document."}),B.NEVER):n.right});function W0(e){const t=Pl.keys(e).flatMap(r=>{const i=e[r];return i?{name:r,values:i}:[]});return new URLSearchParams(xR(t)).toString()}const Rxe=B.object({id:B.string(),firstname:B.string().optional(),lastname:B.string().optional(),email:B.string()}),Oxe=B.array(Rxe),Fxe=B.object({slicemachineEnabled:B.boolean()}),Mxe=B.object({simulator_url:B.string().url().nullish(),languages:B.array(IR).transform(e=>gn.sort(e,t=>t.name)),authors:Oxe.optional().default([]),quotas:Fxe.optional().default({slicemachineEnabled:!1})}).transform(({simulator_url:e,...t})=>{const n=e&&Iq(e)?e:void 0;return{...t,simulatorUrl:n}});function _q(e,t){return _e.request(new URL("repository",e),{credentials:_e.getRequestCredentials(t),okType:Mxe})}function Iq(e){const t=$r.toURL(e);return t?t.pathname.endsWith("/slice-simulator"):!1}const kxe=B.object({results:B.array(B.string())});function Tq(e,t){return _e.request(new URL("repository/tags",e),{credentials:_e.getRequestCredentials(t),okType:kxe})}function yh(){const e=xe();e.mediaLibrary||Bn("mediaLibrary");const{assetsApiBaseUrl:t,authStrategy:n,repository:r}=e,{items:i}=nt.useRequest(xq,[t,r,n]);return{tags:i}}function xq(e,t,n){return _e.request(new URL("tags",e),{credentials:_e.getRequestCredentials(n),okType:Lxe,headers:{repository:t}})}const wq=3,$q=20,wR=B.string().min(wq).max($q),$R=B.object({id:B.string(),name:wR,uploader_id:B.string().optional(),created_at:B.number(),last_modified:B.number(),count:B.number().optional().default(0)}),Lxe=B.object({items:B.array($R)});function bh(e){nt.updateFetcherData(xq,t=>{const{items:n}=t,r=e(n);if(r)return{items:r}})}function jxe(e){const{assetType:t,keyword:n,mode:r,tagIds:i}=e,o=xe();o.mediaLibrary||Bn("mediaLibrary");const{useOpenSearch:a,onAnalyticsEvent:u}=o,s=nt.useFetcherData(Yi),c=s[s.length-1],l=R.useRef(c);l.current=c,R.useEffect(()=>{if(!u||!n||!l.current||l.current.keyword!==n)return;const f=a&&n?"1":"0",p=String(n.split(" ").length),A=String(l.current.total),h=i.join(",");u("Media Library Search",{searchQuery:n,numberOfWords:p,numberOfResults:A,timeToGetResults:l.current.time,useOpenSearch:f,assetType:t,mode:r,tags:h})},[n,a,t,r,u,i])}function Uxe(e){const{assetType:t,mediaDialogOpen:n}=e,r=xe(),i=nt.useFetcherData(Yi),o=R.useRef(0);R.useEffect(()=>{n&&(o.current=performance.now())},[n]);function a(u){if(!r.onAnalyticsEvent||!r.mediaLibrary)return;const s=i[i.length-1];if(!s)return;const{keyword:c,tags:l}=s,f=Oq(i,t,c,l),p=r.useOpenSearch&&c?"1":"0",A=String(c.split(" ").length),h=String(s.total),v=f.findIndex(T=>T.id===u),_=String(v+1),S=[u].join(","),I=(performance.now()-o.current).toFixed(0);r.onAnalyticsEvent("Media Added To Page",{useOpenSearch:p,assetType:t,searchQuery:c,numberOfWords:A,numberOfResults:h,searchPosition:_,mediaIds:S,timeToAddMediaToPage:I,tags:l})}return a}const Wh=B.array(B.string()).optional().transform(e=>e==null?void 0:e[0]),K0=B.object({id:B.string(),kind:B.string(),extension:B.string().optional(),filename:B.string(),width:B.number().optional(),height:B.number().optional(),last_modified:B.number(),url:B.string(),alt:B.string().optional(),size:B.number(),notes:B.string().optional(),credits:B.string().optional(),search_highlight:B.object({filename:Wh,alt:Wh,notes:Wh,credits:Wh}).optional(),tags:B.array($R)}),Eq={"X-Prismic-Source":"Wroom"},Bxe=B.object({total:B.number(),cursor:B.string().optional(),items:B.array(K0)}),Rq=30;function Yi(e,t,n,r,i,o,a,u,s){const c=e?new URL("assets",e):void 0,l=new URLSearchParams(xR([{name:"limit",values:[`${Rq}`]},{name:"cursor",values:[s??""]},{name:"keyword",values:[i]},{name:"tags",values:o.split(",")},{name:"assetType",values:[r]},{name:"opensearch",values:a?["true"]:[]}])).toString(),f=Bxe.transform(A=>({...A,assetType:r,keyword:i,page:u,tags:o})),p=performance.now();return _e.request(`${(c==null?void 0:c.href)??""}?${l}`,{headers:{repository:t,...Eq},credentials:_e.getRequestCredentials(n),okType:f}).then(A=>({...A,time:(performance.now()-p).toFixed(0)}))}nt.cache.registerFetcherConfig(Yi,{revalidationStrategy:{type:"never"}});function Wxe(e){const{assetType:t="all",mode:n}=e,r=xe(),[i,o]=R.useState({keyword:"",page:0,tagIds:[]});r.mediaLibrary||Bn("mediaLibrary");const{assetsApiBaseUrl:a,authStrategy:u,repository:s,useOpenSearch:c}=r,{keyword:l,page:f,cursor:p,tagIds:A}=i,h=nt.useRequest(Yi,ER({assetsApiBaseUrl:a,authStrategy:u,repository:s,assetType:t,keyword:l,tagIds:A,useOpenSearch:c&&!!l,page:f,cursor:p}));jxe({assetType:t,keyword:l,tagIds:A,mode:n});const v=Nxe(t,l,A),_=h.total!==v.length;function S(){h.cursor!==void 0&&o(C=>({...C,page:C.page+1,cursor:h.cursor}))}function I(C){o(y=>({...y,page:0,cursor:void 0})),Ms((y,x)=>{if(x.page===0)return[...C,...y]})}function T(C){o(y=>({...y,keyword:C,page:0,cursor:void 0}))}function g(C){o(y=>({...y,tagIds:C,page:0,cursor:void 0}))}return{keyword:l,setKeyword:T,tagIds:A,setTagIds:g,media:v,mediaTotal:h.total,limit:Rq,hasNextPage:_,fetchNextPage:S,updateMedia:Kxe,unshiftMedia:I,deleteMedia:Pxe,deleteSearchData:Dxe,revalidateFirstPage:Fq}}function Kxe(e){Ms(t=>t.flatMap(n=>{const r=e.find(i=>i.id===n.id);return r?r.response===void 0?[]:{...n,...r.response}:n}))}function Pxe(e){Ms(t=>t.filter(n=>!e.includes(n.id)))}function Dxe(e){const{keyword:t,tagIds:n}=e,r=n==null?void 0:n.join(",");nt.updateFetcherData(Yi,i=>{if(!(t&&i.keyword===t)&&!(r&&i.tags===r))return i})}function Oq(e,t,n,r){const i=e.filter(u=>u.assetType===t&&u.keyword===n&&u.tags===r),a=gn.sort(i,u=>u.page).flatMap(u=>u.items);return n?gn.uniqBy(a,u=>u.id):a}function Nxe(e,t,n){const r=nt.useFetcherData(Yi);return Oq(r,e,t,n.join(","))}function Ms(e){nt.updateFetcherData(Yi,t=>{const{items:n,total:r}=t,i=e(n,t);if(i)return{...t,total:r+(i.length-n.length),items:i}})}function Fq(e){const{config:t,assetType:n}=e;if(!t.mediaLibrary)throw new Error("media library is not configured");const{assetsApiBaseUrl:r,authStrategy:i,repository:o}=t;nt.revalidateData(Yi,ER({assetsApiBaseUrl:r,repository:o,authStrategy:i,assetType:n,keyword:"",tagIds:[],useOpenSearch:!1,page:0}))}function Mq(e){const{config:t,assetType:n}=e;if(!t.mediaLibrary)throw new Error("media library is not configured");nt.updateFetcherData(Yi,r=>r.page===0?r:void 0),Fq({config:t,assetType:n})}function ER(e){return[e.assetsApiBaseUrl,e.repository,e.authStrategy,e.assetType,e.keyword,e.tagIds.join(","),e.useOpenSearch,e.page,e.cursor]}function qxe(e){const{revalidate:t,config:n,assetType:r}=e,{assetsApiBaseUrl:i=void 0,repository:o="",authStrategy:a="token"}=n.mediaLibrary?n:{},[u,s]=R.useState(!1),[c,l]=R.useState(!1);nt.useCacheRevalidation({fetcher:Yi,requestParams:ER({assetsApiBaseUrl:i,repository:o,authStrategy:a,assetType:r,keyword:"",tagIds:[],useOpenSearch:!1,page:0}),validator:(p,A)=>{var _,S,I,T;const h=((_=p.items[0])==null?void 0:_.id)??"",v=((I=(S=A[0])==null?void 0:S.items[0])==null?void 0:I.id)??"";return h!==v||p.total!==((T=A[0])==null?void 0:T.total)},onCacheInvalidated:()=>l(!0),every:6e4}),R.useEffect(()=>{u&&(l(!1),s(!1))},[u]);function f(){s(!0),t()}return{isMediaRevalidationInProgress:u,isMediaCacheInvalid:c,revalidateMedia:f}}let Kh;const Qxe=new Uint8Array(16);function Vxe(){if(!Kh&&(Kh=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Kh))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Kh(Qxe)}const ln=[];for(let e=0;e<256;++e)ln.push((e+256).toString(16).slice(1));function zxe(e,t=0){return ln[e[t+0]]+ln[e[t+1]]+ln[e[t+2]]+ln[e[t+3]]+"-"+ln[e[t+4]]+ln[e[t+5]]+"-"+ln[e[t+6]]+ln[e[t+7]]+"-"+ln[e[t+8]]+ln[e[t+9]]+"-"+ln[e[t+10]]+ln[e[t+11]]+ln[e[t+12]]+ln[e[t+13]]+ln[e[t+14]]+ln[e[t+15]]}const Hxe=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),kF={randomUUID:Hxe};function Yxe(e,t,n){if(kF.randomUUID&&!t&&!e)return kF.randomUUID();e=e||{};const r=e.random||(e.rng||Vxe)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let i=0;i<16;++i)t[n+i]=r[i];return t}return zxe(r)}function Gxe(e){const{onBeforeUpload:t,onComplete:n}=e,[r,i]=R.useState([]),o=r.some(l=>l.status==="idle"||l.status==="uploading"),a=xe();function u(){if(!r.length||r.some(A=>A.status==="uploading")||r.every(A=>A.status==="error"))return;const l=r.find(A=>A.status==="idle");if(!l)return;let f=r;function p(A){f=A(f),i(f),f.every(v=>v.status==="success"||v.status==="error")&&setTimeout(()=>{i([]),n==null||n(f)},1500)}p(A=>A.map(h=>h.id===l.id?{...h,status:"uploading"}:h)),Jxe({file:l.file,config:a}).then(A=>{p(h=>h.map(v=>v.id===l.id?{...v,status:"success",response:A}:v))}).catch(()=>{p(A=>A.map(h=>h.id===l.id?{...h,status:"error"}:h))})}function s(l){const f=l.map(p=>({id:`temp-${Yxe()}`,file:p,status:"idle"}));i(f),t(f)}const c=R.useCallback(l=>{const f=[{...l,status:"idle"},...r.filter(p=>p.id!==l.id)];i(f),t(f)},[t,r]);return R.useEffect(u,[a,r,n]),{isUploading:o,uploadingFiles:r,onFilesSelected:s,onRetry:c}}function Jxe(e){const{file:t,config:n}=e;if(!n.mediaLibrary)throw new Error("Media Library not configured.");const{assetsApiBaseUrl:r,repository:i,authStrategy:o}=n,a=new FormData;return a.append(t.name,t),_e.request(new URL("assets",r),{headers:{repository:i,"Content-Type":"multipart/form-data",...Eq},method:"POST",body:a,credentials:_e.getRequestCredentials(o),okType:K0})}const kq=R.createContext(void 0);function Zxe(e){const{children:t,assetType:n="all",onSelectedChange:r,actionContainerRef:i}=e,o=r?"select":"browse",[a,u]=R.useTransition(),[s,c]=R.useTransition(),l=xe(),{showAlert:f}=m.useAlert(),{keyword:p,setKeyword:A,tagIds:h,setTagIds:v,media:_,fetchNextPage:S,hasNextPage:I,updateMedia:T,unshiftMedia:g,deleteMedia:C,mediaTotal:y,deleteSearchData:x,revalidateFirstPage:w}=Wxe({assetType:n,mode:o}),[M,O]=R.useState();function F(Oe){Oe&&x({keyword:Oe}),c(()=>{A(Oe),D.clearSelection()})}function K(){A(""),Mq({config:l,assetType:n})}function N(Oe){Oe.length&&x({tagIds:Oe}),c(()=>{v(Oe),D.clearSelection()})}const{isMediaRevalidationInProgress:J,isMediaCacheInvalid:Z,revalidateMedia:ae}=qxe({assetType:n,config:l,revalidate:K}),{isUploading:ge,onFilesSelected:se,uploadingFiles:k,onRetry:E}=Gxe({onBeforeUpload:Oe=>{A("");const mt=Oe.filter(Tt=>Tt.status==="idle").map(Tt=>({id:Tt.id,url:URL.createObjectURL(Tt.file),filename:Tt.file.name,size:Tt.file.size,extension:Tt.file.type,kind:Tt.file.type,last_modified:Tt.file.lastModified,tags:[]}));g(mt);const[lt]=mt??[];lt&&D.toggleSelection({id:lt.id,isSingleSelection:!0})},onComplete:Oe=>{const mt=Oe.flatMap(sn=>sn.status==="success"?sn:(rt(sn),{id:sn.id,response:void 0}));T(mt),w({config:l,assetType:n});const lt=mt[0];!lt||!lt.response||!D.isSelected(lt.id)||D.toggleSelection({id:lt.response.id,isSingleSelection:!0})}}),D=qu({totalItemCount:y,onChangeSelection:({selectedIds:Oe,selectedCount:mt})=>{if(Yt(!1),!!r){if(mt===1){const[lt]=[...Oe];if(k.some(sn=>sn.id===lt&&sn.status!=="success")){r(new Set);return}}r(new Set(Oe))}}});function ue(Oe){ge||se(Oe)}function ke(){I&&u(S)}function Se(Oe,mt){T([{id:Oe,response:mt}])}function rt(Oe){const mt=Ip.overflow(Oe.file.name,30);f({id:Oe.id,title:`The specified file "${mt}" could not be uploaded.`,subtitle:d.jsxs(m.Text,{color:"inherit",children:["Read more about our"," ",d.jsx(m.Text,{color:"tomato11",href:TTe,underline:!0,children:"supported media"}),"."]}),buttons:{action:{text:"Retry upload",icon:"cloudUpload",onClick:()=>E(Oe)}}})}const[bt,Yt]=R.useState(!1);return d.jsx(kq.Provider,{value:{isFetchingMedia:a,media:_,mediaTotal:y,onScrollToBottom:ke,actionContainerRef:i,onFilesUpload:ue,isUploading:ge,uploadingFiles:k,isMediaRevalidationInProgress:J,isMediaCacheInvalid:Z,revalidateMedia:ae,deleteMedia:C,updateMedia:Se,keyword:p,onKeywordChange:F,isSearchingMedia:s,assetType:n,tagManagerOpen:bt,setTagManagerOpen:Yt,tagIds:h,onTagIdsChange:N,openMediaSection:M,setOpenMediaSection:O},children:t})}function Et(){const e=R.useContext(kq);if(!e)throw new Error("useMediaLibrary must be used within a MediaLibraryProvider");return e}function Xxe(){const{actionContainerRef:e,isUploading:t,onFilesUpload:n,assetType:r}=Et(),i=e==null?void 0:e.current;return d.jsx(Lq,{actionContainerRef:e,children:d.jsxs(m.Box,{width:"100%",gap:16,children:[d.jsx(ewe,{}),d.jsx(m.Tooltip,{title:Rl.warning.uploadWhileUploading.title,content:Rl.warning.uploadWhileUploading.description,visible:t,stableMount:!0,children:d.jsx(m.FileUploadButton,{disabled:t,onFilesSelected:n,startIcon:"cloudUpload",color:i?"purple":"grey",size:"large",assetType:r,children:"Upload media"})})]})})}function ewe(){const{keyword:e,onKeywordChange:t,isFetchingMedia:n}=Et(),[r,i]=R.useState(e);return Xe.useOnChange(e,()=>{e===""&&i("")}),Xe.useDebounce(r,300,Xe.useStableCallback(o=>t(o))),d.jsx(m.Box,{width:"100%",flexDirection:"column",children:d.jsx(m.FormSearchInput,{value:r,placeholder:"Search",onValueChange:i,maxLength:200,isLoading:n&&e!==r})})}function Lq(e){const{children:t,actionContainerRef:n}=e,r=n==null?void 0:n.current,i=r?m.Portal:R.Fragment,o=r?{container:n.current,asChild:!0}:{};return d.jsx(i,{...o,children:t})}function twe(e){const{children:t}=e,{onFilesUpload:n,assetType:r}=Et();return d.jsx(m.FileDropZone,{overlay:d.jsx(nwe,{}),onFilesSelected:n,assetType:r,children:t})}function nwe(){const{isUploading:e}=Et(),t=e?Rl.warning.uploadWhileUploading.title:"Drop files here",n=e?Rl.warning.uploadWhileUploading.description:"Drop your files to upload them instantly to the media library.";return d.jsx(m.Box,{justifyContent:"center",flexDirection:"column",height:"100%",backgroundColor:"grey3",children:d.jsxs(m.BlankSlate,{children:[d.jsx(m.BlankSlateIcon,{name:e?"block":"cloudUpload",lineColor:e?"tomato11":"purple10",backgroundColor:e?"tomato2":"purple3",borderColor:e?"tomato6":"purple6",borderStyle:"dashed",size:"xlarge"}),d.jsx(m.BlankSlateTitle,{size:"big",children:t}),d.jsx(m.BlankSlateDescription,{width:360,children:n})]})})}function jq(){return d.jsx(m.DefaultErrorMessage,{title:"Oops! Something went wrong",description:"An error occurred while searching for your image.",errorImageSrc:m.dialogErrorImage,sx:{marginBlock:"auto",marginInline:"auto"}})}function Uq(e){const{mediaList:t,mediaActions:n,mediaToolbar:r,sidePane:i}=e,o=m.useMediaQuery({min:"medium"});return d.jsxs(m.Box,{display:"grid",gridTemplateRows:"auto auto 1fr",gridTemplateColumns:o?"1fr 380px":"1fr",width:"100%",height:"100%",children:[d.jsxs(m.Box,{position:"relative",display:"grid",gap:16,gridColumn:"1",gridRow:"1",padding:{right:16,bottom:16},children:[n,r]}),d.jsx(m.Box,{position:"relative",display:"grid",gridColumn:"1",gridRow:"2 / -1",children:t}),o&&i]})}function Bq(e){const{count:t}=e;return d.jsxs(m.Text,{variant:"bold",children:[t," items"]})}function rwe(){var A;const{onScrollToBottom:e,media:t,isUploading:n,uploadingFiles:r,isSearchingMedia:i,isMediaRevalidationInProgress:o,setOpenMediaSection:a}=Et(),u=qu(),s=xe(),c=s.mediaLibrary&&s.mediaLibraryTagsEnabled,l=R.useRef(null);function f(h){u.toggleSelection({id:h,isSingleSelection:!0}),a("tags")}(n||i||o)&&((A=l.current)==null||A.scrollTo({top:0,behavior:"instant"}));function p(h,v,_){const S=v.shiftKey?t.map(({id:I})=>I):void 0;u.toggleSelection({id:h,isSingleSelection:_==="single",metaKey:v.metaKey,shiftKey:v.shiftKey,ids:S})}return d.jsx(Wq,{onScrollToBottom:e,scrollAreaRef:l,children:t.map(h=>{var v,_;return d.jsx(m.MediaCard,{"aria-label":"media item",...h,filenameHighlight:(v=h.search_highlight)==null?void 0:v.filename,loading:i,status:(_=r.find(S=>S.id===h.id))==null?void 0:_.status,selected:u.isSelected(h.id),onCardClick:S=>p(h.id,S,"single"),onCheckedChange:(S,I)=>p(h.id,I,"multi"),onAddTagClick:c?()=>f(h.id):void 0},h.id)})})}function Wq(e){const{children:t,scrollAreaRef:n,onScrollToBottom:r}=e,i=16,o=4,a="250px",u=`calc((100% - ${i*(o-1)}px) / ${o})`;return d.jsx(m.ScrollArea,{"aria-label":"Media list",ref:n,style:{display:"grid",gridTemplateColumns:`repeat(auto-fill, minmax(max(${a}, ${u}), 1fr))`,gridTemplateRows:"1fr 1fr 1fr ",gap:i,padding:2,paddingBottom:16,position:"relative"},onScrollToBottom:r,threshold:500,children:t})}function Kq(e){const{children:t,hasSelectedMedia:n}=e;return d.jsx(m.Box,{overflow:"hidden",gridColumn:"2 / -1",gridRow:"1 / -1",children:d.jsx(m.ScrollArea,{style:{display:"grid",height:"100%"},children:d.jsx(m.Box,{flexGrow:1,borderRadius:{topRight:8,topLeft:8},borderStyle:n?"solid":"dashed",border:{top:!0,right:!0,left:!0,bottom:!1},minWidth:0,children:t})})})}function Pq(e){const{onFilesUpload:t,isUploading:n,isInitialLoad:r=!1}=e,i=r||n;return d.jsxs(m.Box,{flexDirection:"column",justifyContent:"center",alignItems:"center",padding:16,gap:16,width:"100%",children:[d.jsx(m.BlankSlateIcon,{name:"cloudUpload",lineColor:"purple11",backgroundColor:"purple5",size:"large"}),d.jsx(m.Box,{flexDirection:"column",gap:4,children:d.jsxs(m.Text,{align:"center",children:["Select or"," ",d.jsx(m.FileUploadButton,{disabled:i,onFilesSelected:t,renderButton:o=>d.jsx(m.Tooltip,{title:Rl.warning.uploadWhileUploading.title,content:Rl.warning.uploadWhileUploading.description,visible:n,children:d.jsx(m.Box,{display:"inline-flex",as:"span",children:d.jsx(m.Button,{disabled:i,onClick:o,invisible:!0,children:"upload"})})})})," ","media."]})}),d.jsx(m.FileUploadButton,{disabled:i,onFilesSelected:t,color:"grey",children:"Upload media"})]})}function iwe(e){const{actionContainerRef:t}=e;return d.jsx(Uq,{sidePane:d.jsx(uwe,{}),mediaActions:d.jsx(awe,{actionContainerRef:t}),mediaToolbar:d.jsx(m.Skeleton,{color:"grey5",borderRadius:12,children:d.jsx(Bq,{count:888})}),mediaList:d.jsx(owe,{})})}function owe(){return d.jsx(Wq,{children:gn.range(1,24).map(e=>d.jsx(Dq,{},e))})}function awe(e){const{actionContainerRef:t}=e,n=Xe.useForceUpdate();return R.useLayoutEffect(()=>{n()},[n]),d.jsx(Lq,{actionContainerRef:t,children:d.jsxs(m.Box,{width:"100%",gap:16,children:[d.jsx(m.Box,{width:"100%",flexDirection:"column",children:d.jsx(m.FormSearchInput,{placeholder:"Search",maxLength:200,value:"",disabled:!0,onValueChange:()=>{}})}),d.jsx(m.FileUploadButton,{disabled:!0,onFilesSelected:()=>{},startIcon:"cloudUpload",color:t?"purple":"grey",size:"large",children:"Upload media"})]})})}function uwe(){return d.jsx(Kq,{hasSelectedMedia:!1,children:d.jsx(Pq,{onFilesUpload:()=>{},isUploading:!1,isInitialLoad:!0})})}function Dq(){return d.jsxs(m.Box,{height:302,width:"100%",flexDirection:"column",padding:16,backgroundColor:"grey1",border:!0,borderStyle:"solid",borderRadius:6,children:[d.jsx(m.Skeleton,{height:164,width:"100%"}),d.jsx(m.Skeleton,{height:16,width:"100%",sx:{marginTop:12}}),d.jsx(m.Skeleton,{height:10,width:100,sx:{marginTop:8}}),d.jsx(m.Skeleton,{height:1,width:"100%",sx:{marginTop:20,marginBottom:16}}),d.jsxs(m.Box,{flexDirection:"row",gap:8,children:[d.jsx(m.Skeleton,{height:24,width:54}),d.jsx(m.Skeleton,{height:24,width:45}),d.jsx(m.Skeleton,{height:24,width:62})]})]})}const Nq=R.createContext({showToast:()=>{}});function swe(e){const{children:t}=e,{isFetchingMedia:n}=Et(),[r,i]=R.useState({title:"",seconds:5}),[o,a]=R.useState(!1),{title:u,action:s,seconds:c=1,icon:l="check"}=r,f=R.useMemo(()=>({showToast:p=>{i({seconds:c,...p}),a(!0)}}),[c]);return d.jsxs(d.Fragment,{children:[d.jsx(cwe,{open:n}),d.jsx(lwe,{}),d.jsx(m.Toast,{anchor:d.jsx(m.Box,{position:"absolute",justifyContent:"center",width:"100%",bottom:72}),open:o,onOpenChange:a,title:u,action:s,seconds:c,icon:l}),d.jsx(Nq.Provider,{value:f,children:t})]})}function qq(){return R.useContext(Nq)}function cwe(e){const{open:t}=e;return d.jsx(m.Toast,{anchor:d.jsx(m.Box,{position:"absolute",justifyContent:"center",width:"100%",bottom:72}),loadingIndicator:!0,open:t,title:"Loading more items ...",seconds:1})}function lwe(){const{revalidateMedia:e,isMediaCacheInvalid:t}=Et(),[n,r]=R.useState(t);return Xe.useOnChange(t,r),d.jsx(m.Toast,{anchor:d.jsx(m.Box,{position:"absolute",justifyContent:"center",width:"100%",bottom:72}),open:n,title:"There has been changes to your media library",action:{title:"Update",onClick:e},cancel:{onClick:()=>r(!1)}})}function fwe(){const{media:e,mediaTotal:t,tagIds:n}=Et(),r=qu(),i=xe(),o=i.mediaLibrary&&i.mediaLibraryTagsEnabled;return d.jsxs(m.Box,{alignItems:"center",gap:16,children:[r.isSelectAllEnabled&&d.jsx(m.Checkbox,{onCheckedChange:r.toggleSelectAll,checked:r.selectedCount>0,indeterminate:r.selectedCount!==t,onClick:a=>a.stopPropagation(),disabled:e.length===0}),e.length!==0&&d.jsx(Bq,{count:t}),o&&d.jsxs(m.Box,{gap:8,alignItems:"center",children:[d.jsx(m.Text,{children:"Filter:"}),d.jsx(pwe,{}),n.length>0&&d.jsx(m.ErrorBoundary,{children:d.jsx(R.Suspense,{children:d.jsx(dwe,{})})})]})]})}function dwe(){const{tagIds:e,onTagIdsChange:t}=Et(),{tags:n}=yh(),r=R.useMemo(()=>hV.groupBy(n,o=>o.id),[n]);function i(o){const a=e.filter(u=>u!==o.id);t(a)}return d.jsx(d.Fragment,{children:e.map(o=>{var u;const a=(u=r.get(o))==null?void 0:u[0];return a?d.jsx(m.Badge,{title:a.name,size:"medium",color:"purple",onClose:()=>i(a),selected:!0},a.id):null})})}function pwe(){const{setTagManagerOpen:e,tagIds:t,onTagIdsChange:n}=Et(),[r,i]=R.useState(""),[o,a]=R.useState(!1);function u(l){a(l),l||i("")}function s(l){const f=t.includes(l.id)?t.filter(p=>p!==l.id):[...t,l.id];n(f),a(!1)}function c(){a(!1),e(!0)}return d.jsxs(m.DropdownMenu,{open:o,onOpenChange:u,children:[d.jsx(m.DropdownMenuTrigger,{children:d.jsx(m.Button,{startIcon:"label",endIcon:"arrowDropDown",size:"small",color:"grey",children:"Tags"})}),d.jsx(m.DropdownMenuContent,{minWidth:256,align:"start",border:!1,childrenFocusScope:!0,children:d.jsxs(m.ComboBox,{variant:"attached",children:[d.jsx(m.ComboBoxInput,{value:r,onValueChange:i,placeholder:"Search for a tag",autoFocus:!0}),d.jsx(m.ComboBoxContent,{children:d.jsx(m.ErrorBoundary,{renderError:()=>d.jsx(m.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"Error getting tags"}),children:d.jsx(R.Suspense,{fallback:d.jsx(m.Box,{padding:8,flexDirection:"column",gap:8,children:gn.range(1,6).map(l=>d.jsx(m.Skeleton,{height:24,width:85},l))}),children:d.jsx(Awe,{searchTerm:r,setSearchTerm:i,onTagToggle:s})})})}),d.jsx(m.ComboboxAction,{children:d.jsx(m.Button,{invisible:!0,startIcon:"edit",textWeight:"normal",color:"dark",onClick:c,children:"Manage tags"})})]})})]})}function Awe(e){const{onTagToggle:t,searchTerm:n}=e,{tagIds:r}=Et(),{tags:i}=yh(),o=R.useMemo(()=>{const a=n.toLowerCase();return i.filter(u=>u.name.toLowerCase().includes(a))},[i,n]);return d.jsxs(d.Fragment,{children:[!o.length&&d.jsx(m.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"No tags found"}),o.map((a,u)=>{const s=r.includes(a.id);return d.jsx(m.ComboBoxItem,{value:a.id,onCheckedChange:()=>t(a),checked:s,children:d.jsx(m.Badge,{title:a.name,color:"purple",sx:{marginLeft:8,marginBottom:u===o.length-1?8:4,marginTop:u===0?8:4},size:"medium"})},a.id)})]})}function jc(){const{media:e}=Et(),t=qu();return e.filter(({id:n})=>t.isSelected(n))}function hwe(){const[e,t]=R.useState(!1),n=jc(),r=qu(),i=R.useMemo(()=>n.some(({id:a})=>a.startsWith("temp")),[n]),[o]=n;return o?r.selectedCount>1?d.jsxs(m.Box,{gap:8,alignItems:"center",children:[d.jsxs(m.Text,{variant:"emphasized",noWrap:!0,sx:{flexGrow:1},children:[r.selectedCount," media selected"]}),d.jsx(m.Tooltip,{content:"Open all selected media in new tabs",children:d.jsx(m.IconButton,{icon:"openInFull",variant:"solid",size:"small",onClick:()=>n.forEach(a=>window.open(a.url,"_blank"))})}),d.jsx(m.Tooltip,{content:"Remove selected media",children:d.jsx(m.IconButton,{icon:"delete",variant:"solid",color:"tomato",size:"small",hiddenLabel:"Remove media",onClick:()=>t(!0),disabled:i})}),d.jsx(LF,{open:e,onOpenChange:t,media:n})]}):d.jsxs(m.Box,{gap:8,alignItems:"center",children:[d.jsx(m.Text,{variant:"emphasized",noWrap:!0,sx:{flexGrow:1},children:o.filename}),d.jsxs(m.Box,{gap:8,children:[d.jsx(m.Tooltip,{content:"Open media in new tab",children:d.jsx(m.IconButton,{icon:"openInFull",variant:"solid",size:"small",hiddenLabel:"Open media in new tab",onClick:()=>window.open(o.url,"_blank"),disabled:i})}),d.jsx(m.Tooltip,{content:"Copy media URL",children:d.jsx(m.IconButton,{icon:"link",variant:"solid",size:"small",hiddenLabel:"Copy media URL",onClick:()=>navigator.clipboard.writeText(o.url),disabled:i})}),d.jsx(m.Tooltip,{content:"Remove media",children:d.jsx(m.IconButton,{icon:"delete",variant:"solid",color:"tomato",size:"small",hiddenLabel:"Remove media",onClick:()=>t(!0),disabled:i})}),d.jsx(LF,{open:e,onOpenChange:t,media:o})]})]}):null}function LF(e){const{open:t,onOpenChange:n,media:r}=e,i=xe(),{showAlert:o}=m.useAlert(),{deleteMedia:a}=Et(),u=qu(),[s,c]=R.useState(!1),l=Array.isArray(r),f=l?"these items":"this item";function p(){c(!0);const h=u.getSelectionState().selectedIds;gwe({ids:h,config:i}).then(()=>{n(!1),a(h),u.clearSelection()}).catch(()=>{n(!1),o({title:"Error",subtitle:`Something went wrong when removing ${f}.`})}).finally(()=>{c(!1)})}return d.jsxs(m.Dialog,{onOpenChange:n,open:t,size:"small",children:[d.jsx(m.DialogHeader,{icon:"alert",title:`Remove ${f} from your media library?`}),d.jsx(m.DialogContent,{children:d.jsx(m.Box,{padding:16,children:d.jsxs(m.Text,{children:["You are about to delete ",f,":  ",l?d.jsx(mwe,{media:r}):d.jsx("b",{children:r.filename})]})})}),d.jsxs(m.DialogActions,{children:[d.jsx(m.DialogCancelButton,{}),d.jsxs(m.DialogActionButton,{onClick:p,color:"tomato",loading:s,children:["Yes, I want to remove ",f]})]})]})}const Pb=15;function mwe({media:e}){const t=e.slice(0,Pb),n=e.length>Pb,r=n?e.length-Pb:0,i=r===1?"item":"items";return d.jsxs("ul",{children:[t.map((o,a)=>d.jsx("li",{children:d.jsx("b",{children:o.filename})},a)),n&&d.jsxs("span",{children:[d.jsx("br",{}),"And ",d.jsx("b",{children:r})," more ",i,"..."]})]})}function gwe(e){const{ids:t,config:n}=e;if(!n.mediaLibrary)throw new Error("Media Library not configured.");if(t.length===0)throw new Error("No ids provided during media deletion");const{assetsApiBaseUrl:r,repository:i,authStrategy:o}=n;if(t.length===1){const[a]=t;return _e.request(new URL(`assets/${a}`,r),{headers:{repository:i},method:"DELETE",credentials:_e.getRequestCredentials(o),okType:B.unknown()})}return _e.request(new URL("assets/bulk-delete",r),{headers:{repository:i},method:"POST",credentials:_e.getRequestCredentials(o),okType:B.unknown(),body:{ids:t}})}function vwe(){var o;const e=jc(),{uploadingFiles:t}=Et(),[n]=e;if(!n)return null;if(e.length===2)return d.jsx(Db,{children:e.map((a,u)=>d.jsx("div",{style:{position:"absolute",transform:u===0?"translateX(25%) rotate(15deg) ":"translateX(-25%) rotate(-15deg) "},children:d.jsx(jF,{media:a})},a.id))});if(e.length>2)return d.jsx(Db,{children:e.slice(-4).map((a,u)=>d.jsx("div",{style:{position:"absolute",paddingRight:u*16},children:d.jsx(jF,{media:a})},a.id))});const r=(o=t.find(a=>a.id===n.id))==null?void 0:o.status,i=n.kind.startsWith("image");return d.jsx(m.Box,{flexDirection:"column",children:d.jsx(m.CheckerBoard,{children:d.jsx(Db,{uploadStatus:r,hasImage:i,children:i?d.jsx(m.Image,{src:n.url,alt:n.alt,sizing:"contain"}):d.jsx(m.MediaCardPlaceholder,{extension:n.extension,filename:n.filename})})})})}function Db(e){const{children:t,uploadStatus:n,hasImage:r}=e;return d.jsxs(m.Box,{flexDirection:"column",alignItems:"center",justifyContent:"center",position:"relative",height:200,width:"100%",backgroundColor:r?"transparent":"purple2",children:[t,n&&d.jsx(m.Box,{position:"absolute",backgroundColor:"greyAlpha1",width:"100%",height:"100%",padding:{inline:16},justifyContent:"end",flexDirection:"column",children:d.jsx(m.MediaProgress,{status:n})})]})}function jF(e){const{media:t}=e;return d.jsx(m.Box,{width:111,height:152,children:t.kind==="image"?d.jsx(m.Image,{borderRadius:8,src:t.url,alt:t.alt,sizing:"cover"}):d.jsx(m.MediaCardPlaceholder,{extension:t.extension,filename:t.filename})})}const Xa=2e3,dd="__MAIN_THUMBNAIL__";function J1(e,t,n){const r=e.name===dd?void 0:e.name;let i;return t?to.isDefined(n)?i=[n.width,n.height]:to.isDefined(e.width)||to.isDefined(e.height)?i=[e.width??void 0,e.height??void 0]:i=[t.origin.width,t.origin.height]:i=void 0,[r,i?`${i[0]??"auto"}x${i[1]??"auto"}px`:void 0]}function ywe(e){var t,n;return[{...(t=e.config)==null?void 0:t.constraint,name:dd}].concat(((n=e.config)==null?void 0:n.thumbnails)??[])}function bwe(e,t){var a,u;const{__TYPE__:n,thumbnails:r,...i}=t,o=(u=(a=e.config)==null?void 0:a.thumbnails)==null?void 0:u.map(({name:s})=>r==null?void 0:r[s]);return[i,...o??[]]}function Cwe(e,t,n,r){const i=r.length===0?void 0:r;return e===dd||!Ue.isImageContent(t)?{...t,alt:i}:{...t,thumbnails:{...t.thumbnails,[e]:{...n,alt:i}}}}function Swe(e,t){const{width:n,height:r}=t??{};return n&&r?[n,r]:n?[n,Math.round(e.height*(n/e.width))]:r?[Math.round(e.width*(r/e.height)),r]:[e.width,e.height]}function _we(e,t,n,r,i){if(Ewe(e)==="svg")return e;const o=new URL(e);if(i){const{x:a,y:u,width:s,height:c}=t,l=[...o.searchParams.entries(),["rect",[a,u,s,c].join(",")],["w",n],["h",r]];o.search=l.map(f=>f.join("=")).join("&")}return o.toString()}function Qq(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 Iwe(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()}function Twe(e){return e!=null&&e.url?Qq(e.url):void 0}function xwe(e,t,n,r){var u,s,c,l,f;if(!n||e===dd){const p=(u=t.config)==null?void 0:u.thumbnails,A=p&&Object.fromEntries(p.map(h=>[h.name,Xh(r,h)]));return{__TYPE__:"ImageContent",...Xh(r,(s=t.config)==null?void 0:s.constraint),thumbnails:A}}const i=(l=(c=t.config)==null?void 0:c.thumbnails)==null?void 0:l.find(p=>p.name===e);if(!i)return n;const o=(f=n.thumbnails)==null?void 0:f[e],a=Xh(r,i);return a.url===(o==null?void 0:o.url)?n:{...n,thumbnails:Pl.mapValues(n.thumbnails??{},(p,A)=>A===e?a:p)}}function wwe(e){return"kind"in e&&"extension"in e}function Xh(e,t){const{width:n,height:r,rect:i}=$we({...e,width:(e==null?void 0:e.width)??Xa,height:(e==null?void 0:e.height)??Xa},t),o=!!(t!=null&&t.width||t!=null&&t.height);return{provider:"imgix",url:_we(e.url,i,n,r,o),alt:e.alt,...wwe(e)?{credits:e.credits}:{},origin:{id:e.id,url:e.url,width:e.width??Xa,height:e.height??Xa},width:n,height:r,edit:{background:"transparent",zoom:1,crop:{x:i.x,y:i.y}}}}function $we(e,t){const[n,r]=Swe(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 Ewe(e){const{pathname:t}=new URL(e),n=t.lastIndexOf(".");if(n!==-1)return t.substring(n).slice(1).toLowerCase()}function Rwe(e){if(!e)return"";const{filename:t,extension:n}=e;if(!n)return t;const r=new RegExp(`\\.${n}$`);return t.replace(r,"")}function Vq(e){const{tags:t,toggleAssetTag:n,getTagsLabel:r}=e,{setTagManagerOpen:i}=Et(),{showToast:o}=qq(),{showAlert:a}=m.useAlert(),[u,s]=R.useState("");async function c(l,f){s("");try{await n(l,f),o({title:"Media tags were updated",seconds:3})}catch{a({title:"Error",subtitle:"Something went wrong when updating media tags"})}}return d.jsxs(m.Box,{flexDirection:"column",children:[d.jsxs(m.Box,{justifyContent:"space-between",children:[d.jsx(m.Text,{color:"grey12",variant:"bold",children:r()}),d.jsx(m.Button,{startIcon:"edit",invisible:!0,color:"dark",onClick:()=>i(!0),children:"Manage tags"})]}),d.jsxs(m.ComboBox,{sx:{marginTop:4,marginBottom:8},children:[d.jsx(Owe,{searchTerm:u,setSearchTerm:s}),d.jsx(m.ComboBoxContent,{children:d.jsx(m.ErrorBoundary,{renderError:()=>d.jsx(m.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"Error getting tags"}),children:d.jsx(R.Suspense,{fallback:d.jsx(m.Box,{padding:8,flexDirection:"column",gap:8,children:gn.range(1,6).map(l=>d.jsx(m.Skeleton,{height:24,width:85},l))}),children:d.jsx(Fwe,{searchTerm:u,assignedTags:t,onToggleAssetTag:c})})})})]}),d.jsx(m.Box,{flexDirection:"column",alignItems:"flex-start",gap:8,children:t.map(l=>d.jsx(m.Badge,{title:l.name,size:"medium",color:"purple",selected:!0,onClose:()=>c(l,"remove")},l.id))})]})}function Owe(e){const{searchTerm:t,setSearchTerm:n}=e,r=R.useRef(null),{openMediaSection:i,setOpenMediaSection:o}=Et();return R.useEffect(()=>{var a;i==="tags"&&((a=r.current)==null||a.focus(),o(void 0))},[i,o]),d.jsx(m.ComboBoxInput,{value:t,onValueChange:n,placeholder:"Add or create a new tag",ref:r})}function Fwe(e){const{searchTerm:t,assignedTags:n,onToggleAssetTag:r}=e,[i]=jc(),o=xe(),{showAlert:a}=m.useAlert(),{tags:u}=yh(),s=R.useMemo(()=>{const p=t.toLowerCase();return u.filter(A=>A.name.toLowerCase().includes(p))},[u,t]),l=wR.safeParse(t).success&&u.every(p=>p.name!==t);async function f(){if(!t||!i)return;let p;try{p=await Mwe({name:t,config:o}),bh(A=>[p,...A])}catch{a({title:"Error",subtitle:`Something went wrong when creating the tag ${t}`});return}await r(p,"add")}return i?d.jsxs(d.Fragment,{children:[!s.length&&d.jsx(m.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"No tags found"}),s.map((p,A)=>d.jsx(m.ComboBoxItem,{value:p.id,onCheckedChange:h=>r(p,h?"add":"remove"),checked:n.some(h=>h.id===p.id),children:d.jsx(m.Badge,{title:p.name,color:"purple",size:"medium",sx:{marginInline:8,marginBottom:A===s.length-1?8:4,marginTop:A===0?8:4}})},p.id)),l&&d.jsx(m.ComboBoxItem,{value:"new",onCheckedChange:f,children:d.jsxs(m.Box,{padding:8,flexDirection:"row",alignItems:"center",gap:4,children:[d.jsx(m.Icon,{name:"add",size:"small",color:"grey11"}),d.jsxs(m.Text,{color:"grey12",children:['Create tag "',t,'"']})]})})]}):null}function Mwe(e){const{name:t,config:n}=e;n.mediaLibrary||Bn("mediaLibrary");const{assetsApiBaseUrl:r,repository:i,authStrategy:o}=n;return _e.request(new URL("tags",r),{headers:{repository:i},body:{name:t},method:"POST",credentials:_e.getRequestCredentials(o),okType:$R})}function kwe(e){const{selectedMedia:t}=e,n=xe(),r=R.useMemo(()=>jwe(t),[t]);async function i(a,u){const s=u==="remove",c=t.map(f=>f.id);let l=[];Ms(f=>(l=f,f.map(p=>c.includes(p.id)?s?Bwe(p,a):Uwe(p,a):p)));try{await Lwe({tagId:a.id,assetIds:c,operation:s?"remove":"add",config:n});const f=t.length*(s?-1:1);bh(p=>p.map(A=>A.id===a.id?{...A,count:A.count+f}:A))}catch(f){throw Ms(()=>l),f}}function o(){const a=r.length;return a>1?`${a} tags in common`:a===1?"1 tag in common":"Common tags"}return d.jsx(Vq,{tags:r,getTagsLabel:o,toggleAssetTag:i})}function Lwe(e){const{tagId:t,assetIds:n,config:r,operation:i}=e;if(!r.mediaLibrary)throw new Error("Media Library not configured.");const{assetsApiBaseUrl:o,repository:a,authStrategy:u}=r;return _e.request(new URL(`tags/${t}/assets`,o),{headers:{repository:a},body:{assetIds:n},method:i==="add"?"POST":"DELETE",credentials:_e.getRequestCredentials(u),okType:B.unknown()})}function jwe(e){const t=e.length,n={},r=[];return e.forEach(o=>{o.tags.forEach(a=>{n[a.id]||(n[a.id]=0,r.push(a)),n[a.id]++})}),r.filter(o=>n[o.id]===t)}function Uwe(e,t){return e.tags.some(({id:r})=>r===t.id)?e:{...e,tags:[...e.tags,t]}}function Bwe(e,t){const n=e.tags.filter(r=>r.id!==t.id);return{...e,tags:n}}function Wwe(e){const{selectedMedia:t}=e,n=t.tags,r=xe(),{updateMedia:i}=Et();async function o(u,s){const c=t.tags,l=s==="remove",f=l?c.filter(p=>p.id!==u.id):[...c,u];i(t.id,{tags:f});try{await Kwe({mediaId:t.id,config:r,tags:f.map(p=>p.id)}),bh(p=>p.map(A=>A.id===u.id?{...A,count:A.count+(l?-1:1)}:A))}catch(p){throw i(t.id,{tags:c}),p}}function a(){const u=n.length;return u>1?`${u} tags`:u===1?"1 tag":"Tags"}return d.jsx(Vq,{tags:n,getTagsLabel:a,toggleAssetTag:o})}function Kwe(e){const{mediaId:t,config:n,tags:r}=e;if(!n.mediaLibrary)throw new Error("Media Library not configured.");const{assetsApiBaseUrl:i,repository:o,authStrategy:a}=n;return _e.request(new URL(`assets/${t}`,i),{headers:{repository:o},body:{tags:r},method:"PATCH",credentials:_e.getRequestCredentials(a),okType:K0})}function Pwe(){const[e,t]=R.useState("description");if(jc().length!==1)return d.jsx(Qwe,{});const r=e==="description",i=e==="more-info";return d.jsxs(d.Fragment,{children:[d.jsxs(m.Box,{border:!0,borderStyle:"solid",borderRadius:8,backgroundColor:"grey2",children:[d.jsx(m.Tab,{title:"Description",selected:r,onSelect:()=>t("description"),outline:r,background:r?void 0:"transparent",sx:{flexGrow:1,flexBasis:0}}),d.jsx(m.Tab,{title:"More info",selected:i,onSelect:()=>t("more-info"),outline:i,background:i?void 0:"transparent",sx:{flexGrow:1,flexBasis:0}})]}),d.jsx(Dwe,{tab:e})]})}function Dwe(e){const{tab:t}=e;switch(t){case"description":return d.jsx(Nwe,{});case"more-info":return d.jsx(qwe,{})}}function Nwe(){const{title:e,alt:t,onBlur:n,isUploading:r,selectedMedia:i}=zq(),o=xe(),a=o.mediaLibrary&&o.mediaLibraryTagsEnabled;if(!i)return null;const{extension:u}=i;return d.jsxs(m.Box,{flexDirection:"column",gap:16,children:[d.jsx(m.FormInput,{value:e.value,onValueChange:e.set,label:"Media title",placeholder:"Media title",onBlur:n,disabled:r,suffix:u?`.${u}`:void 0}),d.jsx(m.FormInputField,{label:"Alternative text",children:d.jsx(m.ContentEditable,{content:t.displayValue,contentVersion:t.version,readOnly:r,placeholder:"A short description of the media for accessibility",multiline:!0,decorations:{em:"highlight"},onChange:t.onChange,onBlur:n})}),a&&!r&&d.jsx(Wwe,{selectedMedia:i})]})}function qwe(){const{credits:e,notes:t,onBlur:n,isUploading:r,selectedMedia:i}=zq();if(!i)return null;const o=Hwe(i);return d.jsxs(m.Box,{gap:8,flexDirection:"column",children:[o.map(a=>d.jsxs(m.Box,{gap:8,children:[d.jsxs(m.Text,{color:"grey11",children:[a.label,":"]}),d.jsx(m.Text,{children:a.value})]},a.label)),d.jsx(m.FormInputField,{label:"Copyright",children:d.jsx(m.ContentEditable,{content:e.displayValue,contentVersion:e.version,readOnly:r,placeholder:"Media copyrights or credits",multiline:!0,decorations:{em:"highlight"},onChange:e.onChange,onBlur:n})}),d.jsx(m.FormInputField,{label:"Private notes",children:d.jsx(m.ContentEditable,{content:t.displayValue,contentVersion:t.version,readOnly:r,placeholder:"Private notes are never shared publicly",multiline:!0,decorations:{em:"highlight"},onChange:t.onChange,onBlur:n})})]})}function Qwe(){const e=jc(),{uploadingFiles:t}=Et(),n=xe(),r=R.useMemo(()=>t.some(o=>e.some(a=>o.id===a.id)&&o.status!=="success"),[e,t]),i=n.mediaLibrary&&n.mediaLibraryTagsEnabled;return d.jsx(d.Fragment,{children:i&&!r&&d.jsx(kwe,{selectedMedia:e})})}function zq(){const[e]=jc(),{updateMedia:t,uploadingFiles:n}=Et(),r=xe(),{showToast:i}=qq(),o=(e==null?void 0:e.id)??"",a=Ph(e,"alt"),u=Ph(e,"notes"),s=Ph(e,"credits"),c=Ph(e,"filename",Rwe),l=n.some(p=>p.id===(e==null?void 0:e.id)&&p.status!=="success");function f(){if(!e||!c.changed&&!a.changed&&!s.changed&&!u.changed)return;const{extension:p,search_highlight:A}=e,h=p?`${c.value}.${p}`:c.value;t(o,{filename:h,alt:a.value,credits:s.value,notes:u.value,search_highlight:{alt:a.changed||A==null?void 0:A.alt,credits:s.changed||A==null?void 0:A.credits,filename:c.changed||A==null?void 0:A.filename,notes:u.changed||A==null?void 0:A.notes}}),zwe({id:o,config:r,metadata:{filename:h,alt:a.value,credits:s.value,notes:u.value}}).then(()=>{i({title:"Media metadata has been saved.",seconds:3})}).catch(v=>{console.error(v)})}return{selectedMedia:e,onBlur:f,isUploading:l,title:c,alt:a,credits:s,notes:u,extension:e==null?void 0:e.extension}}function Ph(e,t,n=r=>r==null?void 0:r[t]){var c;const r=n(e)??"",[i,o]=R.useState(r);Xe.useOnChange(e==null?void 0:e.id,()=>o(r));const a=(c=e==null?void 0:e.search_highlight)==null?void 0:c[t],u=!!a;function s(l){const{from:f,to:p}=l.state.selection;l.commands.selectAll(),l.commands.unsetAllMarks(),l.commands.setTextSelection({from:f,to:p}),o(l.getText())}return{value:i,set:o,displayValue:Vwe(a??i)??"",onChange:s,version:`${(e==null?void 0:e.id)??""}_${u}`,changed:i!==r}}function Vwe(e){return e==null?void 0:e.replace(/\n/g,"<br>")}function zwe(e){const{id:t,config:n,metadata:r}=e;if(!n.mediaLibrary)throw new Error("Media Library not configured.");const{assetsApiBaseUrl:i,repository:o,authStrategy:a}=n;return _e.request(new URL(`assets/${t}`,i),{headers:{repository:o},body:{...r},method:"PATCH",credentials:_e.getRequestCredentials(a),okType:K0})}function Hwe(e){const{width:t,height:n,last_modified:r,size:i,extension:o}=e,a=t&&n,u={label:"Date",value:PC.prettyPrintDate(new Date(r))},s={label:"File size",value:Ip.formatBytes(i)},c=a?{label:"Dimensions",value:`${t}x${n}`}:void 0,l=a?{label:"Ratio",value:((t??0)/(n??0)).toFixed(1)}:void 0,f=o?{label:"Extension",value:o.toUpperCase()}:void 0;return[u,s,c,l,f].filter(to.isDefined)}function Ywe(){const{setTagManagerOpen:e}=Et(),[t,n]=R.useState("");return d.jsxs(m.Box,{gap:20,flexDirection:"column",height:"100%",children:[d.jsxs(m.Box,{alignItems:"center",gap:4,children:[d.jsx(m.IconButton,{icon:"close",size:"small",hasPadding:!1,onClick:()=>e(!1)}),d.jsx(m.Text,{variant:"bold",children:"Tags management"})]}),d.jsxs(m.Box,{gap:16,flexDirection:"column",height:"100%",children:[d.jsx(m.FormSearchInput,{value:t,onValueChange:n,placeholder:"Search for tags",endAdornment:!1,autoFocus:!0}),d.jsx(m.ErrorBoundary,{renderError:()=>d.jsx(Xwe,{}),children:d.jsx(R.Suspense,{fallback:d.jsx(n$e,{}),children:d.jsx(Gwe,{searchTerm:t})})})]})]})}function Gwe(e){const{searchTerm:t}=e,{tags:n}=yh(),r=n.filter(i=>i.name.toLowerCase().includes(t.toLowerCase()));return r.length===0?d.jsx(m.Text,{color:"grey9",variant:"small",children:"No tags found"}):d.jsx(m.AnimatedList,{ariaLabel:"Tags list",getItemKey:i=>i.id,gap:16,items:r,children:i=>d.jsx(Jwe,{tag:i})})}function Jwe(e){const{tag:t}=e,[n,r]=R.useState(!1),i=xe(),{showAlert:o}=m.useAlert(),{showToast:a}=m.useToast(),{tags:u}=yh();async function s(c){if(!wR.safeParse(c).success){o({title:"Error",subtitle:`Failed to rename tag "${t.name}" to "${c}". Tag name must be at least ${wq} and at maximum ${$q} characters long.`});return}if(u.some(p=>p.name===c)){o({title:"Error",subtitle:`Failed to rename tag "${t.name}" to "${c}". Tag with name "${c}" already exists.`});return}try{await t$e({id:t.id,name:c,config:i}),bh(p=>p.map(A=>A.id===t.id?{...A,name:c}:A)),Ms(p=>p.map(A=>{if(A.tags.findIndex(v=>v.id===t.id)!==-1){const v=A.tags.map(_=>_.id===t.id?{..._,name:c}:_);return{...A,tags:v}}return A})),a({title:`Tag "${t.name}" renamed to "${c}"`,seconds:3})}catch{o({title:"Error",subtitle:"Something went wrong when renaming the tag."})}}return d.jsxs(d.Fragment,{children:[d.jsxs(m.Box,{justifyContent:"space-between",children:[d.jsx(m.Badge,{title:t.name,color:"purple",size:"medium",onEdit:s}),d.jsx(m.Button,{invisible:!0,color:"tomato",textWeight:"normal",onClick:()=>r(!0),children:"Delete"})]}),d.jsx(Zwe,{open:n,onOpenChange:r,tag:t})]})}function Zwe(e){const{open:t,onOpenChange:n,tag:r}=e,{id:i,name:o,count:a}=r,u=xe(),{showAlert:s}=m.useAlert(),[c,l]=R.useState(!1);async function f(){l(!0);try{await e$e({id:i,config:u}),bh(p=>p.filter(A=>A.id!==i)),Ms(p=>p.map(A=>{if(A.tags.findIndex(v=>v.id===i)!==-1){const v=A.tags.filter(_=>_.id!==i);return{...A,tags:v}}return A}))}catch{s({title:"Error",subtitle:"Something went wrong when removing the tag."})}finally{l(!1),n(!1)}}return d.jsxs(m.Dialog,{onOpenChange:n,open:t,size:"small",children:[d.jsx(m.DialogHeader,{title:`This tag is being used on ${a} media item${a===1?"":"s"}`}),d.jsx(m.DialogContent,{padding:16,children:d.jsxs(m.Text,{children:["You are about to delete the tag name ",d.jsx("b",{children:o}),"."," ",a>0&&`This tag is being
31
+ */var $F;function vTe(){if($F)return md;$F=1;var e=R,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={},p=null,A=null;c!==void 0&&(p=""+c),s.key!==void 0&&(p=""+s.key),s.ref!==void 0&&(A=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:p,ref:A,props:f,_owner:i.current}}return md.Fragment=n,md.jsx=a,md.jsxs=a,md}process.env.NODE_ENV==="production"?Q1.exports=vTe():Q1.exports=gTe();var d=Q1.exports;const yTe="media-library-",EF=`${yTe}newMediaLibraryFeaturesBannerClosed`;function aq(e){const{maxWidth:t}=e,[n,r]=R.useState(()=>!(Fh.localStorage.isAvailable()&&Fh.localStorage.read(EF)));function i(){r(!1),Fh.localStorage.isAvailable()&&Fh.localStorage.write(EF,String(Date.now()))}return n?d.jsx(m.Box,{justifyContent:"center",padding:{inline:16,block:12},backgroundColor:"purple9",children:d.jsxs(m.Box,{maxWidth:t,width:"100%",alignItems:"center",gap:8,children:[d.jsx(m.Box,{borderRadius:"100%",alignItems:"center",justifyContent:"center",width:28,height:28,border:!0,borderColor:"purple8",flexShrink:0,children:d.jsx(m.Icon,{name:"autoFixHigh",color:"white",size:"small"})}),d.jsxs("div",{children:[d.jsx(m.Text,{color:"white",variant:"bold",children:"New features on the Media Library now available!"}),d.jsxs(m.Box,{gap:4,flexWrap:"wrap",children:[d.jsx(m.Text,{color:"white",children:"Media Tagging, Filtering, Improved Search & Bulk Deletion"}),d.jsx(m.Text,{color:"white",variant:"bold",href:"https://prismic.io/lp/new-media-library",target:"_blank",rel:"noopener noreferrer",underline:!0,children:"Find out More →"})]})]}),d.jsx(m.Button,{invisible:!0,color:"white",sx:{marginLeft:"auto",marginBottom:"auto",flexShrink:0},underline:!0,onClick:i,children:"Close"})]})}):null}const uq=R.createContext(void 0),bTe={selectedIds:new Set,excludedIds:new Set,isAllSelected:!1};function sq(e){const{children:t,initialTotalItemCount:n,isSelectAllEnabled:r=!1}=e,[i,o]=R.useState(bTe),a=R.useRef(),u=R.useRef(n||0),s=R.useMemo(()=>{const{selectedIds:C,excludedIds:y,isAllSelected:x}=i;return x?u.current-y.size:C.size},[i]),c=R.useCallback(C=>{const{isAllSelected:y,selectedIds:x,excludedIds:w}=i;return y?!w.has(C):x.has(C)},[i]),l=Xe.useStableCallback(()=>{const{isAllSelected:C,selectedIds:y,excludedIds:x}=i;return{selectedIds:[...y],excludedIds:[...x],isAllSelected:C,selectedCount:s}}),f=Xe.useStableCallback(()=>{r&&o({isAllSelected:!0,selectedIds:new Set,excludedIds:new Set})}),p=Xe.useStableCallback(()=>{o({isAllSelected:!1,selectedIds:new Set,excludedIds:new Set})});R.useEffect(()=>{const{isAllSelected:C,selectedIds:y,excludedIds:x}=i,w=u.current;if(!(w===0||!r)){if(C&&x.size===w){p();return}if(!C&&y.size===w){f();return}}},[i,r,f,p]);const A=Xe.useStableCallback(C=>{const{id:y,isSingleSelection:x,metaKey:w,shiftKey:M,ids:O}=C;return M&&O&&O.length>0&&a.current?v(y,O,a.current):x&&!w?h(y):c(y)?I([y]):S([y]),a.current=y,c(y)});function h(C){c(C)&&s===1?o(y=>({...y,selectedIds:new Set})):o({isAllSelected:!1,selectedIds:new Set([C]),excludedIds:new Set})}function v(C,y,x){const w=CTe(y,x,C),M=c(C);return M?I(w):S(w),M}const _=Xe.useStableCallback(()=>{s>0?p():f()});function S(C){const{isAllSelected:y}=i;if(y){o(x=>({...x,excludedIds:RF(x.excludedIds,C)}));return}o(x=>({...x,selectedIds:OF(x.selectedIds,C)}))}function I(C){const{isAllSelected:y}=i;if(y){o(x=>({...x,excludedIds:OF(x.excludedIds,C)}));return}o(x=>({...x,selectedIds:RF(x.selectedIds,C)}))}function T(C){u.current=C}const g=R.useMemo(()=>({selectedCount:s,state:i,totalItemCount:u.current,isSelected:c,isSelectAllEnabled:r,getSelectionState:l,toggleSelection:A,toggleSelectAll:_,clearSelection:p,setTotalItemCount:T}),[i,p,l,r,c,s,_,A]);return d.jsx(uq.Provider,{value:g,children:t})}function qu(e){const t=R.useContext(uq);if(t===void 0)throw new Error("useSelectionManagerContext must be used within a SelectionManagerProvider");const{totalItemCount:n,onChangeSelection:r}=e||{},{setTotalItemCount:i,totalItemCount:o,state:a,getSelectionState:u,...s}=t;n!==void 0&&n!==o&&i(n);const c=Xe.useStableCallback(r);return R.useEffect(()=>{c==null||c(u())},[u,c,a]),{...s,getSelectionState:u,isAllSelected:a.isAllSelected}}function CTe(e,t,n){const r=e.indexOf(t),i=e.indexOf(n);if(r===-1||i===-1)throw new Error("Both startValue and endValue must be in the array");return r<=i?e.slice(r,i+1):e.slice(i,r+1)}function RF(e,t){const n=new Set(e);return t.forEach(r=>n.delete(r)),n}function OF(e,t){return new Set([...e,...t])}function cq(){return d.jsx(m.Box,{justifyContent:"center",flexDirection:"column",height:"100%",backgroundColor:"grey3",children:d.jsxs(m.BlankSlate,{children:[d.jsx(m.BlankSlateIcon,{name:"close",lineColor:"purple10",backgroundColor:"purple3",borderColor:"purple6",borderStyle:"dashed",size:"xlarge"}),d.jsx(m.BlankSlateTitle,{size:"big",children:'"Oops!"'}),d.jsx(m.BlankSlateDescription,{width:360,children:`"We can't find any items with that name"`})]})})}const Rl={warning:{uploadWhileUploading:{title:"Hang tight!",description:"Your current images are still being uploaded. Once they're all set, you'll be free to upload more."}}},j0=R.createContext(void 0);function Te(){const e=R.useContext(j0);if(!e)throw new Error("Missing EditorConfigContext.Provider");return e}class V1 extends Error{}function Bn(e){throw new V1(`Missing EditorConfig.${e}`)}function STe(){if(new URL(location.href).searchParams.has("debug"))return;const n=console.error.bind(console);console.error=(...r)=>{r[0]instanceof V1||_Te(r)||n(...r)},window.addEventListener("error",r=>{r.error instanceof V1&&r.preventDefault(),ITe(r.error)&&r.preventDefault()})}function _Te(e){const t="Warning: flushSync was called from inside a lifecycle method",n=typeof e[0]=="string"&&e[0].includes(t),r=typeof e[1]=="string"&&e[1].includes("RichTextField");return n&&r}function ITe(e){const t=/Invalid content for node document: <(bulletList|orderedList)\(listItem*/,n=e.message;return!!(typeof n=="string"&&n.match(t))}const TTe="https://prismic.io/docs/guides/manage-images#supported-media";var Ve;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const o={};for(const a of i)o[a]=a;return o},e.getValidEnumValues=i=>{const o=e.objectKeys(i).filter(u=>typeof i[i[u]]!="number"),a={};for(const u of o)a[u]=i[u];return e.objectValues(a)},e.objectValues=i=>e.objectKeys(i).map(function(o){return i[o]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const o=[];for(const a in i)Object.prototype.hasOwnProperty.call(i,a)&&o.push(a);return o},e.find=(i,o)=>{for(const a of i)if(o(a))return a},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}e.joinValues=r,e.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(Ve||(Ve={}));var z1;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(z1||(z1={}));const ee=Ve.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Za=e=>{switch(typeof e){case"undefined":return ee.undefined;case"string":return ee.string;case"number":return isNaN(e)?ee.nan:ee.number;case"boolean":return ee.boolean;case"function":return ee.function;case"bigint":return ee.bigint;case"symbol":return ee.symbol;case"object":return Array.isArray(e)?ee.array:e===null?ee.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ee.promise:typeof Map<"u"&&e instanceof Map?ee.map:typeof Set<"u"&&e instanceof Set?ee.set:typeof Date<"u"&&e instanceof Date?ee.date:ee.object;default:return ee.unknown}},H=Ve.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),xTe=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class _i extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(o){return o.message},r={_errors:[]},i=o=>{for(const a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let u=r,s=0;for(;s<a.path.length;){const c=a.path[s];s===a.path.length-1?(u[c]=u[c]||{_errors:[]},u[c]._errors.push(n(a))):u[c]=u[c]||{_errors:[]},u=u[c],s++}}};return i(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ve.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}_i.create=e=>new _i(e);const Xd=(e,t)=>{let n;switch(e.code){case H.invalid_type:e.received===ee.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case H.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Ve.jsonStringifyReplacer)}`;break;case H.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ve.joinValues(e.keys,", ")}`;break;case H.invalid_union:n="Invalid input";break;case H.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ve.joinValues(e.options)}`;break;case H.invalid_enum_value:n=`Invalid enum value. Expected ${Ve.joinValues(e.options)}, received '${e.received}'`;break;case H.invalid_arguments:n="Invalid function arguments";break;case H.invalid_return_type:n="Invalid function return type";break;case H.invalid_date:n="Invalid date";break;case H.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Ve.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case H.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case H.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case H.custom:n="Invalid input";break;case H.invalid_intersection_types:n="Intersection results could not be merged";break;case H.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case H.not_finite:n="Number must be finite";break;default:n=t.defaultError,Ve.assertNever(e)}return{message:n}};let lq=Xd;function wTe(e){lq=e}function wm(){return lq}const $m=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}},$Te=[];function ne(e,t){const n=$m({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,wm(),Xd].filter(r=>!!r)});e.common.issues.push(n)}class Mn{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 _e;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 Mn.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 _e;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 _e=Object.freeze({status:"aborted"}),fq=e=>({status:"dirty",value:e}),Vn=e=>({status:"valid",value:e}),H1=e=>e.status==="aborted",Y1=e=>e.status==="dirty",Em=e=>e.status==="valid",Rm=e=>typeof Promise<"u"&&e instanceof Promise;var de;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(de||(de={}));class so{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const FF=(e,t)=>{if(Em(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new _i(e.common.issues);return this._error=n,this._error}}};function $e(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(a,u)=>a.code!=="invalid_type"?{message:u.defaultError}:typeof u.data>"u"?{message:r??u.defaultError}:{message:n??u.defaultError},description:i}}class Fe{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return Za(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Za(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Mn,ctx:{common:t.parent.common,data:t.data,parsedType:Za(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(Rm(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:Za(t)},o=this._parseSync({data:t,path:i.path,parent:i});return FF(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:Za(t)},i=this._parse({data:t,path:r.path,parent:r}),o=await(Rm(i)?i:Promise.resolve(i));return FF(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:H.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 Ri({schema:this,typeName:ve.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Jo.create(this,this._def)}nullable(){return Fs.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ii.create(this,this._def)}promise(){return Fl.create(this,this._def)}or(t){return rp.create([this,t],this._def)}and(t){return ip.create(this,t,this._def)}transform(t){return new Ri({...$e(this._def),schema:this,typeName:ve.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new cp({...$e(this._def),innerType:this,defaultValue:n,typeName:ve.ZodDefault})}brand(){return new pq({typeName:ve.ZodBranded,type:this,...$e(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new km({...$e(this._def),innerType:this,catchValue:n,typeName:ve.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return vh.create(this,t)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const ETe=/^c[^\s-]{8,}$/i,RTe=/^[a-z][a-z0-9]*$/,OTe=/[0-9A-HJKMNP-TV-Z]{26}/,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,MTe=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\])|(\[IPv6:(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))\])|([A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])*(\.[A-Za-z]{2,})+))$/,kTe=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u"),LTe=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,jTe=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,UTe=e=>e.precision?e.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):e.precision===0?e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function BTe(e,t){return!!((t==="v4"||!t)&&LTe.test(e)||(t==="v6"||!t)&&jTe.test(e))}class Ci extends Fe{constructor(){super(...arguments),this._regex=(t,n,r)=>this.refinement(i=>t.test(i),{validation:n,code:H.invalid_string,...de.errToObj(r)}),this.nonempty=t=>this.min(1,de.errToObj(t)),this.trim=()=>new Ci({...this._def,checks:[...this._def.checks,{kind:"trim"}]}),this.toLowerCase=()=>new Ci({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]}),this.toUpperCase=()=>new Ci({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ee.string){const o=this._getOrReturnCtx(t);return ne(o,{code:H.invalid_type,expected:ee.string,received:o.parsedType}),_e}const r=new Mn;let i;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(i=this._getOrReturnCtx(t,i),ne(i,{code:H.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")t.data.length>o.value&&(i=this._getOrReturnCtx(t,i),ne(i,{code:H.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const a=t.data.length>o.value,u=t.data.length<o.value;(a||u)&&(i=this._getOrReturnCtx(t,i),a?ne(i,{code:H.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):u&&ne(i,{code:H.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")MTe.test(t.data)||(i=this._getOrReturnCtx(t,i),ne(i,{validation:"email",code:H.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")kTe.test(t.data)||(i=this._getOrReturnCtx(t,i),ne(i,{validation:"emoji",code:H.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")FTe.test(t.data)||(i=this._getOrReturnCtx(t,i),ne(i,{validation:"uuid",code:H.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")ETe.test(t.data)||(i=this._getOrReturnCtx(t,i),ne(i,{validation:"cuid",code:H.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")RTe.test(t.data)||(i=this._getOrReturnCtx(t,i),ne(i,{validation:"cuid2",code:H.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")OTe.test(t.data)||(i=this._getOrReturnCtx(t,i),ne(i,{validation:"ulid",code:H.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),ne(i,{validation:"url",code:H.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),ne(i,{validation:"regex",code:H.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(t,i),ne(i,{code:H.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(i=this._getOrReturnCtx(t,i),ne(i,{code:H.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(i=this._getOrReturnCtx(t,i),ne(i,{code:H.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?UTe(o).test(t.data)||(i=this._getOrReturnCtx(t,i),ne(i,{code:H.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="ip"?BTe(t.data,o.version)||(i=this._getOrReturnCtx(t,i),ne(i,{validation:"ip",code:H.invalid_string,message:o.message}),r.dirty()):Ve.assertNever(o);return{status:r.value,value:t.data}}_addCheck(t){return new Ci({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...de.errToObj(t)})}url(t){return this._addCheck({kind:"url",...de.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...de.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...de.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...de.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...de.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...de.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...de.errToObj(t)})}datetime(t){var n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,...de.errToObj(t==null?void 0:t.message)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...de.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...de.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...de.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...de.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...de.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...de.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...de.errToObj(n)})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Ci.create=e=>{var t;return new Ci({checks:[],typeName:ve.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...$e(e)})};function WTe(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 lu extends Fe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==ee.number){const o=this._getOrReturnCtx(t);return ne(o,{code:H.invalid_type,expected:ee.number,received:o.parsedType}),_e}let r;const i=new Mn;for(const o of this._def.checks)o.kind==="int"?Ve.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),ne(r,{code:H.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),ne(r,{code:H.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),ne(r,{code:H.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?WTe(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),ne(r,{code:H.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),ne(r,{code:H.not_finite,message:o.message}),i.dirty()):Ve.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,de.toString(n))}gt(t,n){return this.setLimit("min",t,!1,de.toString(n))}lte(t,n){return this.setLimit("max",t,!0,de.toString(n))}lt(t,n){return this.setLimit("max",t,!1,de.toString(n))}setLimit(t,n,r,i){return new lu({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:de.toString(i)}]})}_addCheck(t){return new lu({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:de.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:de.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:de.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:de.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:de.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:de.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:de.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:de.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:de.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Ve.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}lu.create=e=>new lu({checks:[],typeName:ve.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...$e(e)});class fu extends Fe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==ee.bigint){const o=this._getOrReturnCtx(t);return ne(o,{code:H.invalid_type,expected:ee.bigint,received:o.parsedType}),_e}let r;const i=new Mn;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),ne(r,{code:H.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),ne(r,{code:H.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),ne(r,{code:H.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):Ve.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,de.toString(n))}gt(t,n){return this.setLimit("min",t,!1,de.toString(n))}lte(t,n){return this.setLimit("max",t,!0,de.toString(n))}lt(t,n){return this.setLimit("max",t,!1,de.toString(n))}setLimit(t,n,r,i){return new fu({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:de.toString(i)}]})}_addCheck(t){return new fu({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:de.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:de.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:de.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:de.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:de.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}}fu.create=e=>{var t;return new fu({checks:[],typeName:ve.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...$e(e)})};class ep extends Fe{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ee.boolean){const r=this._getOrReturnCtx(t);return ne(r,{code:H.invalid_type,expected:ee.boolean,received:r.parsedType}),_e}return Vn(t.data)}}ep.create=e=>new ep({typeName:ve.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...$e(e)});class Rs extends Fe{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ee.date){const o=this._getOrReturnCtx(t);return ne(o,{code:H.invalid_type,expected:ee.date,received:o.parsedType}),_e}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return ne(o,{code:H.invalid_date}),_e}const r=new Mn;let i;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(i=this._getOrReturnCtx(t,i),ne(i,{code:H.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(i=this._getOrReturnCtx(t,i),ne(i,{code:H.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):Ve.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Rs({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:de.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:de.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}}Rs.create=e=>new Rs({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:ve.ZodDate,...$e(e)});class Om extends Fe{_parse(t){if(this._getType(t)!==ee.symbol){const r=this._getOrReturnCtx(t);return ne(r,{code:H.invalid_type,expected:ee.symbol,received:r.parsedType}),_e}return Vn(t.data)}}Om.create=e=>new Om({typeName:ve.ZodSymbol,...$e(e)});class tp extends Fe{_parse(t){if(this._getType(t)!==ee.undefined){const r=this._getOrReturnCtx(t);return ne(r,{code:H.invalid_type,expected:ee.undefined,received:r.parsedType}),_e}return Vn(t.data)}}tp.create=e=>new tp({typeName:ve.ZodUndefined,...$e(e)});class np extends Fe{_parse(t){if(this._getType(t)!==ee.null){const r=this._getOrReturnCtx(t);return ne(r,{code:H.invalid_type,expected:ee.null,received:r.parsedType}),_e}return Vn(t.data)}}np.create=e=>new np({typeName:ve.ZodNull,...$e(e)});class Ol extends Fe{constructor(){super(...arguments),this._any=!0}_parse(t){return Vn(t.data)}}Ol.create=e=>new Ol({typeName:ve.ZodAny,...$e(e)});class ds extends Fe{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Vn(t.data)}}ds.create=e=>new ds({typeName:ve.ZodUnknown,...$e(e)});class na extends Fe{_parse(t){const n=this._getOrReturnCtx(t);return ne(n,{code:H.invalid_type,expected:ee.never,received:n.parsedType}),_e}}na.create=e=>new na({typeName:ve.ZodNever,...$e(e)});class Fm extends Fe{_parse(t){if(this._getType(t)!==ee.undefined){const r=this._getOrReturnCtx(t);return ne(r,{code:H.invalid_type,expected:ee.void,received:r.parsedType}),_e}return Vn(t.data)}}Fm.create=e=>new Fm({typeName:ve.ZodVoid,...$e(e)});class Ii extends Fe{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==ee.array)return ne(n,{code:H.invalid_type,expected:ee.array,received:n.parsedType}),_e;if(i.exactLength!==null){const a=n.data.length>i.exactLength.value,u=n.data.length<i.exactLength.value;(a||u)&&(ne(n,{code:a?H.too_big:H.too_small,minimum:u?i.exactLength.value:void 0,maximum:a?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(ne(n,{code:H.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(ne(n,{code:H.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,u)=>i.type._parseAsync(new so(n,a,n.path,u)))).then(a=>Mn.mergeArray(r,a));const o=[...n.data].map((a,u)=>i.type._parseSync(new so(n,a,n.path,u)));return Mn.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new Ii({...this._def,minLength:{value:t,message:de.toString(n)}})}max(t,n){return new Ii({...this._def,maxLength:{value:t,message:de.toString(n)}})}length(t,n){return new Ii({...this._def,exactLength:{value:t,message:de.toString(n)}})}nonempty(t){return this.min(1,t)}}Ii.create=(e,t)=>new Ii({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ve.ZodArray,...$e(t)});function Xc(e){if(e instanceof Ct){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Jo.create(Xc(r))}return new Ct({...e._def,shape:()=>t})}else return e instanceof Ii?new Ii({...e._def,type:Xc(e.element)}):e instanceof Jo?Jo.create(Xc(e.unwrap())):e instanceof Fs?Fs.create(Xc(e.unwrap())):e instanceof co?co.create(e.items.map(t=>Xc(t))):e}class Ct extends Fe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Ve.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==ee.object){const c=this._getOrReturnCtx(t);return ne(c,{code:H.invalid_type,expected:ee.object,received:c.parsedType}),_e}const{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),u=[];if(!(this._def.catchall instanceof na&&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 so(i,f,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof na){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&&(ne(i,{code:H.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 so(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=>Mn.mergeObjectSync(r,c)):Mn.mergeObjectSync(r,s)}get shape(){return this._def.shape()}strict(t){return de.errToObj,new Ct({...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=de.errToObj(t).message)!==null&&u!==void 0?u:s}:{message:s}}}:{}})}strip(){return new Ct({...this._def,unknownKeys:"strip"})}passthrough(){return new Ct({...this._def,unknownKeys:"passthrough"})}extend(t){return new Ct({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Ct({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:ve.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Ct({...this._def,catchall:t})}pick(t){const n={};return Ve.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new Ct({...this._def,shape:()=>n})}omit(t){const n={};return Ve.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new Ct({...this._def,shape:()=>n})}deepPartial(){return Xc(this)}partial(t){const n={};return Ve.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new Ct({...this._def,shape:()=>n})}required(t){const n={};return Ve.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof Jo;)o=o._def.innerType;n[r]=o}}),new Ct({...this._def,shape:()=>n})}keyof(){return dq(Ve.objectKeys(this.shape))}}Ct.create=(e,t)=>new Ct({shape:()=>e,unknownKeys:"strip",catchall:na.create(),typeName:ve.ZodObject,...$e(t)});Ct.strictCreate=(e,t)=>new Ct({shape:()=>e,unknownKeys:"strict",catchall:na.create(),typeName:ve.ZodObject,...$e(t)});Ct.lazycreate=(e,t)=>new Ct({shape:e,unknownKeys:"strip",catchall:na.create(),typeName:ve.ZodObject,...$e(t)});class rp extends Fe{_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 _i(u.ctx.common.issues));return ne(n,{code:H.invalid_union,unionErrors:a}),_e}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 _i(s));return ne(n,{code:H.invalid_union,unionErrors:u}),_e}}get options(){return this._def.options}}rp.create=(e,t)=>new rp({options:e,typeName:ve.ZodUnion,...$e(t)});const Zh=e=>e instanceof ap?Zh(e.schema):e instanceof Ri?Zh(e.innerType()):e instanceof up?[e.value]:e instanceof du?e.options:e instanceof sp?Object.keys(e.enum):e instanceof cp?Zh(e._def.innerType):e instanceof tp?[void 0]:e instanceof np?[null]:null;class U0 extends Fe{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ee.object)return ne(n,{code:H.invalid_type,expected:ee.object,received:n.parsedType}),_e;const r=this.discriminator,i=n.data[r],o=this.optionsMap.get(i);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(ne(n,{code:H.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),_e)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const i=new Map;for(const o of n){const a=Zh(o.shape[t]);if(!a)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const u of a){if(i.has(u))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(u)}`);i.set(u,o)}}return new U0({typeName:ve.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...$e(r)})}}function G1(e,t){const n=Za(e),r=Za(t);if(e===t)return{valid:!0,data:e};if(n===ee.object&&r===ee.object){const i=Ve.objectKeys(t),o=Ve.objectKeys(e).filter(u=>i.indexOf(u)!==-1),a={...e,...t};for(const u of o){const s=G1(e[u],t[u]);if(!s.valid)return{valid:!1};a[u]=s.data}return{valid:!0,data:a}}else if(n===ee.array&&r===ee.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=G1(a,u);if(!s.valid)return{valid:!1};i.push(s.data)}return{valid:!0,data:i}}else return n===ee.date&&r===ee.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class ip extends Fe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=(o,a)=>{if(H1(o)||H1(a))return _e;const u=G1(o.value,a.value);return u.valid?((Y1(o)||Y1(a))&&n.dirty(),{status:n.value,value:u.data}):(ne(r,{code:H.invalid_intersection_types}),_e)};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}))}}ip.create=(e,t,n)=>new ip({left:e,right:t,typeName:ve.ZodIntersection,...$e(n)});class co extends Fe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ee.array)return ne(r,{code:H.invalid_type,expected:ee.array,received:r.parsedType}),_e;if(r.data.length<this._def.items.length)return ne(r,{code:H.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),_e;!this._def.rest&&r.data.length>this._def.items.length&&(ne(r,{code:H.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((a,u)=>{const s=this._def.items[u]||this._def.rest;return s?s._parse(new so(r,a,r.path,u)):null}).filter(a=>!!a);return r.common.async?Promise.all(o).then(a=>Mn.mergeArray(n,a)):Mn.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new co({...this._def,rest:t})}}co.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new co({items:e,typeName:ve.ZodTuple,rest:null,...$e(t)})};class op extends Fe{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!==ee.object)return ne(r,{code:H.invalid_type,expected:ee.object,received:r.parsedType}),_e;const i=[],o=this._def.keyType,a=this._def.valueType;for(const u in r.data)i.push({key:o._parse(new so(r,u,r.path,u)),value:a._parse(new so(r,r.data[u],r.path,u))});return r.common.async?Mn.mergeObjectAsync(n,i):Mn.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Fe?new op({keyType:t,valueType:n,typeName:ve.ZodRecord,...$e(r)}):new op({keyType:Ci.create(),valueType:t,typeName:ve.ZodRecord,...$e(n)})}}class Mm extends Fe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ee.map)return ne(r,{code:H.invalid_type,expected:ee.map,received:r.parsedType}),_e;const i=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([u,s],c)=>({key:i._parse(new so(r,u,r.path,[c,"key"])),value:o._parse(new so(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 _e;(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 _e;(c.status==="dirty"||l.status==="dirty")&&n.dirty(),u.set(c.value,l.value)}return{status:n.value,value:u}}}}Mm.create=(e,t,n)=>new Mm({valueType:t,keyType:e,typeName:ve.ZodMap,...$e(n)});class Os extends Fe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ee.set)return ne(r,{code:H.invalid_type,expected:ee.set,received:r.parsedType}),_e;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(ne(r,{code:H.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(ne(r,{code:H.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const o=this._def.valueType;function a(s){const c=new Set;for(const l of s){if(l.status==="aborted")return _e;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 so(r,s,r.path,c)));return r.common.async?Promise.all(u).then(s=>a(s)):a(u)}min(t,n){return new Os({...this._def,minSize:{value:t,message:de.toString(n)}})}max(t,n){return new Os({...this._def,maxSize:{value:t,message:de.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}Os.create=(e,t)=>new Os({valueType:e,minSize:null,maxSize:null,typeName:ve.ZodSet,...$e(t)});class ll extends Fe{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ee.function)return ne(n,{code:H.invalid_type,expected:ee.function,received:n.parsedType}),_e;function r(u,s){return $m({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,wm(),Xd].filter(c=>!!c),issueData:{code:H.invalid_arguments,argumentsError:s}})}function i(u,s){return $m({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,wm(),Xd].filter(c=>!!c),issueData:{code:H.invalid_return_type,returnTypeError:s}})}const o={errorMap:n.common.contextualErrorMap},a=n.data;return this._def.returns instanceof Fl?Vn(async(...u)=>{const s=new _i([]),c=await this._def.args.parseAsync(u,o).catch(p=>{throw s.addIssue(r(u,p)),s}),l=await a(...c);return await this._def.returns._def.type.parseAsync(l,o).catch(p=>{throw s.addIssue(i(l,p)),s})}):Vn((...u)=>{const s=this._def.args.safeParse(u,o);if(!s.success)throw new _i([r(u,s.error)]);const c=a(...s.data),l=this._def.returns.safeParse(c,o);if(!l.success)throw new _i([i(c,l.error)]);return l.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new ll({...this._def,args:co.create(t).rest(ds.create())})}returns(t){return new ll({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new ll({args:t||co.create([]).rest(ds.create()),returns:n||ds.create(),typeName:ve.ZodFunction,...$e(r)})}}class ap extends Fe{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})}}ap.create=(e,t)=>new ap({getter:e,typeName:ve.ZodLazy,...$e(t)});class up extends Fe{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return ne(n,{received:n.data,code:H.invalid_literal,expected:this._def.value}),_e}return{status:"valid",value:t.data}}get value(){return this._def.value}}up.create=(e,t)=>new up({value:e,typeName:ve.ZodLiteral,...$e(t)});function dq(e,t){return new du({values:e,typeName:ve.ZodEnum,...$e(t)})}class du extends Fe{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return ne(n,{expected:Ve.joinValues(r),received:n.parsedType,code:H.invalid_type}),_e}if(this._def.values.indexOf(t.data)===-1){const n=this._getOrReturnCtx(t),r=this._def.values;return ne(n,{received:n.data,code:H.invalid_enum_value,options:r}),_e}return Vn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t){return du.create(t)}exclude(t){return du.create(this.options.filter(n=>!t.includes(n)))}}du.create=dq;class sp extends Fe{_parse(t){const n=Ve.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==ee.string&&r.parsedType!==ee.number){const i=Ve.objectValues(n);return ne(r,{expected:Ve.joinValues(i),received:r.parsedType,code:H.invalid_type}),_e}if(n.indexOf(t.data)===-1){const i=Ve.objectValues(n);return ne(r,{received:r.data,code:H.invalid_enum_value,options:i}),_e}return Vn(t.data)}get enum(){return this._def.values}}sp.create=(e,t)=>new sp({values:e,typeName:ve.ZodNativeEnum,...$e(t)});class Fl extends Fe{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ee.promise&&n.common.async===!1)return ne(n,{code:H.invalid_type,expected:ee.promise,received:n.parsedType}),_e;const r=n.parsedType===ee.promise?n.data:Promise.resolve(n.data);return Vn(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Fl.create=(e,t)=>new Fl({type:e,typeName:ve.ZodPromise,...$e(t)});class Ri extends Fe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ve.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null;if(i.type==="preprocess"){const a=i.transform(r.data);return r.common.async?Promise.resolve(a).then(u=>this._def.schema._parseAsync({data:u,path:r.path,parent:r})):this._def.schema._parseSync({data:a,path:r.path,parent:r})}const o={addIssue:a=>{ne(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"?_e:(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"?_e:(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(!Em(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=>Em(a)?Promise.resolve(i.transform(a.value,o)).then(u=>({status:n.value,value:u})):a);Ve.assertNever(i)}}Ri.create=(e,t,n)=>new Ri({schema:e,typeName:ve.ZodEffects,effect:t,...$e(n)});Ri.createWithPreprocess=(e,t,n)=>new Ri({schema:t,effect:{type:"preprocess",transform:e},typeName:ve.ZodEffects,...$e(n)});class Jo extends Fe{_parse(t){return this._getType(t)===ee.undefined?Vn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Jo.create=(e,t)=>new Jo({innerType:e,typeName:ve.ZodOptional,...$e(t)});class Fs extends Fe{_parse(t){return this._getType(t)===ee.null?Vn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Fs.create=(e,t)=>new Fs({innerType:e,typeName:ve.ZodNullable,...$e(t)});class cp extends Fe{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===ee.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}cp.create=(e,t)=>new cp({innerType:e,typeName:ve.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...$e(t)});class km extends Fe{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Rm(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new _i(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new _i(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}km.create=(e,t)=>new km({innerType:e,typeName:ve.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...$e(t)});class Lm extends Fe{_parse(t){if(this._getType(t)!==ee.nan){const r=this._getOrReturnCtx(t);return ne(r,{code:H.invalid_type,expected:ee.nan,received:r.parsedType}),_e}return{status:"valid",value:t.data}}}Lm.create=e=>new Lm({typeName:ve.ZodNaN,...$e(e)});const KTe=Symbol("zod_brand");class pq extends Fe{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class vh extends Fe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?_e:o.status==="dirty"?(n.dirty(),fq(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?_e:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new vh({in:t,out:n,typeName:ve.ZodPipeline})}}const Aq=(e,t={},n)=>e?Ol.create().superRefine((r,i)=>{var o,a;if(!e(r)){const u=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,s=(a=(o=u.fatal)!==null&&o!==void 0?o:n)!==null&&a!==void 0?a:!0,c=typeof u=="string"?{message:u}:u;i.addIssue({code:"custom",...c,fatal:s})}}):Ol.create(),PTe={object:Ct.lazycreate};var ve;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline"})(ve||(ve={}));const DTe=(e,t={message:`Input not instance of ${e.name}`})=>Aq(n=>n instanceof e,t),zo=Ci.create,jm=lu.create,NTe=Lm.create,qTe=fu.create,hq=ep.create,QTe=Rs.create,VTe=Om.create,zTe=tp.create,HTe=np.create,YTe=Ol.create,GTe=ds.create,JTe=na.create,ZTe=Fm.create,mq=Ii.create,lp=Ct.create,XTe=Ct.strictCreate,exe=rp.create,txe=U0.create,nxe=ip.create,rxe=co.create,ixe=op.create,oxe=Mm.create,axe=Os.create,uxe=ll.create,sxe=ap.create,cxe=up.create,lxe=du.create,fxe=sp.create,dxe=Fl.create,MF=Ri.create,pxe=Jo.create,Axe=Fs.create,hxe=Ri.createWithPreprocess,mxe=vh.create,gxe=()=>zo().optional(),vxe=()=>jm().optional(),yxe=()=>hq().optional(),bxe={string:e=>Ci.create({...e,coerce:!0}),number:e=>lu.create({...e,coerce:!0}),boolean:e=>ep.create({...e,coerce:!0}),bigint:e=>fu.create({...e,coerce:!0}),date:e=>Rs.create({...e,coerce:!0})},Cxe=_e;var B=Object.freeze({__proto__:null,defaultErrorMap:Xd,setErrorMap:wTe,getErrorMap:wm,makeIssue:$m,EMPTY_PATH:$Te,addIssueToContext:ne,ParseStatus:Mn,INVALID:_e,DIRTY:fq,OK:Vn,isAborted:H1,isDirty:Y1,isValid:Em,isAsync:Rm,get util(){return Ve},get objectUtil(){return z1},ZodParsedType:ee,getParsedType:Za,ZodType:Fe,ZodString:Ci,ZodNumber:lu,ZodBigInt:fu,ZodBoolean:ep,ZodDate:Rs,ZodSymbol:Om,ZodUndefined:tp,ZodNull:np,ZodAny:Ol,ZodUnknown:ds,ZodNever:na,ZodVoid:Fm,ZodArray:Ii,ZodObject:Ct,ZodUnion:rp,ZodDiscriminatedUnion:U0,ZodIntersection:ip,ZodTuple:co,ZodRecord:op,ZodMap:Mm,ZodSet:Os,ZodFunction:ll,ZodLazy:ap,ZodLiteral:up,ZodEnum:du,ZodNativeEnum:sp,ZodPromise:Fl,ZodEffects:Ri,ZodTransformer:Ri,ZodOptional:Jo,ZodNullable:Fs,ZodDefault:cp,ZodCatch:km,ZodNaN:Lm,BRAND:KTe,ZodBranded:pq,ZodPipeline:vh,custom:Aq,Schema:Fe,ZodSchema:Fe,late:PTe,get ZodFirstPartyTypeKind(){return ve},coerce:bxe,any:YTe,array:mq,bigint:qTe,boolean:hq,date:QTe,discriminatedUnion:txe,effect:MF,enum:lxe,function:uxe,instanceof:DTe,intersection:nxe,lazy:sxe,literal:cxe,map:oxe,nan:NTe,nativeEnum:fxe,never:JTe,null:HTe,nullable:Axe,number:jm,object:lp,oboolean:yxe,onumber:vxe,optional:pxe,ostring:gxe,pipeline:mxe,preprocess:hxe,promise:dxe,record:ixe,set:axe,strictObject:XTe,string:zo,symbol:VTe,transformer:MF,tuple:rxe,undefined:zTe,union:exe,unknown:GTe,void:ZTe,NEVER:Cxe,ZodIssueCode:H,quotelessJson:xTe,ZodError:_i});const Sxe=B.object({id:B.string(),label:B.string(),repeatable:B.boolean(),status:B.boolean()}),_xe=B.array(Sxe);function gq(e,t,n){return we.request(new URL("customtypes",e),{headers:{repository:t},credentials:we.getRequestCredentials(n),okType:_xe})}const Ixe=B.object({first_name:B.string().optional(),last_name:B.string().optional(),email:B.string().optional()}),IR=B.object({id:B.string(),name:B.string(),is_master:B.boolean().optional()}),Txe=B.discriminatedUnion("status",[B.object({status:B.literal("unclassified")}),B.object({status:B.literal("published")}),B.object({status:B.literal("release"),release_id:B.string()}),B.object({status:B.literal("archived")})]).and(B.object({version_id:B.string(),tags:B.array(B.string()),custom_type_label:B.string(),preview_summary:B.string().optional(),preview_image:B.string().optional(),last_modified_date:B.coerce.date(),author:Ixe,uid:B.string().optional()})),TR=B.object({id:B.string(),title:B.string().nullish().transform(e=>e??"Untitled"),custom_type_id:B.string(),group_lang_id:B.string(),language:IR,versions:B.array(Txe)}),xxe=B.object({total:B.number(),cursor:B.string().optional(),results:B.array(TR)}),wxe=B.object({id:B.string(),title:B.string(),repository_id:B.string(),tags:B.array(B.string()).optional()}).passthrough(),$xe=B.object({results:B.array(wxe)});function B0(e,t,n,r,i){const o=new URL("documents",e);return r&&o.searchParams.set("limit",r.toString()),i&&o.searchParams.set("cursor",i),o.search+=`&${n}`,we.request(o,{credentials:we.getRequestCredentials(t),okType:xxe})}function vq(e,t,n,r){const i=new URL(e);return i.search=n,we.request(i,{credentials:we.getRequestCredentials(t),okType:$xe,...r})}function yq(e){const{repository:t,searchTerm:n,tags:r,localeId:i,customTypesIds:o}=e,a=new URLSearchParams;return a.append("repository",t),n&&a.append("searchTerm",n),r!=null&&r.length&&a.append("tags",r.toString()),i&&a.append("localeId",i),o!=null&&o.length&&a.append("customTypesIds",o.toString()),a.toString()}function xR(e){return e.reduce((t,n)=>{if(n.values.every(i=>i===""))return t;const r=n.values.map(i=>[n.name,i]);return t.concat(r)},[])}function bq(e,t,n){return we.request(new URL(`documents/${n}`,e),{credentials:we.getRequestCredentials(t),okType:TR})}function Cq(e,t,n){const r=W0({document_id:n});return B0(e,t,r,n.length)}const Exe=B.custom().transform((e,t)=>{const n=Ue.Document.decode(e);return n._tag==="Left"?(t.addIssue({code:B.ZodIssueCode.custom,message:"Invalid document."}),B.NEVER):n.right});function W0(e){const t=Pl.keys(e).flatMap(r=>{const i=e[r];return i?{name:r,values:i}:[]});return new URLSearchParams(xR(t)).toString()}const Rxe=B.object({id:B.string(),firstname:B.string().optional(),lastname:B.string().optional(),email:B.string()}),Oxe=B.array(Rxe),Fxe=B.object({slicemachineEnabled:B.boolean()}),Sq=["next","nuxt","sveltekit"];function Mxe(e){return Sq.includes(e)}const kxe=B.preprocess(e=>typeof e=="string"&&Mxe(e)?e:"other",B.enum([...Sq,"other"])),Lxe=B.object({simulator_url:B.string().url().nullish(),languages:B.array(IR).transform(e=>gn.sort(e,t=>t.name)),authors:Oxe.optional().default([]),quotas:Fxe.optional().default({slicemachineEnabled:!1}),framework:kxe.optional().default("other")}).transform(({simulator_url:e,framework:t,...n})=>{const r=e&&Iq(e)?e:void 0;return{...n,simulatorUrl:r,isSupportedFramework:t!=="other"}});function _q(e,t){return we.request(new URL("repository",e),{credentials:we.getRequestCredentials(t),okType:Lxe})}function Iq(e){const t=$r.toURL(e);return t?t.pathname.endsWith("/slice-simulator"):!1}const jxe=B.object({results:B.array(B.string())});function Tq(e,t){return we.request(new URL("repository/tags",e),{credentials:we.getRequestCredentials(t),okType:jxe})}function yh(){const e=Te();e.mediaLibrary||Bn("mediaLibrary");const{assetsApiBaseUrl:t,authStrategy:n,repository:r}=e,{items:i}=nt.useRequest(xq,[t,r,n]);return{tags:i}}function xq(e,t,n){return we.request(new URL("tags",e),{credentials:we.getRequestCredentials(n),okType:Uxe,headers:{repository:t}})}const wq=3,$q=20,wR=B.string().min(wq).max($q),$R=B.object({id:B.string(),name:wR,uploader_id:B.string().optional(),created_at:B.number(),last_modified:B.number(),count:B.number().optional().default(0)}),Uxe=B.object({items:B.array($R)});function bh(e){nt.updateFetcherData(xq,t=>{const{items:n}=t,r=e(n);if(r)return{items:r}})}function Bxe(e){const{assetType:t,keyword:n,mode:r,tagIds:i}=e,o=Te();o.mediaLibrary||Bn("mediaLibrary");const{useOpenSearch:a,onAnalyticsEvent:u}=o,s=nt.useFetcherData(Yi),c=s[s.length-1],l=R.useRef(c);l.current=c,R.useEffect(()=>{if(!u||!n||!l.current||l.current.keyword!==n)return;const f=a&&n?"1":"0",p=String(n.split(" ").length),A=String(l.current.total),h=i.join(",");u("Media Library Search",{searchQuery:n,numberOfWords:p,numberOfResults:A,timeToGetResults:l.current.time,useOpenSearch:f,assetType:t,mode:r,tags:h})},[n,a,t,r,u,i])}function Wxe(e){const{assetType:t,mediaDialogOpen:n}=e,r=Te(),i=nt.useFetcherData(Yi),o=R.useRef(0);R.useEffect(()=>{n&&(o.current=performance.now())},[n]);function a(u){if(!r.onAnalyticsEvent||!r.mediaLibrary)return;const s=i[i.length-1];if(!s)return;const{keyword:c,tags:l}=s,f=Oq(i,t,c,l),p=r.useOpenSearch&&c?"1":"0",A=String(c.split(" ").length),h=String(s.total),v=f.findIndex(T=>T.id===u),_=String(v+1),S=[u].join(","),I=(performance.now()-o.current).toFixed(0);r.onAnalyticsEvent("Media Added To Page",{useOpenSearch:p,assetType:t,searchQuery:c,numberOfWords:A,numberOfResults:h,searchPosition:_,mediaIds:S,timeToAddMediaToPage:I,tags:l})}return a}const Wh=B.array(B.string()).optional().transform(e=>e==null?void 0:e[0]),K0=B.object({id:B.string(),kind:B.string(),extension:B.string().optional(),filename:B.string(),width:B.number().optional(),height:B.number().optional(),last_modified:B.number(),url:B.string(),alt:B.string().optional(),size:B.number(),notes:B.string().optional(),credits:B.string().optional(),search_highlight:B.object({filename:Wh,alt:Wh,notes:Wh,credits:Wh}).optional(),tags:B.array($R)}),Eq={"X-Prismic-Source":"Wroom"},Kxe=B.object({total:B.number(),cursor:B.string().optional(),items:B.array(K0)}),Rq=30;function Yi(e,t,n,r,i,o,a,u,s){const c=e?new URL("assets",e):void 0,l=new URLSearchParams(xR([{name:"limit",values:[`${Rq}`]},{name:"cursor",values:[s??""]},{name:"keyword",values:[i]},{name:"tags",values:o.split(",")},{name:"assetType",values:[r]},{name:"opensearch",values:a?["true"]:[]}])).toString(),f=Kxe.transform(A=>({...A,assetType:r,keyword:i,page:u,tags:o})),p=performance.now();return we.request(`${(c==null?void 0:c.href)??""}?${l}`,{headers:{repository:t,...Eq},credentials:we.getRequestCredentials(n),okType:f}).then(A=>({...A,time:(performance.now()-p).toFixed(0)}))}nt.cache.registerFetcherConfig(Yi,{revalidationStrategy:{type:"never"}});function Pxe(e){const{assetType:t="all",mode:n}=e,r=Te(),[i,o]=R.useState({keyword:"",page:0,tagIds:[]});r.mediaLibrary||Bn("mediaLibrary");const{assetsApiBaseUrl:a,authStrategy:u,repository:s,useOpenSearch:c}=r,{keyword:l,page:f,cursor:p,tagIds:A}=i,h=nt.useRequest(Yi,ER({assetsApiBaseUrl:a,authStrategy:u,repository:s,assetType:t,keyword:l,tagIds:A,useOpenSearch:c&&!!l,page:f,cursor:p}));Bxe({assetType:t,keyword:l,tagIds:A,mode:n});const v=Qxe(t,l,A),_=h.total!==v.length;function S(){h.cursor!==void 0&&o(C=>({...C,page:C.page+1,cursor:h.cursor}))}function I(C){o(y=>({...y,page:0,cursor:void 0})),Ms((y,x)=>{if(x.page===0)return[...C,...y]})}function T(C){o(y=>({...y,keyword:C,page:0,cursor:void 0}))}function g(C){o(y=>({...y,tagIds:C,page:0,cursor:void 0}))}return{keyword:l,setKeyword:T,tagIds:A,setTagIds:g,media:v,mediaTotal:h.total,limit:Rq,hasNextPage:_,fetchNextPage:S,updateMedia:Dxe,unshiftMedia:I,deleteMedia:Nxe,deleteSearchData:qxe,revalidateFirstPage:Fq}}function Dxe(e){Ms(t=>t.flatMap(n=>{const r=e.find(i=>i.id===n.id);return r?r.response===void 0?[]:{...n,...r.response}:n}))}function Nxe(e){Ms(t=>t.filter(n=>!e.includes(n.id)))}function qxe(e){const{keyword:t,tagIds:n}=e,r=n==null?void 0:n.join(",");nt.updateFetcherData(Yi,i=>{if(!(t&&i.keyword===t)&&!(r&&i.tags===r))return i})}function Oq(e,t,n,r){const i=e.filter(u=>u.assetType===t&&u.keyword===n&&u.tags===r),a=gn.sort(i,u=>u.page).flatMap(u=>u.items);return n?gn.uniqBy(a,u=>u.id):a}function Qxe(e,t,n){const r=nt.useFetcherData(Yi);return Oq(r,e,t,n.join(","))}function Ms(e){nt.updateFetcherData(Yi,t=>{const{items:n,total:r}=t,i=e(n,t);if(i)return{...t,total:r+(i.length-n.length),items:i}})}function Fq(e){const{config:t,assetType:n}=e;if(!t.mediaLibrary)throw new Error("media library is not configured");const{assetsApiBaseUrl:r,authStrategy:i,repository:o}=t;nt.revalidateData(Yi,ER({assetsApiBaseUrl:r,repository:o,authStrategy:i,assetType:n,keyword:"",tagIds:[],useOpenSearch:!1,page:0}))}function Mq(e){const{config:t,assetType:n}=e;if(!t.mediaLibrary)throw new Error("media library is not configured");nt.updateFetcherData(Yi,r=>r.page===0?r:void 0),Fq({config:t,assetType:n})}function ER(e){return[e.assetsApiBaseUrl,e.repository,e.authStrategy,e.assetType,e.keyword,e.tagIds.join(","),e.useOpenSearch,e.page,e.cursor]}function Vxe(e){const{revalidate:t,config:n,assetType:r}=e,{assetsApiBaseUrl:i=void 0,repository:o="",authStrategy:a="token"}=n.mediaLibrary?n:{},[u,s]=R.useState(!1),[c,l]=R.useState(!1);nt.useCacheRevalidation({fetcher:Yi,requestParams:ER({assetsApiBaseUrl:i,repository:o,authStrategy:a,assetType:r,keyword:"",tagIds:[],useOpenSearch:!1,page:0}),validator:(p,A)=>{var _,S,I,T;const h=((_=p.items[0])==null?void 0:_.id)??"",v=((I=(S=A[0])==null?void 0:S.items[0])==null?void 0:I.id)??"";return h!==v||p.total!==((T=A[0])==null?void 0:T.total)},onCacheInvalidated:()=>l(!0),every:6e4}),R.useEffect(()=>{u&&(l(!1),s(!1))},[u]);function f(){s(!0),t()}return{isMediaRevalidationInProgress:u,isMediaCacheInvalid:c,revalidateMedia:f}}let Kh;const zxe=new Uint8Array(16);function Hxe(){if(!Kh&&(Kh=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Kh))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Kh(zxe)}const ln=[];for(let e=0;e<256;++e)ln.push((e+256).toString(16).slice(1));function Yxe(e,t=0){return ln[e[t+0]]+ln[e[t+1]]+ln[e[t+2]]+ln[e[t+3]]+"-"+ln[e[t+4]]+ln[e[t+5]]+"-"+ln[e[t+6]]+ln[e[t+7]]+"-"+ln[e[t+8]]+ln[e[t+9]]+"-"+ln[e[t+10]]+ln[e[t+11]]+ln[e[t+12]]+ln[e[t+13]]+ln[e[t+14]]+ln[e[t+15]]}const Gxe=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),kF={randomUUID:Gxe};function Jxe(e,t,n){if(kF.randomUUID&&!t&&!e)return kF.randomUUID();e=e||{};const r=e.random||(e.rng||Hxe)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let i=0;i<16;++i)t[n+i]=r[i];return t}return Yxe(r)}function Zxe(e){const{onBeforeUpload:t,onComplete:n}=e,[r,i]=R.useState([]),o=r.some(l=>l.status==="idle"||l.status==="uploading"),a=Te();function u(){if(!r.length||r.some(A=>A.status==="uploading")||r.every(A=>A.status==="error"))return;const l=r.find(A=>A.status==="idle");if(!l)return;let f=r;function p(A){f=A(f),i(f),f.every(v=>v.status==="success"||v.status==="error")&&setTimeout(()=>{i([]),n==null||n(f)},1500)}p(A=>A.map(h=>h.id===l.id?{...h,status:"uploading"}:h)),Xxe({file:l.file,config:a}).then(A=>{p(h=>h.map(v=>v.id===l.id?{...v,status:"success",response:A}:v))}).catch(()=>{p(A=>A.map(h=>h.id===l.id?{...h,status:"error"}:h))})}function s(l){const f=l.map(p=>({id:`temp-${Jxe()}`,file:p,status:"idle"}));i(f),t(f)}const c=R.useCallback(l=>{const f=[{...l,status:"idle"},...r.filter(p=>p.id!==l.id)];i(f),t(f)},[t,r]);return R.useEffect(u,[a,r,n]),{isUploading:o,uploadingFiles:r,onFilesSelected:s,onRetry:c}}function Xxe(e){const{file:t,config:n}=e;if(!n.mediaLibrary)throw new Error("Media Library not configured.");const{assetsApiBaseUrl:r,repository:i,authStrategy:o}=n,a=new FormData;return a.append(t.name,t),we.request(new URL("assets",r),{headers:{repository:i,"Content-Type":"multipart/form-data",...Eq},method:"POST",body:a,credentials:we.getRequestCredentials(o),okType:K0})}const kq=R.createContext(void 0);function ewe(e){const{children:t,assetType:n="all",onSelectedChange:r,actionContainerRef:i}=e,o=r?"select":"browse",[a,u]=R.useTransition(),[s,c]=R.useTransition(),l=Te(),{showAlert:f}=m.useAlert(),{keyword:p,setKeyword:A,tagIds:h,setTagIds:v,media:_,fetchNextPage:S,hasNextPage:I,updateMedia:T,unshiftMedia:g,deleteMedia:C,mediaTotal:y,deleteSearchData:x,revalidateFirstPage:w}=Pxe({assetType:n,mode:o}),[M,O]=R.useState();function F(Oe){Oe&&x({keyword:Oe}),c(()=>{A(Oe),D.clearSelection()})}function K(){A(""),Mq({config:l,assetType:n})}function N(Oe){Oe.length&&x({tagIds:Oe}),c(()=>{v(Oe),D.clearSelection()})}const{isMediaRevalidationInProgress:J,isMediaCacheInvalid:Z,revalidateMedia:ae}=Vxe({assetType:n,config:l,revalidate:K}),{isUploading:ge,onFilesSelected:se,uploadingFiles:k,onRetry:E}=Zxe({onBeforeUpload:Oe=>{A("");const mt=Oe.filter(Tt=>Tt.status==="idle").map(Tt=>({id:Tt.id,url:URL.createObjectURL(Tt.file),filename:Tt.file.name,size:Tt.file.size,extension:Tt.file.type,kind:Tt.file.type,last_modified:Tt.file.lastModified,tags:[]}));g(mt);const[lt]=mt??[];lt&&D.toggleSelection({id:lt.id,isSingleSelection:!0})},onComplete:Oe=>{const mt=Oe.flatMap(sn=>sn.status==="success"?sn:(rt(sn),{id:sn.id,response:void 0}));T(mt),w({config:l,assetType:n});const lt=mt[0];!lt||!lt.response||!D.isSelected(lt.id)||D.toggleSelection({id:lt.response.id,isSingleSelection:!0})}}),D=qu({totalItemCount:y,onChangeSelection:({selectedIds:Oe,selectedCount:mt})=>{if(Yt(!1),!!r){if(mt===1){const[lt]=[...Oe];if(k.some(sn=>sn.id===lt&&sn.status!=="success")){r(new Set);return}}r(new Set(Oe))}}});function ue(Oe){ge||se(Oe)}function ke(){I&&u(S)}function Se(Oe,mt){T([{id:Oe,response:mt}])}function rt(Oe){const mt=Ip.overflow(Oe.file.name,30);f({id:Oe.id,title:`The specified file "${mt}" could not be uploaded.`,subtitle:d.jsxs(m.Text,{color:"inherit",children:["Read more about our"," ",d.jsx(m.Text,{color:"tomato11",href:TTe,underline:!0,children:"supported media"}),"."]}),buttons:{action:{text:"Retry upload",icon:"cloudUpload",onClick:()=>E(Oe)}}})}const[bt,Yt]=R.useState(!1);return d.jsx(kq.Provider,{value:{isFetchingMedia:a,media:_,mediaTotal:y,onScrollToBottom:ke,actionContainerRef:i,onFilesUpload:ue,isUploading:ge,uploadingFiles:k,isMediaRevalidationInProgress:J,isMediaCacheInvalid:Z,revalidateMedia:ae,deleteMedia:C,updateMedia:Se,keyword:p,onKeywordChange:F,isSearchingMedia:s,assetType:n,tagManagerOpen:bt,setTagManagerOpen:Yt,tagIds:h,onTagIdsChange:N,openMediaSection:M,setOpenMediaSection:O},children:t})}function Et(){const e=R.useContext(kq);if(!e)throw new Error("useMediaLibrary must be used within a MediaLibraryProvider");return e}function twe(){const{actionContainerRef:e,isUploading:t,onFilesUpload:n,assetType:r}=Et(),i=e==null?void 0:e.current;return d.jsx(Lq,{actionContainerRef:e,children:d.jsxs(m.Box,{width:"100%",gap:16,children:[d.jsx(nwe,{}),d.jsx(m.Tooltip,{title:Rl.warning.uploadWhileUploading.title,content:Rl.warning.uploadWhileUploading.description,visible:t,stableMount:!0,children:d.jsx(m.FileUploadButton,{disabled:t,onFilesSelected:n,startIcon:"cloudUpload",color:i?"purple":"grey",size:"large",assetType:r,children:"Upload media"})})]})})}function nwe(){const{keyword:e,onKeywordChange:t,isFetchingMedia:n}=Et(),[r,i]=R.useState(e);return Xe.useOnChange(e,()=>{e===""&&i("")}),Xe.useDebounce(r,300,Xe.useStableCallback(o=>t(o))),d.jsx(m.Box,{width:"100%",flexDirection:"column",children:d.jsx(m.FormSearchInput,{value:r,placeholder:"Search",onValueChange:i,maxLength:200,isLoading:n&&e!==r})})}function Lq(e){const{children:t,actionContainerRef:n}=e,r=n==null?void 0:n.current,i=r?m.Portal:R.Fragment,o=r?{container:n.current,asChild:!0}:{};return d.jsx(i,{...o,children:t})}function rwe(e){const{children:t}=e,{onFilesUpload:n,assetType:r}=Et();return d.jsx(m.FileDropZone,{overlay:d.jsx(iwe,{}),onFilesSelected:n,assetType:r,children:t})}function iwe(){const{isUploading:e}=Et(),t=e?Rl.warning.uploadWhileUploading.title:"Drop files here",n=e?Rl.warning.uploadWhileUploading.description:"Drop your files to upload them instantly to the media library.";return d.jsx(m.Box,{justifyContent:"center",flexDirection:"column",height:"100%",backgroundColor:"grey3",children:d.jsxs(m.BlankSlate,{children:[d.jsx(m.BlankSlateIcon,{name:e?"block":"cloudUpload",lineColor:e?"tomato11":"purple10",backgroundColor:e?"tomato2":"purple3",borderColor:e?"tomato6":"purple6",borderStyle:"dashed",size:"xlarge"}),d.jsx(m.BlankSlateTitle,{size:"big",children:t}),d.jsx(m.BlankSlateDescription,{width:360,children:n})]})})}function jq(){return d.jsx(m.DefaultErrorMessage,{title:"Oops! Something went wrong",description:"An error occurred while searching for your image.",errorImageSrc:m.dialogErrorImage,sx:{marginBlock:"auto",marginInline:"auto"}})}function Uq(e){const{mediaList:t,mediaActions:n,mediaToolbar:r,sidePane:i}=e,o=m.useMediaQuery({min:"medium"});return d.jsxs(m.Box,{display:"grid",gridTemplateRows:"auto auto 1fr",gridTemplateColumns:o?"1fr 380px":"1fr",width:"100%",height:"100%",children:[d.jsxs(m.Box,{position:"relative",display:"grid",gap:16,gridColumn:"1",gridRow:"1",padding:{right:16,bottom:16},children:[n,r]}),d.jsx(m.Box,{position:"relative",display:"grid",gridColumn:"1",gridRow:"2 / -1",children:t}),o&&i]})}function Bq(e){const{count:t}=e;return d.jsxs(m.Text,{variant:"bold",children:[t," items"]})}function owe(){var A;const{onScrollToBottom:e,media:t,isUploading:n,uploadingFiles:r,isSearchingMedia:i,isMediaRevalidationInProgress:o,setOpenMediaSection:a}=Et(),u=qu(),s=Te(),c=s.mediaLibrary&&s.mediaLibraryTagsEnabled,l=R.useRef(null);function f(h){u.toggleSelection({id:h,isSingleSelection:!0}),a("tags")}(n||i||o)&&((A=l.current)==null||A.scrollTo({top:0,behavior:"instant"}));function p(h,v,_){const S=v.shiftKey?t.map(({id:I})=>I):void 0;u.toggleSelection({id:h,isSingleSelection:_==="single",metaKey:v.metaKey,shiftKey:v.shiftKey,ids:S})}return d.jsx(Wq,{onScrollToBottom:e,scrollAreaRef:l,children:t.map(h=>{var v,_;return d.jsx(m.MediaCard,{"aria-label":"media item",...h,filenameHighlight:(v=h.search_highlight)==null?void 0:v.filename,loading:i,status:(_=r.find(S=>S.id===h.id))==null?void 0:_.status,selected:u.isSelected(h.id),onCardClick:S=>p(h.id,S,"single"),onCheckedChange:(S,I)=>p(h.id,I,"multi"),onAddTagClick:c?()=>f(h.id):void 0},h.id)})})}function Wq(e){const{children:t,scrollAreaRef:n,onScrollToBottom:r}=e,i=16,o=4,a="250px",u=`calc((100% - ${i*(o-1)}px) / ${o})`;return d.jsx(m.ScrollArea,{"aria-label":"Media list",ref:n,style:{display:"grid",gridTemplateColumns:`repeat(auto-fill, minmax(max(${a}, ${u}), 1fr))`,gridTemplateRows:"1fr 1fr 1fr ",gap:i,padding:2,paddingBottom:16,position:"relative"},onScrollToBottom:r,threshold:500,children:t})}function Kq(e){const{children:t,hasSelectedMedia:n}=e;return d.jsx(m.Box,{overflow:"hidden",gridColumn:"2 / -1",gridRow:"1 / -1",children:d.jsx(m.ScrollArea,{style:{display:"grid",height:"100%"},children:d.jsx(m.Box,{flexGrow:1,borderRadius:{topRight:8,topLeft:8},borderStyle:n?"solid":"dashed",border:{top:!0,right:!0,left:!0,bottom:!1},minWidth:0,children:t})})})}function Pq(e){const{onFilesUpload:t,isUploading:n,isInitialLoad:r=!1}=e,i=r||n;return d.jsxs(m.Box,{flexDirection:"column",justifyContent:"center",alignItems:"center",padding:16,gap:16,width:"100%",children:[d.jsx(m.BlankSlateIcon,{name:"cloudUpload",lineColor:"purple11",backgroundColor:"purple5",size:"large"}),d.jsx(m.Box,{flexDirection:"column",gap:4,children:d.jsxs(m.Text,{align:"center",children:["Select or"," ",d.jsx(m.FileUploadButton,{disabled:i,onFilesSelected:t,renderButton:o=>d.jsx(m.Tooltip,{title:Rl.warning.uploadWhileUploading.title,content:Rl.warning.uploadWhileUploading.description,visible:n,children:d.jsx(m.Box,{display:"inline-flex",as:"span",children:d.jsx(m.Button,{disabled:i,onClick:o,invisible:!0,children:"upload"})})})})," ","media."]})}),d.jsx(m.FileUploadButton,{disabled:i,onFilesSelected:t,color:"grey",children:"Upload media"})]})}function awe(e){const{actionContainerRef:t}=e;return d.jsx(Uq,{sidePane:d.jsx(cwe,{}),mediaActions:d.jsx(swe,{actionContainerRef:t}),mediaToolbar:d.jsx(m.Skeleton,{color:"grey5",borderRadius:12,children:d.jsx(Bq,{count:888})}),mediaList:d.jsx(uwe,{})})}function uwe(){return d.jsx(Wq,{children:gn.range(1,24).map(e=>d.jsx(Dq,{},e))})}function swe(e){const{actionContainerRef:t}=e,n=Xe.useForceUpdate();return R.useLayoutEffect(()=>{n()},[n]),d.jsx(Lq,{actionContainerRef:t,children:d.jsxs(m.Box,{width:"100%",gap:16,children:[d.jsx(m.Box,{width:"100%",flexDirection:"column",children:d.jsx(m.FormSearchInput,{placeholder:"Search",maxLength:200,value:"",disabled:!0,onValueChange:()=>{}})}),d.jsx(m.FileUploadButton,{disabled:!0,onFilesSelected:()=>{},startIcon:"cloudUpload",color:t?"purple":"grey",size:"large",children:"Upload media"})]})})}function cwe(){return d.jsx(Kq,{hasSelectedMedia:!1,children:d.jsx(Pq,{onFilesUpload:()=>{},isUploading:!1,isInitialLoad:!0})})}function Dq(){return d.jsxs(m.Box,{height:302,width:"100%",flexDirection:"column",padding:16,backgroundColor:"grey1",border:!0,borderStyle:"solid",borderRadius:6,children:[d.jsx(m.Skeleton,{height:164,width:"100%"}),d.jsx(m.Skeleton,{height:16,width:"100%",sx:{marginTop:12}}),d.jsx(m.Skeleton,{height:10,width:100,sx:{marginTop:8}}),d.jsx(m.Skeleton,{height:1,width:"100%",sx:{marginTop:20,marginBottom:16}}),d.jsxs(m.Box,{flexDirection:"row",gap:8,children:[d.jsx(m.Skeleton,{height:24,width:54}),d.jsx(m.Skeleton,{height:24,width:45}),d.jsx(m.Skeleton,{height:24,width:62})]})]})}const Nq=R.createContext({showToast:()=>{}});function lwe(e){const{children:t}=e,{isFetchingMedia:n}=Et(),[r,i]=R.useState({title:"",seconds:5}),[o,a]=R.useState(!1),{title:u,action:s,seconds:c=1,icon:l="check"}=r,f=R.useMemo(()=>({showToast:p=>{i({seconds:c,...p}),a(!0)}}),[c]);return d.jsxs(d.Fragment,{children:[d.jsx(fwe,{open:n}),d.jsx(dwe,{}),d.jsx(m.Toast,{anchor:d.jsx(m.Box,{position:"absolute",justifyContent:"center",width:"100%",bottom:72}),open:o,onOpenChange:a,title:u,action:s,seconds:c,icon:l}),d.jsx(Nq.Provider,{value:f,children:t})]})}function qq(){return R.useContext(Nq)}function fwe(e){const{open:t}=e;return d.jsx(m.Toast,{anchor:d.jsx(m.Box,{position:"absolute",justifyContent:"center",width:"100%",bottom:72}),loadingIndicator:!0,open:t,title:"Loading more items ...",seconds:1})}function dwe(){const{revalidateMedia:e,isMediaCacheInvalid:t}=Et(),[n,r]=R.useState(t);return Xe.useOnChange(t,r),d.jsx(m.Toast,{anchor:d.jsx(m.Box,{position:"absolute",justifyContent:"center",width:"100%",bottom:72}),open:n,title:"There has been changes to your media library",action:{title:"Update",onClick:e},cancel:{onClick:()=>r(!1)}})}function pwe(){const{media:e,mediaTotal:t,tagIds:n}=Et(),r=qu(),i=Te(),o=i.mediaLibrary&&i.mediaLibraryTagsEnabled;return d.jsxs(m.Box,{alignItems:"center",gap:16,children:[r.isSelectAllEnabled&&d.jsx(m.Checkbox,{onCheckedChange:r.toggleSelectAll,checked:r.selectedCount>0,indeterminate:r.selectedCount!==t,onClick:a=>a.stopPropagation(),disabled:e.length===0}),e.length!==0&&d.jsx(Bq,{count:t}),o&&d.jsxs(m.Box,{gap:8,alignItems:"center",children:[d.jsx(m.Text,{children:"Filter:"}),d.jsx(hwe,{}),n.length>0&&d.jsx(m.ErrorBoundary,{children:d.jsx(R.Suspense,{children:d.jsx(Awe,{})})})]})]})}function Awe(){const{tagIds:e,onTagIdsChange:t}=Et(),{tags:n}=yh(),r=R.useMemo(()=>hV.groupBy(n,o=>o.id),[n]);function i(o){const a=e.filter(u=>u!==o.id);t(a)}return d.jsx(d.Fragment,{children:e.map(o=>{var u;const a=(u=r.get(o))==null?void 0:u[0];return a?d.jsx(m.Badge,{title:a.name,size:"medium",color:"purple",onClose:()=>i(a),selected:!0},a.id):null})})}function hwe(){const{setTagManagerOpen:e,tagIds:t,onTagIdsChange:n}=Et(),[r,i]=R.useState(""),[o,a]=R.useState(!1);function u(l){a(l),l||i("")}function s(l){const f=t.includes(l.id)?t.filter(p=>p!==l.id):[...t,l.id];n(f),a(!1)}function c(){a(!1),e(!0)}return d.jsxs(m.DropdownMenu,{open:o,onOpenChange:u,children:[d.jsx(m.DropdownMenuTrigger,{children:d.jsx(m.Button,{startIcon:"label",endIcon:"arrowDropDown",size:"small",color:"grey",children:"Tags"})}),d.jsx(m.DropdownMenuContent,{minWidth:256,align:"start",border:!1,childrenFocusScope:!0,children:d.jsxs(m.ComboBox,{variant:"attached",children:[d.jsx(m.ComboBoxInput,{value:r,onValueChange:i,placeholder:"Search for a tag",autoFocus:!0}),d.jsx(m.ComboBoxContent,{children:d.jsx(m.ErrorBoundary,{renderError:()=>d.jsx(m.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"Error getting tags"}),children:d.jsx(R.Suspense,{fallback:d.jsx(m.Box,{padding:8,flexDirection:"column",gap:8,children:gn.range(1,6).map(l=>d.jsx(m.Skeleton,{height:24,width:85},l))}),children:d.jsx(mwe,{searchTerm:r,setSearchTerm:i,onTagToggle:s})})})}),d.jsx(m.ComboboxAction,{children:d.jsx(m.Button,{invisible:!0,startIcon:"edit",textWeight:"normal",color:"dark",onClick:c,children:"Manage tags"})})]})})]})}function mwe(e){const{onTagToggle:t,searchTerm:n}=e,{tagIds:r}=Et(),{tags:i}=yh(),o=R.useMemo(()=>{const a=n.toLowerCase();return i.filter(u=>u.name.toLowerCase().includes(a))},[i,n]);return d.jsxs(d.Fragment,{children:[!o.length&&d.jsx(m.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"No tags found"}),o.map((a,u)=>{const s=r.includes(a.id);return d.jsx(m.ComboBoxItem,{value:a.id,onCheckedChange:()=>t(a),checked:s,children:d.jsx(m.Badge,{title:a.name,color:"purple",sx:{marginLeft:8,marginBottom:u===o.length-1?8:4,marginTop:u===0?8:4},size:"medium"})},a.id)})]})}function jc(){const{media:e}=Et(),t=qu();return e.filter(({id:n})=>t.isSelected(n))}function gwe(){const[e,t]=R.useState(!1),n=jc(),r=qu(),i=R.useMemo(()=>n.some(({id:a})=>a.startsWith("temp")),[n]),[o]=n;return o?r.selectedCount>1?d.jsxs(m.Box,{gap:8,alignItems:"center",children:[d.jsxs(m.Text,{variant:"emphasized",noWrap:!0,sx:{flexGrow:1},children:[r.selectedCount," media selected"]}),d.jsx(m.Tooltip,{content:"Open all selected media in new tabs",children:d.jsx(m.IconButton,{icon:"openInFull",variant:"solid",size:"small",onClick:()=>n.forEach(a=>window.open(a.url,"_blank"))})}),d.jsx(m.Tooltip,{content:"Remove selected media",children:d.jsx(m.IconButton,{icon:"delete",variant:"solid",color:"tomato",size:"small",hiddenLabel:"Remove media",onClick:()=>t(!0),disabled:i})}),d.jsx(LF,{open:e,onOpenChange:t,media:n})]}):d.jsxs(m.Box,{gap:8,alignItems:"center",children:[d.jsx(m.Text,{variant:"emphasized",noWrap:!0,sx:{flexGrow:1},children:o.filename}),d.jsxs(m.Box,{gap:8,children:[d.jsx(m.Tooltip,{content:"Open media in new tab",children:d.jsx(m.IconButton,{icon:"openInFull",variant:"solid",size:"small",hiddenLabel:"Open media in new tab",onClick:()=>window.open(o.url,"_blank"),disabled:i})}),d.jsx(m.Tooltip,{content:"Copy media URL",children:d.jsx(m.IconButton,{icon:"link",variant:"solid",size:"small",hiddenLabel:"Copy media URL",onClick:()=>navigator.clipboard.writeText(o.url),disabled:i})}),d.jsx(m.Tooltip,{content:"Remove media",children:d.jsx(m.IconButton,{icon:"delete",variant:"solid",color:"tomato",size:"small",hiddenLabel:"Remove media",onClick:()=>t(!0),disabled:i})}),d.jsx(LF,{open:e,onOpenChange:t,media:o})]})]}):null}function LF(e){const{open:t,onOpenChange:n,media:r}=e,i=Te(),{showAlert:o}=m.useAlert(),{deleteMedia:a}=Et(),u=qu(),[s,c]=R.useState(!1),l=Array.isArray(r),f=l?"these items":"this item";function p(){c(!0);const h=u.getSelectionState().selectedIds;ywe({ids:h,config:i}).then(()=>{n(!1),a(h),u.clearSelection()}).catch(()=>{n(!1),o({title:"Error",subtitle:`Something went wrong when removing ${f}.`})}).finally(()=>{c(!1)})}return d.jsxs(m.Dialog,{onOpenChange:n,open:t,size:"small",children:[d.jsx(m.DialogHeader,{icon:"alert",title:`Remove ${f} from your media library?`}),d.jsx(m.DialogContent,{children:d.jsx(m.Box,{padding:16,children:d.jsxs(m.Text,{children:["You are about to delete ",f,":  ",l?d.jsx(vwe,{media:r}):d.jsx("b",{children:r.filename})]})})}),d.jsxs(m.DialogActions,{children:[d.jsx(m.DialogCancelButton,{}),d.jsxs(m.DialogActionButton,{onClick:p,color:"tomato",loading:s,children:["Yes, I want to remove ",f]})]})]})}const Pb=15;function vwe({media:e}){const t=e.slice(0,Pb),n=e.length>Pb,r=n?e.length-Pb:0,i=r===1?"item":"items";return d.jsxs("ul",{children:[t.map((o,a)=>d.jsx("li",{children:d.jsx("b",{children:o.filename})},a)),n&&d.jsxs("span",{children:[d.jsx("br",{}),"And ",d.jsx("b",{children:r})," more ",i,"..."]})]})}function ywe(e){const{ids:t,config:n}=e;if(!n.mediaLibrary)throw new Error("Media Library not configured.");if(t.length===0)throw new Error("No ids provided during media deletion");const{assetsApiBaseUrl:r,repository:i,authStrategy:o}=n;if(t.length===1){const[a]=t;return we.request(new URL(`assets/${a}`,r),{headers:{repository:i},method:"DELETE",credentials:we.getRequestCredentials(o),okType:B.unknown()})}return we.request(new URL("assets/bulk-delete",r),{headers:{repository:i},method:"POST",credentials:we.getRequestCredentials(o),okType:B.unknown(),body:{ids:t}})}function bwe(){var o;const e=jc(),{uploadingFiles:t}=Et(),[n]=e;if(!n)return null;if(e.length===2)return d.jsx(Db,{children:e.map((a,u)=>d.jsx("div",{style:{position:"absolute",transform:u===0?"translateX(25%) rotate(15deg) ":"translateX(-25%) rotate(-15deg) "},children:d.jsx(jF,{media:a})},a.id))});if(e.length>2)return d.jsx(Db,{children:e.slice(-4).map((a,u)=>d.jsx("div",{style:{position:"absolute",paddingRight:u*16},children:d.jsx(jF,{media:a})},a.id))});const r=(o=t.find(a=>a.id===n.id))==null?void 0:o.status,i=n.kind.startsWith("image");return d.jsx(m.Box,{flexDirection:"column",children:d.jsx(m.CheckerBoard,{children:d.jsx(Db,{uploadStatus:r,hasImage:i,children:i?d.jsx(m.Image,{src:n.url,alt:n.alt,sizing:"contain"}):d.jsx(m.MediaCardPlaceholder,{extension:n.extension,filename:n.filename})})})})}function Db(e){const{children:t,uploadStatus:n,hasImage:r}=e;return d.jsxs(m.Box,{flexDirection:"column",alignItems:"center",justifyContent:"center",position:"relative",height:200,width:"100%",backgroundColor:r?"transparent":"purple2",children:[t,n&&d.jsx(m.Box,{position:"absolute",backgroundColor:"greyAlpha1",width:"100%",height:"100%",padding:{inline:16},justifyContent:"end",flexDirection:"column",children:d.jsx(m.MediaProgress,{status:n})})]})}function jF(e){const{media:t}=e;return d.jsx(m.Box,{width:111,height:152,children:t.kind==="image"?d.jsx(m.Image,{borderRadius:8,src:t.url,alt:t.alt,sizing:"cover"}):d.jsx(m.MediaCardPlaceholder,{extension:t.extension,filename:t.filename})})}const Xa=2e3,dd="__MAIN_THUMBNAIL__";function J1(e,t,n){const r=e.name===dd?void 0:e.name;let i;return t?to.isDefined(n)?i=[n.width,n.height]:to.isDefined(e.width)||to.isDefined(e.height)?i=[e.width??void 0,e.height??void 0]:i=[t.origin.width,t.origin.height]:i=void 0,[r,i?`${i[0]??"auto"}x${i[1]??"auto"}px`:void 0]}function Cwe(e){var t,n;return[{...(t=e.config)==null?void 0:t.constraint,name:dd}].concat(((n=e.config)==null?void 0:n.thumbnails)??[])}function Swe(e,t){var a,u;const{__TYPE__:n,thumbnails:r,...i}=t,o=(u=(a=e.config)==null?void 0:a.thumbnails)==null?void 0:u.map(({name:s})=>r==null?void 0:r[s]);return[i,...o??[]]}function _we(e,t,n,r){const i=r.length===0?void 0:r;return e===dd||!Ue.isImageContent(t)?{...t,alt:i}:{...t,thumbnails:{...t.thumbnails,[e]:{...n,alt:i}}}}function Iwe(e,t){const{width:n,height:r}=t??{};return n&&r?[n,r]:n?[n,Math.round(e.height*(n/e.width))]:r?[Math.round(e.width*(r/e.height)),r]:[e.width,e.height]}function Twe(e,t,n,r,i){if(Owe(e)==="svg")return e;const o=new URL(e);if(i){const{x:a,y:u,width:s,height:c}=t,l=[...o.searchParams.entries(),["rect",[a,u,s,c].join(",")],["w",n],["h",r]];o.search=l.map(f=>f.join("=")).join("&")}return o.toString()}function Qq(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 xwe(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()}function wwe(e){return e!=null&&e.url?Qq(e.url):void 0}function $we(e,t,n,r){var u,s,c,l,f;if(!n||e===dd){const p=(u=t.config)==null?void 0:u.thumbnails,A=p&&Object.fromEntries(p.map(h=>[h.name,Xh(r,h)]));return{__TYPE__:"ImageContent",...Xh(r,(s=t.config)==null?void 0:s.constraint),thumbnails:A}}const i=(l=(c=t.config)==null?void 0:c.thumbnails)==null?void 0:l.find(p=>p.name===e);if(!i)return n;const o=(f=n.thumbnails)==null?void 0:f[e],a=Xh(r,i);return a.url===(o==null?void 0:o.url)?n:{...n,thumbnails:Pl.mapValues(n.thumbnails??{},(p,A)=>A===e?a:p)}}function Ewe(e){return"kind"in e&&"extension"in e}function Xh(e,t){const{width:n,height:r,rect:i}=Rwe({...e,width:(e==null?void 0:e.width)??Xa,height:(e==null?void 0:e.height)??Xa},t),o=!!(t!=null&&t.width||t!=null&&t.height);return{provider:"imgix",url:Twe(e.url,i,n,r,o),alt:e.alt,...Ewe(e)?{credits:e.credits}:{},origin:{id:e.id,url:e.url,width:e.width??Xa,height:e.height??Xa},width:n,height:r,edit:{background:"transparent",zoom:1,crop:{x:i.x,y:i.y}}}}function Rwe(e,t){const[n,r]=Iwe(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 Owe(e){const{pathname:t}=new URL(e),n=t.lastIndexOf(".");if(n!==-1)return t.substring(n).slice(1).toLowerCase()}function Fwe(e){if(!e)return"";const{filename:t,extension:n}=e;if(!n)return t;const r=new RegExp(`\\.${n}$`);return t.replace(r,"")}function Vq(e){const{tags:t,toggleAssetTag:n,getTagsLabel:r}=e,{setTagManagerOpen:i}=Et(),{showToast:o}=qq(),{showAlert:a}=m.useAlert(),[u,s]=R.useState("");async function c(l,f){s("");try{await n(l,f),o({title:"Media tags were updated",seconds:3})}catch{a({title:"Error",subtitle:"Something went wrong when updating media tags"})}}return d.jsxs(m.Box,{flexDirection:"column",children:[d.jsxs(m.Box,{justifyContent:"space-between",children:[d.jsx(m.Text,{color:"grey12",variant:"bold",children:r()}),d.jsx(m.Button,{startIcon:"edit",invisible:!0,color:"dark",onClick:()=>i(!0),children:"Manage tags"})]}),d.jsxs(m.ComboBox,{sx:{marginTop:4,marginBottom:8},children:[d.jsx(Mwe,{searchTerm:u,setSearchTerm:s}),d.jsx(m.ComboBoxContent,{children:d.jsx(m.ErrorBoundary,{renderError:()=>d.jsx(m.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"Error getting tags"}),children:d.jsx(R.Suspense,{fallback:d.jsx(m.Box,{padding:8,flexDirection:"column",gap:8,children:gn.range(1,6).map(l=>d.jsx(m.Skeleton,{height:24,width:85},l))}),children:d.jsx(kwe,{searchTerm:u,assignedTags:t,onToggleAssetTag:c})})})})]}),d.jsx(m.Box,{flexDirection:"column",alignItems:"flex-start",gap:8,children:t.map(l=>d.jsx(m.Badge,{title:l.name,size:"medium",color:"purple",selected:!0,onClose:()=>c(l,"remove")},l.id))})]})}function Mwe(e){const{searchTerm:t,setSearchTerm:n}=e,r=R.useRef(null),{openMediaSection:i,setOpenMediaSection:o}=Et();return R.useEffect(()=>{var a;i==="tags"&&((a=r.current)==null||a.focus(),o(void 0))},[i,o]),d.jsx(m.ComboBoxInput,{value:t,onValueChange:n,placeholder:"Add or create a new tag",ref:r})}function kwe(e){const{searchTerm:t,assignedTags:n,onToggleAssetTag:r}=e,[i]=jc(),o=Te(),{showAlert:a}=m.useAlert(),{tags:u}=yh(),s=R.useMemo(()=>{const p=t.toLowerCase();return u.filter(A=>A.name.toLowerCase().includes(p))},[u,t]),l=wR.safeParse(t).success&&u.every(p=>p.name!==t);async function f(){if(!t||!i)return;let p;try{p=await Lwe({name:t,config:o}),bh(A=>[p,...A])}catch{a({title:"Error",subtitle:`Something went wrong when creating the tag ${t}`});return}await r(p,"add")}return i?d.jsxs(d.Fragment,{children:[!s.length&&d.jsx(m.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"No tags found"}),s.map((p,A)=>d.jsx(m.ComboBoxItem,{value:p.id,onCheckedChange:h=>r(p,h?"add":"remove"),checked:n.some(h=>h.id===p.id),children:d.jsx(m.Badge,{title:p.name,color:"purple",size:"medium",sx:{marginInline:8,marginBottom:A===s.length-1?8:4,marginTop:A===0?8:4}})},p.id)),l&&d.jsx(m.ComboBoxItem,{value:"new",onCheckedChange:f,children:d.jsxs(m.Box,{padding:8,flexDirection:"row",alignItems:"center",gap:4,children:[d.jsx(m.Icon,{name:"add",size:"small",color:"grey11"}),d.jsxs(m.Text,{color:"grey12",children:['Create tag "',t,'"']})]})})]}):null}function Lwe(e){const{name:t,config:n}=e;n.mediaLibrary||Bn("mediaLibrary");const{assetsApiBaseUrl:r,repository:i,authStrategy:o}=n;return we.request(new URL("tags",r),{headers:{repository:i},body:{name:t},method:"POST",credentials:we.getRequestCredentials(o),okType:$R})}function jwe(e){const{selectedMedia:t}=e,n=Te(),r=R.useMemo(()=>Bwe(t),[t]);async function i(a,u){const s=u==="remove",c=t.map(f=>f.id);let l=[];Ms(f=>(l=f,f.map(p=>c.includes(p.id)?s?Kwe(p,a):Wwe(p,a):p)));try{await Uwe({tagId:a.id,assetIds:c,operation:s?"remove":"add",config:n});const f=t.length*(s?-1:1);bh(p=>p.map(A=>A.id===a.id?{...A,count:A.count+f}:A))}catch(f){throw Ms(()=>l),f}}function o(){const a=r.length;return a>1?`${a} tags in common`:a===1?"1 tag in common":"Common tags"}return d.jsx(Vq,{tags:r,getTagsLabel:o,toggleAssetTag:i})}function Uwe(e){const{tagId:t,assetIds:n,config:r,operation:i}=e;if(!r.mediaLibrary)throw new Error("Media Library not configured.");const{assetsApiBaseUrl:o,repository:a,authStrategy:u}=r;return we.request(new URL(`tags/${t}/assets`,o),{headers:{repository:a},body:{assetIds:n},method:i==="add"?"POST":"DELETE",credentials:we.getRequestCredentials(u),okType:B.unknown()})}function Bwe(e){const t=e.length,n={},r=[];return e.forEach(o=>{o.tags.forEach(a=>{n[a.id]||(n[a.id]=0,r.push(a)),n[a.id]++})}),r.filter(o=>n[o.id]===t)}function Wwe(e,t){return e.tags.some(({id:r})=>r===t.id)?e:{...e,tags:[...e.tags,t]}}function Kwe(e,t){const n=e.tags.filter(r=>r.id!==t.id);return{...e,tags:n}}function Pwe(e){const{selectedMedia:t}=e,n=t.tags,r=Te(),{updateMedia:i}=Et();async function o(u,s){const c=t.tags,l=s==="remove",f=l?c.filter(p=>p.id!==u.id):[...c,u];i(t.id,{tags:f});try{await Dwe({mediaId:t.id,config:r,tags:f.map(p=>p.id)}),bh(p=>p.map(A=>A.id===u.id?{...A,count:A.count+(l?-1:1)}:A))}catch(p){throw i(t.id,{tags:c}),p}}function a(){const u=n.length;return u>1?`${u} tags`:u===1?"1 tag":"Tags"}return d.jsx(Vq,{tags:n,getTagsLabel:a,toggleAssetTag:o})}function Dwe(e){const{mediaId:t,config:n,tags:r}=e;if(!n.mediaLibrary)throw new Error("Media Library not configured.");const{assetsApiBaseUrl:i,repository:o,authStrategy:a}=n;return we.request(new URL(`assets/${t}`,i),{headers:{repository:o},body:{tags:r},method:"PATCH",credentials:we.getRequestCredentials(a),okType:K0})}function Nwe(){const[e,t]=R.useState("description");if(jc().length!==1)return d.jsx(zwe,{});const r=e==="description",i=e==="more-info";return d.jsxs(d.Fragment,{children:[d.jsxs(m.Box,{border:!0,borderStyle:"solid",borderRadius:8,backgroundColor:"grey2",children:[d.jsx(m.Tab,{title:"Description",selected:r,onSelect:()=>t("description"),outline:r,background:r?void 0:"transparent",sx:{flexGrow:1,flexBasis:0}}),d.jsx(m.Tab,{title:"More info",selected:i,onSelect:()=>t("more-info"),outline:i,background:i?void 0:"transparent",sx:{flexGrow:1,flexBasis:0}})]}),d.jsx(qwe,{tab:e})]})}function qwe(e){const{tab:t}=e;switch(t){case"description":return d.jsx(Qwe,{});case"more-info":return d.jsx(Vwe,{})}}function Qwe(){const{title:e,alt:t,onBlur:n,isUploading:r,selectedMedia:i}=zq(),o=Te(),a=o.mediaLibrary&&o.mediaLibraryTagsEnabled;if(!i)return null;const{extension:u}=i;return d.jsxs(m.Box,{flexDirection:"column",gap:16,children:[d.jsx(m.FormInput,{value:e.value,onValueChange:e.set,label:"Media title",placeholder:"Media title",onBlur:n,disabled:r,suffix:u?`.${u}`:void 0}),d.jsx(m.FormInputField,{label:"Alternative text",children:d.jsx(m.ContentEditable,{content:t.displayValue,contentVersion:t.version,readOnly:r,placeholder:"A short description of the media for accessibility",multiline:!0,decorations:{em:"highlight"},onChange:t.onChange,onBlur:n})}),a&&!r&&d.jsx(Pwe,{selectedMedia:i})]})}function Vwe(){const{credits:e,notes:t,onBlur:n,isUploading:r,selectedMedia:i}=zq();if(!i)return null;const o=Gwe(i);return d.jsxs(m.Box,{gap:8,flexDirection:"column",children:[o.map(a=>d.jsxs(m.Box,{gap:8,children:[d.jsxs(m.Text,{color:"grey11",children:[a.label,":"]}),d.jsx(m.Text,{children:a.value})]},a.label)),d.jsx(m.FormInputField,{label:"Copyright",children:d.jsx(m.ContentEditable,{content:e.displayValue,contentVersion:e.version,readOnly:r,placeholder:"Media copyrights or credits",multiline:!0,decorations:{em:"highlight"},onChange:e.onChange,onBlur:n})}),d.jsx(m.FormInputField,{label:"Private notes",children:d.jsx(m.ContentEditable,{content:t.displayValue,contentVersion:t.version,readOnly:r,placeholder:"Private notes are never shared publicly",multiline:!0,decorations:{em:"highlight"},onChange:t.onChange,onBlur:n})})]})}function zwe(){const e=jc(),{uploadingFiles:t}=Et(),n=Te(),r=R.useMemo(()=>t.some(o=>e.some(a=>o.id===a.id)&&o.status!=="success"),[e,t]),i=n.mediaLibrary&&n.mediaLibraryTagsEnabled;return d.jsx(d.Fragment,{children:i&&!r&&d.jsx(jwe,{selectedMedia:e})})}function zq(){const[e]=jc(),{updateMedia:t,uploadingFiles:n}=Et(),r=Te(),{showToast:i}=qq(),o=(e==null?void 0:e.id)??"",a=Ph(e,"alt"),u=Ph(e,"notes"),s=Ph(e,"credits"),c=Ph(e,"filename",Fwe),l=n.some(p=>p.id===(e==null?void 0:e.id)&&p.status!=="success");function f(){if(!e||!c.changed&&!a.changed&&!s.changed&&!u.changed)return;const{extension:p,search_highlight:A}=e,h=p?`${c.value}.${p}`:c.value;t(o,{filename:h,alt:a.value,credits:s.value,notes:u.value,search_highlight:{alt:a.changed||A==null?void 0:A.alt,credits:s.changed||A==null?void 0:A.credits,filename:c.changed||A==null?void 0:A.filename,notes:u.changed||A==null?void 0:A.notes}}),Ywe({id:o,config:r,metadata:{filename:h,alt:a.value,credits:s.value,notes:u.value}}).then(()=>{i({title:"Media metadata has been saved.",seconds:3})}).catch(v=>{console.error(v)})}return{selectedMedia:e,onBlur:f,isUploading:l,title:c,alt:a,credits:s,notes:u,extension:e==null?void 0:e.extension}}function Ph(e,t,n=r=>r==null?void 0:r[t]){var c;const r=n(e)??"",[i,o]=R.useState(r);Xe.useOnChange(e==null?void 0:e.id,()=>o(r));const a=(c=e==null?void 0:e.search_highlight)==null?void 0:c[t],u=!!a;function s(l){const{from:f,to:p}=l.state.selection;l.commands.selectAll(),l.commands.unsetAllMarks(),l.commands.setTextSelection({from:f,to:p}),o(l.getText())}return{value:i,set:o,displayValue:Hwe(a??i)??"",onChange:s,version:`${(e==null?void 0:e.id)??""}_${u}`,changed:i!==r}}function Hwe(e){return e==null?void 0:e.replace(/\n/g,"<br>")}function Ywe(e){const{id:t,config:n,metadata:r}=e;if(!n.mediaLibrary)throw new Error("Media Library not configured.");const{assetsApiBaseUrl:i,repository:o,authStrategy:a}=n;return we.request(new URL(`assets/${t}`,i),{headers:{repository:o},body:{...r},method:"PATCH",credentials:we.getRequestCredentials(a),okType:K0})}function Gwe(e){const{width:t,height:n,last_modified:r,size:i,extension:o}=e,a=t&&n,u={label:"Date",value:PC.prettyPrintDate(new Date(r))},s={label:"File size",value:Ip.formatBytes(i)},c=a?{label:"Dimensions",value:`${t}x${n}`}:void 0,l=a?{label:"Ratio",value:((t??0)/(n??0)).toFixed(1)}:void 0,f=o?{label:"Extension",value:o.toUpperCase()}:void 0;return[u,s,c,l,f].filter(to.isDefined)}function Jwe(){const{setTagManagerOpen:e}=Et(),[t,n]=R.useState("");return d.jsxs(m.Box,{gap:20,flexDirection:"column",height:"100%",children:[d.jsxs(m.Box,{alignItems:"center",gap:4,children:[d.jsx(m.IconButton,{icon:"close",size:"small",hasPadding:!1,onClick:()=>e(!1)}),d.jsx(m.Text,{variant:"bold",children:"Tags management"})]}),d.jsxs(m.Box,{gap:16,flexDirection:"column",height:"100%",children:[d.jsx(m.FormSearchInput,{value:t,onValueChange:n,placeholder:"Search for tags",endAdornment:!1,autoFocus:!0}),d.jsx(m.ErrorBoundary,{renderError:()=>d.jsx(t$e,{}),children:d.jsx(R.Suspense,{fallback:d.jsx(i$e,{}),children:d.jsx(Zwe,{searchTerm:t})})})]})]})}function Zwe(e){const{searchTerm:t}=e,{tags:n}=yh(),r=n.filter(i=>i.name.toLowerCase().includes(t.toLowerCase()));return r.length===0?d.jsx(m.Text,{color:"grey9",variant:"small",children:"No tags found"}):d.jsx(m.AnimatedList,{ariaLabel:"Tags list",getItemKey:i=>i.id,gap:16,items:r,children:i=>d.jsx(Xwe,{tag:i})})}function Xwe(e){const{tag:t}=e,[n,r]=R.useState(!1),i=Te(),{showAlert:o}=m.useAlert(),{showToast:a}=m.useToast(),{tags:u}=yh();async function s(c){if(!wR.safeParse(c).success){o({title:"Error",subtitle:`Failed to rename tag "${t.name}" to "${c}". Tag name must be at least ${wq} and at maximum ${$q} characters long.`});return}if(u.some(p=>p.name===c)){o({title:"Error",subtitle:`Failed to rename tag "${t.name}" to "${c}". Tag with name "${c}" already exists.`});return}try{await r$e({id:t.id,name:c,config:i}),bh(p=>p.map(A=>A.id===t.id?{...A,name:c}:A)),Ms(p=>p.map(A=>{if(A.tags.findIndex(v=>v.id===t.id)!==-1){const v=A.tags.map(_=>_.id===t.id?{..._,name:c}:_);return{...A,tags:v}}return A})),a({title:`Tag "${t.name}" renamed to "${c}"`,seconds:3})}catch{o({title:"Error",subtitle:"Something went wrong when renaming the tag."})}}return d.jsxs(d.Fragment,{children:[d.jsxs(m.Box,{justifyContent:"space-between",children:[d.jsx(m.Badge,{title:t.name,color:"purple",size:"medium",onEdit:s}),d.jsx(m.Button,{invisible:!0,color:"tomato",textWeight:"normal",onClick:()=>r(!0),children:"Delete"})]}),d.jsx(e$e,{open:n,onOpenChange:r,tag:t})]})}function e$e(e){const{open:t,onOpenChange:n,tag:r}=e,{id:i,name:o,count:a}=r,u=Te(),{showAlert:s}=m.useAlert(),[c,l]=R.useState(!1);async function f(){l(!0);try{await n$e({id:i,config:u}),bh(p=>p.filter(A=>A.id!==i)),Ms(p=>p.map(A=>{if(A.tags.findIndex(v=>v.id===i)!==-1){const v=A.tags.filter(_=>_.id!==i);return{...A,tags:v}}return A}))}catch{s({title:"Error",subtitle:"Something went wrong when removing the tag."})}finally{l(!1),n(!1)}}return d.jsxs(m.Dialog,{onOpenChange:n,open:t,size:"small",children:[d.jsx(m.DialogHeader,{title:`This tag is being used on ${a} media item${a===1?"":"s"}`}),d.jsx(m.DialogContent,{padding:16,children:d.jsxs(m.Text,{children:["You are about to delete the tag name ",d.jsx("b",{children:o}),"."," ",a>0&&`This tag is being
32
32
  used on ${a} media item${a===1?"":"s"} and will be deleted
33
- from ${a===1?"it":"them"}.`]})}),d.jsxs(m.DialogActions,{children:[d.jsx(m.DialogCancelButton,{}),d.jsx(m.DialogActionButton,{onClick:f,color:"tomato",loading:c,children:"Yes, I want to delete"})]})]})}function Xwe(){const e=R.useContext(nt.ErrorBoundaryContext);return d.jsx(m.Box,{flexDirection:"column",children:d.jsxs(m.BlankSlate,{children:[d.jsx(m.BlankSlateIcon,{name:"close",lineColor:"purple10",backgroundColor:"purple3",borderColor:"purple6",borderStyle:"dashed"}),d.jsx(m.BlankSlateTitle,{size:"big",children:"Oops!"}),d.jsx(m.BlankSlateDescription,{width:360,children:"We couldn't load your media tags."}),d.jsx(m.BlankSlateActions,{children:d.jsx(m.Button,{onClick:e==null?void 0:e.reset,size:"medium",children:"Try again"})})]})})}function e$e(e){const{id:t,config:n}=e;n.mediaLibrary||Bn("mediaLibrary");const{assetsApiBaseUrl:r,repository:i,authStrategy:o}=n;return _e.request(new URL(`tags/${t}`,r),{headers:{repository:i},method:"DELETE",credentials:_e.getRequestCredentials(o),okType:B.unknown()})}function t$e(e){const{id:t,name:n,config:r}=e;r.mediaLibrary||Bn("mediaLibrary");const{assetsApiBaseUrl:i,repository:o,authStrategy:a}=r;return _e.request(new URL(`tags/${t}`,i),{headers:{repository:o},method:"PATCH",credentials:_e.getRequestCredentials(a),body:{name:n},okType:B.unknown()})}function n$e(){return d.jsx(m.Box,{flexDirection:"column",gap:16,children:gn.range(1,6).map(e=>d.jsxs(m.Box,{justifyContent:"space-between",children:[d.jsx(m.Skeleton,{height:24,width:85}),d.jsx(m.Skeleton,{height:24,width:45})]},e))})}function r$e(){const e=jc(),{onFilesUpload:t,isUploading:n,tagManagerOpen:r}=Et();return e.length===0&&r===!1?d.jsx(Pq,{onFilesUpload:t,isUploading:n}):d.jsx(m.Box,{flexDirection:"column",backgroundColor:"grey1",width:"100%",padding:16,gap:16,borderRadius:{topLeft:8,topRight:8},children:r?d.jsx(Ywe,{}):d.jsxs(d.Fragment,{children:[d.jsx(hwe,{}),d.jsx(vwe,{}),d.jsx(Pwe,{})]})})}function i$e(){const e=qu();return d.jsx(Kq,{hasSelectedMedia:e.selectedCount!==0,children:d.jsx(r$e,{})})}function Hq(e){const{assetType:t,onSelectedChange:n,actionContainerRef:r}=e;return d.jsx(m.ErrorBoundary,{renderError:()=>d.jsx(jq,{}),children:d.jsx(R.Suspense,{fallback:d.jsx(iwe,{actionContainerRef:r}),children:d.jsx(sq,{children:d.jsx(Zxe,{assetType:t,actionContainerRef:r,onSelectedChange:n,children:d.jsx(twe,{children:d.jsx(o$e,{})})})})})})}function o$e(){const{media:e}=Et();return d.jsx(swe,{children:d.jsx(Uq,{sidePane:d.jsx(i$e,{}),mediaActions:d.jsx(Xxe,{}),mediaToolbar:d.jsx(fwe,{}),mediaList:e.length===0?d.jsx(cq,{}):d.jsx(rwe,{})})})}const Yq=R.createContext({editedUID:{current:!1},onEditUID:()=>{}});function Gq(e){return Object.values(e.json).some(t=>{var n;return((n=t.uid)==null?void 0:n.type)==="UID"})}function a$e(e){const{content:t,customType:n}=e;return Gq(n)&&!t.uid}function Jq(e){const{documentId:t,documentsWithUid:n,uid:r}=e;return n.filter(i=>t!==i.id&&s$e({document:i,uid:r})&&u$e({...e,document:i}))}function u$e(e){const{customTypeId:t,languageId:n,document:r}=e,i=t===r.custom_type_id,o=n===r.language.id;return i&&o}function s$e(e){const{document:t,uid:n}=e,r=t.versions.filter(i=>i.uid===n);return r.length===0?!0:r.some(i=>i.status!=="archived")}function Zq(e,t){if(t)return`${e}___${t}`}const Xq=R.createContext({update:()=>{}});function P0(e){const{sliceKey:t}=e||{},n=R.useContext(Xq),r=Zq("sliceFieldSet",t),i=t===(n==null?void 0:n.id);return{selectionId:r,selected:i,selection:n}}function er(e){var t;return((t=e.config)==null?void 0:t.label)??(e.type==="Boolean"||e.type==="Separator"?void 0:e.fieldset)??e.type}const Z1="...";function Qu(e,t){var n,r,i;return e.type==="Boolean"?(t?(n=e.config)==null?void 0:n.placeholder_true:(r=e.config)==null?void 0:r.placeholder_false)||Z1:((i=e.config)==null?void 0:i.placeholder)||Z1}function c$e(e){var u;const{content:t,field:n,id:r,readOnly:i,onContentChange:o}=e,a=(t==null?void 0:t.value)??((u=n.config)==null?void 0:u.default_value)??!1;return d.jsxs(m.Field,{children:[d.jsx(m.FieldIcon,{name:"biToggle"}),d.jsx(m.FieldLabel,{htmlFor:r,children:er(n)}),d.jsxs(m.FieldControl,{children:[d.jsx(m.Box,{padding:4,alignItems:"center",children:d.jsx(m.Text,{children:Qu(n,a)})}),d.jsx(m.Switch,{id:r,sx:{alignSelf:"center",marginLeft:"auto",marginRight:12},checked:a,onCheckedChange:s=>{i||o(l$e(s))}})]})]})}function l$e(e){return{__TYPE__:"BooleanContent",value:e}}function f$e(e){const{id:t,field:n,content:r,onContentChange:i}=e;return d.jsxs(m.Field,{children:[d.jsx(m.FieldIcon,{name:"colorLens"}),d.jsx(m.FieldLabel,{id:t,children:er(n)}),d.jsx(m.FieldControl,{children:d.jsx(m.Box,{padding:{left:4},alignItems:"center",children:d.jsx(m.ColorInput,{onValueChange:o=>i(d$e(o)),value:r==null?void 0:r.value,"aria-labelledby":t,placeholder:Qu(n)})})})]})}function d$e(e){return e===void 0?void 0:{__TYPE__:"FieldContent",type:"Color",value:e}}function p$e(e){const{id:t,readOnly:n,field:r,content:i,onContentChange:o}=e,a=i!=null&&i.value?PC.dateFromISOString(i.value):void 0;return d.jsxs(m.Field,{children:[d.jsx(m.FieldIcon,{name:"dateRange"}),d.jsx(m.FieldLabel,{id:t,children:er(r)}),d.jsx(m.FieldControl,{children:d.jsx(m.Box,{padding:{left:4,right:12},width:"100%",flexDirection:"column",justifyContent:"center",children:d.jsx(m.DateInput,{mode:"date","aria-labelledby":t,disabled:n,value:a,onValueChange:u=>o(A$e(u))})})})]})}function A$e(e){if(e)return{__TYPE__:"FieldContent",type:"Date",value:h$e(e)}}function h$e(e){const t=`${e.getFullYear()}`.padStart(4,"0"),n=`${e.getMonth()+1}`.padStart(2,"0"),r=`${e.getDate()}`.padStart(2,"0");return`${t}-${n}-${r}`}const Vu=R.forwardRef(function(t,n){return d.jsx(m.TextInput,{padding:e7,...t,ref:n,sx:{...t.sx,alignSelf:"stretch"}})}),e7={input:{inline:4},adornment:{inline:12}},m$e=({provider:e})=>g$e[e.toLowerCase()]??d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("g",{clipPath:"url(#clip0_6524_22412)",children:d.jsx("path",{d:"M7.99992 1.33333C4.31992 1.33333 1.33325 4.32 1.33325 8C1.33325 11.68 4.31992 14.6667 7.99992 14.6667C11.6799 14.6667 14.6666 11.68 14.6666 8C14.6666 4.32 11.6799 1.33333 7.99992 1.33333ZM2.66659 8C2.66659 7.59333 2.71992 7.19333 2.80659 6.81333L5.99325 10V10.6667C5.99325 11.4 6.59325 12 7.32658 12V13.2867C4.70658 12.9533 2.66659 10.7133 2.66659 8ZM11.9266 11.6C11.7533 11.06 11.2599 10.6667 10.6599 10.6667H9.99325V8.66667C9.99325 8.3 9.69325 8 9.32658 8H5.32658V6.66667H6.65992C7.02658 6.66667 7.32658 6.36667 7.32658 6V4.66667H8.65992C9.39325 4.66667 9.99325 4.06667 9.99325 3.33333V3.06C11.9466 3.84667 13.3333 5.76667 13.3333 8C13.3333 9.38667 12.7933 10.6533 11.9266 11.6Z",fill:"#6F6E77"})}),d.jsx("defs",{children:d.jsx("clipPath",{id:"clip0_6524_22412",children:d.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),g$e={codepen:d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("g",{clipPath:"url(#clip0_6523_22409)",children:d.jsx("path",{d:"M15.9879 5.44292C15.9843 5.42352 15.981 5.40413 15.9759 5.38517C15.9726 5.37375 15.9688 5.36298 15.9651 5.35177C15.9597 5.33497 15.9541 5.31816 15.9474 5.30179C15.9427 5.29037 15.9373 5.27938 15.9321 5.26839C15.9248 5.25288 15.9173 5.23758 15.9086 5.22271C15.9026 5.21172 15.8957 5.20138 15.889 5.19082C15.8798 5.1766 15.8703 5.1626 15.8599 5.14902C15.8524 5.13889 15.8446 5.1292 15.8365 5.1195C15.8257 5.10657 15.8141 5.09429 15.8024 5.08223C15.7934 5.07318 15.7843 5.06413 15.7748 5.05529C15.7623 5.04387 15.7494 5.0331 15.7358 5.02276C15.7255 5.01479 15.7154 5.0066 15.7046 4.99927C15.7007 4.99647 15.6973 4.99324 15.6932 4.99065L8.38116 0.115543C8.15039 -0.0385144 7.84939 -0.0385144 7.61863 0.115543L0.306176 4.99044C0.302082 4.99302 0.29885 4.99626 0.294756 4.99906C0.283983 5.0066 0.273856 5.01457 0.263514 5.02254C0.250155 5.0331 0.237011 5.04387 0.224515 5.05486C0.215034 5.06348 0.205985 5.07253 0.19715 5.0818C0.185084 5.09386 0.17388 5.10614 0.162892 5.11907C0.154704 5.12877 0.146947 5.13846 0.139406 5.14924C0.129064 5.16281 0.119583 5.1766 0.110318 5.19104C0.103639 5.20159 0.0969593 5.21194 0.0907108 5.22293C0.0820922 5.23779 0.0745509 5.25309 0.0674405 5.26817C0.0622694 5.27916 0.0566673 5.29037 0.0521425 5.30157C0.0454631 5.31795 0.0396456 5.33475 0.0342589 5.35156C0.030596 5.36276 0.0267177 5.37375 0.0237011 5.38388C0.0187455 5.40284 0.0150825 5.42201 0.0116351 5.44162C0.00969592 5.45153 0.00732581 5.46123 0.00603302 5.47136C0.00215465 5.50109 0 5.53082 0 5.56121V10.4372C0 10.4673 0.00215465 10.4975 0.00646395 10.527C0.00797221 10.5378 0.0107733 10.5464 0.0129279 10.5568C0.0163753 10.5762 0.0193919 10.5955 0.0258558 10.6149C0.0288723 10.6257 0.0323198 10.6365 0.0366291 10.6483C0.0420157 10.6656 0.0474023 10.6828 0.0538662 10.6985C0.058391 10.7093 0.0646395 10.7201 0.0689488 10.7309C0.0760591 10.7459 0.0840314 10.761 0.09265 10.7768C0.098683 10.7875 0.105578 10.7983 0.112042 10.8082C0.121307 10.8233 0.131434 10.8362 0.142207 10.8491C0.149748 10.8599 0.157289 10.8685 0.165908 10.8789C0.176897 10.8918 0.187455 10.9047 0.200382 10.9162C0.209217 10.9248 0.21762 10.9355 0.228393 10.942C0.24089 10.9528 0.254249 10.9636 0.267177 10.9748C0.277519 10.9834 0.288723 10.9898 0.297342 10.9982C0.301436 11.0004 0.303806 11.0047 0.308115 11.0067L7.61863 15.8841C7.73412 15.9617 7.86641 16.0005 8 15.9998C8.13359 15.9992 8.26588 15.9611 8.38137 15.8841L15.6938 11.0092C15.6979 11.0067 15.7014 11.0036 15.7052 11.0008C15.716 10.9933 15.7261 10.9853 15.7365 10.9773C15.7498 10.9668 15.763 10.9558 15.7755 10.9446C15.785 10.9362 15.794 10.9269 15.8031 10.9179C15.8149 10.9058 15.8263 10.8935 15.8371 10.8806C15.8453 10.8709 15.8531 10.8612 15.8606 10.8509C15.8709 10.8373 15.8804 10.8233 15.8897 10.8091C15.8964 10.7987 15.903 10.7882 15.9093 10.7776C15.9179 10.7625 15.9254 10.7472 15.9328 10.7317C15.9379 10.7207 15.9433 10.7097 15.9481 10.6985C15.9548 10.6819 15.9604 10.6651 15.9657 10.6483C15.9694 10.6371 15.9733 10.6261 15.9765 10.6149C15.9815 10.596 15.9849 10.5766 15.9886 10.5572C15.9903 10.5473 15.9929 10.5376 15.994 10.5275C15.9978 10.4977 16 10.468 16 10.4376V5.5625C16 5.53212 15.9976 5.50238 15.994 5.47265C15.9922 5.46209 15.989 5.45347 15.9869 5.44292H15.9879ZM7.99978 9.62638L5.56826 8.00005L7.99978 6.37351L10.4315 8.00005L7.99978 9.62638ZM7.31245 5.17919L4.33171 7.17288L1.92561 5.56336L7.31245 1.97221V5.17919ZM3.09515 7.99984L1.37531 9.15021V6.84947L3.09515 7.99984ZM4.33171 8.82765L7.31245 10.8211V14.0281L1.92561 10.4365L4.33171 8.82722V8.82765ZM8.68733 10.8207L11.6681 8.82722L14.0744 10.4365L8.68733 14.0277V10.8207ZM12.9046 8.00027L14.6247 6.84969V9.15064L12.9046 7.99984V8.00027ZM11.6681 7.17288L8.68733 5.1794V1.97221L14.0744 5.56336L11.6681 7.17288Z",fill:"black"})}),d.jsx("defs",{children:d.jsx("clipPath",{id:"clip0_6523_22409",children:d.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),codesandbox:d.jsxs("svg",{width:"14",height:"16",viewBox:"0 0 14 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("g",{clipPath:"url(#clip0_6523_22406)",children:d.jsx("path",{d:"M6.24312 14.1129V8.35021L1.28724 5.49888V8.78388L3.55732 10.0999V12.5702L6.24312 14.1129ZM7.53036 14.1468L10.2658 12.571V10.0422L12.5506 8.71812V5.47426L7.53036 8.3727V14.1468ZM11.8904 4.36906L9.25164 2.83995L6.93472 4.18436L4.60022 2.8386L1.93795 4.38817L6.90626 7.24665L11.8904 4.36906ZM0 12.0115V4.02675L6.91821 0L13.8378 4.00984V11.9988L6.91805 15.985L0 12.0115Z",fill:"black"})}),d.jsx("defs",{children:d.jsx("clipPath",{id:"clip0_6523_22406",children:d.jsx("rect",{width:"13.8378",height:"16",fill:"white"})})})]}),dailymotion:d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsxs("g",{clipPath:"url(#clip0_6523_22345)",children:[d.jsx("path",{d:"M16 0H0V16H16V0Z",fill:"white"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.73038 10.3003C8.40789 10.6268 8.00377 10.7901 7.51804 10.7901C7.04025 10.7901 6.64411 10.6308 6.32956 10.3122C6.01503 9.99367 5.85776 9.58351 5.85776 9.08176C5.85776 8.60389 6.01901 8.20766 6.3415 7.89306C6.66401 7.57847 7.06016 7.42118 7.52998 7.42118C7.84849 7.42118 8.13715 7.49484 8.39594 7.64219C8.65474 7.78953 8.8558 7.99063 8.99913 8.2455C9.14246 8.50034 9.21412 8.77908 9.21412 9.08176C9.21412 9.56757 9.05287 9.97376 8.73038 10.3003ZM9.10662 3.58632V6.35792C8.82791 6.07918 8.53131 5.87808 8.21678 5.75463C7.90223 5.63118 7.54988 5.56946 7.1597 5.56946C6.53062 5.56946 5.96527 5.72476 5.4636 6.03538C4.96193 6.34597 4.57176 6.77007 4.29305 7.30768C4.01435 7.84528 3.875 8.44062 3.875 9.09369C3.875 9.76269 4.01236 10.366 4.28708 10.9036C4.5618 11.4412 4.95197 11.8653 5.45763 12.1759C5.96328 12.4865 6.54258 12.6418 7.19553 12.6418C8.14312 12.6418 8.80403 12.3312 9.17831 11.71H9.20218V12.5595H11.0894V3.15625L9.10662 3.58632Z",fill:"#232323"})]}),d.jsx("defs",{children:d.jsx("clipPath",{id:"clip0_6523_22345",children:d.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),flickr:d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("rect",{width:"16",height:"16",fill:"white"}),d.jsxs("g",{clipPath:"url(#clip0_6523_22379)",children:[d.jsx("path",{d:"M8.43286 7.78387C8.43286 9.321 9.67925 10.5674 11.2166 10.5674C12.7538 10.5674 13.9999 9.321 13.9999 7.78387C13.9999 6.24675 12.7538 5.00061 11.2166 5.00061C9.67925 5.00061 8.43286 6.24675 8.43286 7.78387Z",fill:"#FF0084"}),d.jsx("path",{d:"M2 7.78408C2 9.32121 3.24614 10.5676 4.78352 10.5676C6.32089 10.5676 7.56703 9.32121 7.56703 7.78408C7.56703 6.24695 6.32089 5.00081 4.78352 5.00081C3.24614 5.00081 2 6.24695 2 7.78408Z",fill:"#0063DC"})]}),d.jsx("defs",{children:d.jsx("clipPath",{id:"clip0_6523_22379",children:d.jsx("rect",{width:"12",height:"5.568",fill:"white",transform:"translate(2 5)"})})})]}),giphy:d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("rect",{width:"16",height:"16",fill:"#121212"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 3.38889V12.2778H5.11111V3.38889H4Z",fill:"#00FF99"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.6663 5.61111V12.2778H11.7774V5.61111H10.6663Z",fill:"#9933FF"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.75 3H4V4.11111H8.83333V3H7.75Z",fill:"#FFF35C"}),d.jsx("path",{d:"M9.00041 4.11111H7.33374H8.83374V3.77778L9.00041 4.11111Z",fill:"#999999"}),d.jsx("path",{d:"M8.83374 4.11111H7.33374L8.44485 3L8.83374 3.77778V4.11111Z",fill:"#999237"}),d.jsx("path",{d:"M10.6663 7.44444V5.77778L11.7774 6.33333L10.6663 7.44444Z",fill:"#5C1F99"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.6667 11.8889H4V13H11.7778V11.8889H10.6667Z",fill:"#00CCFF"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.6668 5.22222V4.11111H9.55569V3H8.44458V3.90739V5.0185V6.33333H9.55569H10.6668H11.7779V5.22222H10.6668Z",fill:"#FF6666"})]}),instagram:d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:[d.jsxs("g",{clipPath:"url(#clip0_6523_22356)",children:[d.jsx("mask",{id:"mask0_6523_22356",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"16",height:"16",children:d.jsx("path",{d:"M4.70325 0.0949238C3.85627 0.1349 3.27778 0.270564 2.77227 0.468642C2.24897 0.672648 1.80537 0.946046 1.36408 1.38914C0.922279 1.83249 0.650958 2.27688 0.448504 2.8007C0.252489 3.3075 0.119662 3.88627 0.0822604 4.73377C0.045126 5.58283 0.0366102 5.85363 0.0407495 8.01522C0.0448729 10.1765 0.0544124 10.4479 0.0949012 11.2972C0.135388 12.1439 0.270546 12.7222 0.468623 13.2279C0.672886 13.7512 0.946004 14.1946 1.38935 14.6361C1.83245 15.0777 2.27708 15.3487 2.80115 15.5515C3.30744 15.7472 3.88644 15.8806 4.73369 15.9177C5.58273 15.9551 5.85379 15.9634 8.01483 15.9592C10.1769 15.9551 10.448 15.9456 11.297 15.9053C12.144 15.8648 12.722 15.7292 13.228 15.5316C13.7513 15.3268 14.1949 15.0542 14.6362 14.6109C15.0775 14.1678 15.3488 13.7231 15.5512 13.199C15.7473 12.6927 15.8806 12.1137 15.9175 11.267C15.9546 10.4174 15.9634 10.1461 15.9593 7.98478C15.9551 5.8232 15.9453 5.55239 15.9051 4.7036C15.8649 3.85609 15.7292 3.27811 15.5314 2.77208C15.3269 2.24877 15.054 1.80567 14.6109 1.36387C14.1678 0.922574 13.7232 0.650729 13.1991 0.448785C12.6926 0.252768 12.1138 0.119166 11.2666 0.0825425C10.4175 0.0448876 10.1465 0.0366393 7.98465 0.0407642C5.82336 0.0448892 5.5523 0.0541772 4.70325 0.0949238ZM4.79611 14.485C4.02004 14.4512 3.59863 14.3222 3.31776 14.2142C2.94585 14.0703 2.68046 13.8977 2.40114 13.6205C2.12234 13.3422 1.94928 13.0776 1.80408 12.7064C1.69497 12.4255 1.5637 12.0046 1.52734 11.2286C1.48788 10.3896 1.47886 10.1378 1.47498 8.01237C1.47086 5.88742 1.47859 5.63569 1.51522 4.79593C1.54848 4.02038 1.67822 3.59843 1.78602 3.31782C1.92993 2.94539 2.10196 2.68051 2.37973 2.4012C2.65801 2.12187 2.92263 1.94933 3.29402 1.80412C3.57463 1.69451 3.99555 1.56426 4.77134 1.52738C5.61084 1.48766 5.8623 1.47915 7.98723 1.47502C10.1127 1.47089 10.3644 1.47838 11.2042 1.51526C11.9797 1.54904 12.4016 1.67749 12.682 1.78607C13.0541 1.92998 13.3195 2.1015 13.5986 2.37979C13.8777 2.65808 14.0507 2.92218 14.1959 3.29435C14.3055 3.57418 14.4358 3.99562 14.4724 4.77117C14.5124 5.61068 14.5214 5.8624 14.5253 7.98736C14.5294 10.1128 14.5217 10.3646 14.4848 11.2038C14.451 11.9799 14.3223 12.4016 14.214 12.6827C14.0701 13.0543 13.898 13.3197 13.62 13.5991C13.342 13.8773 13.0774 14.0509 12.7057 14.1961C12.4256 14.3055 12.0042 14.436 11.2289 14.4729C10.3894 14.5123 10.1379 14.5214 8.01225 14.5252C5.88732 14.5294 5.63586 14.5214 4.79611 14.485ZM11.2854 3.74493C11.2864 4.27211 11.7151 4.69896 12.2422 4.69792C12.7697 4.69689 13.1965 4.2685 13.1957 3.74132C13.1947 3.21414 12.7661 2.78704 12.2386 2.78807C11.7112 2.7891 11.2844 3.21775 11.2854 3.74493ZM3.91277 8.00773C3.91714 10.2653 5.75063 12.0913 8.0076 12.0869C10.2648 12.0825 12.0919 10.2495 12.0875 7.99201C12.0831 5.73526 10.2494 3.90819 7.99188 3.91257C5.73489 3.91696 3.90837 5.75073 3.91277 8.00773ZM5.34648 8.0049C5.3439 6.53969 6.52978 5.34942 7.99471 5.34683C9.45991 5.344 10.6504 6.52937 10.6533 7.99484C10.6561 9.46031 9.47022 10.6503 8.00477 10.6532C6.53984 10.656 5.34932 9.47037 5.34648 8.0049Z",fill:"white"})}),d.jsxs("g",{mask:"url(#mask0_6523_22356)",children:[d.jsx("mask",{id:"mask1_6523_22356",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"-1",y:"-1",width:"18",height:"18",children:d.jsx("path",{d:"M16.5905 -0.583628H-0.603516V16.6106H16.5905V-0.583628Z",fill:"white"})}),d.jsxs("g",{mask:"url(#mask1_6523_22356)",children:[d.jsx("mask",{id:"mask2_6523_22356",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"-1",y:"-1",width:"18",height:"18",children:d.jsx("path",{d:"M16.6701 -0.663237H-0.683105V16.6902H16.6701V-0.663237Z",fill:"white"})}),d.jsxs("g",{mask:"url(#mask2_6523_22356)",children:[d.jsx("mask",{id:"mask3_6523_22356",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"-1",y:"-1",width:"18",height:"18",children:d.jsx("path",{d:"M16.6701 -0.663237H-0.683105V16.6902H16.6701V-0.663237Z",fill:"white"})}),d.jsx("g",{mask:"url(#mask3_6523_22356)",children:d.jsx("rect",{x:"-0.688721",y:"-0.665792",width:"17.3622",height:"17.3622",fill:"url(#pattern0)"})})]})]})]})]}),d.jsxs("defs",{children:[d.jsx("pattern",{id:"pattern0",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:d.jsx("use",{xlinkHref:"#image0_6523_22356",transform:"scale(0.000439947)"})}),d.jsx("clipPath",{id:"clip0_6523_22356",children:d.jsx("rect",{width:"16",height:"16",fill:"white"})}),d.jsx("image",{id:"image0_6523_22356",width:"2273",height:"2275",xlinkHref:"data:image/jpeg;base64,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Hbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfw5h277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3XY/hh26jfww7dRv4Yduo38MO3Ub+GHbqN/DDt1G/hh26jfww7dRv4Yduo38MO3Ub+GHbqN/DDt1G/hh26jfww7dRv4Yduo38MO3Ub+GHbqN/DDt1G/hh26jfww7dRv4Yduo38MO3Ub+GHbqN/DDt1G/hh26jfww7dRv4Yduo38MO3Ub+GHbqN/DDt1G/hh26j+GHbqP4Yduo38MO3Ub+GHbqP4Yduo/hh26j+GHbmP4YduY/hh25j+GHbmP4YduY/hh25j+GHbmP4YduY/hh25j+GHbmP4YduY/hh25j+GHbmP4YduY/hh25j+GHbmP4YduY/hh25j+GHbmNh25jYduY2HbmNh25jYduY2HbmNh24jYduI2HbiNh24jYduI2HbiNh24jYduI2HbiNh24jYduI2HbiNh24jYduI2HbiNh24jYduI2HbiNh24jYduI2HbiNh0+Nh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jhz+j7fweHn/AFd+fp9v6v8Ape79DDf1JLc930/LnmGfj9H0+v7/APAf6c32/wAQ/wCR+n/5f9383/iNaca041pxrTjWnGtONaca041pxrTjWnGtONaca041pxrTjWnGtONaca041pxrTjWnGtONaca041pxrTjWnGtONaca041pxrTjWnGtONaca041pxrTjWnGtONaca041pxrTjWnGtONaca0415xrzjXnGvONeca8415xrzjXnGvONeca8415xrzjXnGvONeca8415xrzjXnGvONeYa8w15hrzDXmGvMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMNeYa8w15hrzDXnGvONeca8415xrzjXnGvONeca041pxrTjWnGtONaca041pxrTjWnGtONacas41ZxqzjVnGrONWcas41ZxqzjVnGrONScak41JxqTjUUGooNRQaig1FBqKDTUGmoNNQaag01BpqDTUGmoNNQaag0lBpKDSUGkoNJQaSg0lBpKDSUGioNFQaKg0VBoqDRVGiqNFUaKo0FRoKjQVGgqNBUaCo0FRoKjQVGgqPXqj16o9eqPXqj16o9eqPXqj16o9eqPXqj1yo9cqPXKj1yo9cqPXLD1yw9csPXLD1yw9csPWrD1qw9asPWrD1qw9asPWrD1qw9asPWrD1qw9YsPWLD1iw9YsPWLD1iw9YsPWLD1iw9YsPWLD1iw9YsPWLD1iw9YsPWLD1iw9YsPWLD1iw9YsPWLD1aw9WsPVrD1aw9WsPVrD1aw9WsPVrD1aw9WsPVrB34/8Ay/z/AH/53yHY/wDU/E/0v+P7/wCz/9k="})]})]}),pinterest:d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsxs("g",{clipPath:"url(#clip0_6570_25513)",children:[d.jsx("rect",{width:"15.996",height:"16",rx:"2",fill:"#CC2127"}),d.jsx("path",{d:"M7.999 2C4.68555 2 2 4.68555 2 7.999C2 10.5406 3.58174 12.7102 5.81336 13.5861C5.76137 13.1121 5.71338 12.3843 5.83336 11.8644C5.94134 11.3964 6.53724 8.88285 6.53724 8.88285C6.53724 8.88285 6.35727 8.52291 6.35727 7.993C6.35727 7.15914 6.84119 6.53524 7.44309 6.53524C7.95501 6.53524 8.20297 6.91918 8.20297 7.3811C8.20297 7.89502 7.87502 8.66489 7.70705 9.37877C7.56507 9.97667 8.007 10.4626 8.5949 10.4626C9.66072 10.4626 10.4806 9.33878 10.4806 7.71505C10.4806 6.27929 9.44876 5.27345 7.975 5.27345C6.26729 5.27345 5.26546 6.55324 5.26546 7.87702C5.26546 8.39293 5.46342 8.94484 5.71138 9.24679C5.75937 9.30678 5.76737 9.35877 5.75337 9.41876C5.70738 9.60873 5.6074 10.0167 5.5874 10.0987C5.56141 10.2086 5.50142 10.2326 5.38743 10.1786C4.63756 9.83069 4.16964 8.73488 4.16964 7.85502C4.16964 5.96334 5.54541 4.22563 8.13298 4.22563C10.2146 4.22563 11.8304 5.70938 11.8304 7.69105C11.8304 9.75871 10.5266 11.4224 8.71688 11.4224C8.10898 11.4224 7.53708 11.1065 7.34111 10.7345C7.34111 10.7345 7.04116 11.8804 6.96717 12.1603C6.83119 12.6822 6.46526 13.3341 6.2213 13.732C6.7832 13.906 7.3791 14 7.997 14C11.3104 14 13.996 11.3144 13.996 8.001C13.998 4.68555 11.3124 2 7.999 2Z",fill:"white"})]}),d.jsx("defs",{children:d.jsx("clipPath",{id:"clip0_6570_25513",children:d.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),spotify:d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("g",{clipPath:"url(#clip0_6523_22402)",children:d.jsx("path",{d:"M12.6609 7.10585C10.121 5.59751 5.93158 5.45882 3.50697 6.1947C3.11759 6.31287 2.70584 6.09298 2.5879 5.70373C2.46988 5.31411 2.68945 4.90265 3.07911 4.78429C5.86241 3.93945 10.4892 4.1026 13.4132 5.83828C13.7634 6.04622 13.8782 6.49851 13.6707 6.84813C13.4629 7.19833 13.0103 7.31376 12.6609 7.10585ZM12.5777 9.33993C12.3995 9.62908 12.0215 9.71979 11.7327 9.54223C9.61522 8.24063 6.38637 7.86357 3.88123 8.624C3.55636 8.72218 3.21323 8.53899 3.11455 8.21475C3.01666 7.88989 3.19992 7.54738 3.5242 7.44859C6.38597 6.58018 9.9436 7.00081 12.3756 8.49536C12.6644 8.67322 12.7553 9.05146 12.5777 9.33993ZM11.6136 11.4855C11.472 11.7177 11.1697 11.7904 10.9383 11.6489C9.08801 10.518 6.75909 10.2627 4.01637 10.8891C3.75207 10.9497 3.48866 10.7841 3.42838 10.5198C3.36785 10.2556 3.53284 9.99217 3.79772 9.93186C6.79916 9.2457 9.37381 9.54101 11.4506 10.8101C11.6822 10.9515 11.7551 11.254 11.6136 11.4855ZM8.00002 0.120623C3.64839 0.120623 0.120605 3.64834 0.120605 7.99989C0.120605 12.352 3.64839 15.8794 8.00002 15.8794C12.3517 15.8794 15.8794 12.352 15.8794 7.99989C15.8794 3.64834 12.3517 0.120623 8.00002 0.120623Z",fill:"#1ED760"})}),d.jsx("defs",{children:d.jsx("clipPath",{id:"clip0_6523_22402",children:d.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),twitter:d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:d.jsx("path",{d:"M14.3193 4.31285C14.329 4.45301 14.329 4.59317 14.329 4.73462C14.329 9.04475 11.0516 14.0156 5.05865 14.0156V14.0131C3.28832 14.0156 1.55478 13.508 0.0644531 12.5507C0.321873 12.5817 0.580582 12.5972 0.839937 12.5979C2.30703 12.5992 3.7322 12.1063 4.88639 11.1988C3.4922 11.1724 2.26961 10.2623 1.84252 8.93366C2.3309 9.02796 2.83413 9.00858 3.31349 8.87746C1.79349 8.57001 0.699937 7.23299 0.699937 5.68023C0.699937 5.66602 0.699937 5.65246 0.699937 5.63889C1.15284 5.89144 1.65994 6.0316 2.17865 6.0471C0.747034 5.08923 0.305743 3.18251 1.17026 1.69176C2.82445 3.7296 5.2651 4.96844 7.8851 5.09956C7.62252 3.96664 7.98123 2.77947 8.82768 1.98307C10.1399 0.748096 12.2038 0.811395 13.4374 2.12452C14.167 1.98048 14.8664 1.71243 15.5064 1.33264C15.2632 2.0877 14.7541 2.72909 14.0741 3.13665C14.7199 3.06044 15.3509 2.88734 15.9451 2.62316C15.5077 3.2794 14.9567 3.85103 14.3193 4.31285Z",fill:"#1D9BF0"})}),vimeo:d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsxs("g",{clipPath:"url(#clip0_6523_22340)",children:[d.jsx("path",{d:"M16 14.4C16 15.28 15.28 16 14.4 16H1.6C0.72 16 0 15.28 0 14.4V1.6C0 0.72 0.72 0 1.6 0H14.4C15.28 0 16 0.72 16 1.6V14.4Z",fill:"#1AB7EA"}),d.jsx("path",{d:"M13.9945 5.3084C13.9391 6.42815 13.1229 7.97447 11.5458 9.93402C9.91331 11.9736 8.52987 13 7.40928 13C6.70372 13 6.12267 12.3735 5.63846 11.1338C5.32027 9.98735 4.98824 8.85427 4.67005 7.70786C4.31036 6.46814 3.92299 5.84161 3.50796 5.84161C3.42495 5.84161 3.10676 6.02824 2.56721 6.38816L2 5.68165C2.59488 5.1751 3.17593 4.68187 3.75698 4.17532C4.54554 3.52214 5.14042 3.17555 5.54162 3.13556C6.46853 3.05557 7.04958 3.66877 7.27093 4.97514C7.50612 6.40149 7.67213 7.28129 7.75514 7.62788C8.01799 8.80095 8.32235 9.40081 8.64054 9.40081C8.88956 9.40081 9.26309 9.01423 9.77497 8.2544C10.273 7.49457 10.5497 6.90804 10.5774 6.50813C10.6465 5.85494 10.3837 5.52169 9.77497 5.52169C9.48444 5.52169 9.19392 5.58834 8.88956 5.70831C9.48444 3.84206 10.605 2.94893 12.2652 3.00225C13.4826 3.02891 14.0637 3.80207 13.9945 5.3084Z",fill:"white"})]}),d.jsx("defs",{children:d.jsx("clipPath",{id:"clip0_6523_22340",children:d.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),youtube:d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("path",{d:"M15.6656 3.75817C15.4816 3.06609 14.9395 2.5211 14.2511 2.33614C13.0034 2 8 2 8 2C8 2 2.99666 2 1.7489 2.33614C1.06051 2.5211 0.518324 3.06609 0.334339 3.75817C0 5.01251 0 7.62963 0 7.62963C0 7.62963 0 10.2467 0.334339 11.5012C0.518324 12.1932 1.06051 12.7381 1.7489 12.9232C2.99666 13.2593 8 13.2593 8 13.2593C8 13.2593 13.0034 13.2593 14.2511 12.9232C14.9395 12.7381 15.4816 12.1932 15.6656 11.5012C16 10.2467 16 7.62963 16 7.62963C16 7.62963 16 5.01251 15.6656 3.75817Z",fill:"#ED1D24"}),d.jsx("path",{d:"M6.36353 10.0058L10.5453 7.62974L6.36353 5.25349V10.0058Z",fill:"white"})]})};function t7(e){const{debouncedUrl:t,content:n,onContentChange:r,selected:i}=e,o=R.useRef(null),[a,u]=R.useState(!1);Xe.useOnChange(t,()=>{var c;a&&(u(!1),(c=o.current)==null||c.reset())});function s(){u(!0),r(void 0)}return $r.toURL(t)?t===(n==null?void 0:n.embed_url)?d.jsx(X1,{content:n,selected:i}):d.jsx(m.ErrorBoundary,{ref:o,renderError:v$e,onError:s,children:d.jsx(R.Suspense,{fallback:n&&d.jsx(X1,{content:n,selected:i}),children:d.jsx(y$e,{url:t,selected:i,onContentChange:r})})}):null}function v$e(){return d.jsxs(m.Box,{backgroundColor:"grey2",borderRadius:6,padding:16,gap:4,children:[d.jsx(m.Icon,{name:"alert",size:"small",color:"grey11"}),d.jsx(m.Text,{variant:"smallBold",color:"grey11",children:"There is no embed data available."})]})}function X1(e){const{content:t,selected:n}=e,{thumbnail:r,provider:i,author:o,url:a,subtitle:u}=_$e(t);return d.jsxs(m.PreviewCard,{selected:n,children:[d.jsx(m.PreviewImage,{src:r.url,aspectRatio:r.aspectRatio}),d.jsxs(m.PreviewContent,{children:[d.jsxs(m.Box,{display:"flex",alignItems:"center",gap:4,children:[d.jsx(m$e,{provider:i}),d.jsx(m.Text,{variant:"smallBold",color:"grey12",noWrap:!0,children:i}),o&&d.jsx(m.Text,{variant:"small",color:"grey11",noWrap:!0,children:o})]}),d.jsx(m.Text,{variant:"smallBold",href:a,children:u})]})]})}function y$e(e){const{url:t,onContentChange:n,selected:r}=e,i=b$e({url:t,onContentChange:n});return d.jsx(X1,{content:i,selected:r})}function b$e(e){const{url:t,onContentChange:n}=e,{embedApiEndpoint:r}=xe(),i=nt.useRequest(C$e,[t,r]),o=Xe.useStableCallback(n);return R.useEffect(()=>{const a=m.handleEditorFlushSyncError(()=>o(i));return()=>{clearTimeout(a)}},[i,o]),i}function C$e(e,t){const n=new URL(t);return n.searchParams.set("url",e),_e.request(n,{okType:S$e(e)})}function S$e(e){return B.object({type:B.string(),version:B.string().or(B.number()).nullish(),title:B.string().nullish(),author_name:B.string().nullish(),author_url:B.string().nullish(),provider_name:B.string().nullish(),provider_url:B.string().nullish(),cache_age:B.string().or(B.number()).nullish(),thumbnail_url:B.string().nullish(),thumbnail_width:B.number().nullish(),thumbnail_height:B.number().nullish(),html:B.string().nullish()}).passthrough().transform(t=>{const n={embed_url:e};return{...n,__TYPE__:"EmbedContent",type:t.type,version:t.version,title:t.title,author_name:t.author_name,author_url:t.author_url,provider_name:t.provider_name,provider_url:t.provider_url,cache_age:t.cache_age,thumbnail_url:t.thumbnail_url,thumbnail_width:t.thumbnail_width,thumbnail_height:t.thumbnail_height,html:t.html,all:{...n,...t}}})}function _$e(e){let t="";switch(e.type){case"video":t=e.title??"";break;case"photo":t=`View this post${e.provider_name?` on ${e.provider_name}`:""}`;break;default:t=`Open${e.provider_name?` on ${e.provider_name}`:""}`}return{url:e.embed_url,thumbnail:{url:e.thumbnail_url??"",aspectRatio:e.type==="video"?"16:9":"1:1"},provider:e.provider_name??"",author:e.author_name??"",subtitle:t}}function I$e(e){const{id:t,readOnly:n,field:r,content:i,onContentChange:o}=e,a=Xe.useDebounceState({initialState:(i==null?void 0:i.embed_url)??"",startTransition:R.startTransition});function u(s){a.set(s),$r.toURL(s)||o(void 0)}return d.jsxs(m.Field,{footer:$r.toURL(a.value)&&d.jsx(m.FieldFooter,{children:d.jsx(t7,{debouncedUrl:a.debouncedValue,content:i,onContentChange:o})}),children:[d.jsx(m.FieldIcon,{name:"cloud"}),d.jsx(m.FieldLabel,{htmlFor:t,children:er(r)}),d.jsx(m.FieldControl,{children:d.jsx(Vu,{id:t,readOnly:n,placeholder:Qu(r),value:a.value,onValueChange:u,variant:$r.toURL(a.value)?"link":"normal",endAdornment:d.jsx(m.Button,{startIcon:"close",color:"grey",size:"small",disabled:!a,onClick:()=>u("")})})})]})}function n7(e){return!(e.lat>85||e.lat<-85||e.lng>180||e.lng<-180)}function Nb(e){const t=/^.*@(-?\d+.\d+),(-?\d+.\d+).*$/,n=e.match(t);if(!n)return;const r=parseFloat(n[1]??""),i=parseFloat(n[2]??"");if(isNaN(r)||isNaN(i))return;const o={lat:r,lng:i};if(n7(o))return o}function UF(e){return e?`${e.lat}, ${e.lng}`:""}function BF(e){const t=/\(?([\d|.|-]*)[\s+]*,[\s]*([\d|.|-]*)\)?/,n=e.match(t);if(!n)return Nb(e);const r=parseFloat(n[1]??""),i=parseFloat(n[2]??"");if(isNaN(r)||isNaN(i))return Nb(e);const o={lat:r,lng:i};return n7(o)?o:Nb(e)}function T$e(e){const{field:t,id:n,readOnly:r,...i}=e,{onValueChange:o,displayedValue:a,onBlur:u,clearValue:s,isValidCoordinates:c}=x$e(i);return d.jsxs(m.Field,{children:[d.jsx(m.FieldIcon,{name:"place"}),d.jsx(m.FieldLabel,{htmlFor:n,children:er(t)}),d.jsx(m.FieldControl,{children:d.jsx(Vu,{id:n,onValueChange:o,placeholder:Z1,readOnly:r,value:a,onBlur:u,variant:c?"link":"normal",endAdornment:d.jsx(m.Button,{startIcon:"close",color:"grey",size:"small",disabled:!a,onClick:s})})})]})}function x$e(e){const{content:t,onContentChange:n}=e,r=UF(t==null?void 0:t.position),[i,o]=R.useState(r);function a(){const c=BF(i);if(!c)return o(""),n(void 0);const{lat:l,lng:f}=c;o(UF({lat:l,lng:f})),n({__TYPE__:"GeoPointContent",position:{lat:l,lng:f}})}function u(){o(""),n(void 0)}const s=!!BF(i);return{displayedValue:i,isValidCoordinates:s,onValueChange:o,onBlur:a,clearValue:u}}function r7(e){const{fieldLabel:t,imageLabel:n=[]}=e;return d.jsxs(m.CardHeaderTitle,{children:[d.jsx(m.Text,{variant:"bold",noWrap:!0,children:Ip.overflow(t,30)}),n.length!==0&&d.jsx(m.Text,{color:"grey11",noSelect:!0,children:` • ${n.join(" • ")}`})]})}function i7(e){const{fieldLabel:t,isUpdating:n,readOnly:r,onMediaDialogOpenChange:i}=e;return d.jsxs(d.Fragment,{children:[d.jsx(m.CardHeader,{sx:{flexWrap:"wrap"},children:d.jsx(r7,{fieldLabel:t})}),d.jsx(m.CardContent,{children:d.jsx(m.Card,{color:"grey2",variant:"dashed",paddingBlock:12,radius:4,sx:{width:"100%"},children:d.jsx(m.CardContent,{children:d.jsxs(m.BlankSlate,{variant:"horizontal",children:[d.jsx(m.BlankSlateIcon,{name:"cloudUpload",lineColor:"purple9",backgroundColor:"purple4",size:"small"}),d.jsx(m.BlankSlateTitle,{children:n?"Preparing your image...":"You haven't selected an image"}),!r&&d.jsx(m.BlankSlateActions,{children:d.jsx(m.Button,{disabled:n,onClick:()=>i(!0),size:"medium",children:"Select image"})})]})})})})]})}const w$e=lp({id:zo(),width:jm(),height:jm(),urls:lp({full:zo(),small:zo().transform(Iwe)}),alt_description:zo().optional(),description:zo().nullable()}),$$e=lp({results:mq(w$e)}).transform(e=>e.results);function o7(e,t){const n=new URL("search/photos",e);return n.searchParams.set("page","1"),n.searchParams.set("per_page","28"),n.searchParams.set("query",t),_e.request(n,{okType:$$e})}nt.cache.registerFetcherConfig(o7,{cacheCapacity:5,revalidationStrategy:{type:"never"}});function E$e(e,t){const n=R.useRef(),r=xe(),i=nt.useRequest(o7,[e,t]);return Xe.useDebounce(t,1e3,()=>{var o;n.current&&t!==n.current&&((o=r.onAnalyticsEvent)==null||o.call(r,"Unsplash Image Searched")),n.current=t}),i}function R$e(e){const{onSelectedChange:t}=e,[n,r]=R.useTransition(),i=Xe.useDebounceState({initialState:"",ms:300,startTransition:r});return d.jsxs(m.Box,{flexDirection:"column",gap:16,width:"100%",position:"relative",children:[d.jsx(m.FormSearchInput,{value:i.value,placeholder:"Search on Unsplash.com",onValueChange:i.set}),d.jsx(m.ErrorBoundary,{renderError:()=>d.jsx(jq,{}),children:d.jsx(R.Suspense,{fallback:d.jsx(F$e,{}),children:d.jsx(O$e,{term:i.debouncedValue,loading:n,onSelectedChange:t})})})]})}function O$e(e){const{term:t,onSelectedChange:n,loading:r}=e,{media:i,toggleSelected:o,selectedImageId:a}=M$e({term:t,onSelectedChange:n});return d.jsxs(d.Fragment,{children:[d.jsx(a7,{children:i==null?void 0:i.map(u=>{const c=new URL(u.urls.full).searchParams.get("fm")??"jpg";return d.jsx(m.MediaCard,{url:u.urls.small,filename:u.description??"Unsplash Image",selected:a===u.id,onCardClick:()=>o(u),onCheckedChange:()=>o(u),extension:c,width:u.width,height:u.height,loading:r},u.id)})}),i.length===0&&d.jsx(cq,{})]})}function a7(e){const{children:t}=e;return d.jsx(m.ScrollArea,{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 250px), 1fr))",gap:16,paddingBottom:16,position:"relative",width:"100%"},children:t})}function F$e(){return d.jsx(a7,{children:gn.range(1,24).map(e=>d.jsx(Dq,{},e))})}function M$e(e){var c;const{term:t,onSelectedChange:n}=e,{unsplashApiBaseUrl:r}=xe(),i=E$e(r,t||"citrus fruit"),o=(c=i==null?void 0:i[0])==null?void 0:c.id,[a,u]=R.useState();R.useEffect(()=>{n==null||n([]),u(void 0)},[o,n]);function s(l){if(l.id===a)return u(void 0),n==null?void 0:n([]);u(l.id),n==null||n([{...l,url:l.urls.full,alt:l.alt_description}])}return{media:i,toggleSelected:s,selectedImageId:a}}function RR(e){const{open:t,onOpenChange:n,onMediaSelected:r,assetType:i}=e,o=xe(),a=o.mediaLibrary,[u,s]=R.useState(()=>a?"media":"unsplash"),[c,l]=R.useState(new Set),[f,p]=R.useState([]),A=c.size+f.length,h=nt.useFetcherData(Yi);R.useEffect(()=>{!t||!a||Mq({config:o,assetType:i})},[t,o,i,a]);function v(C){if(C!=="media"&&C!=="unsplash")throw new Error(`Invalid option ${C}.`);s(C)}function _(C){C||l(new Set),n(C)}const S=Uxe({assetType:i,mediaDialogOpen:t});function I(){var C;if(u==="unsplash"){const y=f[0];if(!y)return;r(y),(C=o.onAnalyticsEvent)==null||C.call(o,"Unsplash Image Added")}else if(u==="media"){const w=h.flatMap(M=>M.items).filter(M=>c.has(M.id))[0];if(!w)return;r(w),S(w.id)}_(!1)}function T(){if(A===0)return"Select a media item to add to the page";if(A>1)return"Only one media item can be added to the page"}const{containerRef:g}=m.useAlert();return d.jsxs(m.Dialog,{open:t,onOpenChange:_,size:{width:"min(calc(100% - 48px), 2000px)",height:"calc(100% - 30px)"},position:"center",onPointerDownOutside:C=>{g&&Xe.refContainsTarget(g,C.target)&&C.preventDefault()},children:[d.jsx(m.DialogHeader,{icon:"image",title:"Media library"}),d.jsxs(m.DialogOptions,{value:u,onValueChange:v,padding:"small",width:"auto",children:[a&&d.jsx(m.DialogOptionsItem,{value:"media",icon:"photo"}),d.jsx(m.DialogOptionsItem,{value:"unsplash",icon:"unsplash"})]}),d.jsx(m.DialogContent,{children:d.jsxs(m.Box,{flexDirection:"column",flexGrow:1,overflow:"hidden",children:[d.jsx(aq,{}),d.jsxs(m.Box,{overflow:"hidden",backgroundColor:"grey3",padding:{top:16,inline:16},flexGrow:1,children:[u==="media"&&d.jsx(Hq,{assetType:i,onSelectedChange:l}),u==="unsplash"&&d.jsx(R$e,{onSelectedChange:p})]})]})}),d.jsxs(m.DialogActions,{children:[d.jsx(m.DialogCancelButton,{}),d.jsx(m.DialogActionButton,{onClick:I,disabled:A!==1,tooltipLabel:T(),children:"Add to page"})]})]})}function u7(e){const{isMediaDialogOpen:t,selected:n,onMediaSelected:r,onMediaDialogOpenChange:i,children:o}=e;return d.jsxs(m.Card,{color:n?"indigo2":"grey2",variant:n?"selected":"dashed",paddingBlock:12,radius:4,children:[o,d.jsx(RR,{open:t,onOpenChange:i,onMediaSelected:r,assetType:"image"})]})}function s7(e){const{contentView:t,croppedImage:n}=e,{width:r,height:i,x:o,y:a,zoom:u}=n,s=L$e({origin:t.origin,croppedImage:n});return{...t,width:r,height:i,url:s,edit:{...t.edit,zoom:u,crop:{x:o,y:a}}}}function k$e(e){var c,l,f;const{field:t,content:n,thumbnail:r,croppedImage:i}=e;if(r===dd)return c7({content:n,croppedImage:i});const o=Ue.isImageContent(n),a=(l=(c=t==null?void 0:t.config)==null?void 0:c.thumbnails)==null?void 0:l.find(p=>p.name===r),u=o?(f=n.thumbnails)==null?void 0:f[r]:void 0;if(!a||!u)return n;const s=s7({contentView:u,croppedImage:i});return s.url===u.url?n:{...n,thumbnails:o?{...n.thumbnails,[r]:s}:void 0}}function c7(e){const{content:t,croppedImage:n}=e,r=s7({contentView:t,croppedImage:n});return r.url===t.url?t:{...t,...r}}function L$e(e){const{origin:t,croppedImage:n}=e,{x:r,y:i,width:o,height:a,cropHeight:u,cropWidth:s}=n,c=new URL(t.url),l=t.height!==a||t.width!==o;if(r!==0||i!==0||u!==t.height||s!==t.width){const p=[r,i,s,u].map(Math.round).join(",");c.searchParams.set("rect",p),c.searchParams.set("w",o.toString()),c.searchParams.set("h",a.toString())}return l&&(c.searchParams.set("w",o.toString()),c.searchParams.set("h",a.toString())),c.toString()}function j$e(e){const{x:t,y:n}=e.edit.crop,r=e.edit.zoom,{width:i,height:o}=e,{width:a,height:u}=e.origin,s=i/o,c=Math.min(a,u*s/r),l=c/s;return{x:t,y:n,width:i,height:o,zoom:r,cropWidth:c,cropHeight:l}}function U$e(e){const{selectedImage:t,imageCrop:n,setImageCrop:r}=e,{width:i,height:o,zoom:a,cropHeight:u,cropWidth:s}=n,c=t.contentView,l={x:n.x,y:n.y,width:s,height:u},[f,p]=R.useState(),A=(c==null?void 0:c.origin.url)??"",h=!(t!=null&&t.thumbnail.height&&(t!=null&&t.thumbnail.width));function v(g,C){const y=parseInt(C);isNaN(y)||y<=0||!h||r({...n,[g]:y})}function _(g){r({...n,cropWidth:g.width,cropHeight:g.height,x:g.x,y:g.y})}function S(g){r({...n,zoom:g})}function I(){p(Dh),r({...n,...Dh})}function T(){c&&(p(Dh),r({...n,...Dh,zoom:1,cropWidth:c.width,cropHeight:c.height}))}return d.jsxs(m.Box,{padding:{inline:24,block:16},flexDirection:"column",gap:16,height:"100%",overflowY:"auto",alignItems:"center",children:[d.jsxs(m.Box,{gap:8,height:32,alignItems:"flex-start",width:"100%",children:[d.jsx(m.Tooltip,{content:"Center",children:d.jsx(m.Button,{color:"grey",size:"medium",startIcon:"centerFocusWeak",onClick:I})}),d.jsx(m.Tooltip,{content:"Cover",children:d.jsx(m.Button,{color:"grey",size:"medium",startIcon:"zoomOutMap",onClick:T})}),d.jsx(m.Separator,{orientation:"vertical"}),d.jsx(m.FormInput,{prefix:"W",prefixTooltip:"Width",placeholder:"width",type:"number",size:"medium",value:String(i),onValueChange:g=>v("width",g),sx:{width:100},disabled:!h}),d.jsx(m.FormInput,{prefix:"H",prefixTooltip:"Height",placeholder:"height",type:"number",size:"medium",value:String(o),onValueChange:g=>v("height",g),sx:{width:100},disabled:!h})]}),d.jsx(m.Cropper,{image:A,aspect:i/o,crop:f??{x:0,y:0},onCropChange:p,zoom:a,onZoomChange:S,onCropAreaChange:(g,C)=>_(C),initialCroppedAreaPixels:l}),d.jsx(m.Box,{width:"100%",maxWidth:320,children:d.jsx(m.Slider,{min:1,max:3,step:.01,value:[a],onValueChange:([g])=>S(g??1)})})]})}const Dh={x:0,y:0};function B$e(e){const{trigger:t,initialImages:n,renderTooltip:r}=e,{open:i,onOpenChange:o,ready:a,option:u,selectedImage:s,croppedImage:c,setCroppedImage:l,setReady:f,setOption:p}=W$e(e);return d.jsxs(m.Dialog,{trigger:t,onAnimationEnd:()=>f(!0),open:i,onOpenChange:o,renderTooltip:r,children:[d.jsx(m.DialogHeader,{icon:"photo",title:"Image editor"}),d.jsx(m.DialogOptions,{value:String(u),onValueChange:A=>p(Number(A)),children:n.map((A,h)=>d.jsx(m.DialogOptionsItem,{value:String(h),icon:"photo",title:A.labels[0]??"Main",subtitle:A.labels[1]??""},A.thumbnail.name))}),s&&d.jsx(m.DialogContent,{children:a&&c&&d.jsx(U$e,{selectedImage:s,imageCrop:c,setImageCrop:l},s.thumbnail.name)})]})}function W$e(e){const{initialImages:t,initialOption:n,onClose:r}=e,[i,o]=R.useState(_),[a,u]=R.useState(!1),[s,c]=R.useState(!1),[l,f]=R.useState(n);function p(S){S?(f(n),o(_())):(c(!1),r({option:l,croppedImages:i})),u(S)}const A=t[l],h=i[(A==null?void 0:A.thumbnail.name)??""];function v(S){if(!A)return;const I=A.thumbnail.name;o({...i,[I]:S})}function _(){return t.reduce((S,I)=>(I.contentView&&(S[I.thumbnail.name]=j$e(I.contentView)),S),{})}return{open:a,ready:s,option:l,selectedImage:A,croppedImage:h,setCroppedImage:v,setReady:c,setOption:f,onClose:r,onOpenChange:p}}function K$e(e){const{id:t,readOnly:n,altText:r,onValueChange:i,selected:o}=e;return d.jsxs(m.Field,{selected:o,children:[d.jsx(m.FieldLabel,{htmlFor:t,children:"Alt text"}),d.jsx(m.FieldControl,{children:d.jsx(m.Box,{flexGrow:1,height:40,children:d.jsx(Vu,{id:t,placeholder:"Short description for the visually impaired",readOnly:n,value:r,onValueChange:i,padding:{input:{inline:12}}})})})]})}function P$e(e){const{fieldLabel:t,imageLabel:n,initialImages:r,page:i,displaySeparator:o=!0,isSVGContentView:a,visibility:u,onClear:s,onCropperDialogClose:c,onMediaDialogOpenChange:l}=e;return d.jsxs(m.Box,{display:"flex",flexDirection:"column",gap:12,children:[d.jsxs(m.Box,{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:4,children:[d.jsx(r7,{fieldLabel:t,imageLabel:n}),d.jsxs(m.CardHeaderActions,{sx:{visibility:u},children:[d.jsx(B$e,{trigger:d.jsx(m.Button,{startIcon:"crop",disabled:a}),renderTooltip:f=>d.jsx(m.Tooltip,{content:"Crop & Resize",children:f}),initialImages:r,initialOption:i,onClose:c}),d.jsx(m.Tooltip,{content:"Replace",children:d.jsx(m.Button,{startIcon:"imageSearch",hiddenLabel:"Replace",onClick:()=>l(!0)})}),d.jsx(m.Tooltip,{content:"Clear",children:d.jsx(m.Button,{onClick:s,startIcon:"delete"})})]})]}),o&&d.jsx(m.Separator,{style:"dashed",decorative:!0})]})}function D$e(e){const{documentType:t,documentUrl:n,title:r,statusColor:i,description:o,tags:a,tagsFilter:u,previewImageUrl:s,onSelect:c}=e;function l(f){return f.nativeEvent instanceof MouseEvent&&(f.metaKey||f.ctrlKey)?window.open(n,"_blank"):c()}return d.jsxs(m.Card,{paddingBlock:16,onSelect:l,children:[d.jsx(m.CardContent,{children:d.jsxs(m.Box,{justifyContent:"space-between",children:[d.jsxs(m.Box,{flexDirection:"column",gap:4,alignItems:"flex-start",flexGrow:1,children:[d.jsx(N$e,{documentType:t}),d.jsx(q$e,{title:r,statusColor:i}),d.jsx(Q$e,{description:o})]}),d.jsx(V$e,{previewImageUrl:s})]})}),a.length>0&&d.jsx(z$e,{tags:a,tagsFilter:u})]})}function N$e(e){const{documentType:t}=e;return d.jsx(m.Badge,{maxWidth:150,size:"medium",title:`Type: ${t}`,icon:"description"})}function q$e(e){const{title:t,statusColor:n}=e;return d.jsxs(m.Box,{gap:8,alignItems:"center",children:[d.jsx(m.Dot,{color:n}),d.jsx(m.Text,{variant:"bold",children:t})]})}function Q$e(e){const{description:t}=e,n=t==null?void 0:t.substring(0,150);return n?d.jsx(m.Text,{variant:"small",color:"grey11",children:`${n}${n!==t?"...":""}`}):d.jsx(m.Text,{variant:"smallItalic",color:"grey11",children:"No description available"})}function V$e(e){const{previewImageUrl:t}=e;return d.jsx(m.Box,{width:142,height:90,backgroundColor:"grey2",border:!0,borderRadius:6,flexDirection:"column",alignItems:"center",justifyContent:"center",gap:4,flexShrink:0,padding:8,children:t?d.jsx(m.Image,{src:t,sizing:"cover"}):d.jsxs(d.Fragment,{children:[d.jsx(m.Icon,{name:"hideImage",size:"large",color:"grey11"}),d.jsx(m.Text,{color:"grey11",variant:"small",children:"No preview available"})]})})}function z$e(e){const{tags:t}=e;return d.jsxs(m.CardFooter,{children:[d.jsxs(m.Box,{gap:4,alignItems:"center",children:[d.jsx(m.Icon,{name:"label",size:"small",color:"grey11"}),d.jsx(m.Text,{variant:"small",color:"grey11",children:"Tags:"})]}),d.jsx(m.TextOverflow,{children:t.map(n=>d.jsx(m.Badge,{size:"medium",title:n,sx:{marginRight:8}},n))})]})}function H$e(e){var g,C;const{searchTerm:t,tagsFilter:n,typesFilter:r,localesFilter:i}=e,o=xe();o.searchDocuments||Bn("searchDocuments");const{coreApiBaseUrl:a,documentSearchBaseUrl:u,authStrategy:s,status:c,documentListOpenSearchEnabled:l,repository:f}=o,p=l===!1;function A(){return p?W0({tags:[...Rn.map(n,y=>y.id)],customTypes:[...Rn.map(r,y=>y.id)],language:[...Rn.map(i,y=>y.id)],term:[t]}):bq({repository:f,searchTerm:t,customTypesIds:[...Rn.map(r,y=>y.id)],tags:[...Rn.map(n,y=>y.id)],localeId:[...Rn.map(i,y=>y.id)][0]})}const[h,v]=R.useState([]),[_,S]=R.useState(""),I=A(),T=nt.useRequest(l7,[a,u,s,I,c,p]);return I!==_?(S(I),v(T.results)):T.results.length>0&&((g=gn.last(h))==null?void 0:g.id)!==((C=gn.last(T.results))==null?void 0:C.id)&&v(y=>y.concat(T.results)),{documents:h,response:T}}nt.cache.registerFetcherConfig(l7,{cacheCapacity:500,revalidationStrategy:{type:"never"}});async function l7(e,t,n,r,i,o){const a=oq[i];if(o){const l=await B0(e,n,r,200);return WF(l,a)}const u=await yq(t,n,r),s=await Sq(e,n,u.results.map(({id:c})=>c));return WF(s,a)}function WF(e,t){return{results:e.results.flatMap(r=>{const i=r.versions.filter(o=>t.includes(o.status));return i.length===0?[]:{...r,versions:i}})}}function KF(){const e=xe();e.searchDocuments||Bn("searchDocuments");const{coreApiBaseUrl:t,authStrategy:n}=e,r=nt.useRequest(_q,[t,n]);return new Set(r.languages.map(i=>({id:i.id,label:i.name})))}function Y$e(){const e=xe();e.searchDocuments||Bn("searchDocuments");const{coreApiBaseUrl:t,authStrategy:n}=e,r=nt.useRequest(Tq,[t,n]);return new Set(r.results.map(i=>({id:i,label:i})))}function G$e(){const e=xe();e.searchDocuments||Bn("searchDocuments");const{customTypesApiBaseUrl:t,repository:n,authStrategy:r}=e,i=nt.useRequest(gq,[t,n,r]);return new Set(i)}function J$e(e,t){const n=xe(),r=Xe.useDebounceState({initialState:""}),[i,o]=R.useState(new Set),[a,u]=R.useState(new Set);function s(){return!n.searchDocuments||!n.localeId?new Set:new Set([{id:n.localeId,label:n.localeId}])}const[c,l]=R.useState(s),f=Rn.union(a,Um(e)),p=Rn.union(i,Um(t));return{searchTerm:r,filteredTags:i,setFilteredTags:o,filteredCustomTypes:a,setFilteredCustomTypes:u,filteredLocales:c,setFilteredLocales:l,typesFilter:f,tagsFilter:p}}function Um(e){return e?Rn.map(e,t=>({id:t,label:t})):new Set}function Z$e(e){const{filteredLocales:t,setFilteredLocales:n,filteredTags:r,setFilteredTags:i,filteredCustomTypes:o,setFilteredCustomTypes:a,fixedTags:u,fixedCustomTypes:s}=e;return d.jsxs(d.Fragment,{children:[d.jsx(eEe,{selectedValues:t,onSelectedValuesChange:n}),d.jsx(eC,{selectedValues:r,fixedSelectedValues:Um(u),onSelectedValuesChange:i,label:"Tags",icon:"label",fetchFilters:Y$e}),d.jsx(eC,{selectedValues:o,fixedSelectedValues:Um(s),onSelectedValuesChange:a,label:"Type",icon:"description",fetchFilters:G$e})]})}function eC(e){const[t,n]=R.useState(!1),r=R.useRef(null);return d.jsx(m.ErrorBoundary,{ref:r,renderError:()=>{var i;return d.jsx(m.FilterField,{mode:"error",onErrorRetry:(i=r.current)==null?void 0:i.reset,open:t,setOpen:n,values:new Set,...e})},children:d.jsx(R.Suspense,{fallback:d.jsx(m.FilterField,{mode:"loading",open:t,setOpen:n,values:new Set,...e}),children:d.jsx(X$e,{open:t,setOpen:n,...e})})})}function X$e(e){const{open:t,setOpen:n,onSelectedValuesChange:r,fixedSelectedValues:i,selectedValues:o,label:a,icon:u,fetchFilters:s,multiple:c}=e,l=s();return d.jsx(m.FilterField,{open:t,setOpen:n,label:a,icon:u,selectedValues:o,values:new Set(l),fixedSelectedValues:i,onSelectedValuesChange:r,multiple:c})}function eEe(e){const{selectedValues:t,onSelectedValuesChange:n}=e,[r,i]=R.useState(Rn.first(t));function o(u){n(u),i(Rn.first(u))}const a=Rn.find(KF(),u=>{var s;return u.id===((s=Rn.first(t))==null?void 0:s.id)});return(a==null?void 0:a.label)!==(r==null?void 0:r.label)&&i(a),d.jsx(eC,{selectedValues:new Set(r?[r]:[]),onSelectedValuesChange:o,label:"Locale",icon:"public",fetchFilters:KF,multiple:!1})}function f7(e){const{onSelectDocument:t,fixedCustomTypes:n,fixedTags:r,...i}=e,o=xe(),{searchTerm:a,filteredTags:u,setFilteredTags:s,filteredCustomTypes:c,setFilteredCustomTypes:l,filteredLocales:f,setFilteredLocales:p,typesFilter:A,tagsFilter:h}=J$e(n,r),[v,_]=R.useTransition();return d.jsx(m.Dialog,{size:{height:727,width:656},hasClose:!1,...i,children:d.jsx(m.DialogContent,{children:d.jsxs(m.Box,{flexDirection:"column",height:"100%",children:[d.jsxs(m.Box,{padding:{top:16,inline:16,bottom:8},flexDirection:"column",gap:12,children:[d.jsx(m.FormInput,{value:a.value,onValueChange:a.set,placeholder:"Search a page",icon:"search"}),o.searchDocuments&&d.jsx(Z$e,{filteredTags:u,setFilteredTags:s,filteredCustomTypes:c,setFilteredCustomTypes:l,filteredLocales:f,setFilteredLocales:p,fixedTags:r,fixedCustomTypes:n}),d.jsx(m.Text,{variant:"smallBold",color:"grey11",children:"Link to a document"})]}),o.searchDocuments?d.jsx(m.ErrorBoundary,{renderError:nEe,children:d.jsx(R.Suspense,{fallback:d.jsx(iEe,{}),children:d.jsx(rEe,{searchTerm:a.debouncedValue,tagsFilter:h,typesFilter:A,localesFilter:f,startTransition:_,onSelectDocument:t})})}):d.jsx(d7,{message:"Slice Machine does not yet support mock data for linked documents in the simulator."}),d.jsx(tEe,{isLoading:v})]})})})}function tEe(e){const{isLoading:t}=e;return d.jsx(m.Toast,{anchor:d.jsx(m.Box,{position:"relative",width:"100%",justifyContent:"center",bottom:72}),loadingIndicator:!0,open:t,title:"Loading more results ...",seconds:1})}function nEe(){return d.jsx(m.Box,{height:"100%",flexDirection:"column",alignItems:"center",justifyContent:"center",children:d.jsx(m.DefaultErrorMessage,{title:"Request failed",description:"An error occurred while fetching documents.",errorImageSrc:m.dialogErrorImage})})}function rEe(e){const{searchTerm:t,tagsFilter:n,typesFilter:r,localesFilter:i,onSelectDocument:o}=e,{documents:a}=H$e({searchTerm:t,tagsFilter:n,localesFilter:i,typesFilter:r}),u=xe();return d.jsxs(m.ScrollArea,{style:{flexGrow:1,paddingTop:m.theme.space[10],paddingBottom:m.theme.space[16],paddingInline:m.theme.space[16],display:"flex",flexDirection:"column",gap:m.theme.space[12]},children:[a.length===0&&d.jsx(d7,{}),a.map(s=>{const c=s.versions[0];if(!c)return null;const l=_R({documentId:s.id,versionId:c.status==="archived"?c.version_id:void 0,releaseId:c.status==="release"?c.release_id:void 0,status:c.status,baseUrl:u.baseUrl}),f=oEe({tags:c.tags,tagsFilter:n});return d.jsx(D$e,{documentType:c.custom_type_label,documentUrl:l,description:c.preview_summary,tags:f,title:s.title,previewImageUrl:c.preview_image,onSelect:()=>o(s.id),statusColor:iq[c.status].color},`${s.id}-${c.status}`)})]})}function d7(e){const{message:t="We can't find any versions matching this request"}=e,n="Oops!";return d.jsx(m.Box,{justifyContent:"center",flexDirection:"column",height:"100%",children:d.jsxs(m.BlankSlate,{children:[d.jsx(m.BlankSlateIcon,{name:"close",lineColor:"purple10",backgroundColor:"purple3",borderColor:"purple6",borderStyle:"dashed",size:"xlarge"}),d.jsx(m.BlankSlateTitle,{size:"big",children:n}),d.jsx(m.BlankSlateDescription,{width:360,children:t})]})})}function iEe(){return d.jsx(m.Box,{flexDirection:"column",gap:12,padding:{top:10,inline:16,bottom:16},children:gn.range(1,5).map(e=>d.jsx(m.Skeleton,{height:150},e))})}function oEe(e){const{tags:t,tagsFilter:n}=e,r=[...n].map(o=>o.label).reverse();return gn.sort(t,o=>-r.indexOf(o))}function p7(e){const{hasLink:t,onUnlink:n,selectEnabled:r,selectedType:i,onValueChange:o,openInNewTab:a=!0,condensedButtons:u=!1,setOpenInNewTab:s}=e,c=s&&i==="web",l=a?"checkBox":"checkBoxOutlinedBlank";return d.jsxs(d.Fragment,{children:[c&&d.jsx(m.Tooltip,{content:"Open in new tab",visible:u,children:d.jsx(m.Button,{startIcon:l,color:"grey",size:"small",onClick:()=>s(!a),children:u?"":"Open in new tab"})}),d.jsxs(m.Select,{value:i,color:"grey",size:"small",boldTriggerText:!0,startIcon:aEe(i),disabled:!r,onValueChange:o,placeholder:u?"":gd("placeholder"),onlyStartIcon:u&&!!i,renderTrigger:({button:f})=>d.jsx(m.Tooltip,{content:gd(i),visible:u,children:f}),children:[d.jsx(m.SelectItem,{value:"web",icon:"public",children:gd("web")}),d.jsx(m.SelectItem,{value:"document",icon:"description",children:gd("document")}),d.jsx(m.SelectItem,{value:"media",icon:"image",children:gd("media")})]}),d.jsx(m.Button,{startIcon:"close",color:"grey",size:"small",disabled:!t,onClick:n})]})}function gd(e){if(!e||e==="placeholder")return"Choose link type";switch(e){case"document":return"Link to Prismic page";case"web":return"Link to web page";case"media":return"Link to media"}}function aEe(e){if(e)switch(e){case"document":return"description";case"web":return"public";case"media":return"image"}}function uEe(e){var y;const{field:t,content:n,onContentChange:r}=e,i=h(),[o,a]=R.useState(A),[u,s]=R.useState(()=>(n==null?void 0:n.value.__TYPE__)==="ExternalLink"?n.value.target:""),[c,l]=R.useState(!1),f=R.useRef(null);Xe.useOnChange(i,T);const p=o?sEe[o]:void 0;function A(){var x,w;return!((x=t.config)!=null&&x.select)||n!=null&&n.value.__TYPE__?n==null?void 0:n.value.__TYPE__:PF[(w=t.config)==null?void 0:w.select]}function h(){return n?n.value.__TYPE__==="DocumentLink"?n.value.id:n.value.__TYPE__==="ExternalLink"?n.value.url:n.value.name:""}function v(x){if(!x)return r(void 0);switch(o){case"ExternalLink":return r({__TYPE__:"LinkContent",value:{__TYPE__:"ExternalLink",url:x,target:u}});case"DocumentLink":return r({__TYPE__:"LinkContent",value:{__TYPE__:"DocumentLink",id:x}});case"FileLink":case"ImageLink":case void 0:return r(void 0)}}function _(x){a(PF[x]),v("")}function S(x){v(x)}function I(){l(!0)}function T(){var x;c&&(l(!1),(x=f.current)==null||x.reset())}function g(x){const w=x?"_blank":null;s(w),r({__TYPE__:"LinkContent",value:{__TYPE__:"ExternalLink",url:i,target:w}})}function C(x){r(h7({media:x}))}return{contentType:o,selectType:p,fieldValue:i,onValueChange:v,onTypeChange:_,placeholder:Qu(t),isTypeSelectEnabled:!((y=t.config)!=null&&y.select),onDocumentSelected:S,onError:I,errorBoundaryRef:f,isTargetNewTab:u==="_blank",updateWebLinkTarget:g,onMediaSelected:C}}const sEe={DocumentLink:"document",ExternalLink:"web",FileLink:"media",ImageLink:"media"},PF={document:"DocumentLink",web:"ExternalLink",media:"FileLink"};function cEe(e){const t=xe();t.searchDocuments||Bn("searchDocuments");const{coreApiBaseUrl:n,authStrategy:r}=t;return nt.useRequest(A7,[n,r,e]).title}const lEe=lp({id:zo(),title:zo()});function A7(e,t,n){return _e.request(new URL(`documents/${n}`,e),{credentials:_e.getRequestCredentials(t),okType:lEe})}nt.cache.registerFetcherConfig(A7,{concurrency:50});function h7(e){var i,o,a,u,s,c;const{media:t}=e,n="kind"in t;return n&&t.kind==="image"?{__TYPE__:"LinkContent",value:{__TYPE__:"ImageLink",id:t.id,name:t.filename,url:t.url,kind:t.kind,size:t.size.toString(),height:((i=t.height)==null?void 0:i.toString())??`${Xa}`,width:((o=t.width)==null?void 0:o.toString())??`${Xa}`,date:((a=t.last_modified)==null?void 0:a.toString())??""}}:n?{__TYPE__:"LinkContent",value:{__TYPE__:"FileLink",id:t.id,name:t.filename,kind:t.kind,url:t.url,size:t.size.toString(),date:((u=t.last_modified)==null?void 0:u.toString())??""}}:{__TYPE__:"LinkContent",value:{__TYPE__:"ImageLink",id:t.id,name:(t==null?void 0:t.alt)??t.url,kind:"image",url:t.url,size:"0",height:((s=t.height)==null?void 0:s.toString())??`${Xa}`,width:((c=t.width)==null?void 0:c.toString())??`${Xa}`}}}function m7(e){var J,Z;const{content:t,field:n,id:r,onContentChange:i,readOnly:o=!1,condensedButtons:a=!1}=e,[u,s]=R.useState(!1),[c,l]=R.useState(!1),[f,p]=R.useState(!1),[A,h]=R.useState(!1),{contentType:v,fieldValue:_,errorBoundaryRef:S,onDocumentSelected:I,onError:T,onMediaSelected:g,...C}=uEe({content:t,field:n,onContentChange:i}),y=u||c,x=o||!v,w=v==="DocumentLink"&&_!=="",M=v==="ImageLink"||v==="FileLink",F=v==="ExternalLink"&&$r.toURL(_),K={id:r,contentType:v,onBlur:()=>s(!1),onFocus:()=>{s(!0),v==="DocumentLink"&&p(!0),v==="FileLink"&&h(!0),v==="ImageLink"&&h(!0)},readOnly:x,textType:F||M?"link":"normal",value:_,condensedButtons:a,...C},{searchDocuments:N}=xe();return d.jsxs(d.Fragment,{children:[d.jsxs(m.Popover,{onMouseOverChange:l,open:y,align:"start",sideOffset:-3,openDelay:100,closeDelay:200,focusOnEnter:!1,anchor:d.jsxs(m.Field,{onMouseOverChange:s,children:[d.jsx(m.FieldIcon,{name:"link"}),d.jsx(m.FieldLabel,{htmlFor:r,children:er(n)}),d.jsx(m.FieldControl,{children:w&&N?d.jsx(pEe,{errorBoundaryRef:S,onError:T,fallback:d.jsx(tC,{...K,value:"..."}),renderError:()=>fEe(K),children:d.jsx(dEe,{...K,documentId:_,openDocumentListModal:()=>p(!0)})}):d.jsx(tC,{...K})})]}),children:[F&&d.jsx(m.LinkDescriptionCard,{url:F,title:$r.getUrlTitle(F)??"",subTitle:F.toString()}),(t==null?void 0:t.value.__TYPE__)==="ImageLink"&&d.jsx(m.LinkImageCard,{url:t.value.url,title:t.value.name,subTitle:`${t.value.width} x ${t.value.height} pixels`})]}),d.jsx(RR,{open:A,onOpenChange:h,onMediaSelected:g,assetType:"all"}),d.jsx(f7,{open:f,onOpenChange:p,onSelectDocument:ae=>{p(!1),I(ae)},fixedCustomTypes:new Set((J=n.config)==null?void 0:J.customtypes),fixedTags:new Set((Z=n.config)==null?void 0:Z.tags)})]})}function fEe(e){return d.jsx(tC,{...e,textType:"link"})}function tC(e){const{id:t,onValueChange:n,placeholder:r,readOnly:i,value:o,textType:a,onFocus:u,onBlur:s,contentType:c,isTypeSelectEnabled:l,selectType:f,onTypeChange:p,isTargetNewTab:A,condensedButtons:h,updateWebLinkTarget:v}=e,_=c==="DocumentLink"||c==="ImageLink"||c==="FileLink";return d.jsx(Vu,{id:t,onValueChange:n,placeholder:r,readOnly:i||_,value:o,variant:a,onFocus:u,onBlur:s,cursor:_?"pointer":"text",endAdornment:d.jsx(p7,{hasLink:!!o,onUnlink:()=>n(""),selectEnabled:l,selectedType:f,onValueChange:p,openInNewTab:A,condensedButtons:h,setOpenInNewTab:v})})}function dEe(e){const{id:t,documentId:n,openDocumentListModal:r,onValueChange:i,isTypeSelectEnabled:o,selectType:a,condensedButtons:u,onTypeChange:s}=e,c=cEe(n);return d.jsx(Vu,{id:t,readOnly:!0,value:c,variant:"link",onFocus:r,cursor:"pointer",endAdornment:d.jsx(p7,{hasLink:!0,onUnlink:()=>i(""),selectEnabled:o,selectedType:a,condensedButtons:u,onValueChange:s})})}function pEe(e){const{errorBoundaryRef:t,onError:n,children:r,fallback:i,renderError:o}=e;return d.jsx(m.ErrorBoundary,{ref:t,onError:n,renderError:o,children:d.jsx(R.Suspense,{fallback:i,children:r})})}function AEe(e){const{linkTo:t,onLinkToChange:n}=e;return d.jsx(m7,{content:hEe(t),onContentChange:r=>n(mEe(r)),field:{type:"Link",config:{label:"Link",allowTargetBlank:!0}},condensedButtons:!0})}function hEe(e){return e?{__TYPE__:"LinkContent",value:e}:void 0}function mEe(e){return e?e.value:void 0}function g7(e){var g,C;const{allContentViews:t,content:n,contentView:r,fieldLabel:i,id:o,imageLabel:a,initialImages:u,isUpdating:s,page:c=0,readOnly:l,thumbnailName:f,onClear:p,onContentChange:A,onCropperDialogClose:h,onPageChange:v=()=>{},onMediaDialogOpenChange:_}=e,S=((C=(g=n==null?void 0:n.url)==null?void 0:g.split("?")[0])==null?void 0:C.slice(-4))===".svg",I=n!=null&&n.url&&!l?"visible":"hidden",T=!Ue.isImageContent(n);return d.jsxs(m.Box,{display:"flex",gap:12,padding:{inline:12},children:[d.jsx(m.Box,{children:d.jsx(m.Carousel,{getItemSource:Twe,items:t,onPageChange:v,page:c,buttonSize:"small",renderPrevTooltip:y=>d.jsx(m.Tooltip,{content:"Previous",children:y}),renderNextTooltip:y=>d.jsx(m.Tooltip,{content:"Next",children:y}),style:T?{width:181,height:142}:{width:123,height:93},children:y=>(y==null?void 0:y.url)&&d.jsx(m.CarouselItem,{"aria-label":"Image Field Item",src:Qq(y.url),alt:y.alt??void 0,isUpdating:s,disableAnimation:T},`${f}_${y.url}`)})}),d.jsxs(m.Box,{width:"100%",display:"flex",flexDirection:"column",gap:T?16:12,children:[d.jsx(P$e,{fieldLabel:i,imageLabel:a,initialImages:u,page:c,displaySeparator:!T,isSVGContentView:S,visibility:I,onClear:p,onCropperDialogClose:h,onMediaDialogOpenChange:_}),d.jsx(K$e,{id:o,readOnly:l||!r,altText:(r==null?void 0:r.alt)??"",onValueChange:y=>{r&&A(Cwe(f,n,r,y))}}),T&&d.jsx(AEe,{linkTo:n.linkTo,onLinkToChange:y=>{A({...n,linkTo:y})}})]})]})}function gEe(e){const{content:t,onContentChange:n,field:r}=e,[i,o]=R.useState(0),[a,u]=R.useTransition(),s=vEe(r),c=s[i],l=t?bwe(r,t):void 0,f=l==null?void 0:l[i];function p(_){if(!c)return;const S=xwe(c.name,r,t,_);S!==t&&u(()=>n(S))}function A(_){u(()=>o(_))}function h({option:_,croppedImages:S}){if(o(_),!t)return;const I=Object.entries(S).reduce((T,[g,C])=>k$e({field:r,content:T,thumbnail:g,croppedImage:C}),t);I!==t&&u(()=>n(I))}function v(){o==null||o(0),n(void 0)}return{onCropperDialogClose:h,onPageChange:A,onMediaSelected:p,isUpdating:a,page:i,thumbnail:c,allThumbnails:s,allContentViews:l,contentView:f,onClear:v}}function vEe(e){return R.useMemo(()=>ywe(e),[e])}function yEe(e){const{content:t,field:n,id:r,onContentChange:i,readOnly:o}=e,a=t&&t.origin.url.length>0,{onCropperDialogClose:u,onPageChange:s,onMediaSelected:c,isUpdating:l,page:f,thumbnail:p,allThumbnails:A,allContentViews:h,contentView:v,onClear:_}=gEe({field:n,content:t,onContentChange:i}),[S,I]=R.useState(!1),T=er(n),g=A.map((x,w)=>{const M=h==null?void 0:h[w];return{thumbnail:x,contentView:M,labels:J1(x,t,M)}}),C=p&&a?J1(p,t,v).filter(to.isDefined):[],y=p&&t&&a&&h;return d.jsx(u7,{isMediaDialogOpen:S,onMediaSelected:c,onMediaDialogOpenChange:I,children:d.jsx(R.Suspense,{fallback:d.jsx("div",{style:{height:95}}),children:y?d.jsx(g7,{allContentViews:h,content:t,contentView:v,fieldLabel:T,id:r,imageLabel:C,initialImages:g,isUpdating:l,page:f,readOnly:o,thumbnailName:p.name,onClear:_,onContentChange:i,onCropperDialogClose:u,onMediaDialogOpenChange:I,onPageChange:s}):d.jsx(i7,{fieldLabel:T,isUpdating:l,readOnly:o,onMediaDialogOpenChange:I})})})}function bEe(e){var _,S;const{searchTerm:t,catalogId:n}=e,r=xe();r.integrationFields||Bn("integrationFields");const{integrationFieldsApiBaseUrl:i,repository:o,authStrategy:a}=r,[u,s]=R.useState(1),[c,l]=R.useState([]),[f,p]=R.useState(""),A=nt.useRequest(CEe,[i,a,o,n,t,t===f?u:1]);t!==f?(p(t),s(1),l(A.items)):A.items.length>0&&((_=gn.last(c))==null?void 0:_.id)!==((S=gn.last(A.items))==null?void 0:S.id)&&l(I=>I.concat(A.items));const h=u<A.totalPages;function v(){h&&s(I=>I+1)}return{items:c,response:A,fetchNextPage:v,hasNextPage:h}}function CEe(e,t,n,r,i,o=1,a=30){const u=new URL(`if/search/${r}`,e);return u.searchParams.set("searchTerm",i),u.searchParams.set("limit",a.toString()),u.searchParams.set("page",o.toString()),_e.request(u,{headers:{repository:n},credentials:_e.getRequestCredentials(t),okType:SEe})}const v7=B.object({id:B.string(),title:B.string(),imageURL:B.string().optional(),description:B.string().optional()}),SEe=B.object({items:B.array(v7),totalPages:B.number(),page:B.number()});function y7(e){const{itemId:t,catalogId:n}=e,r=xe();r.integrationFields||Bn("integrationFields");const{integrationFieldsApiBaseUrl:i,repository:o,authStrategy:a}=r,s=nt.useRequest(_Ee,[i,a,o,n,t]).items[0];if(!s)throw new Error("Item not found");return{item:s}}function _Ee(e,t,n,r,i){const o=new URL(`if/read/${r}`,e);return o.searchParams.set("ids",[i].toString()),_e.request(o,{headers:{repository:n},credentials:_e.getRequestCredentials(t),okType:IEe})}const IEe=B.object({items:B.array(v7)});function OR(e){const{item:t,onClick:n,catalogId:r}=e;return d.jsxs(m.PreviewCard,{variant:"large",onClick:n,children:[d.jsx(TEe,{src:t.imageURL??"",alt:t.title}),d.jsxs(m.PreviewContent,{children:[d.jsx(m.Badge,{title:`Catalog: ${r}`,icon:"multipleStop",size:"medium"}),d.jsx(m.Text,{variant:"bold",color:"grey12",sx:{marginTop:4},children:t.title}),d.jsx(m.Text,{variant:"small",color:"grey11",children:t.description??t.id})]})]})}const Nh=76;function TEe(e){const{src:t,alt:n}=e;return t?d.jsx(m.PreviewImage,{src:t,alt:n,width:Nh,height:Nh,framed:!0}):d.jsxs(m.Box,{borderRadius:6,backgroundColor:"grey2",height:Nh,width:Nh,flexDirection:"column",alignItems:"center",justifyContent:"center",border:!0,padding:{inline:4,block:8},children:[d.jsx(m.Icon,{name:"hideImage",size:"large",color:"grey11"}),d.jsx(m.Text,{color:"grey11",variant:"small",noSelect:!0,align:"center",children:"No preview image"})]})}function el(){return d.jsxs(m.PreviewCard,{variant:"large",children:[d.jsx(m.Skeleton,{height:76,width:76}),d.jsxs(m.PreviewContent,{children:[d.jsx(m.Skeleton,{height:24,width:168}),d.jsx(m.Skeleton,{height:24,width:240,sx:{marginTop:4}}),d.jsx(m.Skeleton,{height:16,width:144})]})]})}function xEe(e){const{open:t,onOpenChange:n,catalogId:r,onSelectItem:i}=e,o=Xe.useDebounceState({initialState:""}),a=xe();return d.jsx(m.Dialog,{open:t,onOpenChange:n,hasClose:!1,size:{width:612,height:724},children:d.jsx(m.DialogContent,{children:d.jsxs(m.Box,{flexDirection:"column",height:"100%",children:[d.jsxs(m.Box,{padding:{top:16,inline:16},flexDirection:"column",gap:8,children:[d.jsx(m.FormSearchInput,{value:o.value,onValueChange:o.set,placeholder:"Search in your catalog"}),d.jsx(m.Text,{variant:"smallBold",color:"grey11",children:"Select an item"})]}),a.integrationFields?d.jsx(m.ErrorBoundary,{renderError:()=>d.jsx(nC,{message:"There was an error while fetching your catalog items."}),children:d.jsx(R.Suspense,{fallback:d.jsxs(m.Box,{flexDirection:"column",gap:12,padding:{top:10,inline:16,bottom:16},children:[d.jsx(el,{}),d.jsx(el,{}),d.jsx(el,{}),d.jsx(el,{}),d.jsx(el,{})]}),children:d.jsx($Ee,{searchTerm:o.debouncedValue,catalogId:r,onItemClick:i})})}):d.jsx(nC,{message:"Slice Machine does not yet support mock data for integration field in the simulator."})]})})})}function wEe(e){const{isLoading:t}=e;return d.jsx(m.Toast,{anchor:d.jsx(m.Box,{position:"relative",width:"100%",justifyContent:"center",bottom:72}),loadingIndicator:!0,open:t,title:"Loading more results ...",seconds:1})}function $Ee(e){const{catalogId:t,searchTerm:n,onItemClick:r}=e,[i,o]=R.useTransition(),{items:a,hasNextPage:u,fetchNextPage:s}=bEe({catalogId:t,searchTerm:n});return d.jsxs(d.Fragment,{children:[d.jsx(m.ScrollArea,{onScrollToBottom:()=>u&&o(s),style:{flexGrow:1,paddingTop:m.theme.space[10],paddingBottom:m.theme.space[16],paddingInline:m.theme.space[16],display:"flex",flexDirection:"column",gap:m.theme.space[12]},threshold:252,children:a.length===0?d.jsx(nC,{}):a.map(c=>d.jsx(OR,{item:c,catalogId:t,onClick:()=>r(c)},c.id))}),d.jsx(wEe,{isLoading:i})]})}function nC(e){const{message:t="We can't find any items matching your search"}=e,n="Oops!";return d.jsx(m.Box,{justifyContent:"center",flexDirection:"column",height:"100%",children:d.jsxs(m.BlankSlate,{children:[d.jsx(m.BlankSlateIcon,{name:"close",lineColor:"purple10",backgroundColor:"purple3",borderColor:"purple6",borderStyle:"dashed",size:"xlarge"}),d.jsx(m.BlankSlateTitle,{size:"big",children:n}),d.jsx(m.BlankSlateDescription,{width:360,children:t})]})})}function EEe(e){const{itemId:t,item:n}=e,r=xe();return t&&n&&n.id===t?d.jsx(tl,{...e,value:n.title}):t&&r.integrationFields?d.jsx(m.ErrorBoundary,{renderError:()=>d.jsx(tl,{...e,value:t}),children:d.jsx(R.Suspense,{fallback:d.jsx(tl,{...e,value:t}),children:d.jsx(FEe,{...e,itemId:t})},t)},t):t&&!r.integrationFields?d.jsx(tl,{...e,value:t}):d.jsx(tl,{...e,value:""})}function REe(e){const{catalogId:t,itemId:n,item:r}=e,i=xe();return n&&r&&r.id===n?d.jsx(m.FieldFooter,{children:d.jsx(OR,{catalogId:t,item:r})}):n&&i.integrationFields?d.jsx(m.ErrorBoundary,{renderError:()=>null,children:d.jsx(m.FieldFooter,{children:d.jsx(R.Suspense,{fallback:d.jsx(el,{}),children:d.jsx(OEe,{catalogId:t,itemId:n})},n)})},n):null}function OEe(e){const{itemId:t,catalogId:n}=e,{item:r}=y7({catalogId:n,itemId:t});return d.jsx(OR,{catalogId:n,item:r})}function tl(e){const{id:t,field:n,readOnly:r,value:i,onFocus:o,onClearItem:a}=e;return d.jsx(Vu,{id:t,placeholder:Qu(n),readOnly:!0,variant:"link",value:i,...!r&&{cursor:"pointer",onFocus:o},endAdornment:d.jsx(m.Button,{startIcon:"close",color:"grey",size:"small",disabled:!i,onClick:a})})}function FEe(e){const{itemId:t,catalogId:n}=e,{item:r}=y7({catalogId:n,itemId:t});return d.jsx(tl,{...e,value:r.title})}function MEe(e){var A;const{id:t,field:n,content:r,readOnly:i,onContentChange:o}=e,[a,u]=R.useState(!1),[s,c]=R.useState(),l=(A=n.config)==null?void 0:A.catalog;if(!l)return null;function f(h){o({value:h.id,__TYPE__:"IntegrationFieldsContent"}),c(h),u(!1)}function p(){o(void 0),c(void 0)}return d.jsxs(d.Fragment,{children:[d.jsxs(m.Field,{footer:d.jsx(REe,{catalogId:l,item:s,itemId:r==null?void 0:r.value}),children:[d.jsx(m.FieldIcon,{name:"multipleStop"}),d.jsx(m.FieldLabel,{htmlFor:t,children:er(n)}),d.jsx(m.FieldControl,{children:d.jsx(EEe,{id:t,field:n,readOnly:i,catalogId:l,item:s,itemId:r==null?void 0:r.value,onFocus:()=>u(!0),onClearItem:p})})]}),d.jsx(xEe,{open:a,onOpenChange:u,catalogId:l,onSelectItem:f})]})}function kEe(e){const{content:t,field:n,id:r,onContentChange:i,readOnly:o}=e;return d.jsxs(m.Field,{children:[d.jsx(m.FieldIcon,{name:"notes"}),d.jsx(m.FieldLabel,{htmlFor:r,children:er(n)}),d.jsx(m.FieldControl,{children:d.jsx(m.TextArea,{id:r,placeholder:Qu(n),readOnly:o,paddingLeft:4,paddingRight:12,sx:{flexGrow:1},value:(t==null?void 0:t.value)??"",onChange:a=>{i(LEe(a))}})})]})}function LEe(e){return e.length===0?void 0:{__TYPE__:"FieldContent",type:"Text",value:e}}const jEe=({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 d.jsxs(m.Field,{children:[d.jsx(m.FieldIcon,{name:"pin"}),d.jsx(m.FieldLabel,{htmlFor:n,children:er(t)}),d.jsx(m.FieldControl,{children:d.jsx(m.NumberInput,{id:n,value:a,min:(u=t.config)==null?void 0:u.min,max:(s=t.config)==null?void 0:s.max,padding:e7,placeholder:Qu(t),readOnly:i,onValueChange:c=>r(UEe(c))})})]})};function UEe(e){return e===void 0?void 0:{__TYPE__:"FieldContent",type:"Number",value:String(e)}}function fn(e){this.content=e}fn.prototype={constructor:fn,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 fn(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 fn(n)},addToStart:function(e,t){return new fn([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new fn(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 fn(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=fn.from(e),e.size?new fn(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=fn.from(e),e.size?new fn(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=fn.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}};fn.from=function(e){if(e instanceof fn)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new fn(t)};function b7(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=b7(i.content,o.content,n+1);if(a!=null)return a}n+=i.nodeSize}}function C7(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=C7(a.content,u.content,n-1,r-1);if(c)return c}n-=s,r-=s}}class G{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 G(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 G(r,i)}cutByIndex(t,n){return t==n?G.empty:t==0&&n==this.content.length?this:new G(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 G(i,o)}addToStart(t){return new G([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new G(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 b7(this,t,n)}findDiffEnd(t,n=this.size,r=t.size){return C7(this,t,n,r)}findIndex(t,n=-1){if(t==0)return qh(0,t);if(t==this.size)return qh(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?qh(r+1,a):qh(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 G.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new G(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return G.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 G(n||t,r)}static from(t){if(!t)return G.empty;if(t instanceof G)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new G([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}G.empty=new G([],0);const qb={index:0,offset:0};function qh(e,t){return qb.index=e,qb.offset=t,qb}function Bm(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(!Bm(e[r],t[r]))return!1}else{for(let r in e)if(!(r in t)||!Bm(e[r],t[r]))return!1;for(let r in t)if(!(r in e))return!1}return!0}let gt=class rC{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&&Bm(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 rC.none;if(t instanceof rC)return[t];let n=t.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};gt.none=[];class fp extends Error{}class re{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=_7(this.content,t+this.openStart,n);return r&&new re(r,this.openStart,this.openEnd)}removeBetween(t,n){return new re(S7(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 re.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 re(G.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 re(t,r,i)}}re.empty=new re(G.empty,0,0);function S7(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(S7(o.content,t-i-1,n-i-1)))}function _7(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=_7(a.content,t-o-1,n);return u&&e.replaceChild(i,a.copy(u))}function BEe(e,t,n){if(n.openStart>e.depth)throw new fp("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new fp("Inconsistent open depths");return I7(e,t,n,0)}function I7(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=I7(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 As(a,u.cut(0,e.parentOffset).append(n.content).append(u.cut(t.parentOffset)))}else{let{start:a,end:u}=WEe(n,e);return As(o,x7(e,a,u,t,r))}else return As(o,Wm(e,t,r))}function T7(e,t){if(!t.type.compatibleContent(e.type))throw new fp("Cannot join "+t.type.name+" onto "+e.type.name)}function iC(e,t,n){let r=e.node(n);return T7(r,t.node(n)),r}function ps(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 wd(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&&(ps(e.nodeAfter,r),o++));for(let u=o;u<a;u++)ps(i.child(u),r);t&&t.depth==n&&t.textOffset&&ps(t.nodeBefore,r)}function As(e,t){return e.type.checkContent(t),e.copy(t)}function x7(e,t,n,r,i){let o=e.depth>i&&iC(e,t,i+1),a=r.depth>i&&iC(n,r,i+1),u=[];return wd(null,e,i,u),o&&a&&t.index(i)==n.index(i)?(T7(o,a),ps(As(o,x7(e,t,n,r,i+1)),u)):(o&&ps(As(o,Wm(e,t,i+1)),u),wd(t,n,i,u),a&&ps(As(a,Wm(n,r,i+1)),u)),wd(r,null,i,u),new G(u)}function Wm(e,t,n){let r=[];if(wd(null,e,n,r),e.depth>n){let i=iC(e,t,n+1);ps(As(i,Wm(e,t,n+1)),r)}return wd(t,null,n,r),new G(r)}function WEe(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(G.from(i));return{start:i.resolveNoCache(e.openStart+n),end:i.resolveNoCache(i.content.size-e.openEnd-n)}}class dp{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 gt.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 Km(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 dp(n,r,o)}static resolveCached(t,n){for(let i=0;i<Qb.length;i++){let o=Qb[i];if(o.pos==n&&o.doc==t)return o}let r=Qb[Vb]=dp.resolve(t,n);return Vb=(Vb+1)%KEe,r}}let Qb=[],Vb=0,KEe=12;class Km{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 PEe=Object.create(null);let fl=class oC{constructor(t,n,r,i=gt.none){this.type=t,this.attrs=n,this.marks=i,this.content=r||G.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&&Bm(this.attrs,n||t.defaultAttrs||PEe)&&gt.sameSet(this.marks,r||gt.none)}copy(t=null){return t==this.content?this:new oC(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new oC(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 re.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 re(c,i.depth-a,o.depth-a)}replace(t,n,r){return BEe(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 dp.resolveCached(this,t)}resolveNoCache(t){return dp.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()+")"),w7(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=G.empty,i=0,o=r.childCount){let a=this.contentMatchAt(t).matchFragment(r,i,o),u=a&&a.matchFragment(this.content,n);if(!u||!u.validEnd)return!1;for(let s=i;s<o;s++)if(!this.type.allowsMarks(r.child(s).marks))return!1;return!0}canReplaceWith(t,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(t).matchType(r),a=o&&o.matchFragment(this.content,n);return a?a.validEnd:!1}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content);let t=gt.none;for(let n=0;n<this.marks.length;n++)t=this.marks[n].addToSet(t);if(!gt.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=G.fromJSON(t,n.content);return t.nodeType(n.type).create(n.attrs,i,r)}};fl.prototype.text=void 0;class Pm extends fl{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):w7(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 Pm(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new Pm(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 w7(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class ks{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new DEe(t,n);if(r.next==null)return ks.empty;let i=$7(r);r.next&&r.err("Unexpected trailing text");let o=YEe(HEe(i));return GEe(o,r),o}matchType(t){for(let n=0;n<this.next.length;n++)if(this.next[n].type==t)return this.next[n].next;return null}matchFragment(t,n=0,r=t.childCount){let i=this;for(let o=n;i&&o<r;o++)i=i.matchType(t.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:n}=this.next[t];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(t){for(let n=0;n<this.next.length;n++)for(let r=0;r<t.next.length;r++)if(this.next[n].type==t.next[r].type)return!0;return!1}fillBefore(t,n=!1,r=0){let i=[this];function o(a,u){let s=a.matchFragment(t,r);if(s&&(!n||s.validEnd))return G.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 p=o(f,u.concat(l));if(p)return p}}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(`
34
- `)}}ks.empty=new ks(!0);class DEe{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 $7(e){let t=[];do t.push(NEe(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function NEe(e){let t=[];do t.push(qEe(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function qEe(e){let t=zEe(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=QEe(e,t);else break;return t}function DF(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function QEe(e,t){let n=DF(e),r=n;return e.eat(",")&&(e.next!="}"?r=DF(e):r=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function VEe(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 zEe(e){if(e.eat("(")){let t=$7(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=VEe(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 HEe(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 E7(e,t){return t-e}function NF(e,t){let n=[];return r(t),n.sort(E7);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 YEe(e){let t=Object.create(null);return n(NF(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]);NF(e,s).forEach(l=>{c||i.push([u,c=[]]),c.indexOf(l)==-1&&c.push(l)})})});let o=t[r.join(",")]=new ks(r.indexOf(e.length-1)>-1);for(let a=0;a<i.length;a++){let u=i[a][1].sort(E7);o.next.push({type:i[a][0],next:t[u.join(",")]||n(u)})}return o}}function GEe(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 R7(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 O7(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 F7(e){let t=Object.create(null);if(e)for(let n in e)t[n]=new JEe(e[n]);return t}let qF=class M7{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=F7(r.attrs),this.defaultAttrs=R7(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==ks.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:O7(this.attrs,t)}create(t=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new fl(this,this.computeAttrs(t),G.from(n),gt.setFrom(r))}createChecked(t=null,n,r){return n=G.from(n),this.checkContent(n),new fl(this,this.computeAttrs(t),n,gt.setFrom(r))}createAndFill(t=null,n,r){if(t=this.computeAttrs(t),n=G.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(G.empty,!0);return o?new fl(this,t,n.append(o),gt.setFrom(r)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let r=0;r<t.childCount;r++)if(!this.allowsMarks(t.child(r).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw new RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}allowsMarkType(t){return this.markSet==null||this.markSet.indexOf(t)>-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;n<t.length;n++)if(!this.allowsMarkType(t[n].type))return!1;return!0}allowedMarks(t){if(this.markSet==null)return t;let n;for(let r=0;r<t.length;r++)this.allowsMarkType(t[r].type)?n&&n.push(t[r]):n||(n=t.slice(0,r));return n?n.length?n:gt.none:t}static compile(t,n){let r=Object.create(null);t.forEach((o,a)=>r[o]=new M7(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 JEe{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class FR{constructor(t,n,r,i){this.name=t,this.rank=n,this.schema=r,this.spec=i,this.attrs=F7(i.attrs),this.excluded=null;let o=R7(this.attrs);this.instance=o?new gt(this,o):null}create(t=null){return!t&&this.instance?this.instance:new gt(this,O7(this.attrs,t))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((o,a)=>r[o]=new FR(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 ZEe{constructor(t){this.cached=Object.create(null);let n=this.spec={};for(let i in t)n[i]=t[i];n.nodes=fn.from(t.nodes),n.marks=fn.from(t.marks||{}),this.nodes=qF.compile(this.spec.nodes,this),this.marks=FR.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],a=o.spec.content||"",u=o.spec.marks;o.contentMatch=r[a]||(r[a]=ks.parse(a,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.markSet=u=="_"?null:u?QF(this,u.split(" ")):u==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],a=o.spec.excludes;o.excluded=a==null?[o]:a==""?[]:QF(this,a.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,r,i){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof qF){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 Pm(r,r.defaultAttrs,t,gt.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeFromJSON(t){return fl.fromJSON(this,t)}markFromJSON(t){return gt.fromJSON(this,t)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}}function QF(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 pp{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 zF(this,n,!1);return r.addAll(t,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new zF(this,n,!0);return r.addAll(t,n.from,n.to),re.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(tRe(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=HF(a)),a.mark||a.ignore||a.clearMark||(a.mark=i)})}for(let i in t.nodes){let o=t.nodes[i].spec.parseDOM;o&&o.forEach(a=>{r(a=HF(a)),a.node||a.ignore||a.mark||(a.node=i)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new pp(t,pp.schemaRules(t)))}}const k7={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},XEe={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},L7={ol:!0,ul:!0},Dm=1,Nm=2,$d=4;function VF(e,t,n){return t!=null?(t?Dm:0)|(t==="full"?Nm:0):e&&e.whitespace=="pre"?Dm|Nm:n&~$d}class Qh{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=gt.none,this.stashMarks=[],this.match=a||(u&$d?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(G.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&Dm)){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=G.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(G.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):rRe(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&&!k7.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class zF{constructor(t,n,r){this.parser=t,this.options=n,this.isOpen=r,this.open=0;let i=n.topNode,o,a=VF(null,n.preserveWhitespace,0)|(r?$d:0);i?o=new Qh(i.type,i.attrs,gt.none,gt.none,!0,n.topMatch||i.type.contentMatch,a):r?o=new Qh(null,null,gt.none,gt.none,!0,null,a):o=new Qh(t.schema.topNodeType,null,gt.none,gt.none,!0,null,a),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t){if(t.nodeType==3)this.addTextNode(t);else if(t.nodeType==1){let n=t.getAttribute("style");if(!n)this.addElement(t);else{let r=this.readStyles(nRe(n));if(!r)return;let[i,o]=r,a=this.top;for(let u=0;u<o.length;u++)this.removePendingMark(o[u],a);for(let u=0;u<i.length;u++)this.addPendingMark(i[u]);this.addElement(t);for(let u=0;u<i.length;u++)this.removePendingMark(i[u],a);for(let u=0;u<o.length;u++)this.addPendingMark(o[u])}}}addTextNode(t){let n=t.nodeValue,r=this.top;if(r.options&Nm||r.inlineContext(t)||/[^ \t\r\n\u000c]/.test(n)){if(r.options&Dm)r.options&Nm?n=n.replace(/\r\n?/g,`
35
- `):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;L7.hasOwnProperty(r)&&this.parser.normalizeLists&&eRe(t);let o=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(i=this.parser.matchTag(t,this,n));if(o?o.ignore:XEe.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(k7.hasOwnProperty(r))u.content.length&&u.content[0].isInline&&this.open&&(this.open--,u=this.top),a=!0,u.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t);return}this.addAll(t),a&&this.sync(u),this.needsBlock=s}else this.addElementByRule(t,o,o.consuming===!1?i:void 0)}leafFallback(t){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(`
36
- `))}ignoreFallback(t){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(t){let n=gt.none,r=gt.none;e:for(let i=0;i<t.length;i+=2)for(let o=void 0;;){let a=this.parser.matchStyle(t[i],t[i+1],this,o);if(!a)continue e;if(a.ignore)return null;if(a.clearMark?this.top.pendingMarks.forEach(u=>{a.clearMark(u)&&(r=u.addToSet(r))}):n=this.parser.schema.marks[a.mark].create(a.attrs).addToSet(n),a.consuming===!1)o=a;else break}return[n,r]}addElementByRule(t,n,r){let i,o,a;n.node?(o=this.parser.schema.nodes[n.node],o.isLeaf?this.insertNode(o.create(n.attrs))||this.leafFallback(t):i=this.enter(o,n.attrs||null,n.preserveWhitespace)):(a=this.parser.schema.marks[n.mark].create(n.attrs),this.addPendingMark(a));let u=this.top;if(o&&o.isLeaf)this.findInside(t);else if(r)this.addElement(t,r);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(s=>this.insertNode(s));else{let s=t;typeof n.contentElement=="string"?s=t.querySelector(n.contentElement):typeof n.contentElement=="function"?s=n.contentElement(t):n.contentElement&&(s=n.contentElement),this.findAround(t,s,!0),this.addAll(s)}i&&this.sync(u)&&this.open--,a&&this.removePendingMark(a,u)}addAll(t,n,r){let i=n||0;for(let o=n?t.childNodes[n]:t.firstChild,a=r==null?null:t.childNodes[r];o!=a;o=o.nextSibling,++i)this.findAtPoint(t,i),this.addDOM(o);this.findAtPoint(t,i)}findPlace(t){let n,r;for(let i=this.open;i>=0;i--){let o=this.nodes[i],a=o.findWrapping(t);if(a&&(!n||n.length>a.length)&&(n=a,r=o,!a.length)||o.solid)break}if(!n)return!1;this.sync(r);for(let i=0;i<n.length;i++)this.enterInner(n[i],null,!1);return!0}insertNode(t){if(t.isInline&&this.needsBlock&&!this.top.type){let n=this.textblockFromContext();n&&this.enterInner(n)}if(this.findPlace(t)){this.closeExtra();let n=this.top;n.applyPending(t.type),n.match&&(n.match=n.match.matchType(t.type));let r=n.activeMarks;for(let i=0;i<t.marks.length;i++)(!n.type||n.type.allowsMarkType(t.marks[i].type))&&(r=t.marks[i].addToSet(r));return n.content.push(t.mark(r)),!0}return!1}enter(t,n,r){let i=this.findPlace(t.create(n));return i&&this.enterInner(t,n,!0,r),i}enterInner(t,n=null,r=!1,i){this.closeExtra();let o=this.top;o.applyPending(t),o.match=o.match&&o.match.matchType(t);let a=VF(t,i,o.options);o.options&$d&&o.content.length==0&&(a|=$d),this.nodes.push(new Qh(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=iRe(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 eRe(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let r=t.nodeType==1?t.nodeName.toLowerCase():null;r&&L7.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):r=="li"?n=t:r&&(n=null)}}function tRe(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function nRe(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 HF(e){let t={};for(let n in e)t[n]=e[n];return t}function rRe(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 iRe(e,t){for(let n=0;n<t.length;n++)if(e.eq(t[n]))return t[n]}class as{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},r){r||(r=zb(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}=as.renderSpec(zb(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&&as.renderSpec(zb(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:p,contentDOM:A}=as.renderSpec(t,f,r);if(u.appendChild(p),A){if(a)throw new RangeError("Multiple content holes");a=A}}}return{dom:u,contentDOM:a}}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new as(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=YF(t.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(t){return YF(t.marks)}}function YF(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function zb(e){return e.document||window.document}const j7=65535,U7=Math.pow(2,16);function oRe(e,t){return e+t*U7}function GF(e){return e&j7}function aRe(e){return(e-(e&j7))/U7}const B7=1,W7=2,em=4,K7=8;let aC=class{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&K7)>0}get deletedBefore(){return(this.delInfo&(B7|em))>0}get deletedAfter(){return(this.delInfo&(W7|em))>0}get deletedAcross(){return(this.delInfo&em)>0}},Ml=class nl{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&nl.empty)return nl.empty}recover(t){let n=0,r=GF(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+aRe(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 p=c?t==s?-1:t==f?1:n:n,A=s+i+(p<0?0:l);if(r)return A;let h=t==(n<0?s:f)?null:oRe(u/3,t-s),v=t==s?W7:t==f?B7:em;return(n<0?t!=s:t!=f)&&(v|=K7),new aC(A,v,h)}i+=l-c}return r?t+i:new aC(t+i,0,null)}touches(t,n){let r=0,i=GF(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 nl(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?nl.empty:new nl(t<0?[0,-t,0]:[0,0,t])}};Ml.empty=new Ml([]);class Ed{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 Ed(this.maps,this.mirror,t,n)}copy(){return new Ed(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 Ed;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 aC(t,i,null)}}const Hb=Object.create(null);let yr=class{getMap(){return Ml.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Hb[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 Hb)throw new RangeError("Duplicate use of step JSON ID "+t);return Hb[t]=n,n.prototype.jsonID=t,n}},ir=class bd{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new bd(t,null)}static fail(t){return new bd(null,t)}static fromReplace(t,n,r,i){try{return bd.ok(t.replace(n,r,i))}catch(o){if(o instanceof fp)return bd.fail(o.message);throw o}}};function MR(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(MR(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return G.fromArray(r)}let P7=class Cd extends yr{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 re(MR(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 ir.fromReplace(t,this.from,this.to,o)}invert(){return new D7(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 Cd(n.pos,r.pos,this.mark)}merge(t){return t instanceof Cd&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Cd(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 Cd(n.from,n.to,t.markFromJSON(n.mark))}};yr.jsonID("addMark",P7);let D7=class Sd extends yr{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 re(MR(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),n.openStart,n.openEnd);return ir.fromReplace(t,this.from,this.to,r)}invert(){return new P7(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 Sd(n.pos,r.pos,this.mark)}merge(t){return t instanceof Sd&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Sd(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 Sd(n.from,n.to,t.markFromJSON(n.mark))}};yr.jsonID("removeMark",D7);let N7=class _d extends yr{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return ir.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return ir.fromReplace(t,this.pos,this.pos+1,new re(G.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 _d(this.pos,n.marks[i]);return new _d(this.pos,this.mark)}}return new q7(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new _d(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 _d(n.pos,t.markFromJSON(n.mark))}};yr.jsonID("addNodeMark",N7);let q7=class uC extends yr{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return ir.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return ir.fromReplace(t,this.pos,this.pos+1,new re(G.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new N7(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new uC(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 uC(n.pos,t.markFromJSON(n.mark))}};yr.jsonID("removeNodeMark",q7);let Ch=class es extends yr{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&sC(t,this.from,this.to)?ir.fail("Structure replace would overwrite content"):ir.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new Ml([this.from,this.to-this.from,this.slice.size])}invert(t){return new es(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 es(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof es)||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?re.empty:new re(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new es(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?re.empty:new re(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new es(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 es(n.from,n.to,re.fromJSON(t,n.slice),!!n.structure)}};yr.jsonID("replace",Ch);let ra=class tm extends yr{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&&(sC(t,this.from,this.gapFrom)||sC(t,this.gapTo,this.to)))return ir.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return ir.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?ir.fromReplace(t,this.from,this.to,r):ir.fail("Content does not fit in gap")}getMap(){return new Ml([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 tm(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 tm(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 tm(n.from,n.to,n.gapFrom,n.gapTo,re.fromJSON(t,n.slice),n.insert,!!n.structure)}};yr.jsonID("replaceAround",ra);function sC(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 uRe(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Sh(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||!uRe(i,o,a))break}return null}function Q7(e,t,n=null,r=e){let i=sRe(e,t),o=i&&cRe(r,t);return o?i.map(JF).concat({type:t,attrs:n}).concat(o.map(JF)):null}function JF(e){return{type:e,attrs:null}}function sRe(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 cRe(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 V7(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),p=i.index(c);if(f.type.spec.isolating)return!1;let A=f.content.cutByIndex(p,f.childCount),h=r&&r[l+1];h&&(A=A.replaceChild(0,h.type.create(h.attrs)));let v=r&&r[l]||f;if(!f.canReplace(p+1,f.childCount)||!v.type.validContent(A))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 _h(e,t){let n=e.resolve(t),r=n.index();return z7(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function z7(e,t){return!!(e&&t&&!e.isLeaf&&e.canAppend(t))}function H7(e,t,n=-1){let r=e.resolve(t);for(let i=r.depth;;i--){let o,a,u=r.index(i);if(i==r.depth?(o=r.nodeBefore,a=r.nodeAfter):n>0?(o=r.node(i+1),u++,a=r.node(i).maybeChild(u)):(o=r.node(i).maybeChild(u-1),a=r.node(i+1)),o&&!o.isTextblock&&z7(o,a)&&r.node(i).canReplace(u,u+1))return t;if(i==0)break;t=n<0?r.before(i):r.after(i)}}function lRe(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 kR(e,t,n=t,r=re.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return fRe(i,o,r)?new Ch(t,n,r):new dRe(i,o,r).fit()}function fRe(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class dRe{constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=G.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=G.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 re(o,a,u);return t>-1?new ra(r.pos,t,this.$to.pos,this.$to.end(),s,n):s.size||r.pos!=this.$to.pos?new Ch(r.pos,i.pos,s):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<t;r++){let o=n.firstChild;if(n.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){t=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?t:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=Yb(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let a=i.firstChild;for(let u=this.depth;u>=0;u--){let{type:s,match:c}=this.frontier[u],l,f=null;if(n==1&&(a?c.matchType(a.type)||(f=c.fillBefore(G.from(a),!1)):o&&s.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:u,parent:o,inject:f};if(n==2&&a&&(l=c.findWrapping(a.type)))return{sliceDepth:r,frontierDepth:u,parent:o,wrap:l};if(o&&c.matchType(o.type))break}}}openMore(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=Yb(t,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new re(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=Yb(t,n);if(i.childCount<=1&&n>0){let o=t.size-n<=n+i.size;this.unplaced=new re(Id(t,n-1,1),n-1,o?n-1:r)}else this.unplaced=new re(Id(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:p}=this.frontier[n];if(i){for(let v=0;v<i.childCount;v++)l.push(i.child(v));f=f.matchFragment(i)}let A=u.size+t-(a.content.size-a.openEnd);for(;c<u.childCount;){let v=u.child(c),_=f.matchType(v.type);if(!_)break;c++,(c>1||s==0||v.content.size)&&(f=_,l.push(Y7(v.mark(p.allowedMarks(v.marks)),c==1?s:0,c==u.childCount?A:-1)))}let h=c==u.childCount;h||(A=-1),this.placed=Td(this.placed,n,G.from(l)),this.frontier[n].match=f,h&&A<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let v=0,_=u;v<A;v++){let S=_.lastChild;this.frontier.push({type:S.type,match:S.contentMatchAt(S.childCount)}),_=S.content}this.unplaced=h?t==0?re.empty:new re(Id(a.content,t-1,1),t-1,A<0?a.openEnd:t-1):new re(Id(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||!Gb(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=Gb(t,n,i,r,o);if(a){for(let u=n-1;u>=0;u--){let{match:s,type:c}=this.frontier[u],l=Gb(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=Td(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=Td(this.placed,this.depth,G.from(t.create(n,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(G.empty,!0);n.childCount&&(this.placed=Td(this.placed,this.frontier.length,n))}}function Id(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Id(e.firstChild.content,t-1,n)))}function Td(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Td(e.lastChild.content,t-1,n)))}function Yb(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function Y7(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,Y7(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(G.empty,!0)))),e.copy(r)}function Gb(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&&!pRe(n,o.content,a)?u:null}function pRe(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}let ARe=class nm extends yr{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 ir.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 ir.fromReplace(t,this.pos,this.pos+1,new re(G.from(i),0,n.isLeaf?0:1))}getMap(){return Ml.empty}invert(t){return new nm(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 nm(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 nm(n.pos,n.attr,n.value)}};yr.jsonID("attr",ARe);let Ap=class extends Error{};Ap=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};Ap.prototype=Object.create(Error.prototype);Ap.prototype.constructor=Ap;Ap.prototype.name="TransformError";const Jb=Object.create(null);class Qe{constructor(t,n,r){this.$anchor=t,this.$head=n,this.ranges=r||[new hRe(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=re.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?re.empty:n),u==0&&eM(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),eM(t,r,n.isInline?-1:1))}}static findFrom(t,n,r=!1){let i=t.parent.inlineContent?new Ke(t):rl(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?rl(t.node(0),t.node(o),t.before(o+1),t.index(o),n,r):rl(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 Ti(t.node(0))}static atStart(t){return rl(t,t,0,0,1)||new Ti(t)}static atEnd(t){return rl(t,t,t.content.size,t.childCount,-1)||new Ti(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Jb[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 Jb)throw new RangeError("Duplicate use of selection JSON ID "+t);return Jb[t]=n,n.prototype.jsonID=t,n}getBookmark(){return Ke.between(this.$anchor,this.$head).getBookmark()}}Qe.prototype.visible=!0;class hRe{constructor(t,n){this.$from=t,this.$to=n}}let ZF=!1;function XF(e){!ZF&&!e.parent.inlineContent&&(ZF=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class Ke extends Qe{constructor(t,n=t){XF(t),XF(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 Qe.near(r);let i=t.resolve(n.map(this.anchor));return new Ke(i.parent.inlineContent?i:r,r)}replace(t,n=re.empty){if(super.replace(t,n),n==re.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof Ke&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new D0(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 Ke(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=Qe.findFrom(n,r,!0)||Qe.findFrom(n,-r,!0);if(o)n=o.$head;else return Qe.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(Qe.findFrom(t,-r,!0)||Qe.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new Ke(t,n)}}Qe.jsonID("text",Ke);class D0{constructor(t,n){this.anchor=t,this.head=n}map(t){return new D0(t.map(this.anchor),t.map(this.head))}resolve(t){return Ke.between(t.resolve(this.anchor),t.resolve(this.head))}}class me extends Qe{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?Qe.near(o):new me(o)}content(){return new re(G.from(this.node),0,0)}eq(t){return t instanceof me&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new LR(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new me(t.resolve(n.anchor))}static create(t,n){return new me(t.resolve(n))}static isSelectable(t){return!t.isText&&t.type.spec.selectable!==!1}}me.prototype.visible=!1;Qe.jsonID("node",me);class LR{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new D0(r,r):new LR(r)}resolve(t){let n=t.resolve(this.anchor),r=n.nodeAfter;return r&&me.isSelectable(r)?new me(n):Qe.near(n)}}class Ti extends Qe{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,n=re.empty){if(n==re.empty){t.delete(0,t.doc.content.size);let r=Qe.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(t){return new Ti(t)}map(t){return new Ti(t)}eq(t){return t instanceof Ti}getBookmark(){return mRe}}Qe.jsonID("all",Ti);const mRe={map(){return this},resolve(e){return new Ti(e)}};function rl(e,t,n,r,i,o=!1){if(t.inlineContent)return Ke.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&&me.isSelectable(u))return me.create(e,n-(i<0?u.nodeSize:0))}else{let s=rl(e,u,n+i,i<0?u.childCount:0,i,o);if(s)return s}n+=u.nodeSize*i}return null}function eM(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof Ch||i instanceof ra))return;let o=e.mapping.maps[r],a;o.forEach((u,s,c,l)=>{a==null&&(a=l)}),e.setSelection(Qe.near(e.doc.resolve(a),n))}function tM(e,t){return!t||!e?e:e.bind(t)}class Vh{constructor(t,n,r){this.name=t,this.init=tM(n.init,r),this.apply=tM(n.apply,r)}}new Vh("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new Vh("selection",{init(e,t){return e.selection||Qe.atStart(t.doc)},apply(e){return e.selection}}),new Vh("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new Vh("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}});function G7(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r=="handleDOMEvents"&&(i=G7(i,t,{})),n[r]=i}return n}class Nr{constructor(t){this.spec=t,this.props={},t.props&&G7(t.props,this,this.props),this.key=t.key?t.key.key:J7("plugin")}getState(t){return t[this.key]}}const Zb=Object.create(null);function J7(e){return e in Zb?e+"$"+ ++Zb[e]:(Zb[e]=0,e+"$")}class Gi{constructor(t="key"){this.key=J7(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const Uc=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},Z7=function(e,t,n,r){return n&&(nM(e,t,n,r,-1)||nM(e,t,n,r,1))},gRe=/^(img|br|input|textarea|hr)$/i;function nM(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:qm(e))){let o=e.parentNode;if(!o||o.nodeType!=1||jR(e)||gRe.test(e.nodeName)||e.contentEditable=="false")return!1;t=Uc(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?qm(e):0}else return!1}}function qm(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function vRe(e,t,n){for(let r=t==0,i=t==qm(e);r||i;){if(e==n)return!0;let o=Uc(e);if(e=e.parentNode,!e)return!1;r=r&&o==0,i=i&&o==qm(e)}}function jR(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 X7=function(e){return e.focusNode&&Z7(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function e8(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}const lo=typeof navigator<"u"?navigator:null,rM=typeof document<"u"?document:null,zu=lo&&lo.userAgent||"",cC=/Edge\/(\d+)/.exec(zu),t8=/MSIE \d/.exec(zu),lC=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(zu),Ih=!!(t8||lC||cC),n8=t8?document.documentMode:lC?+lC[1]:cC?+cC[1]:0,N0=!Ih&&/gecko\/(\d+)/i.test(zu);N0&&+(/Firefox\/(\d+)/.exec(zu)||[0,0])[1];const fC=!Ih&&/Chrome\/(\d+)/.exec(zu),Bc=!!fC,yRe=fC?+fC[1]:0,Wc=!Ih&&!!lo&&/Apple Computer/.test(lo.vendor),UR=Wc&&(/Mobile\/\w+/.test(zu)||!!lo&&lo.maxTouchPoints>2),Hr=UR||(lo?/Mac/.test(lo.platform):!1),bRe=lo?/Win/.test(lo.platform):!1,Th=/Android \d/.test(zu),BR=!!rM&&"webkitFontSmoothing"in rM.documentElement.style,CRe=BR?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function SRe(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),o=i&&i.size==0,a=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(a<0)return null;let u=r.resolve(a),s,c;if(X7(n)){for(s=u;i&&!i.node;)i=i.parent;let l=i.node;if(i&&l.isAtom&&me.isSelectable(l)&&i.parent&&!(l.isInline&&vRe(n.focusNode,n.focusOffset,i.dom))){let f=i.posBefore;c=new me(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=i8(e,s,u,l)}return c}function r8(e){return e.editable?e.hasFocus():xRe(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function WR(e,t=!1){let n=e.state.selection;if(TRe(e,n),!!r8(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&Bc){let r=e.domSelectionRange(),i=e.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&Z7(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)IRe(e);else{let{anchor:r,head:i}=n,o,a;iM&&!(n instanceof Ke)&&(n.$from.parent.inlineContent||(o=oM(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(a=oM(e,n.to))),e.docView.setSelection(r,i,e.root,t),iM&&(o&&aM(o),a&&aM(a)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&_Re(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const iM=Wc||Bc&&yRe<63;function oM(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(Wc&&i&&i.contentEditable=="false")return Xb(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return Xb(i);if(o)return Xb(o)}}function Xb(e){return e.contentEditable="true",Wc&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function aM(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function _Re(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!r8(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function IRe(e){let t=e.domSelection(),n=document.createRange(),r=e.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setEnd(r.parentNode,Uc(r)+1):n.setEnd(r,0),n.collapse(!1),t.removeAllRanges(),t.addRange(n),!i&&!e.state.selection.visible&&Ih&&n8<=11&&(r.disabled=!0,r.disabled=!1)}function TRe(e,t){if(t instanceof me){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(uM(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else uM(e)}function uM(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function i8(e,t,n,r){return e.someProp("createSelectionBetween",i=>i(e,t,n))||Ke.between(t,n,r)}function xRe(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function dC(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&&Qe.findFrom(o,t)}function Ha(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function sM(e,t,n){let r=e.state.selection;if(r instanceof Ke)if(n.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let a=e.state.doc.resolve(i.pos+o.nodeSize*(t<0?-1:1));return Ha(e,new Ke(r.$anchor,a))}else if(r.empty){if(e.endOfTextblock(t>0?"forward":"backward")){let i=dC(e.state,t);return i&&i instanceof me?Ha(e,i):!1}else if(!(Hr&&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?me.isSelectable(o)?Ha(e,new me(t<0?e.state.doc.resolve(i.pos-o.nodeSize):i)):BR?Ha(e,new Ke(e.state.doc.resolve(t<0?u:u+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof me&&r.node.isInline)return Ha(e,new Ke(t>0?r.$to:r.$from));{let i=dC(e.state,t);return i?Ha(e,i):!1}}}function Qm(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Rd(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!="BR")}function Gc(e,t){return t<0?wRe(e):$Re(e)}function wRe(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,a=!1;for(N0&&n.nodeType==1&&r<Qm(n)&&Rd(n.childNodes[r],-1)&&(a=!0);;)if(r>0){if(n.nodeType!=1)break;{let u=n.childNodes[r-1];if(Rd(u,-1))i=n,o=--r;else if(u.nodeType==3)n=u,r=n.nodeValue.length;else break}}else{if(o8(n))break;{let u=n.previousSibling;for(;u&&Rd(u,-1);)i=n.parentNode,o=Uc(u),u=u.previousSibling;if(u)n=u,r=Qm(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}a?pC(e,n,r):i&&pC(e,i,o)}function $Re(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=Qm(n),o,a;for(;;)if(r<i){if(n.nodeType!=1)break;let u=n.childNodes[r];if(Rd(u,1))o=n,a=++r;else break}else{if(o8(n))break;{let u=n.nextSibling;for(;u&&Rd(u,1);)o=u.parentNode,a=Uc(u)+1,u=u.nextSibling;if(u)n=u,r=0,i=Qm(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}}o&&pC(e,o,a)}function o8(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function ERe(e,t){for(;e&&t==e.childNodes.length&&!jR(e);)t=Uc(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;e=n,t=0}}function RRe(e,t){for(;e&&!t&&!jR(e);)t=Uc(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;e=n,t=e.childNodes.length}}function pC(e,t,n){if(t.nodeType!=3){let o,a;(a=ERe(t,n))?(t=a,n=0):(o=RRe(t,n))&&(t=o,n=o.nodeValue.length)}let r=e.domSelection();if(X7(r)){let o=document.createRange();o.setEnd(t,n),o.setStart(t,n),r.removeAllRanges(),r.addRange(o)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&WR(e)},50)}function cM(e,t){let n=e.state.doc.resolve(t);if(!(Bc||bRe)&&n.parent.inlineContent){let i=e.coordsAtPos(t);if(t>n.start()){let o=e.coordsAtPos(t-1),a=(o.top+o.bottom)/2;if(a>i.top&&a<i.bottom&&Math.abs(o.left-i.left)>1)return o.left<i.left?"ltr":"rtl"}if(t<n.end()){let o=e.coordsAtPos(t+1),a=(o.top+o.bottom)/2;if(a>i.top&&a<i.bottom&&Math.abs(o.left-i.left)>1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function lM(e,t,n){let r=e.state.selection;if(r instanceof Ke&&!r.empty||n.indexOf("s")>-1||Hr&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let a=dC(e.state,t);if(a&&a instanceof me)return Ha(e,a)}if(!i.parent.inlineContent){let a=t<0?i:o,u=r instanceof Ti?Qe.near(a,t):Qe.findFrom(a,t);return u?Ha(e,u):!1}return!1}function fM(e,t){if(!(e.state.selection instanceof Ke))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 dM(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function ORe(e){if(!Wc||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable=="false"){let r=t.firstChild;dM(e,r,"true"),setTimeout(()=>dM(e,r,"false"),20)}return!1}function FRe(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function MRe(e,t){let n=t.keyCode,r=FRe(t);if(n==8||Hr&&n==72&&r=="c")return fM(e,-1)||Gc(e,-1);if(n==46&&!t.shiftKey||Hr&&n==68&&r=="c")return fM(e,1)||Gc(e,1);if(n==13||n==27)return!0;if(n==37||Hr&&n==66&&r=="c"){let i=n==37?cM(e,e.state.selection.from)=="ltr"?-1:1:-1;return sM(e,i,r)||Gc(e,i)}else if(n==39||Hr&&n==70&&r=="c"){let i=n==39?cM(e,e.state.selection.from)=="ltr"?1:-1:1;return sM(e,i,r)||Gc(e,i)}else{if(n==38||Hr&&n==80&&r=="c")return lM(e,-1,r)||Gc(e,-1);if(n==40||Hr&&n==78&&r=="c")return ORe(e)||lM(e,1,r)||Gc(e,1);if(r==(Hr?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function a8(e,t){e.someProp("transformCopied",A=>{t=A(t,e)});let n=[],{content:r,openStart:i,openEnd:o}=t;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let A=r.firstChild;n.push(A.type.name,A.attrs!=A.type.defaultAttrs?A.attrs:null),r=A.content}let a=e.someProp("clipboardSerializer")||as.fromSchema(e.state.schema),u=d8(),s=u.createElement("div");s.appendChild(a.serializeFragment(r,{document:u}));let c=s.firstChild,l,f=0;for(;c&&c.nodeType==1&&(l=f8[c.nodeName.toLowerCase()]);){for(let A=l.length-1;A>=0;A--){let h=u.createElement(l[A]);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 p=e.someProp("clipboardTextSerializer",A=>A(t,e))||t.content.textBetween(0,t.content.size,`
33
+ from ${a===1?"it":"them"}.`]})}),d.jsxs(m.DialogActions,{children:[d.jsx(m.DialogCancelButton,{}),d.jsx(m.DialogActionButton,{onClick:f,color:"tomato",loading:c,children:"Yes, I want to delete"})]})]})}function t$e(){const e=R.useContext(nt.ErrorBoundaryContext);return d.jsx(m.Box,{flexDirection:"column",children:d.jsxs(m.BlankSlate,{children:[d.jsx(m.BlankSlateIcon,{name:"close",lineColor:"purple10",backgroundColor:"purple3",borderColor:"purple6",borderStyle:"dashed"}),d.jsx(m.BlankSlateTitle,{size:"big",children:"Oops!"}),d.jsx(m.BlankSlateDescription,{width:360,children:"We couldn't load your media tags."}),d.jsx(m.BlankSlateActions,{children:d.jsx(m.Button,{onClick:e==null?void 0:e.reset,size:"medium",children:"Try again"})})]})})}function n$e(e){const{id:t,config:n}=e;n.mediaLibrary||Bn("mediaLibrary");const{assetsApiBaseUrl:r,repository:i,authStrategy:o}=n;return we.request(new URL(`tags/${t}`,r),{headers:{repository:i},method:"DELETE",credentials:we.getRequestCredentials(o),okType:B.unknown()})}function r$e(e){const{id:t,name:n,config:r}=e;r.mediaLibrary||Bn("mediaLibrary");const{assetsApiBaseUrl:i,repository:o,authStrategy:a}=r;return we.request(new URL(`tags/${t}`,i),{headers:{repository:o},method:"PATCH",credentials:we.getRequestCredentials(a),body:{name:n},okType:B.unknown()})}function i$e(){return d.jsx(m.Box,{flexDirection:"column",gap:16,children:gn.range(1,6).map(e=>d.jsxs(m.Box,{justifyContent:"space-between",children:[d.jsx(m.Skeleton,{height:24,width:85}),d.jsx(m.Skeleton,{height:24,width:45})]},e))})}function o$e(){const e=jc(),{onFilesUpload:t,isUploading:n,tagManagerOpen:r}=Et();return e.length===0&&r===!1?d.jsx(Pq,{onFilesUpload:t,isUploading:n}):d.jsx(m.Box,{flexDirection:"column",backgroundColor:"grey1",width:"100%",padding:16,gap:16,borderRadius:{topLeft:8,topRight:8},children:r?d.jsx(Jwe,{}):d.jsxs(d.Fragment,{children:[d.jsx(gwe,{}),d.jsx(bwe,{}),d.jsx(Nwe,{})]})})}function a$e(){const e=qu();return d.jsx(Kq,{hasSelectedMedia:e.selectedCount!==0,children:d.jsx(o$e,{})})}function Hq(e){const{assetType:t,onSelectedChange:n,actionContainerRef:r}=e;return d.jsx(m.ErrorBoundary,{renderError:()=>d.jsx(jq,{}),children:d.jsx(R.Suspense,{fallback:d.jsx(awe,{actionContainerRef:r}),children:d.jsx(sq,{children:d.jsx(ewe,{assetType:t,actionContainerRef:r,onSelectedChange:n,children:d.jsx(rwe,{children:d.jsx(u$e,{})})})})})})}function u$e(){const{media:e}=Et();return d.jsx(lwe,{children:d.jsx(Uq,{sidePane:d.jsx(a$e,{}),mediaActions:d.jsx(twe,{}),mediaToolbar:d.jsx(pwe,{}),mediaList:e.length===0?d.jsx(cq,{}):d.jsx(owe,{})})})}const Yq=R.createContext({editedUID:{current:!1},onEditUID:()=>{}});function Gq(e){return Object.values(e.json).some(t=>{var n;return((n=t.uid)==null?void 0:n.type)==="UID"})}function s$e(e){const{content:t,customType:n}=e;return Gq(n)&&!t.uid}function Jq(e){const{documentId:t,documentsWithUid:n,uid:r}=e;return n.filter(i=>t!==i.id&&l$e({document:i,uid:r})&&c$e({...e,document:i}))}function c$e(e){const{customTypeId:t,languageId:n,document:r}=e,i=t===r.custom_type_id,o=n===r.language.id;return i&&o}function l$e(e){const{document:t,uid:n}=e,r=t.versions.filter(i=>i.uid===n);return r.length===0?!0:r.some(i=>i.status!=="archived")}function Zq(e,t){if(t)return`${e}___${t}`}const Xq=R.createContext({update:()=>{}});function P0(e){const{sliceKey:t}=e||{},n=R.useContext(Xq),r=Zq("sliceFieldSet",t),i=t===(n==null?void 0:n.id);return{selectionId:r,selected:i,selection:n}}function er(e){var t;return((t=e.config)==null?void 0:t.label)??(e.type==="Boolean"||e.type==="Separator"?void 0:e.fieldset)??e.type}const Z1="...";function Qu(e,t){var n,r,i;return e.type==="Boolean"?(t?(n=e.config)==null?void 0:n.placeholder_true:(r=e.config)==null?void 0:r.placeholder_false)||Z1:((i=e.config)==null?void 0:i.placeholder)||Z1}function f$e(e){var u;const{content:t,field:n,id:r,readOnly:i,onContentChange:o}=e,a=(t==null?void 0:t.value)??((u=n.config)==null?void 0:u.default_value)??!1;return d.jsxs(m.Field,{children:[d.jsx(m.FieldIcon,{name:"biToggle"}),d.jsx(m.FieldLabel,{htmlFor:r,children:er(n)}),d.jsxs(m.FieldControl,{children:[d.jsx(m.Box,{padding:4,alignItems:"center",children:d.jsx(m.Text,{children:Qu(n,a)})}),d.jsx(m.Switch,{id:r,sx:{alignSelf:"center",marginLeft:"auto",marginRight:12},checked:a,onCheckedChange:s=>{i||o(d$e(s))}})]})]})}function d$e(e){return{__TYPE__:"BooleanContent",value:e}}function p$e(e){const{id:t,field:n,content:r,onContentChange:i}=e;return d.jsxs(m.Field,{children:[d.jsx(m.FieldIcon,{name:"colorLens"}),d.jsx(m.FieldLabel,{id:t,children:er(n)}),d.jsx(m.FieldControl,{children:d.jsx(m.Box,{padding:{left:4},alignItems:"center",children:d.jsx(m.ColorInput,{onValueChange:o=>i(A$e(o)),value:r==null?void 0:r.value,"aria-labelledby":t,placeholder:Qu(n)})})})]})}function A$e(e){return e===void 0?void 0:{__TYPE__:"FieldContent",type:"Color",value:e}}function h$e(e){const{id:t,readOnly:n,field:r,content:i,onContentChange:o}=e,a=i!=null&&i.value?PC.dateFromISOString(i.value):void 0;return d.jsxs(m.Field,{children:[d.jsx(m.FieldIcon,{name:"dateRange"}),d.jsx(m.FieldLabel,{id:t,children:er(r)}),d.jsx(m.FieldControl,{children:d.jsx(m.Box,{padding:{left:4,right:12},width:"100%",flexDirection:"column",justifyContent:"center",children:d.jsx(m.DateInput,{mode:"date","aria-labelledby":t,disabled:n,value:a,onValueChange:u=>o(m$e(u))})})})]})}function m$e(e){if(e)return{__TYPE__:"FieldContent",type:"Date",value:g$e(e)}}function g$e(e){const t=`${e.getFullYear()}`.padStart(4,"0"),n=`${e.getMonth()+1}`.padStart(2,"0"),r=`${e.getDate()}`.padStart(2,"0");return`${t}-${n}-${r}`}const Vu=R.forwardRef(function(t,n){return d.jsx(m.TextInput,{padding:e7,...t,ref:n,sx:{...t.sx,alignSelf:"stretch"}})}),e7={input:{inline:4},adornment:{inline:12}},v$e=({provider:e})=>y$e[e.toLowerCase()]??d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("g",{clipPath:"url(#clip0_6524_22412)",children:d.jsx("path",{d:"M7.99992 1.33333C4.31992 1.33333 1.33325 4.32 1.33325 8C1.33325 11.68 4.31992 14.6667 7.99992 14.6667C11.6799 14.6667 14.6666 11.68 14.6666 8C14.6666 4.32 11.6799 1.33333 7.99992 1.33333ZM2.66659 8C2.66659 7.59333 2.71992 7.19333 2.80659 6.81333L5.99325 10V10.6667C5.99325 11.4 6.59325 12 7.32658 12V13.2867C4.70658 12.9533 2.66659 10.7133 2.66659 8ZM11.9266 11.6C11.7533 11.06 11.2599 10.6667 10.6599 10.6667H9.99325V8.66667C9.99325 8.3 9.69325 8 9.32658 8H5.32658V6.66667H6.65992C7.02658 6.66667 7.32658 6.36667 7.32658 6V4.66667H8.65992C9.39325 4.66667 9.99325 4.06667 9.99325 3.33333V3.06C11.9466 3.84667 13.3333 5.76667 13.3333 8C13.3333 9.38667 12.7933 10.6533 11.9266 11.6Z",fill:"#6F6E77"})}),d.jsx("defs",{children:d.jsx("clipPath",{id:"clip0_6524_22412",children:d.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),y$e={codepen:d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("g",{clipPath:"url(#clip0_6523_22409)",children:d.jsx("path",{d:"M15.9879 5.44292C15.9843 5.42352 15.981 5.40413 15.9759 5.38517C15.9726 5.37375 15.9688 5.36298 15.9651 5.35177C15.9597 5.33497 15.9541 5.31816 15.9474 5.30179C15.9427 5.29037 15.9373 5.27938 15.9321 5.26839C15.9248 5.25288 15.9173 5.23758 15.9086 5.22271C15.9026 5.21172 15.8957 5.20138 15.889 5.19082C15.8798 5.1766 15.8703 5.1626 15.8599 5.14902C15.8524 5.13889 15.8446 5.1292 15.8365 5.1195C15.8257 5.10657 15.8141 5.09429 15.8024 5.08223C15.7934 5.07318 15.7843 5.06413 15.7748 5.05529C15.7623 5.04387 15.7494 5.0331 15.7358 5.02276C15.7255 5.01479 15.7154 5.0066 15.7046 4.99927C15.7007 4.99647 15.6973 4.99324 15.6932 4.99065L8.38116 0.115543C8.15039 -0.0385144 7.84939 -0.0385144 7.61863 0.115543L0.306176 4.99044C0.302082 4.99302 0.29885 4.99626 0.294756 4.99906C0.283983 5.0066 0.273856 5.01457 0.263514 5.02254C0.250155 5.0331 0.237011 5.04387 0.224515 5.05486C0.215034 5.06348 0.205985 5.07253 0.19715 5.0818C0.185084 5.09386 0.17388 5.10614 0.162892 5.11907C0.154704 5.12877 0.146947 5.13846 0.139406 5.14924C0.129064 5.16281 0.119583 5.1766 0.110318 5.19104C0.103639 5.20159 0.0969593 5.21194 0.0907108 5.22293C0.0820922 5.23779 0.0745509 5.25309 0.0674405 5.26817C0.0622694 5.27916 0.0566673 5.29037 0.0521425 5.30157C0.0454631 5.31795 0.0396456 5.33475 0.0342589 5.35156C0.030596 5.36276 0.0267177 5.37375 0.0237011 5.38388C0.0187455 5.40284 0.0150825 5.42201 0.0116351 5.44162C0.00969592 5.45153 0.00732581 5.46123 0.00603302 5.47136C0.00215465 5.50109 0 5.53082 0 5.56121V10.4372C0 10.4673 0.00215465 10.4975 0.00646395 10.527C0.00797221 10.5378 0.0107733 10.5464 0.0129279 10.5568C0.0163753 10.5762 0.0193919 10.5955 0.0258558 10.6149C0.0288723 10.6257 0.0323198 10.6365 0.0366291 10.6483C0.0420157 10.6656 0.0474023 10.6828 0.0538662 10.6985C0.058391 10.7093 0.0646395 10.7201 0.0689488 10.7309C0.0760591 10.7459 0.0840314 10.761 0.09265 10.7768C0.098683 10.7875 0.105578 10.7983 0.112042 10.8082C0.121307 10.8233 0.131434 10.8362 0.142207 10.8491C0.149748 10.8599 0.157289 10.8685 0.165908 10.8789C0.176897 10.8918 0.187455 10.9047 0.200382 10.9162C0.209217 10.9248 0.21762 10.9355 0.228393 10.942C0.24089 10.9528 0.254249 10.9636 0.267177 10.9748C0.277519 10.9834 0.288723 10.9898 0.297342 10.9982C0.301436 11.0004 0.303806 11.0047 0.308115 11.0067L7.61863 15.8841C7.73412 15.9617 7.86641 16.0005 8 15.9998C8.13359 15.9992 8.26588 15.9611 8.38137 15.8841L15.6938 11.0092C15.6979 11.0067 15.7014 11.0036 15.7052 11.0008C15.716 10.9933 15.7261 10.9853 15.7365 10.9773C15.7498 10.9668 15.763 10.9558 15.7755 10.9446C15.785 10.9362 15.794 10.9269 15.8031 10.9179C15.8149 10.9058 15.8263 10.8935 15.8371 10.8806C15.8453 10.8709 15.8531 10.8612 15.8606 10.8509C15.8709 10.8373 15.8804 10.8233 15.8897 10.8091C15.8964 10.7987 15.903 10.7882 15.9093 10.7776C15.9179 10.7625 15.9254 10.7472 15.9328 10.7317C15.9379 10.7207 15.9433 10.7097 15.9481 10.6985C15.9548 10.6819 15.9604 10.6651 15.9657 10.6483C15.9694 10.6371 15.9733 10.6261 15.9765 10.6149C15.9815 10.596 15.9849 10.5766 15.9886 10.5572C15.9903 10.5473 15.9929 10.5376 15.994 10.5275C15.9978 10.4977 16 10.468 16 10.4376V5.5625C16 5.53212 15.9976 5.50238 15.994 5.47265C15.9922 5.46209 15.989 5.45347 15.9869 5.44292H15.9879ZM7.99978 9.62638L5.56826 8.00005L7.99978 6.37351L10.4315 8.00005L7.99978 9.62638ZM7.31245 5.17919L4.33171 7.17288L1.92561 5.56336L7.31245 1.97221V5.17919ZM3.09515 7.99984L1.37531 9.15021V6.84947L3.09515 7.99984ZM4.33171 8.82765L7.31245 10.8211V14.0281L1.92561 10.4365L4.33171 8.82722V8.82765ZM8.68733 10.8207L11.6681 8.82722L14.0744 10.4365L8.68733 14.0277V10.8207ZM12.9046 8.00027L14.6247 6.84969V9.15064L12.9046 7.99984V8.00027ZM11.6681 7.17288L8.68733 5.1794V1.97221L14.0744 5.56336L11.6681 7.17288Z",fill:"black"})}),d.jsx("defs",{children:d.jsx("clipPath",{id:"clip0_6523_22409",children:d.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),codesandbox:d.jsxs("svg",{width:"14",height:"16",viewBox:"0 0 14 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("g",{clipPath:"url(#clip0_6523_22406)",children:d.jsx("path",{d:"M6.24312 14.1129V8.35021L1.28724 5.49888V8.78388L3.55732 10.0999V12.5702L6.24312 14.1129ZM7.53036 14.1468L10.2658 12.571V10.0422L12.5506 8.71812V5.47426L7.53036 8.3727V14.1468ZM11.8904 4.36906L9.25164 2.83995L6.93472 4.18436L4.60022 2.8386L1.93795 4.38817L6.90626 7.24665L11.8904 4.36906ZM0 12.0115V4.02675L6.91821 0L13.8378 4.00984V11.9988L6.91805 15.985L0 12.0115Z",fill:"black"})}),d.jsx("defs",{children:d.jsx("clipPath",{id:"clip0_6523_22406",children:d.jsx("rect",{width:"13.8378",height:"16",fill:"white"})})})]}),dailymotion:d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsxs("g",{clipPath:"url(#clip0_6523_22345)",children:[d.jsx("path",{d:"M16 0H0V16H16V0Z",fill:"white"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.73038 10.3003C8.40789 10.6268 8.00377 10.7901 7.51804 10.7901C7.04025 10.7901 6.64411 10.6308 6.32956 10.3122C6.01503 9.99367 5.85776 9.58351 5.85776 9.08176C5.85776 8.60389 6.01901 8.20766 6.3415 7.89306C6.66401 7.57847 7.06016 7.42118 7.52998 7.42118C7.84849 7.42118 8.13715 7.49484 8.39594 7.64219C8.65474 7.78953 8.8558 7.99063 8.99913 8.2455C9.14246 8.50034 9.21412 8.77908 9.21412 9.08176C9.21412 9.56757 9.05287 9.97376 8.73038 10.3003ZM9.10662 3.58632V6.35792C8.82791 6.07918 8.53131 5.87808 8.21678 5.75463C7.90223 5.63118 7.54988 5.56946 7.1597 5.56946C6.53062 5.56946 5.96527 5.72476 5.4636 6.03538C4.96193 6.34597 4.57176 6.77007 4.29305 7.30768C4.01435 7.84528 3.875 8.44062 3.875 9.09369C3.875 9.76269 4.01236 10.366 4.28708 10.9036C4.5618 11.4412 4.95197 11.8653 5.45763 12.1759C5.96328 12.4865 6.54258 12.6418 7.19553 12.6418C8.14312 12.6418 8.80403 12.3312 9.17831 11.71H9.20218V12.5595H11.0894V3.15625L9.10662 3.58632Z",fill:"#232323"})]}),d.jsx("defs",{children:d.jsx("clipPath",{id:"clip0_6523_22345",children:d.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),flickr:d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("rect",{width:"16",height:"16",fill:"white"}),d.jsxs("g",{clipPath:"url(#clip0_6523_22379)",children:[d.jsx("path",{d:"M8.43286 7.78387C8.43286 9.321 9.67925 10.5674 11.2166 10.5674C12.7538 10.5674 13.9999 9.321 13.9999 7.78387C13.9999 6.24675 12.7538 5.00061 11.2166 5.00061C9.67925 5.00061 8.43286 6.24675 8.43286 7.78387Z",fill:"#FF0084"}),d.jsx("path",{d:"M2 7.78408C2 9.32121 3.24614 10.5676 4.78352 10.5676C6.32089 10.5676 7.56703 9.32121 7.56703 7.78408C7.56703 6.24695 6.32089 5.00081 4.78352 5.00081C3.24614 5.00081 2 6.24695 2 7.78408Z",fill:"#0063DC"})]}),d.jsx("defs",{children:d.jsx("clipPath",{id:"clip0_6523_22379",children:d.jsx("rect",{width:"12",height:"5.568",fill:"white",transform:"translate(2 5)"})})})]}),giphy:d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("rect",{width:"16",height:"16",fill:"#121212"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 3.38889V12.2778H5.11111V3.38889H4Z",fill:"#00FF99"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.6663 5.61111V12.2778H11.7774V5.61111H10.6663Z",fill:"#9933FF"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.75 3H4V4.11111H8.83333V3H7.75Z",fill:"#FFF35C"}),d.jsx("path",{d:"M9.00041 4.11111H7.33374H8.83374V3.77778L9.00041 4.11111Z",fill:"#999999"}),d.jsx("path",{d:"M8.83374 4.11111H7.33374L8.44485 3L8.83374 3.77778V4.11111Z",fill:"#999237"}),d.jsx("path",{d:"M10.6663 7.44444V5.77778L11.7774 6.33333L10.6663 7.44444Z",fill:"#5C1F99"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.6667 11.8889H4V13H11.7778V11.8889H10.6667Z",fill:"#00CCFF"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.6668 5.22222V4.11111H9.55569V3H8.44458V3.90739V5.0185V6.33333H9.55569H10.6668H11.7779V5.22222H10.6668Z",fill:"#FF6666"})]}),instagram:d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:[d.jsxs("g",{clipPath:"url(#clip0_6523_22356)",children:[d.jsx("mask",{id:"mask0_6523_22356",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"16",height:"16",children:d.jsx("path",{d:"M4.70325 0.0949238C3.85627 0.1349 3.27778 0.270564 2.77227 0.468642C2.24897 0.672648 1.80537 0.946046 1.36408 1.38914C0.922279 1.83249 0.650958 2.27688 0.448504 2.8007C0.252489 3.3075 0.119662 3.88627 0.0822604 4.73377C0.045126 5.58283 0.0366102 5.85363 0.0407495 8.01522C0.0448729 10.1765 0.0544124 10.4479 0.0949012 11.2972C0.135388 12.1439 0.270546 12.7222 0.468623 13.2279C0.672886 13.7512 0.946004 14.1946 1.38935 14.6361C1.83245 15.0777 2.27708 15.3487 2.80115 15.5515C3.30744 15.7472 3.88644 15.8806 4.73369 15.9177C5.58273 15.9551 5.85379 15.9634 8.01483 15.9592C10.1769 15.9551 10.448 15.9456 11.297 15.9053C12.144 15.8648 12.722 15.7292 13.228 15.5316C13.7513 15.3268 14.1949 15.0542 14.6362 14.6109C15.0775 14.1678 15.3488 13.7231 15.5512 13.199C15.7473 12.6927 15.8806 12.1137 15.9175 11.267C15.9546 10.4174 15.9634 10.1461 15.9593 7.98478C15.9551 5.8232 15.9453 5.55239 15.9051 4.7036C15.8649 3.85609 15.7292 3.27811 15.5314 2.77208C15.3269 2.24877 15.054 1.80567 14.6109 1.36387C14.1678 0.922574 13.7232 0.650729 13.1991 0.448785C12.6926 0.252768 12.1138 0.119166 11.2666 0.0825425C10.4175 0.0448876 10.1465 0.0366393 7.98465 0.0407642C5.82336 0.0448892 5.5523 0.0541772 4.70325 0.0949238ZM4.79611 14.485C4.02004 14.4512 3.59863 14.3222 3.31776 14.2142C2.94585 14.0703 2.68046 13.8977 2.40114 13.6205C2.12234 13.3422 1.94928 13.0776 1.80408 12.7064C1.69497 12.4255 1.5637 12.0046 1.52734 11.2286C1.48788 10.3896 1.47886 10.1378 1.47498 8.01237C1.47086 5.88742 1.47859 5.63569 1.51522 4.79593C1.54848 4.02038 1.67822 3.59843 1.78602 3.31782C1.92993 2.94539 2.10196 2.68051 2.37973 2.4012C2.65801 2.12187 2.92263 1.94933 3.29402 1.80412C3.57463 1.69451 3.99555 1.56426 4.77134 1.52738C5.61084 1.48766 5.8623 1.47915 7.98723 1.47502C10.1127 1.47089 10.3644 1.47838 11.2042 1.51526C11.9797 1.54904 12.4016 1.67749 12.682 1.78607C13.0541 1.92998 13.3195 2.1015 13.5986 2.37979C13.8777 2.65808 14.0507 2.92218 14.1959 3.29435C14.3055 3.57418 14.4358 3.99562 14.4724 4.77117C14.5124 5.61068 14.5214 5.8624 14.5253 7.98736C14.5294 10.1128 14.5217 10.3646 14.4848 11.2038C14.451 11.9799 14.3223 12.4016 14.214 12.6827C14.0701 13.0543 13.898 13.3197 13.62 13.5991C13.342 13.8773 13.0774 14.0509 12.7057 14.1961C12.4256 14.3055 12.0042 14.436 11.2289 14.4729C10.3894 14.5123 10.1379 14.5214 8.01225 14.5252C5.88732 14.5294 5.63586 14.5214 4.79611 14.485ZM11.2854 3.74493C11.2864 4.27211 11.7151 4.69896 12.2422 4.69792C12.7697 4.69689 13.1965 4.2685 13.1957 3.74132C13.1947 3.21414 12.7661 2.78704 12.2386 2.78807C11.7112 2.7891 11.2844 3.21775 11.2854 3.74493ZM3.91277 8.00773C3.91714 10.2653 5.75063 12.0913 8.0076 12.0869C10.2648 12.0825 12.0919 10.2495 12.0875 7.99201C12.0831 5.73526 10.2494 3.90819 7.99188 3.91257C5.73489 3.91696 3.90837 5.75073 3.91277 8.00773ZM5.34648 8.0049C5.3439 6.53969 6.52978 5.34942 7.99471 5.34683C9.45991 5.344 10.6504 6.52937 10.6533 7.99484C10.6561 9.46031 9.47022 10.6503 8.00477 10.6532C6.53984 10.656 5.34932 9.47037 5.34648 8.0049Z",fill:"white"})}),d.jsxs("g",{mask:"url(#mask0_6523_22356)",children:[d.jsx("mask",{id:"mask1_6523_22356",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"-1",y:"-1",width:"18",height:"18",children:d.jsx("path",{d:"M16.5905 -0.583628H-0.603516V16.6106H16.5905V-0.583628Z",fill:"white"})}),d.jsxs("g",{mask:"url(#mask1_6523_22356)",children:[d.jsx("mask",{id:"mask2_6523_22356",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"-1",y:"-1",width:"18",height:"18",children:d.jsx("path",{d:"M16.6701 -0.663237H-0.683105V16.6902H16.6701V-0.663237Z",fill:"white"})}),d.jsxs("g",{mask:"url(#mask2_6523_22356)",children:[d.jsx("mask",{id:"mask3_6523_22356",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"-1",y:"-1",width:"18",height:"18",children:d.jsx("path",{d:"M16.6701 -0.663237H-0.683105V16.6902H16.6701V-0.663237Z",fill:"white"})}),d.jsx("g",{mask:"url(#mask3_6523_22356)",children:d.jsx("rect",{x:"-0.688721",y:"-0.665792",width:"17.3622",height:"17.3622",fill:"url(#pattern0)"})})]})]})]})]}),d.jsxs("defs",{children:[d.jsx("pattern",{id:"pattern0",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:d.jsx("use",{xlinkHref:"#image0_6523_22356",transform:"scale(0.000439947)"})}),d.jsx("clipPath",{id:"clip0_6523_22356",children:d.jsx("rect",{width:"16",height:"16",fill:"white"})}),d.jsx("image",{id:"image0_6523_22356",width:"2273",height:"2275",xlinkHref:"data:image/jpeg;base64,/9j/4AAQSkZJRgABAgEAlgCWAAD/7AARRHVja3kAAQAEAAAAHgAA/+4AIUFkb2JlAGTAAAAAAQMAEAMCAwYAAFokAABijgAAd23/2wCEABALCwsMCxAMDBAXDw0PFxsUEBAUGx8XFxcXFx8eFxoaGhoXHh4jJSclIx4vLzMzLy9AQEBAQEBAQEBAQEBAQEABEQ8PERMRFRISFRQRFBEUGhQWFhQaJhoaHBoaJjAjHh4eHiMwKy4nJycuKzU1MDA1NUBAP0BAQEBAQEBAQEBAQP/CABEICOMI4QMBIgACEQEDEQH/xADDAAEBAQEBAQEBAAAAAAAAAAAAAQUEBgMHAgEBAQADAQEAAAAAAAAAAAAAAAECAwUEBhAAAQIEBAcBAQEBAQAAAAAAAAMFcIA1FiIjMxQBEQIyEwQ0MRIGFZARAAADCAICAgEABwUJAQAAAAADo4ABcqLSBDREsXNDRcECESExQVGREjIQYdETM3GB8VJiksLiFBUSAAECBgEEAwABAwIHAAAAAAABAnCxcpIDM0QxMkNFcZFzERBBEmGCoCFRgUKDNP/aAAwDAQACEQMRAAAA9X5n5Z3e26jLei6jLRqMsajLGoyxqMsajLGoyxqMsajLJqMsajLGoyxqMsajLGoyxqMsalyqajLGoyxqMsajLJqMsajLGoyxqMsajLRqMsajLGoyxqMsajLGoyxqMsajLppswabMGmyxqMwumzIajLppsyGoyy6jLGoyxqMsuoyxqMsuoyxqTMhqzMi6jLGoyy6jLGoyy6jLGoyy6jLGoyxqMsuoyxqMuLqsoarKLqMsajLLqMsajLLqMsajLGoyi6rKGqyhqsouqyhqXKGoyy6jLGoyxqMouqyhqsoarKGqyi6rKGqyhqsouqyhqsoarKGqyhqMouqyhqsoarKGqyi6rKGqylarKGqyhqsoarKLqsoarJGsyRrMkazJGsyRrMka0yhqsouqyhqsoarKGqyhqsoarKGqylarKGqyi6rKGqyhqsqGsyRrMkazJGsyRrMkazJGsyRrMkazJGsyRrMkazJGsyRrMkazJGsyRrMka2149hh+rvDOV4Obg7+Ds6w2UAAAAAEAAACAAAAAAAKlAQAAAAAAAAAAECABQFAEAKBLFWCwAAUAFABQAVLAFABQAUAFABQCVYAFABQAUAFgAUAAFABQEsBVgAAUAAFAAABUsAAtAAAABQAAAAIFAAAAAAAC0AAAAAAAAABLFAAAAAAAAAAAAAAAAAAA1eDv4NfFDZQAAAAAAQAAAIAAAAAAWCgBAAAAAAAAAAQIAWFqCkAFABBQAAUAAFABQAVLAFABQAUAFABQJZVgAUAFBQAIFABQAAUAFASwVFAABQAAUAAFAgAAtAAABQAAAAAIFAAAAAAAC0AAAAAAAAABLFAAAAAAAAAAAAAAAAAAA1eDv4NfGDYAAAAAAAABAAgAAACpSKIsKlAAQAAAAAAAIAAAAAAFBAFAAABQAUAAFABUsAUAFBQAUAAFBUsAUAFABQAWLAAFABQAAUBBbAAABQAAUAAFAgAoFAAABQAAAAAIFAAAAAAC0AAAAAAAAFBAEsUAAAAAAAAAAAAAAAAAADV4O/g18YNgAAIAAAAAAACwIAAAAWCglQoAAQAAAAAIAAAAAAAsAFALAAFAABQAUAAFSwBQUAFABQAUARbLAFABQAUARbLAFAABQAAUCFWAABQAAAUAAFQAAAtAAABQAAAAAIFAAAAAAC0AAAAAAAAFABEFAAAAAAAAAAAAAAAAAAA1eDv4NXGDYAAAAAAAAAAAABAAAAFgpBYKAAAEACAAAAAAAAAAUAAAFAABQAAUAFAlRQAUAFABQAUAlWABQAUAFASlSwBQAAUAFASwWFAABQAAUAABBbLAAFAAAAC0AAAAAQBRSAAAABQAAoAAICgAAAUCAAAAAAAAAFIAAAAAAAAADV4O/g1cYNlAAAAAABAAAAAAAAAAQAAUlQqUAAACAAAAAAAAAAAAAAUAAFABQAUBFVABQAUAFABQBFLAFABQAUAFlCABQAUAAFASwLFABQAAAUAAFllEAAFAAAABQAoAABLFUBAAAAFAAAAAAACgAAAUBLAAAAAAABQASwAAAAAAAAA1eDv4NXGDZQAAAAAAAAAAQAAAAAAAACoSgAAAACAAAAAAAAAAAUAAAFAABQAVKEFABQAUAFABRAFABQAUAFARVQAUAAFAABQEpUsAAUAAFAAABQIAAFAAABQAAoAAFSwWCwAAAAUAAAAAAAKAABQAEogAAAABQAAACLAAAAAAAADV4O/P1ceo2KgqBYKgoAAAAAAAAAAQAAAAAACpQECAAAAAAAAAAAAUAAFAABQAAUQBQAUAFABQAUlIFABQAAUAFEVUAAUAFAABQAEsUAFAAABQAAUACABQAAAAUAAKCAtAQACwAABQAAAAAAAAAUAAAKAgAAACgAAAABKIAAAAAAADVz9DP1ccNlqCpQCAAAqUBAAAAAAAAAAAQAAAIWCpQAAAAAAAAAAAAAFAABQAAUgBQAUAFABQAUBBQAUAAFABQEpYIBQAtAABQAAWWUgAUAAFAABQAAIFAAAAABQAAAAUCUoBAABQAAAAAAAAUAAAAAACKqUAAAAAAAAAEsAAAAAAANTg0M/Vxw2UAAAAACxSKIoAAABAAAAAAAAAQAIAKJQAAAAAAAAAABQAAUAFRRABQAUAFABQAUBLFABQAAUAFAEUIBQAoFABQgALQBAFAABQAAUAAAQKVLAAAAFAAAABQAAAIKBQAAAAAAAAUAAAAAAABLCoqgAAAAAAAELBQAAAAAANTg7+DVxw2UAAAAAEAAAqCoKAAAAAAEAAACAAAAAFlAAAAAAAAAAAUAARQAAUAFABQAUIC0ARQAlCgAlABQAVAABQAUAFAAABQEFAAC0AIBQoCUAIFqUQAAUAAAAAFAAAAAgUAKAAAAAABQAAAAAAAAAIAAUlAAAKAEUAAAAAAAADVz+/g1ccNlAAAAAAAAAAAWEoAAAAAAAAgAAAEAAAAABQKgqUAAAAABSIABQAAUAFABQAUARQAAUAFABQAEsWwAUAFAABQAAUACUWABQAAUAAKAEUUEAFRQAAAAUAAAAAAQBQAoAAAAAAFAAAAAAAAAAiiUAAAAAELQAAAAAAAAANTg7+DVyA2UEAAAAAAAAAACKgoAAAAAAAAQAAAAAAAAAAABYKgqJagoJYAUAAFAABQAUAFABUAAFABQAUAARVQBQAUAAFAABQAAVLAAFAABQAAUQFAIAFCgAAAAUAAAAFASwAAAAABQAAAoAAAAAAAAAAAAAAARQAAAAAAAoAAIA1ODv4NfIDOgAAAAAAAAAAALBQAhBUFAAAAAAAAAAAAAAAAAAEAAoAAAKACgAAoAAKACopAoAAKACgAAoECgAoAAKACgAAoAEACgAAoAAKAAAgApYAAABaAAAAACgCAAAAAAKAAAAAAAAFAAAAAAAoAAAgAAAAAAAAAAAABqcHfwauSGygAAAAgAAAAAAAAAFQVBUFQVBUFSgAAAIAAAACgBAAAAAAKAACgAAoAAKAACpYAoAKAACgAoACKqACgAAoAKAACgAIKqAAAKAACgCFAIAqoAAAoAAAAUACgAJRFCAAACgAAAAAAAAABQAAAKAAAAIAAAAAAAAAAAACkUafB38GrkhsoAAAAAAAAAAAAAAAAAAAIAABUoAAAAAEAAAAoAAAAAKAACgAAoAAKIVCgAAoAKAACgApKIAKAACgAoAAKAJFi2iQFAAoAAKAAABAopAAAoAAAAAKAAAILBUUAACgAAAAAAAAAAoAAAUAAAABAAAAAAAAAAFEURQABp8HfwauUGygAAAAAAAAAgAAAAAAAAAAAAAAFSgQAAAAAAACgAAAAoAAAKIVBULUALYAAKAAEoAKAACgIKAACgAAoAAKAICqgAAoAAAKAAACoUUIAAKAAAACgAAACAoAgoAAUAAAAAAAAACgAAABQAAACWAAAAAAAAACwVBUFAABp8HfwauUGygAAAAABAAAAAAAAUAAAAAEAAAAAALKAAAAAAAAAoAAAKIVACgAAoAASgAAoAKAACgCAKACgAAoAAKAAIopAAoAAAKAAACiAFBAAoAAUAACgAAAAAAogAAAAAFAoAAAAAAAAAAAAAAAEFAAAAAAAAAAAAoAAGpwd/Bq5QZ0CKJQAAAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAAAFAAABQAAUAAAJQAAUAAFABQACFAABQAAUAAFABSAsLABQAAAUAAAFEBSUEsUAAAAFAACgAAAAUABAAAAABQAAAAoAAAAAAAAAAAAFAAikiiKIolARQoAAAAAADUz9DP08oNmQAACwVBUoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAoAQACgAAoAAKAACgACKWAAKAACgAAoAAKgKgCgAAoAAAAKAICgKICkAACgAAAAAAAoAUAlgAAACgAAAAAAABQAAAAAAAAAKAAAAAAAAgAAABQAAQBqZ+hn6uWGzIAAAEAqCoKgqCoKAAAFBAAAUAAAAAAAAAAAAAAAAAAFACAAUAAAFAABQAAAUAAFQLBQAgAFAABQAAUBFCFAAABQAAAUAAQFUAQWUSwC0AAAAAAFAAAAAAhSKEsUKAAAAAAAAAAAACgAUAAAAAAAAgoAAAIAAAAAAAADUz9DP1cwM6AAAAAAAAAsFQVBUFQVFVBUFAAAAAAACgAAAAAAAAABAKAAACgAAAoAAAKAACkFILEoAAKAAACgAAoAAKgAAAoAAKAAAACxQAIKALAAAABQKAAAAAAAAItAIAAABQAAAAAAAAAKAAAAAAAFAAAQCwUACWAAAAAAAAAGpn6Gfp5gbMgAAAAAAAAAAAAAAAAAAFgoAAACCoWoKgqCoKgoAAAAUAAAAFAAAEKRVgsAFACAAUAAFAABQAAAUAAFEBSABQAAAUAAAFAAELAUUBLAsAAAUAAAKAAAABQAAEAAAAAAFCgAAAAAAAAAAAAAAAAEsoACoKBAAAAAAAAAKNPP7+DTzQ2ZAAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAAAFQVBULUFSgABC1BYAAAKAEAAoAAKAACgAAAoAQACgBUqKEAAAAoAAAKAAAAlLKAhYUUQKAAAAAAACgAAABQAgAKQAKAAAAAAAFAAAAAAAAAAAAAJYoAIFLKQApFEURRFEUAoAGlwd/Bp5oZ5AAAAAAABQAAAAAAAAAAAAAAAAAAKAAAAAAAACgABAAKAAAACgAAAoAAAKAAChAAAKAAACkBYAoAAAAKAAACgAAAIAoItgAAABQKAAAAAAAAAILC0CWUAAAAAAAAAAAAAAAFAoAAAAACURRFgAAAAAAAAURRKAGlwd/Bq5wZ0AAAAAAAAAAAFAAAAAAAAAAACgAAUAAAAAAAJQAAAAAUAAAAFAAABQAAAlAAABQACChQCAsLBQAAAUAAAAFAAAAAQUoIAAAAUAAAAAKAAAABQAABAAAAKAAAAAAAABQAAAAAAAoAAAAAAAABKIoAAAAAAA0uDv4NPODZkAAAAAAAAAAAACgAAAAAAAAAAAAAoAAAAAAAKAAAACgAAAAAoAAAQCgAAoAAACWKsFgAAthAUAChAAAAAKAAACgAAAIAUACgAAAAAAAoAAAAUAAIAAAAAAAABaAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAQGnwd/Bp54Z5AAAAAAAAAAAAABQAKAAAAAAAAAACgAAAAAAoAAAAAKAAEAAAoAAAAKAAACgCFQBKAAAACgAAAAoAAAAAKAAAAAgpRFgAAAAFoAAAAAAAAAAAEChQAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAFAAAAAJYAunwd/Bo58VsyAAAAAAAAAIKgoAAACFoAAAAAAAoAAFAIFgqCoKAFAAIKgqColqCpQAAFEKAAAQoUAAQqWIFsAAAFAAAABQAAAAgFAAACgAUAAAAQAABQAAAAAAAoAAFAAAQBQBAAACgAAAAAAAAAAAoAAAAAAAAAAAAAAAAAAAACFWKNLP0ODT4IszyAAWCoKgqCoqoKgsAAAAABYAUACoKgqCoLAAqCwUAAAAAFAAAAABQAAALAABQAAAgFAWAAAFAAAABQgAAAAFAAAAABQAAAAAACVYoiwAACgAAUAAAAAAAACKoAAQAAAAAACgAAAAAAAAAAAAAUKAAAAAAAAAAAAAAAAA0s/Qz9HgDZmAAABUAAAAAAAAAAAAAKAAFAAAAAAoAAAAKAAAAAACgAAABAKAAAAACgAAAABKAAAACgAAAAAAoAAAAAAKAAAAAIAAAoAAAAAUAAAAAAAAAQoUAAAAAAAAAAFAAAAAAAAAAAAAAAABQAAAAAAAAAAGln6Gfo8IZ5AoAAAUAAAAAAAAAAAAACgAAAAAABaAAAACgAAAAAoAQAAAACgAAAAABKAAAACgAAAAABKAAAAAACgAAAAAAACLUpFVKCAAAAAACgAAABQAAACAAAAAAFAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAUAEAaWfoZ+nxBnkAAAAACgAAAAAAAAAAAAoAUAAAACgAAAAAoAAAAAKAAAAAACgBAAAAAKAAAAAChAAAAAAAKAAAAAACgAAAASgAQWAAACgABQAAAAAAAAAhYoFEpAAAAAAABQAAAAAAAAAAUAAAAAAAAACgAgAAKAAAAABpZ+hn6PEGeQAAAAAAAAKFAAAAAAAAAoAAAAAUCgAAAAoAAAAAAKAAAEAAAoAAAAAAASgAAAAAAoAAAAQAACgAAAAAAACLUFhQAAAAAAAAAAAAAUAACgAACFgABQAAAAAAAAAAAUAAAAAAAAAAAAFAAAAAAAAAAAAAaWfoZ+jxBnmAAAAAAAAAAACgAAAAAAAoUAAACgAEFShC1BUFQVBUFQVLaEAAAAAAAoAAQAAAACgAAAABAAKAAAAAAAACgAAACFlEUSwVAAACgAAABQAAAAAAAAAAUgAAAAAABQAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAFAaWfoZ/n8YZ5gAAAAAAAAAAABaAAAAAACgAASwVFpYLBYAAKAAAACgAAVBUFAAAEoAAAAAAAAAQCgAAAAAAAoQAAAAAAAAAACiFgBQAAAAAAAAAAAAAUAAAAICkWAAAUAAAAAAAAFAAAAAAAAAABQAAAAAAAAAAAAAAAAAAGln6Gf5/IGzMAAAAAAAAAAAAAFAAAAABRKsAAAFAAAABQAAAoFCAoAIAWCoKAFAAACAAAAAAAAAUIAAAAAAABQAAAAAAACAoiwABQAAAAAAAoAAAAAAAAKAAiiKAIAAAKAAAAAAAAAACgAAAQAAAAAKABQAAAAAAAAAAAANLP0M/z+QM8gAAUAAAAAAAAAAAFCgAEAFAAAABQoAAAFAAAABQAAAAAAAKiWpQAAAAAAAIAAAABQAAAgAAAAAAFAAAAAAIAAAoAAAAAAAAAAAAAKAAAAAACkAAAAAAAKAAAAAAAAACgAAAAAAAAAAAAAAAAAAAAAANLP0M/z+QM8wAAAAAUAAAAAKAAABQEoQAAUKAABQAAAAUAAAAFAAAAAAAABQAKgqIqCoKlAAAAAgAAAFAAAAAAAAAAAAAASwKWAAAAAAAAACgAAAAAAAAAoAEASwBQQAAKBQAAQAAAKAAAAAAAAACgAAAAAAAAAAAAAAAAANLP0M/z+UMswAAAoAAAAFAAAAAAABUUlSgAAUAAAFACgAUAAAAFAAAAAAAACAUAAAACoKIAAAAAAAACUAAAAAAAAAAAAgqCwAAAAoAAAAAAAAAAAKAAAAAAEoAAUiiLAAAKAAAAAABAUKAAABAAAAAAAAAAAAAAoAAAAAADSz9DP83mDPMAAAAAAAAAFAAAAACgVFIsLAABQAoAFAAABQAAAAUAAAAAAAAAAAJQAAFgqUACAAAAAAAAAAAAgAFJaSiKIoiiKIoiiLAAAAAAAAAAAKAAAAAAACgAQAAAQqAKAAAAACgAAAAAAAAAoAAAAAAAAAAAAAAAAAAAADSz9DP83lDPYAAAAAAAAAAAChQAAEoCKUSoABQKAAACgAABaAAACgAAAABAAAAAAAAAQKsUSgAAAAEAAAAAAAAAAAAACFQVBUAAAAAAAUAAAAAAAAAFAAAAACFRVQAAAAAABQICgAgAAAUAAAAAAAAAAAFAAAAAAAAAAAAAAaWfoZ/m8wZZgAAoAAAAAUAAACgAAASghaUIAAKAAAAChQAKAAAACgAAAAAABAAAAAAACxFAAAACgAAAABAAhUFQWURRFEURRFEURRFEUQUAAAAAAAAAAFAAAAABQCUkURYAAFgFAAACkWAUAAAAAACABQAAAAAAAAAAAAAAAAAAAUAABpZ+hn+XzhnmAAAAAACgAAAAAAoAACVQCKsoQAAKAFAAoAAAKAAAFoAQAAAAAAAEAAAAVBQBAAAAAAAAAKAAAAAQVBUFQVBUFgAAAAAAAABQAIAAAAAAFAAAAAABQAAJFEoAABSAAAAAAFAAAAAAAAABQAAAAAAAAAAAAIAAABpZ+hn+XQGeYAAAAAAAAKAAAAAFAoACUAIKoQAUCgAAAoAAAWgAAoAAAQAAAAAAAEACkUAAAABAAAAAAAAAEURRFEURRFEURRFEUQAAAAUAAAAAAAAFAAAAAAgUAAILBQAABQABAAFAgAAAAAAUAAAAAAAAAAAAAAURVRRFEURRFEURRFGjn6Gf5POGewAAAAAAAAAAAFACgAAUAACUEsVSoAAFAAABQoAAFAAAAAAACAAUAAAAAIWCoKgqCgAAAACAAAAAAAAAAACCwoAAAAAAAAAAEACgAAAAAoAAAAACCgFlQAAAQCgAAAAAAoEAAAAAAACgAAAAACiKIoiiKJQAAAAAAA0c/Q4PLoiss5QAEAAUAAAAAAAKBQAAAAUACUpLFUIAAFACgAUAAAFAAAAAAACAAAAAAKgqCgCAUAAAAAAAAAAIACgAIoiiKIogAQAAAAAAKAAAAAAACgAQAAAAKAAAAAAEoAsQAAAKAAAAAACgAAAQAAAAUiiKAoAAAAAAAAAAADR4O/g8mgMtgACAKRRKCUQKAAFAAAAAoAAAAWgSgliqEAAFoAAAKAAAACgAAAAAAABAABYAAFEURRFBLAAAAAAAAAAAAAAAAAAAEAAFAAAAAAAAgUAAAAAFAAAAAAgUAAAABFVFgACAAABQAAAFgCkURVRRFEUSgAAAAAAAAAAAAAAABo8HfweTQGWYAKAAAABFEoJYBQKAAAACgABQAKAABCqlgFAAoAAAKAAAAAAACgAAALLAAAAAAhUFAAEAAAAAAAAAAAAAAAAEAUAACAAAAAABQAAAAAUCAAAABQAAAAAIFAAAARVRQAgFEUkUBQAAAAAAAAAUAAAAAAAAAAAAAABo8HfwePQGWwAAAAAAFACgIoASwBQAAAAtAAAABQAEstUIAAFAAABQAAAAAAAAAAAFiKlABCwAUBYKAAIAAAAAAAAAAABAoCKIsAAAAAAAAoAAAEAACgAAAAAoAEAAACgAAAAsAAAAAACgAAAAAAsAAAAAAAAAAAAACgAAAAAANHg0M/xaQy2AAAAAAABQAKAAlEoRYAoAAUACgAAAoUABFKlEAKQKAAAAACgFEoAAAAJRFEEAFEURRFEUSgAAAAAAEABQAAAAAAAAAAAAEUkFAAAAABQAAAAIFAAAAABQAAIAAFAAAABYAAAAAAFAAAAAAAABQAAAAAAAAAAAAAAAGln6Gf4tIZbAAAAAAAAoAAAAAFAihKIALQAAAUAALQAAAVKAEogFFiiAAFJQAAAAABQAAgAAAAAAAAAAAAAAAAAAAAAEAAAAAAEqwAAAAAoEAAAACgAAAAQKAAAACgAAQAAKAAAAACgAQAAAAKAAAAAAAAAAAACgAAAAAAANLP0M/wAOkMtgAAAAAAAAUCgAAAAAoCURVRYAoAAAKFAAoAAAAKAAABFAKAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAABQCUQAAIAFAAAAAABYAAAAFAAAAgUAAAAAFAAgAAUAAAAAAFAAAAgAAAUAAAAAAAAAAAAAAABpZ+hn+HUGWwAAUiiKIoiwACgAAAUAAAAALUolCLAFAACgUAAAFAAAABQAAAAAAAAUAAAAAAIAAAAAAAAAAAAAAAAAAACgAQAABKEogoAAAEAACgAAAAoEAAACgAAAQKAAAAACgAAQAKAAAAAAACgAAAAAAAAAAAoAAAAAEAA0uDv4PBqDLYAAAAAABFgFopAAAAAAoAAAUCgRRFEChQAAKAAAACgAAAAAoAAAAAAAAAAAAQAAACgAAgAKAAAAACABQAAAAAAAAWAJRFEWAAUAACAABQAAAUCAAABQAAAAWAAAABQAAAAAIFAAAAAAABQAAAAAAAAAAAAAAAGlwd/B4NIZbAAAUAAAABKAoCLAVYsAAAAUAAKABQEoSiLLRSAABQAAAAAUAAAAAAAFAAAAAAAACAAAAAAAAAAAAAoAAAAAAEAACgAAAAAsSiAAAACgAAQAKAAACgQAAAKAAAACwAAAAAKAAAAAACgAAQAAAAAAAAKAAAAAAAA0uDv4OfqDLYAAAAAAAAAAFoAAEWKKRRAAABaAAAACgABUUoEUQAAKAAAAAACgAAAAAAAAAAAoAQAAAFBAUAAAACAAAAAAAABQAAIAAFAAARRFiBQAAAUAACABQAAAUCAAABQAAAAUACAAAABQAAAAAAUAAAAAAAAAAAAAAABp5+hwc/TFZbIoiiAAAABQAAAAoFAAAAAiliiCgAAUAAAFACgAAWKIUiiAAALFAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAQKAAAAACgAQAAAKAASiKSCgAAAoAAEACgAAAoAEAACgAAAAoAAEAAAACgAAAAAAAAAACqlAAACLAADT4O/g52oMtgAAAEURRAAFEAAFoAAAAKAAAlEWWgAAAAoAAAWgAAAAAJSxQABFEWAAKAAAAAAAAAACgAAAAAAAAAgAAAAAUAAAAACBQAAAAUCAAAABUWAAIFAAABQAIAFAAAABQAAIAFAAAAAABQAAAAAIFAACkURQAAAAAAAAABpcHfwc7UGWwAAAAAAAAFAiiLAoiygAUAAAAFACgIpYUgAAAUAAKABQAAAAAAUBKIsAAAAUAAAAAAAAAAAAAAAAAAAAAKBAAAAAAoAAEACgAAAAoEAASiCgAAQKAAACgAQAKAAAACgAAAQKAAAAAAACiiKIolAAAAAAAKAAAAAAA0uDv4ObpC7AAAoFAAAAAAAAABQIqooiiLFAAAABQoABKIpYogAAUAKAAAABQAAAAIogWxSLAAAAAAAAAFAAAAABAAAAAAoAAAAAKBAAAAoAAEAACgAAAsAiggFqKJUBSBAoAAKAAAKSCgBSAACgAAAACrIolAAAAAKAAAAAAAAAAAAAAA0uDQ4ObqirsgAAAAoAAAAAAFAAAAAC0BKIoiwBQAAAtAAAABQIoiiAAC0AAAAAAFAAAlCLAAFAAAAAAAAAAAAAAAACgAQAAAKAAAACwAAAAKABAAAoAAALAIoARalBFIsQKFIolAKAAASiKsASiKJQCgIoAAAACgAAQAAAAAAAAKAAAAAA0+Dv4OZqC7AAAIoiiKIqooiiKWKIsAAAAUAAAKBQAIoiiBQAoAAFAAAAABYoiiKIKABQAAAAAUgKIoiwAAAAAAAAAAAAAACgAAAAAoEAAACgAAAQKAAACgAQAKAAAACwCUAqKAAAoEAAACgAAAAoEAAAACgAAAAAAAoAAAAAAAAAAAADT4O/g5mkLsAAAABQAAAAAoACKJRYoiiKIsAUKAAABQEoiiKIstAAAAABQAAAAIpYKAAAABQAAAAIsAUAAAAAAAAAAAKABAAAAoAAAALAAAAAoAEACgAAAoEAACgAAAsAAACgAAAoAEAACgAAAAoAAEAACgAAAAAAAAAAAoAAAAADT4NDg5emKu2AAAAAAAAAAAAC0AAAAAFAiiKIqoAFAAAABQIqooiiBQAAAAAUACKqLAAFAAAABQEogAAAAAAAAAAoAAAAAAKBAAAAoAAAECgAAAoEAACgAAQKAAACgAAoEAAACgAAAoAEAACgAAAAAoAAAAAAALAAAAAAAAAAAANTg7+Dl6Qu0AAAAACKIoiiKIpYAAAAKAABQAAAAUKiiKIAFAAAABQpKIogAAUAAAABKWLKAAABQAAEogAAUAAAAKAAABAAAAoAAAALAAAAAoAEACgAAAsAAACgAQAKAACgAAAsAAACgAAAAoAAECgAAAAAAoAAAAAAAAAAKAAAAAA1ODv4OVpBsACgAAAAAAAUAAAAAAAFiqiiLAAAFAAACkpYogAAAUAAKAilgAAAAAUACKqABQAAAAEpYAAAKAAAAAAAAACwAAAAKAAABAoAAAKBAAAoAAECgAAoAAECgAAAoAAAKBAAAoAAAKAAAAACwAAAAAAAKAAAAAAAAAAAA1OHu4eVpBsAASiKIoiiKIstAAAAAAAABQAAAAoFiiLAAAFACgEoiliwAAAAC0BKIoiwBQAAAAIstAAAABQEogAoAAAAAAAAAKAAAACwAAAAKBAAAAoEACgAAAoEACgAAAoAEACgAAAoAAKAAABAoAAAAKAAAAACgAAAQAAAAAKAAAAAA1eDv4OTpBsAAAAAABQAAAAqKIoiiLFFIogAAAAtAAAiiLFAAACgAUCKIogUAKAAASlgAAAAUKShKIsAUAABKqBQAAAAAAAAsAAAACgAQAAKAABAAooiiKIqyKIogoAAALAAAoAAAKABAoAAAKAAACgAAAsAAAAACgAAAAAAoAAAAAAAAAAADV4O/h5OiKbIoiiKIoiliiLAAAAAAAAKBQAAAIoixQAAAoAFASiKIoiiC0AAAFSiKIAKABQEoiiABQAoAFiwAAASqSlgAAAAAAAoAAAECgAAAQqoAAAUlLAAAAoAALAAEoiqgAAsAAACgAAoAAECgAAoAAAKAAAACgAAQAAAKAAAAAAAAAAAAAAA1eHu4eToBsAAAABQAAAAEoiiKIAAFAAACgAVKIoiiKIALQAAAAAWKIKABQAAIogAtAAAASliiACgEpYsAAAoFiiAAAACgAAAAAAsAFJYLCgAQoACgAQAKAAACgQAKAAEooikiiKqAACgAAAoAAKAABAoAAAKAAAAACgAAAAAQKAAAAAAAAAAA1uDv4eRogmwAAAFLAAKAAAAAAAABQAIoiiCgUAAAAAFSiKqKIogAUABKqKWAAAAABYqosAAAUBKIsoAFAiwACgUBKIAFCgAAQAAAqopEoigAKAABAoAAAECgAAoAALAAABKKBCpaBAIsoAAKAAACgAAoAAAKBAAAAoAAAAAAKAAAAAAAAAAAAAA1uHu4eP5wbAAAAAUAAAABKIoiqgAAUAAAAAFSiKqKIoiwABQAAoBKWLAAAKBUoiiAABQApKIogAUAKiwBQAEoiygUABKIALQAAQBQACgQAAKAAABAoAAAKBAAoAAAKBAAoCKAoCUAoCKIKBAAAoAAKAAACgAAAoAAAAKBAAAAAAAoAAACoKlAABADW4e/h43nixsAAABQAAAAAAAAAApKWKIogAAAAUAAKAABYoiiAAC0ACKIsAUKAAAiiLFACgAWLAAAKilgAAEqoFAAAACkpYpAAAAoAEAACgAAAsAAACgAQAKAACgAAsAACgAAAoABKqLAAKBAAoAAKAAACgAAAAoAAAAAAKBAAAAFgqUAAAAAINfh7uHjecGwAAAFAAAAAAAiiKIogAAUKAAAigFiiKIogAoFAAAAiiLLQAAAIpYsoAAABKWKIsoABKWKIKABYsAAApKWKIAAKAAAACgAAAQKFIoiiKIqyKIoACgAAsAAACooiiCgAQKAACgAAoABKqLAAKFIsAoAAAKAABAoAAAAKAAAAAAAWKqCpQAAAAAADW4e7i4vmiybAAAAAUAAAAAKAAAAABYoiiKIAKABQAAAEoirYogAAAAtiiKIAAFCkoiwABQAEqoogUBKIsoAFAiiCgAAWKIqooiwFIoiqASkigAKAAACgQAAKAABAoAAKAACgEoiqgQAKAACgAAoAAKiiLBSosAAoAAAKAAAACwAAAAAAKAqCoKAAAAAAAADX4e7h4vmCbAAAAAAUAAAABKIoiqiiKIAFAAAAACgWKIsAAAAUKAiiLAFCgAIoiiBQoABKIogUKAAiwBQpKIsAUAKSiLAAALQAAQAKAAAACgAAAoEAACgAAsAAACgAoAAKAASqixAAoAAKAACgAAoACLKAAWCwoAAAKAAAAChSKIpIoAAAACgAAAAAANfh7uHieYJsKIoiiFIAAFAAAAAAAAAACgWKIoiiKIsAAtAAAAiiKWCgAAIoirYAAABKWLKAAAABYsoABKWLAKAAiiLKBQEoiiKqKIsAAAooiwAChSKIoiiKsiiKIqooiiKIqyKIoiqgAAoAAKAACgEoiygQLQQAKAACgAAoBKIsqoKCACgAAAAoAoiiKJQCgAAAAAAAAAAANfi7uHieUJsAAAAAAAAABQAAAEoiiKIogAAtAAAASiKIstAAAABYqooiwAABUqooiwAAC1KIogAApKWLAAFiqiwAACkoiliwACgAAAAoAAAKABAAoAAAKABAoAAKAACooiwCgAAoAAKASiChSCgAAoEACgAULAAUBLKAACwAAAoiqigAAAAAAAAAKAAAAA2OHu4uH5YrHZFEURRFEURRFEURRFVFEURSwAAAAAAAALFVFEWAAAAWgJRFEUQAWgAARRFgFoACURRBaAAlEUQWgJRFEWAWgRRFgFAAAqURVRRFgAFAAAgUAAAFAABQAAIFAABQAAUAAFARRFlABQAAUBFEqUKQUAAFAABQACVUoAQAUAAALUoAgAAAAUAAAAAAAAAABscXdw8LyhNgAAAAAAAAAAAAAAUCgJRFEURRAAoAUAlEURRAAoUAAAlEVbFgAAAlWxRAAARVRSxYABSURRAoAVFEWAKFARRFEAFAAABQAAAUAAFAAABQAIAFAJRFVFgFAABQAAUAlEWUAFAABQACVUWAUAAFAABQAAUlgAAFAFAAAUAAAAAAAAAAAFAAAmzxdvFwfIE2gAJRFEoAAAAJRFEURRFEURYAAoAUAABFEUsURZQAAAAEVbFEUQAAUCpRFEAFAoEURRBQACUsWUAABFLFlAARRFVAoAAUAlEURVRRFEURVRRFEUQUACBQAAAUAAFABUURYBQAAUAFAAQtQAUAAFABUWAAUAAFAABQAEFAACgAUAAAAAAFAAAAAAAAAAbPF3cXB8cVNkURRAAAApRFEUQAAAAAAAAALKCURVRYAAAABaBFEURRFgFoAACURVQAKAAlVFEWAKFJRFEWAAVFLFEAFAsURYBQCURRFVFEWAAUAAAFAAABQAAUAAFARRBQAAUAAFARVQAAUAFARYBQAUAAFARZQAAUAAFoIChSWAAClAAgAAUAAAAAAAAAAAAAFbXF28XA8YY7AAAoAAAAAAFAAAASiKIoiiKIsAAUKAASiKIoiwC0AAAAKSliiLAAKASiKIpYKAAiiLKBQAIqoogUACKqAAAirYoiiACgAAoAAAKAASiKqKIAKAACgAAoCKIqoAKAACgIqoAAKACkoiwCgAoAKAiwCgUAKAACgAIKAUAAAoAAAAAAKAABAAAAAANvi7eLgeMMdgEURRFEURRFCURRFEURVRRFgACgAAAAAAJSxVRRAAAABSUsURRFEFAAAqURVRRAABSUsUQAAUlEUQKFAJRFEFoCURRFVFgAAFAsURSRVRRFEVUAAFoAAAUAAFJRFJBQAUACpVRRABQAUBFVAABQAVFEFAABQCVUCgBQAAUAAFJYACgUAAAAFAAAAAAAAAAAAAbfF28fA8MVjtiiLAAAAAAAAAAAAAAAKBQAEoiiKIAAKAABUoiiKqKIsAUAAKSiKIogoAFiiLKAABYqooiwAASrYogAEqooiiC0AABKqKIoiwCgAAoAAAKAiiLKAACgAAoBKqKIAKAC1KIsAoAKAiygAAoAKiiCgAoFSiCgAAoAAKASwClgqUAACgAAAAAAAoAAAAAADc4u3i+f8IY7AAAAAAUAAAAAAACKIoiiACiliiKIAAAAKSiKIogUAKAAAAiliqiiAACkoiiBQpKIoiiLKBQAIqosAAIq2KIAKAAiiKqKIsUAKAACgIoiiKqKIsAoAAKASiKqACgAEqoAKACkoiwC0AKSiLKACgAEsoALQApKIAKAACgAUKgFgoAoEAAAACgAAAAAAAAAANzi7eP5/wAMVjsiiKIoiiKIoiiKIoiiKIpYoiiAAAAAACgAAEpYoiiLKAAAAACopYoiiKIsoAABKWKqLAAKSliiLAAKAiiKIstASiKqLAABKtiiKIogoAAKiiKIoiqiiACgAAqKWLLAAAUKAiqiwCgAIqosAoAKSliwCgAqLAKACgIsoFACgEsoAKAAC0ACLAKAWCpQKAAAAAAAAACwAAAADd4u3i+e8IY7AAAAAAAAAAAAAAAAAUBKIoiiKIqoogAAAAAtAAiiKIoiqiwBQAoCKIoiygAIpYqoogAAqKWKIogoCKIogtAAiqiiLAAKAASliqiiLAKAACgEoiqiwACgAqKIsAoBKtiiACgEqosAoALYogoACKqACgAtEAoAAKgAtACgAApLAACoqpQAAAAAKAAAAAAAAAA3ePs4/nueGOwAAFAAAAAAAAAAAiiKIoiiKIsAAUAKAAAAAAiqiiKIpYogAoABKIqoogAtASiKIogtAAiiKqKIsAoCKWLAKASiKqKIFACgEoiiKqAACgAEq2KSLALQAIqosAoABKqLAKAC2KIsAoBKqLAKAC2LAKACosAUKAiqgAoBLKBQoAAKASwCgAAFgqKqCgAAAAAAAACgAAN7j7OP53nhjsAASiKIoiiKIoiiKIoiiKIsAUAAAAAAAAAAKAiliiKIqooiiAAACgIpYoiiKqLABKqKIpYsAoBKIoiqgUABKqKIAKAiliiKqAACooiiKILQAAqKIoiiLKACkoiiLKAC2KIsAoBKqKIKAASrYsAoBKqLAKBYqoAKAiygUKAgoAKBYsoAAKAELCgUEACqgqCgAAACgAAAAAAAAN7j7eP53nxWOyKIoiiKIsAAAAAAAAAgAAKAABQAAAEoiiKqKIoiwACgUAAACKqKIoiiLKBQEoiqiiLAAKiliiKIKAAiqiiBQEqooiiLKAASliqiiACgEoiqiiLAFCkoiqiwACkoiygAAtiiCgAqKIKACkpYsAoCKqBQpKIKACosUKASqgAoBKtgAoACLLQAAoAAAAEClgqCpQAAAAAAAADf4+zj+d5wY7AAAAAAAUAAAAAAAAIiqiiKIoiiKIoiiKIsAAtAAAACgAIoiiKWKqKIogoACKIqooiwBQpKIoiiCgEoiliygAIqooiiBQoCKIqosAAoCKWKIKAACkoiqgAEq2KIKAiiLKACkpYsoAKiiCgAqKWCgEogtCkogoALYAKACoALQIsoAALUAKAAAACgAFgqCpQAAKAAABACCoPQcnZx/Oc4MdgAAAAACURRFEURRFEURRFEURSxRFEURRFEAAAAAAFAAAAJVsURRFEURVRRAABSURSxVRRFgABFVFEWAWgJRFEWUABFWxRFgAFARRFVFigAJVRRFgFAARVsUQUBFEVUAlVFgFoAEVUAFJSxZQAVFgFAJVsAFJRBaAlVABalEFABUWAWgJZQAUCoUAAAFAAAABQAAAAAAFQVBUFQVB6Hj7OT5zmxWOyKIoiiKIoiiKIsACiKIqIAAAAKAAAAAAAABQAAoBKIoiiKIqooiiKIqoAFACooiiKIqoAACKtiiLAAKSiKIsoFSiKIqosAApKWKIogoACKqKIFCgIoiqgAoCKWCgIqoAKSiLALQIqoAKSliygEqosApKWLKASrYAKSiC0BKqCgEqoFCkogoFACoAKAAAACgAAAAAAAAAAAoAD0XH2cfzfMDHYAAAAAAAACgABAAAUAAAAAAAAAAAAlEURVRRFEUsURVRRFEUQUAAAlVFEURRFlAoAEVUURYABSURSxYBSURRFVFgCgRVRRFgFAJSxVRYABUURRBaAFRRFgFRRBalEVUAAlVFgFoEVUAFRSwUBFlAoVABSVbABSUQWgJZQAWpYBQEWUChQEFAABQAAAAAUAAAAAAAAAAB6Lk7OP5vmBjsAAAAAAAAAAAASiKIoiiKIoiiKIoiiKIoiliiKIoiiKqKIoiiKIqooiiLAAKAAiqiliiKIsAoACKIqoogUBKqKIsApKIpYqosAAIqooiwC0CKIqoABKtiiLAKAiiLKBUqosAqKIsoFSiKqACosUKSiLKASrYsAqLALUqoAKSlgoBLKBUqoKASrYAKSiC0ABKqAC0AAALAAAAAAAAAAAAAAPR8nXyfOcwMMwAAAAAAEoiliiKIoiiKIoiiKIoiiAFIoiiKIoiiKIoiiKIqooiiKIqooiwABQoACKIqooiiKIKAAiiKtiiAASqiiKILQIoiiLKAAiqiliwACooiwC0CKqKIAKSliwCkoiygEq2LAKSiKILQIqoBKtiwCoogoFiygpKILUogoFiqgAqLLQEqoFCkogoBLLQAoCCgUAKAAAABAoAAAAAAFAAA9HydnJ83yorDZFEURRFEURRFEURRFEURYAAAAAAAAAAAAAAACrFEURVRRFEAFAAAABQAEURVRRFEUQUCgRRFVFEAAlVFLFEFARRFEVUCgJRFVFEAFRSxYBSURVRYAoVFEAFRRBaBFVABUUsAFRRBalEWUBFWwCVUFAsWUAlVAoVFgFsWUAFsAFJYBaFRYBQLBQAUlEChQAAAAUAAACAAoAAAAIB6Tk6+T5vlhhmAAAAUQAAAAKAAAAAAAAAAAAAAAAAAFAAAAABQAAAAUABFEVbFEURRABQCURRFVFgChUURRFgFJRFLFEWUAlEVUUQKlVFEAFRSxVQAEVUWAKlVFgFRRFlAsVUWACVbAJVRYBbFEFJSwUFRYBbFEFJSwUFRYBbFgFJSwUFRYBalEFAJZaAFAoEWUAAFAAAAAAAAAAAAAhR6Tk6+T5zlBr2AAAAAAAAAAAAAAAAAAAAAAAAAAoAAUAAAAAFAAAABQAEURVRRFEUQUAABFLFVFEABFVFEWAWgRRFEVUABFWxRAJVRRAoVFEWUAlEVbAJRFVAJVsWAUlEWAWpRFlARZaBFVAqVUFJSxZQEWUCpZQUlLBSUQWgRZQVFLBSURZaAlVABalEFABQLFEFAAAAgKCABQKAAACAAel5evk+b5QYbAAAAAgAAACKJQASiKIoiiKIoiiKIoiiKIoAAACgAAAAAoAAAAKAASiKIqooiiKIsoFAASiKqKIsAEqopYoiygEoiiKqBQIqosAEq2KIAKiiLKBUoiygEpYsoCKqACopYsAqKWCkogpKtgEqoFSqiwCosUKiwC2LKASrYBKqC1KIsoFSqgAtiygEqoFCkogAoAFiygQAABYAoAAAFAABFAD0vJ18vzfKisM4oiiKAAAEoiiKiKIoiiKIoiiKIoiiKIoiiKIoilikACgAAAAAoAAAAAKAASiKqKWKIoiiKqAAAAiqiiLAFCooiiKqAAiiKtiwASiKqBUqoogEqopYsAqKIsoFiiLKAirYCKIsoFSqgEqosUKiykpYKAiygWLKAiy0KiwC2LAKSxQpKqBQqLALUogoLYAKSiC0BKIsoAKBREqCigAEoiiKIpQAAIEKAPTcnXy/OcmK17IoiiKIoiiKIoiiKIoiiKIqIoiiKIoiiKIoiiKIoiiKqKIoAAACgAAAAAAoAABKIqooiiKIoiqiwAAASqiliiLAKSiKIqosAUCKqKIBKIq2ASqiiBUqoogAqKWCkoiiC1KIsoCKWCkoiygWKqAirYKiwCosUKiiC2KILYqoCKtgIsoKilgpKWCgIsoLUogpKWCgEqoFCgIogoAAKAAAAABQAAAAAsA9Ny9fJ83yQ15gFEURRFEAAAAAAAAAAAEAAAAFEVUURRFEURRFVFEoAAAAAABQAACVUURRFEURRFVFEACgJVRRFEUQUBFEVbFEABFVFECpRFVAJVRSxYJVRRAqVUUQUlLFgFRRFlqURYBUUsFJRBalEFJVsAlVAqVUAlVAqVUFqUQUlLBSVUCpVQCVbBQEWUCxZQCVbABSUQWgAJVRYBQAAAAAAAUAAACggHp+Xq5fm+QGGwAAAAAAAAAIAAAAAAAAAAAAAKIoiiKIoiqiiKSKIoAACgAAAAEqooiiKIpYqooiiLAAKAiiKIoiygUCKIqosAIqopYBKIqosAtiiLAKilgEqosAtiiLAKilgqKIFSqiwSqixQqLKBYsoCLLUoiygWLKSqgVKqBUqoBKtgpKILUogpKtgAqLFCosoBKtgAEqosAtAAiqgAAAAAoAAAAAAAD1HL1cvznIDXmAAAAAAAAAAAAEAAAAAAAAAAAFEVUURRFEURRFEURVSgAAAAAAFRRFEURRFVFEURRABQCURSxRFVAAJVRRFgCpVRRFgBFWxYARVRYBbFEAlWxYBUUQKlVFglVFigRVQKlVAJVsFRRBalEFRSwVFEFsWUlEFqUQWpVQCVbAJVQWpRBSUsFJRBaFRYBSUsFAAJVQKAFAAAJRFlAAAAAAAAAeo5url+c5Aa8woAAIAAAAAlAAAAAAAAAAAAAAEAAFIoiiKIoiiKqKIoAASiUAoAACUIoiqiiKIoiiLALQAIoiqiiKIBKqKWKIBKqKIsAWKqLACKtiwCoogVKqLBKqKWAiqgVKqLBKIstAiygWLKSiLLUqosEq2ASrYBKqC2LBKqBUqoLUogpKWCkqoFiygEq2CkogtAiygEq2LAAKSiLALQAAAoCAKIogAAAAAPU8vVzfO8eK15xRFEURRFEURRFEURRFEURRFEVEURRFEUSgAAAAAAAAURVRRFEURRFJFEURVAAAAAABQAEURRFLFVFgAAlEVUURRFgFsURRABUUsWAVFEWALFVFgFRSwEVUWKlVFgBFWwEVUCpRBUUsFRRBbFEFRVsBFlAsWUlEFqVUCxZQEWWpVQKlVAJVsFJYBbFgFRZaAlVAoVFgFAsWUAAFRYAoAUAAAABFVFEoRRFEUeo5url+c44a8wAAAAAAACiKIoiiKIoiiKIoiiKIpJQAAAAAAAFIoiiKIoiiKIqgAAAAAAAoAAACKIqooiiLAAKSiKIpYogpKIoiwC2KIogpKIpYKiiLALYogIq2ASqiwBYqoCKtgIqoFiykoixUqosEq2LKSlgpKILYsEqostSiC2LAKiy1KILUqoBKtgIsoFiygqLFCkogtAiygAtSiACgEoiygUAAAKAAAAAAA9TzdPN87xg15gAAAAAAAAABAABRFEURRFEURRFEURQAAAACAACkURVRRFEUAAAAAABQAAAACURVRRFEURYBaAlEURRFlARSxZQCURRBalEUQVFLFglVFEFsUQEVbFglEWUlLFlJRFlqURZalEFRSwEWUFsWCVUWKlVAsWUFRYqVUFqUQVFipVQWpRBUWKFRZQLFlARZaAlVAoVFgFAJVsAAFAJRFgChQAAAAAAAHquXq5vneMGvMAABKAAAAAAAAAAQAAAAAoiiKIoigAAAAAAAUiiKIpIolAAAAKAAAAAAACkoiiKWKIqoAACKIqoogVKIqoBKIq2ASiKILYoiykoixQqKIFiqgEoiy1KIspKWCopYKiwC2LBKqBYqoFiygIstSqgWLKAiy1KqBUsoCLLUqoFSygIstCosAtiwCostASqgUCKqACgWLAKAAASqiwABQAAAAAPVc3VzfPcWK15xRFEURRFEURRFEURRKAAAAAQAAAAAURRFEUgAAAAAABRFEURQAFAAAAAAAgAWgAAJRFEVUURYAAJRFVFLAJRFVFglLFVFgBFWwEURZSUsWAVFLARVQLFVARSwVFEFsWCVUWKlVAqVUlEWWpRBalEFRZalEFqUQVFlqUQWxYBUFqUQWxZQEWWgRZQWxYBUWKFJRBaAlEFABbFEAAFAAARRFEUQUCgAer5unm+d4oa8wAAAAAAABSKIoiiKSUAAAAAAAABSKIoiiKAAAAAQAoiiKIoAAAAAACgAAAAAAIqooiiKIsAUKiiKIsAqKIsUCKqLAFiqgIoiy1KIsEq2KIKilgIqoFiwSqixUqoBKtgIq2AiykpYKixUqoFSqgqLFSqgVLKCoFSqgtiwSqgVKqC2LAKixQqC0CCgIstASqgUKSiACgAWKqAAAACgAAAIsAPV8/TzfPcUNeYAAAAAAAAAAApFEURRFEURQAAEAAgApFEURQAAAAAKRRFEUkoAABQAAAAAAAAAUlEURSxRFEFAJRFEUQWpRFEFRRFigRVQCVbFglEWWpRFgFsUQEWWpRFlJSwEVbARZQLFlJRBbFglWwEWWpVQKlVARZalVAsWUlLBSWUCxZSUsFRZQLFlBbAJVQKlVABUWKFJRBQKBFlABQKBFEAFAAAAAAAer5unn+f4sVrziiKIoiiKIoiiUAAAgAEAFIoiiKIolAAAAAAAUiiKSUAAAABSKIoigAAAAAAEAAAACgUCKIoiiKIsoBKIoirYBKIogtSiKIKilgIqoBKWLKSiLFCosEpYspKILYogtiwSiLLUogtiwSqgWLKSrYCLLUogtSiCostSiC2LBKtgqLALYKSlgqLKBYKSlgpKILUqoAKixQAqLALQIogoAAFCooiwAAAAAA9ZzdPN8/xQ15AAAAACkURRFEUSgAAAAAAKRRFEURSSgEAAACkURRKAAAIAKRRFEoAAAAAABQAAAAACURRFVFEWAKBFVFEAlEVbAJRFlAsUQVFLAJRFlJSxYJVRYqVUCxRBUWKlVFglWwEVbJRFlRYqVUCxZSUsFRYqVUCpZSVUCxZSVbAJZaBFlJVsBFloVFipVQCVbBSUQWgRZQEWWgARVQKFARYABQAAKAlEURVQAHrOfo5/n+IGvMAAAAAAAAAAAoiiKJRAgAAAAAoiiKIoAABACiKJQAAAAKIoiklICgAAAAAAAAAAApKIoiliiACooiiASrYogIoiy0CLALYogIqoFSiLKSlgIq2AiykpYCKtgIspKWLKSlgqLBKtkogtiwSrYCLLUqoFiykogtiykpYKiy1KILUqoCLLUqoFSqgEq2ASqgVKqACopYKASiCgUAKiiAAAACgAUAD1nN08/A4kVrziiKIoiiKSUAAAgAAAAAUiiKAAAAAQAoiiKJSAAACiKJRAAAACiKIoiiUAAAAAAQAALQAAIoiiLAKAiiKWCkoiwBYqosEoixQqKIFiqgIpYKiiBYspKIstSiC2LBKqLFSiC2LBKtgIspKWSqgWLKSrYCLLUogtiykpYKiwSrYKixUqoLYsAqC1KILUogqLLQEsoFSqgAEq2ACgIogtAAAiiLKAAAAAA9Zz9HPweIGrMAAAAAAUiiKIoiiUAAAAQAoiiUAgAAAAoiiUQAAAoiiUgKACQAoiiKIolAKAAAAAAAAASiKIoiygAVKIsApKIsUKiiASliykoixUqosEpYspKIsVKqLBKtgIsVKqASrYCLLUogtiwSrYCLKSlkqoFiykpYKixUqoLYsEq2CosEstSqgVKqC2LBKtgEqoLYsAqLFCosAtSiLKASrYAAAKiiBQoAACKIAAAD1vP0c/B4ga8wAAAAAAAAQAAAAoigIAAAAKIpAAAACiKJSAAAQUiiKAAABSKIoiiKSKJQAAAAAAAASqiiKWLAACKIsoFiiLKAilgEqosEpYKSiBUqoBKWCopYCLKSlgqKWCosEpYKixUqoFiykpYKgWLKSlgqLBLLQqBUsoFgpLLUogtiykpYKiygWCkq2ASygWLKCoFCosAtAiwCgWKIKAASqgAUAAAKAAA9Zz9HPweIGvIoiiKIoiiKIoigIAAAAAAFIolEAAAAFIoCAAAQUigAAAAoipJQAAAKIoiiKIoAAAACgAEoiiKIogAAqKIFAiqiwBYogqKIFiqgWKIKilgIsoFiwSqgVKqBYsEqoFiykpYKixUqoFiwSy1KILYsEstSqgWLKSiC2LKSlgqC1LBKtgpLFCospKWCostAiygWCkpYKAiygUKiwACkpYAKAAiiAC0AAAAD1vP0c/C4YaswAAAAAAABSKIoiiKJRAAABSKIqAAAAQUiiUAAAColEAAAFIoigAAEAKIoiiKJQAAlABKIoiiKIsoAFSiKIBKqKWASiKqBYogqKWAiygWLBKqLFSiC2KICLLUogtiwSqgWLBKtgIstSiSrYCLLUogtgIstSiC2LKSlgqC2LBKtgqLBKtgqLFCoFSygqBUqoLUogpKWCgIsoFAiygAEq2AAACkoiwAAABQPW8/R8OFw4rXnFEURRFEUkoAAAAAAAAFEVAAAIAKRRKAAAABRKSAACkUSgAACCkVEoAAACkURRFEUkURRFEVUURSxRAAARRFlAqURYBSURYoEVUCxYJVRYqUQVFLARZalEWCVbARZalECxZSUQWxYJZalEFsWCUsFQLFlJSwVFlqWAWwVFipZQWwEWWpRBallAQWpZQLFlJVsAllAsWUFJSwAVFgFoEWAUAlLFlAAAAAJRFVFEUes+HRz8LiBryAAAAAAAAAFIoioAAABBSKAAAAACoikAAAAKAAAQqIolAAAAoikAAAAAFIoiiKIoiiKIogAAEqoogUCKIsoFiiLBKqLFSiLKSlgIstAiwSrYBKILYsEq2AixUqoFiykpZKIKixUqoFiyksVKqBYspLFSqgtiwSrYCC2LKSlgqC1LALYspKWCospKWCkstAiykpYKASy0AKiwBQqLAKABYsAAoAAAAAD1vP0c/D4Ya8yiKIoiiKiKAAAAAAQAAolAAAAUiolEAAAFIolAAEFiKAAACiKQAAAWIolAAAEAAAAACgAAAUCKIogEqopYBKIogpKWAirYCLBKtiwSiC2KIFiykogtiwSlgqLFSiC2LCLLUogtiwSrZKIFiyksUKgtiwSrYCC2LKSxUqoLYsEstCosEq2CosVKqC2LAKgVKqC1KIKAiy0ACLKBQqLAAALYogAAAAAAr1vw+/w4fDDVmAAAAACAAAAFEUSgAAAAKSkgAAApFAAAILEUAAAFEogAAsRRKAAIKRRFEoAAAAAAAAAAJRFEURYBalEWAEVUCgRYJVsWCUQWxRAsWUlEWKlVAsWUlECxZSUsBFlqWCVbARZalECwVFipZSUsFRYqVUCxZSWWpRJVsFQKllJVsFQKlVAsWUlWwEWUlWwCWWgRZQWpYBQLBQCUQWgARZQAAKlEVUAAAAB67n6OficMNWQAAAApFEoAAAAAAAAFSAAACkUAAAgBUAAACkUgAAQUSgACCkUAABBRFJFAAAAAAUAAlEURSxYAJRFgFJSxYARZaBFgFsWCURYqVUBFloEWKllAsAlloEFJYqUQWxYJSwVAsWUlLBUCxZSUsFQLFlJSwVBbFgllqVbAQWxZSWWgRZSVbARZalEFsWUBBalVAoVABSUsAFJRAoUAlEAFAoEURRLAAB674ff4cThhryAAAAAAAAAAAAKiUQAAAUlAAEAFiUAAABSUQAIKJQABACgAAIFIpAAAAACiKIoiiKIoiiKIogAAIq2ASiLAFSqgEogtiiBYsoCLFSqgWLBKqBYspKWAiy1KIFiyksUKgIsVKqBYKixUq2AgqLFSy0CC2LBLLUqoFgqLLUspKWCostSiC2LKSlgqLKSlgpLFCksoFSqgAqLFACksAUAKgAAoAFAAAA9b8Pv8OJwg15gAAAAAAAFRKIAAAAAUSgACAFQAAAAUSiAACwACAFEoAABBRKIAAKRQAAAEgApFEVUURRFEAACxRAARVsAlEAlWwCUQWpRARSwVFipVQLFglVAsAlloEFsWCUsFRYqWUCwEWWpYBbARYqWUlWwEFqWCVbAQWxZUWWpSwVBbFlJSwVFglWwVFipVQWxYBUWKFQUCxZQALFlABUWAKAlVAAAAABQAHrfh0c/E4Ya8wACoiiKSUAAAAAABSKAAAQAqAAAACkAAACFAAEFAAAgUlEAAAFJQACQUiiKAAAAAAAAAAIoiygWKIACLLQIsEpYspKIFSqgIsVKqBYspKWAiy1KIFiykogtgEstSiBYspLFSiC2LBLLUogWCostSxQqBYspLLUsEq2CosVLKSrYKixUqoLYsEq2CosEq2ASrYKSiC0CCgEsUKASwC0ACLKAAAAAAA9dz9Hw4vDDVkAAAAAAAAAAKSgAACAFQAAAAAogAAsSgACAKAAQKSiAACkUABIAKSgAAAKRRFJKAAEURRFEWKAAlEWUCxYARVQLFgCxZSUQKlVAsWCVUCxZSUsBBalglLBUWKllAsFRYqUQWwEWKlVAsFRYqWCVbBUCxZSWKlVBbAsWUlloVAsWUlWwEFJZaBBallAsWUFRYoVFgFqWAUCwAUBFgFoAEUQUAAAAB674ff4cXhhqyAAAAAAAKIolAAAEAFiUAAAABQEAAFgAAEFAAAgpAAAFAAJACgAAAUlEAACAAAAAAAAEqopYACLAKSlgEqoFiwBYsoCBUsoFgEstSiCosVKILYBLFSqgWLKSxQqBYsEq2AgWLKSxUqoFgIstSy1KILYKixUspLLQqBYspLLQILUsoFgpLLQILUsoBKtgEsoFCoAKSxQApKIALQAEogAAAAPXfD7/DjcMNWQAAAACgAAAACABBQAAAAAogAAAsAAAgoAALEogAAoAAEgoAAAKSiABAAApFEUAJRFEURRFEAAlVFigRRAJVsAlgFsWALAJZQLBSWKFQKlglWwEWKlVAsFRYqUQWxYJZalECxZSWKlEFsBFlqWCVbAQWwVFipZalVBbARZallAsFJZaBBallAQWpZQLBQEFqVUChUWAAWwAAUlgCgBQAEURYAAeu+H3+HF4Ya8gCiKAAAAAAQAWJQAAAAAFJRAAAgUAABBQAAIUQAAoACQAUAAAUQAIAAAKAAAQAAAAAAFSiACosUBKIBLLQIsUKgEsUKgVLALYBLLQICLLUogWLKSlgqBYsEq2AgtiwSxQqBYKSxUsUKgWCostSwSrYKgWC2LKSy1KILYspKWCospKWCostAgtSygIstAiygVKqAASy0AAKgAUAKAAAAA9d8Pv8OLwg15gAAAAAAgAsSgAAAAAAKgAAAQUAAAgCgAELKgACgAEgCgAAAogQAAKSgAACAFAAACURRFEWACUsWACVUCxYBbFglECpZQLBSWALBSWKBBalgCwVFipVQLAJZalgFsAlipZQLBUCpYJZaBBbAqWUlipVQWwEFsWUllqWKFQUlihUFqWAWwUlihUFqWAUlihSWAWgRZQAWwAACVUACgAABQAHrvh9/hxeEGvMAAAEAAAKgAAAAAABZUAAACFAAAEAUAAgUBABQAJAFAAABRAgABQABAABSUAgAAAAAAKiwABYsAIstAgEq2ASxQqASxQqBUsAtgEsUKgEstSwBYLYsEstAgWCksUKgWASy1LALYCC2ASy1KILYFiykstSykpYKgtSwC2CoLUsAtiykpYKgoFgpKWCgIKBUsoACLLQAAEqoAFAAAAA9d8Pv8ONwg15gAgAAACkAAAAAAAAKIAAEKAAAIAKAABFCAAKAASAUAACiBAACygAIAKSgEAAAAAAAAAJVQACWKAllAsWAWwCUQWxYAsFJYoEFRYqUQWwCWWpRAsFJYqVUCwCWWgQLFlJYqWUlLBbAQWxYJZaBBbAJZallqUQWwVBalgFsFJYoVBalgFQWpYBbABbABUAFqWAUAlloAAAUlgCgAAAAeu+H3+HG4Qa8wQAAABSAAAAAAAABQEAACKAAEAAUAAhZUAAFAAAkWUAAWVAAgAUABABQAIAAAAAAAAAACosAAWASqgVLALYsAIFSygWASygWCksUCC1LBLFCoFiyksUCC1LBKtgIFSyksUKgWC2Aiy1LBLLQILYBLLUstAgtgpLFSygtgpLFCoLUsAqC1LALUALYAKgAtSwCgEpYKAAASygUAAAAD13w+/w43CDXkAAAALAAAAAAAAACiAAALLAAAIAoAABFCAALKABIAoAAKIAEAUAAIBQABAAABRFJFEURSwAACWUACwAVAqWACWWgQKlVARYqVUCxYJVsBBalgCwVAqWUCwEWWpYBbAJYqWUCwVAsFJYqWKllAsFQWpYJZallAsFsWUlipVQWwCWWhUCpZQVAqWUFqWAVAoUlgFqUQUACwUAAAllAoAAAAHrvh38HJ4IaMwAABYAAAAAAAAAAoQAABZYAABFlAAAhZUAAAoAAkAoAAKECAFlAAQBZQAIAAAUQAAAABLAFACoAFgAqBQIBLLQEsUKgEsUKgVLALYBLLUsAWCksVKILYBLLQIFgpLFSygWCoFiwSy1LFSqgWCoLUsEstSqgWCkstSxQqC2LBLLQqASy0KgVLKC1LAKgUKSwC0CACgVLAKAASiC0AAAddx5n6A9HK6csy4/8jy7QAAAAAAAAAAAKAAAAAIABKAAAAACgAAAAAoAAQIAUAAAAAKAAAAAAAAAAAAAAAABAAAQAApBQAEAACBQpAAAgAWAAgoBABUABCgEFAQAEALUABABUKAQAIFCoACAC1AAQApBQAIKAQAAtgAAEAKAAAQUAAAKAAAgAL6Mz8/YNnk//9oACAECAAEFAPV9NHpS26Bt0DboG3QNugbdA26Bt0DboG3QNugbdA26Bt0DboG3QNugbdA26Bt0DboG3QNugbdA26Bt0DboG3QNugbdA26Bt0DboG3QNugbdA26Bt0DboG3QNugbdA26Bt0DboG3QNugbdA26Bt0DboG3QNugbdA26Bt0DboG3QNugbdA26Bt0DboG3QNugbdA26Bt0DboG3QNugbdA26Bt0DboG3QNugbdA26Bt0DboG3QNugbdA26Bt0DboG3QNugbdA26Bt0DboG3QNugbdA26Bt0DboG3QNugbdA26Bt0DboG3QNugbdA26Bt0DboG3QNugbdA26Bt0DboG3QNugbdA26Bt0DboG3QNugbdA26Bt0DboG3QNugbdA26Bt0DboG3QNsgbZA2yBtkBT00Ovp/5vsCOlA5HSgcjpQOR0oHI6UDkdKByOlA5HSgcjpQOR0oHI6UDkdKByOlA5HSgcjpQOR0oHI6UDkdKByOlA5HSgcjpQOR0oHI6UDkdKByOlA5HSgcjpQOR0oHJaUDktOByWnA5LTgclpwOS04HJacDktOByWnA5LTgclpwOT04HJ6cDk9OByfZA5Psgcn2QOT7IHJ9kDk+yB3R2QO6OyB3R2QO6O2B3R2wO6O2B3R2wO6e2B3T2wO6e2B3T2wO6fyB3T+QO4fkDuH5A7h+QO4fkDuH5A7h/6tcYH8f2B3H9gdx/YHcf2B3H9gd1fsDurugd1d0Durugd1d0Duvugd190Duvugd198Duvvgd198DlO+BynfA5Tvgcp3wOU74HKakDlNSByupA5XUgcrqQOV1IHK6kDldSByupA5XVgctqwOW1YHLasDltWBy2rA5bVgctqwOW1YHLasDltWBy2rA5bVgctqwOW1YHL6sDl9WBy+tA5fWgcvrQOX1oHL60Dl9aBy+tA5fWgcvrQOX1oHL60Dl9aBy+tA5fWgcvrQOX1oHL60Dl9aBy+tA5fWgd7afV0LwM4cOPHjtuJ7P5Azo/T/9oACAEDAAEFAOnp4cuXA5cDlwOXA5cDlwOXA5cDlwOXA5cDlwOXA5cDlwOXA5cDlwOXA5cDlwOXA5cDlwOXA5cDlwOXA5cDlwOXA5cDlwOXA5cDlwOXA5cDlwOXA5cDlwOXA5cDlwOXA/ngfzwP54H89J/PSfz0n89J/PSfz0n8dJ/HSfx0n8dJ/HSfx0n8dB/HQfx0H8dB4+g8fQePoPH0Hj6Dx9B4+g8fQePoPGmeNM8aZ4kzxJniTPEmeJM8SZ4kzxJniTPEmeJM8SZ4kzxJniTPEmeJI8KR4UjwpHhSPCkeFI8KR4UjwpHhSPCkeFI8KR4UjwpHhSPCkeFI8KR4UjwpHhSPCkeFI8KR4UjwpHhSPCkeFI8KR4UjwpHhSPCkeFI8KR4UjwpHhSPCkeFI8KR4UjwpHhSOv1kurp2Kxw/IHcPyB3D8gdw/IHcPyB3D8gdw/IHcPyB3D8gdw/IHcPyB3D8gd0/kDun8gd0/kDun8gd09sDuntgd09sDuntgd09sDuntgd0dsDujtgd0dsDujtgd0dsDujsgd0dkDujsgd0dkDk+yByfZA5Psgcn2QOT7IHJ9kDk9OByenA5LTgclpwOS04HJacDktOByWnA5LTgclpwOS0oHI6UDkdKByOlA5HSgcjpQOR0oHI6UDkdKByOlA5HSgcjpQOR0oHI6UDkdKByGlA5DSgchpQOQ0oHIaUDkNGByGjA5DRgchowOQ0YHIaMDkNGByGjA5DRgchowOQ0YHIaMDkNGByGlA5DSgchpQOQ0oHI6UDkdKByOlA5HSgcjpQOR0oHI6UDkdKByOlA5HSgcjpQOR0oHI6UDkdKByOlA5HSgcjpQOR0oHJaUDktOByWnA5LTgclpwOS04HJacDktOByWnA5LTgclpwOS04HJacDktOByenA5PTgcnpwOT04HJ6cDk+yByfZA5Psgcn2QOT7IHJ9kDk+yByfZA5Psgcn2QOT7IHJ9kDk+yByfZA5Psgcn2QOT7IHJ9kDk+yByXVw6k4GdfX09HT/ANnoE/2Bns9p/9oACAEBAAEFAHt8Ta+hT/UPPX1XM9lzPZcz2XM9lzPZcz2XM9lzPZcz2XM9lzPZcz2XM9lzPZcz2XM9lzPZcz2XK9lyvZcr2XK9lyvZcr2XK9lyvZcr2XK9lyvZcr2XK9lyvZcr2XK9lyvZcr2XK9lyvZcr2XK9lyvZcr2XK9lyvZcr2XK9lyvZcr2XK9lyvZcr2XK9lyvZcr2XK9lyvZcr2XK9lyvZcr2XK9lyvZcr2XK9lyvZcr2XK9lyvZcr2XK9lyvZcr2XK9lyvRcr2XK9lyvZcr2XK9lyvZcr2XK9lyvZcr2XK9lyvZcr2XK9lyvZcr2XK9lyvZcr2XK9lyvZcr2XK9lyvZcr2XK9lyvZcr2XK9lyvZcr2XK9lyvZcr2XK9lyvZcr2XM9lzPZcz2XM9lzPZcz2XM9lzPZcz2XM9lzPZcz2XM9lzPZcz2XM9lzPZcz2XM9lzPZcz2XM9lzPZcz2XM9lzPhcz2XM+FzPhcz4XM+FzPhcz4XM+FzPhcz4XM+FzPhcz4XO+FzPhc74XO+Fzvhc74XO+Fzvhc74XO+Fzvhc74XO+Fzvhc74XO+Fzvhc74XO+Fzvhc74XO+Fzvhc74XO+Fzvhc74XO+Fzvhc74XO+Fzvhc74XO+Fzvhc74XO+Fzvhc74XO+Fzvhc74XO+Fzvhc74XO+FzvhdD4XO+Fzvhc74XQ+F0PpdD6XQ+l0PpdD6XQ+l0PpdD6XQ+l0PpdD6XQ+l0PpdD6XQ+l0PpdD6XQ+l0PpdD6XQ+l0PpdD6XQ+l0PpdD6XQ+l0PpdD6XQ+l0PpdD6XQ+l0PpdD6XQ+l0PpdD6XQ+l0PpdD6XQ+l0PpdD6XQ+l0PpdD6XQ+l0PpdD6XQ+l0PpdD6XQ+l0PpdD6XQ+l0PpdD6XQ+l0PpdD6XQ+l0PpdD6XQ+l0PpdD6XQ+l0PpdD6XQ+l0PpdD6XQ+l0PpdD6XQ+nD/UvvDiy/6zq9hc/wBCp1KPEjd2e4PtXkcfavI4+1eRx9q8jj7V5HH2ryOPtXkcfavI4+1eRx9q8jj7V5HH2ryOPtXkcfavI4+1eRx9q8jj7V5HH2ryOPtXkcfavI4+1eRx9q8jj7V5HH2ryOPtXkcfavI4+1eRx9q8jj7V5HH2ryOPtXkcfavI4+1eRx9q8jj7V5HH2ryOPtYkcfaxI4/ViRx9rEjj9WJHH6sSOP1YkcfqxI4/ViRx+rEjj9WJHH6sSOP1YkcfqxI4/ViRx+rEjj9WJHH6sSOP1YkcfqxI4/ViRx+rEjj9WJHH6sSOP1YkcfqxI4/ViRx+rEjj9WJHH6sSOP1YkcfqxI4/ViRx+rEjj9WJHH6sSOP1YkcfqxI4/ViRx+rEjj9WJHH6sSOP1YkcfqxI4/ViRx+rEjj9WJHH6sSOP1YkcfqxI4/ViRx+rEjj9WJHH6sSOP1YkcfqxI4/ViRx+rEjj9WJHH6sSOP1YkcfqxI4/ViRx+rEjj9WJHH6sSOP1YkcfqxI4/ViRx+rEjj9WJHH6sSOPtXkcfavI4+1eRx9q8jj7V5HH2ryOPtXkcfavI4+1eRx9q8jj7V5HH2ryOPtXkcfavI4+1eRx9q8jj7V5HH2ryOPtXkcfKvI4+VeRx8q8jj5V5HHyrSOPlWkcfKtI4+VaRx8q0jj5VpHHyrSOPlWkcfKtI4+VaRx7q0jj3VpHHurSOPdWkce6tI491aRx7qsjj3VZHHuqyOPdVkce6rI491WRx6qsjj1VZHHqqyOPVVkceqrI49VWRx6qsjj1VZHHqqSOPNUkceapI481SRx5qkjjzVJHHmqSOPNUkceapI481SRx4qkjjxU5HHipyOPFTkceKnI48VORx4qcjjxU5HHepyOO9Tkcd6nI471KRx3qUjjvUpHHepSOO9SkcdqlI47VKRx2qUjjtUpHHapSOO1RkcdqjI47VGRx1qMjjrUZHHWoyOOtRkcdajI461GRx1qEjjpUJHHSoSOOlQkcdKhI46VCRx0qEjjpUJHHOoSOOf3yOOf3yOOf3yOOf3yOOf3yOOf3yOOX3yOOX3yOOX3SOOX3SOOX3SOOX3SOOX3SOOP3SOOP3SOOP3SOOP3SOOP3SOOP2yOOP2yOOP2yOOH2yOOH2yOOH2yOOH2yOOH2yOOH2yOOH2yOOH2yOOH2SOe/wDZI57/ANkjnv8A2SOe/wDZI57/ANkjnv8A2SOe/wDZI57/ANkjnv8A2SOe/wDZI5732SOe99kjnvfXI5731yOe99cjnvfXI5731yOe99cjnvfXI5731yOe99cjnvfXI5731yOe99cjnvfXI5731yOe79cjnu/XI57v1yOe79cjnu/XI57v1yOe79Ujnu/VI57v1SOe79Ujnu/VI57v1SOe79Ujnu/VI57v1SN+JUc/W6+CkjTa3LOHs/8AN9I4/in8/wBZZlmWZZlmWZZlmWZZlmWZZlmWZZlmWZZlmWYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDAYDLMsyzLMsyzLMsyzLMsyzLMsyzLMsyzLMsyzLMsyzLMsyzLMoyjKMoyjKMoyjKMoyjKMoyjKMoyjKMoyjKMoyjKMoyTJMkyTJMkyTJMkyTJMkyTJMkyTJMkyTJMkyTJMkyTJMgyDIMgyDIMgyDIMgyDIMgyDIMgyDIMgyDIMgyDIMgyDIMgyDIMgyDIMgyDIMgyDIMgyDIMgyDIMgyDIMg4eDm1/If/9oACAECAgY/AGq5jXuc1HKrk/nqasViGrFYhqxWIasViGrFYhqxWIasViGrFYhqxWIasViGrFYhqxWIasViGrFYhqxWIasViGrFYhqx2IasdiGrHYhqx2IasdiGrHYhqx2IasdiGrHYhqx2IasdiGrHYhqx2IasdiGrHYhqx2IasdiGrHYhqx2IasdiGrHYhqx2IasdiGrHYhqx2IasdiGrHYhqx2IasdiGrHYhqx2IasdiGrHYhqx2IasdiGrHYhqx2IasdiGrHYhqx2IasdiGrHYhqx2IasdiGrHYhqx2IasdiGrHYhqx2IasdiGrHYhqx2IasdiGrHYhqx2IasdiGrHYhqx2IasdiGrHYhqx2IasdiGrHYhqx2IasdiGrHYhqx2IasdiGrHYhqx2IasdiGrHYhqx2IasdiGrHYhqx2IasdiGrHYhqx2IasdiGrHYhqx2IasdiGrHYhqx2IasdiGrHYhqx2IasdiGrHYhqx2IasdiGrFYhqxWIasViGrFYhqxWIasViGrFYhqxWIasViGrFYhqxWIasViGrFYhqxWIasViGrFYhqxWIasViGrFYhqxWIasViGrFYhqxWIasViGrFYhqxWIasViGrFYhqxWIasViGrFYgrf8GsX+ytT+FT6P8Ax+zHQ2UD8dDZQPx0NlA/HQ2UD8dDZQPx0NlA/HQ2UD8dDZQPx0NlA/HQ2UD8dDZQPx0NlA/HQ2UD8dDZQPx0NlA/HQ2UD8dDZQPx0NlA/HQ2UD8dDZQPx0NlA/HQ2UD2UNlA9lDZQPZQ2UD2UNlA9lDZQPZQ2UD2UNlA9lDZQPZQ2UD2UNlA9lDZQPZQ2UD2UNlA9lDZQPZQ2UD2UNlA9lLZQPZSkoHspSUD2UpKB7KUge2lIHtpSB7aUge2lIHtpSB7aUge2lIHtpSB7aUge2lIHt+Ege34SB6fCQPT4SB6fCQPT4genxA9PiB6fED0gekD0/4ZZYHrA9fmB6/MD1+YHr8wPX5WB6/KwPX5WB7vlYHu+Vge6pYHuqWB7qlge6pYHuqWB7qlge6pYHuqWB76lge+pZwPfUs4HvrdOB763Tge+t04HvrdOB763Tge+t04HvrdOB763Tge+t04HvrdOB763TgfkrdOB+St04H5K3TgfkrdOB+St04H5K3TgfkrdOB+St04H5K3TgfkrdOB+T9HTgfk/R04H5P0dOB+T9HTgfk/R04H5P0dOB+T9HTgfk/R04H5P0dOB+T9HTgfk/R04H5P0dOB+T9HTgfk/R04H5P0dOB+T9HTgfk/R04H5P0dOB+T9HTgfk/R04H5P0dOB+T9HTgfk/R04H5Ecn8fy9XJ/qir/wAlgb/Cf3O5BNH/ALun/Y4BwDgHAOAcA4BwD15689eevPXnrz15689eevPXnrz15689eevPXnrz15689eevPXnrz15689eeuPXHrj1x649ceuPXHrj1x649ceuPXHrj1x649ceuPXHrj1x649ceuPXHrj1x649ceuPXHrz15689eevPXnrz15684BwDgHAOAcA4BwDgHBOCcE4JwTgnBOEcI4RwjhHCOEcM4ZwzhnDOGcQ4hxDiHFOKcU4pxTjHGOMcY4xxzjnHOOcc8B4DwHgPAeA8B4DwnhPCeE8J4TwnhPH/ALf6f//aAAgBAwIGPwA6IdEOiHRDoh0Q6IdEOh0Oh0Oh0Oh0Oh0Oh0Oh0Oh0Oh0Oh0Oh0Oh0Oh0Oh0Oh0Oh0Oh0OiHRDoh0Q6IdEOiHRDoh0T6OifR0T6OifR2p9Han0dqfR2t+jtb9Ha36O1v0drfo7W/R2t+jtb9Ha36O1v0drfo7W/R2t+jtb9Ha36Oxv0djfo7G/SHY36Q7G/SHY36Q7GWodjLUOxlqHYy1DsZah2MtQ7GWodjLUOxlqHYy1DsZah2MtQ7GWodjLUOxlqHYy1DsZah2MtQ7GWodjLUOxlqHYy1DsZah2MtQ1stQ1stQ1stQ1stQ1stQ1stQ1stQ1stQ1stQ1stQ1stQ1stQ1stQ1stQ1stQ1stQ1stQ1stQ1stQ1stQ1stQ1stQ1stQ1stQ1stQ1stQ1stQ1stQ1stQ1stQ1stQ1stQ1stQ1stQ1stQ1stQ1stQVP8Gt/wBWp/B/b7EgekD0gekD0gekD0gekD0+IHp8QPT4genxA9PiB6fED0+IHp8QPT4genxA9PhIHp8JA9PhIHp8JA9vwkD2/CQPb8JA9tKQPbSkD20pA9tKQPbSkD20pA9tKQPbSkD20pA9tKQPbSkD2UpA9lKSgeylJQPZSkoHsobKB7KGygeyhsoHsobKB7KGygeyhsoHsobKB7KGygeyhsoHsobKB7KGygfjobKB+OhsoH46GygfjobKB+OhsoH46GygfjobKB+OhsoH46GygfjobKB+OhsoH4/zbKB+P82ygfj/ADbKB+P82ygfj/NsoH4/zbKB+P8ANsoH4/zbKB+P82ygfj/NsoH4/wA2ygfj/NsoH4/zbKB+P82ygfj/ADbKB+P82ygfj/NsoH4/zbKB+P8ANsoH4/zbKB+P82ygfj/NsoH46GygfjobKB+OhsoH46GygfjobKB+OhsoH46GygfjobKB+OhsoH46GygfjobKB+OhsoH46GygfjobKB7KGygeyhsoHsobKB7KGygeyhsoHsobKB7KGygeyhsoHsobKB7KGygeyhsoHsobKB7KGygeyhsoHsobKB7KGygeyhsoHspSUD2UpKB7KUlA9lKSgeylJQPZSkD2UpA9tKQPbSkD20pA9tKQPbSkD20pA9tKQPbSkD20pA9tKQPbSkD20pA9tKQPbSkD20pA9tKQPbSkD20pA9qp/wBESBqvcv8Ai1qfyqqa3C9/+w5ByDkHIOQcg5ByDkHIOQcg5ByDkHnPOec855zznnPOec855zznnPOec855zznmPMeY8x5jzHmPMeY8x5jzHmPMeY8x5jzHmPMeY8x5jzHmPMeY8x5jzHmPMeY8x5jznnPOec855zznIOQcg5ByDkHIOSck5JyTknJOUco5RyjlHKOWcs5ZyzlnLOYcw5hzDmHNOac05pzTmnOOcc45xzjnHOOec855zznnPOec8557A9gewPYHsD2B7A9gewPYHsD2B7AT/wCrr5+n9P/aAAgBAQEGPwD6/T6/X/MuTHfn6/R7/wBDnfq/m+37R+fqd9S3f8v1+n1/Ezvs8ZKZdAyUy6Bkpl0DJTLoGSmXQMlMugZKZdAyUy6Bkpl0DJTLoGSmXQMlMugZKZdAyUy6Bkpl0DJTLoGSmXQMlMugZKZdAyUy6Bkpl0DJTLoGSmXQMlMugZKZdAyUy6Bkpl0DJTLoGSmXQMlMugZKZdAyUy6Bkpl0DJTLoGSmXQMlMugZKZdAyUy6Bkpl0DJTLoGSmXQMlMugZKZdAyUy6Bkpl0DJTLoGSmXQMlMugZKZdAyUy6Bkpl0DJTLoGSmXQMlMugZKZdAyUy6Bkpl0DJTLoGSmXQMlMugZKZdAyUy6Bkpl0DJTLoGSmXQMlMugZKZdAyUy6Bkpl0DJTLoGSmXQMlMugZKZdAyUy6Bkpl0DJTLoGSmXQMlMugZKZdAyUy6Bkpl0DJTLoGSmXQMlMugZKZdAyUy6Bkpl0DJTLoGSmXQMlMugZKZdAyUy6Bkpl0DJTLoGSmXQMlMugZKZdAyUy6Bkpl0DJTLoGSmXQMlMugZKZdAyUy6Bkpl0DJTLoGSmXQMlMugZKZdAyUy6Bkpl0DJTLoGSmXQMlMugZKZdAyUy6Bkpl0DJTLoGSmXQMlMugZKZdAyUy6Bkpl0DJTLoGSmXQMlMugZKZdAyUy6Bkpl0DJTLoGSmXQMlMugZKZdAyUy6Bkpl0DJTLoGSmXQMlMugZKZdAyUy6Bkpl0DJTLoGSmXQMlMugZKZdAyUy6Bkpl0DJTLoGSmXQMlMugZKZdAyUy6Bkpl0DJTLoGSmXQMlMugZKZdAyUy6Bkpl0DJTLoGSmXQMlMugZKZdAyUy6Bkpl0DJTLoGSmXQMlMugZKZdAyUy6Bkpl0DJTLoGSmXQMlMugZKZdAyUy6Bkpl0DJTLoGSmXQMlMugZKZdAyUy6Bkpl0DJTLoGSmXQMlMugZKZdAyUy6Bkpl0DJTLoGSmXQMlMugZSZdAyky6BlJl0DKTLoGUmXQMpMugZSZdAyky6BlJl0DKTLoGUmXQMpMugZSZdAyky6BlJl0DKTLoGUmXQMpMugZSZdAyky6BlJl0DKTLoGUmXQMpMugZSZdAyky6BlJl0DKTLoGUmXQMpMugZSZdAyky6BlJl0DKTLoGUmXQMpMugZSZdAyky6BlJl0DKTLoGUmXQMpMugZSZdAyky6BlJl0DKTLoGUmXQMpMugZSZdAyky6BlJl0DKTLoGUmXQMpMugZSZdAyky6BlJl0DKTLoGUmXQMpMugZSZdAyky6BlJl0DKTLoGUmXQMpMugZSZdAyky6BlJl0DKTLoGUmXQMpMugZSZdAyky6BlJl0DKTLoGUmXQMpMugZSZdAyky6BlJl0DKTLoGUmXQMpMugZSZdAyky6BlJl0DKTLoDnvufy537Hll/h/wDD6D6Wt/8AX6/X7GP/AJSzvp+h35f+p32+v9/73fw/b/ZdP+37Ps76u/2fX6u+rDn6vt/3/wDqLvsfww7ddj+GHbrsfww7d9j+GHbrsfww7ddj+GHbrsfww7ddj+GHbrsfww7ddj+GHbrsfww7ddj+GHbrsfww7ddj+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfw5h277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3XY/hh26jfww7dRv4Yduo38MO3Ub+GHbqN/DDt1G/hh26jfww7dRv4Yduo38MO3Ub+GHbqN/DDt1G/hh26jfww7dRv4Yduo38MO3Ub+GHbqN/DDt1G/hh26jfww7dRv4Yduo38MO3Ub+GHbqN/DDt1G/hh26jfww7dRv4Yduo38MO3Ub+GHbqN/DDt1G/hh26j+GHbqP4Yduo38MO3Ub+GHbqP4Yduo/hh26j+GHbmP4YduY/hh25j+GHbmP4YduY/hh25j+GHbmP4YduY/hh25j+GHbmP4YduY/hh25j+GHbmP4YduY/hh25j+GHbmP4YduY/hh25j+GHbmNh25jYduY2HbmNh25jYduY2HbmNh24jYduI2HbiNh24jYduI2HbiNh24jYduI2HbiNh24jYduI2HbiNh24jYduI2HbiNh24jYduI2HbiNh24jYduI2HbiNh0+Nh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh0+Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh06Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jh02Jhz+j7fweHn/AFd+fp9v6v8Ape79DDf1JLc930/LnmGfj9H0+v7/APAf6c32/wAQ/wCR+n/5f9383/iNaca041pxrTjWnGtONaca041pxrTjWnGtONaca041pxrTjWnGtONaca041pxrTjWnGtONaca041pxrTjWnGtONaca041pxrTjWnGtONaca041pxrTjWnGtONaca041pxrTjWnGtONaca0415xrzjXnGvONeca8415xrzjXnGvONeca8415xrzjXnGvONeca8415xrzjXnGvONeYa8w15hrzDXmGvMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMPBMNeYa8w15hrzDXnGvONeca8415xrzjXnGvONeca041pxrTjWnGtONaca041pxrTjWnGtONacas41ZxqzjVnGrONWcas41ZxqzjVnGrONScak41JxqTjUUGooNRQaig1FBqKDTUGmoNNQaag01BpqDTUGmoNNQaag0lBpKDSUGkoNJQaSg0lBpKDSUGioNFQaKg0VBoqDRVGiqNFUaKo0FRoKjQVGgqNBUaCo0FRoKjQVGgqPXqj16o9eqPXqj16o9eqPXqj16o9eqPXqj1yo9cqPXKj1yo9cqPXLD1yw9csPXLD1yw9csPWrD1qw9asPWrD1qw9asPWrD1qw9asPWrD1qw9YsPWLD1iw9YsPWLD1iw9YsPWLD1iw9YsPWLD1iw9YsPWLD1iw9YsPWLD1iw9YsPWLD1iw9YsPWLD1aw9WsPVrD1aw9WsPVrD1aw9WsPVrD1aw9WsPVrB34/8Ay/z/AH/53yHY/wDU/E/0v+P7/wCz/9k="})]})]}),pinterest:d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsxs("g",{clipPath:"url(#clip0_6570_25513)",children:[d.jsx("rect",{width:"15.996",height:"16",rx:"2",fill:"#CC2127"}),d.jsx("path",{d:"M7.999 2C4.68555 2 2 4.68555 2 7.999C2 10.5406 3.58174 12.7102 5.81336 13.5861C5.76137 13.1121 5.71338 12.3843 5.83336 11.8644C5.94134 11.3964 6.53724 8.88285 6.53724 8.88285C6.53724 8.88285 6.35727 8.52291 6.35727 7.993C6.35727 7.15914 6.84119 6.53524 7.44309 6.53524C7.95501 6.53524 8.20297 6.91918 8.20297 7.3811C8.20297 7.89502 7.87502 8.66489 7.70705 9.37877C7.56507 9.97667 8.007 10.4626 8.5949 10.4626C9.66072 10.4626 10.4806 9.33878 10.4806 7.71505C10.4806 6.27929 9.44876 5.27345 7.975 5.27345C6.26729 5.27345 5.26546 6.55324 5.26546 7.87702C5.26546 8.39293 5.46342 8.94484 5.71138 9.24679C5.75937 9.30678 5.76737 9.35877 5.75337 9.41876C5.70738 9.60873 5.6074 10.0167 5.5874 10.0987C5.56141 10.2086 5.50142 10.2326 5.38743 10.1786C4.63756 9.83069 4.16964 8.73488 4.16964 7.85502C4.16964 5.96334 5.54541 4.22563 8.13298 4.22563C10.2146 4.22563 11.8304 5.70938 11.8304 7.69105C11.8304 9.75871 10.5266 11.4224 8.71688 11.4224C8.10898 11.4224 7.53708 11.1065 7.34111 10.7345C7.34111 10.7345 7.04116 11.8804 6.96717 12.1603C6.83119 12.6822 6.46526 13.3341 6.2213 13.732C6.7832 13.906 7.3791 14 7.997 14C11.3104 14 13.996 11.3144 13.996 8.001C13.998 4.68555 11.3124 2 7.999 2Z",fill:"white"})]}),d.jsx("defs",{children:d.jsx("clipPath",{id:"clip0_6570_25513",children:d.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),spotify:d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("g",{clipPath:"url(#clip0_6523_22402)",children:d.jsx("path",{d:"M12.6609 7.10585C10.121 5.59751 5.93158 5.45882 3.50697 6.1947C3.11759 6.31287 2.70584 6.09298 2.5879 5.70373C2.46988 5.31411 2.68945 4.90265 3.07911 4.78429C5.86241 3.93945 10.4892 4.1026 13.4132 5.83828C13.7634 6.04622 13.8782 6.49851 13.6707 6.84813C13.4629 7.19833 13.0103 7.31376 12.6609 7.10585ZM12.5777 9.33993C12.3995 9.62908 12.0215 9.71979 11.7327 9.54223C9.61522 8.24063 6.38637 7.86357 3.88123 8.624C3.55636 8.72218 3.21323 8.53899 3.11455 8.21475C3.01666 7.88989 3.19992 7.54738 3.5242 7.44859C6.38597 6.58018 9.9436 7.00081 12.3756 8.49536C12.6644 8.67322 12.7553 9.05146 12.5777 9.33993ZM11.6136 11.4855C11.472 11.7177 11.1697 11.7904 10.9383 11.6489C9.08801 10.518 6.75909 10.2627 4.01637 10.8891C3.75207 10.9497 3.48866 10.7841 3.42838 10.5198C3.36785 10.2556 3.53284 9.99217 3.79772 9.93186C6.79916 9.2457 9.37381 9.54101 11.4506 10.8101C11.6822 10.9515 11.7551 11.254 11.6136 11.4855ZM8.00002 0.120623C3.64839 0.120623 0.120605 3.64834 0.120605 7.99989C0.120605 12.352 3.64839 15.8794 8.00002 15.8794C12.3517 15.8794 15.8794 12.352 15.8794 7.99989C15.8794 3.64834 12.3517 0.120623 8.00002 0.120623Z",fill:"#1ED760"})}),d.jsx("defs",{children:d.jsx("clipPath",{id:"clip0_6523_22402",children:d.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),twitter:d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:d.jsx("path",{d:"M14.3193 4.31285C14.329 4.45301 14.329 4.59317 14.329 4.73462C14.329 9.04475 11.0516 14.0156 5.05865 14.0156V14.0131C3.28832 14.0156 1.55478 13.508 0.0644531 12.5507C0.321873 12.5817 0.580582 12.5972 0.839937 12.5979C2.30703 12.5992 3.7322 12.1063 4.88639 11.1988C3.4922 11.1724 2.26961 10.2623 1.84252 8.93366C2.3309 9.02796 2.83413 9.00858 3.31349 8.87746C1.79349 8.57001 0.699937 7.23299 0.699937 5.68023C0.699937 5.66602 0.699937 5.65246 0.699937 5.63889C1.15284 5.89144 1.65994 6.0316 2.17865 6.0471C0.747034 5.08923 0.305743 3.18251 1.17026 1.69176C2.82445 3.7296 5.2651 4.96844 7.8851 5.09956C7.62252 3.96664 7.98123 2.77947 8.82768 1.98307C10.1399 0.748096 12.2038 0.811395 13.4374 2.12452C14.167 1.98048 14.8664 1.71243 15.5064 1.33264C15.2632 2.0877 14.7541 2.72909 14.0741 3.13665C14.7199 3.06044 15.3509 2.88734 15.9451 2.62316C15.5077 3.2794 14.9567 3.85103 14.3193 4.31285Z",fill:"#1D9BF0"})}),vimeo:d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsxs("g",{clipPath:"url(#clip0_6523_22340)",children:[d.jsx("path",{d:"M16 14.4C16 15.28 15.28 16 14.4 16H1.6C0.72 16 0 15.28 0 14.4V1.6C0 0.72 0.72 0 1.6 0H14.4C15.28 0 16 0.72 16 1.6V14.4Z",fill:"#1AB7EA"}),d.jsx("path",{d:"M13.9945 5.3084C13.9391 6.42815 13.1229 7.97447 11.5458 9.93402C9.91331 11.9736 8.52987 13 7.40928 13C6.70372 13 6.12267 12.3735 5.63846 11.1338C5.32027 9.98735 4.98824 8.85427 4.67005 7.70786C4.31036 6.46814 3.92299 5.84161 3.50796 5.84161C3.42495 5.84161 3.10676 6.02824 2.56721 6.38816L2 5.68165C2.59488 5.1751 3.17593 4.68187 3.75698 4.17532C4.54554 3.52214 5.14042 3.17555 5.54162 3.13556C6.46853 3.05557 7.04958 3.66877 7.27093 4.97514C7.50612 6.40149 7.67213 7.28129 7.75514 7.62788C8.01799 8.80095 8.32235 9.40081 8.64054 9.40081C8.88956 9.40081 9.26309 9.01423 9.77497 8.2544C10.273 7.49457 10.5497 6.90804 10.5774 6.50813C10.6465 5.85494 10.3837 5.52169 9.77497 5.52169C9.48444 5.52169 9.19392 5.58834 8.88956 5.70831C9.48444 3.84206 10.605 2.94893 12.2652 3.00225C13.4826 3.02891 14.0637 3.80207 13.9945 5.3084Z",fill:"white"})]}),d.jsx("defs",{children:d.jsx("clipPath",{id:"clip0_6523_22340",children:d.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),youtube:d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("path",{d:"M15.6656 3.75817C15.4816 3.06609 14.9395 2.5211 14.2511 2.33614C13.0034 2 8 2 8 2C8 2 2.99666 2 1.7489 2.33614C1.06051 2.5211 0.518324 3.06609 0.334339 3.75817C0 5.01251 0 7.62963 0 7.62963C0 7.62963 0 10.2467 0.334339 11.5012C0.518324 12.1932 1.06051 12.7381 1.7489 12.9232C2.99666 13.2593 8 13.2593 8 13.2593C8 13.2593 13.0034 13.2593 14.2511 12.9232C14.9395 12.7381 15.4816 12.1932 15.6656 11.5012C16 10.2467 16 7.62963 16 7.62963C16 7.62963 16 5.01251 15.6656 3.75817Z",fill:"#ED1D24"}),d.jsx("path",{d:"M6.36353 10.0058L10.5453 7.62974L6.36353 5.25349V10.0058Z",fill:"white"})]})};function t7(e){const{debouncedUrl:t,content:n,onContentChange:r,selected:i}=e,o=R.useRef(null),[a,u]=R.useState(!1);Xe.useOnChange(t,()=>{var c;a&&(u(!1),(c=o.current)==null||c.reset())});function s(){u(!0),r(void 0)}return $r.toURL(t)?t===(n==null?void 0:n.embed_url)?d.jsx(X1,{content:n,selected:i}):d.jsx(m.ErrorBoundary,{ref:o,renderError:b$e,onError:s,children:d.jsx(R.Suspense,{fallback:n&&d.jsx(X1,{content:n,selected:i}),children:d.jsx(C$e,{url:t,selected:i,onContentChange:r})})}):null}function b$e(){return d.jsxs(m.Box,{backgroundColor:"grey2",borderRadius:6,padding:16,gap:4,children:[d.jsx(m.Icon,{name:"alert",size:"small",color:"grey11"}),d.jsx(m.Text,{variant:"smallBold",color:"grey11",children:"There is no embed data available."})]})}function X1(e){const{content:t,selected:n}=e,{thumbnail:r,provider:i,author:o,url:a,subtitle:u}=T$e(t);return d.jsxs(m.PreviewCard,{selected:n,children:[d.jsx(m.PreviewImage,{src:r.url,aspectRatio:r.aspectRatio}),d.jsxs(m.PreviewContent,{children:[d.jsxs(m.Box,{display:"flex",alignItems:"center",gap:4,children:[d.jsx(v$e,{provider:i}),d.jsx(m.Text,{variant:"smallBold",color:"grey12",noWrap:!0,children:i}),o&&d.jsx(m.Text,{variant:"small",color:"grey11",noWrap:!0,children:o})]}),d.jsx(m.Text,{variant:"smallBold",href:a,children:u})]})]})}function C$e(e){const{url:t,onContentChange:n,selected:r}=e,i=S$e({url:t,onContentChange:n});return d.jsx(X1,{content:i,selected:r})}function S$e(e){const{url:t,onContentChange:n}=e,{embedApiEndpoint:r}=Te(),i=nt.useRequest(_$e,[t,r]),o=Xe.useStableCallback(n);return R.useEffect(()=>{const a=m.handleEditorFlushSyncError(()=>o(i));return()=>{clearTimeout(a)}},[i,o]),i}function _$e(e,t){const n=new URL(t);return n.searchParams.set("url",e),we.request(n,{okType:I$e(e)})}function I$e(e){return B.object({type:B.string(),version:B.string().or(B.number()).nullish(),title:B.string().nullish(),author_name:B.string().nullish(),author_url:B.string().nullish(),provider_name:B.string().nullish(),provider_url:B.string().nullish(),cache_age:B.string().or(B.number()).nullish(),thumbnail_url:B.string().nullish(),thumbnail_width:B.number().nullish(),thumbnail_height:B.number().nullish(),html:B.string().nullish()}).passthrough().transform(t=>{const n={embed_url:e};return{...n,__TYPE__:"EmbedContent",type:t.type,version:t.version,title:t.title,author_name:t.author_name,author_url:t.author_url,provider_name:t.provider_name,provider_url:t.provider_url,cache_age:t.cache_age,thumbnail_url:t.thumbnail_url,thumbnail_width:t.thumbnail_width,thumbnail_height:t.thumbnail_height,html:t.html,all:{...n,...t}}})}function T$e(e){let t="";switch(e.type){case"video":t=e.title??"";break;case"photo":t=`View this post${e.provider_name?` on ${e.provider_name}`:""}`;break;default:t=`Open${e.provider_name?` on ${e.provider_name}`:""}`}return{url:e.embed_url,thumbnail:{url:e.thumbnail_url??"",aspectRatio:e.type==="video"?"16:9":"1:1"},provider:e.provider_name??"",author:e.author_name??"",subtitle:t}}function x$e(e){const{id:t,readOnly:n,field:r,content:i,onContentChange:o}=e,a=Xe.useDebounceState({initialState:(i==null?void 0:i.embed_url)??"",startTransition:R.startTransition});function u(s){a.set(s),$r.toURL(s)||o(void 0)}return d.jsxs(m.Field,{footer:$r.toURL(a.value)&&d.jsx(m.FieldFooter,{children:d.jsx(t7,{debouncedUrl:a.debouncedValue,content:i,onContentChange:o})}),children:[d.jsx(m.FieldIcon,{name:"cloud"}),d.jsx(m.FieldLabel,{htmlFor:t,children:er(r)}),d.jsx(m.FieldControl,{children:d.jsx(Vu,{id:t,readOnly:n,placeholder:Qu(r),value:a.value,onValueChange:u,variant:$r.toURL(a.value)?"link":"normal",endAdornment:d.jsx(m.Button,{startIcon:"close",color:"grey",size:"small",disabled:!a,onClick:()=>u("")})})})]})}function n7(e){return!(e.lat>85||e.lat<-85||e.lng>180||e.lng<-180)}function Nb(e){const t=/^.*@(-?\d+.\d+),(-?\d+.\d+).*$/,n=e.match(t);if(!n)return;const r=parseFloat(n[1]??""),i=parseFloat(n[2]??"");if(isNaN(r)||isNaN(i))return;const o={lat:r,lng:i};if(n7(o))return o}function UF(e){return e?`${e.lat}, ${e.lng}`:""}function BF(e){const t=/\(?([\d|.|-]*)[\s+]*,[\s]*([\d|.|-]*)\)?/,n=e.match(t);if(!n)return Nb(e);const r=parseFloat(n[1]??""),i=parseFloat(n[2]??"");if(isNaN(r)||isNaN(i))return Nb(e);const o={lat:r,lng:i};return n7(o)?o:Nb(e)}function w$e(e){const{field:t,id:n,readOnly:r,...i}=e,{onValueChange:o,displayedValue:a,onBlur:u,clearValue:s,isValidCoordinates:c}=$$e(i);return d.jsxs(m.Field,{children:[d.jsx(m.FieldIcon,{name:"place"}),d.jsx(m.FieldLabel,{htmlFor:n,children:er(t)}),d.jsx(m.FieldControl,{children:d.jsx(Vu,{id:n,onValueChange:o,placeholder:Z1,readOnly:r,value:a,onBlur:u,variant:c?"link":"normal",endAdornment:d.jsx(m.Button,{startIcon:"close",color:"grey",size:"small",disabled:!a,onClick:s})})})]})}function $$e(e){const{content:t,onContentChange:n}=e,r=UF(t==null?void 0:t.position),[i,o]=R.useState(r);function a(){const c=BF(i);if(!c)return o(""),n(void 0);const{lat:l,lng:f}=c;o(UF({lat:l,lng:f})),n({__TYPE__:"GeoPointContent",position:{lat:l,lng:f}})}function u(){o(""),n(void 0)}const s=!!BF(i);return{displayedValue:i,isValidCoordinates:s,onValueChange:o,onBlur:a,clearValue:u}}function r7(e){const{fieldLabel:t,imageLabel:n=[]}=e;return d.jsxs(m.CardHeaderTitle,{children:[d.jsx(m.Text,{variant:"bold",noWrap:!0,children:Ip.overflow(t,30)}),n.length!==0&&d.jsx(m.Text,{color:"grey11",noSelect:!0,children:` • ${n.join(" • ")}`})]})}function i7(e){const{fieldLabel:t,isUpdating:n,readOnly:r,onMediaDialogOpenChange:i}=e;return d.jsxs(d.Fragment,{children:[d.jsx(m.CardHeader,{sx:{flexWrap:"wrap"},children:d.jsx(r7,{fieldLabel:t})}),d.jsx(m.CardContent,{children:d.jsx(m.Card,{color:"grey2",variant:"dashed",paddingBlock:12,radius:4,sx:{width:"100%"},children:d.jsx(m.CardContent,{children:d.jsxs(m.BlankSlate,{variant:"horizontal",children:[d.jsx(m.BlankSlateIcon,{name:"cloudUpload",lineColor:"purple9",backgroundColor:"purple4",size:"small"}),d.jsx(m.BlankSlateTitle,{children:n?"Preparing your image...":"You haven't selected an image"}),!r&&d.jsx(m.BlankSlateActions,{children:d.jsx(m.Button,{disabled:n,onClick:()=>i(!0),size:"medium",children:"Select image"})})]})})})})]})}const E$e=lp({id:zo(),width:jm(),height:jm(),urls:lp({full:zo(),small:zo().transform(xwe)}),alt_description:zo().optional(),description:zo().nullable()}),R$e=lp({results:mq(E$e)}).transform(e=>e.results);function o7(e,t){const n=new URL("search/photos",e);return n.searchParams.set("page","1"),n.searchParams.set("per_page","28"),n.searchParams.set("query",t),we.request(n,{okType:R$e})}nt.cache.registerFetcherConfig(o7,{cacheCapacity:5,revalidationStrategy:{type:"never"}});function O$e(e,t){const n=R.useRef(),r=Te(),i=nt.useRequest(o7,[e,t]);return Xe.useDebounce(t,1e3,()=>{var o;n.current&&t!==n.current&&((o=r.onAnalyticsEvent)==null||o.call(r,"Unsplash Image Searched")),n.current=t}),i}function F$e(e){const{onSelectedChange:t}=e,[n,r]=R.useTransition(),i=Xe.useDebounceState({initialState:"",ms:300,startTransition:r});return d.jsxs(m.Box,{flexDirection:"column",gap:16,width:"100%",position:"relative",children:[d.jsx(m.FormSearchInput,{value:i.value,placeholder:"Search on Unsplash.com",onValueChange:i.set}),d.jsx(m.ErrorBoundary,{renderError:()=>d.jsx(jq,{}),children:d.jsx(R.Suspense,{fallback:d.jsx(k$e,{}),children:d.jsx(M$e,{term:i.debouncedValue,loading:n,onSelectedChange:t})})})]})}function M$e(e){const{term:t,onSelectedChange:n,loading:r}=e,{media:i,toggleSelected:o,selectedImageId:a}=L$e({term:t,onSelectedChange:n});return d.jsxs(d.Fragment,{children:[d.jsx(a7,{children:i==null?void 0:i.map(u=>{const c=new URL(u.urls.full).searchParams.get("fm")??"jpg";return d.jsx(m.MediaCard,{url:u.urls.small,filename:u.description??"Unsplash Image",selected:a===u.id,onCardClick:()=>o(u),onCheckedChange:()=>o(u),extension:c,width:u.width,height:u.height,loading:r},u.id)})}),i.length===0&&d.jsx(cq,{})]})}function a7(e){const{children:t}=e;return d.jsx(m.ScrollArea,{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 250px), 1fr))",gap:16,paddingBottom:16,position:"relative",width:"100%"},children:t})}function k$e(){return d.jsx(a7,{children:gn.range(1,24).map(e=>d.jsx(Dq,{},e))})}function L$e(e){var c;const{term:t,onSelectedChange:n}=e,{unsplashApiBaseUrl:r}=Te(),i=O$e(r,t||"citrus fruit"),o=(c=i==null?void 0:i[0])==null?void 0:c.id,[a,u]=R.useState();R.useEffect(()=>{n==null||n([]),u(void 0)},[o,n]);function s(l){if(l.id===a)return u(void 0),n==null?void 0:n([]);u(l.id),n==null||n([{...l,url:l.urls.full,alt:l.alt_description}])}return{media:i,toggleSelected:s,selectedImageId:a}}function RR(e){const{open:t,onOpenChange:n,onMediaSelected:r,assetType:i}=e,o=Te(),a=o.mediaLibrary,[u,s]=R.useState(()=>a?"media":"unsplash"),[c,l]=R.useState(new Set),[f,p]=R.useState([]),A=c.size+f.length,h=nt.useFetcherData(Yi);R.useEffect(()=>{!t||!a||Mq({config:o,assetType:i})},[t,o,i,a]);function v(C){if(C!=="media"&&C!=="unsplash")throw new Error(`Invalid option ${C}.`);s(C)}function _(C){C||l(new Set),n(C)}const S=Wxe({assetType:i,mediaDialogOpen:t});function I(){var C;if(u==="unsplash"){const y=f[0];if(!y)return;r(y),(C=o.onAnalyticsEvent)==null||C.call(o,"Unsplash Image Added")}else if(u==="media"){const w=h.flatMap(M=>M.items).filter(M=>c.has(M.id))[0];if(!w)return;r(w),S(w.id)}_(!1)}function T(){if(A===0)return"Select a media item to add to the page";if(A>1)return"Only one media item can be added to the page"}const{containerRef:g}=m.useAlert();return d.jsxs(m.Dialog,{open:t,onOpenChange:_,size:{width:"min(calc(100% - 48px), 2000px)",height:"calc(100% - 30px)"},position:"center",onPointerDownOutside:C=>{g&&Xe.refContainsTarget(g,C.target)&&C.preventDefault()},children:[d.jsx(m.DialogHeader,{icon:"image",title:"Media library"}),d.jsxs(m.DialogOptions,{value:u,onValueChange:v,padding:"small",width:"auto",children:[a&&d.jsx(m.DialogOptionsItem,{value:"media",icon:"photo"}),d.jsx(m.DialogOptionsItem,{value:"unsplash",icon:"unsplash"})]}),d.jsx(m.DialogContent,{children:d.jsxs(m.Box,{flexDirection:"column",flexGrow:1,overflow:"hidden",children:[d.jsx(aq,{}),d.jsxs(m.Box,{overflow:"hidden",backgroundColor:"grey3",padding:{top:16,inline:16},flexGrow:1,children:[u==="media"&&d.jsx(Hq,{assetType:i,onSelectedChange:l}),u==="unsplash"&&d.jsx(F$e,{onSelectedChange:p})]})]})}),d.jsxs(m.DialogActions,{children:[d.jsx(m.DialogCancelButton,{}),d.jsx(m.DialogActionButton,{onClick:I,disabled:A!==1,tooltipLabel:T(),children:"Add to page"})]})]})}function u7(e){const{isMediaDialogOpen:t,selected:n,onMediaSelected:r,onMediaDialogOpenChange:i,children:o}=e;return d.jsxs(m.Card,{color:n?"indigo2":"grey2",variant:n?"selected":"dashed",paddingBlock:12,radius:4,children:[o,d.jsx(RR,{open:t,onOpenChange:i,onMediaSelected:r,assetType:"image"})]})}function s7(e){const{contentView:t,croppedImage:n}=e,{width:r,height:i,x:o,y:a,zoom:u}=n,s=U$e({origin:t.origin,croppedImage:n});return{...t,width:r,height:i,url:s,edit:{...t.edit,zoom:u,crop:{x:o,y:a}}}}function j$e(e){var c,l,f;const{field:t,content:n,thumbnail:r,croppedImage:i}=e;if(r===dd)return c7({content:n,croppedImage:i});const o=Ue.isImageContent(n),a=(l=(c=t==null?void 0:t.config)==null?void 0:c.thumbnails)==null?void 0:l.find(p=>p.name===r),u=o?(f=n.thumbnails)==null?void 0:f[r]:void 0;if(!a||!u)return n;const s=s7({contentView:u,croppedImage:i});return s.url===u.url?n:{...n,thumbnails:o?{...n.thumbnails,[r]:s}:void 0}}function c7(e){const{content:t,croppedImage:n}=e,r=s7({contentView:t,croppedImage:n});return r.url===t.url?t:{...t,...r}}function U$e(e){const{origin:t,croppedImage:n}=e,{x:r,y:i,width:o,height:a,cropHeight:u,cropWidth:s}=n,c=new URL(t.url),l=t.height!==a||t.width!==o;if(r!==0||i!==0||u!==t.height||s!==t.width){const p=[r,i,s,u].map(Math.round).join(",");c.searchParams.set("rect",p),c.searchParams.set("w",o.toString()),c.searchParams.set("h",a.toString())}return l&&(c.searchParams.set("w",o.toString()),c.searchParams.set("h",a.toString())),c.toString()}function B$e(e){const{x:t,y:n}=e.edit.crop,r=e.edit.zoom,{width:i,height:o}=e,{width:a,height:u}=e.origin,s=i/o,c=Math.min(a,u*s/r),l=c/s;return{x:t,y:n,width:i,height:o,zoom:r,cropWidth:c,cropHeight:l}}function W$e(e){const{selectedImage:t,imageCrop:n,setImageCrop:r}=e,{width:i,height:o,zoom:a,cropHeight:u,cropWidth:s}=n,c=t.contentView,l={x:n.x,y:n.y,width:s,height:u},[f,p]=R.useState(),A=(c==null?void 0:c.origin.url)??"",h=!(t!=null&&t.thumbnail.height&&(t!=null&&t.thumbnail.width));function v(g,C){const y=parseInt(C);isNaN(y)||y<=0||!h||r({...n,[g]:y})}function _(g){r({...n,cropWidth:g.width,cropHeight:g.height,x:g.x,y:g.y})}function S(g){r({...n,zoom:g})}function I(){p(Dh),r({...n,...Dh})}function T(){c&&(p(Dh),r({...n,...Dh,zoom:1,cropWidth:c.width,cropHeight:c.height}))}return d.jsxs(m.Box,{padding:{inline:24,block:16},flexDirection:"column",gap:16,height:"100%",overflowY:"auto",alignItems:"center",children:[d.jsxs(m.Box,{gap:8,height:32,alignItems:"flex-start",width:"100%",children:[d.jsx(m.Tooltip,{content:"Center",children:d.jsx(m.Button,{color:"grey",size:"medium",startIcon:"centerFocusWeak",onClick:I})}),d.jsx(m.Tooltip,{content:"Cover",children:d.jsx(m.Button,{color:"grey",size:"medium",startIcon:"zoomOutMap",onClick:T})}),d.jsx(m.Separator,{orientation:"vertical"}),d.jsx(m.FormInput,{prefix:"W",prefixTooltip:"Width",placeholder:"width",type:"number",size:"medium",value:String(i),onValueChange:g=>v("width",g),sx:{width:100},disabled:!h}),d.jsx(m.FormInput,{prefix:"H",prefixTooltip:"Height",placeholder:"height",type:"number",size:"medium",value:String(o),onValueChange:g=>v("height",g),sx:{width:100},disabled:!h})]}),d.jsx(m.Cropper,{image:A,aspect:i/o,crop:f??{x:0,y:0},onCropChange:p,zoom:a,onZoomChange:S,onCropAreaChange:(g,C)=>_(C),initialCroppedAreaPixels:l}),d.jsx(m.Box,{width:"100%",maxWidth:320,children:d.jsx(m.Slider,{min:1,max:3,step:.01,value:[a],onValueChange:([g])=>S(g??1)})})]})}const Dh={x:0,y:0};function K$e(e){const{trigger:t,initialImages:n,renderTooltip:r}=e,{open:i,onOpenChange:o,ready:a,option:u,selectedImage:s,croppedImage:c,setCroppedImage:l,setReady:f,setOption:p}=P$e(e);return d.jsxs(m.Dialog,{trigger:t,onAnimationEnd:()=>f(!0),open:i,onOpenChange:o,renderTooltip:r,children:[d.jsx(m.DialogHeader,{icon:"photo",title:"Image editor"}),d.jsx(m.DialogOptions,{value:String(u),onValueChange:A=>p(Number(A)),children:n.map((A,h)=>d.jsx(m.DialogOptionsItem,{value:String(h),icon:"photo",title:A.labels[0]??"Main",subtitle:A.labels[1]??""},A.thumbnail.name))}),s&&d.jsx(m.DialogContent,{children:a&&c&&d.jsx(W$e,{selectedImage:s,imageCrop:c,setImageCrop:l},s.thumbnail.name)})]})}function P$e(e){const{initialImages:t,initialOption:n,onClose:r}=e,[i,o]=R.useState(_),[a,u]=R.useState(!1),[s,c]=R.useState(!1),[l,f]=R.useState(n);function p(S){S?(f(n),o(_())):(c(!1),r({option:l,croppedImages:i})),u(S)}const A=t[l],h=i[(A==null?void 0:A.thumbnail.name)??""];function v(S){if(!A)return;const I=A.thumbnail.name;o({...i,[I]:S})}function _(){return t.reduce((S,I)=>(I.contentView&&(S[I.thumbnail.name]=B$e(I.contentView)),S),{})}return{open:a,ready:s,option:l,selectedImage:A,croppedImage:h,setCroppedImage:v,setReady:c,setOption:f,onClose:r,onOpenChange:p}}function D$e(e){const{id:t,readOnly:n,altText:r,onValueChange:i,selected:o}=e;return d.jsxs(m.Field,{selected:o,children:[d.jsx(m.FieldLabel,{htmlFor:t,children:"Alt text"}),d.jsx(m.FieldControl,{children:d.jsx(m.Box,{flexGrow:1,height:40,children:d.jsx(Vu,{id:t,placeholder:"Short description for the visually impaired",readOnly:n,value:r,onValueChange:i,padding:{input:{inline:12}}})})})]})}function N$e(e){const{fieldLabel:t,imageLabel:n,initialImages:r,page:i,displaySeparator:o=!0,isSVGContentView:a,visibility:u,onClear:s,onCropperDialogClose:c,onMediaDialogOpenChange:l}=e;return d.jsxs(m.Box,{display:"flex",flexDirection:"column",gap:12,children:[d.jsxs(m.Box,{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:4,children:[d.jsx(r7,{fieldLabel:t,imageLabel:n}),d.jsxs(m.CardHeaderActions,{sx:{visibility:u},children:[d.jsx(K$e,{trigger:d.jsx(m.Button,{startIcon:"crop",disabled:a}),renderTooltip:f=>d.jsx(m.Tooltip,{content:"Crop & Resize",children:f}),initialImages:r,initialOption:i,onClose:c}),d.jsx(m.Tooltip,{content:"Replace",children:d.jsx(m.Button,{startIcon:"imageSearch",hiddenLabel:"Replace",onClick:()=>l(!0)})}),d.jsx(m.Tooltip,{content:"Clear",children:d.jsx(m.Button,{onClick:s,startIcon:"delete"})})]})]}),o&&d.jsx(m.Separator,{style:"dashed",decorative:!0})]})}function q$e(e){const{documentType:t,documentUrl:n,title:r,statusColor:i,description:o,tags:a,tagsFilter:u,previewImageUrl:s,onSelect:c}=e;function l(f){return f.nativeEvent instanceof MouseEvent&&(f.metaKey||f.ctrlKey)?window.open(n,"_blank"):c()}return d.jsxs(m.Card,{paddingBlock:16,onSelect:l,children:[d.jsx(m.CardContent,{children:d.jsxs(m.Box,{justifyContent:"space-between",children:[d.jsxs(m.Box,{flexDirection:"column",gap:4,alignItems:"flex-start",flexGrow:1,children:[d.jsx(Q$e,{documentType:t}),d.jsx(V$e,{title:r,statusColor:i}),d.jsx(z$e,{description:o})]}),d.jsx(H$e,{previewImageUrl:s})]})}),a.length>0&&d.jsx(Y$e,{tags:a,tagsFilter:u})]})}function Q$e(e){const{documentType:t}=e;return d.jsx(m.Badge,{maxWidth:150,size:"medium",title:`Type: ${t}`,icon:"description"})}function V$e(e){const{title:t,statusColor:n}=e;return d.jsxs(m.Box,{gap:8,alignItems:"center",children:[d.jsx(m.Dot,{color:n}),d.jsx(m.Text,{variant:"bold",children:t})]})}function z$e(e){const{description:t}=e,n=t==null?void 0:t.substring(0,150);return n?d.jsx(m.Text,{variant:"small",color:"grey11",children:`${n}${n!==t?"...":""}`}):d.jsx(m.Text,{variant:"smallItalic",color:"grey11",children:"No description available"})}function H$e(e){const{previewImageUrl:t}=e;return d.jsx(m.Box,{width:142,height:90,backgroundColor:"grey2",border:!0,borderRadius:6,flexDirection:"column",alignItems:"center",justifyContent:"center",gap:4,flexShrink:0,padding:8,children:t?d.jsx(m.Image,{src:t,sizing:"cover"}):d.jsxs(d.Fragment,{children:[d.jsx(m.Icon,{name:"hideImage",size:"large",color:"grey11"}),d.jsx(m.Text,{color:"grey11",variant:"small",children:"No preview available"})]})})}function Y$e(e){const{tags:t}=e;return d.jsxs(m.CardFooter,{children:[d.jsxs(m.Box,{gap:4,alignItems:"center",children:[d.jsx(m.Icon,{name:"label",size:"small",color:"grey11"}),d.jsx(m.Text,{variant:"small",color:"grey11",children:"Tags:"})]}),d.jsx(m.TextOverflow,{children:t.map(n=>d.jsx(m.Badge,{size:"medium",title:n,sx:{marginRight:8}},n))})]})}function G$e(e){var g,C;const{searchTerm:t,tagsFilter:n,typesFilter:r,localesFilter:i}=e,o=Te();o.searchDocuments||Bn("searchDocuments");const{coreApiBaseUrl:a,documentSearchBaseUrl:u,authStrategy:s,status:c,documentListOpenSearchEnabled:l,repository:f}=o,p=l===!1;function A(){return p?W0({tags:[...Rn.map(n,y=>y.id)],customTypes:[...Rn.map(r,y=>y.id)],language:[...Rn.map(i,y=>y.id)],term:[t]}):yq({repository:f,searchTerm:t,customTypesIds:[...Rn.map(r,y=>y.id)],tags:[...Rn.map(n,y=>y.id)],localeId:[...Rn.map(i,y=>y.id)][0]})}const[h,v]=R.useState([]),[_,S]=R.useState(""),I=A(),T=nt.useRequest(l7,[a,u,s,I,c,p]);return I!==_?(S(I),v(T.results)):T.results.length>0&&((g=gn.last(h))==null?void 0:g.id)!==((C=gn.last(T.results))==null?void 0:C.id)&&v(y=>y.concat(T.results)),{documents:h,response:T}}nt.cache.registerFetcherConfig(l7,{cacheCapacity:500,revalidationStrategy:{type:"never"}});async function l7(e,t,n,r,i,o){const a=oq[i];if(o){const l=await B0(e,n,r,200);return WF(l,a)}const u=await vq(t,n,r),s=await Cq(e,n,u.results.map(({id:c})=>c));return WF(s,a)}function WF(e,t){return{results:e.results.flatMap(r=>{const i=r.versions.filter(o=>t.includes(o.status));return i.length===0?[]:{...r,versions:i}})}}function KF(){const e=Te();e.searchDocuments||Bn("searchDocuments");const{coreApiBaseUrl:t,authStrategy:n}=e,r=nt.useRequest(_q,[t,n]);return new Set(r.languages.map(i=>({id:i.id,label:i.name})))}function J$e(){const e=Te();e.searchDocuments||Bn("searchDocuments");const{coreApiBaseUrl:t,authStrategy:n}=e,r=nt.useRequest(Tq,[t,n]);return new Set(r.results.map(i=>({id:i,label:i})))}function Z$e(){const e=Te();e.searchDocuments||Bn("searchDocuments");const{customTypesApiBaseUrl:t,repository:n,authStrategy:r}=e,i=nt.useRequest(gq,[t,n,r]);return new Set(i)}function X$e(e,t){const n=Te(),r=Xe.useDebounceState({initialState:""}),[i,o]=R.useState(new Set),[a,u]=R.useState(new Set);function s(){return!n.searchDocuments||!n.localeId?new Set:new Set([{id:n.localeId,label:n.localeId}])}const[c,l]=R.useState(s),f=Rn.union(a,Um(e)),p=Rn.union(i,Um(t));return{searchTerm:r,filteredTags:i,setFilteredTags:o,filteredCustomTypes:a,setFilteredCustomTypes:u,filteredLocales:c,setFilteredLocales:l,typesFilter:f,tagsFilter:p}}function Um(e){return e?Rn.map(e,t=>({id:t,label:t})):new Set}function eEe(e){const{filteredLocales:t,setFilteredLocales:n,filteredTags:r,setFilteredTags:i,filteredCustomTypes:o,setFilteredCustomTypes:a,fixedTags:u,fixedCustomTypes:s}=e;return d.jsxs(d.Fragment,{children:[d.jsx(nEe,{selectedValues:t,onSelectedValuesChange:n}),d.jsx(eC,{selectedValues:r,fixedSelectedValues:Um(u),onSelectedValuesChange:i,label:"Tags",icon:"label",fetchFilters:J$e}),d.jsx(eC,{selectedValues:o,fixedSelectedValues:Um(s),onSelectedValuesChange:a,label:"Type",icon:"description",fetchFilters:Z$e})]})}function eC(e){const[t,n]=R.useState(!1),r=R.useRef(null);return d.jsx(m.ErrorBoundary,{ref:r,renderError:()=>{var i;return d.jsx(m.FilterField,{mode:"error",onErrorRetry:(i=r.current)==null?void 0:i.reset,open:t,setOpen:n,values:new Set,...e})},children:d.jsx(R.Suspense,{fallback:d.jsx(m.FilterField,{mode:"loading",open:t,setOpen:n,values:new Set,...e}),children:d.jsx(tEe,{open:t,setOpen:n,...e})})})}function tEe(e){const{open:t,setOpen:n,onSelectedValuesChange:r,fixedSelectedValues:i,selectedValues:o,label:a,icon:u,fetchFilters:s,multiple:c}=e,l=s();return d.jsx(m.FilterField,{open:t,setOpen:n,label:a,icon:u,selectedValues:o,values:new Set(l),fixedSelectedValues:i,onSelectedValuesChange:r,multiple:c})}function nEe(e){const{selectedValues:t,onSelectedValuesChange:n}=e,[r,i]=R.useState(Rn.first(t));function o(u){n(u),i(Rn.first(u))}const a=Rn.find(KF(),u=>{var s;return u.id===((s=Rn.first(t))==null?void 0:s.id)});return(a==null?void 0:a.label)!==(r==null?void 0:r.label)&&i(a),d.jsx(eC,{selectedValues:new Set(r?[r]:[]),onSelectedValuesChange:o,label:"Locale",icon:"public",fetchFilters:KF,multiple:!1})}function f7(e){const{onSelectDocument:t,fixedCustomTypes:n,fixedTags:r,...i}=e,o=Te(),{searchTerm:a,filteredTags:u,setFilteredTags:s,filteredCustomTypes:c,setFilteredCustomTypes:l,filteredLocales:f,setFilteredLocales:p,typesFilter:A,tagsFilter:h}=X$e(n,r),[v,_]=R.useTransition();return d.jsx(m.Dialog,{size:{height:727,width:656},hasClose:!1,...i,children:d.jsx(m.DialogContent,{children:d.jsxs(m.Box,{flexDirection:"column",height:"100%",children:[d.jsxs(m.Box,{padding:{top:16,inline:16,bottom:8},flexDirection:"column",gap:12,children:[d.jsx(m.FormInput,{value:a.value,onValueChange:a.set,placeholder:"Search a page",icon:"search"}),o.searchDocuments&&d.jsx(eEe,{filteredTags:u,setFilteredTags:s,filteredCustomTypes:c,setFilteredCustomTypes:l,filteredLocales:f,setFilteredLocales:p,fixedTags:r,fixedCustomTypes:n}),d.jsx(m.Text,{variant:"smallBold",color:"grey11",children:"Link to a document"})]}),o.searchDocuments?d.jsx(m.ErrorBoundary,{renderError:iEe,children:d.jsx(R.Suspense,{fallback:d.jsx(aEe,{}),children:d.jsx(oEe,{searchTerm:a.debouncedValue,tagsFilter:h,typesFilter:A,localesFilter:f,startTransition:_,onSelectDocument:t})})}):d.jsx(d7,{message:"Slice Machine does not yet support mock data for linked documents in the simulator."}),d.jsx(rEe,{isLoading:v})]})})})}function rEe(e){const{isLoading:t}=e;return d.jsx(m.Toast,{anchor:d.jsx(m.Box,{position:"relative",width:"100%",justifyContent:"center",bottom:72}),loadingIndicator:!0,open:t,title:"Loading more results ...",seconds:1})}function iEe(){return d.jsx(m.Box,{height:"100%",flexDirection:"column",alignItems:"center",justifyContent:"center",children:d.jsx(m.DefaultErrorMessage,{title:"Request failed",description:"An error occurred while fetching documents.",errorImageSrc:m.dialogErrorImage})})}function oEe(e){const{searchTerm:t,tagsFilter:n,typesFilter:r,localesFilter:i,onSelectDocument:o}=e,{documents:a}=G$e({searchTerm:t,tagsFilter:n,localesFilter:i,typesFilter:r}),u=Te();return d.jsxs(m.ScrollArea,{style:{flexGrow:1,paddingTop:m.theme.space[10],paddingBottom:m.theme.space[16],paddingInline:m.theme.space[16],display:"flex",flexDirection:"column",gap:m.theme.space[12]},children:[a.length===0&&d.jsx(d7,{}),a.map(s=>{const c=s.versions[0];if(!c)return null;const l=_R({documentId:s.id,versionId:c.status==="archived"?c.version_id:void 0,releaseId:c.status==="release"?c.release_id:void 0,status:c.status,baseUrl:u.baseUrl}),f=uEe({tags:c.tags,tagsFilter:n});return d.jsx(q$e,{documentType:c.custom_type_label,documentUrl:l,description:c.preview_summary,tags:f,title:s.title,previewImageUrl:c.preview_image,onSelect:()=>o(s.id),statusColor:iq[c.status].color},`${s.id}-${c.status}`)})]})}function d7(e){const{message:t="We can't find any versions matching this request"}=e,n="Oops!";return d.jsx(m.Box,{justifyContent:"center",flexDirection:"column",height:"100%",children:d.jsxs(m.BlankSlate,{children:[d.jsx(m.BlankSlateIcon,{name:"close",lineColor:"purple10",backgroundColor:"purple3",borderColor:"purple6",borderStyle:"dashed",size:"xlarge"}),d.jsx(m.BlankSlateTitle,{size:"big",children:n}),d.jsx(m.BlankSlateDescription,{width:360,children:t})]})})}function aEe(){return d.jsx(m.Box,{flexDirection:"column",gap:12,padding:{top:10,inline:16,bottom:16},children:gn.range(1,5).map(e=>d.jsx(m.Skeleton,{height:150},e))})}function uEe(e){const{tags:t,tagsFilter:n}=e,r=[...n].map(o=>o.label).reverse();return gn.sort(t,o=>-r.indexOf(o))}function p7(e){const{hasLink:t,onUnlink:n,selectEnabled:r,selectedType:i,onValueChange:o,openInNewTab:a=!0,condensedButtons:u=!1,setOpenInNewTab:s}=e,c=s&&i==="web",l=a?"checkBox":"checkBoxOutlinedBlank";return d.jsxs(d.Fragment,{children:[c&&d.jsx(m.Tooltip,{content:"Open in new tab",visible:u,children:d.jsx(m.Button,{startIcon:l,color:"grey",size:"small",onClick:()=>s(!a),children:u?"":"Open in new tab"})}),d.jsxs(m.Select,{value:i,color:"grey",size:"small",boldTriggerText:!0,startIcon:sEe(i),disabled:!r,onValueChange:o,placeholder:u?"":gd("placeholder"),onlyStartIcon:u&&!!i,renderTrigger:({button:f})=>d.jsx(m.Tooltip,{content:gd(i),visible:u,children:f}),children:[d.jsx(m.SelectItem,{value:"web",icon:"public",children:gd("web")}),d.jsx(m.SelectItem,{value:"document",icon:"description",children:gd("document")}),d.jsx(m.SelectItem,{value:"media",icon:"image",children:gd("media")})]}),d.jsx(m.Button,{startIcon:"close",color:"grey",size:"small",disabled:!t,onClick:n})]})}function gd(e){if(!e||e==="placeholder")return"Choose link type";switch(e){case"document":return"Link to Prismic page";case"web":return"Link to web page";case"media":return"Link to media"}}function sEe(e){if(e)switch(e){case"document":return"description";case"web":return"public";case"media":return"image"}}function cEe(e){var y;const{field:t,content:n,onContentChange:r}=e,i=h(),[o,a]=R.useState(A),[u,s]=R.useState(()=>(n==null?void 0:n.value.__TYPE__)==="ExternalLink"?n.value.target:""),[c,l]=R.useState(!1),f=R.useRef(null);Xe.useOnChange(i,T);const p=o?lEe[o]:void 0;function A(){var x,w;return!((x=t.config)!=null&&x.select)||n!=null&&n.value.__TYPE__?n==null?void 0:n.value.__TYPE__:PF[(w=t.config)==null?void 0:w.select]}function h(){return n?n.value.__TYPE__==="DocumentLink"?n.value.id:n.value.__TYPE__==="ExternalLink"?n.value.url:n.value.name:""}function v(x){if(!x)return r(void 0);switch(o){case"ExternalLink":return r({__TYPE__:"LinkContent",value:{__TYPE__:"ExternalLink",url:x,target:u}});case"DocumentLink":return r({__TYPE__:"LinkContent",value:{__TYPE__:"DocumentLink",id:x}});case"FileLink":case"ImageLink":case void 0:return r(void 0)}}function _(x){a(PF[x]),v("")}function S(x){v(x)}function I(){l(!0)}function T(){var x;c&&(l(!1),(x=f.current)==null||x.reset())}function g(x){const w=x?"_blank":null;s(w),r({__TYPE__:"LinkContent",value:{__TYPE__:"ExternalLink",url:i,target:w}})}function C(x){r(h7({media:x}))}return{contentType:o,selectType:p,fieldValue:i,onValueChange:v,onTypeChange:_,placeholder:Qu(t),isTypeSelectEnabled:!((y=t.config)!=null&&y.select),onDocumentSelected:S,onError:I,errorBoundaryRef:f,isTargetNewTab:u==="_blank",updateWebLinkTarget:g,onMediaSelected:C}}const lEe={DocumentLink:"document",ExternalLink:"web",FileLink:"media",ImageLink:"media"},PF={document:"DocumentLink",web:"ExternalLink",media:"FileLink"};function fEe(e){const t=Te();t.searchDocuments||Bn("searchDocuments");const{coreApiBaseUrl:n,authStrategy:r}=t;return nt.useRequest(A7,[n,r,e]).title}const dEe=lp({id:zo(),title:zo()});function A7(e,t,n){return we.request(new URL(`documents/${n}`,e),{credentials:we.getRequestCredentials(t),okType:dEe})}nt.cache.registerFetcherConfig(A7,{concurrency:50});function h7(e){var i,o,a,u,s,c;const{media:t}=e,n="kind"in t;return n&&t.kind==="image"?{__TYPE__:"LinkContent",value:{__TYPE__:"ImageLink",id:t.id,name:t.filename,url:t.url,kind:t.kind,size:t.size.toString(),height:((i=t.height)==null?void 0:i.toString())??`${Xa}`,width:((o=t.width)==null?void 0:o.toString())??`${Xa}`,date:((a=t.last_modified)==null?void 0:a.toString())??""}}:n?{__TYPE__:"LinkContent",value:{__TYPE__:"FileLink",id:t.id,name:t.filename,kind:t.kind,url:t.url,size:t.size.toString(),date:((u=t.last_modified)==null?void 0:u.toString())??""}}:{__TYPE__:"LinkContent",value:{__TYPE__:"ImageLink",id:t.id,name:(t==null?void 0:t.alt)??t.url,kind:"image",url:t.url,size:"0",height:((s=t.height)==null?void 0:s.toString())??`${Xa}`,width:((c=t.width)==null?void 0:c.toString())??`${Xa}`}}}function m7(e){var J,Z;const{content:t,field:n,id:r,onContentChange:i,readOnly:o=!1,condensedButtons:a=!1}=e,[u,s]=R.useState(!1),[c,l]=R.useState(!1),[f,p]=R.useState(!1),[A,h]=R.useState(!1),{contentType:v,fieldValue:_,errorBoundaryRef:S,onDocumentSelected:I,onError:T,onMediaSelected:g,...C}=cEe({content:t,field:n,onContentChange:i}),y=u||c,x=o||!v,w=v==="DocumentLink"&&_!=="",M=v==="ImageLink"||v==="FileLink",F=v==="ExternalLink"&&$r.toURL(_),K={id:r,contentType:v,onBlur:()=>s(!1),onFocus:()=>{s(!0),v==="DocumentLink"&&p(!0),v==="FileLink"&&h(!0),v==="ImageLink"&&h(!0)},readOnly:x,textType:F||M?"link":"normal",value:_,condensedButtons:a,...C},{searchDocuments:N}=Te();return d.jsxs(d.Fragment,{children:[d.jsxs(m.Popover,{onMouseOverChange:l,open:y,align:"start",sideOffset:-3,openDelay:100,closeDelay:200,focusOnEnter:!1,anchor:d.jsxs(m.Field,{onMouseOverChange:s,children:[d.jsx(m.FieldIcon,{name:"link"}),d.jsx(m.FieldLabel,{htmlFor:r,children:er(n)}),d.jsx(m.FieldControl,{children:w&&N?d.jsx(hEe,{errorBoundaryRef:S,onError:T,fallback:d.jsx(tC,{...K,value:"..."}),renderError:()=>pEe(K),children:d.jsx(AEe,{...K,documentId:_,openDocumentListModal:()=>p(!0)})}):d.jsx(tC,{...K})})]}),children:[F&&d.jsx(m.LinkDescriptionCard,{url:F,title:$r.getUrlTitle(F)??"",subTitle:F.toString()}),(t==null?void 0:t.value.__TYPE__)==="ImageLink"&&d.jsx(m.LinkImageCard,{url:t.value.url,title:t.value.name,subTitle:`${t.value.width} x ${t.value.height} pixels`})]}),d.jsx(RR,{open:A,onOpenChange:h,onMediaSelected:g,assetType:"all"}),d.jsx(f7,{open:f,onOpenChange:p,onSelectDocument:ae=>{p(!1),I(ae)},fixedCustomTypes:new Set((J=n.config)==null?void 0:J.customtypes),fixedTags:new Set((Z=n.config)==null?void 0:Z.tags)})]})}function pEe(e){return d.jsx(tC,{...e,textType:"link"})}function tC(e){const{id:t,onValueChange:n,placeholder:r,readOnly:i,value:o,textType:a,onFocus:u,onBlur:s,contentType:c,isTypeSelectEnabled:l,selectType:f,onTypeChange:p,isTargetNewTab:A,condensedButtons:h,updateWebLinkTarget:v}=e,_=c==="DocumentLink"||c==="ImageLink"||c==="FileLink";return d.jsx(Vu,{id:t,onValueChange:n,placeholder:r,readOnly:i||_,value:o,variant:a,onFocus:u,onBlur:s,cursor:_?"pointer":"text",endAdornment:d.jsx(p7,{hasLink:!!o,onUnlink:()=>n(""),selectEnabled:l,selectedType:f,onValueChange:p,openInNewTab:A,condensedButtons:h,setOpenInNewTab:v})})}function AEe(e){const{id:t,documentId:n,openDocumentListModal:r,onValueChange:i,isTypeSelectEnabled:o,selectType:a,condensedButtons:u,onTypeChange:s}=e,c=fEe(n);return d.jsx(Vu,{id:t,readOnly:!0,value:c,variant:"link",onFocus:r,cursor:"pointer",endAdornment:d.jsx(p7,{hasLink:!0,onUnlink:()=>i(""),selectEnabled:o,selectedType:a,condensedButtons:u,onValueChange:s})})}function hEe(e){const{errorBoundaryRef:t,onError:n,children:r,fallback:i,renderError:o}=e;return d.jsx(m.ErrorBoundary,{ref:t,onError:n,renderError:o,children:d.jsx(R.Suspense,{fallback:i,children:r})})}function mEe(e){const{linkTo:t,onLinkToChange:n}=e;return d.jsx(m7,{content:gEe(t),onContentChange:r=>n(vEe(r)),field:{type:"Link",config:{label:"Link",allowTargetBlank:!0}},condensedButtons:!0})}function gEe(e){return e?{__TYPE__:"LinkContent",value:e}:void 0}function vEe(e){return e?e.value:void 0}function g7(e){var g,C;const{allContentViews:t,content:n,contentView:r,fieldLabel:i,id:o,imageLabel:a,initialImages:u,isUpdating:s,page:c=0,readOnly:l,thumbnailName:f,onClear:p,onContentChange:A,onCropperDialogClose:h,onPageChange:v=()=>{},onMediaDialogOpenChange:_}=e,S=((C=(g=n==null?void 0:n.url)==null?void 0:g.split("?")[0])==null?void 0:C.slice(-4))===".svg",I=n!=null&&n.url&&!l?"visible":"hidden",T=!Ue.isImageContent(n);return d.jsxs(m.Box,{display:"flex",gap:12,padding:{inline:12},children:[d.jsx(m.Box,{children:d.jsx(m.Carousel,{getItemSource:wwe,items:t,onPageChange:v,page:c,buttonSize:"small",renderPrevTooltip:y=>d.jsx(m.Tooltip,{content:"Previous",children:y}),renderNextTooltip:y=>d.jsx(m.Tooltip,{content:"Next",children:y}),style:T?{width:181,height:142}:{width:123,height:93},children:y=>(y==null?void 0:y.url)&&d.jsx(m.CarouselItem,{"aria-label":"Image Field Item",src:Qq(y.url),alt:y.alt??void 0,isUpdating:s,disableAnimation:T},`${f}_${y.url}`)})}),d.jsxs(m.Box,{width:"100%",display:"flex",flexDirection:"column",gap:T?16:12,children:[d.jsx(N$e,{fieldLabel:i,imageLabel:a,initialImages:u,page:c,displaySeparator:!T,isSVGContentView:S,visibility:I,onClear:p,onCropperDialogClose:h,onMediaDialogOpenChange:_}),d.jsx(D$e,{id:o,readOnly:l||!r,altText:(r==null?void 0:r.alt)??"",onValueChange:y=>{r&&A(_we(f,n,r,y))}}),T&&d.jsx(mEe,{linkTo:n.linkTo,onLinkToChange:y=>{A({...n,linkTo:y})}})]})]})}function yEe(e){const{content:t,onContentChange:n,field:r}=e,[i,o]=R.useState(0),[a,u]=R.useTransition(),s=bEe(r),c=s[i],l=t?Swe(r,t):void 0,f=l==null?void 0:l[i];function p(_){if(!c)return;const S=$we(c.name,r,t,_);S!==t&&u(()=>n(S))}function A(_){u(()=>o(_))}function h({option:_,croppedImages:S}){if(o(_),!t)return;const I=Object.entries(S).reduce((T,[g,C])=>j$e({field:r,content:T,thumbnail:g,croppedImage:C}),t);I!==t&&u(()=>n(I))}function v(){o==null||o(0),n(void 0)}return{onCropperDialogClose:h,onPageChange:A,onMediaSelected:p,isUpdating:a,page:i,thumbnail:c,allThumbnails:s,allContentViews:l,contentView:f,onClear:v}}function bEe(e){return R.useMemo(()=>Cwe(e),[e])}function CEe(e){const{content:t,field:n,id:r,onContentChange:i,readOnly:o}=e,a=t&&t.origin.url.length>0,{onCropperDialogClose:u,onPageChange:s,onMediaSelected:c,isUpdating:l,page:f,thumbnail:p,allThumbnails:A,allContentViews:h,contentView:v,onClear:_}=yEe({field:n,content:t,onContentChange:i}),[S,I]=R.useState(!1),T=er(n),g=A.map((x,w)=>{const M=h==null?void 0:h[w];return{thumbnail:x,contentView:M,labels:J1(x,t,M)}}),C=p&&a?J1(p,t,v).filter(to.isDefined):[],y=p&&t&&a&&h;return d.jsx(u7,{isMediaDialogOpen:S,onMediaSelected:c,onMediaDialogOpenChange:I,children:d.jsx(R.Suspense,{fallback:d.jsx("div",{style:{height:95}}),children:y?d.jsx(g7,{allContentViews:h,content:t,contentView:v,fieldLabel:T,id:r,imageLabel:C,initialImages:g,isUpdating:l,page:f,readOnly:o,thumbnailName:p.name,onClear:_,onContentChange:i,onCropperDialogClose:u,onMediaDialogOpenChange:I,onPageChange:s}):d.jsx(i7,{fieldLabel:T,isUpdating:l,readOnly:o,onMediaDialogOpenChange:I})})})}function SEe(e){var _,S;const{searchTerm:t,catalogId:n}=e,r=Te();r.integrationFields||Bn("integrationFields");const{integrationFieldsApiBaseUrl:i,repository:o,authStrategy:a}=r,[u,s]=R.useState(1),[c,l]=R.useState([]),[f,p]=R.useState(""),A=nt.useRequest(_Ee,[i,a,o,n,t,t===f?u:1]);t!==f?(p(t),s(1),l(A.items)):A.items.length>0&&((_=gn.last(c))==null?void 0:_.id)!==((S=gn.last(A.items))==null?void 0:S.id)&&l(I=>I.concat(A.items));const h=u<A.totalPages;function v(){h&&s(I=>I+1)}return{items:c,response:A,fetchNextPage:v,hasNextPage:h}}function _Ee(e,t,n,r,i,o=1,a=30){const u=new URL(`if/search/${r}`,e);return u.searchParams.set("searchTerm",i),u.searchParams.set("limit",a.toString()),u.searchParams.set("page",o.toString()),we.request(u,{headers:{repository:n},credentials:we.getRequestCredentials(t),okType:IEe})}const v7=B.object({id:B.string(),title:B.string(),imageURL:B.string().optional(),description:B.string().optional()}),IEe=B.object({items:B.array(v7),totalPages:B.number(),page:B.number()});function y7(e){const{itemId:t,catalogId:n}=e,r=Te();r.integrationFields||Bn("integrationFields");const{integrationFieldsApiBaseUrl:i,repository:o,authStrategy:a}=r,s=nt.useRequest(TEe,[i,a,o,n,t]).items[0];if(!s)throw new Error("Item not found");return{item:s}}function TEe(e,t,n,r,i){const o=new URL(`if/read/${r}`,e);return o.searchParams.set("ids",[i].toString()),we.request(o,{headers:{repository:n},credentials:we.getRequestCredentials(t),okType:xEe})}const xEe=B.object({items:B.array(v7)});function OR(e){const{item:t,onClick:n,catalogId:r}=e;return d.jsxs(m.PreviewCard,{variant:"large",onClick:n,children:[d.jsx(wEe,{src:t.imageURL??"",alt:t.title}),d.jsxs(m.PreviewContent,{children:[d.jsx(m.Badge,{title:`Catalog: ${r}`,icon:"multipleStop",size:"medium"}),d.jsx(m.Text,{variant:"bold",color:"grey12",sx:{marginTop:4},children:t.title}),d.jsx(m.Text,{variant:"small",color:"grey11",children:t.description??t.id})]})]})}const Nh=76;function wEe(e){const{src:t,alt:n}=e;return t?d.jsx(m.PreviewImage,{src:t,alt:n,width:Nh,height:Nh,framed:!0}):d.jsxs(m.Box,{borderRadius:6,backgroundColor:"grey2",height:Nh,width:Nh,flexDirection:"column",alignItems:"center",justifyContent:"center",border:!0,padding:{inline:4,block:8},children:[d.jsx(m.Icon,{name:"hideImage",size:"large",color:"grey11"}),d.jsx(m.Text,{color:"grey11",variant:"small",noSelect:!0,align:"center",children:"No preview image"})]})}function el(){return d.jsxs(m.PreviewCard,{variant:"large",children:[d.jsx(m.Skeleton,{height:76,width:76}),d.jsxs(m.PreviewContent,{children:[d.jsx(m.Skeleton,{height:24,width:168}),d.jsx(m.Skeleton,{height:24,width:240,sx:{marginTop:4}}),d.jsx(m.Skeleton,{height:16,width:144})]})]})}function $Ee(e){const{open:t,onOpenChange:n,catalogId:r,onSelectItem:i}=e,o=Xe.useDebounceState({initialState:""}),a=Te();return d.jsx(m.Dialog,{open:t,onOpenChange:n,hasClose:!1,size:{width:612,height:724},children:d.jsx(m.DialogContent,{children:d.jsxs(m.Box,{flexDirection:"column",height:"100%",children:[d.jsxs(m.Box,{padding:{top:16,inline:16},flexDirection:"column",gap:8,children:[d.jsx(m.FormSearchInput,{value:o.value,onValueChange:o.set,placeholder:"Search in your catalog"}),d.jsx(m.Text,{variant:"smallBold",color:"grey11",children:"Select an item"})]}),a.integrationFields?d.jsx(m.ErrorBoundary,{renderError:()=>d.jsx(nC,{message:"There was an error while fetching your catalog items."}),children:d.jsx(R.Suspense,{fallback:d.jsxs(m.Box,{flexDirection:"column",gap:12,padding:{top:10,inline:16,bottom:16},children:[d.jsx(el,{}),d.jsx(el,{}),d.jsx(el,{}),d.jsx(el,{}),d.jsx(el,{})]}),children:d.jsx(REe,{searchTerm:o.debouncedValue,catalogId:r,onItemClick:i})})}):d.jsx(nC,{message:"Slice Machine does not yet support mock data for integration field in the simulator."})]})})})}function EEe(e){const{isLoading:t}=e;return d.jsx(m.Toast,{anchor:d.jsx(m.Box,{position:"relative",width:"100%",justifyContent:"center",bottom:72}),loadingIndicator:!0,open:t,title:"Loading more results ...",seconds:1})}function REe(e){const{catalogId:t,searchTerm:n,onItemClick:r}=e,[i,o]=R.useTransition(),{items:a,hasNextPage:u,fetchNextPage:s}=SEe({catalogId:t,searchTerm:n});return d.jsxs(d.Fragment,{children:[d.jsx(m.ScrollArea,{onScrollToBottom:()=>u&&o(s),style:{flexGrow:1,paddingTop:m.theme.space[10],paddingBottom:m.theme.space[16],paddingInline:m.theme.space[16],display:"flex",flexDirection:"column",gap:m.theme.space[12]},threshold:252,children:a.length===0?d.jsx(nC,{}):a.map(c=>d.jsx(OR,{item:c,catalogId:t,onClick:()=>r(c)},c.id))}),d.jsx(EEe,{isLoading:i})]})}function nC(e){const{message:t="We can't find any items matching your search"}=e,n="Oops!";return d.jsx(m.Box,{justifyContent:"center",flexDirection:"column",height:"100%",children:d.jsxs(m.BlankSlate,{children:[d.jsx(m.BlankSlateIcon,{name:"close",lineColor:"purple10",backgroundColor:"purple3",borderColor:"purple6",borderStyle:"dashed",size:"xlarge"}),d.jsx(m.BlankSlateTitle,{size:"big",children:n}),d.jsx(m.BlankSlateDescription,{width:360,children:t})]})})}function OEe(e){const{itemId:t,item:n}=e,r=Te();return t&&n&&n.id===t?d.jsx(tl,{...e,value:n.title}):t&&r.integrationFields?d.jsx(m.ErrorBoundary,{renderError:()=>d.jsx(tl,{...e,value:t}),children:d.jsx(R.Suspense,{fallback:d.jsx(tl,{...e,value:t}),children:d.jsx(kEe,{...e,itemId:t})},t)},t):t&&!r.integrationFields?d.jsx(tl,{...e,value:t}):d.jsx(tl,{...e,value:""})}function FEe(e){const{catalogId:t,itemId:n,item:r}=e,i=Te();return n&&r&&r.id===n?d.jsx(m.FieldFooter,{children:d.jsx(OR,{catalogId:t,item:r})}):n&&i.integrationFields?d.jsx(m.ErrorBoundary,{renderError:()=>null,children:d.jsx(m.FieldFooter,{children:d.jsx(R.Suspense,{fallback:d.jsx(el,{}),children:d.jsx(MEe,{catalogId:t,itemId:n})},n)})},n):null}function MEe(e){const{itemId:t,catalogId:n}=e,{item:r}=y7({catalogId:n,itemId:t});return d.jsx(OR,{catalogId:n,item:r})}function tl(e){const{id:t,field:n,readOnly:r,value:i,onFocus:o,onClearItem:a}=e;return d.jsx(Vu,{id:t,placeholder:Qu(n),readOnly:!0,variant:"link",value:i,...!r&&{cursor:"pointer",onFocus:o},endAdornment:d.jsx(m.Button,{startIcon:"close",color:"grey",size:"small",disabled:!i,onClick:a})})}function kEe(e){const{itemId:t,catalogId:n}=e,{item:r}=y7({catalogId:n,itemId:t});return d.jsx(tl,{...e,value:r.title})}function LEe(e){var A;const{id:t,field:n,content:r,readOnly:i,onContentChange:o}=e,[a,u]=R.useState(!1),[s,c]=R.useState(),l=(A=n.config)==null?void 0:A.catalog;if(!l)return null;function f(h){o({value:h.id,__TYPE__:"IntegrationFieldsContent"}),c(h),u(!1)}function p(){o(void 0),c(void 0)}return d.jsxs(d.Fragment,{children:[d.jsxs(m.Field,{footer:d.jsx(FEe,{catalogId:l,item:s,itemId:r==null?void 0:r.value}),children:[d.jsx(m.FieldIcon,{name:"multipleStop"}),d.jsx(m.FieldLabel,{htmlFor:t,children:er(n)}),d.jsx(m.FieldControl,{children:d.jsx(OEe,{id:t,field:n,readOnly:i,catalogId:l,item:s,itemId:r==null?void 0:r.value,onFocus:()=>u(!0),onClearItem:p})})]}),d.jsx($Ee,{open:a,onOpenChange:u,catalogId:l,onSelectItem:f})]})}function jEe(e){const{content:t,field:n,id:r,onContentChange:i,readOnly:o}=e;return d.jsxs(m.Field,{children:[d.jsx(m.FieldIcon,{name:"notes"}),d.jsx(m.FieldLabel,{htmlFor:r,children:er(n)}),d.jsx(m.FieldControl,{children:d.jsx(m.TextArea,{id:r,placeholder:Qu(n),readOnly:o,paddingLeft:4,paddingRight:12,sx:{flexGrow:1},value:(t==null?void 0:t.value)??"",onChange:a=>{i(UEe(a))}})})]})}function UEe(e){return e.length===0?void 0:{__TYPE__:"FieldContent",type:"Text",value:e}}const BEe=({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 d.jsxs(m.Field,{children:[d.jsx(m.FieldIcon,{name:"pin"}),d.jsx(m.FieldLabel,{htmlFor:n,children:er(t)}),d.jsx(m.FieldControl,{children:d.jsx(m.NumberInput,{id:n,value:a,min:(u=t.config)==null?void 0:u.min,max:(s=t.config)==null?void 0:s.max,padding:e7,placeholder:Qu(t),readOnly:i,onValueChange:c=>r(WEe(c))})})]})};function WEe(e){return e===void 0?void 0:{__TYPE__:"FieldContent",type:"Number",value:String(e)}}function fn(e){this.content=e}fn.prototype={constructor:fn,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 fn(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 fn(n)},addToStart:function(e,t){return new fn([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new fn(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 fn(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=fn.from(e),e.size?new fn(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=fn.from(e),e.size?new fn(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=fn.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}};fn.from=function(e){if(e instanceof fn)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new fn(t)};function b7(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=b7(i.content,o.content,n+1);if(a!=null)return a}n+=i.nodeSize}}function C7(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=C7(a.content,u.content,n-1,r-1);if(c)return c}n-=s,r-=s}}class G{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 G(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 G(r,i)}cutByIndex(t,n){return t==n?G.empty:t==0&&n==this.content.length?this:new G(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 G(i,o)}addToStart(t){return new G([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new G(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 b7(this,t,n)}findDiffEnd(t,n=this.size,r=t.size){return C7(this,t,n,r)}findIndex(t,n=-1){if(t==0)return qh(0,t);if(t==this.size)return qh(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?qh(r+1,a):qh(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 G.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new G(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return G.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 G(n||t,r)}static from(t){if(!t)return G.empty;if(t instanceof G)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new G([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}G.empty=new G([],0);const qb={index:0,offset:0};function qh(e,t){return qb.index=e,qb.offset=t,qb}function Bm(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(!Bm(e[r],t[r]))return!1}else{for(let r in e)if(!(r in t)||!Bm(e[r],t[r]))return!1;for(let r in t)if(!(r in e))return!1}return!0}let gt=class rC{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&&Bm(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 rC.none;if(t instanceof rC)return[t];let n=t.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};gt.none=[];class fp extends Error{}class re{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=_7(this.content,t+this.openStart,n);return r&&new re(r,this.openStart,this.openEnd)}removeBetween(t,n){return new re(S7(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 re.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 re(G.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 re(t,r,i)}}re.empty=new re(G.empty,0,0);function S7(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(S7(o.content,t-i-1,n-i-1)))}function _7(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=_7(a.content,t-o-1,n);return u&&e.replaceChild(i,a.copy(u))}function KEe(e,t,n){if(n.openStart>e.depth)throw new fp("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new fp("Inconsistent open depths");return I7(e,t,n,0)}function I7(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=I7(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 As(a,u.cut(0,e.parentOffset).append(n.content).append(u.cut(t.parentOffset)))}else{let{start:a,end:u}=PEe(n,e);return As(o,x7(e,a,u,t,r))}else return As(o,Wm(e,t,r))}function T7(e,t){if(!t.type.compatibleContent(e.type))throw new fp("Cannot join "+t.type.name+" onto "+e.type.name)}function iC(e,t,n){let r=e.node(n);return T7(r,t.node(n)),r}function ps(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 wd(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&&(ps(e.nodeAfter,r),o++));for(let u=o;u<a;u++)ps(i.child(u),r);t&&t.depth==n&&t.textOffset&&ps(t.nodeBefore,r)}function As(e,t){return e.type.checkContent(t),e.copy(t)}function x7(e,t,n,r,i){let o=e.depth>i&&iC(e,t,i+1),a=r.depth>i&&iC(n,r,i+1),u=[];return wd(null,e,i,u),o&&a&&t.index(i)==n.index(i)?(T7(o,a),ps(As(o,x7(e,t,n,r,i+1)),u)):(o&&ps(As(o,Wm(e,t,i+1)),u),wd(t,n,i,u),a&&ps(As(a,Wm(n,r,i+1)),u)),wd(r,null,i,u),new G(u)}function Wm(e,t,n){let r=[];if(wd(null,e,n,r),e.depth>n){let i=iC(e,t,n+1);ps(As(i,Wm(e,t,n+1)),r)}return wd(t,null,n,r),new G(r)}function PEe(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(G.from(i));return{start:i.resolveNoCache(e.openStart+n),end:i.resolveNoCache(i.content.size-e.openEnd-n)}}class dp{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 gt.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 Km(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 dp(n,r,o)}static resolveCached(t,n){for(let i=0;i<Qb.length;i++){let o=Qb[i];if(o.pos==n&&o.doc==t)return o}let r=Qb[Vb]=dp.resolve(t,n);return Vb=(Vb+1)%DEe,r}}let Qb=[],Vb=0,DEe=12;class Km{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 NEe=Object.create(null);let fl=class oC{constructor(t,n,r,i=gt.none){this.type=t,this.attrs=n,this.marks=i,this.content=r||G.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&&Bm(this.attrs,n||t.defaultAttrs||NEe)&&gt.sameSet(this.marks,r||gt.none)}copy(t=null){return t==this.content?this:new oC(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new oC(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 re.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 re(c,i.depth-a,o.depth-a)}replace(t,n,r){return KEe(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 dp.resolveCached(this,t)}resolveNoCache(t){return dp.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()+")"),w7(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=G.empty,i=0,o=r.childCount){let a=this.contentMatchAt(t).matchFragment(r,i,o),u=a&&a.matchFragment(this.content,n);if(!u||!u.validEnd)return!1;for(let s=i;s<o;s++)if(!this.type.allowsMarks(r.child(s).marks))return!1;return!0}canReplaceWith(t,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(t).matchType(r),a=o&&o.matchFragment(this.content,n);return a?a.validEnd:!1}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content);let t=gt.none;for(let n=0;n<this.marks.length;n++)t=this.marks[n].addToSet(t);if(!gt.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=G.fromJSON(t,n.content);return t.nodeType(n.type).create(n.attrs,i,r)}};fl.prototype.text=void 0;class Pm extends fl{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):w7(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 Pm(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new Pm(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 w7(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class ks{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new qEe(t,n);if(r.next==null)return ks.empty;let i=$7(r);r.next&&r.err("Unexpected trailing text");let o=JEe(GEe(i));return ZEe(o,r),o}matchType(t){for(let n=0;n<this.next.length;n++)if(this.next[n].type==t)return this.next[n].next;return null}matchFragment(t,n=0,r=t.childCount){let i=this;for(let o=n;i&&o<r;o++)i=i.matchType(t.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:n}=this.next[t];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(t){for(let n=0;n<this.next.length;n++)for(let r=0;r<t.next.length;r++)if(this.next[n].type==t.next[r].type)return!0;return!1}fillBefore(t,n=!1,r=0){let i=[this];function o(a,u){let s=a.matchFragment(t,r);if(s&&(!n||s.validEnd))return G.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 p=o(f,u.concat(l));if(p)return p}}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(`
34
+ `)}}ks.empty=new ks(!0);class qEe{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 $7(e){let t=[];do t.push(QEe(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function QEe(e){let t=[];do t.push(VEe(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function VEe(e){let t=YEe(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=zEe(e,t);else break;return t}function DF(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function zEe(e,t){let n=DF(e),r=n;return e.eat(",")&&(e.next!="}"?r=DF(e):r=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function HEe(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 YEe(e){if(e.eat("(")){let t=$7(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=HEe(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 GEe(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 E7(e,t){return t-e}function NF(e,t){let n=[];return r(t),n.sort(E7);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 JEe(e){let t=Object.create(null);return n(NF(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]);NF(e,s).forEach(l=>{c||i.push([u,c=[]]),c.indexOf(l)==-1&&c.push(l)})})});let o=t[r.join(",")]=new ks(r.indexOf(e.length-1)>-1);for(let a=0;a<i.length;a++){let u=i[a][1].sort(E7);o.next.push({type:i[a][0],next:t[u.join(",")]||n(u)})}return o}}function ZEe(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 R7(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 O7(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 F7(e){let t=Object.create(null);if(e)for(let n in e)t[n]=new XEe(e[n]);return t}let qF=class M7{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=F7(r.attrs),this.defaultAttrs=R7(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==ks.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:O7(this.attrs,t)}create(t=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new fl(this,this.computeAttrs(t),G.from(n),gt.setFrom(r))}createChecked(t=null,n,r){return n=G.from(n),this.checkContent(n),new fl(this,this.computeAttrs(t),n,gt.setFrom(r))}createAndFill(t=null,n,r){if(t=this.computeAttrs(t),n=G.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(G.empty,!0);return o?new fl(this,t,n.append(o),gt.setFrom(r)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let r=0;r<t.childCount;r++)if(!this.allowsMarks(t.child(r).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw new RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}allowsMarkType(t){return this.markSet==null||this.markSet.indexOf(t)>-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;n<t.length;n++)if(!this.allowsMarkType(t[n].type))return!1;return!0}allowedMarks(t){if(this.markSet==null)return t;let n;for(let r=0;r<t.length;r++)this.allowsMarkType(t[r].type)?n&&n.push(t[r]):n||(n=t.slice(0,r));return n?n.length?n:gt.none:t}static compile(t,n){let r=Object.create(null);t.forEach((o,a)=>r[o]=new M7(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 XEe{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class FR{constructor(t,n,r,i){this.name=t,this.rank=n,this.schema=r,this.spec=i,this.attrs=F7(i.attrs),this.excluded=null;let o=R7(this.attrs);this.instance=o?new gt(this,o):null}create(t=null){return!t&&this.instance?this.instance:new gt(this,O7(this.attrs,t))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((o,a)=>r[o]=new FR(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 eRe{constructor(t){this.cached=Object.create(null);let n=this.spec={};for(let i in t)n[i]=t[i];n.nodes=fn.from(t.nodes),n.marks=fn.from(t.marks||{}),this.nodes=qF.compile(this.spec.nodes,this),this.marks=FR.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],a=o.spec.content||"",u=o.spec.marks;o.contentMatch=r[a]||(r[a]=ks.parse(a,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.markSet=u=="_"?null:u?QF(this,u.split(" ")):u==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],a=o.spec.excludes;o.excluded=a==null?[o]:a==""?[]:QF(this,a.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,r,i){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof qF){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 Pm(r,r.defaultAttrs,t,gt.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeFromJSON(t){return fl.fromJSON(this,t)}markFromJSON(t){return gt.fromJSON(this,t)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}}function QF(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 pp{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 zF(this,n,!1);return r.addAll(t,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new zF(this,n,!0);return r.addAll(t,n.from,n.to),re.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(rRe(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=HF(a)),a.mark||a.ignore||a.clearMark||(a.mark=i)})}for(let i in t.nodes){let o=t.nodes[i].spec.parseDOM;o&&o.forEach(a=>{r(a=HF(a)),a.node||a.ignore||a.mark||(a.node=i)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new pp(t,pp.schemaRules(t)))}}const k7={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},tRe={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},L7={ol:!0,ul:!0},Dm=1,Nm=2,$d=4;function VF(e,t,n){return t!=null?(t?Dm:0)|(t==="full"?Nm:0):e&&e.whitespace=="pre"?Dm|Nm:n&~$d}class Qh{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=gt.none,this.stashMarks=[],this.match=a||(u&$d?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(G.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&Dm)){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=G.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(G.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):oRe(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&&!k7.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class zF{constructor(t,n,r){this.parser=t,this.options=n,this.isOpen=r,this.open=0;let i=n.topNode,o,a=VF(null,n.preserveWhitespace,0)|(r?$d:0);i?o=new Qh(i.type,i.attrs,gt.none,gt.none,!0,n.topMatch||i.type.contentMatch,a):r?o=new Qh(null,null,gt.none,gt.none,!0,null,a):o=new Qh(t.schema.topNodeType,null,gt.none,gt.none,!0,null,a),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t){if(t.nodeType==3)this.addTextNode(t);else if(t.nodeType==1){let n=t.getAttribute("style");if(!n)this.addElement(t);else{let r=this.readStyles(iRe(n));if(!r)return;let[i,o]=r,a=this.top;for(let u=0;u<o.length;u++)this.removePendingMark(o[u],a);for(let u=0;u<i.length;u++)this.addPendingMark(i[u]);this.addElement(t);for(let u=0;u<i.length;u++)this.removePendingMark(i[u],a);for(let u=0;u<o.length;u++)this.addPendingMark(o[u])}}}addTextNode(t){let n=t.nodeValue,r=this.top;if(r.options&Nm||r.inlineContext(t)||/[^ \t\r\n\u000c]/.test(n)){if(r.options&Dm)r.options&Nm?n=n.replace(/\r\n?/g,`
35
+ `):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;L7.hasOwnProperty(r)&&this.parser.normalizeLists&&nRe(t);let o=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(i=this.parser.matchTag(t,this,n));if(o?o.ignore:tRe.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(k7.hasOwnProperty(r))u.content.length&&u.content[0].isInline&&this.open&&(this.open--,u=this.top),a=!0,u.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t);return}this.addAll(t),a&&this.sync(u),this.needsBlock=s}else this.addElementByRule(t,o,o.consuming===!1?i:void 0)}leafFallback(t){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(`
36
+ `))}ignoreFallback(t){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(t){let n=gt.none,r=gt.none;e:for(let i=0;i<t.length;i+=2)for(let o=void 0;;){let a=this.parser.matchStyle(t[i],t[i+1],this,o);if(!a)continue e;if(a.ignore)return null;if(a.clearMark?this.top.pendingMarks.forEach(u=>{a.clearMark(u)&&(r=u.addToSet(r))}):n=this.parser.schema.marks[a.mark].create(a.attrs).addToSet(n),a.consuming===!1)o=a;else break}return[n,r]}addElementByRule(t,n,r){let i,o,a;n.node?(o=this.parser.schema.nodes[n.node],o.isLeaf?this.insertNode(o.create(n.attrs))||this.leafFallback(t):i=this.enter(o,n.attrs||null,n.preserveWhitespace)):(a=this.parser.schema.marks[n.mark].create(n.attrs),this.addPendingMark(a));let u=this.top;if(o&&o.isLeaf)this.findInside(t);else if(r)this.addElement(t,r);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(s=>this.insertNode(s));else{let s=t;typeof n.contentElement=="string"?s=t.querySelector(n.contentElement):typeof n.contentElement=="function"?s=n.contentElement(t):n.contentElement&&(s=n.contentElement),this.findAround(t,s,!0),this.addAll(s)}i&&this.sync(u)&&this.open--,a&&this.removePendingMark(a,u)}addAll(t,n,r){let i=n||0;for(let o=n?t.childNodes[n]:t.firstChild,a=r==null?null:t.childNodes[r];o!=a;o=o.nextSibling,++i)this.findAtPoint(t,i),this.addDOM(o);this.findAtPoint(t,i)}findPlace(t){let n,r;for(let i=this.open;i>=0;i--){let o=this.nodes[i],a=o.findWrapping(t);if(a&&(!n||n.length>a.length)&&(n=a,r=o,!a.length)||o.solid)break}if(!n)return!1;this.sync(r);for(let i=0;i<n.length;i++)this.enterInner(n[i],null,!1);return!0}insertNode(t){if(t.isInline&&this.needsBlock&&!this.top.type){let n=this.textblockFromContext();n&&this.enterInner(n)}if(this.findPlace(t)){this.closeExtra();let n=this.top;n.applyPending(t.type),n.match&&(n.match=n.match.matchType(t.type));let r=n.activeMarks;for(let i=0;i<t.marks.length;i++)(!n.type||n.type.allowsMarkType(t.marks[i].type))&&(r=t.marks[i].addToSet(r));return n.content.push(t.mark(r)),!0}return!1}enter(t,n,r){let i=this.findPlace(t.create(n));return i&&this.enterInner(t,n,!0,r),i}enterInner(t,n=null,r=!1,i){this.closeExtra();let o=this.top;o.applyPending(t),o.match=o.match&&o.match.matchType(t);let a=VF(t,i,o.options);o.options&$d&&o.content.length==0&&(a|=$d),this.nodes.push(new Qh(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=aRe(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 nRe(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let r=t.nodeType==1?t.nodeName.toLowerCase():null;r&&L7.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):r=="li"?n=t:r&&(n=null)}}function rRe(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function iRe(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 HF(e){let t={};for(let n in e)t[n]=e[n];return t}function oRe(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 aRe(e,t){for(let n=0;n<t.length;n++)if(e.eq(t[n]))return t[n]}class as{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},r){r||(r=zb(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}=as.renderSpec(zb(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&&as.renderSpec(zb(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:p,contentDOM:A}=as.renderSpec(t,f,r);if(u.appendChild(p),A){if(a)throw new RangeError("Multiple content holes");a=A}}}return{dom:u,contentDOM:a}}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new as(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=YF(t.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(t){return YF(t.marks)}}function YF(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function zb(e){return e.document||window.document}const j7=65535,U7=Math.pow(2,16);function uRe(e,t){return e+t*U7}function GF(e){return e&j7}function sRe(e){return(e-(e&j7))/U7}const B7=1,W7=2,em=4,K7=8;let aC=class{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&K7)>0}get deletedBefore(){return(this.delInfo&(B7|em))>0}get deletedAfter(){return(this.delInfo&(W7|em))>0}get deletedAcross(){return(this.delInfo&em)>0}},Ml=class nl{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&nl.empty)return nl.empty}recover(t){let n=0,r=GF(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+sRe(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 p=c?t==s?-1:t==f?1:n:n,A=s+i+(p<0?0:l);if(r)return A;let h=t==(n<0?s:f)?null:uRe(u/3,t-s),v=t==s?W7:t==f?B7:em;return(n<0?t!=s:t!=f)&&(v|=K7),new aC(A,v,h)}i+=l-c}return r?t+i:new aC(t+i,0,null)}touches(t,n){let r=0,i=GF(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 nl(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?nl.empty:new nl(t<0?[0,-t,0]:[0,0,t])}};Ml.empty=new Ml([]);class Ed{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 Ed(this.maps,this.mirror,t,n)}copy(){return new Ed(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 Ed;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 aC(t,i,null)}}const Hb=Object.create(null);let yr=class{getMap(){return Ml.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Hb[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 Hb)throw new RangeError("Duplicate use of step JSON ID "+t);return Hb[t]=n,n.prototype.jsonID=t,n}},ir=class bd{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new bd(t,null)}static fail(t){return new bd(null,t)}static fromReplace(t,n,r,i){try{return bd.ok(t.replace(n,r,i))}catch(o){if(o instanceof fp)return bd.fail(o.message);throw o}}};function MR(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(MR(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return G.fromArray(r)}let P7=class Cd extends yr{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 re(MR(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 ir.fromReplace(t,this.from,this.to,o)}invert(){return new D7(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 Cd(n.pos,r.pos,this.mark)}merge(t){return t instanceof Cd&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Cd(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 Cd(n.from,n.to,t.markFromJSON(n.mark))}};yr.jsonID("addMark",P7);let D7=class Sd extends yr{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 re(MR(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),n.openStart,n.openEnd);return ir.fromReplace(t,this.from,this.to,r)}invert(){return new P7(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 Sd(n.pos,r.pos,this.mark)}merge(t){return t instanceof Sd&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Sd(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 Sd(n.from,n.to,t.markFromJSON(n.mark))}};yr.jsonID("removeMark",D7);let N7=class _d extends yr{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return ir.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return ir.fromReplace(t,this.pos,this.pos+1,new re(G.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 _d(this.pos,n.marks[i]);return new _d(this.pos,this.mark)}}return new q7(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new _d(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 _d(n.pos,t.markFromJSON(n.mark))}};yr.jsonID("addNodeMark",N7);let q7=class uC extends yr{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return ir.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return ir.fromReplace(t,this.pos,this.pos+1,new re(G.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new N7(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new uC(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 uC(n.pos,t.markFromJSON(n.mark))}};yr.jsonID("removeNodeMark",q7);let Ch=class es extends yr{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&sC(t,this.from,this.to)?ir.fail("Structure replace would overwrite content"):ir.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new Ml([this.from,this.to-this.from,this.slice.size])}invert(t){return new es(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 es(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof es)||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?re.empty:new re(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new es(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?re.empty:new re(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new es(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 es(n.from,n.to,re.fromJSON(t,n.slice),!!n.structure)}};yr.jsonID("replace",Ch);let ra=class tm extends yr{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&&(sC(t,this.from,this.gapFrom)||sC(t,this.gapTo,this.to)))return ir.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return ir.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?ir.fromReplace(t,this.from,this.to,r):ir.fail("Content does not fit in gap")}getMap(){return new Ml([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 tm(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 tm(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 tm(n.from,n.to,n.gapFrom,n.gapTo,re.fromJSON(t,n.slice),n.insert,!!n.structure)}};yr.jsonID("replaceAround",ra);function sC(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 cRe(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Sh(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||!cRe(i,o,a))break}return null}function Q7(e,t,n=null,r=e){let i=lRe(e,t),o=i&&fRe(r,t);return o?i.map(JF).concat({type:t,attrs:n}).concat(o.map(JF)):null}function JF(e){return{type:e,attrs:null}}function lRe(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 fRe(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 V7(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),p=i.index(c);if(f.type.spec.isolating)return!1;let A=f.content.cutByIndex(p,f.childCount),h=r&&r[l+1];h&&(A=A.replaceChild(0,h.type.create(h.attrs)));let v=r&&r[l]||f;if(!f.canReplace(p+1,f.childCount)||!v.type.validContent(A))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 _h(e,t){let n=e.resolve(t),r=n.index();return z7(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function z7(e,t){return!!(e&&t&&!e.isLeaf&&e.canAppend(t))}function H7(e,t,n=-1){let r=e.resolve(t);for(let i=r.depth;;i--){let o,a,u=r.index(i);if(i==r.depth?(o=r.nodeBefore,a=r.nodeAfter):n>0?(o=r.node(i+1),u++,a=r.node(i).maybeChild(u)):(o=r.node(i).maybeChild(u-1),a=r.node(i+1)),o&&!o.isTextblock&&z7(o,a)&&r.node(i).canReplace(u,u+1))return t;if(i==0)break;t=n<0?r.before(i):r.after(i)}}function dRe(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 kR(e,t,n=t,r=re.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return pRe(i,o,r)?new Ch(t,n,r):new ARe(i,o,r).fit()}function pRe(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class ARe{constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=G.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=G.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 re(o,a,u);return t>-1?new ra(r.pos,t,this.$to.pos,this.$to.end(),s,n):s.size||r.pos!=this.$to.pos?new Ch(r.pos,i.pos,s):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<t;r++){let o=n.firstChild;if(n.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){t=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?t:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=Yb(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let a=i.firstChild;for(let u=this.depth;u>=0;u--){let{type:s,match:c}=this.frontier[u],l,f=null;if(n==1&&(a?c.matchType(a.type)||(f=c.fillBefore(G.from(a),!1)):o&&s.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:u,parent:o,inject:f};if(n==2&&a&&(l=c.findWrapping(a.type)))return{sliceDepth:r,frontierDepth:u,parent:o,wrap:l};if(o&&c.matchType(o.type))break}}}openMore(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=Yb(t,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new re(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=Yb(t,n);if(i.childCount<=1&&n>0){let o=t.size-n<=n+i.size;this.unplaced=new re(Id(t,n-1,1),n-1,o?n-1:r)}else this.unplaced=new re(Id(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:p}=this.frontier[n];if(i){for(let v=0;v<i.childCount;v++)l.push(i.child(v));f=f.matchFragment(i)}let A=u.size+t-(a.content.size-a.openEnd);for(;c<u.childCount;){let v=u.child(c),_=f.matchType(v.type);if(!_)break;c++,(c>1||s==0||v.content.size)&&(f=_,l.push(Y7(v.mark(p.allowedMarks(v.marks)),c==1?s:0,c==u.childCount?A:-1)))}let h=c==u.childCount;h||(A=-1),this.placed=Td(this.placed,n,G.from(l)),this.frontier[n].match=f,h&&A<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let v=0,_=u;v<A;v++){let S=_.lastChild;this.frontier.push({type:S.type,match:S.contentMatchAt(S.childCount)}),_=S.content}this.unplaced=h?t==0?re.empty:new re(Id(a.content,t-1,1),t-1,A<0?a.openEnd:t-1):new re(Id(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||!Gb(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=Gb(t,n,i,r,o);if(a){for(let u=n-1;u>=0;u--){let{match:s,type:c}=this.frontier[u],l=Gb(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=Td(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=Td(this.placed,this.depth,G.from(t.create(n,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(G.empty,!0);n.childCount&&(this.placed=Td(this.placed,this.frontier.length,n))}}function Id(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Id(e.firstChild.content,t-1,n)))}function Td(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Td(e.lastChild.content,t-1,n)))}function Yb(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function Y7(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,Y7(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(G.empty,!0)))),e.copy(r)}function Gb(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&&!hRe(n,o.content,a)?u:null}function hRe(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}let mRe=class nm extends yr{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 ir.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 ir.fromReplace(t,this.pos,this.pos+1,new re(G.from(i),0,n.isLeaf?0:1))}getMap(){return Ml.empty}invert(t){return new nm(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 nm(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 nm(n.pos,n.attr,n.value)}};yr.jsonID("attr",mRe);let Ap=class extends Error{};Ap=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};Ap.prototype=Object.create(Error.prototype);Ap.prototype.constructor=Ap;Ap.prototype.name="TransformError";const Jb=Object.create(null);class Qe{constructor(t,n,r){this.$anchor=t,this.$head=n,this.ranges=r||[new gRe(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=re.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?re.empty:n),u==0&&eM(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),eM(t,r,n.isInline?-1:1))}}static findFrom(t,n,r=!1){let i=t.parent.inlineContent?new Ke(t):rl(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?rl(t.node(0),t.node(o),t.before(o+1),t.index(o),n,r):rl(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 Ti(t.node(0))}static atStart(t){return rl(t,t,0,0,1)||new Ti(t)}static atEnd(t){return rl(t,t,t.content.size,t.childCount,-1)||new Ti(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Jb[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 Jb)throw new RangeError("Duplicate use of selection JSON ID "+t);return Jb[t]=n,n.prototype.jsonID=t,n}getBookmark(){return Ke.between(this.$anchor,this.$head).getBookmark()}}Qe.prototype.visible=!0;class gRe{constructor(t,n){this.$from=t,this.$to=n}}let ZF=!1;function XF(e){!ZF&&!e.parent.inlineContent&&(ZF=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class Ke extends Qe{constructor(t,n=t){XF(t),XF(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 Qe.near(r);let i=t.resolve(n.map(this.anchor));return new Ke(i.parent.inlineContent?i:r,r)}replace(t,n=re.empty){if(super.replace(t,n),n==re.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof Ke&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new D0(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 Ke(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=Qe.findFrom(n,r,!0)||Qe.findFrom(n,-r,!0);if(o)n=o.$head;else return Qe.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(Qe.findFrom(t,-r,!0)||Qe.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new Ke(t,n)}}Qe.jsonID("text",Ke);class D0{constructor(t,n){this.anchor=t,this.head=n}map(t){return new D0(t.map(this.anchor),t.map(this.head))}resolve(t){return Ke.between(t.resolve(this.anchor),t.resolve(this.head))}}class me extends Qe{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?Qe.near(o):new me(o)}content(){return new re(G.from(this.node),0,0)}eq(t){return t instanceof me&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new LR(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new me(t.resolve(n.anchor))}static create(t,n){return new me(t.resolve(n))}static isSelectable(t){return!t.isText&&t.type.spec.selectable!==!1}}me.prototype.visible=!1;Qe.jsonID("node",me);class LR{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new D0(r,r):new LR(r)}resolve(t){let n=t.resolve(this.anchor),r=n.nodeAfter;return r&&me.isSelectable(r)?new me(n):Qe.near(n)}}class Ti extends Qe{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,n=re.empty){if(n==re.empty){t.delete(0,t.doc.content.size);let r=Qe.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(t){return new Ti(t)}map(t){return new Ti(t)}eq(t){return t instanceof Ti}getBookmark(){return vRe}}Qe.jsonID("all",Ti);const vRe={map(){return this},resolve(e){return new Ti(e)}};function rl(e,t,n,r,i,o=!1){if(t.inlineContent)return Ke.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&&me.isSelectable(u))return me.create(e,n-(i<0?u.nodeSize:0))}else{let s=rl(e,u,n+i,i<0?u.childCount:0,i,o);if(s)return s}n+=u.nodeSize*i}return null}function eM(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof Ch||i instanceof ra))return;let o=e.mapping.maps[r],a;o.forEach((u,s,c,l)=>{a==null&&(a=l)}),e.setSelection(Qe.near(e.doc.resolve(a),n))}function tM(e,t){return!t||!e?e:e.bind(t)}class Vh{constructor(t,n,r){this.name=t,this.init=tM(n.init,r),this.apply=tM(n.apply,r)}}new Vh("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new Vh("selection",{init(e,t){return e.selection||Qe.atStart(t.doc)},apply(e){return e.selection}}),new Vh("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new Vh("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}});function G7(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r=="handleDOMEvents"&&(i=G7(i,t,{})),n[r]=i}return n}class Nr{constructor(t){this.spec=t,this.props={},t.props&&G7(t.props,this,this.props),this.key=t.key?t.key.key:J7("plugin")}getState(t){return t[this.key]}}const Zb=Object.create(null);function J7(e){return e in Zb?e+"$"+ ++Zb[e]:(Zb[e]=0,e+"$")}class Gi{constructor(t="key"){this.key=J7(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const Uc=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},Z7=function(e,t,n,r){return n&&(nM(e,t,n,r,-1)||nM(e,t,n,r,1))},yRe=/^(img|br|input|textarea|hr)$/i;function nM(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:qm(e))){let o=e.parentNode;if(!o||o.nodeType!=1||jR(e)||yRe.test(e.nodeName)||e.contentEditable=="false")return!1;t=Uc(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?qm(e):0}else return!1}}function qm(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function bRe(e,t,n){for(let r=t==0,i=t==qm(e);r||i;){if(e==n)return!0;let o=Uc(e);if(e=e.parentNode,!e)return!1;r=r&&o==0,i=i&&o==qm(e)}}function jR(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 X7=function(e){return e.focusNode&&Z7(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function e8(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}const lo=typeof navigator<"u"?navigator:null,rM=typeof document<"u"?document:null,zu=lo&&lo.userAgent||"",cC=/Edge\/(\d+)/.exec(zu),t8=/MSIE \d/.exec(zu),lC=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(zu),Ih=!!(t8||lC||cC),n8=t8?document.documentMode:lC?+lC[1]:cC?+cC[1]:0,N0=!Ih&&/gecko\/(\d+)/i.test(zu);N0&&+(/Firefox\/(\d+)/.exec(zu)||[0,0])[1];const fC=!Ih&&/Chrome\/(\d+)/.exec(zu),Bc=!!fC,CRe=fC?+fC[1]:0,Wc=!Ih&&!!lo&&/Apple Computer/.test(lo.vendor),UR=Wc&&(/Mobile\/\w+/.test(zu)||!!lo&&lo.maxTouchPoints>2),Hr=UR||(lo?/Mac/.test(lo.platform):!1),SRe=lo?/Win/.test(lo.platform):!1,Th=/Android \d/.test(zu),BR=!!rM&&"webkitFontSmoothing"in rM.documentElement.style,_Re=BR?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function IRe(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),o=i&&i.size==0,a=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(a<0)return null;let u=r.resolve(a),s,c;if(X7(n)){for(s=u;i&&!i.node;)i=i.parent;let l=i.node;if(i&&l.isAtom&&me.isSelectable(l)&&i.parent&&!(l.isInline&&bRe(n.focusNode,n.focusOffset,i.dom))){let f=i.posBefore;c=new me(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=i8(e,s,u,l)}return c}function r8(e){return e.editable?e.hasFocus():$Re(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function WR(e,t=!1){let n=e.state.selection;if(wRe(e,n),!!r8(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&Bc){let r=e.domSelectionRange(),i=e.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&Z7(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)xRe(e);else{let{anchor:r,head:i}=n,o,a;iM&&!(n instanceof Ke)&&(n.$from.parent.inlineContent||(o=oM(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(a=oM(e,n.to))),e.docView.setSelection(r,i,e.root,t),iM&&(o&&aM(o),a&&aM(a)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&TRe(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const iM=Wc||Bc&&CRe<63;function oM(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(Wc&&i&&i.contentEditable=="false")return Xb(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return Xb(i);if(o)return Xb(o)}}function Xb(e){return e.contentEditable="true",Wc&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function aM(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function TRe(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!r8(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function xRe(e){let t=e.domSelection(),n=document.createRange(),r=e.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setEnd(r.parentNode,Uc(r)+1):n.setEnd(r,0),n.collapse(!1),t.removeAllRanges(),t.addRange(n),!i&&!e.state.selection.visible&&Ih&&n8<=11&&(r.disabled=!0,r.disabled=!1)}function wRe(e,t){if(t instanceof me){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(uM(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else uM(e)}function uM(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function i8(e,t,n,r){return e.someProp("createSelectionBetween",i=>i(e,t,n))||Ke.between(t,n,r)}function $Re(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function dC(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&&Qe.findFrom(o,t)}function Ha(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function sM(e,t,n){let r=e.state.selection;if(r instanceof Ke)if(n.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let a=e.state.doc.resolve(i.pos+o.nodeSize*(t<0?-1:1));return Ha(e,new Ke(r.$anchor,a))}else if(r.empty){if(e.endOfTextblock(t>0?"forward":"backward")){let i=dC(e.state,t);return i&&i instanceof me?Ha(e,i):!1}else if(!(Hr&&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?me.isSelectable(o)?Ha(e,new me(t<0?e.state.doc.resolve(i.pos-o.nodeSize):i)):BR?Ha(e,new Ke(e.state.doc.resolve(t<0?u:u+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof me&&r.node.isInline)return Ha(e,new Ke(t>0?r.$to:r.$from));{let i=dC(e.state,t);return i?Ha(e,i):!1}}}function Qm(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Rd(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!="BR")}function Gc(e,t){return t<0?ERe(e):RRe(e)}function ERe(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,a=!1;for(N0&&n.nodeType==1&&r<Qm(n)&&Rd(n.childNodes[r],-1)&&(a=!0);;)if(r>0){if(n.nodeType!=1)break;{let u=n.childNodes[r-1];if(Rd(u,-1))i=n,o=--r;else if(u.nodeType==3)n=u,r=n.nodeValue.length;else break}}else{if(o8(n))break;{let u=n.previousSibling;for(;u&&Rd(u,-1);)i=n.parentNode,o=Uc(u),u=u.previousSibling;if(u)n=u,r=Qm(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}a?pC(e,n,r):i&&pC(e,i,o)}function RRe(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=Qm(n),o,a;for(;;)if(r<i){if(n.nodeType!=1)break;let u=n.childNodes[r];if(Rd(u,1))o=n,a=++r;else break}else{if(o8(n))break;{let u=n.nextSibling;for(;u&&Rd(u,1);)o=u.parentNode,a=Uc(u)+1,u=u.nextSibling;if(u)n=u,r=0,i=Qm(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}}o&&pC(e,o,a)}function o8(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function ORe(e,t){for(;e&&t==e.childNodes.length&&!jR(e);)t=Uc(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;e=n,t=0}}function FRe(e,t){for(;e&&!t&&!jR(e);)t=Uc(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;e=n,t=e.childNodes.length}}function pC(e,t,n){if(t.nodeType!=3){let o,a;(a=ORe(t,n))?(t=a,n=0):(o=FRe(t,n))&&(t=o,n=o.nodeValue.length)}let r=e.domSelection();if(X7(r)){let o=document.createRange();o.setEnd(t,n),o.setStart(t,n),r.removeAllRanges(),r.addRange(o)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&WR(e)},50)}function cM(e,t){let n=e.state.doc.resolve(t);if(!(Bc||SRe)&&n.parent.inlineContent){let i=e.coordsAtPos(t);if(t>n.start()){let o=e.coordsAtPos(t-1),a=(o.top+o.bottom)/2;if(a>i.top&&a<i.bottom&&Math.abs(o.left-i.left)>1)return o.left<i.left?"ltr":"rtl"}if(t<n.end()){let o=e.coordsAtPos(t+1),a=(o.top+o.bottom)/2;if(a>i.top&&a<i.bottom&&Math.abs(o.left-i.left)>1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function lM(e,t,n){let r=e.state.selection;if(r instanceof Ke&&!r.empty||n.indexOf("s")>-1||Hr&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let a=dC(e.state,t);if(a&&a instanceof me)return Ha(e,a)}if(!i.parent.inlineContent){let a=t<0?i:o,u=r instanceof Ti?Qe.near(a,t):Qe.findFrom(a,t);return u?Ha(e,u):!1}return!1}function fM(e,t){if(!(e.state.selection instanceof Ke))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 dM(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function MRe(e){if(!Wc||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable=="false"){let r=t.firstChild;dM(e,r,"true"),setTimeout(()=>dM(e,r,"false"),20)}return!1}function kRe(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function LRe(e,t){let n=t.keyCode,r=kRe(t);if(n==8||Hr&&n==72&&r=="c")return fM(e,-1)||Gc(e,-1);if(n==46&&!t.shiftKey||Hr&&n==68&&r=="c")return fM(e,1)||Gc(e,1);if(n==13||n==27)return!0;if(n==37||Hr&&n==66&&r=="c"){let i=n==37?cM(e,e.state.selection.from)=="ltr"?-1:1:-1;return sM(e,i,r)||Gc(e,i)}else if(n==39||Hr&&n==70&&r=="c"){let i=n==39?cM(e,e.state.selection.from)=="ltr"?1:-1:1;return sM(e,i,r)||Gc(e,i)}else{if(n==38||Hr&&n==80&&r=="c")return lM(e,-1,r)||Gc(e,-1);if(n==40||Hr&&n==78&&r=="c")return MRe(e)||lM(e,1,r)||Gc(e,1);if(r==(Hr?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function a8(e,t){e.someProp("transformCopied",A=>{t=A(t,e)});let n=[],{content:r,openStart:i,openEnd:o}=t;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let A=r.firstChild;n.push(A.type.name,A.attrs!=A.type.defaultAttrs?A.attrs:null),r=A.content}let a=e.someProp("clipboardSerializer")||as.fromSchema(e.state.schema),u=d8(),s=u.createElement("div");s.appendChild(a.serializeFragment(r,{document:u}));let c=s.firstChild,l,f=0;for(;c&&c.nodeType==1&&(l=f8[c.nodeName.toLowerCase()]);){for(let A=l.length-1;A>=0;A--){let h=u.createElement(l[A]);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 p=e.someProp("clipboardTextSerializer",A=>A(t,e))||t.content.textBetween(0,t.content.size,`
37
37
 
38
38
  `);return{dom:s,text:p}}function u8(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",p=>{t=p(t,o||r,e)}),o)return t?new re(G.from(e.state.schema.text(t.replace(/\r\n?/g,`
39
- `))),0,0):re.empty;let f=e.someProp("clipboardTextParser",p=>p(t,i,r,e));if(f)u=f;else{let p=i.marks(),{schema:A}=e.state,h=as.fromSchema(A);a=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(v=>{let _=a.appendChild(document.createElement("p"));v&&_.appendChild(h.serializeNode(A.text(v,p)))})}}else e.someProp("transformPastedHTML",f=>{n=f(n,e)}),a=jRe(n),BR&&URe(a);let c=a&&a.querySelector("[data-pm-slice]"),l=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(l&&l[3])for(let f=+l[3];f>0;f--){let p=a.firstChild;for(;p&&p.nodeType!=1;)p=p.nextSibling;if(!p)break;a=p}if(u||(u=(e.someProp("clipboardParser")||e.someProp("domParser")||pp.fromSchema(e.state.schema)).parseSlice(a,{preserveWhitespace:!!(s||l),context:i,ruleFromNode(p){return p.nodeName=="BR"&&!p.nextSibling&&p.parentNode&&!kRe.test(p.parentNode.nodeName)?{ignore:!0}:null}})),l)u=BRe(pM(u,+l[1],+l[2]),l[4]);else if(u=re.maxOpen(LRe(u.content,i),!0),u.openStart||u.openEnd){let f=0,p=0;for(let A=u.content.firstChild;f<u.openStart&&!A.type.spec.isolating;f++,A=A.firstChild);for(let A=u.content.lastChild;p<u.openEnd&&!A.type.spec.isolating;p++,A=A.lastChild);u=pM(u,f,p)}return e.someProp("transformPasted",f=>{u=f(u,e)}),u}const kRe=/^(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 LRe(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&&c8(s,o,u,a[a.length-1],0))a[a.length-1]=c;else{a.length&&(a[a.length-1]=l8(a[a.length-1],o.length));let l=s8(u,s);a.push(l),i=i.matchType(l.type),o=s}}),a)return G.from(a)}return e}function s8(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,G.from(e));return e}function c8(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let o=c8(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(G.from(s8(n,e,i+1))))}}function l8(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,l8(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(G.empty,!0);return e.copy(n.append(r))}function AC(e,t,n,r,i,o){let a=t<0?e.firstChild:e.lastChild,u=a.content;return e.childCount>1&&(o=0),i<r-1&&(u=AC(u,t,n,r,i+1,o)),i>=n&&(u=t<0?a.contentMatchAt(0).fillBefore(u,o<=i).append(u):u.append(a.contentMatchAt(a.childCount).fillBefore(G.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,a.copy(u))}function pM(e,t,n){return t<e.openStart&&(e=new re(AC(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new re(AC(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const f8={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 AM=null;function d8(){return AM||(AM=document.implementation.createHTMLDocument("title"))}function jRe(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=d8().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&f8[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 URe(e){let t=e.querySelectorAll(Bc?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}function BRe(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=G.from(s.create(r[u+1],i)),o++,a++}return new re(i,o,a)}const Ji={},Rr={};function eu(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}Rr.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!A8(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Th&&Bc&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),UR&&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,e8(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",r=>r(e,n))||MRe(e,n)?n.preventDefault():eu(e,"key")};Rr.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)};Rr.keypress=(e,t)=>{let n=t;if(A8(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Hr&&n.metaKey)return;if(e.someProp("handleKeyPress",i=>i(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof Ke)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode);!/[\r\n]/.test(i)&&!e.someProp("handleTextInput",o=>o(e,r.$from.pos,r.$to.pos,i))&&e.dispatch(e.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}};function q0(e){return{left:e.clientX,top:e.clientY}}function WRe(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function KR(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 dl(e,t,n){e.focused||e.focus();let r=e.state.tr.setSelection(t);n=="pointer"&&r.setMeta("pointer",!0),e.dispatch(r)}function KRe(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&me.isSelectable(r)?(dl(e,new me(n),"pointer"),!0):!1}function PRe(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof me&&(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(me.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?(dl(e,me.create(e.state.doc,i),"pointer"),!0):!1}function DRe(e,t,n,r,i){return KR(e,"handleClickOn",t,n,r)||e.someProp("handleClick",o=>o(e,t,r))||(i?PRe(e,n):KRe(e,n))}function NRe(e,t,n,r){return KR(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",i=>i(e,t,r))}function qRe(e,t,n,r){return KR(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",i=>i(e,t,r))||QRe(e,n,r)}function QRe(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?(dl(e,Ke.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)dl(e,Ke.create(r,u+1,u+1+a.content.size),"pointer");else if(me.isSelectable(a))dl(e,me.create(r,u),"pointer");else continue;return!0}}function PR(e){return Vm(e)}const p8=Hr?"metaKey":"ctrlKey";Ji.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=PR(e),i=Date.now(),o="singleClick";i-e.input.lastClick.time<500&&WRe(n,e.input.lastClick)&&!n[p8]&&(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(q0(n));a&&(o=="singleClick"?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new VRe(e,a,n,!!r)):(o=="doubleClick"?NRe:qRe)(e,a.pos,a.inside,n)?n.preventDefault():eu(e,"pointer"))};class VRe{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[p8],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 me&&c.from<=a&&c.to>a)&&(this.mightDrag={node:o,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&N0&&!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)),eu(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(()=>WR(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(q0(t))),this.updateAllowDefault(t),this.allowDefault||!n?eu(this.view,"pointer"):DRe(this.view,n.pos,n.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||Wc&&this.mightDrag&&!this.mightDrag.node.isAtom||Bc&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(dl(this.view,Qe.near(this.view.state.doc.resolve(n.pos)),"pointer"),t.preventDefault()):eu(this.view,"pointer")}move(t){this.updateAllowDefault(t),eu(this.view,"pointer"),t.buttons==0&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}Ji.touchstart=e=>{e.input.lastTouch=Date.now(),PR(e),eu(e,"pointer")};Ji.touchmove=e=>{e.input.lastTouch=Date.now(),eu(e,"pointer")};Ji.contextmenu=e=>PR(e);function A8(e,t){return e.composing?!0:Wc&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const zRe=Th?5e3:-1;Rr.compositionstart=Rr.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(),Vm(e,!0),e.markCursor=null;else if(Vm(e),N0&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=e.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let a=o<0?i.lastChild:i.childNodes[o-1];if(!a)break;if(a.nodeType==3){e.domSelection().collapse(a,a.nodeValue.length);break}else i=a,o=-1}}e.input.composing=!0}h8(e,zRe)};Rr.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,h8(e,20))};function h8(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Vm(e),t))}function HRe(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=YRe());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function YRe(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function Vm(e,t=!1){if(!(Th&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),HRe(e),t||e.docView&&e.docView.dirty){let n=SRe(e);return n&&!n.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(n)):e.updateState(e.state),!0}return!1}}function GRe(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 hp=Ih&&n8<15||UR&&CRe<604;Ji.copy=Rr.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type=="cut";if(r.empty)return;let o=hp?null:n.clipboardData,a=r.content(),{dom:u,text:s}=a8(e,a);o?(n.preventDefault(),o.clearData(),o.setData("text/html",u.innerHTML),o.setData("text/plain",s)):GRe(e,u),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function JRe(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function ZRe(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?hC(e,r.value,null,i,t):hC(e,r.textContent,r.innerHTML,i,t)},50)}function hC(e,t,n,r,i){let o=u8(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",s=>s(e,i,o||re.empty)))return!0;if(!o)return!1;let a=JRe(o),u=a?e.state.tr.replaceSelectionWith(a,r):e.state.tr.replaceSelection(o);return e.dispatch(u.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function m8(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Rr.paste=(e,t)=>{let n=t;if(e.composing&&!Th)return;let r=hp?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&hC(e,m8(r),r.getData("text/html"),i,n)?n.preventDefault():ZRe(e,n)};class XRe{constructor(t,n,r){this.slice=t,this.move=n,this.node=r}}const g8=Hr?"altKey":"ctrlKey";Ji.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(q0(n)),a;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof me?i.to-1:i.to))){if(r&&r.mightDrag)a=me.create(e.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let l=e.docView.nearestDesc(n.target,!0);l&&l.node.type.spec.draggable&&l!=e.docView&&(a=me.create(e.state.doc,l.posBefore))}}let u=(a||e.state.selection).content(),{dom:s,text:c}=a8(e,u);n.dataTransfer.clearData(),n.dataTransfer.setData(hp?"Text":"text/html",s.innerHTML),n.dataTransfer.effectAllowed="copyMove",hp||n.dataTransfer.setData("text/plain",c),e.dragging=new XRe(u,!n[g8],a)};Ji.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)};Rr.dragover=Rr.dragenter=(e,t)=>t.preventDefault();Rr.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let i=e.posAtCoords(q0(n));if(!i)return;let o=e.state.doc.resolve(i.pos),a=r&&r.slice;a?e.someProp("transformPasted",h=>{a=h(a,e)}):a=u8(e,m8(n.dataTransfer),hp?null:n.dataTransfer.getData("text/html"),!1,o);let u=!!(r&&!n[g8]);if(e.someProp("handleDrop",h=>h(e,n,a||re.empty,u))){n.preventDefault();return}if(!a)return;n.preventDefault();let s=a?lRe(e.state.doc,o.pos,a):o.pos;s==null&&(s=o.pos);let c=e.state.tr;if(u){let{node:h}=r;h?h.replace(c):c.deleteSelection()}let l=c.mapping.map(s),f=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,p=c.doc;if(f?c.replaceRangeWith(l,l,a.content.firstChild):c.replaceRange(l,l,a),c.doc.eq(p))return;let A=c.doc.resolve(l);if(f&&me.isSelectable(a.content.firstChild)&&A.nodeAfter&&A.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new me(A));else{let h=c.mapping.map(s);c.mapping.maps[c.mapping.maps.length-1].forEach((v,_,S,I)=>h=I),c.setSelection(i8(e,A,c.doc.resolve(h)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))};Ji.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&WR(e)},20))};Ji.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)};Ji.beforeinput=(e,t)=>{if(Bc&&Th&&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,e8(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 Rr)Ji[e]=Rr[e];function mp(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 zm{constructor(t,n){this.toDOM=t,this.spec=n||hs,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 Si(o-r,o-r,this)}valid(){return!0}eq(t){return this==t||t instanceof zm&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&mp(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class ru{constructor(t,n){this.attrs=t,this.spec=n||hs}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 Si(o,a,this)}valid(t,n){return n.from<n.to}eq(t){return this==t||t instanceof ru&&mp(this.attrs,t.attrs)&&mp(this.spec,t.spec)}static is(t){return t.type instanceof ru}destroy(){}}let eOe=class v8{constructor(t,n){this.attrs=t,this.spec=n||hs}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 Si(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 v8&&mp(this.attrs,t.attrs)&&mp(this.spec,t.spec)}destroy(){}};class Si{constructor(t,n,r){this.from=t,this.to=n,this.type=r}copy(t,n){return new Si(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 Si(t,t,new zm(n,r))}static inline(t,n,r,i){return new Si(t,n,new ru(r,i))}static node(t,n,r,i){return new Si(t,n,new eOe(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof ru}get widget(){return this.type instanceof zm}}const il=[],hs={};class Vt{constructor(t,n){this.local=t.length?t:il,this.children=n.length?n:il}static create(t,n){return n.length?Hm(n,t,0,hs):Nn}find(t,n,r){let i=[];return this.findInner(t??0,n??1e9,i,0,r),i}findInner(t,n,r,i,o){for(let a=0;a<this.local.length;a++){let u=this.local[a];u.from<=n&&u.to>=t&&(!o||o(u.spec))&&r.push(u.copy(u.from+i,u.to+i))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<n&&this.children[a+1]>t){let u=this.children[a]+1;this.children[a+2].findInner(t-u,n-u,r,i+u,o)}}map(t,n,r){return this==Nn||t.maps.length==0?this:this.mapInner(t,n,0,0,r||hs)}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?tOe(this.children,a||[],t,n,r,i,o):a?new Vt(a.sort(ms),il):Nn}add(t,n){return n.length?this==Nn?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=b8(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,Hm(l,u,c+1,hs)),o+=3}});let a=y8(o?C8(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(ms):this.local,i||this.children)}remove(t){return t.length==0||this==Nn?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!=Nn?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):Nn}forChild(t,n){if(this==Nn)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 ru){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(ms),il);return r?new rs([u,r]):u}return r||Nn}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 DR(this.localsInner(t))}localsInner(t){if(this==Nn)return il;if(t.inlineContent||!this.local.some(ru.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof ru||n.push(this.local[r]);return n}}Vt.empty=new Vt([],[]);Vt.removeOverlap=DR;const Nn=Vt.empty;class rs{constructor(t){this.members=t}map(t,n){const r=this.members.map(i=>i.map(t,n,hs));return rs.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!=Nn&&(o instanceof rs?r=r.concat(o.members):r.push(o))}return rs.from(r)}eq(t){if(!(t instanceof rs)||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?DR(r?n:n.sort(ms)):il}static from(t){switch(t.length){case 0:return Nn;case 1:return t[0];default:return new rs(t.every(n=>n instanceof Vt)?t:t.reduce((n,r)=>n.concat(r instanceof Vt?r:r.members),[]))}}}function tOe(e,t,n,r,i,o,a){let u=e.slice();for(let c=0,l=o;c<n.maps.length;c++){let f=0;n.maps[c].forEach((p,A,h,v)=>{let _=v-h-(A-p);for(let S=0;S<u.length;S+=3){let I=u[S+1];if(I<0||p>I+l-f)continue;let T=u[S]+l-f;A>=T?u[S+1]=p<=T?-2:-1:p>=l&&_&&(u[S]+=_,u[S+1]+=_)}f+=_}),l=n.maps[c].map(l,-1)}let s=!1;for(let c=0;c<u.length;c+=3)if(u[c+1]<0){if(u[c+1]==-2){s=!0,u[c+1]=-1;continue}let l=n.map(e[c]+o),f=l-i;if(f<0||f>=r.content.size){s=!0;continue}let p=n.map(e[c+1]+o,-1),A=p-i,{index:h,offset:v}=r.content.findIndex(f),_=r.maybeChild(h);if(_&&v==f&&v+_.nodeSize==A){let S=u[c+2].mapInner(n,_,l+1,e[c]+o+1,a);S!=Nn?(u[c]=f,u[c+1]=A,u[c+2]=S):(u[c+1]=-2,s=!0)}else s=!0}if(s){let c=nOe(u,e,t,n,i,o,a),l=Hm(c,r,0,a);t=l.local;for(let f=0;f<u.length;f+=3)u[f+1]<0&&(u.splice(f,3),f-=3);for(let f=0,p=0;f<l.children.length;f+=3){let A=l.children[f];for(;p<u.length&&u[p]<A;)p+=3;u.splice(p,0,l.children[f],l.children[f+1],l.children[f+2])}}return new Vt(t.sort(ms),u)}function y8(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 Si(i.from+t,i.to+t,i.type))}return n}function nOe(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 b8(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 C8(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function Hm(e,t,n,r){let i=[],o=!1;t.forEach((u,s)=>{let c=b8(e,u,s+n);if(c){o=!0;let l=Hm(c,u,n+s+1,r);l!=Nn&&i.push(s,s+u.nodeSize,l)}});let a=y8(o?C8(e):e,-n).sort(ms);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):Nn}function ms(e,t){return e.from-t.from||e.to-t.to}function DR(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),hM(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),hM(t,i,r.copy(o.from,r.to)));break}}}return t}function hM(e,t,n){for(;t<e.length&&ms(n,e[t])>0;)t++;e.splice(t,0,n)}var pu={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Ym={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},rOe=typeof navigator<"u"&&/Mac/.test(navigator.platform),iOe=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var pn=0;pn<10;pn++)pu[48+pn]=pu[96+pn]=String(pn);for(var pn=1;pn<=24;pn++)pu[pn+111]="F"+pn;for(var pn=65;pn<=90;pn++)pu[pn]=String.fromCharCode(pn+32),Ym[pn]=String.fromCharCode(pn);for(var e1 in pu)Ym.hasOwnProperty(e1)||(Ym[e1]=pu[e1]);function oOe(e){var t=rOe&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||iOe&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?Ym:pu)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const aOe=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function uOe(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))aOe?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 sOe(e){let t=Object.create(null);for(let n in e)t[uOe(n)]=e[n];return t}function t1(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function cOe(e){return new Nr({props:{handleKeyDown:lOe(e)}})}function lOe(e){let t=sOe(e);return function(n,r){let i=oOe(r),o,a=t[t1(i,r)];if(a&&a(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let u=t[t1(i,r,!1)];if(u&&u(n.state,n.dispatch,n))return!0}if((r.shiftKey||r.altKey||r.metaKey||i.charCodeAt(0)>127)&&(o=pu[r.keyCode])&&o!=i){let u=t[t1(o,r)];if(u&&u(n.state,n.dispatch,n))return!0}}return!1}}const S8=65535,_8=Math.pow(2,16);function fOe(e,t){return e+t*_8}function mM(e){return e&S8}function dOe(e){return(e-(e&S8))/_8}const I8=1,T8=2,rm=4,x8=8;class gM{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&x8)>0}get deletedBefore(){return(this.delInfo&(I8|rm))>0}get deletedAfter(){return(this.delInfo&(T8|rm))>0}get deletedAcross(){return(this.delInfo&rm)>0}}class Tr{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&Tr.empty)return Tr.empty}recover(t){let n=0,r=mM(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+dOe(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 p=c?t==s?-1:t==f?1:n:n,A=s+i+(p<0?0:l);if(r)return A;let h=t==(n<0?s:f)?null:fOe(u/3,t-s),v=t==s?T8:t==f?I8:rm;return(n<0?t!=s:t!=f)&&(v|=x8),new gM(A,v,h)}i+=l-c}return r?t+i:new gM(t+i,0,null)}touches(t,n){let r=0,i=mM(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 Tr(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?Tr.empty:new Tr(t<0?[0,-t,0]:[0,0,t])}}Tr.empty=new Tr([]);const n1=Object.create(null);class Wn{getMap(){return Tr.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=n1[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 n1)throw new RangeError("Duplicate use of step JSON ID "+t);return n1[t]=n,n.prototype.jsonID=t,n}}class Dt{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new Dt(t,null)}static fail(t){return new Dt(null,t)}static fromReplace(t,n,r,i){try{return Dt.ok(t.replace(n,r,i))}catch(o){if(o instanceof fp)return Dt.fail(o.message);throw o}}}function NR(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(NR(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return G.fromArray(r)}class us extends Wn{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 re(NR(n.content,(a,u)=>!a.isAtom||!u.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),i),n.openStart,n.openEnd);return Dt.fromReplace(t,this.from,this.to,o)}invert(){return new ss(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 us(n.pos,r.pos,this.mark)}merge(t){return t instanceof us&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new us(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 us(n.from,n.to,t.markFromJSON(n.mark))}}Wn.jsonID("addMark",us);class ss extends Wn{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 re(NR(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),n.openStart,n.openEnd);return Dt.fromReplace(t,this.from,this.to,r)}invert(){return new us(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 ss(n.pos,r.pos,this.mark)}merge(t){return t instanceof ss&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new ss(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 ss(n.from,n.to,t.markFromJSON(n.mark))}}Wn.jsonID("removeMark",ss);class cs extends Wn{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Dt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Dt.fromReplace(t,this.pos,this.pos+1,new re(G.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 cs(this.pos,n.marks[i]);return new cs(this.pos,this.mark)}}return new gp(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new cs(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 cs(n.pos,t.markFromJSON(n.mark))}}Wn.jsonID("addNodeMark",cs);class gp extends Wn{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Dt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Dt.fromReplace(t,this.pos,this.pos+1,new re(G.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new cs(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new gp(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 gp(n.pos,t.markFromJSON(n.mark))}}Wn.jsonID("removeNodeMark",gp);class Qo extends Wn{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&mC(t,this.from,this.to)?Dt.fail("Structure replace would overwrite content"):Dt.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new Tr([this.from,this.to-this.from,this.slice.size])}invert(t){return new Qo(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 Qo(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof Qo)||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?re.empty:new re(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new Qo(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?re.empty:new re(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new Qo(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 Qo(n.from,n.to,re.fromJSON(t,n.slice),!!n.structure)}}Wn.jsonID("replace",Qo);class pl extends Wn{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&&(mC(t,this.from,this.gapFrom)||mC(t,this.gapTo,this.to)))return Dt.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Dt.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Dt.fromReplace(t,this.from,this.to,r):Dt.fail("Content does not fit in gap")}getMap(){return new Tr([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 pl(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 pl(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 pl(n.from,n.to,n.gapFrom,n.gapTo,re.fromJSON(t,n.slice),n.insert,!!n.structure)}}Wn.jsonID("replaceAround",pl);function mC(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 pOe(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function AOe(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||!pOe(i,o,a))break}return null}function hOe(e,t,n=null,r=e){let i=mOe(e,t),o=i&&gOe(r,t);return o?i.map(vM).concat({type:t,attrs:n}).concat(o.map(vM)):null}function vM(e){return{type:e,attrs:null}}function mOe(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 gOe(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 im(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),p=i.index(c);if(f.type.spec.isolating)return!1;let A=f.content.cutByIndex(p,f.childCount),h=r&&r[l+1];h&&(A=A.replaceChild(0,h.type.create(h.attrs)));let v=r&&r[l]||f;if(!f.canReplace(p+1,f.childCount)||!v.type.validContent(A))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 qR(e,t){let n=e.resolve(t),r=n.index();return w8(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function w8(e,t){return!!(e&&t&&!e.isLeaf&&e.canAppend(t))}function $8(e,t,n=-1){let r=e.resolve(t);for(let i=r.depth;;i--){let o,a,u=r.index(i);if(i==r.depth?(o=r.nodeBefore,a=r.nodeAfter):n>0?(o=r.node(i+1),u++,a=r.node(i).maybeChild(u)):(o=r.node(i).maybeChild(u-1),a=r.node(i+1)),o&&!o.isTextblock&&w8(o,a)&&r.node(i).canReplace(u,u+1))return t;if(i==0)break;t=n<0?r.before(i):r.after(i)}}class Od extends Wn{constructor(t,n,r){super(),this.pos=t,this.attr=n,this.value=r}apply(t){let n=t.nodeAt(this.pos);if(!n)return Dt.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return Dt.fromReplace(t,this.pos,this.pos+1,new re(G.from(i),0,n.isLeaf?0:1))}getMap(){return Tr.empty}invert(t){return new Od(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 Od(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 Od(n.pos,n.attr,n.value)}}Wn.jsonID("attr",Od);class Gm extends Wn{constructor(t,n){super(),this.attr=t,this.value=n}apply(t){let n=Object.create(null);for(let i in t.attrs)n[i]=t.attrs[i];n[this.attr]=this.value;let r=t.type.create(n,t.content,t.marks);return Dt.ok(r)}getMap(){return Tr.empty}invert(t){return new Gm(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Gm(n.attr,n.value)}}Wn.jsonID("docAttr",Gm);let vp=class extends Error{};vp=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};vp.prototype=Object.create(Error.prototype);vp.prototype.constructor=vp;vp.prototype.name="TransformError";const vOe=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function E8(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}const yOe=(e,t,n)=>{let r=E8(e,n);if(!r)return!1;let i=QR(r);if(!i){let a=r.blockRange(),u=a&&Sh(a);return u==null?!1:(t&&t(e.tr.lift(a,u).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&M8(e,i,t))return!0;if(r.parent.content.size==0&&(kl(o,"end")||me.isSelectable(o))){let a=kR(e.doc,r.before(),r.after(),re.empty);if(a&&a.slice.size<a.to-a.from){if(t){let u=e.tr.step(a);u.setSelection(kl(o,"end")?Qe.findFrom(u.doc.resolve(u.mapping.map(i.pos,-1)),-1):me.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},bOe=(e,t,n)=>{let r=E8(e,n);if(!r)return!1;let i=QR(r);return i?R8(e,i,t):!1},COe=(e,t,n)=>{let r=O8(e,n);if(!r)return!1;let i=VR(r);return i?R8(e,i,t):!1};function R8(e,t,n){let r=t.nodeBefore,i=r,o=t.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return!1;let l=i.lastChild;if(!l)return!1;i=l}let a=t.nodeAfter,u=a,s=t.pos+1;for(;!u.isTextblock;s++){if(u.type.spec.isolating)return!1;let l=u.firstChild;if(!l)return!1;u=l}let c=kR(e.doc,o,s,re.empty);if(!c||c.from!=o||c instanceof Ch&&c.slice.size>=s-o)return!1;if(n){let l=e.tr.step(c);l.setSelection(Ke.create(l.doc,o)),n(l.scrollIntoView())}return!0}function kl(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 SOe=(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=QR(r)}let a=o&&o.nodeBefore;return!a||!me.isSelectable(a)?!1:(t&&t(e.tr.setSelection(me.create(e.doc,o.pos-a.nodeSize)).scrollIntoView()),!0)};function QR(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function O8(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}const _Oe=(e,t,n)=>{let r=O8(e,n);if(!r)return!1;let i=VR(r);if(!i)return!1;let o=i.nodeAfter;if(M8(e,i,t))return!0;if(r.parent.content.size==0&&(kl(o,"start")||me.isSelectable(o))){let a=kR(e.doc,r.before(),r.after(),re.empty);if(a&&a.slice.size<a.to-a.from){if(t){let u=e.tr.step(a);u.setSelection(kl(o,"start")?Qe.findFrom(u.doc.resolve(u.mapping.map(i.pos)),1):me.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},IOe=(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=VR(r)}let a=o&&o.nodeAfter;return!a||!me.isSelectable(a)?!1:(t&&t(e.tr.setSelection(me.create(e.doc,o.pos)).scrollIntoView()),!0)};function VR(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 TOe=(e,t)=>{let n=e.selection,r=n instanceof me,i;if(r){if(n.node.isTextblock||!_h(e.doc,n.from))return!1;i=n.from}else if(i=H7(e.doc,n.from,-1),i==null)return!1;if(t){let o=e.tr.join(i);r&&o.setSelection(me.create(o.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(o.scrollIntoView())}return!0},xOe=(e,t)=>{let n=e.selection,r;if(n instanceof me){if(n.node.isTextblock||!_h(e.doc,n.to))return!1;r=n.to}else if(r=H7(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},wOe=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),o=i&&Sh(i);return o==null?!1:(t&&t(e.tr.lift(i,o).scrollIntoView()),!0)},$Oe=(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 F8(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 EOe=(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=F8(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(Qe.near(s.doc.resolve(u),1)),t(s.scrollIntoView())}return!0},ROe=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof Ti||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=F8(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(Ke.create(u.doc,a+1)),t(u.scrollIntoView())}return!0},OOe=(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(V7(e.doc,o))return t&&t(e.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Sh(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)},FOe=(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(me.create(e.doc,i))),!0)};function MOe(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||_h(e.doc,t.pos))?!1:(n&&n(e.tr.clearIncompatible(t.pos,r.type,r.contentMatchAt(r.childCount)).join(t.pos).scrollIntoView()),!0)}function M8(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,o,a;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(MOe(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,p=G.empty;for(let v=o.length-1;v>=0;v--)p=G.from(o[v].create(null,p));p=G.from(r.copy(p));let A=e.tr.step(new ra(t.pos-1,f,t.pos,f,new re(p,1,0),o.length,!0)),h=f+2*o.length;_h(A.doc,h)&&A.join(h),n(A.scrollIntoView())}return!0}let s=Qe.findFrom(t,1),c=s&&s.$from.blockRange(s.$to),l=c&&Sh(c);if(l!=null&&l>=t.depth)return n&&n(e.tr.lift(c,l).scrollIntoView()),!0;if(u&&kl(i,"start",!0)&&kl(r,"end")){let f=r,p=[];for(;p.push(f),!f.isTextblock;)f=f.lastChild;let A=i,h=1;for(;!A.isTextblock;A=A.firstChild)h++;if(f.canReplace(f.childCount,f.childCount,A.content)){if(n){let v=G.empty;for(let S=p.length-1;S>=0;S--)v=G.from(p[S].copy(v));let _=e.tr.step(new ra(t.pos-p.length,t.pos+i.nodeSize,t.pos+h,t.pos+i.nodeSize-h,new re(v,p.length,0),0,!0));n(_.scrollIntoView())}return!0}}return!1}function k8(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(Ke.create(t.doc,e<0?i.start(o):i.end(o)))),!0):!1}}const kOe=k8(-1),LOe=k8(1);function jOe(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,a=i.blockRange(o),u=a&&Q7(a,e,t);return u?(r&&r(n.tr.wrap(a,u).scrollIntoView()),!0):!1}}function yM(e,t=null){return function(n,r){let i=!1;for(let o=0;o<n.selection.ranges.length&&!i;o++){let{$from:{pos:a},$to:{pos:u}}=n.selection.ranges[o];n.doc.nodesBetween(a,u,(s,c)=>{if(i)return!1;if(!(!s.isTextblock||s.hasMarkup(e,t)))if(s.type==e)i=!0;else{let l=n.doc.resolve(c),f=l.index();i=l.parent.canReplaceWith(f,f+1,e)}})}if(!i)return!1;if(r){let o=n.tr;for(let a=0;a<n.selection.ranges.length;a++){let{$from:{pos:u},$to:{pos:s}}=n.selection.ranges[a];o.setBlockType(u,s,e,t)}r(o.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function UOe(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 Km(l,l,a.depth),a.endIndex<a.parent.childCount&&(a=new Km(i,n.doc.resolve(o.end(a.depth)),a.depth)),u=!0}let c=Q7(s,e,t,a);return c?(r&&r(BOe(n.tr,a,c,u,e).scrollIntoView()),!0):!1}}function BOe(e,t,n,r,i){let o=G.empty;for(let l=n.length-1;l>=0;l--)o=G.from(n[l].type.create(n[l].attrs,o));e.step(new ra(t.start-(r?2:0),t.end,t.start,t.end,new re(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,p=!0;l<f;l++,p=!1)!p&&V7(e.doc,s,u)&&(e.split(s,u),s+=2*u),s+=c.child(l).nodeSize;return e}function WOe(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?KOe(t,n,e,o):POe(t,n,o):!0:!1}}function KOe(e,t,n,r){let i=e.tr,o=r.end,a=r.$to.end(r.depth);o<a&&(i.step(new ra(o-1,a,o,a,new re(G.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Km(i.doc.resolve(r.$from.pos),i.doc.resolve(a),r.depth));const u=Sh(r);if(u==null)return!1;i.lift(r,u);let s=i.mapping.map(o,-1)-1;return _h(i.doc,s)&&i.join(s),t(i.scrollIntoView()),!0}function POe(e,t,n){let r=e.tr,i=n.parent;for(let A=n.end,h=n.endIndex-1,v=n.startIndex;h>v;h--)A-=i.child(h).nodeSize,r.delete(A-1,A+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?G.empty:G.from(i))))return!1;let f=o.pos,p=f+a.nodeSize;return r.step(new ra(f-(u?1:0),p+(s?1:0),f+1,p-1,new re((u?G.empty:G.from(i.copy(G.empty))).append(s?G.empty:G.from(i.copy(G.empty))),u?0:1,s?0:1),u?0:1)),t(r.scrollIntoView()),!0}function DOe(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=G.from(c?e.create():null),f=new re(G.from(e.create(null,G.from(u.type.create(null,l)))),c?3:1,0),p=o.start,A=o.end;n(t.tr.step(new ra(p-(c?3:1),A,p,A,f,1,!0)).scrollIntoView())}return!0}}function Q0(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),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 zR{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(p=>p===!0)),f={...Object.fromEntries(Object.entries(r).map(([p,A])=>[p,(...v)=>{const _=this.buildProps(c,n),S=A(...v)(_);return u.push(S),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,u={tr:t,editor:i,view:a,state:Q0({state:o,transaction:t}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(t,n),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(r).map(([s,c])=>[s,(...l)=>c(...l)(u)]))}};return u}}function oe(e,t,n){return e.config[t]===void 0&&e.parent?oe(e.parent,t,n):typeof e.config[t]=="function"?e.config[t].bind({...n,parent:e.parent?oe(e.parent,t,n):null}):e.config[t]}function V0(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 L8(e){const t=[],{nodeExtensions:n,markExtensions:r}=V0(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=oe(a,"addGlobalAttributes",u);if(!s)return;s().forEach(l=>{l.types.forEach(f=>{Object.entries(l.attributes).forEach(([p,A])=>{t.push({type:f,name:p,attribute:{...o,...A}})})})})}),i.forEach(a=>{const u={name:a.name,options:a.options,storage:a.storage},s=oe(a,"addAttributes",u);if(!s)return;const c=s();Object.entries(c).forEach(([l,f])=>{const p={...o,...f};typeof(p==null?void 0:p.default)=="function"&&(p.default=p.default()),p!=null&&p.isRequired&&(p==null?void 0:p.default)===void 0&&delete p.default,t.push({type:a.name,name:l,attribute:p})})}),t}function yn(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 St(...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}if(i==="class"){const u=o?o.split(" "):[],s=r[i]?r[i].split(" "):[],c=u.filter(l=>!s.includes(l));r[i]=[...s,...c].join(" ")}else i==="style"?r[i]=[r[i],o].join("; "):r[i]=o}),r},{})}function gC(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)=>St(n,r),{})}function NOe(e){return typeof e=="function"}function Me(e,t=void 0,...n){return NOe(e)?t?e.bind(t)(...n):e(...n):e}function qOe(e={}){return Object.keys(e).length===0&&e.constructor===Object}function QOe(e){return typeof e!="string"?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e==="true"?!0:e==="false"?!1:e}function bM(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):QOe(n.getAttribute(a.name));return u==null?o:{...o,[a.name]:u}},{});return{...r,...i}}}}function CM(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>t==="attrs"&&qOe(n)?!1:n!=null))}function j8(e,t){var n;const r=L8(e),{nodeExtensions:i,markExtensions:o}=V0(e),a=(n=i.find(c=>oe(c,"topNode")))===null||n===void 0?void 0:n.name,u=Object.fromEntries(i.map(c=>{const l=r.filter(S=>S.type===c.name),f={name:c.name,options:c.options,storage:c.storage,editor:t},p=e.reduce((S,I)=>{const T=oe(I,"extendNodeSchema",f);return{...S,...T?T(c):{}}},{}),A=CM({...p,content:Me(oe(c,"content",f)),marks:Me(oe(c,"marks",f)),group:Me(oe(c,"group",f)),inline:Me(oe(c,"inline",f)),atom:Me(oe(c,"atom",f)),selectable:Me(oe(c,"selectable",f)),draggable:Me(oe(c,"draggable",f)),code:Me(oe(c,"code",f)),defining:Me(oe(c,"defining",f)),isolating:Me(oe(c,"isolating",f)),attrs:Object.fromEntries(l.map(S=>{var I;return[S.name,{default:(I=S==null?void 0:S.attribute)===null||I===void 0?void 0:I.default}]}))}),h=Me(oe(c,"parseHTML",f));h&&(A.parseDOM=h.map(S=>bM(S,l)));const v=oe(c,"renderHTML",f);v&&(A.toDOM=S=>v({node:S,HTMLAttributes:gC(S,l)}));const _=oe(c,"renderText",f);return _&&(A.toText=_),[c.name,A]})),s=Object.fromEntries(o.map(c=>{const l=r.filter(_=>_.type===c.name),f={name:c.name,options:c.options,storage:c.storage,editor:t},p=e.reduce((_,S)=>{const I=oe(S,"extendMarkSchema",f);return{..._,...I?I(c):{}}},{}),A=CM({...p,inclusive:Me(oe(c,"inclusive",f)),excludes:Me(oe(c,"excludes",f)),group:Me(oe(c,"group",f)),spanning:Me(oe(c,"spanning",f)),code:Me(oe(c,"code",f)),attrs:Object.fromEntries(l.map(_=>{var S;return[_.name,{default:(S=_==null?void 0:_.attribute)===null||S===void 0?void 0:S.default}]}))}),h=Me(oe(c,"parseHTML",f));h&&(A.parseDOM=h.map(_=>bM(_,l)));const v=oe(c,"renderHTML",f);return v&&(A.toDOM=_=>v({mark:_,HTMLAttributes:gC(_,l)})),[c.name,A]}));return new ZEe({topNode:a,nodes:u,marks:s})}function r1(e,t){return t.nodes[e]||t.marks[e]||null}function SM(e,t){return Array.isArray(t)?t.some(n=>(typeof n=="string"?n:n.name)===e.name):t}const VOe=(e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(i,o,a,u)=>{var s,c;const l=((c=(s=i.type.spec).toText)===null||c===void 0?void 0:c.call(s,{node:i,pos:o,parent:a,index:u}))||i.textContent||"%leaf%";n+=l.slice(0,Math.max(0,r-o))}),n};function HR(e){return Object.prototype.toString.call(e)==="[object RegExp]"}class YR{constructor(t){this.find=t.find,this.handler=t.handler}}const zOe=(e,t)=>{if(HR(t))return t.exec(e);const n=t(e);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function zh(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(p=>p.type.spec.code))return!1;let l=!1;const f=VOe(c)+o;return a.forEach(p=>{if(l)return;const A=zOe(f,p.find);if(!A)return;const h=s.state.tr,v=Q0({state:s.state,transaction:h}),_={from:r-(A[0].length-o.length),to:i},{commands:S,chain:I,can:T}=new zR({editor:n,state:v});p.handler({state:v,range:_,match:A,commands:S,chain:I,can:T})===null||!h.steps.length||(h.setMeta(u,{transform:h,from:r,to:i,text:o}),s.dispatch(h),l=!0)}),l}function HOe(e){const{editor:t,rules:n}=e,r=new Nr({state:{init(){return null},apply(i,o){const a=i.getMeta(r);if(a)return a;const u=i.getMeta("applyInputRules");return!!u&&setTimeout(()=>{const{from:c,text:l}=u,f=c+l.length;zh({editor:t,from:c,to:f,text:l,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:o}},props:{handleTextInput(i,o,a,u){return zh({editor:t,from:o,to:a,text:u,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&zh({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?zh({editor:t,from:a.pos,to:a.pos,text:`
41
- `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function YOe(e){return typeof e=="number"}class GOe{constructor(t){this.find=t.find,this.handler=t.handler}}const JOe=(e,t,n)=>{if(HR(t))return[...e.matchAll(t)];const r=t(e,n);return r?r.map(i=>{const o=[i.text];return o.index=i.index,o.input=e,o.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(i.replaceWith)),o}):[]};function ZOe(e){const{editor:t,state:n,from:r,to:i,rule:o,pasteEvent:a,dropEvent:u}=e,{commands:s,chain:c,can:l}=new zR({editor:t,state:n}),f=[];return n.doc.nodesBetween(r,i,(A,h)=>{if(!A.isTextblock||A.type.spec.code)return;const v=Math.max(r,h),_=Math.min(i,h+A.content.size),S=A.textBetween(v-h,_-h,void 0,"");JOe(S,o.find,a).forEach(T=>{if(T.index===void 0)return;const g=v+T.index+1,C=g+T[0].length,y={from:n.tr.mapping.map(g),to:n.tr.mapping.map(C)},x=o.handler({state:n,range:y,match:T,commands:s,chain:c,can:l,pasteEvent:a,dropEvent:u});f.push(x)})}),f.every(A=>A!==null)}const XOe=e=>{var t;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(t=n.clipboardData)===null||t===void 0||t.setData("text/html",e),n};function eFe(e){const{editor:t,rules:n}=e;let r=null,i=!1,o=!1,a=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,u=typeof DragEvent<"u"?new DragEvent("drop"):null;const s=({state:l,from:f,to:p,rule:A,pasteEvt:h})=>{const v=l.tr,_=Q0({state:l,transaction:v});if(!(!ZOe({editor:t,state:_,from:Math.max(f-1,0),to:p.b-1,rule:A,pasteEvent:h,dropEvent:u})||!v.steps.length))return u=typeof DragEvent<"u"?new DragEvent("drop"):null,a=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,v};return n.map(l=>new Nr({view(f){const p=A=>{var h;r=!((h=f.dom.parentElement)===null||h===void 0)&&h.contains(A.target)?f.dom.parentElement:null};return window.addEventListener("dragstart",p),{destroy(){window.removeEventListener("dragstart",p)}}},props:{handleDOMEvents:{drop:(f,p)=>(o=r===f.dom.parentElement,u=p,!1),paste:(f,p)=>{var A;const h=(A=p.clipboardData)===null||A===void 0?void 0:A.getData("text/html");return a=p,i=!!(h!=null&&h.includes("data-pm-slice")),!1}}},appendTransaction:(f,p,A)=>{const h=f[0],v=h.getMeta("uiEvent")==="paste"&&!i,_=h.getMeta("uiEvent")==="drop"&&!o,S=h.getMeta("applyPasteRules"),I=!!S;if(!v&&!_&&!I)return;if(I){const{from:C,text:y}=S,x=C+y.length,w=XOe(y);return s({rule:l,state:A,from:C,to:{b:x},pasteEvt:w})}const T=p.doc.content.findDiffStart(A.doc.content),g=p.doc.content.findDiffEnd(A.doc.content);if(!(!YOe(T)||!g||T===g.b))return s({rule:l,state:A,from:T,to:g,pasteEvt:a})}}))}function tFe(e){const t=e.filter((n,r)=>e.indexOf(n)!==r);return[...new Set(t)]}class sl{constructor(t,n){this.splittableMarks=[],this.editor=n,this.extensions=sl.resolve(t),this.schema=j8(this.extensions,n),this.extensions.forEach(r=>{var i;this.editor.extensionStorage[r.name]=r.storage;const o={name:r.name,options:r.options,storage:r.storage,editor:this.editor,type:r1(r.name,this.schema)};r.type==="mark"&&(!((i=Me(oe(r,"keepOnSplit",o)))!==null&&i!==void 0)||i)&&this.splittableMarks.push(r.name);const a=oe(r,"onBeforeCreate",o);a&&this.editor.on("beforeCreate",a);const u=oe(r,"onCreate",o);u&&this.editor.on("create",u);const s=oe(r,"onUpdate",o);s&&this.editor.on("update",s);const c=oe(r,"onSelectionUpdate",o);c&&this.editor.on("selectionUpdate",c);const l=oe(r,"onTransaction",o);l&&this.editor.on("transaction",l);const f=oe(r,"onFocus",o);f&&this.editor.on("focus",f);const p=oe(r,"onBlur",o);p&&this.editor.on("blur",p);const A=oe(r,"onDestroy",o);A&&this.editor.on("destroy",A)})}static resolve(t){const n=sl.sort(sl.flatten(t)),r=tFe(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=oe(n,"addExtensions",r);return i?[n,...this.flatten(i())]:n}).flat(10)}static sort(t){return t.sort((r,i)=>{const o=oe(r,"priority")||100,a=oe(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:r1(n.name,this.schema)},i=oe(n,"addCommands",r);return i?{...t,...i()}:t},{})}get plugins(){const{editor:t}=this,n=sl.sort([...this.extensions].reverse()),r=[],i=[],o=n.map(a=>{const u={name:a.name,options:a.options,storage:a.storage,editor:t,type:r1(a.name,this.schema)},s=[],c=oe(a,"addKeyboardShortcuts",u);let l={};if(a.type==="mark"&&a.config.exitable&&(l.ArrowRight=()=>Kc.handleExit({editor:t,mark:a})),c){const v=Object.fromEntries(Object.entries(c()).map(([_,S])=>[_,()=>S({editor:t})]));l={...l,...v}}const f=cOe(l);s.push(f);const p=oe(a,"addInputRules",u);SM(a,t.options.enableInputRules)&&p&&r.push(...p());const A=oe(a,"addPasteRules",u);SM(a,t.options.enablePasteRules)&&A&&i.push(...A());const h=oe(a,"addProseMirrorPlugins",u);if(h){const v=h();s.push(...v)}return s}).flat();return[HOe({editor:t,rules:r}),...eFe({editor:t,rules:i}),...o]}get attributes(){return L8(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:n}=V0(this.extensions);return Object.fromEntries(n.filter(r=>!!oe(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:yn(r.name,this.schema)},a=oe(r,"addNodeView",o);if(!a)return[];const u=(s,c,l,f)=>{const p=gC(s,i);return a()({editor:t,node:s,getPos:l,decorations:f,HTMLAttributes:p,extension:r})};return[r.name,u]}))}}function nFe(e){return Object.prototype.toString.call(e).slice(8,-1)}function i1(e){return nFe(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function z0(e,t){const n={...e};return i1(e)&&i1(t)&&Object.keys(t).forEach(r=>{i1(t[r])?r in e?n[r]=z0(e[r],t[r]):Object.assign(n,{[r]:t[r]}):Object.assign(n,{[r]:t[r]})}),n}class cr{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&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Me(oe(this,"addOptions",{name:this.name}))),this.storage=Me(oe(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new cr(t)}configure(t={}){const n=this.extend();return n.options=z0(this.options,t),n.storage=Me(oe(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){const n=new cr({...this.config,...t});return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Me(oe(n,"addOptions",{name:n.name})),n.storage=Me(oe(n,"addStorage",{name:n.name,options:n.options})),n}}function rFe(e,t,n){const{from:r,to:i}=t,{blockSeparator:o=`
39
+ `))),0,0):re.empty;let f=e.someProp("clipboardTextParser",p=>p(t,i,r,e));if(f)u=f;else{let p=i.marks(),{schema:A}=e.state,h=as.fromSchema(A);a=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(v=>{let _=a.appendChild(document.createElement("p"));v&&_.appendChild(h.serializeNode(A.text(v,p)))})}}else e.someProp("transformPastedHTML",f=>{n=f(n,e)}),a=BRe(n),BR&&WRe(a);let c=a&&a.querySelector("[data-pm-slice]"),l=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(l&&l[3])for(let f=+l[3];f>0;f--){let p=a.firstChild;for(;p&&p.nodeType!=1;)p=p.nextSibling;if(!p)break;a=p}if(u||(u=(e.someProp("clipboardParser")||e.someProp("domParser")||pp.fromSchema(e.state.schema)).parseSlice(a,{preserveWhitespace:!!(s||l),context:i,ruleFromNode(p){return p.nodeName=="BR"&&!p.nextSibling&&p.parentNode&&!jRe.test(p.parentNode.nodeName)?{ignore:!0}:null}})),l)u=KRe(pM(u,+l[1],+l[2]),l[4]);else if(u=re.maxOpen(URe(u.content,i),!0),u.openStart||u.openEnd){let f=0,p=0;for(let A=u.content.firstChild;f<u.openStart&&!A.type.spec.isolating;f++,A=A.firstChild);for(let A=u.content.lastChild;p<u.openEnd&&!A.type.spec.isolating;p++,A=A.lastChild);u=pM(u,f,p)}return e.someProp("transformPasted",f=>{u=f(u,e)}),u}const jRe=/^(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 URe(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&&c8(s,o,u,a[a.length-1],0))a[a.length-1]=c;else{a.length&&(a[a.length-1]=l8(a[a.length-1],o.length));let l=s8(u,s);a.push(l),i=i.matchType(l.type),o=s}}),a)return G.from(a)}return e}function s8(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,G.from(e));return e}function c8(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let o=c8(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(G.from(s8(n,e,i+1))))}}function l8(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,l8(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(G.empty,!0);return e.copy(n.append(r))}function AC(e,t,n,r,i,o){let a=t<0?e.firstChild:e.lastChild,u=a.content;return e.childCount>1&&(o=0),i<r-1&&(u=AC(u,t,n,r,i+1,o)),i>=n&&(u=t<0?a.contentMatchAt(0).fillBefore(u,o<=i).append(u):u.append(a.contentMatchAt(a.childCount).fillBefore(G.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,a.copy(u))}function pM(e,t,n){return t<e.openStart&&(e=new re(AC(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new re(AC(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const f8={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 AM=null;function d8(){return AM||(AM=document.implementation.createHTMLDocument("title"))}function BRe(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=d8().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&f8[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 WRe(e){let t=e.querySelectorAll(Bc?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}function KRe(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=G.from(s.create(r[u+1],i)),o++,a++}return new re(i,o,a)}const Ji={},Rr={};function eu(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}Rr.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!A8(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Th&&Bc&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),UR&&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,e8(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",r=>r(e,n))||LRe(e,n)?n.preventDefault():eu(e,"key")};Rr.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)};Rr.keypress=(e,t)=>{let n=t;if(A8(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Hr&&n.metaKey)return;if(e.someProp("handleKeyPress",i=>i(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof Ke)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode);!/[\r\n]/.test(i)&&!e.someProp("handleTextInput",o=>o(e,r.$from.pos,r.$to.pos,i))&&e.dispatch(e.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}};function q0(e){return{left:e.clientX,top:e.clientY}}function PRe(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function KR(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 dl(e,t,n){e.focused||e.focus();let r=e.state.tr.setSelection(t);n=="pointer"&&r.setMeta("pointer",!0),e.dispatch(r)}function DRe(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&me.isSelectable(r)?(dl(e,new me(n),"pointer"),!0):!1}function NRe(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof me&&(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(me.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?(dl(e,me.create(e.state.doc,i),"pointer"),!0):!1}function qRe(e,t,n,r,i){return KR(e,"handleClickOn",t,n,r)||e.someProp("handleClick",o=>o(e,t,r))||(i?NRe(e,n):DRe(e,n))}function QRe(e,t,n,r){return KR(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",i=>i(e,t,r))}function VRe(e,t,n,r){return KR(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",i=>i(e,t,r))||zRe(e,n,r)}function zRe(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?(dl(e,Ke.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)dl(e,Ke.create(r,u+1,u+1+a.content.size),"pointer");else if(me.isSelectable(a))dl(e,me.create(r,u),"pointer");else continue;return!0}}function PR(e){return Vm(e)}const p8=Hr?"metaKey":"ctrlKey";Ji.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=PR(e),i=Date.now(),o="singleClick";i-e.input.lastClick.time<500&&PRe(n,e.input.lastClick)&&!n[p8]&&(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(q0(n));a&&(o=="singleClick"?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new HRe(e,a,n,!!r)):(o=="doubleClick"?QRe:VRe)(e,a.pos,a.inside,n)?n.preventDefault():eu(e,"pointer"))};class HRe{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[p8],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 me&&c.from<=a&&c.to>a)&&(this.mightDrag={node:o,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&N0&&!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)),eu(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(()=>WR(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(q0(t))),this.updateAllowDefault(t),this.allowDefault||!n?eu(this.view,"pointer"):qRe(this.view,n.pos,n.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||Wc&&this.mightDrag&&!this.mightDrag.node.isAtom||Bc&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(dl(this.view,Qe.near(this.view.state.doc.resolve(n.pos)),"pointer"),t.preventDefault()):eu(this.view,"pointer")}move(t){this.updateAllowDefault(t),eu(this.view,"pointer"),t.buttons==0&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}Ji.touchstart=e=>{e.input.lastTouch=Date.now(),PR(e),eu(e,"pointer")};Ji.touchmove=e=>{e.input.lastTouch=Date.now(),eu(e,"pointer")};Ji.contextmenu=e=>PR(e);function A8(e,t){return e.composing?!0:Wc&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const YRe=Th?5e3:-1;Rr.compositionstart=Rr.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(),Vm(e,!0),e.markCursor=null;else if(Vm(e),N0&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=e.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let a=o<0?i.lastChild:i.childNodes[o-1];if(!a)break;if(a.nodeType==3){e.domSelection().collapse(a,a.nodeValue.length);break}else i=a,o=-1}}e.input.composing=!0}h8(e,YRe)};Rr.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,h8(e,20))};function h8(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Vm(e),t))}function GRe(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=JRe());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function JRe(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function Vm(e,t=!1){if(!(Th&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),GRe(e),t||e.docView&&e.docView.dirty){let n=IRe(e);return n&&!n.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(n)):e.updateState(e.state),!0}return!1}}function ZRe(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 hp=Ih&&n8<15||UR&&_Re<604;Ji.copy=Rr.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type=="cut";if(r.empty)return;let o=hp?null:n.clipboardData,a=r.content(),{dom:u,text:s}=a8(e,a);o?(n.preventDefault(),o.clearData(),o.setData("text/html",u.innerHTML),o.setData("text/plain",s)):ZRe(e,u),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function XRe(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function eOe(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?hC(e,r.value,null,i,t):hC(e,r.textContent,r.innerHTML,i,t)},50)}function hC(e,t,n,r,i){let o=u8(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",s=>s(e,i,o||re.empty)))return!0;if(!o)return!1;let a=XRe(o),u=a?e.state.tr.replaceSelectionWith(a,r):e.state.tr.replaceSelection(o);return e.dispatch(u.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function m8(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Rr.paste=(e,t)=>{let n=t;if(e.composing&&!Th)return;let r=hp?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&hC(e,m8(r),r.getData("text/html"),i,n)?n.preventDefault():eOe(e,n)};class tOe{constructor(t,n,r){this.slice=t,this.move=n,this.node=r}}const g8=Hr?"altKey":"ctrlKey";Ji.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(q0(n)),a;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof me?i.to-1:i.to))){if(r&&r.mightDrag)a=me.create(e.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let l=e.docView.nearestDesc(n.target,!0);l&&l.node.type.spec.draggable&&l!=e.docView&&(a=me.create(e.state.doc,l.posBefore))}}let u=(a||e.state.selection).content(),{dom:s,text:c}=a8(e,u);n.dataTransfer.clearData(),n.dataTransfer.setData(hp?"Text":"text/html",s.innerHTML),n.dataTransfer.effectAllowed="copyMove",hp||n.dataTransfer.setData("text/plain",c),e.dragging=new tOe(u,!n[g8],a)};Ji.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)};Rr.dragover=Rr.dragenter=(e,t)=>t.preventDefault();Rr.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let i=e.posAtCoords(q0(n));if(!i)return;let o=e.state.doc.resolve(i.pos),a=r&&r.slice;a?e.someProp("transformPasted",h=>{a=h(a,e)}):a=u8(e,m8(n.dataTransfer),hp?null:n.dataTransfer.getData("text/html"),!1,o);let u=!!(r&&!n[g8]);if(e.someProp("handleDrop",h=>h(e,n,a||re.empty,u))){n.preventDefault();return}if(!a)return;n.preventDefault();let s=a?dRe(e.state.doc,o.pos,a):o.pos;s==null&&(s=o.pos);let c=e.state.tr;if(u){let{node:h}=r;h?h.replace(c):c.deleteSelection()}let l=c.mapping.map(s),f=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,p=c.doc;if(f?c.replaceRangeWith(l,l,a.content.firstChild):c.replaceRange(l,l,a),c.doc.eq(p))return;let A=c.doc.resolve(l);if(f&&me.isSelectable(a.content.firstChild)&&A.nodeAfter&&A.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new me(A));else{let h=c.mapping.map(s);c.mapping.maps[c.mapping.maps.length-1].forEach((v,_,S,I)=>h=I),c.setSelection(i8(e,A,c.doc.resolve(h)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))};Ji.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&WR(e)},20))};Ji.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)};Ji.beforeinput=(e,t)=>{if(Bc&&Th&&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,e8(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 Rr)Ji[e]=Rr[e];function mp(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 zm{constructor(t,n){this.toDOM=t,this.spec=n||hs,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 Si(o-r,o-r,this)}valid(){return!0}eq(t){return this==t||t instanceof zm&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&mp(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class ru{constructor(t,n){this.attrs=t,this.spec=n||hs}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 Si(o,a,this)}valid(t,n){return n.from<n.to}eq(t){return this==t||t instanceof ru&&mp(this.attrs,t.attrs)&&mp(this.spec,t.spec)}static is(t){return t.type instanceof ru}destroy(){}}let nOe=class v8{constructor(t,n){this.attrs=t,this.spec=n||hs}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 Si(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 v8&&mp(this.attrs,t.attrs)&&mp(this.spec,t.spec)}destroy(){}};class Si{constructor(t,n,r){this.from=t,this.to=n,this.type=r}copy(t,n){return new Si(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 Si(t,t,new zm(n,r))}static inline(t,n,r,i){return new Si(t,n,new ru(r,i))}static node(t,n,r,i){return new Si(t,n,new nOe(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof ru}get widget(){return this.type instanceof zm}}const il=[],hs={};class Vt{constructor(t,n){this.local=t.length?t:il,this.children=n.length?n:il}static create(t,n){return n.length?Hm(n,t,0,hs):Nn}find(t,n,r){let i=[];return this.findInner(t??0,n??1e9,i,0,r),i}findInner(t,n,r,i,o){for(let a=0;a<this.local.length;a++){let u=this.local[a];u.from<=n&&u.to>=t&&(!o||o(u.spec))&&r.push(u.copy(u.from+i,u.to+i))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<n&&this.children[a+1]>t){let u=this.children[a]+1;this.children[a+2].findInner(t-u,n-u,r,i+u,o)}}map(t,n,r){return this==Nn||t.maps.length==0?this:this.mapInner(t,n,0,0,r||hs)}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?rOe(this.children,a||[],t,n,r,i,o):a?new Vt(a.sort(ms),il):Nn}add(t,n){return n.length?this==Nn?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=b8(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,Hm(l,u,c+1,hs)),o+=3}});let a=y8(o?C8(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(ms):this.local,i||this.children)}remove(t){return t.length==0||this==Nn?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!=Nn?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):Nn}forChild(t,n){if(this==Nn)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 ru){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(ms),il);return r?new rs([u,r]):u}return r||Nn}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 DR(this.localsInner(t))}localsInner(t){if(this==Nn)return il;if(t.inlineContent||!this.local.some(ru.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof ru||n.push(this.local[r]);return n}}Vt.empty=new Vt([],[]);Vt.removeOverlap=DR;const Nn=Vt.empty;class rs{constructor(t){this.members=t}map(t,n){const r=this.members.map(i=>i.map(t,n,hs));return rs.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!=Nn&&(o instanceof rs?r=r.concat(o.members):r.push(o))}return rs.from(r)}eq(t){if(!(t instanceof rs)||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?DR(r?n:n.sort(ms)):il}static from(t){switch(t.length){case 0:return Nn;case 1:return t[0];default:return new rs(t.every(n=>n instanceof Vt)?t:t.reduce((n,r)=>n.concat(r instanceof Vt?r:r.members),[]))}}}function rOe(e,t,n,r,i,o,a){let u=e.slice();for(let c=0,l=o;c<n.maps.length;c++){let f=0;n.maps[c].forEach((p,A,h,v)=>{let _=v-h-(A-p);for(let S=0;S<u.length;S+=3){let I=u[S+1];if(I<0||p>I+l-f)continue;let T=u[S]+l-f;A>=T?u[S+1]=p<=T?-2:-1:p>=l&&_&&(u[S]+=_,u[S+1]+=_)}f+=_}),l=n.maps[c].map(l,-1)}let s=!1;for(let c=0;c<u.length;c+=3)if(u[c+1]<0){if(u[c+1]==-2){s=!0,u[c+1]=-1;continue}let l=n.map(e[c]+o),f=l-i;if(f<0||f>=r.content.size){s=!0;continue}let p=n.map(e[c+1]+o,-1),A=p-i,{index:h,offset:v}=r.content.findIndex(f),_=r.maybeChild(h);if(_&&v==f&&v+_.nodeSize==A){let S=u[c+2].mapInner(n,_,l+1,e[c]+o+1,a);S!=Nn?(u[c]=f,u[c+1]=A,u[c+2]=S):(u[c+1]=-2,s=!0)}else s=!0}if(s){let c=iOe(u,e,t,n,i,o,a),l=Hm(c,r,0,a);t=l.local;for(let f=0;f<u.length;f+=3)u[f+1]<0&&(u.splice(f,3),f-=3);for(let f=0,p=0;f<l.children.length;f+=3){let A=l.children[f];for(;p<u.length&&u[p]<A;)p+=3;u.splice(p,0,l.children[f],l.children[f+1],l.children[f+2])}}return new Vt(t.sort(ms),u)}function y8(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 Si(i.from+t,i.to+t,i.type))}return n}function iOe(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 b8(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 C8(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function Hm(e,t,n,r){let i=[],o=!1;t.forEach((u,s)=>{let c=b8(e,u,s+n);if(c){o=!0;let l=Hm(c,u,n+s+1,r);l!=Nn&&i.push(s,s+u.nodeSize,l)}});let a=y8(o?C8(e):e,-n).sort(ms);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):Nn}function ms(e,t){return e.from-t.from||e.to-t.to}function DR(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),hM(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),hM(t,i,r.copy(o.from,r.to)));break}}}return t}function hM(e,t,n){for(;t<e.length&&ms(n,e[t])>0;)t++;e.splice(t,0,n)}var pu={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Ym={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},oOe=typeof navigator<"u"&&/Mac/.test(navigator.platform),aOe=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var pn=0;pn<10;pn++)pu[48+pn]=pu[96+pn]=String(pn);for(var pn=1;pn<=24;pn++)pu[pn+111]="F"+pn;for(var pn=65;pn<=90;pn++)pu[pn]=String.fromCharCode(pn+32),Ym[pn]=String.fromCharCode(pn);for(var e1 in pu)Ym.hasOwnProperty(e1)||(Ym[e1]=pu[e1]);function uOe(e){var t=oOe&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||aOe&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?Ym:pu)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const sOe=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function cOe(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))sOe?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 lOe(e){let t=Object.create(null);for(let n in e)t[cOe(n)]=e[n];return t}function t1(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function fOe(e){return new Nr({props:{handleKeyDown:dOe(e)}})}function dOe(e){let t=lOe(e);return function(n,r){let i=uOe(r),o,a=t[t1(i,r)];if(a&&a(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let u=t[t1(i,r,!1)];if(u&&u(n.state,n.dispatch,n))return!0}if((r.shiftKey||r.altKey||r.metaKey||i.charCodeAt(0)>127)&&(o=pu[r.keyCode])&&o!=i){let u=t[t1(o,r)];if(u&&u(n.state,n.dispatch,n))return!0}}return!1}}const S8=65535,_8=Math.pow(2,16);function pOe(e,t){return e+t*_8}function mM(e){return e&S8}function AOe(e){return(e-(e&S8))/_8}const I8=1,T8=2,rm=4,x8=8;class gM{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&x8)>0}get deletedBefore(){return(this.delInfo&(I8|rm))>0}get deletedAfter(){return(this.delInfo&(T8|rm))>0}get deletedAcross(){return(this.delInfo&rm)>0}}class Tr{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&Tr.empty)return Tr.empty}recover(t){let n=0,r=mM(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+AOe(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 p=c?t==s?-1:t==f?1:n:n,A=s+i+(p<0?0:l);if(r)return A;let h=t==(n<0?s:f)?null:pOe(u/3,t-s),v=t==s?T8:t==f?I8:rm;return(n<0?t!=s:t!=f)&&(v|=x8),new gM(A,v,h)}i+=l-c}return r?t+i:new gM(t+i,0,null)}touches(t,n){let r=0,i=mM(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 Tr(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?Tr.empty:new Tr(t<0?[0,-t,0]:[0,0,t])}}Tr.empty=new Tr([]);const n1=Object.create(null);class Wn{getMap(){return Tr.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=n1[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 n1)throw new RangeError("Duplicate use of step JSON ID "+t);return n1[t]=n,n.prototype.jsonID=t,n}}class Dt{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new Dt(t,null)}static fail(t){return new Dt(null,t)}static fromReplace(t,n,r,i){try{return Dt.ok(t.replace(n,r,i))}catch(o){if(o instanceof fp)return Dt.fail(o.message);throw o}}}function NR(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(NR(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return G.fromArray(r)}class us extends Wn{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 re(NR(n.content,(a,u)=>!a.isAtom||!u.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),i),n.openStart,n.openEnd);return Dt.fromReplace(t,this.from,this.to,o)}invert(){return new ss(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 us(n.pos,r.pos,this.mark)}merge(t){return t instanceof us&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new us(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 us(n.from,n.to,t.markFromJSON(n.mark))}}Wn.jsonID("addMark",us);class ss extends Wn{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 re(NR(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),n.openStart,n.openEnd);return Dt.fromReplace(t,this.from,this.to,r)}invert(){return new us(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 ss(n.pos,r.pos,this.mark)}merge(t){return t instanceof ss&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new ss(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 ss(n.from,n.to,t.markFromJSON(n.mark))}}Wn.jsonID("removeMark",ss);class cs extends Wn{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Dt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Dt.fromReplace(t,this.pos,this.pos+1,new re(G.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 cs(this.pos,n.marks[i]);return new cs(this.pos,this.mark)}}return new gp(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new cs(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 cs(n.pos,t.markFromJSON(n.mark))}}Wn.jsonID("addNodeMark",cs);class gp extends Wn{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Dt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Dt.fromReplace(t,this.pos,this.pos+1,new re(G.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new cs(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new gp(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 gp(n.pos,t.markFromJSON(n.mark))}}Wn.jsonID("removeNodeMark",gp);class Qo extends Wn{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&mC(t,this.from,this.to)?Dt.fail("Structure replace would overwrite content"):Dt.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new Tr([this.from,this.to-this.from,this.slice.size])}invert(t){return new Qo(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 Qo(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof Qo)||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?re.empty:new re(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new Qo(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?re.empty:new re(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new Qo(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 Qo(n.from,n.to,re.fromJSON(t,n.slice),!!n.structure)}}Wn.jsonID("replace",Qo);class pl extends Wn{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&&(mC(t,this.from,this.gapFrom)||mC(t,this.gapTo,this.to)))return Dt.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Dt.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Dt.fromReplace(t,this.from,this.to,r):Dt.fail("Content does not fit in gap")}getMap(){return new Tr([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 pl(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 pl(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 pl(n.from,n.to,n.gapFrom,n.gapTo,re.fromJSON(t,n.slice),n.insert,!!n.structure)}}Wn.jsonID("replaceAround",pl);function mC(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 hOe(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function mOe(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||!hOe(i,o,a))break}return null}function gOe(e,t,n=null,r=e){let i=vOe(e,t),o=i&&yOe(r,t);return o?i.map(vM).concat({type:t,attrs:n}).concat(o.map(vM)):null}function vM(e){return{type:e,attrs:null}}function vOe(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 yOe(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 im(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),p=i.index(c);if(f.type.spec.isolating)return!1;let A=f.content.cutByIndex(p,f.childCount),h=r&&r[l+1];h&&(A=A.replaceChild(0,h.type.create(h.attrs)));let v=r&&r[l]||f;if(!f.canReplace(p+1,f.childCount)||!v.type.validContent(A))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 qR(e,t){let n=e.resolve(t),r=n.index();return w8(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function w8(e,t){return!!(e&&t&&!e.isLeaf&&e.canAppend(t))}function $8(e,t,n=-1){let r=e.resolve(t);for(let i=r.depth;;i--){let o,a,u=r.index(i);if(i==r.depth?(o=r.nodeBefore,a=r.nodeAfter):n>0?(o=r.node(i+1),u++,a=r.node(i).maybeChild(u)):(o=r.node(i).maybeChild(u-1),a=r.node(i+1)),o&&!o.isTextblock&&w8(o,a)&&r.node(i).canReplace(u,u+1))return t;if(i==0)break;t=n<0?r.before(i):r.after(i)}}class Od extends Wn{constructor(t,n,r){super(),this.pos=t,this.attr=n,this.value=r}apply(t){let n=t.nodeAt(this.pos);if(!n)return Dt.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return Dt.fromReplace(t,this.pos,this.pos+1,new re(G.from(i),0,n.isLeaf?0:1))}getMap(){return Tr.empty}invert(t){return new Od(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 Od(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 Od(n.pos,n.attr,n.value)}}Wn.jsonID("attr",Od);class Gm extends Wn{constructor(t,n){super(),this.attr=t,this.value=n}apply(t){let n=Object.create(null);for(let i in t.attrs)n[i]=t.attrs[i];n[this.attr]=this.value;let r=t.type.create(n,t.content,t.marks);return Dt.ok(r)}getMap(){return Tr.empty}invert(t){return new Gm(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Gm(n.attr,n.value)}}Wn.jsonID("docAttr",Gm);let vp=class extends Error{};vp=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};vp.prototype=Object.create(Error.prototype);vp.prototype.constructor=vp;vp.prototype.name="TransformError";const bOe=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function E8(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}const COe=(e,t,n)=>{let r=E8(e,n);if(!r)return!1;let i=QR(r);if(!i){let a=r.blockRange(),u=a&&Sh(a);return u==null?!1:(t&&t(e.tr.lift(a,u).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&M8(e,i,t))return!0;if(r.parent.content.size==0&&(kl(o,"end")||me.isSelectable(o))){let a=kR(e.doc,r.before(),r.after(),re.empty);if(a&&a.slice.size<a.to-a.from){if(t){let u=e.tr.step(a);u.setSelection(kl(o,"end")?Qe.findFrom(u.doc.resolve(u.mapping.map(i.pos,-1)),-1):me.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},SOe=(e,t,n)=>{let r=E8(e,n);if(!r)return!1;let i=QR(r);return i?R8(e,i,t):!1},_Oe=(e,t,n)=>{let r=O8(e,n);if(!r)return!1;let i=VR(r);return i?R8(e,i,t):!1};function R8(e,t,n){let r=t.nodeBefore,i=r,o=t.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return!1;let l=i.lastChild;if(!l)return!1;i=l}let a=t.nodeAfter,u=a,s=t.pos+1;for(;!u.isTextblock;s++){if(u.type.spec.isolating)return!1;let l=u.firstChild;if(!l)return!1;u=l}let c=kR(e.doc,o,s,re.empty);if(!c||c.from!=o||c instanceof Ch&&c.slice.size>=s-o)return!1;if(n){let l=e.tr.step(c);l.setSelection(Ke.create(l.doc,o)),n(l.scrollIntoView())}return!0}function kl(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 IOe=(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=QR(r)}let a=o&&o.nodeBefore;return!a||!me.isSelectable(a)?!1:(t&&t(e.tr.setSelection(me.create(e.doc,o.pos-a.nodeSize)).scrollIntoView()),!0)};function QR(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function O8(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}const TOe=(e,t,n)=>{let r=O8(e,n);if(!r)return!1;let i=VR(r);if(!i)return!1;let o=i.nodeAfter;if(M8(e,i,t))return!0;if(r.parent.content.size==0&&(kl(o,"start")||me.isSelectable(o))){let a=kR(e.doc,r.before(),r.after(),re.empty);if(a&&a.slice.size<a.to-a.from){if(t){let u=e.tr.step(a);u.setSelection(kl(o,"start")?Qe.findFrom(u.doc.resolve(u.mapping.map(i.pos)),1):me.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},xOe=(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=VR(r)}let a=o&&o.nodeAfter;return!a||!me.isSelectable(a)?!1:(t&&t(e.tr.setSelection(me.create(e.doc,o.pos)).scrollIntoView()),!0)};function VR(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 wOe=(e,t)=>{let n=e.selection,r=n instanceof me,i;if(r){if(n.node.isTextblock||!_h(e.doc,n.from))return!1;i=n.from}else if(i=H7(e.doc,n.from,-1),i==null)return!1;if(t){let o=e.tr.join(i);r&&o.setSelection(me.create(o.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(o.scrollIntoView())}return!0},$Oe=(e,t)=>{let n=e.selection,r;if(n instanceof me){if(n.node.isTextblock||!_h(e.doc,n.to))return!1;r=n.to}else if(r=H7(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},EOe=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),o=i&&Sh(i);return o==null?!1:(t&&t(e.tr.lift(i,o).scrollIntoView()),!0)},ROe=(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 F8(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 OOe=(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=F8(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(Qe.near(s.doc.resolve(u),1)),t(s.scrollIntoView())}return!0},FOe=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof Ti||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=F8(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(Ke.create(u.doc,a+1)),t(u.scrollIntoView())}return!0},MOe=(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(V7(e.doc,o))return t&&t(e.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Sh(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)},kOe=(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(me.create(e.doc,i))),!0)};function LOe(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||_h(e.doc,t.pos))?!1:(n&&n(e.tr.clearIncompatible(t.pos,r.type,r.contentMatchAt(r.childCount)).join(t.pos).scrollIntoView()),!0)}function M8(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,o,a;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(LOe(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,p=G.empty;for(let v=o.length-1;v>=0;v--)p=G.from(o[v].create(null,p));p=G.from(r.copy(p));let A=e.tr.step(new ra(t.pos-1,f,t.pos,f,new re(p,1,0),o.length,!0)),h=f+2*o.length;_h(A.doc,h)&&A.join(h),n(A.scrollIntoView())}return!0}let s=Qe.findFrom(t,1),c=s&&s.$from.blockRange(s.$to),l=c&&Sh(c);if(l!=null&&l>=t.depth)return n&&n(e.tr.lift(c,l).scrollIntoView()),!0;if(u&&kl(i,"start",!0)&&kl(r,"end")){let f=r,p=[];for(;p.push(f),!f.isTextblock;)f=f.lastChild;let A=i,h=1;for(;!A.isTextblock;A=A.firstChild)h++;if(f.canReplace(f.childCount,f.childCount,A.content)){if(n){let v=G.empty;for(let S=p.length-1;S>=0;S--)v=G.from(p[S].copy(v));let _=e.tr.step(new ra(t.pos-p.length,t.pos+i.nodeSize,t.pos+h,t.pos+i.nodeSize-h,new re(v,p.length,0),0,!0));n(_.scrollIntoView())}return!0}}return!1}function k8(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(Ke.create(t.doc,e<0?i.start(o):i.end(o)))),!0):!1}}const jOe=k8(-1),UOe=k8(1);function BOe(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,a=i.blockRange(o),u=a&&Q7(a,e,t);return u?(r&&r(n.tr.wrap(a,u).scrollIntoView()),!0):!1}}function yM(e,t=null){return function(n,r){let i=!1;for(let o=0;o<n.selection.ranges.length&&!i;o++){let{$from:{pos:a},$to:{pos:u}}=n.selection.ranges[o];n.doc.nodesBetween(a,u,(s,c)=>{if(i)return!1;if(!(!s.isTextblock||s.hasMarkup(e,t)))if(s.type==e)i=!0;else{let l=n.doc.resolve(c),f=l.index();i=l.parent.canReplaceWith(f,f+1,e)}})}if(!i)return!1;if(r){let o=n.tr;for(let a=0;a<n.selection.ranges.length;a++){let{$from:{pos:u},$to:{pos:s}}=n.selection.ranges[a];o.setBlockType(u,s,e,t)}r(o.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function WOe(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 Km(l,l,a.depth),a.endIndex<a.parent.childCount&&(a=new Km(i,n.doc.resolve(o.end(a.depth)),a.depth)),u=!0}let c=Q7(s,e,t,a);return c?(r&&r(KOe(n.tr,a,c,u,e).scrollIntoView()),!0):!1}}function KOe(e,t,n,r,i){let o=G.empty;for(let l=n.length-1;l>=0;l--)o=G.from(n[l].type.create(n[l].attrs,o));e.step(new ra(t.start-(r?2:0),t.end,t.start,t.end,new re(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,p=!0;l<f;l++,p=!1)!p&&V7(e.doc,s,u)&&(e.split(s,u),s+=2*u),s+=c.child(l).nodeSize;return e}function POe(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?DOe(t,n,e,o):NOe(t,n,o):!0:!1}}function DOe(e,t,n,r){let i=e.tr,o=r.end,a=r.$to.end(r.depth);o<a&&(i.step(new ra(o-1,a,o,a,new re(G.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Km(i.doc.resolve(r.$from.pos),i.doc.resolve(a),r.depth));const u=Sh(r);if(u==null)return!1;i.lift(r,u);let s=i.mapping.map(o,-1)-1;return _h(i.doc,s)&&i.join(s),t(i.scrollIntoView()),!0}function NOe(e,t,n){let r=e.tr,i=n.parent;for(let A=n.end,h=n.endIndex-1,v=n.startIndex;h>v;h--)A-=i.child(h).nodeSize,r.delete(A-1,A+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?G.empty:G.from(i))))return!1;let f=o.pos,p=f+a.nodeSize;return r.step(new ra(f-(u?1:0),p+(s?1:0),f+1,p-1,new re((u?G.empty:G.from(i.copy(G.empty))).append(s?G.empty:G.from(i.copy(G.empty))),u?0:1,s?0:1),u?0:1)),t(r.scrollIntoView()),!0}function qOe(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=G.from(c?e.create():null),f=new re(G.from(e.create(null,G.from(u.type.create(null,l)))),c?3:1,0),p=o.start,A=o.end;n(t.tr.step(new ra(p-(c?3:1),A,p,A,f,1,!0)).scrollIntoView())}return!0}}function Q0(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),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 zR{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(p=>p===!0)),f={...Object.fromEntries(Object.entries(r).map(([p,A])=>[p,(...v)=>{const _=this.buildProps(c,n),S=A(...v)(_);return u.push(S),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,u={tr:t,editor:i,view:a,state:Q0({state:o,transaction:t}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(t,n),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(r).map(([s,c])=>[s,(...l)=>c(...l)(u)]))}};return u}}function oe(e,t,n){return e.config[t]===void 0&&e.parent?oe(e.parent,t,n):typeof e.config[t]=="function"?e.config[t].bind({...n,parent:e.parent?oe(e.parent,t,n):null}):e.config[t]}function V0(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 L8(e){const t=[],{nodeExtensions:n,markExtensions:r}=V0(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=oe(a,"addGlobalAttributes",u);if(!s)return;s().forEach(l=>{l.types.forEach(f=>{Object.entries(l.attributes).forEach(([p,A])=>{t.push({type:f,name:p,attribute:{...o,...A}})})})})}),i.forEach(a=>{const u={name:a.name,options:a.options,storage:a.storage},s=oe(a,"addAttributes",u);if(!s)return;const c=s();Object.entries(c).forEach(([l,f])=>{const p={...o,...f};typeof(p==null?void 0:p.default)=="function"&&(p.default=p.default()),p!=null&&p.isRequired&&(p==null?void 0:p.default)===void 0&&delete p.default,t.push({type:a.name,name:l,attribute:p})})}),t}function yn(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 St(...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}if(i==="class"){const u=o?o.split(" "):[],s=r[i]?r[i].split(" "):[],c=u.filter(l=>!s.includes(l));r[i]=[...s,...c].join(" ")}else i==="style"?r[i]=[r[i],o].join("; "):r[i]=o}),r},{})}function gC(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)=>St(n,r),{})}function QOe(e){return typeof e=="function"}function Me(e,t=void 0,...n){return QOe(e)?t?e.bind(t)(...n):e(...n):e}function VOe(e={}){return Object.keys(e).length===0&&e.constructor===Object}function zOe(e){return typeof e!="string"?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e==="true"?!0:e==="false"?!1:e}function bM(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):zOe(n.getAttribute(a.name));return u==null?o:{...o,[a.name]:u}},{});return{...r,...i}}}}function CM(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>t==="attrs"&&VOe(n)?!1:n!=null))}function j8(e,t){var n;const r=L8(e),{nodeExtensions:i,markExtensions:o}=V0(e),a=(n=i.find(c=>oe(c,"topNode")))===null||n===void 0?void 0:n.name,u=Object.fromEntries(i.map(c=>{const l=r.filter(S=>S.type===c.name),f={name:c.name,options:c.options,storage:c.storage,editor:t},p=e.reduce((S,I)=>{const T=oe(I,"extendNodeSchema",f);return{...S,...T?T(c):{}}},{}),A=CM({...p,content:Me(oe(c,"content",f)),marks:Me(oe(c,"marks",f)),group:Me(oe(c,"group",f)),inline:Me(oe(c,"inline",f)),atom:Me(oe(c,"atom",f)),selectable:Me(oe(c,"selectable",f)),draggable:Me(oe(c,"draggable",f)),code:Me(oe(c,"code",f)),defining:Me(oe(c,"defining",f)),isolating:Me(oe(c,"isolating",f)),attrs:Object.fromEntries(l.map(S=>{var I;return[S.name,{default:(I=S==null?void 0:S.attribute)===null||I===void 0?void 0:I.default}]}))}),h=Me(oe(c,"parseHTML",f));h&&(A.parseDOM=h.map(S=>bM(S,l)));const v=oe(c,"renderHTML",f);v&&(A.toDOM=S=>v({node:S,HTMLAttributes:gC(S,l)}));const _=oe(c,"renderText",f);return _&&(A.toText=_),[c.name,A]})),s=Object.fromEntries(o.map(c=>{const l=r.filter(_=>_.type===c.name),f={name:c.name,options:c.options,storage:c.storage,editor:t},p=e.reduce((_,S)=>{const I=oe(S,"extendMarkSchema",f);return{..._,...I?I(c):{}}},{}),A=CM({...p,inclusive:Me(oe(c,"inclusive",f)),excludes:Me(oe(c,"excludes",f)),group:Me(oe(c,"group",f)),spanning:Me(oe(c,"spanning",f)),code:Me(oe(c,"code",f)),attrs:Object.fromEntries(l.map(_=>{var S;return[_.name,{default:(S=_==null?void 0:_.attribute)===null||S===void 0?void 0:S.default}]}))}),h=Me(oe(c,"parseHTML",f));h&&(A.parseDOM=h.map(_=>bM(_,l)));const v=oe(c,"renderHTML",f);return v&&(A.toDOM=_=>v({mark:_,HTMLAttributes:gC(_,l)})),[c.name,A]}));return new eRe({topNode:a,nodes:u,marks:s})}function r1(e,t){return t.nodes[e]||t.marks[e]||null}function SM(e,t){return Array.isArray(t)?t.some(n=>(typeof n=="string"?n:n.name)===e.name):t}const HOe=(e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(i,o,a,u)=>{var s,c;const l=((c=(s=i.type.spec).toText)===null||c===void 0?void 0:c.call(s,{node:i,pos:o,parent:a,index:u}))||i.textContent||"%leaf%";n+=l.slice(0,Math.max(0,r-o))}),n};function HR(e){return Object.prototype.toString.call(e)==="[object RegExp]"}class YR{constructor(t){this.find=t.find,this.handler=t.handler}}const YOe=(e,t)=>{if(HR(t))return t.exec(e);const n=t(e);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function zh(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(p=>p.type.spec.code))return!1;let l=!1;const f=HOe(c)+o;return a.forEach(p=>{if(l)return;const A=YOe(f,p.find);if(!A)return;const h=s.state.tr,v=Q0({state:s.state,transaction:h}),_={from:r-(A[0].length-o.length),to:i},{commands:S,chain:I,can:T}=new zR({editor:n,state:v});p.handler({state:v,range:_,match:A,commands:S,chain:I,can:T})===null||!h.steps.length||(h.setMeta(u,{transform:h,from:r,to:i,text:o}),s.dispatch(h),l=!0)}),l}function GOe(e){const{editor:t,rules:n}=e,r=new Nr({state:{init(){return null},apply(i,o){const a=i.getMeta(r);if(a)return a;const u=i.getMeta("applyInputRules");return!!u&&setTimeout(()=>{const{from:c,text:l}=u,f=c+l.length;zh({editor:t,from:c,to:f,text:l,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:o}},props:{handleTextInput(i,o,a,u){return zh({editor:t,from:o,to:a,text:u,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&zh({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?zh({editor:t,from:a.pos,to:a.pos,text:`
41
+ `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function JOe(e){return typeof e=="number"}class ZOe{constructor(t){this.find=t.find,this.handler=t.handler}}const XOe=(e,t,n)=>{if(HR(t))return[...e.matchAll(t)];const r=t(e,n);return r?r.map(i=>{const o=[i.text];return o.index=i.index,o.input=e,o.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(i.replaceWith)),o}):[]};function eFe(e){const{editor:t,state:n,from:r,to:i,rule:o,pasteEvent:a,dropEvent:u}=e,{commands:s,chain:c,can:l}=new zR({editor:t,state:n}),f=[];return n.doc.nodesBetween(r,i,(A,h)=>{if(!A.isTextblock||A.type.spec.code)return;const v=Math.max(r,h),_=Math.min(i,h+A.content.size),S=A.textBetween(v-h,_-h,void 0,"");XOe(S,o.find,a).forEach(T=>{if(T.index===void 0)return;const g=v+T.index+1,C=g+T[0].length,y={from:n.tr.mapping.map(g),to:n.tr.mapping.map(C)},x=o.handler({state:n,range:y,match:T,commands:s,chain:c,can:l,pasteEvent:a,dropEvent:u});f.push(x)})}),f.every(A=>A!==null)}const tFe=e=>{var t;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(t=n.clipboardData)===null||t===void 0||t.setData("text/html",e),n};function nFe(e){const{editor:t,rules:n}=e;let r=null,i=!1,o=!1,a=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,u=typeof DragEvent<"u"?new DragEvent("drop"):null;const s=({state:l,from:f,to:p,rule:A,pasteEvt:h})=>{const v=l.tr,_=Q0({state:l,transaction:v});if(!(!eFe({editor:t,state:_,from:Math.max(f-1,0),to:p.b-1,rule:A,pasteEvent:h,dropEvent:u})||!v.steps.length))return u=typeof DragEvent<"u"?new DragEvent("drop"):null,a=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,v};return n.map(l=>new Nr({view(f){const p=A=>{var h;r=!((h=f.dom.parentElement)===null||h===void 0)&&h.contains(A.target)?f.dom.parentElement:null};return window.addEventListener("dragstart",p),{destroy(){window.removeEventListener("dragstart",p)}}},props:{handleDOMEvents:{drop:(f,p)=>(o=r===f.dom.parentElement,u=p,!1),paste:(f,p)=>{var A;const h=(A=p.clipboardData)===null||A===void 0?void 0:A.getData("text/html");return a=p,i=!!(h!=null&&h.includes("data-pm-slice")),!1}}},appendTransaction:(f,p,A)=>{const h=f[0],v=h.getMeta("uiEvent")==="paste"&&!i,_=h.getMeta("uiEvent")==="drop"&&!o,S=h.getMeta("applyPasteRules"),I=!!S;if(!v&&!_&&!I)return;if(I){const{from:C,text:y}=S,x=C+y.length,w=tFe(y);return s({rule:l,state:A,from:C,to:{b:x},pasteEvt:w})}const T=p.doc.content.findDiffStart(A.doc.content),g=p.doc.content.findDiffEnd(A.doc.content);if(!(!JOe(T)||!g||T===g.b))return s({rule:l,state:A,from:T,to:g,pasteEvt:a})}}))}function rFe(e){const t=e.filter((n,r)=>e.indexOf(n)!==r);return[...new Set(t)]}class sl{constructor(t,n){this.splittableMarks=[],this.editor=n,this.extensions=sl.resolve(t),this.schema=j8(this.extensions,n),this.extensions.forEach(r=>{var i;this.editor.extensionStorage[r.name]=r.storage;const o={name:r.name,options:r.options,storage:r.storage,editor:this.editor,type:r1(r.name,this.schema)};r.type==="mark"&&(!((i=Me(oe(r,"keepOnSplit",o)))!==null&&i!==void 0)||i)&&this.splittableMarks.push(r.name);const a=oe(r,"onBeforeCreate",o);a&&this.editor.on("beforeCreate",a);const u=oe(r,"onCreate",o);u&&this.editor.on("create",u);const s=oe(r,"onUpdate",o);s&&this.editor.on("update",s);const c=oe(r,"onSelectionUpdate",o);c&&this.editor.on("selectionUpdate",c);const l=oe(r,"onTransaction",o);l&&this.editor.on("transaction",l);const f=oe(r,"onFocus",o);f&&this.editor.on("focus",f);const p=oe(r,"onBlur",o);p&&this.editor.on("blur",p);const A=oe(r,"onDestroy",o);A&&this.editor.on("destroy",A)})}static resolve(t){const n=sl.sort(sl.flatten(t)),r=rFe(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=oe(n,"addExtensions",r);return i?[n,...this.flatten(i())]:n}).flat(10)}static sort(t){return t.sort((r,i)=>{const o=oe(r,"priority")||100,a=oe(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:r1(n.name,this.schema)},i=oe(n,"addCommands",r);return i?{...t,...i()}:t},{})}get plugins(){const{editor:t}=this,n=sl.sort([...this.extensions].reverse()),r=[],i=[],o=n.map(a=>{const u={name:a.name,options:a.options,storage:a.storage,editor:t,type:r1(a.name,this.schema)},s=[],c=oe(a,"addKeyboardShortcuts",u);let l={};if(a.type==="mark"&&a.config.exitable&&(l.ArrowRight=()=>Kc.handleExit({editor:t,mark:a})),c){const v=Object.fromEntries(Object.entries(c()).map(([_,S])=>[_,()=>S({editor:t})]));l={...l,...v}}const f=fOe(l);s.push(f);const p=oe(a,"addInputRules",u);SM(a,t.options.enableInputRules)&&p&&r.push(...p());const A=oe(a,"addPasteRules",u);SM(a,t.options.enablePasteRules)&&A&&i.push(...A());const h=oe(a,"addProseMirrorPlugins",u);if(h){const v=h();s.push(...v)}return s}).flat();return[GOe({editor:t,rules:r}),...nFe({editor:t,rules:i}),...o]}get attributes(){return L8(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:n}=V0(this.extensions);return Object.fromEntries(n.filter(r=>!!oe(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:yn(r.name,this.schema)},a=oe(r,"addNodeView",o);if(!a)return[];const u=(s,c,l,f)=>{const p=gC(s,i);return a()({editor:t,node:s,getPos:l,decorations:f,HTMLAttributes:p,extension:r})};return[r.name,u]}))}}function iFe(e){return Object.prototype.toString.call(e).slice(8,-1)}function i1(e){return iFe(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function z0(e,t){const n={...e};return i1(e)&&i1(t)&&Object.keys(t).forEach(r=>{i1(t[r])?r in e?n[r]=z0(e[r],t[r]):Object.assign(n,{[r]:t[r]}):Object.assign(n,{[r]:t[r]})}),n}class cr{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&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Me(oe(this,"addOptions",{name:this.name}))),this.storage=Me(oe(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new cr(t)}configure(t={}){const n=this.extend();return n.options=z0(this.options,t),n.storage=Me(oe(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){const n=new cr({...this.config,...t});return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Me(oe(n,"addOptions",{name:n.name})),n.storage=Me(oe(n,"addStorage",{name:n.name,options:n.options})),n}}function oFe(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,p)=>{var A;const h=a==null?void 0:a[c.type.name];if(h)return c.isBlock&&!s&&(u+=o,s=!0),f&&(u+=h({node:c,pos:l,parent:f,index:p,range:t})),!1;c.isText?(u+=(A=c==null?void 0:c.text)===null||A===void 0?void 0:A.slice(Math.max(r,l)-l,i-l),s=!1):c.isBlock&&!s&&(u+=o,s=!0)}),u}function iFe(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}cr.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Nr({key:new Gi("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=iFe(n);return rFe(r,{from:a,to:u},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:s})}}})]}});const oFe=()=>({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),aFe=(e=!1)=>({commands:t})=>t.setContent("",e),uFe=()=>({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)),p=c.resolve(l.map(s+u.nodeSize)),A=f.blockRange(p);if(!A)return;const h=AOe(A);if(u.type.isTextblock){const{defaultType:v}=f.parent.contentMatchAt(f.index());t.setNodeMarkup(A.start,v)}(h||h===0)&&t.lift(A,h)})}),!0},sFe=e=>t=>e(t),cFe=()=>({state:e,dispatch:t})=>ROe(e,t),lFe=(e,t)=>({editor:n,tr:r})=>{const{state:i}=n,o=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);const a=r.mapping.map(t);return r.insert(a,o.content),r.setSelection(new Ke(r.doc.resolve(a-1))),!0},fFe=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;const i=e.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(t){const u=i.before(o),s=i.after(o);e.delete(u,s).scrollIntoView()}return!0}return!1},dFe=e=>({tr:t,state:n,dispatch:r})=>{const i=yn(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},pFe=e=>({tr:t,dispatch:n})=>{const{from:r,to:i}=e;return n&&t.delete(r,i),!0},AFe=()=>({state:e,dispatch:t})=>vOe(e,t),hFe=()=>({commands:e})=>e.keyboardShortcut("Enter"),mFe=()=>({state:e,dispatch:t})=>EOe(e,t);function Jm(e,t,n={strict:!0}){const r=Object.keys(t);return r.length?r.every(i=>n.strict?t[i]===e[i]:HR(t[i])?t[i].test(e[i]):t[i]===e[i]):!0}function vC(e,t,n={}){return e.find(r=>r.type===t&&Jm(r.attrs,n))}function gFe(e,t,n={}){return!!vC(e,t,n)}function GR(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=vC([...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(vC([...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&&gFe([...e.parent.child(u).marks],t,n);)s+=e.parent.child(u).nodeSize,u+=1;return{from:a,to:s}}function Hu(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 vFe=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const o=Hu(e,r.schema),{doc:a,selection:u}=n,{$from:s,from:c,to:l}=u;if(i){const f=GR(s,o,t);if(f&&f.from<=c&&f.to>=l){const p=Ke.create(a,f.from,f.to);n.setSelection(p)}}return!0},yFe=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 JR(e){return e instanceof Ke}function Yo(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function bFe(e,t=null){if(!t)return null;const n=Qe.atStart(e),r=Qe.atEnd(e);if(t==="start"||t===!0)return n;if(t==="end")return r;const i=n.from,o=r.to;return t==="all"?Ke.create(e,Yo(0,i,o),Yo(e.content.size,i,o)):Ke.create(e,Yo(t,i,o),Yo(t,i,o))}function H0(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const CFe=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:o})=>{t={scrollIntoView:!0,...t};const a=()=>{H0()&&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&&!JR(n.state.selection))return a(),!0;const u=bFe(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},SFe=(e,t)=>n=>e.every((r,i)=>t(r,{...n,index:i})),_Fe=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),U8=e=>{const t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){const r=t[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):r.nodeType===1&&U8(r)}return e};function _M(e){const t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,"text/html").body;return U8(n)}function Zm(e,t,n){if(n={slice:!0,parseOptions:{},...n},typeof e=="object"&&e!==null)try{return Array.isArray(e)&&e.length>0?G.fromArray(e.map(r=>t.nodeFromJSON(r))):t.nodeFromJSON(e)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",r),Zm("",t,n)}if(typeof e=="string"){const r=pp.fromSchema(t);return n.slice?r.parseSlice(_M(e),n.parseOptions).content:r.parse(_M(e),n.parseOptions)}return Zm("",t,n)}function IFe(e,t,n){const r=e.steps.length-1;if(r<t)return;const i=e.steps[r];if(!(i instanceof Qo||i instanceof pl))return;const o=e.mapping.maps[r];let a=0;o.forEach((u,s,c,l)=>{a===0&&(a=l)}),e.setSelection(Qe.near(e.doc.resolve(a),n))}const TFe=e=>e.toString().startsWith("<"),xFe=(e,t,n)=>({tr:r,dispatch:i,editor:o})=>{if(i){n={parseOptions:{},updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};const a=Zm(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}:{from:e.from,to:e.to},c=!0,l=!0;if((TFe(a)?a:[a]).forEach(A=>{A.check(),c=c?A.isText&&A.marks.length===0:!1,l=l?A.isBlock:!1}),u===s&&l){const{parent:A}=r.doc.resolve(u);A.isTextblock&&!A.type.spec.code&&!A.childCount&&(u-=1,s+=1)}let p;c?(Array.isArray(t)?p=t.map(A=>A.text||"").join(""):typeof t=="object"&&t&&t.text?p=t.text:p=t,r.insertText(p,u,s)):(p=a,r.replaceWith(u,s,p)),n.updateSelection&&IFe(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:u,text:p}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:u,text:p})}return!0},wFe=()=>({state:e,dispatch:t})=>TOe(e,t),$Fe=()=>({state:e,dispatch:t})=>xOe(e,t),EFe=()=>({state:e,dispatch:t})=>yOe(e,t),RFe=()=>({state:e,dispatch:t})=>_Oe(e,t),OFe=()=>({tr:e,state:t,dispatch:n})=>{try{const r=$8(t.doc,t.selection.$from.pos,-1);return r==null?!1:(e.join(r,2),n&&n(e),!0)}catch{return!1}},FFe=()=>({state:e,dispatch:t,tr:n})=>{try{const r=$8(e.doc,e.selection.$from.pos,1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},MFe=()=>({state:e,dispatch:t})=>bOe(e,t),kFe=()=>({state:e,dispatch:t})=>COe(e,t);function B8(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function LFe(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))H0()||B8()?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 jFe=e=>({editor:t,view:n,tr:r,dispatch:i})=>{const o=LFe(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 ZR(e,t,n={}){const{from:r,to:i,empty:o}=e.selection,a=t?yn(t,e.schema):null,u=[];e.doc.nodesBetween(r,i,(f,p)=>{if(f.isText)return;const A=Math.max(r,p),h=Math.min(i,p+f.nodeSize);u.push({node:f,from:A,to:h})});const s=i-r,c=u.filter(f=>a?a.name===f.node.type.name:!0).filter(f=>Jm(f.node.attrs,n,{strict:!1}));return o?!!c.length:c.reduce((f,p)=>f+p.to-p.from,0)>=s}const UFe=(e,t={})=>({state:n,dispatch:r})=>{const i=yn(e,n.schema);return ZR(n,i,t)?wOe(n,r):!1},BFe=()=>({state:e,dispatch:t})=>OOe(e,t),WFe=e=>({state:t,dispatch:n})=>{const r=yn(e,t.schema);return WOe(r)(t,n)},KFe=()=>({state:e,dispatch:t})=>$Oe(e,t);function W8(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function IM(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 PFe=(e,t)=>({tr:n,state:r,dispatch:i})=>{let o=null,a=null;const u=W8(typeof e=="string"?e:e.name,r.schema);return u?(u==="node"&&(o=yn(e,r.schema)),u==="mark"&&(a=Hu(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,IM(c.attrs,t)),a&&c.marks.length&&c.marks.forEach(f=>{a===f.type&&n.addMark(l,l+c.nodeSize,a.create(IM(f.attrs,t)))})})}),!0):!1},DFe=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),NFe=()=>({tr:e,commands:t})=>t.setTextSelection({from:0,to:e.doc.content.size}),qFe=()=>({state:e,dispatch:t})=>SOe(e,t),QFe=()=>({state:e,dispatch:t})=>IOe(e,t),VFe=()=>({state:e,dispatch:t})=>FOe(e,t),zFe=()=>({state:e,dispatch:t})=>LOe(e,t),HFe=()=>({state:e,dispatch:t})=>kOe(e,t);function YFe(e,t,n={}){return Zm(e,t,{slice:!1,parseOptions:n})}const GFe=(e,t=!1,n={})=>({tr:r,editor:i,dispatch:o})=>{const{doc:a}=r,u=YFe(e,i.schema,n);return o&&r.replaceWith(0,a.content.size,u).setMeta("preventUpdate",!t),!0};function XR(e,t){const n=Hu(t,e.schema),{from:r,to:i,empty:o}=e.selection,a=[];o?(e.storedMarks&&a.push(...e.storedMarks),a.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,s=>{a.push(...s.marks)});const u=a.find(s=>s.type.name===n.name);return u?{...u.attrs}:{}}function JFe(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 ZFe(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 eO(e){return t=>ZFe(t.$from,e)}function XFe(e,t){const n=sl.resolve(e);return j8(n,t)}function K8(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach(i=>{const o=n.resolve(e-1),a=GR(o,i.type);a&&r.push({mark:i,...a})}):n.nodesBetween(e,t,(i,o)=>{!i||(i==null?void 0:i.nodeSize)===void 0||r.push(...i.marks.map(a=>({from:o,to:o+i.nodeSize,mark:a})))}),r}function om(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 eMe(e,t,n={}){const{empty:r,ranges:i}=e.selection,o=t?Hu(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(f=>o?o.name===f.type.name:!0).find(f=>Jm(f.attrs,n,{strict:!1}));let a=0;const u=[];if(i.forEach(({$from:f,$to:p})=>{const A=f.pos,h=p.pos;e.doc.nodesBetween(A,h,(v,_)=>{if(!v.isText&&!v.marks.length)return;const S=Math.max(A,_),I=Math.min(h,_+v.nodeSize),T=I-S;a+=T,u.push(...v.marks.map(g=>({mark:g,from:S,to:I})))})}),a===0)return!1;const s=u.filter(f=>o?o.name===f.mark.type.name:!0).filter(f=>Jm(f.mark.attrs,n,{strict:!1})).reduce((f,p)=>f+p.to-p.from,0),c=u.filter(f=>o?f.mark.type!==o&&f.mark.type.excludes(o):!0).reduce((f,p)=>f+p.to-p.from,0);return(s>0?s+c:s)>=a}function TM(e,t){const{nodeExtensions:n}=V0(t),r=n.find(a=>a.name===e);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=Me(oe(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function tMe(e){return e instanceof me}function nMe(e,t,n){const i=e.state.doc.content.size,o=Yo(t,0,i),a=Yo(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),p=Math.max(u.right,s.right),A=p-f,h=l-c,S={top:c,bottom:l,left:f,right:p,width:A,height:h,x:f,y:c};return{...S,toJSON:()=>S}}function rMe(e,t,n){var r;const{selection:i}=t;let o=null;if(JR(i)&&(o=i.$cursor),o){const u=(r=e.storedMarks)!==null&&r!==void 0?r:o.marks();return!!n.isInSet(u)||!u.some(s=>s.type.excludes(n))}const{ranges:a}=i;return a.some(({$from:u,$to:s})=>{let c=u.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(u.pos,s.pos,(l,f,p)=>{if(c)return!1;if(l.isInline){const A=!p||p.type.allowsMarkType(n),h=!!n.isInSet(l.marks)||!l.marks.some(v=>v.type.excludes(n));c=A&&h}return!c}),c})}const iMe=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:a,ranges:u}=o,s=Hu(e,r.schema);if(i)if(a){const c=XR(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,(p,A)=>{const h=Math.max(A,l),v=Math.min(A+p.nodeSize,f);p.marks.find(S=>S.type===s)?p.marks.forEach(S=>{s===S.type&&n.addMark(h,v,s.create({...S.attrs,...t}))}):n.addMark(h,v,s.create(t))})});return rMe(r,n,s)},oMe=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),aMe=(e,t={})=>({state:n,dispatch:r,chain:i})=>{const o=yn(e,n.schema);return o.isTextblock?i().command(({commands:a})=>yM(o,t)(n)?!0:a.clearNodes()).command(({state:a})=>yM(o,t)(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},uMe=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,i=Yo(e,0,r.content.size),o=me.create(r,i);t.setSelection(o)}return!0},sMe=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,{from:i,to:o}=typeof e=="number"?{from:e,to:e}:e,a=Ke.atStart(r).from,u=Ke.atEnd(r).to,s=Yo(i,a,u),c=Yo(o,a,u),l=Ke.create(r,s,c);t.setSelection(l)}return!0},cMe=e=>({state:t,dispatch:n})=>{const r=yn(e,t.schema);return DOe(r)(t,n)};function xM(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 lMe=({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=om(c,u.node().type.name,u.node().attrs);if(o instanceof me&&o.node.isBlock)return!u.parentOffset||!im(a,u.pos)?!1:(r&&(e&&xM(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 Ke&&t.deleteSelection();const p=u.depth===0?void 0:JFe(u.node(-1).contentMatchAt(u.indexAfter(-1)));let A=f&&p?[{type:p,attrs:l}]:void 0,h=im(t.doc,t.mapping.map(u.pos),1,A);if(!A&&!h&&im(t.doc,t.mapping.map(u.pos),1,p?[{type:p}]:void 0)&&(h=!0,A=p?[{type:p,attrs:l}]:void 0),h&&(t.split(t.mapping.map(u.pos),1,A),p&&!f&&!u.parentOffset&&u.parent.type!==p)){const v=t.mapping.map(u.before()),_=t.doc.resolve(v);u.node(-1).canReplaceWith(_.index(),_.index()+1,p)&&t.setNodeMarkup(t.mapping.map(u.before()),p)}e&&xM(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return!0},fMe=e=>({tr:t,state:n,dispatch:r,editor:i})=>{var o;const a=yn(e,n.schema),{$from:u,$to:s}=n.selection,c=n.selection.node;if(c&&c.isBlock||u.depth<2||!u.sameParent(s))return!1;const l=u.node(-1);if(l.type!==a)return!1;const f=i.extensionManager.attributes;if(u.parent.content.size===0&&u.node(-1).childCount===u.indexAfter(-1)){if(u.depth===2||u.node(-3).type!==a||u.index(-2)!==u.node(-2).childCount-1)return!1;if(r){let _=G.empty;const S=u.index(-1)?1:u.index(-2)?2:3;for(let x=u.depth-S;x>=u.depth-3;x-=1)_=G.from(u.node(x).copy(_));const I=u.indexAfter(-1)<u.node(-2).childCount?1:u.indexAfter(-2)<u.node(-3).childCount?2:3,T=om(f,u.node().type.name,u.node().attrs),g=((o=a.contentMatch.defaultType)===null||o===void 0?void 0:o.createAndFill(T))||void 0;_=_.append(G.from(a.createAndFill(null,g)||void 0));const C=u.before(u.depth-(S-1));t.replace(C,u.after(-I),new re(_,4-S,0));let y=-1;t.doc.nodesBetween(C,t.doc.content.size,(x,w)=>{if(y>-1)return!1;x.isTextblock&&x.content.size===0&&(y=w+1)}),y>-1&&t.setSelection(Ke.near(t.doc.resolve(y))),t.scrollIntoView()}return!0}const p=s.pos===u.end()?l.contentMatchAt(0).defaultType:null,A=om(f,l.type.name,l.attrs),h=om(f,u.node().type.name,u.node().attrs);t.delete(u.pos,s.pos);const v=p?[{type:a,attrs:A},{type:p,attrs:h}]:[{type:a,attrs:A}];if(!im(t.doc,u.pos,2))return!1;if(r){const{selection:_,storedMarks:S}=n,{splittableMarks:I}=i.extensionManager,T=S||_.$to.parentOffset&&_.$from.marks();if(t.split(u.pos,2,v).scrollIntoView(),!T||!r)return!0;const g=T.filter(C=>I.includes(C.type.name));t.ensureMarks(g)}return!0},o1=(e,t)=>{const n=eO(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)&&qR(e.doc,n.pos)&&e.join(n.pos),!0},a1=(e,t)=>{const n=eO(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)&&qR(e.doc,r)&&e.join(r),!0},dMe=(e,t,n,r={})=>({editor:i,tr:o,state:a,dispatch:u,chain:s,commands:c,can:l})=>{const{extensions:f,splittableMarks:p}=i.extensionManager,A=yn(e,a.schema),h=yn(t,a.schema),{selection:v,storedMarks:_}=a,{$from:S,$to:I}=v,T=S.blockRange(I),g=_||v.$to.parentOffset&&v.$from.marks();if(!T)return!1;const C=eO(y=>TM(y.type.name,f))(v);if(T.depth>=1&&C&&T.depth-C.depth<=1){if(C.node.type===A)return c.liftListItem(h);if(TM(C.node.type.name,f)&&A.validContent(C.node.content)&&u)return s().command(()=>(o.setNodeMarkup(C.pos,A),!0)).command(()=>o1(o,A)).command(()=>a1(o,A)).run()}return!n||!g||!u?s().command(()=>l().wrapInList(A,r)?!0:c.clearNodes()).wrapInList(A,r).command(()=>o1(o,A)).command(()=>a1(o,A)).run():s().command(()=>{const y=l().wrapInList(A,r),x=g.filter(w=>p.includes(w.type.name));return o.ensureMarks(x),y?!0:c.clearNodes()}).wrapInList(A,r).command(()=>o1(o,A)).command(()=>a1(o,A)).run()},pMe=(e,t={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,a=Hu(e,r.schema);return eMe(r,a,t)?i.unsetMark(a,{extendEmptyMarkRange:o}):i.setMark(a,t)},AMe=(e,t,n={})=>({state:r,commands:i})=>{const o=yn(e,r.schema),a=yn(t,r.schema);return ZR(r,o,n)?i.setNode(a):i.setNode(o,n)},hMe=(e,t={})=>({state:n,commands:r})=>{const i=yn(e,n.schema);return ZR(n,i,t)?r.lift(i):r.wrapIn(i,t)},mMe=()=>({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},gMe=()=>({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},vMe=(e,t={})=>({tr:n,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:a=!1}=t,{selection:u}=n,s=Hu(e,r.schema),{$from:c,empty:l,ranges:f}=u;if(!i)return!0;if(l&&a){let{from:p,to:A}=u;const h=(o=c.marks().find(_=>_.type===s))===null||o===void 0?void 0:o.attrs,v=GR(c,s,h);v&&(p=v.from,A=v.to),n.removeMark(p,A,s)}else f.forEach(p=>{n.removeMark(p.$from.pos,p.$to.pos,s)});return n.removeStoredMark(s),!0},yMe=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let o=null,a=null;const u=W8(typeof e=="string"?e:e.name,r.schema);return u?(u==="node"&&(o=yn(e,r.schema)),u==="mark"&&(a=Hu(e,r.schema)),i&&n.selection.ranges.forEach(s=>{const c=s.$from.pos,l=s.$to.pos;r.doc.nodesBetween(c,l,(f,p)=>{o&&o===f.type&&n.setNodeMarkup(p,void 0,{...f.attrs,...t}),a&&f.marks.length&&f.marks.forEach(A=>{if(a===A.type){const h=Math.max(p,c),v=Math.min(p+f.nodeSize,l);n.addMark(h,v,a.create({...A.attrs,...t}))}})})}),!0):!1},bMe=(e,t={})=>({state:n,dispatch:r})=>{const i=yn(e,n.schema);return jOe(i,t)(n,r)},CMe=(e,t={})=>({state:n,dispatch:r})=>{const i=yn(e,n.schema);return UOe(i,t)(n,r)};var SMe=Object.freeze({__proto__:null,blur:oFe,clearContent:aFe,clearNodes:uFe,command:sFe,createParagraphNear:cFe,cut:lFe,deleteCurrentNode:fFe,deleteNode:dFe,deleteRange:pFe,deleteSelection:AFe,enter:hFe,exitCode:mFe,extendMarkRange:vFe,first:yFe,focus:CFe,forEach:SFe,insertContent:_Fe,insertContentAt:xFe,joinUp:wFe,joinDown:$Fe,joinBackward:EFe,joinForward:RFe,joinItemBackward:OFe,joinItemForward:FFe,joinTextblockBackward:MFe,joinTextblockForward:kFe,keyboardShortcut:jFe,lift:UFe,liftEmptyBlock:BFe,liftListItem:WFe,newlineInCode:KFe,resetAttributes:PFe,scrollIntoView:DFe,selectAll:NFe,selectNodeBackward:qFe,selectNodeForward:QFe,selectParentNode:VFe,selectTextblockEnd:zFe,selectTextblockStart:HFe,setContent:GFe,setMark:iMe,setMeta:oMe,setNode:aMe,setNodeSelection:uMe,setTextSelection:sMe,sinkListItem:cMe,splitBlock:lMe,splitListItem:fMe,toggleList:dMe,toggleMark:pMe,toggleNode:AMe,toggleWrap:hMe,undoInputRule:mMe,unsetAllMarks:gMe,unsetMark:vMe,updateAttributes:yMe,wrapIn:bMe,wrapInList:CMe});cr.create({name:"commands",addCommands(){return{...SMe}}});cr.create({name:"editable",addProseMirrorPlugins(){return[new Nr({key:new Gi("editable"),props:{editable:()=>this.editor.options.editable}})]}});cr.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new Nr({key:new Gi("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}}}})]}});cr.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:p,parent:A}=f,h=f.parent.isTextblock&&p>0?u.doc.resolve(p-1):f,v=h.parent.type.spec.isolating,_=f.pos-f.parentOffset,S=v&&h.parent.childCount===1?_===f.pos:Qe.atStart(c).from===p;return!l||!S||!A.type.isTextblock||A.textContent.length?!1:a.clearNodes()}),()=>a.deleteSelection(),()=>a.joinBackward(),()=>a.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:a})=>[()=>a.deleteSelection(),()=>a.deleteCurrentNode(),()=>a.joinForward(),()=>a.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:a})=>[()=>a.newlineInCode(),()=>a.createParagraphNear(),()=>a.liftEmptyBlock(),()=>a.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return H0()||B8()?o:i},addProseMirrorPlugins(){return[new Nr({key:new Gi("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=Qe.atStart(t.doc).from,s=Qe.atEnd(t.doc).to;if(i||!(o===u&&a===s)||!(n.doc.textBetween(0,n.doc.content.size," "," ").length===0))return;const f=n.tr,p=Q0({state:n,transaction:f}),{commands:A}=new zR({editor:this.editor,state:p});if(A.clearNodes(),!!f.steps.length)return f}})]}});cr.create({name:"tabindex",addProseMirrorPlugins(){return[new Nr({key:new Gi("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});function Xm(e){return new YR({find:e.find,handler:({state:t,range:n,match:r})=>{const i=Me(e.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=t,a=r[r.length-1],u=r[0];if(a){const s=u.search(/\S/),c=n.from+u.indexOf(a),l=c+a.length;if(K8(n.from,n.to,t.doc).filter(A=>A.mark.type.excluded.find(v=>v===e.type&&v!==A.mark.type)).filter(A=>A.to>c).length)return null;l<n.to&&o.delete(l,n.to),c>n.from&&o.delete(n.from+s,c);const p=n.from+s+a.length;o.addMark(n.from+s,p,e.type.create(i||{})),o.removeStoredMark(e.type)}}})}function yC(e){return new YR({find:e.find,handler:({state:t,range:n,match:r})=>{const i=t.doc.resolve(n.from),o=Me(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,o)}})}function eg(e){return new YR({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{const o=Me(e.getAttributes,void 0,r)||{},a=t.tr.delete(n.from,n.to),s=a.doc.resolve(n.from).blockRange(),c=s&&hOe(s,e.type,o);if(!c)return null;if(a.wrap(s,c),e.keepMarks&&e.editor){const{selection:f,storedMarks:p}=t,{splittableMarks:A}=e.editor.extensionManager,h=p||f.$to.parentOffset&&f.$from.marks();if(h){const v=h.filter(_=>A.includes(_.type.name));a.ensureMarks(v)}}if(e.keepAttributes){const f=e.type.name==="bulletList"||e.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(f,o).run()}const l=a.doc.resolve(n.from-1).nodeBefore;l&&l.type===e.type&&qR(a.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,l))&&a.join(n.from-1)}})}let Kc=class bC{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&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Me(oe(this,"addOptions",{name:this.name}))),this.storage=Me(oe(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new bC(t)}configure(t={}){const n=this.extend();return n.options=z0(this.options,t),n.storage=Me(oe(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){const n=new bC({...this.config,...t});return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Me(oe(n,"addOptions",{name:n.name})),n.storage=Me(oe(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 kn{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&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Me(oe(this,"addOptions",{name:this.name}))),this.storage=Me(oe(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new kn(t)}configure(t={}){const n=this.extend();return n.options=z0(this.options,t),n.storage=Me(oe(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){const n=new kn({...this.config,...t});return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Me(oe(n,"addOptions",{name:n.name})),n.storage=Me(oe(n,"addStorage",{name:n.name,options:n.options})),n}}function _Me(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}class IMe{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)&&r.contains(l)||!f)return;let p=0,A=0;if(this.dom!==f){const _=this.dom.getBoundingClientRect(),S=f.getBoundingClientRect(),I=(i=t.offsetX)!==null&&i!==void 0?i:(o=t.nativeEvent)===null||o===void 0?void 0:o.offsetX,T=(a=t.offsetY)!==null&&a!==void 0?a:(u=t.nativeEvent)===null||u===void 0?void 0:u.offsetY;p=S.x-_.x+I,A=S.y-_.y+T}(s=t.dataTransfer)===null||s===void 0||s.setDragImage(this.dom,p,A);const h=me.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.startsWith("drag"),a=t.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(r.tagName)||r.isContentEditable)&&!a&&!o)return!0;const{isEditable:s}=this.editor,{isDragging:c}=this,l=!!this.node.type.spec.draggable,f=me.isSelectable(this.node),p=t.type==="copy",A=t.type==="paste",h=t.type==="cut",v=t.type==="mousedown";if(!l&&f&&o&&t.preventDefault(),l&&o&&!c)return t.preventDefault(),!1;if(l&&s&&!c&&v){const _=r.closest("[data-drag-handle]");_&&(this.dom===_||this.dom.contains(_))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(c||a||p||A||h||v&&f)}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"&&(H0()||_Me())&&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 tg(e){return new GOe({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{const o=Me(e.getAttributes,void 0,r,i);if(o===!1||o===null)return null;const{tr:a}=t,u=r[r.length-1],s=r[0];let c=n.to;if(u){const l=s.search(/\S/),f=n.from+s.indexOf(u),p=f+u.length;if(K8(n.from,n.to,t.doc).filter(h=>h.mark.type.excluded.find(_=>_===e.type&&_!==h.mark.type)).filter(h=>h.to>f).length)return null;p<n.to&&a.delete(p,n.to),f>n.from&&a.delete(n.from+l,f),c=n.from+l+u.length,a.addMark(n.from+l,c,e.type.create(o||{})),a.removeStoredMark(e.type)}}})}function TMe(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}var ng=200,Zt=function(){};Zt.prototype.append=function(t){return t.length?(t=Zt.from(t),!this.length&&t||t.length<ng&&this.leafAppend(t)||this.length<ng&&t.leafPrepend(this)||this.appendInner(t)):this};Zt.prototype.prepend=function(t){return t.length?Zt.from(t).append(this):this};Zt.prototype.appendInner=function(t){return new xMe(this,t)};Zt.prototype.slice=function(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.length),t>=n?Zt.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))};Zt.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};Zt.prototype.forEach=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(t,n,r,0):this.forEachInvertedInner(t,n,r,0)};Zt.prototype.map=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,a){return i.push(t(o,a))},n,r),i};Zt.from=function(t){return t instanceof Zt?t:t&&t.length?new P8(t):Zt.empty};var P8=function(e){function t(r){e.call(this),this.values=r}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new t(this.values.slice(i,o))},t.prototype.getInner=function(i){return this.values[i]},t.prototype.forEachInner=function(i,o,a,u){for(var s=o;s<a;s++)if(i(this.values[s],u+s)===!1)return!1},t.prototype.forEachInvertedInner=function(i,o,a,u){for(var s=o-1;s>=a;s--)if(i(this.values[s],u+s)===!1)return!1},t.prototype.leafAppend=function(i){if(this.length+i.length<=ng)return new t(this.values.concat(i.flatten()))},t.prototype.leafPrepend=function(i){if(this.length+i.length<=ng)return new t(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(Zt);Zt.empty=new P8([]);var xMe=function(e){function t(n,r){e.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},t.prototype.forEachInner=function(r,i,o,a){var u=this.left.length;if(i<u&&this.left.forEachInner(r,i,Math.min(o,u),a)===!1||o>u&&this.right.forEachInner(r,Math.max(i-u,0),Math.min(this.length,o)-u,a+u)===!1)return!1},t.prototype.forEachInvertedInner=function(r,i,o,a){var u=this.left.length;if(i>u&&this.right.forEachInvertedInner(r,i-u,Math.max(o,u)-u,a+u)===!1||o<u&&this.left.forEachInvertedInner(r,Math.min(i,u),o,a)===!1)return!1},t.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(r,i):r>=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},t.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new t(this.left,i)},t.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new t(i,this.right)},t.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new t(this.left,new t(this.right,r)):new t(this,r)},t}(Zt);const wMe=500;class yi{constructor(t,n){this.items=t,this.eventCount=n}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let a=t.tr,u,s,c=[],l=[];return this.items.forEach((f,p)=>{if(!f.step){i||(i=this.remapping(r,p+1),o=i.maps.length),o--,l.push(f);return}if(i){l.push(new Xi(f.map));let A=f.step.map(i.slice(o)),h;A&&a.maybeStep(A).doc&&(h=a.mapping.maps[a.mapping.maps.length-1],c.push(new Xi(h,void 0,void 0,c.length+l.length))),o--,h&&i.appendMap(h,o)}else a.maybeStep(f.step);if(f.selection)return u=i?f.selection.map(i.slice(o)):f.selection,s=new yi(this.items.slice(0,r).append(l.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:s,transform:a,selection:u}}addTransform(t,n,r,i){let o=[],a=this.eventCount,u=this.items,s=!i&&u.length?u.get(u.length-1):null;for(let l=0;l<t.steps.length;l++){let f=t.steps[l].invert(t.docs[l]),p=new Xi(t.mapping.maps[l],f,n),A;(A=s&&s.merge(p))&&(p=A,l?o.pop():u=u.slice(0,u.length-1)),o.push(p),n&&(a++,n=void 0),i||(s=p)}let c=a-r.depth;return c>EMe&&(u=$Me(u,c),a-=c),new yi(u.append(o),a)}remapping(t,n){let r=new Ed;return this.items.forEach((i,o)=>{let a=i.mirrorOffset!=null&&o-i.mirrorOffset>=t?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,a)},t,n),r}addMaps(t){return this.eventCount==0?this:new yi(this.items.append(t.map(n=>new Xi(n))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=t.mapping,a=t.steps.length,u=this.eventCount;this.items.forEach(p=>{p.selection&&u--},i);let s=n;this.items.forEach(p=>{let A=o.getMirror(--s);if(A==null)return;a=Math.min(a,A);let h=o.maps[A];if(p.step){let v=t.steps[A].invert(t.docs[A]),_=p.selection&&p.selection.map(o.slice(s+1,A));_&&u++,r.push(new Xi(h,v,_))}else r.push(new Xi(h))},i);let c=[];for(let p=n;p<a;p++)c.push(new Xi(o.maps[p]));let l=this.items.slice(0,i).append(c).append(r),f=new yi(l,u);return f.emptyItemCount()>wMe&&(f=f.compress(this.items.length-r.length)),f}emptyItemCount(){let t=0;return this.items.forEach(n=>{n.step||t++}),t}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],o=0;return this.items.forEach((a,u)=>{if(u>=t)i.push(a),a.selection&&o++;else if(a.step){let s=a.step.map(n.slice(r)),c=s&&s.getMap();if(r--,c&&n.appendMap(c,r),s){let l=a.selection&&a.selection.map(n.slice(r));l&&o++;let f=new Xi(c.invert(),s,l),p,A=i.length-1;(p=i.length&&i[A].merge(f))?i[A]=p:i.push(f)}}else a.map&&r--},this.items.length,0),new yi(Zt.from(i.reverse()),o)}}yi.empty=new yi(Zt.empty,0);function $Me(e,t){let n;return e.forEach((r,i)=>{if(r.selection&&t--==0)return n=i,!1}),e.slice(n)}class Xi{constructor(t,n,r,i){this.map=t,this.step=n,this.selection=r,this.mirrorOffset=i}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new Xi(n.getMap().invert(),n,this.selection)}}}class Ya{constructor(t,n,r,i,o){this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const EMe=20;function RMe(e,t,n,r){let i=n.getMeta(iu),o;if(i)return i.historyState;n.getMeta(FMe)&&(e=new Ya(e.done,e.undone,null,0,-1));let a=n.getMeta("appendedTransaction");if(n.steps.length==0)return e;if(a&&a.getMeta(iu))return a.getMeta(iu).redo?new Ya(e.done.addTransform(n,void 0,r,am(t)),e.undone,wM(n.mapping.maps[n.steps.length-1]),e.prevTime,e.prevComposition):new Ya(e.done,e.undone.addTransform(n,void 0,r,am(t)),null,e.prevTime,e.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let u=n.getMeta("composition"),s=e.prevTime==0||!a&&e.prevComposition!=u&&(e.prevTime<(n.time||0)-r.newGroupDelay||!OMe(n,e.prevRanges)),c=a?u1(e.prevRanges,n.mapping):wM(n.mapping.maps[n.steps.length-1]);return new Ya(e.done.addTransform(n,s?t.selection.getBookmark():void 0,r,am(t)),yi.empty,c,n.time,u??e.prevComposition)}else return(o=n.getMeta("rebased"))?new Ya(e.done.rebased(n,o),e.undone.rebased(n,o),u1(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new Ya(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),u1(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function OMe(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((r,i)=>{for(let o=0;o<t.length;o+=2)r<=t[o+1]&&i>=t[o]&&(n=!0)}),n}function wM(e){let t=[];return e.forEach((n,r,i,o)=>t.push(i,o)),t}function u1(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),o=t.map(e[r+1],-1);i<=o&&n.push(i,o)}return n}function D8(e,t,n,r){let i=am(t),o=iu.get(t).spec.config,a=(r?e.undone:e.done).popEvent(t,i);if(!a)return;let u=a.selection.resolve(a.transform.doc),s=(r?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),o,i),c=new Ya(r?s:a.remaining,r?a.remaining:s,null,0,-1);n(a.transform.setSelection(u).setMeta(iu,{redo:r,historyState:c}).scrollIntoView())}let s1=!1,$M=null;function am(e){let t=e.plugins;if($M!=t){s1=!1,$M=t;for(let n=0;n<t.length;n++)if(t[n].spec.historyPreserveItems){s1=!0;break}}return s1}const iu=new Gi("history"),FMe=new Gi("closeHistory");function MMe(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new Nr({key:iu,state:{init(){return new Ya(yi.empty,yi.empty,null,0,-1)},apply(t,n,r){return RMe(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(t,n){let r=n.inputType,i=r=="historyUndo"?N8:r=="historyRedo"?q8:null;return i?(n.preventDefault(),i(t.state,t.dispatch)):!1}}}})}const N8=(e,t)=>{let n=iu.getState(e);return!n||n.done.eventCount==0?!1:(t&&D8(n,e,t,!1),!0)},q8=(e,t)=>{let n=iu.getState(e);return!n||n.undone.eventCount==0?!1:(t&&D8(n,e,t,!0),!0)},kMe=cr.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>N8(e,t),redo:()=>({state:e,dispatch:t})=>q8(e,t)}},addProseMirrorPlugins(){return[MMe(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}});var or="top",Zr="bottom",Xr="right",ar="left",tO="auto",xh=[or,Zr,Xr,ar],Ll="start",yp="end",LMe="clippingParents",Q8="viewport",vd="popper",jMe="reference",EM=xh.reduce(function(e,t){return e.concat([t+"-"+Ll,t+"-"+yp])},[]),V8=[].concat(xh,[tO]).reduce(function(e,t){return e.concat([t,t+"-"+Ll,t+"-"+yp])},[]),UMe="beforeRead",BMe="read",WMe="afterRead",KMe="beforeMain",PMe="main",DMe="afterMain",NMe="beforeWrite",qMe="write",QMe="afterWrite",VMe=[UMe,BMe,WMe,KMe,PMe,DMe,NMe,qMe,QMe];function fo(e){return e?(e.nodeName||"").toLowerCase():null}function Or(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Ls(e){var t=Or(e).Element;return e instanceof t||e instanceof Element}function Jr(e){var t=Or(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function nO(e){if(typeof ShadowRoot>"u")return!1;var t=Or(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function zMe(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];!Jr(o)||!fo(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 HMe(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},{});!Jr(i)||!fo(i)||(Object.assign(i.style,u),Object.keys(o).forEach(function(s){i.removeAttribute(s)}))})}}const z8={name:"applyStyles",enabled:!0,phase:"write",fn:zMe,effect:HMe,requires:["computeStyles"]};function no(e){return e.split("-")[0]}var gs=Math.max,rg=Math.min,jl=Math.round;function CC(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function H8(){return!/^((?!chrome|android).)*safari/i.test(CC())}function Ul(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&Jr(e)&&(i=e.offsetWidth>0&&jl(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&jl(r.height)/e.offsetHeight||1);var a=Ls(e)?Or(e):window,u=a.visualViewport,s=!H8()&&n,c=(r.left+(s&&u?u.offsetLeft:0))/i,l=(r.top+(s&&u?u.offsetTop:0))/o,f=r.width/i,p=r.height/o;return{width:f,height:p,top:l,right:c+f,bottom:l+p,left:c,x:c,y:l}}function rO(e){var t=Ul(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 Y8(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&nO(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function ia(e){return Or(e).getComputedStyle(e)}function YMe(e){return["table","td","th"].indexOf(fo(e))>=0}function Yu(e){return((Ls(e)?e.ownerDocument:e.document)||window.document).documentElement}function Y0(e){return fo(e)==="html"?e:e.assignedSlot||e.parentNode||(nO(e)?e.host:null)||Yu(e)}function RM(e){return!Jr(e)||ia(e).position==="fixed"?null:e.offsetParent}function GMe(e){var t=/firefox/i.test(CC()),n=/Trident/i.test(CC());if(n&&Jr(e)){var r=ia(e);if(r.position==="fixed")return null}var i=Y0(e);for(nO(i)&&(i=i.host);Jr(i)&&["html","body"].indexOf(fo(i))<0;){var o=ia(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 wh(e){for(var t=Or(e),n=RM(e);n&&YMe(n)&&ia(n).position==="static";)n=RM(n);return n&&(fo(n)==="html"||fo(n)==="body"&&ia(n).position==="static")?t:n||GMe(e)||t}function iO(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Fd(e,t,n){return gs(e,rg(t,n))}function JMe(e,t,n){var r=Fd(e,t,n);return r>n?n:r}function G8(){return{top:0,right:0,bottom:0,left:0}}function J8(e){return Object.assign({},G8(),e)}function Z8(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var ZMe=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,J8(typeof t!="number"?t:Z8(t,xh))};function XMe(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,u=no(n.placement),s=iO(u),c=[ar,Xr].indexOf(u)>=0,l=c?"height":"width";if(!(!o||!a)){var f=ZMe(i.padding,n),p=rO(o),A=s==="y"?or:ar,h=s==="y"?Zr:Xr,v=n.rects.reference[l]+n.rects.reference[s]-a[s]-n.rects.popper[l],_=a[s]-n.rects.reference[s],S=wh(o),I=S?s==="y"?S.clientHeight||0:S.clientWidth||0:0,T=v/2-_/2,g=f[A],C=I-p[l]-f[h],y=I/2-p[l]/2+T,x=Fd(g,y,C),w=s;n.modifiersData[r]=(t={},t[w]=x,t.centerOffset=x-y,t)}}function eke(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||Y8(t.elements.popper,i)&&(t.elements.arrow=i))}const tke={name:"arrow",enabled:!0,phase:"main",fn:XMe,effect:eke,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Bl(e){return e.split("-")[1]}var nke={top:"auto",right:"auto",bottom:"auto",left:"auto"};function rke(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:jl(n*i)/i||0,y:jl(r*i)/i||0}}function OM(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,p=a.x,A=p===void 0?0:p,h=a.y,v=h===void 0?0:h,_=typeof l=="function"?l({x:A,y:v}):{x:A,y:v};A=_.x,v=_.y;var S=a.hasOwnProperty("x"),I=a.hasOwnProperty("y"),T=ar,g=or,C=window;if(c){var y=wh(n),x="clientHeight",w="clientWidth";if(y===Or(n)&&(y=Yu(n),ia(y).position!=="static"&&u==="absolute"&&(x="scrollHeight",w="scrollWidth")),y=y,i===or||(i===ar||i===Xr)&&o===yp){g=Zr;var M=f&&y===C&&C.visualViewport?C.visualViewport.height:y[x];v-=M-r.height,v*=s?1:-1}if(i===ar||(i===or||i===Zr)&&o===yp){T=Xr;var O=f&&y===C&&C.visualViewport?C.visualViewport.width:y[w];A-=O-r.width,A*=s?1:-1}}var F=Object.assign({position:u},c&&nke),K=l===!0?rke({x:A,y:v},Or(n)):{x:A,y:v};if(A=K.x,v=K.y,s){var N;return Object.assign({},F,(N={},N[g]=I?"0":"",N[T]=S?"0":"",N.transform=(C.devicePixelRatio||1)<=1?"translate("+A+"px, "+v+"px)":"translate3d("+A+"px, "+v+"px, 0)",N))}return Object.assign({},F,(t={},t[g]=I?v+"px":"",t[T]=S?A+"px":"",t.transform="",t))}function ike(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,a=o===void 0?!0:o,u=n.roundOffsets,s=u===void 0?!0:u,c={placement:no(t.placement),variation:Bl(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,OM(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:s})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,OM(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:s})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const oke={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:ike,data:{}};var Hh={passive:!0};function ake(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=Or(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&c.forEach(function(l){l.addEventListener("scroll",n.update,Hh)}),u&&s.addEventListener("resize",n.update,Hh),function(){o&&c.forEach(function(l){l.removeEventListener("scroll",n.update,Hh)}),u&&s.removeEventListener("resize",n.update,Hh)}}const uke={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:ake,data:{}};var ske={left:"right",right:"left",bottom:"top",top:"bottom"};function um(e){return e.replace(/left|right|bottom|top/g,function(t){return ske[t]})}var cke={start:"end",end:"start"};function FM(e){return e.replace(/start|end/g,function(t){return cke[t]})}function oO(e){var t=Or(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function aO(e){return Ul(Yu(e)).left+oO(e).scrollLeft}function lke(e,t){var n=Or(e),r=Yu(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,u=0,s=0;if(i){o=i.width,a=i.height;var c=H8();(c||!c&&t==="fixed")&&(u=i.offsetLeft,s=i.offsetTop)}return{width:o,height:a,x:u+aO(e),y:s}}function fke(e){var t,n=Yu(e),r=oO(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=gs(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=gs(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),u=-r.scrollLeft+aO(e),s=-r.scrollTop;return ia(i||n).direction==="rtl"&&(u+=gs(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:u,y:s}}function uO(e){var t=ia(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function X8(e){return["html","body","#document"].indexOf(fo(e))>=0?e.ownerDocument.body:Jr(e)&&uO(e)?e:X8(Y0(e))}function Md(e,t){var n;t===void 0&&(t=[]);var r=X8(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=Or(r),a=i?[o].concat(o.visualViewport||[],uO(r)?r:[]):r,u=t.concat(a);return i?u:u.concat(Md(Y0(a)))}function SC(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function dke(e,t){var n=Ul(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 MM(e,t,n){return t===Q8?SC(lke(e,n)):Ls(t)?dke(t,n):SC(fke(Yu(e)))}function pke(e){var t=Md(Y0(e)),n=["absolute","fixed"].indexOf(ia(e).position)>=0,r=n&&Jr(e)?wh(e):e;return Ls(r)?t.filter(function(i){return Ls(i)&&Y8(i,r)&&fo(i)!=="body"}):[]}function Ake(e,t,n,r){var i=t==="clippingParents"?pke(e):[].concat(t),o=[].concat(i,[n]),a=o[0],u=o.reduce(function(s,c){var l=MM(e,c,r);return s.top=gs(l.top,s.top),s.right=rg(l.right,s.right),s.bottom=rg(l.bottom,s.bottom),s.left=gs(l.left,s.left),s},MM(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 eQ(e){var t=e.reference,n=e.element,r=e.placement,i=r?no(r):null,o=r?Bl(r):null,a=t.x+t.width/2-n.width/2,u=t.y+t.height/2-n.height/2,s;switch(i){case or:s={x:a,y:t.y-n.height};break;case Zr:s={x:a,y:t.y+t.height};break;case Xr:s={x:t.x+t.width,y:u};break;case ar:s={x:t.x-n.width,y:u};break;default:s={x:t.x,y:t.y}}var c=i?iO(i):null;if(c!=null){var l=c==="y"?"height":"width";switch(o){case Ll:s[c]=s[c]-(t[l]/2-n[l]/2);break;case yp:s[c]=s[c]+(t[l]/2-n[l]/2);break}}return s}function bp(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?LMe:u,c=n.rootBoundary,l=c===void 0?Q8:c,f=n.elementContext,p=f===void 0?vd:f,A=n.altBoundary,h=A===void 0?!1:A,v=n.padding,_=v===void 0?0:v,S=J8(typeof _!="number"?_:Z8(_,xh)),I=p===vd?jMe:vd,T=e.rects.popper,g=e.elements[h?I:p],C=Ake(Ls(g)?g:g.contextElement||Yu(e.elements.popper),s,l,a),y=Ul(e.elements.reference),x=eQ({reference:y,element:T,strategy:"absolute",placement:i}),w=SC(Object.assign({},T,x)),M=p===vd?w:y,O={top:C.top-M.top+S.top,bottom:M.bottom-C.bottom+S.bottom,left:C.left-M.left+S.left,right:M.right-C.right+S.right},F=e.modifiersData.offset;if(p===vd&&F){var K=F[i];Object.keys(O).forEach(function(N){var J=[Xr,Zr].indexOf(N)>=0?1:-1,Z=[or,Zr].indexOf(N)>=0?"y":"x";O[N]+=K[Z]*J})}return O}function hke(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?V8:s,l=Bl(r),f=l?u?EM:EM.filter(function(h){return Bl(h)===l}):xh,p=f.filter(function(h){return c.indexOf(h)>=0});p.length===0&&(p=f);var A=p.reduce(function(h,v){return h[v]=bp(e,{placement:v,boundary:i,rootBoundary:o,padding:a})[no(v)],h},{});return Object.keys(A).sort(function(h,v){return A[h]-A[v]})}function mke(e){if(no(e)===tO)return[];var t=um(e);return[FM(e),t,FM(t)]}function gke(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,p=n.altBoundary,A=n.flipVariations,h=A===void 0?!0:A,v=n.allowedAutoPlacements,_=t.options.placement,S=no(_),I=S===_,T=s||(I||!h?[um(_)]:mke(_)),g=[_].concat(T).reduce(function(Se,rt){return Se.concat(no(rt)===tO?hke(t,{placement:rt,boundary:l,rootBoundary:f,padding:c,flipVariations:h,allowedAutoPlacements:v}):rt)},[]),C=t.rects.reference,y=t.rects.popper,x=new Map,w=!0,M=g[0],O=0;O<g.length;O++){var F=g[O],K=no(F),N=Bl(F)===Ll,J=[or,Zr].indexOf(K)>=0,Z=J?"width":"height",ae=bp(t,{placement:F,boundary:l,rootBoundary:f,altBoundary:p,padding:c}),ge=J?N?Xr:ar:N?Zr:or;C[Z]>y[Z]&&(ge=um(ge));var se=um(ge),k=[];if(o&&k.push(ae[K]<=0),u&&k.push(ae[ge]<=0,ae[se]<=0),k.every(function(Se){return Se})){M=F,w=!1;break}x.set(F,k)}if(w)for(var E=h?3:1,D=function(rt){var bt=g.find(function(Yt){var Oe=x.get(Yt);if(Oe)return Oe.slice(0,rt).every(function(mt){return mt})});if(bt)return M=bt,"break"},ue=E;ue>0;ue--){var ke=D(ue);if(ke==="break")break}t.placement!==M&&(t.modifiersData[r]._skip=!0,t.placement=M,t.reset=!0)}}const vke={name:"flip",enabled:!0,phase:"main",fn:gke,requiresIfExists:["offset"],data:{_skip:!1}};function kM(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 LM(e){return[or,Xr,Zr,ar].some(function(t){return e[t]>=0})}function yke(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=bp(t,{elementContext:"reference"}),u=bp(t,{altBoundary:!0}),s=kM(a,r),c=kM(u,i,o),l=LM(s),f=LM(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 bke={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:yke};function Cke(e,t,n){var r=no(e),i=[ar,or].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,[ar,Xr].indexOf(r)>=0?{x:u,y:a}:{x:a,y:u}}function Ske(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=i===void 0?[0,0]:i,a=V8.reduce(function(l,f){return l[f]=Cke(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 _ke={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Ske};function Ike(e){var t=e.state,n=e.name;t.modifiersData[n]=eQ({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const Tke={name:"popperOffsets",enabled:!0,phase:"read",fn:Ike,data:{}};function xke(e){return e==="x"?"y":"x"}function wke(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,p=n.tether,A=p===void 0?!0:p,h=n.tetherOffset,v=h===void 0?0:h,_=bp(t,{boundary:s,rootBoundary:c,padding:f,altBoundary:l}),S=no(t.placement),I=Bl(t.placement),T=!I,g=iO(S),C=xke(g),y=t.modifiersData.popperOffsets,x=t.rects.reference,w=t.rects.popper,M=typeof v=="function"?v(Object.assign({},t.rects,{placement:t.placement})):v,O=typeof M=="number"?{mainAxis:M,altAxis:M}:Object.assign({mainAxis:0,altAxis:0},M),F=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,K={x:0,y:0};if(y){if(o){var N,J=g==="y"?or:ar,Z=g==="y"?Zr:Xr,ae=g==="y"?"height":"width",ge=y[g],se=ge+_[J],k=ge-_[Z],E=A?-w[ae]/2:0,D=I===Ll?x[ae]:w[ae],ue=I===Ll?-w[ae]:-x[ae],ke=t.elements.arrow,Se=A&&ke?rO(ke):{width:0,height:0},rt=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:G8(),bt=rt[J],Yt=rt[Z],Oe=Fd(0,x[ae],Se[ae]),mt=T?x[ae]/2-E-Oe-bt-O.mainAxis:D-Oe-bt-O.mainAxis,lt=T?-x[ae]/2+E+Oe+Yt+O.mainAxis:ue+Oe+Yt+O.mainAxis,Tt=t.elements.arrow&&wh(t.elements.arrow),sn=Tt?g==="y"?Tt.clientTop||0:Tt.clientLeft||0:0,Fo=(N=F==null?void 0:F[g])!=null?N:0,Qa=ge+mt-Fo-sn,fi=ge+lt-Fo,qr=Fd(A?rg(se,Qa):se,ge,A?gs(k,fi):k);y[g]=qr,K[g]=qr-ge}if(u){var Zi,Mo=g==="x"?or:ar,di=g==="x"?Zr:Xr,tr=y[C],Qr=C==="y"?"height":"width",pi=tr+_[Mo],Ai=tr-_[di],ko=[or,ar].indexOf(S)!==-1,Lo=(Zi=F==null?void 0:F[C])!=null?Zi:0,jo=ko?pi:tr-x[Qr]-w[Qr]-Lo+O.altAxis,Vr=ko?tr+x[Qr]+w[Qr]-Lo-O.altAxis:Ai,Va=A&&ko?JMe(jo,tr,Vr):Fd(A?jo:pi,tr,A?Vr:Ai);y[C]=Va,K[C]=Va-tr}t.modifiersData[r]=K}}const $ke={name:"preventOverflow",enabled:!0,phase:"main",fn:wke,requiresIfExists:["offset"]};function Eke(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Rke(e){return e===Or(e)||!Jr(e)?oO(e):Eke(e)}function Oke(e){var t=e.getBoundingClientRect(),n=jl(t.width)/e.offsetWidth||1,r=jl(t.height)/e.offsetHeight||1;return n!==1||r!==1}function Fke(e,t,n){n===void 0&&(n=!1);var r=Jr(t),i=Jr(t)&&Oke(t),o=Yu(t),a=Ul(e,i,n),u={scrollLeft:0,scrollTop:0},s={x:0,y:0};return(r||!r&&!n)&&((fo(t)!=="body"||uO(o))&&(u=Rke(t)),Jr(t)?(s=Ul(t,!0),s.x+=t.clientLeft,s.y+=t.clientTop):o&&(s.x=aO(o))),{x:a.left+u.scrollLeft-s.x,y:a.top+u.scrollTop-s.y,width:a.width,height:a.height}}function Mke(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 kke(e){var t=Mke(e);return VMe.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function Lke(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function jke(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 jM={placement:"bottom",modifiers:[],strategy:"absolute"};function UM(){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 Uke(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,i=t.defaultOptions,o=i===void 0?jM:i;return function(u,s,c){c===void 0&&(c=o);var l={placement:"bottom",orderedModifiers:[],options:Object.assign({},jM,o),modifiersData:{},elements:{reference:u,popper:s},attributes:{},styles:{}},f=[],p=!1,A={state:l,setOptions:function(S){var I=typeof S=="function"?S(l.options):S;v(),l.options=Object.assign({},o,l.options,I),l.scrollParents={reference:Ls(u)?Md(u):u.contextElement?Md(u.contextElement):[],popper:Md(s)};var T=kke(jke([].concat(r,l.options.modifiers)));return l.orderedModifiers=T.filter(function(g){return g.enabled}),h(),A.update()},forceUpdate:function(){if(!p){var S=l.elements,I=S.reference,T=S.popper;if(UM(I,T)){l.rects={reference:Fke(I,wh(T),l.options.strategy==="fixed"),popper:rO(T)},l.reset=!1,l.placement=l.options.placement,l.orderedModifiers.forEach(function(O){return l.modifiersData[O.name]=Object.assign({},O.data)});for(var g=0;g<l.orderedModifiers.length;g++){if(l.reset===!0){l.reset=!1,g=-1;continue}var C=l.orderedModifiers[g],y=C.fn,x=C.options,w=x===void 0?{}:x,M=C.name;typeof y=="function"&&(l=y({state:l,options:w,name:M,instance:A})||l)}}}},update:Lke(function(){return new Promise(function(_){A.forceUpdate(),_(l)})}),destroy:function(){v(),p=!0}};if(!UM(u,s))return A;A.setOptions(c).then(function(_){!p&&c.onFirstUpdate&&c.onFirstUpdate(_)});function h(){l.orderedModifiers.forEach(function(_){var S=_.name,I=_.options,T=I===void 0?{}:I,g=_.effect;if(typeof g=="function"){var C=g({state:l,name:S,instance:A,options:T}),y=function(){};f.push(C||y)}})}function v(){f.forEach(function(_){return _()}),f=[]}return A}}var Bke=[uke,Tke,oke,z8,_ke,vke,$ke,tke,bke],Wke=Uke({defaultModifiers:Bke}),Kke="tippy-box",tQ="tippy-content",Pke="tippy-backdrop",nQ="tippy-arrow",rQ="tippy-svg-arrow",ts={passive:!0,capture:!0},iQ=function(){return document.body};function Dke(e,t){return{}.hasOwnProperty.call(e,t)}function c1(e,t,n){if(Array.isArray(e)){var r=e[t];return r??(Array.isArray(n)?n[t]:n)}return e}function sO(e,t){var n={}.toString.call(e);return n.indexOf("[object")===0&&n.indexOf(t+"]")>-1}function oQ(e,t){return typeof e=="function"?e.apply(void 0,t):e}function BM(e,t){if(t===0)return e;var n;return function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)}}function Nke(e,t){var n=Object.assign({},e);return t.forEach(function(r){delete n[r]}),n}function qke(e){return e.split(/\s+/).filter(Boolean)}function ol(e){return[].concat(e)}function WM(e,t){e.indexOf(t)===-1&&e.push(t)}function Qke(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function Vke(e){return e.split("-")[0]}function ig(e){return[].slice.call(e)}function KM(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function kd(){return document.createElement("div")}function Cp(e){return["Element","Fragment"].some(function(t){return sO(e,t)})}function zke(e){return sO(e,"NodeList")}function Hke(e){return sO(e,"MouseEvent")}function Yke(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function Gke(e){return Cp(e)?[e]:zke(e)?ig(e):Array.isArray(e)?e:ig(document.querySelectorAll(e))}function l1(e,t){e.forEach(function(n){n&&(n.style.transitionDuration=t+"ms")})}function PM(e,t){e.forEach(function(n){n&&n.setAttribute("data-state",t)})}function Jke(e){var t,n=ol(e),r=n[0];return r!=null&&(t=r.ownerDocument)!=null&&t.body?r.ownerDocument:document}function Zke(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=Vke(a.placement),l=a.modifiersData.offset;if(!l)return!0;var f=c==="bottom"?l.top.y:0,p=c==="top"?l.bottom.y:0,A=c==="right"?l.left.x:0,h=c==="left"?l.right.x:0,v=o.top-r+f>s,_=r-o.bottom-p>s,S=o.left-n+A>s,I=n-o.right-h>s;return v||_||S||I})}function f1(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){e[r](i,n)})}function DM(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 eo={isTouch:!1},NM=0;function Xke(){eo.isTouch||(eo.isTouch=!0,window.performance&&document.addEventListener("mousemove",aQ))}function aQ(){var e=performance.now();e-NM<20&&(eo.isTouch=!1,document.removeEventListener("mousemove",aQ)),NM=e}function eLe(){var e=document.activeElement;if(Yke(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function tLe(){document.addEventListener("touchstart",Xke,ts),window.addEventListener("blur",eLe)}var nLe=typeof window<"u"&&typeof document<"u",rLe=nLe?!!window.msCrypto:!1;function Jc(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 qM(e){var t=/[ \t]{2,}/g,n=/^[ \t]*/gm;return e.replace(t," ").replace(n,"").trim()}function iLe(e){return qM(`
43
+ `,textSerializers:a={}}=n||{};let u="",s=!0;return e.nodesBetween(r,i,(c,l,f,p)=>{var A;const h=a==null?void 0:a[c.type.name];if(h)return c.isBlock&&!s&&(u+=o,s=!0),f&&(u+=h({node:c,pos:l,parent:f,index:p,range:t})),!1;c.isText?(u+=(A=c==null?void 0:c.text)===null||A===void 0?void 0:A.slice(Math.max(r,l)-l,i-l),s=!1):c.isBlock&&!s&&(u+=o,s=!0)}),u}function aFe(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}cr.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Nr({key:new Gi("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=aFe(n);return oFe(r,{from:a,to:u},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:s})}}})]}});const uFe=()=>({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),sFe=(e=!1)=>({commands:t})=>t.setContent("",e),cFe=()=>({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)),p=c.resolve(l.map(s+u.nodeSize)),A=f.blockRange(p);if(!A)return;const h=mOe(A);if(u.type.isTextblock){const{defaultType:v}=f.parent.contentMatchAt(f.index());t.setNodeMarkup(A.start,v)}(h||h===0)&&t.lift(A,h)})}),!0},lFe=e=>t=>e(t),fFe=()=>({state:e,dispatch:t})=>FOe(e,t),dFe=(e,t)=>({editor:n,tr:r})=>{const{state:i}=n,o=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);const a=r.mapping.map(t);return r.insert(a,o.content),r.setSelection(new Ke(r.doc.resolve(a-1))),!0},pFe=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;const i=e.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(t){const u=i.before(o),s=i.after(o);e.delete(u,s).scrollIntoView()}return!0}return!1},AFe=e=>({tr:t,state:n,dispatch:r})=>{const i=yn(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},hFe=e=>({tr:t,dispatch:n})=>{const{from:r,to:i}=e;return n&&t.delete(r,i),!0},mFe=()=>({state:e,dispatch:t})=>bOe(e,t),gFe=()=>({commands:e})=>e.keyboardShortcut("Enter"),vFe=()=>({state:e,dispatch:t})=>OOe(e,t);function Jm(e,t,n={strict:!0}){const r=Object.keys(t);return r.length?r.every(i=>n.strict?t[i]===e[i]:HR(t[i])?t[i].test(e[i]):t[i]===e[i]):!0}function vC(e,t,n={}){return e.find(r=>r.type===t&&Jm(r.attrs,n))}function yFe(e,t,n={}){return!!vC(e,t,n)}function GR(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=vC([...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(vC([...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&&yFe([...e.parent.child(u).marks],t,n);)s+=e.parent.child(u).nodeSize,u+=1;return{from:a,to:s}}function Hu(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 bFe=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const o=Hu(e,r.schema),{doc:a,selection:u}=n,{$from:s,from:c,to:l}=u;if(i){const f=GR(s,o,t);if(f&&f.from<=c&&f.to>=l){const p=Ke.create(a,f.from,f.to);n.setSelection(p)}}return!0},CFe=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 JR(e){return e instanceof Ke}function Yo(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function SFe(e,t=null){if(!t)return null;const n=Qe.atStart(e),r=Qe.atEnd(e);if(t==="start"||t===!0)return n;if(t==="end")return r;const i=n.from,o=r.to;return t==="all"?Ke.create(e,Yo(0,i,o),Yo(e.content.size,i,o)):Ke.create(e,Yo(t,i,o),Yo(t,i,o))}function H0(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const _Fe=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:o})=>{t={scrollIntoView:!0,...t};const a=()=>{H0()&&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&&!JR(n.state.selection))return a(),!0;const u=SFe(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},IFe=(e,t)=>n=>e.every((r,i)=>t(r,{...n,index:i})),TFe=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),U8=e=>{const t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){const r=t[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):r.nodeType===1&&U8(r)}return e};function _M(e){const t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,"text/html").body;return U8(n)}function Zm(e,t,n){if(n={slice:!0,parseOptions:{},...n},typeof e=="object"&&e!==null)try{return Array.isArray(e)&&e.length>0?G.fromArray(e.map(r=>t.nodeFromJSON(r))):t.nodeFromJSON(e)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",r),Zm("",t,n)}if(typeof e=="string"){const r=pp.fromSchema(t);return n.slice?r.parseSlice(_M(e),n.parseOptions).content:r.parse(_M(e),n.parseOptions)}return Zm("",t,n)}function xFe(e,t,n){const r=e.steps.length-1;if(r<t)return;const i=e.steps[r];if(!(i instanceof Qo||i instanceof pl))return;const o=e.mapping.maps[r];let a=0;o.forEach((u,s,c,l)=>{a===0&&(a=l)}),e.setSelection(Qe.near(e.doc.resolve(a),n))}const wFe=e=>e.toString().startsWith("<"),$Fe=(e,t,n)=>({tr:r,dispatch:i,editor:o})=>{if(i){n={parseOptions:{},updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};const a=Zm(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}:{from:e.from,to:e.to},c=!0,l=!0;if((wFe(a)?a:[a]).forEach(A=>{A.check(),c=c?A.isText&&A.marks.length===0:!1,l=l?A.isBlock:!1}),u===s&&l){const{parent:A}=r.doc.resolve(u);A.isTextblock&&!A.type.spec.code&&!A.childCount&&(u-=1,s+=1)}let p;c?(Array.isArray(t)?p=t.map(A=>A.text||"").join(""):typeof t=="object"&&t&&t.text?p=t.text:p=t,r.insertText(p,u,s)):(p=a,r.replaceWith(u,s,p)),n.updateSelection&&xFe(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:u,text:p}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:u,text:p})}return!0},EFe=()=>({state:e,dispatch:t})=>wOe(e,t),RFe=()=>({state:e,dispatch:t})=>$Oe(e,t),OFe=()=>({state:e,dispatch:t})=>COe(e,t),FFe=()=>({state:e,dispatch:t})=>TOe(e,t),MFe=()=>({tr:e,state:t,dispatch:n})=>{try{const r=$8(t.doc,t.selection.$from.pos,-1);return r==null?!1:(e.join(r,2),n&&n(e),!0)}catch{return!1}},kFe=()=>({state:e,dispatch:t,tr:n})=>{try{const r=$8(e.doc,e.selection.$from.pos,1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},LFe=()=>({state:e,dispatch:t})=>SOe(e,t),jFe=()=>({state:e,dispatch:t})=>_Oe(e,t);function B8(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function UFe(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))H0()||B8()?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 BFe=e=>({editor:t,view:n,tr:r,dispatch:i})=>{const o=UFe(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 ZR(e,t,n={}){const{from:r,to:i,empty:o}=e.selection,a=t?yn(t,e.schema):null,u=[];e.doc.nodesBetween(r,i,(f,p)=>{if(f.isText)return;const A=Math.max(r,p),h=Math.min(i,p+f.nodeSize);u.push({node:f,from:A,to:h})});const s=i-r,c=u.filter(f=>a?a.name===f.node.type.name:!0).filter(f=>Jm(f.node.attrs,n,{strict:!1}));return o?!!c.length:c.reduce((f,p)=>f+p.to-p.from,0)>=s}const WFe=(e,t={})=>({state:n,dispatch:r})=>{const i=yn(e,n.schema);return ZR(n,i,t)?EOe(n,r):!1},KFe=()=>({state:e,dispatch:t})=>MOe(e,t),PFe=e=>({state:t,dispatch:n})=>{const r=yn(e,t.schema);return POe(r)(t,n)},DFe=()=>({state:e,dispatch:t})=>ROe(e,t);function W8(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function IM(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 NFe=(e,t)=>({tr:n,state:r,dispatch:i})=>{let o=null,a=null;const u=W8(typeof e=="string"?e:e.name,r.schema);return u?(u==="node"&&(o=yn(e,r.schema)),u==="mark"&&(a=Hu(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,IM(c.attrs,t)),a&&c.marks.length&&c.marks.forEach(f=>{a===f.type&&n.addMark(l,l+c.nodeSize,a.create(IM(f.attrs,t)))})})}),!0):!1},qFe=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),QFe=()=>({tr:e,commands:t})=>t.setTextSelection({from:0,to:e.doc.content.size}),VFe=()=>({state:e,dispatch:t})=>IOe(e,t),zFe=()=>({state:e,dispatch:t})=>xOe(e,t),HFe=()=>({state:e,dispatch:t})=>kOe(e,t),YFe=()=>({state:e,dispatch:t})=>UOe(e,t),GFe=()=>({state:e,dispatch:t})=>jOe(e,t);function JFe(e,t,n={}){return Zm(e,t,{slice:!1,parseOptions:n})}const ZFe=(e,t=!1,n={})=>({tr:r,editor:i,dispatch:o})=>{const{doc:a}=r,u=JFe(e,i.schema,n);return o&&r.replaceWith(0,a.content.size,u).setMeta("preventUpdate",!t),!0};function XR(e,t){const n=Hu(t,e.schema),{from:r,to:i,empty:o}=e.selection,a=[];o?(e.storedMarks&&a.push(...e.storedMarks),a.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,s=>{a.push(...s.marks)});const u=a.find(s=>s.type.name===n.name);return u?{...u.attrs}:{}}function XFe(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 eMe(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 eO(e){return t=>eMe(t.$from,e)}function tMe(e,t){const n=sl.resolve(e);return j8(n,t)}function K8(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach(i=>{const o=n.resolve(e-1),a=GR(o,i.type);a&&r.push({mark:i,...a})}):n.nodesBetween(e,t,(i,o)=>{!i||(i==null?void 0:i.nodeSize)===void 0||r.push(...i.marks.map(a=>({from:o,to:o+i.nodeSize,mark:a})))}),r}function om(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 nMe(e,t,n={}){const{empty:r,ranges:i}=e.selection,o=t?Hu(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(f=>o?o.name===f.type.name:!0).find(f=>Jm(f.attrs,n,{strict:!1}));let a=0;const u=[];if(i.forEach(({$from:f,$to:p})=>{const A=f.pos,h=p.pos;e.doc.nodesBetween(A,h,(v,_)=>{if(!v.isText&&!v.marks.length)return;const S=Math.max(A,_),I=Math.min(h,_+v.nodeSize),T=I-S;a+=T,u.push(...v.marks.map(g=>({mark:g,from:S,to:I})))})}),a===0)return!1;const s=u.filter(f=>o?o.name===f.mark.type.name:!0).filter(f=>Jm(f.mark.attrs,n,{strict:!1})).reduce((f,p)=>f+p.to-p.from,0),c=u.filter(f=>o?f.mark.type!==o&&f.mark.type.excludes(o):!0).reduce((f,p)=>f+p.to-p.from,0);return(s>0?s+c:s)>=a}function TM(e,t){const{nodeExtensions:n}=V0(t),r=n.find(a=>a.name===e);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=Me(oe(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function rMe(e){return e instanceof me}function iMe(e,t,n){const i=e.state.doc.content.size,o=Yo(t,0,i),a=Yo(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),p=Math.max(u.right,s.right),A=p-f,h=l-c,S={top:c,bottom:l,left:f,right:p,width:A,height:h,x:f,y:c};return{...S,toJSON:()=>S}}function oMe(e,t,n){var r;const{selection:i}=t;let o=null;if(JR(i)&&(o=i.$cursor),o){const u=(r=e.storedMarks)!==null&&r!==void 0?r:o.marks();return!!n.isInSet(u)||!u.some(s=>s.type.excludes(n))}const{ranges:a}=i;return a.some(({$from:u,$to:s})=>{let c=u.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(u.pos,s.pos,(l,f,p)=>{if(c)return!1;if(l.isInline){const A=!p||p.type.allowsMarkType(n),h=!!n.isInSet(l.marks)||!l.marks.some(v=>v.type.excludes(n));c=A&&h}return!c}),c})}const aMe=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:a,ranges:u}=o,s=Hu(e,r.schema);if(i)if(a){const c=XR(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,(p,A)=>{const h=Math.max(A,l),v=Math.min(A+p.nodeSize,f);p.marks.find(S=>S.type===s)?p.marks.forEach(S=>{s===S.type&&n.addMark(h,v,s.create({...S.attrs,...t}))}):n.addMark(h,v,s.create(t))})});return oMe(r,n,s)},uMe=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),sMe=(e,t={})=>({state:n,dispatch:r,chain:i})=>{const o=yn(e,n.schema);return o.isTextblock?i().command(({commands:a})=>yM(o,t)(n)?!0:a.clearNodes()).command(({state:a})=>yM(o,t)(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},cMe=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,i=Yo(e,0,r.content.size),o=me.create(r,i);t.setSelection(o)}return!0},lMe=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,{from:i,to:o}=typeof e=="number"?{from:e,to:e}:e,a=Ke.atStart(r).from,u=Ke.atEnd(r).to,s=Yo(i,a,u),c=Yo(o,a,u),l=Ke.create(r,s,c);t.setSelection(l)}return!0},fMe=e=>({state:t,dispatch:n})=>{const r=yn(e,t.schema);return qOe(r)(t,n)};function xM(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 dMe=({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=om(c,u.node().type.name,u.node().attrs);if(o instanceof me&&o.node.isBlock)return!u.parentOffset||!im(a,u.pos)?!1:(r&&(e&&xM(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 Ke&&t.deleteSelection();const p=u.depth===0?void 0:XFe(u.node(-1).contentMatchAt(u.indexAfter(-1)));let A=f&&p?[{type:p,attrs:l}]:void 0,h=im(t.doc,t.mapping.map(u.pos),1,A);if(!A&&!h&&im(t.doc,t.mapping.map(u.pos),1,p?[{type:p}]:void 0)&&(h=!0,A=p?[{type:p,attrs:l}]:void 0),h&&(t.split(t.mapping.map(u.pos),1,A),p&&!f&&!u.parentOffset&&u.parent.type!==p)){const v=t.mapping.map(u.before()),_=t.doc.resolve(v);u.node(-1).canReplaceWith(_.index(),_.index()+1,p)&&t.setNodeMarkup(t.mapping.map(u.before()),p)}e&&xM(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return!0},pMe=e=>({tr:t,state:n,dispatch:r,editor:i})=>{var o;const a=yn(e,n.schema),{$from:u,$to:s}=n.selection,c=n.selection.node;if(c&&c.isBlock||u.depth<2||!u.sameParent(s))return!1;const l=u.node(-1);if(l.type!==a)return!1;const f=i.extensionManager.attributes;if(u.parent.content.size===0&&u.node(-1).childCount===u.indexAfter(-1)){if(u.depth===2||u.node(-3).type!==a||u.index(-2)!==u.node(-2).childCount-1)return!1;if(r){let _=G.empty;const S=u.index(-1)?1:u.index(-2)?2:3;for(let x=u.depth-S;x>=u.depth-3;x-=1)_=G.from(u.node(x).copy(_));const I=u.indexAfter(-1)<u.node(-2).childCount?1:u.indexAfter(-2)<u.node(-3).childCount?2:3,T=om(f,u.node().type.name,u.node().attrs),g=((o=a.contentMatch.defaultType)===null||o===void 0?void 0:o.createAndFill(T))||void 0;_=_.append(G.from(a.createAndFill(null,g)||void 0));const C=u.before(u.depth-(S-1));t.replace(C,u.after(-I),new re(_,4-S,0));let y=-1;t.doc.nodesBetween(C,t.doc.content.size,(x,w)=>{if(y>-1)return!1;x.isTextblock&&x.content.size===0&&(y=w+1)}),y>-1&&t.setSelection(Ke.near(t.doc.resolve(y))),t.scrollIntoView()}return!0}const p=s.pos===u.end()?l.contentMatchAt(0).defaultType:null,A=om(f,l.type.name,l.attrs),h=om(f,u.node().type.name,u.node().attrs);t.delete(u.pos,s.pos);const v=p?[{type:a,attrs:A},{type:p,attrs:h}]:[{type:a,attrs:A}];if(!im(t.doc,u.pos,2))return!1;if(r){const{selection:_,storedMarks:S}=n,{splittableMarks:I}=i.extensionManager,T=S||_.$to.parentOffset&&_.$from.marks();if(t.split(u.pos,2,v).scrollIntoView(),!T||!r)return!0;const g=T.filter(C=>I.includes(C.type.name));t.ensureMarks(g)}return!0},o1=(e,t)=>{const n=eO(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)&&qR(e.doc,n.pos)&&e.join(n.pos),!0},a1=(e,t)=>{const n=eO(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)&&qR(e.doc,r)&&e.join(r),!0},AMe=(e,t,n,r={})=>({editor:i,tr:o,state:a,dispatch:u,chain:s,commands:c,can:l})=>{const{extensions:f,splittableMarks:p}=i.extensionManager,A=yn(e,a.schema),h=yn(t,a.schema),{selection:v,storedMarks:_}=a,{$from:S,$to:I}=v,T=S.blockRange(I),g=_||v.$to.parentOffset&&v.$from.marks();if(!T)return!1;const C=eO(y=>TM(y.type.name,f))(v);if(T.depth>=1&&C&&T.depth-C.depth<=1){if(C.node.type===A)return c.liftListItem(h);if(TM(C.node.type.name,f)&&A.validContent(C.node.content)&&u)return s().command(()=>(o.setNodeMarkup(C.pos,A),!0)).command(()=>o1(o,A)).command(()=>a1(o,A)).run()}return!n||!g||!u?s().command(()=>l().wrapInList(A,r)?!0:c.clearNodes()).wrapInList(A,r).command(()=>o1(o,A)).command(()=>a1(o,A)).run():s().command(()=>{const y=l().wrapInList(A,r),x=g.filter(w=>p.includes(w.type.name));return o.ensureMarks(x),y?!0:c.clearNodes()}).wrapInList(A,r).command(()=>o1(o,A)).command(()=>a1(o,A)).run()},hMe=(e,t={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,a=Hu(e,r.schema);return nMe(r,a,t)?i.unsetMark(a,{extendEmptyMarkRange:o}):i.setMark(a,t)},mMe=(e,t,n={})=>({state:r,commands:i})=>{const o=yn(e,r.schema),a=yn(t,r.schema);return ZR(r,o,n)?i.setNode(a):i.setNode(o,n)},gMe=(e,t={})=>({state:n,commands:r})=>{const i=yn(e,n.schema);return ZR(n,i,t)?r.lift(i):r.wrapIn(i,t)},vMe=()=>({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},yMe=()=>({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},bMe=(e,t={})=>({tr:n,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:a=!1}=t,{selection:u}=n,s=Hu(e,r.schema),{$from:c,empty:l,ranges:f}=u;if(!i)return!0;if(l&&a){let{from:p,to:A}=u;const h=(o=c.marks().find(_=>_.type===s))===null||o===void 0?void 0:o.attrs,v=GR(c,s,h);v&&(p=v.from,A=v.to),n.removeMark(p,A,s)}else f.forEach(p=>{n.removeMark(p.$from.pos,p.$to.pos,s)});return n.removeStoredMark(s),!0},CMe=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let o=null,a=null;const u=W8(typeof e=="string"?e:e.name,r.schema);return u?(u==="node"&&(o=yn(e,r.schema)),u==="mark"&&(a=Hu(e,r.schema)),i&&n.selection.ranges.forEach(s=>{const c=s.$from.pos,l=s.$to.pos;r.doc.nodesBetween(c,l,(f,p)=>{o&&o===f.type&&n.setNodeMarkup(p,void 0,{...f.attrs,...t}),a&&f.marks.length&&f.marks.forEach(A=>{if(a===A.type){const h=Math.max(p,c),v=Math.min(p+f.nodeSize,l);n.addMark(h,v,a.create({...A.attrs,...t}))}})})}),!0):!1},SMe=(e,t={})=>({state:n,dispatch:r})=>{const i=yn(e,n.schema);return BOe(i,t)(n,r)},_Me=(e,t={})=>({state:n,dispatch:r})=>{const i=yn(e,n.schema);return WOe(i,t)(n,r)};var IMe=Object.freeze({__proto__:null,blur:uFe,clearContent:sFe,clearNodes:cFe,command:lFe,createParagraphNear:fFe,cut:dFe,deleteCurrentNode:pFe,deleteNode:AFe,deleteRange:hFe,deleteSelection:mFe,enter:gFe,exitCode:vFe,extendMarkRange:bFe,first:CFe,focus:_Fe,forEach:IFe,insertContent:TFe,insertContentAt:$Fe,joinUp:EFe,joinDown:RFe,joinBackward:OFe,joinForward:FFe,joinItemBackward:MFe,joinItemForward:kFe,joinTextblockBackward:LFe,joinTextblockForward:jFe,keyboardShortcut:BFe,lift:WFe,liftEmptyBlock:KFe,liftListItem:PFe,newlineInCode:DFe,resetAttributes:NFe,scrollIntoView:qFe,selectAll:QFe,selectNodeBackward:VFe,selectNodeForward:zFe,selectParentNode:HFe,selectTextblockEnd:YFe,selectTextblockStart:GFe,setContent:ZFe,setMark:aMe,setMeta:uMe,setNode:sMe,setNodeSelection:cMe,setTextSelection:lMe,sinkListItem:fMe,splitBlock:dMe,splitListItem:pMe,toggleList:AMe,toggleMark:hMe,toggleNode:mMe,toggleWrap:gMe,undoInputRule:vMe,unsetAllMarks:yMe,unsetMark:bMe,updateAttributes:CMe,wrapIn:SMe,wrapInList:_Me});cr.create({name:"commands",addCommands(){return{...IMe}}});cr.create({name:"editable",addProseMirrorPlugins(){return[new Nr({key:new Gi("editable"),props:{editable:()=>this.editor.options.editable}})]}});cr.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new Nr({key:new Gi("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}}}})]}});cr.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:p,parent:A}=f,h=f.parent.isTextblock&&p>0?u.doc.resolve(p-1):f,v=h.parent.type.spec.isolating,_=f.pos-f.parentOffset,S=v&&h.parent.childCount===1?_===f.pos:Qe.atStart(c).from===p;return!l||!S||!A.type.isTextblock||A.textContent.length?!1:a.clearNodes()}),()=>a.deleteSelection(),()=>a.joinBackward(),()=>a.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:a})=>[()=>a.deleteSelection(),()=>a.deleteCurrentNode(),()=>a.joinForward(),()=>a.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:a})=>[()=>a.newlineInCode(),()=>a.createParagraphNear(),()=>a.liftEmptyBlock(),()=>a.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return H0()||B8()?o:i},addProseMirrorPlugins(){return[new Nr({key:new Gi("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=Qe.atStart(t.doc).from,s=Qe.atEnd(t.doc).to;if(i||!(o===u&&a===s)||!(n.doc.textBetween(0,n.doc.content.size," "," ").length===0))return;const f=n.tr,p=Q0({state:n,transaction:f}),{commands:A}=new zR({editor:this.editor,state:p});if(A.clearNodes(),!!f.steps.length)return f}})]}});cr.create({name:"tabindex",addProseMirrorPlugins(){return[new Nr({key:new Gi("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});function Xm(e){return new YR({find:e.find,handler:({state:t,range:n,match:r})=>{const i=Me(e.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=t,a=r[r.length-1],u=r[0];if(a){const s=u.search(/\S/),c=n.from+u.indexOf(a),l=c+a.length;if(K8(n.from,n.to,t.doc).filter(A=>A.mark.type.excluded.find(v=>v===e.type&&v!==A.mark.type)).filter(A=>A.to>c).length)return null;l<n.to&&o.delete(l,n.to),c>n.from&&o.delete(n.from+s,c);const p=n.from+s+a.length;o.addMark(n.from+s,p,e.type.create(i||{})),o.removeStoredMark(e.type)}}})}function yC(e){return new YR({find:e.find,handler:({state:t,range:n,match:r})=>{const i=t.doc.resolve(n.from),o=Me(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,o)}})}function eg(e){return new YR({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{const o=Me(e.getAttributes,void 0,r)||{},a=t.tr.delete(n.from,n.to),s=a.doc.resolve(n.from).blockRange(),c=s&&gOe(s,e.type,o);if(!c)return null;if(a.wrap(s,c),e.keepMarks&&e.editor){const{selection:f,storedMarks:p}=t,{splittableMarks:A}=e.editor.extensionManager,h=p||f.$to.parentOffset&&f.$from.marks();if(h){const v=h.filter(_=>A.includes(_.type.name));a.ensureMarks(v)}}if(e.keepAttributes){const f=e.type.name==="bulletList"||e.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(f,o).run()}const l=a.doc.resolve(n.from-1).nodeBefore;l&&l.type===e.type&&qR(a.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,l))&&a.join(n.from-1)}})}let Kc=class bC{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&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Me(oe(this,"addOptions",{name:this.name}))),this.storage=Me(oe(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new bC(t)}configure(t={}){const n=this.extend();return n.options=z0(this.options,t),n.storage=Me(oe(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){const n=new bC({...this.config,...t});return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Me(oe(n,"addOptions",{name:n.name})),n.storage=Me(oe(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 kn{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&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Me(oe(this,"addOptions",{name:this.name}))),this.storage=Me(oe(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new kn(t)}configure(t={}){const n=this.extend();return n.options=z0(this.options,t),n.storage=Me(oe(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){const n=new kn({...this.config,...t});return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Me(oe(n,"addOptions",{name:n.name})),n.storage=Me(oe(n,"addStorage",{name:n.name,options:n.options})),n}}function TMe(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}class xMe{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)&&r.contains(l)||!f)return;let p=0,A=0;if(this.dom!==f){const _=this.dom.getBoundingClientRect(),S=f.getBoundingClientRect(),I=(i=t.offsetX)!==null&&i!==void 0?i:(o=t.nativeEvent)===null||o===void 0?void 0:o.offsetX,T=(a=t.offsetY)!==null&&a!==void 0?a:(u=t.nativeEvent)===null||u===void 0?void 0:u.offsetY;p=S.x-_.x+I,A=S.y-_.y+T}(s=t.dataTransfer)===null||s===void 0||s.setDragImage(this.dom,p,A);const h=me.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.startsWith("drag"),a=t.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(r.tagName)||r.isContentEditable)&&!a&&!o)return!0;const{isEditable:s}=this.editor,{isDragging:c}=this,l=!!this.node.type.spec.draggable,f=me.isSelectable(this.node),p=t.type==="copy",A=t.type==="paste",h=t.type==="cut",v=t.type==="mousedown";if(!l&&f&&o&&t.preventDefault(),l&&o&&!c)return t.preventDefault(),!1;if(l&&s&&!c&&v){const _=r.closest("[data-drag-handle]");_&&(this.dom===_||this.dom.contains(_))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(c||a||p||A||h||v&&f)}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"&&(H0()||TMe())&&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 tg(e){return new ZOe({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{const o=Me(e.getAttributes,void 0,r,i);if(o===!1||o===null)return null;const{tr:a}=t,u=r[r.length-1],s=r[0];let c=n.to;if(u){const l=s.search(/\S/),f=n.from+s.indexOf(u),p=f+u.length;if(K8(n.from,n.to,t.doc).filter(h=>h.mark.type.excluded.find(_=>_===e.type&&_!==h.mark.type)).filter(h=>h.to>f).length)return null;p<n.to&&a.delete(p,n.to),f>n.from&&a.delete(n.from+l,f),c=n.from+l+u.length,a.addMark(n.from+l,c,e.type.create(o||{})),a.removeStoredMark(e.type)}}})}function wMe(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}var ng=200,Zt=function(){};Zt.prototype.append=function(t){return t.length?(t=Zt.from(t),!this.length&&t||t.length<ng&&this.leafAppend(t)||this.length<ng&&t.leafPrepend(this)||this.appendInner(t)):this};Zt.prototype.prepend=function(t){return t.length?Zt.from(t).append(this):this};Zt.prototype.appendInner=function(t){return new $Me(this,t)};Zt.prototype.slice=function(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.length),t>=n?Zt.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))};Zt.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};Zt.prototype.forEach=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(t,n,r,0):this.forEachInvertedInner(t,n,r,0)};Zt.prototype.map=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,a){return i.push(t(o,a))},n,r),i};Zt.from=function(t){return t instanceof Zt?t:t&&t.length?new P8(t):Zt.empty};var P8=function(e){function t(r){e.call(this),this.values=r}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new t(this.values.slice(i,o))},t.prototype.getInner=function(i){return this.values[i]},t.prototype.forEachInner=function(i,o,a,u){for(var s=o;s<a;s++)if(i(this.values[s],u+s)===!1)return!1},t.prototype.forEachInvertedInner=function(i,o,a,u){for(var s=o-1;s>=a;s--)if(i(this.values[s],u+s)===!1)return!1},t.prototype.leafAppend=function(i){if(this.length+i.length<=ng)return new t(this.values.concat(i.flatten()))},t.prototype.leafPrepend=function(i){if(this.length+i.length<=ng)return new t(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(Zt);Zt.empty=new P8([]);var $Me=function(e){function t(n,r){e.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},t.prototype.forEachInner=function(r,i,o,a){var u=this.left.length;if(i<u&&this.left.forEachInner(r,i,Math.min(o,u),a)===!1||o>u&&this.right.forEachInner(r,Math.max(i-u,0),Math.min(this.length,o)-u,a+u)===!1)return!1},t.prototype.forEachInvertedInner=function(r,i,o,a){var u=this.left.length;if(i>u&&this.right.forEachInvertedInner(r,i-u,Math.max(o,u)-u,a+u)===!1||o<u&&this.left.forEachInvertedInner(r,Math.min(i,u),o,a)===!1)return!1},t.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(r,i):r>=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},t.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new t(this.left,i)},t.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new t(i,this.right)},t.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new t(this.left,new t(this.right,r)):new t(this,r)},t}(Zt);const EMe=500;class yi{constructor(t,n){this.items=t,this.eventCount=n}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let a=t.tr,u,s,c=[],l=[];return this.items.forEach((f,p)=>{if(!f.step){i||(i=this.remapping(r,p+1),o=i.maps.length),o--,l.push(f);return}if(i){l.push(new Xi(f.map));let A=f.step.map(i.slice(o)),h;A&&a.maybeStep(A).doc&&(h=a.mapping.maps[a.mapping.maps.length-1],c.push(new Xi(h,void 0,void 0,c.length+l.length))),o--,h&&i.appendMap(h,o)}else a.maybeStep(f.step);if(f.selection)return u=i?f.selection.map(i.slice(o)):f.selection,s=new yi(this.items.slice(0,r).append(l.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:s,transform:a,selection:u}}addTransform(t,n,r,i){let o=[],a=this.eventCount,u=this.items,s=!i&&u.length?u.get(u.length-1):null;for(let l=0;l<t.steps.length;l++){let f=t.steps[l].invert(t.docs[l]),p=new Xi(t.mapping.maps[l],f,n),A;(A=s&&s.merge(p))&&(p=A,l?o.pop():u=u.slice(0,u.length-1)),o.push(p),n&&(a++,n=void 0),i||(s=p)}let c=a-r.depth;return c>OMe&&(u=RMe(u,c),a-=c),new yi(u.append(o),a)}remapping(t,n){let r=new Ed;return this.items.forEach((i,o)=>{let a=i.mirrorOffset!=null&&o-i.mirrorOffset>=t?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,a)},t,n),r}addMaps(t){return this.eventCount==0?this:new yi(this.items.append(t.map(n=>new Xi(n))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=t.mapping,a=t.steps.length,u=this.eventCount;this.items.forEach(p=>{p.selection&&u--},i);let s=n;this.items.forEach(p=>{let A=o.getMirror(--s);if(A==null)return;a=Math.min(a,A);let h=o.maps[A];if(p.step){let v=t.steps[A].invert(t.docs[A]),_=p.selection&&p.selection.map(o.slice(s+1,A));_&&u++,r.push(new Xi(h,v,_))}else r.push(new Xi(h))},i);let c=[];for(let p=n;p<a;p++)c.push(new Xi(o.maps[p]));let l=this.items.slice(0,i).append(c).append(r),f=new yi(l,u);return f.emptyItemCount()>EMe&&(f=f.compress(this.items.length-r.length)),f}emptyItemCount(){let t=0;return this.items.forEach(n=>{n.step||t++}),t}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],o=0;return this.items.forEach((a,u)=>{if(u>=t)i.push(a),a.selection&&o++;else if(a.step){let s=a.step.map(n.slice(r)),c=s&&s.getMap();if(r--,c&&n.appendMap(c,r),s){let l=a.selection&&a.selection.map(n.slice(r));l&&o++;let f=new Xi(c.invert(),s,l),p,A=i.length-1;(p=i.length&&i[A].merge(f))?i[A]=p:i.push(f)}}else a.map&&r--},this.items.length,0),new yi(Zt.from(i.reverse()),o)}}yi.empty=new yi(Zt.empty,0);function RMe(e,t){let n;return e.forEach((r,i)=>{if(r.selection&&t--==0)return n=i,!1}),e.slice(n)}class Xi{constructor(t,n,r,i){this.map=t,this.step=n,this.selection=r,this.mirrorOffset=i}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new Xi(n.getMap().invert(),n,this.selection)}}}class Ya{constructor(t,n,r,i,o){this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const OMe=20;function FMe(e,t,n,r){let i=n.getMeta(iu),o;if(i)return i.historyState;n.getMeta(kMe)&&(e=new Ya(e.done,e.undone,null,0,-1));let a=n.getMeta("appendedTransaction");if(n.steps.length==0)return e;if(a&&a.getMeta(iu))return a.getMeta(iu).redo?new Ya(e.done.addTransform(n,void 0,r,am(t)),e.undone,wM(n.mapping.maps[n.steps.length-1]),e.prevTime,e.prevComposition):new Ya(e.done,e.undone.addTransform(n,void 0,r,am(t)),null,e.prevTime,e.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let u=n.getMeta("composition"),s=e.prevTime==0||!a&&e.prevComposition!=u&&(e.prevTime<(n.time||0)-r.newGroupDelay||!MMe(n,e.prevRanges)),c=a?u1(e.prevRanges,n.mapping):wM(n.mapping.maps[n.steps.length-1]);return new Ya(e.done.addTransform(n,s?t.selection.getBookmark():void 0,r,am(t)),yi.empty,c,n.time,u??e.prevComposition)}else return(o=n.getMeta("rebased"))?new Ya(e.done.rebased(n,o),e.undone.rebased(n,o),u1(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new Ya(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),u1(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function MMe(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((r,i)=>{for(let o=0;o<t.length;o+=2)r<=t[o+1]&&i>=t[o]&&(n=!0)}),n}function wM(e){let t=[];return e.forEach((n,r,i,o)=>t.push(i,o)),t}function u1(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),o=t.map(e[r+1],-1);i<=o&&n.push(i,o)}return n}function D8(e,t,n,r){let i=am(t),o=iu.get(t).spec.config,a=(r?e.undone:e.done).popEvent(t,i);if(!a)return;let u=a.selection.resolve(a.transform.doc),s=(r?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),o,i),c=new Ya(r?s:a.remaining,r?a.remaining:s,null,0,-1);n(a.transform.setSelection(u).setMeta(iu,{redo:r,historyState:c}).scrollIntoView())}let s1=!1,$M=null;function am(e){let t=e.plugins;if($M!=t){s1=!1,$M=t;for(let n=0;n<t.length;n++)if(t[n].spec.historyPreserveItems){s1=!0;break}}return s1}const iu=new Gi("history"),kMe=new Gi("closeHistory");function LMe(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new Nr({key:iu,state:{init(){return new Ya(yi.empty,yi.empty,null,0,-1)},apply(t,n,r){return FMe(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(t,n){let r=n.inputType,i=r=="historyUndo"?N8:r=="historyRedo"?q8:null;return i?(n.preventDefault(),i(t.state,t.dispatch)):!1}}}})}const N8=(e,t)=>{let n=iu.getState(e);return!n||n.done.eventCount==0?!1:(t&&D8(n,e,t,!1),!0)},q8=(e,t)=>{let n=iu.getState(e);return!n||n.undone.eventCount==0?!1:(t&&D8(n,e,t,!0),!0)},jMe=cr.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>N8(e,t),redo:()=>({state:e,dispatch:t})=>q8(e,t)}},addProseMirrorPlugins(){return[LMe(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}});var or="top",Zr="bottom",Xr="right",ar="left",tO="auto",xh=[or,Zr,Xr,ar],Ll="start",yp="end",UMe="clippingParents",Q8="viewport",vd="popper",BMe="reference",EM=xh.reduce(function(e,t){return e.concat([t+"-"+Ll,t+"-"+yp])},[]),V8=[].concat(xh,[tO]).reduce(function(e,t){return e.concat([t,t+"-"+Ll,t+"-"+yp])},[]),WMe="beforeRead",KMe="read",PMe="afterRead",DMe="beforeMain",NMe="main",qMe="afterMain",QMe="beforeWrite",VMe="write",zMe="afterWrite",HMe=[WMe,KMe,PMe,DMe,NMe,qMe,QMe,VMe,zMe];function fo(e){return e?(e.nodeName||"").toLowerCase():null}function Or(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Ls(e){var t=Or(e).Element;return e instanceof t||e instanceof Element}function Jr(e){var t=Or(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function nO(e){if(typeof ShadowRoot>"u")return!1;var t=Or(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function YMe(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];!Jr(o)||!fo(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 GMe(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},{});!Jr(i)||!fo(i)||(Object.assign(i.style,u),Object.keys(o).forEach(function(s){i.removeAttribute(s)}))})}}const z8={name:"applyStyles",enabled:!0,phase:"write",fn:YMe,effect:GMe,requires:["computeStyles"]};function no(e){return e.split("-")[0]}var gs=Math.max,rg=Math.min,jl=Math.round;function CC(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function H8(){return!/^((?!chrome|android).)*safari/i.test(CC())}function Ul(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&Jr(e)&&(i=e.offsetWidth>0&&jl(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&jl(r.height)/e.offsetHeight||1);var a=Ls(e)?Or(e):window,u=a.visualViewport,s=!H8()&&n,c=(r.left+(s&&u?u.offsetLeft:0))/i,l=(r.top+(s&&u?u.offsetTop:0))/o,f=r.width/i,p=r.height/o;return{width:f,height:p,top:l,right:c+f,bottom:l+p,left:c,x:c,y:l}}function rO(e){var t=Ul(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 Y8(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&nO(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function ia(e){return Or(e).getComputedStyle(e)}function JMe(e){return["table","td","th"].indexOf(fo(e))>=0}function Yu(e){return((Ls(e)?e.ownerDocument:e.document)||window.document).documentElement}function Y0(e){return fo(e)==="html"?e:e.assignedSlot||e.parentNode||(nO(e)?e.host:null)||Yu(e)}function RM(e){return!Jr(e)||ia(e).position==="fixed"?null:e.offsetParent}function ZMe(e){var t=/firefox/i.test(CC()),n=/Trident/i.test(CC());if(n&&Jr(e)){var r=ia(e);if(r.position==="fixed")return null}var i=Y0(e);for(nO(i)&&(i=i.host);Jr(i)&&["html","body"].indexOf(fo(i))<0;){var o=ia(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 wh(e){for(var t=Or(e),n=RM(e);n&&JMe(n)&&ia(n).position==="static";)n=RM(n);return n&&(fo(n)==="html"||fo(n)==="body"&&ia(n).position==="static")?t:n||ZMe(e)||t}function iO(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Fd(e,t,n){return gs(e,rg(t,n))}function XMe(e,t,n){var r=Fd(e,t,n);return r>n?n:r}function G8(){return{top:0,right:0,bottom:0,left:0}}function J8(e){return Object.assign({},G8(),e)}function Z8(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var eke=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,J8(typeof t!="number"?t:Z8(t,xh))};function tke(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,u=no(n.placement),s=iO(u),c=[ar,Xr].indexOf(u)>=0,l=c?"height":"width";if(!(!o||!a)){var f=eke(i.padding,n),p=rO(o),A=s==="y"?or:ar,h=s==="y"?Zr:Xr,v=n.rects.reference[l]+n.rects.reference[s]-a[s]-n.rects.popper[l],_=a[s]-n.rects.reference[s],S=wh(o),I=S?s==="y"?S.clientHeight||0:S.clientWidth||0:0,T=v/2-_/2,g=f[A],C=I-p[l]-f[h],y=I/2-p[l]/2+T,x=Fd(g,y,C),w=s;n.modifiersData[r]=(t={},t[w]=x,t.centerOffset=x-y,t)}}function nke(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||Y8(t.elements.popper,i)&&(t.elements.arrow=i))}const rke={name:"arrow",enabled:!0,phase:"main",fn:tke,effect:nke,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Bl(e){return e.split("-")[1]}var ike={top:"auto",right:"auto",bottom:"auto",left:"auto"};function oke(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:jl(n*i)/i||0,y:jl(r*i)/i||0}}function OM(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,p=a.x,A=p===void 0?0:p,h=a.y,v=h===void 0?0:h,_=typeof l=="function"?l({x:A,y:v}):{x:A,y:v};A=_.x,v=_.y;var S=a.hasOwnProperty("x"),I=a.hasOwnProperty("y"),T=ar,g=or,C=window;if(c){var y=wh(n),x="clientHeight",w="clientWidth";if(y===Or(n)&&(y=Yu(n),ia(y).position!=="static"&&u==="absolute"&&(x="scrollHeight",w="scrollWidth")),y=y,i===or||(i===ar||i===Xr)&&o===yp){g=Zr;var M=f&&y===C&&C.visualViewport?C.visualViewport.height:y[x];v-=M-r.height,v*=s?1:-1}if(i===ar||(i===or||i===Zr)&&o===yp){T=Xr;var O=f&&y===C&&C.visualViewport?C.visualViewport.width:y[w];A-=O-r.width,A*=s?1:-1}}var F=Object.assign({position:u},c&&ike),K=l===!0?oke({x:A,y:v},Or(n)):{x:A,y:v};if(A=K.x,v=K.y,s){var N;return Object.assign({},F,(N={},N[g]=I?"0":"",N[T]=S?"0":"",N.transform=(C.devicePixelRatio||1)<=1?"translate("+A+"px, "+v+"px)":"translate3d("+A+"px, "+v+"px, 0)",N))}return Object.assign({},F,(t={},t[g]=I?v+"px":"",t[T]=S?A+"px":"",t.transform="",t))}function ake(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,a=o===void 0?!0:o,u=n.roundOffsets,s=u===void 0?!0:u,c={placement:no(t.placement),variation:Bl(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,OM(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:s})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,OM(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:s})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const uke={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:ake,data:{}};var Hh={passive:!0};function ske(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=Or(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&c.forEach(function(l){l.addEventListener("scroll",n.update,Hh)}),u&&s.addEventListener("resize",n.update,Hh),function(){o&&c.forEach(function(l){l.removeEventListener("scroll",n.update,Hh)}),u&&s.removeEventListener("resize",n.update,Hh)}}const cke={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:ske,data:{}};var lke={left:"right",right:"left",bottom:"top",top:"bottom"};function um(e){return e.replace(/left|right|bottom|top/g,function(t){return lke[t]})}var fke={start:"end",end:"start"};function FM(e){return e.replace(/start|end/g,function(t){return fke[t]})}function oO(e){var t=Or(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function aO(e){return Ul(Yu(e)).left+oO(e).scrollLeft}function dke(e,t){var n=Or(e),r=Yu(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,u=0,s=0;if(i){o=i.width,a=i.height;var c=H8();(c||!c&&t==="fixed")&&(u=i.offsetLeft,s=i.offsetTop)}return{width:o,height:a,x:u+aO(e),y:s}}function pke(e){var t,n=Yu(e),r=oO(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=gs(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=gs(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),u=-r.scrollLeft+aO(e),s=-r.scrollTop;return ia(i||n).direction==="rtl"&&(u+=gs(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:u,y:s}}function uO(e){var t=ia(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function X8(e){return["html","body","#document"].indexOf(fo(e))>=0?e.ownerDocument.body:Jr(e)&&uO(e)?e:X8(Y0(e))}function Md(e,t){var n;t===void 0&&(t=[]);var r=X8(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=Or(r),a=i?[o].concat(o.visualViewport||[],uO(r)?r:[]):r,u=t.concat(a);return i?u:u.concat(Md(Y0(a)))}function SC(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Ake(e,t){var n=Ul(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 MM(e,t,n){return t===Q8?SC(dke(e,n)):Ls(t)?Ake(t,n):SC(pke(Yu(e)))}function hke(e){var t=Md(Y0(e)),n=["absolute","fixed"].indexOf(ia(e).position)>=0,r=n&&Jr(e)?wh(e):e;return Ls(r)?t.filter(function(i){return Ls(i)&&Y8(i,r)&&fo(i)!=="body"}):[]}function mke(e,t,n,r){var i=t==="clippingParents"?hke(e):[].concat(t),o=[].concat(i,[n]),a=o[0],u=o.reduce(function(s,c){var l=MM(e,c,r);return s.top=gs(l.top,s.top),s.right=rg(l.right,s.right),s.bottom=rg(l.bottom,s.bottom),s.left=gs(l.left,s.left),s},MM(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 eQ(e){var t=e.reference,n=e.element,r=e.placement,i=r?no(r):null,o=r?Bl(r):null,a=t.x+t.width/2-n.width/2,u=t.y+t.height/2-n.height/2,s;switch(i){case or:s={x:a,y:t.y-n.height};break;case Zr:s={x:a,y:t.y+t.height};break;case Xr:s={x:t.x+t.width,y:u};break;case ar:s={x:t.x-n.width,y:u};break;default:s={x:t.x,y:t.y}}var c=i?iO(i):null;if(c!=null){var l=c==="y"?"height":"width";switch(o){case Ll:s[c]=s[c]-(t[l]/2-n[l]/2);break;case yp:s[c]=s[c]+(t[l]/2-n[l]/2);break}}return s}function bp(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?UMe:u,c=n.rootBoundary,l=c===void 0?Q8:c,f=n.elementContext,p=f===void 0?vd:f,A=n.altBoundary,h=A===void 0?!1:A,v=n.padding,_=v===void 0?0:v,S=J8(typeof _!="number"?_:Z8(_,xh)),I=p===vd?BMe:vd,T=e.rects.popper,g=e.elements[h?I:p],C=mke(Ls(g)?g:g.contextElement||Yu(e.elements.popper),s,l,a),y=Ul(e.elements.reference),x=eQ({reference:y,element:T,strategy:"absolute",placement:i}),w=SC(Object.assign({},T,x)),M=p===vd?w:y,O={top:C.top-M.top+S.top,bottom:M.bottom-C.bottom+S.bottom,left:C.left-M.left+S.left,right:M.right-C.right+S.right},F=e.modifiersData.offset;if(p===vd&&F){var K=F[i];Object.keys(O).forEach(function(N){var J=[Xr,Zr].indexOf(N)>=0?1:-1,Z=[or,Zr].indexOf(N)>=0?"y":"x";O[N]+=K[Z]*J})}return O}function gke(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?V8:s,l=Bl(r),f=l?u?EM:EM.filter(function(h){return Bl(h)===l}):xh,p=f.filter(function(h){return c.indexOf(h)>=0});p.length===0&&(p=f);var A=p.reduce(function(h,v){return h[v]=bp(e,{placement:v,boundary:i,rootBoundary:o,padding:a})[no(v)],h},{});return Object.keys(A).sort(function(h,v){return A[h]-A[v]})}function vke(e){if(no(e)===tO)return[];var t=um(e);return[FM(e),t,FM(t)]}function yke(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,p=n.altBoundary,A=n.flipVariations,h=A===void 0?!0:A,v=n.allowedAutoPlacements,_=t.options.placement,S=no(_),I=S===_,T=s||(I||!h?[um(_)]:vke(_)),g=[_].concat(T).reduce(function(Se,rt){return Se.concat(no(rt)===tO?gke(t,{placement:rt,boundary:l,rootBoundary:f,padding:c,flipVariations:h,allowedAutoPlacements:v}):rt)},[]),C=t.rects.reference,y=t.rects.popper,x=new Map,w=!0,M=g[0],O=0;O<g.length;O++){var F=g[O],K=no(F),N=Bl(F)===Ll,J=[or,Zr].indexOf(K)>=0,Z=J?"width":"height",ae=bp(t,{placement:F,boundary:l,rootBoundary:f,altBoundary:p,padding:c}),ge=J?N?Xr:ar:N?Zr:or;C[Z]>y[Z]&&(ge=um(ge));var se=um(ge),k=[];if(o&&k.push(ae[K]<=0),u&&k.push(ae[ge]<=0,ae[se]<=0),k.every(function(Se){return Se})){M=F,w=!1;break}x.set(F,k)}if(w)for(var E=h?3:1,D=function(rt){var bt=g.find(function(Yt){var Oe=x.get(Yt);if(Oe)return Oe.slice(0,rt).every(function(mt){return mt})});if(bt)return M=bt,"break"},ue=E;ue>0;ue--){var ke=D(ue);if(ke==="break")break}t.placement!==M&&(t.modifiersData[r]._skip=!0,t.placement=M,t.reset=!0)}}const bke={name:"flip",enabled:!0,phase:"main",fn:yke,requiresIfExists:["offset"],data:{_skip:!1}};function kM(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 LM(e){return[or,Xr,Zr,ar].some(function(t){return e[t]>=0})}function Cke(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=bp(t,{elementContext:"reference"}),u=bp(t,{altBoundary:!0}),s=kM(a,r),c=kM(u,i,o),l=LM(s),f=LM(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 Ske={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Cke};function _ke(e,t,n){var r=no(e),i=[ar,or].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,[ar,Xr].indexOf(r)>=0?{x:u,y:a}:{x:a,y:u}}function Ike(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=i===void 0?[0,0]:i,a=V8.reduce(function(l,f){return l[f]=_ke(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 Tke={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Ike};function xke(e){var t=e.state,n=e.name;t.modifiersData[n]=eQ({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const wke={name:"popperOffsets",enabled:!0,phase:"read",fn:xke,data:{}};function $ke(e){return e==="x"?"y":"x"}function Eke(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,p=n.tether,A=p===void 0?!0:p,h=n.tetherOffset,v=h===void 0?0:h,_=bp(t,{boundary:s,rootBoundary:c,padding:f,altBoundary:l}),S=no(t.placement),I=Bl(t.placement),T=!I,g=iO(S),C=$ke(g),y=t.modifiersData.popperOffsets,x=t.rects.reference,w=t.rects.popper,M=typeof v=="function"?v(Object.assign({},t.rects,{placement:t.placement})):v,O=typeof M=="number"?{mainAxis:M,altAxis:M}:Object.assign({mainAxis:0,altAxis:0},M),F=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,K={x:0,y:0};if(y){if(o){var N,J=g==="y"?or:ar,Z=g==="y"?Zr:Xr,ae=g==="y"?"height":"width",ge=y[g],se=ge+_[J],k=ge-_[Z],E=A?-w[ae]/2:0,D=I===Ll?x[ae]:w[ae],ue=I===Ll?-w[ae]:-x[ae],ke=t.elements.arrow,Se=A&&ke?rO(ke):{width:0,height:0},rt=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:G8(),bt=rt[J],Yt=rt[Z],Oe=Fd(0,x[ae],Se[ae]),mt=T?x[ae]/2-E-Oe-bt-O.mainAxis:D-Oe-bt-O.mainAxis,lt=T?-x[ae]/2+E+Oe+Yt+O.mainAxis:ue+Oe+Yt+O.mainAxis,Tt=t.elements.arrow&&wh(t.elements.arrow),sn=Tt?g==="y"?Tt.clientTop||0:Tt.clientLeft||0:0,Fo=(N=F==null?void 0:F[g])!=null?N:0,Qa=ge+mt-Fo-sn,fi=ge+lt-Fo,qr=Fd(A?rg(se,Qa):se,ge,A?gs(k,fi):k);y[g]=qr,K[g]=qr-ge}if(u){var Zi,Mo=g==="x"?or:ar,di=g==="x"?Zr:Xr,tr=y[C],Qr=C==="y"?"height":"width",pi=tr+_[Mo],Ai=tr-_[di],ko=[or,ar].indexOf(S)!==-1,Lo=(Zi=F==null?void 0:F[C])!=null?Zi:0,jo=ko?pi:tr-x[Qr]-w[Qr]-Lo+O.altAxis,Vr=ko?tr+x[Qr]+w[Qr]-Lo-O.altAxis:Ai,Va=A&&ko?XMe(jo,tr,Vr):Fd(A?jo:pi,tr,A?Vr:Ai);y[C]=Va,K[C]=Va-tr}t.modifiersData[r]=K}}const Rke={name:"preventOverflow",enabled:!0,phase:"main",fn:Eke,requiresIfExists:["offset"]};function Oke(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Fke(e){return e===Or(e)||!Jr(e)?oO(e):Oke(e)}function Mke(e){var t=e.getBoundingClientRect(),n=jl(t.width)/e.offsetWidth||1,r=jl(t.height)/e.offsetHeight||1;return n!==1||r!==1}function kke(e,t,n){n===void 0&&(n=!1);var r=Jr(t),i=Jr(t)&&Mke(t),o=Yu(t),a=Ul(e,i,n),u={scrollLeft:0,scrollTop:0},s={x:0,y:0};return(r||!r&&!n)&&((fo(t)!=="body"||uO(o))&&(u=Fke(t)),Jr(t)?(s=Ul(t,!0),s.x+=t.clientLeft,s.y+=t.clientTop):o&&(s.x=aO(o))),{x:a.left+u.scrollLeft-s.x,y:a.top+u.scrollTop-s.y,width:a.width,height:a.height}}function Lke(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 jke(e){var t=Lke(e);return HMe.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function Uke(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function Bke(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 jM={placement:"bottom",modifiers:[],strategy:"absolute"};function UM(){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 Wke(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,i=t.defaultOptions,o=i===void 0?jM:i;return function(u,s,c){c===void 0&&(c=o);var l={placement:"bottom",orderedModifiers:[],options:Object.assign({},jM,o),modifiersData:{},elements:{reference:u,popper:s},attributes:{},styles:{}},f=[],p=!1,A={state:l,setOptions:function(S){var I=typeof S=="function"?S(l.options):S;v(),l.options=Object.assign({},o,l.options,I),l.scrollParents={reference:Ls(u)?Md(u):u.contextElement?Md(u.contextElement):[],popper:Md(s)};var T=jke(Bke([].concat(r,l.options.modifiers)));return l.orderedModifiers=T.filter(function(g){return g.enabled}),h(),A.update()},forceUpdate:function(){if(!p){var S=l.elements,I=S.reference,T=S.popper;if(UM(I,T)){l.rects={reference:kke(I,wh(T),l.options.strategy==="fixed"),popper:rO(T)},l.reset=!1,l.placement=l.options.placement,l.orderedModifiers.forEach(function(O){return l.modifiersData[O.name]=Object.assign({},O.data)});for(var g=0;g<l.orderedModifiers.length;g++){if(l.reset===!0){l.reset=!1,g=-1;continue}var C=l.orderedModifiers[g],y=C.fn,x=C.options,w=x===void 0?{}:x,M=C.name;typeof y=="function"&&(l=y({state:l,options:w,name:M,instance:A})||l)}}}},update:Uke(function(){return new Promise(function(_){A.forceUpdate(),_(l)})}),destroy:function(){v(),p=!0}};if(!UM(u,s))return A;A.setOptions(c).then(function(_){!p&&c.onFirstUpdate&&c.onFirstUpdate(_)});function h(){l.orderedModifiers.forEach(function(_){var S=_.name,I=_.options,T=I===void 0?{}:I,g=_.effect;if(typeof g=="function"){var C=g({state:l,name:S,instance:A,options:T}),y=function(){};f.push(C||y)}})}function v(){f.forEach(function(_){return _()}),f=[]}return A}}var Kke=[cke,wke,uke,z8,Tke,bke,Rke,rke,Ske],Pke=Wke({defaultModifiers:Kke}),Dke="tippy-box",tQ="tippy-content",Nke="tippy-backdrop",nQ="tippy-arrow",rQ="tippy-svg-arrow",ts={passive:!0,capture:!0},iQ=function(){return document.body};function qke(e,t){return{}.hasOwnProperty.call(e,t)}function c1(e,t,n){if(Array.isArray(e)){var r=e[t];return r??(Array.isArray(n)?n[t]:n)}return e}function sO(e,t){var n={}.toString.call(e);return n.indexOf("[object")===0&&n.indexOf(t+"]")>-1}function oQ(e,t){return typeof e=="function"?e.apply(void 0,t):e}function BM(e,t){if(t===0)return e;var n;return function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)}}function Qke(e,t){var n=Object.assign({},e);return t.forEach(function(r){delete n[r]}),n}function Vke(e){return e.split(/\s+/).filter(Boolean)}function ol(e){return[].concat(e)}function WM(e,t){e.indexOf(t)===-1&&e.push(t)}function zke(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function Hke(e){return e.split("-")[0]}function ig(e){return[].slice.call(e)}function KM(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function kd(){return document.createElement("div")}function Cp(e){return["Element","Fragment"].some(function(t){return sO(e,t)})}function Yke(e){return sO(e,"NodeList")}function Gke(e){return sO(e,"MouseEvent")}function Jke(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function Zke(e){return Cp(e)?[e]:Yke(e)?ig(e):Array.isArray(e)?e:ig(document.querySelectorAll(e))}function l1(e,t){e.forEach(function(n){n&&(n.style.transitionDuration=t+"ms")})}function PM(e,t){e.forEach(function(n){n&&n.setAttribute("data-state",t)})}function Xke(e){var t,n=ol(e),r=n[0];return r!=null&&(t=r.ownerDocument)!=null&&t.body?r.ownerDocument:document}function eLe(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=Hke(a.placement),l=a.modifiersData.offset;if(!l)return!0;var f=c==="bottom"?l.top.y:0,p=c==="top"?l.bottom.y:0,A=c==="right"?l.left.x:0,h=c==="left"?l.right.x:0,v=o.top-r+f>s,_=r-o.bottom-p>s,S=o.left-n+A>s,I=n-o.right-h>s;return v||_||S||I})}function f1(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){e[r](i,n)})}function DM(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 eo={isTouch:!1},NM=0;function tLe(){eo.isTouch||(eo.isTouch=!0,window.performance&&document.addEventListener("mousemove",aQ))}function aQ(){var e=performance.now();e-NM<20&&(eo.isTouch=!1,document.removeEventListener("mousemove",aQ)),NM=e}function nLe(){var e=document.activeElement;if(Jke(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function rLe(){document.addEventListener("touchstart",tLe,ts),window.addEventListener("blur",nLe)}var iLe=typeof window<"u"&&typeof document<"u",oLe=iLe?!!window.msCrypto:!1;function Jc(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 qM(e){var t=/[ \t]{2,}/g,n=/^[ \t]*/gm;return e.replace(t," ").replace(n,"").trim()}function aLe(e){return qM(`
44
44
  %ctippy.js
45
45
 
46
46
  %c`+qM(e)+`
47
47
 
48
48
  %c👷‍ This is a development-only message. It will be removed in production.
49
- `)}function uQ(e){return[iLe(e),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var Sp;process.env.NODE_ENV!=="production"&&oLe();function oLe(){Sp=new Set}function qo(e,t){if(e&&!Sp.has(t)){var n;Sp.add(t),(n=console).warn.apply(n,uQ(t))}}function _C(e,t){if(e&&!Sp.has(t)){var n;Sp.add(t),(n=console).error.apply(n,uQ(t))}}function aLe(e){var t=!e,n=Object.prototype.toString.call(e)==="[object Object]"&&!e.addEventListener;_C(t,["tippy() was passed","`"+String(e)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),_C(n,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var sQ={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},uLe={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},xr=Object.assign({appendTo:iQ,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},sQ,uLe),sLe=Object.keys(xr),cLe=function(t){process.env.NODE_ENV!=="production"&&lQ(t,[]);var n=Object.keys(t);n.forEach(function(r){xr[r]=t[r]})};function cQ(e){var t=e.plugins||[],n=t.reduce(function(r,i){var o=i.name,a=i.defaultValue;if(o){var u;r[o]=e[o]!==void 0?e[o]:(u=xr[o])!=null?u:a}return r},{});return Object.assign({},e,n)}function lLe(e,t){var n=t?Object.keys(cQ(Object.assign({},xr,{plugins:t}))):sLe,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 QM(e,t){var n=Object.assign({},t,{content:oQ(t.content,[e])},t.ignoreAttributes?{}:lLe(e,t.plugins));return n.aria=Object.assign({},xr.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?t.interactive:n.aria.expanded,content:n.aria.content==="auto"?t.interactive?null:"describedby":n.aria.content},n}function lQ(e,t){e===void 0&&(e={}),t===void 0&&(t=[]);var n=Object.keys(e);n.forEach(function(r){var i=Nke(xr,Object.keys(sQ)),o=!Dke(i,r);o&&(o=t.filter(function(a){return a.name===r}).length===0),qo(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.",`
49
+ `)}function uQ(e){return[aLe(e),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var Sp;process.env.NODE_ENV!=="production"&&uLe();function uLe(){Sp=new Set}function qo(e,t){if(e&&!Sp.has(t)){var n;Sp.add(t),(n=console).warn.apply(n,uQ(t))}}function _C(e,t){if(e&&!Sp.has(t)){var n;Sp.add(t),(n=console).error.apply(n,uQ(t))}}function sLe(e){var t=!e,n=Object.prototype.toString.call(e)==="[object Object]"&&!e.addEventListener;_C(t,["tippy() was passed","`"+String(e)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),_C(n,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var sQ={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},cLe={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},xr=Object.assign({appendTo:iQ,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},sQ,cLe),lLe=Object.keys(xr),fLe=function(t){process.env.NODE_ENV!=="production"&&lQ(t,[]);var n=Object.keys(t);n.forEach(function(r){xr[r]=t[r]})};function cQ(e){var t=e.plugins||[],n=t.reduce(function(r,i){var o=i.name,a=i.defaultValue;if(o){var u;r[o]=e[o]!==void 0?e[o]:(u=xr[o])!=null?u:a}return r},{});return Object.assign({},e,n)}function dLe(e,t){var n=t?Object.keys(cQ(Object.assign({},xr,{plugins:t}))):lLe,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 QM(e,t){var n=Object.assign({},t,{content:oQ(t.content,[e])},t.ignoreAttributes?{}:dLe(e,t.plugins));return n.aria=Object.assign({},xr.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?t.interactive:n.aria.expanded,content:n.aria.content==="auto"?t.interactive?null:"describedby":n.aria.content},n}function lQ(e,t){e===void 0&&(e={}),t===void 0&&(t=[]);var n=Object.keys(e);n.forEach(function(r){var i=Qke(xr,Object.keys(sQ)),o=!qke(i,r);o&&(o=t.filter(function(a){return a.name===r}).length===0),qo(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.",`
50
50
 
51
51
  `,`All props: https://atomiks.github.io/tippyjs/v6/all-props/
52
- `,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var fLe=function(){return"innerHTML"};function IC(e,t){e[fLe()]=t}function VM(e){var t=kd();return e===!0?t.className=nQ:(t.className=rQ,Cp(e)?t.appendChild(e):IC(t,e)),t}function zM(e,t){Cp(t.content)?(IC(e,""),e.appendChild(t.content)):typeof t.content!="function"&&(t.allowHTML?IC(e,t.content):e.textContent=t.content)}function TC(e){var t=e.firstElementChild,n=ig(t.children);return{box:t,content:n.find(function(r){return r.classList.contains(tQ)}),arrow:n.find(function(r){return r.classList.contains(nQ)||r.classList.contains(rQ)}),backdrop:n.find(function(r){return r.classList.contains(Pke)})}}function fQ(e){var t=kd(),n=kd();n.className=Kke,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=kd();r.className=tQ,r.setAttribute("data-state","hidden"),zM(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props);function i(o,a){var u=TC(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)&&zM(c,e.props),a.arrow?l?o.arrow!==a.arrow&&(s.removeChild(l),s.appendChild(VM(a.arrow))):s.appendChild(VM(a.arrow)):l&&s.removeChild(l)}return{popper:t,onUpdate:i}}fQ.$$tippy=!0;var dLe=1,Yh=[],d1=[];function pLe(e,t){var n=QM(e,Object.assign({},xr,cQ(KM(t)))),r,i,o,a=!1,u=!1,s=!1,c=!1,l,f,p,A=[],h=BM(Qa,n.interactiveDebounce),v,_=dLe++,S=null,I=Qke(n.plugins),T={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},g={id:_,reference:e,popper:kd(),popperInstance:S,props:n,state:T,plugins:I,clearDelayTimeouts:jo,setProps:Vr,setContent:Va,show:Dc,hide:j,hideWithInteractivity:L,enable:ko,disable:Lo,unmount:W,destroy:Le};if(!n.render)return process.env.NODE_ENV!=="production"&&_C(!0,"render() function has not been supplied."),g;var C=n.render(g),y=C.popper,x=C.onUpdate;y.setAttribute("data-tippy-root",""),y.id="tippy-"+g.id,g.popper=y,e._tippy=g,y._tippy=g;var w=I.map(function(U){return U.fn(g)}),M=e.hasAttribute("aria-expanded");return Tt(),E(),ge(),se("onCreate",[g]),n.showOnCreate&&pi(),y.addEventListener("mouseenter",function(){g.props.interactive&&g.state.isVisible&&g.clearDelayTimeouts()}),y.addEventListener("mouseleave",function(){g.props.interactive&&g.props.trigger.indexOf("mouseenter")>=0&&J().addEventListener("mousemove",h)}),g;function O(){var U=g.props.touch;return Array.isArray(U)?U:[U,0]}function F(){return O()[0]==="hold"}function K(){var U;return!!((U=g.props.render)!=null&&U.$$tippy)}function N(){return v||e}function J(){var U=N().parentNode;return U?Jke(U):document}function Z(){return TC(y)}function ae(U){return g.state.isMounted&&!g.state.isVisible||eo.isTouch||l&&l.type==="focus"?0:c1(g.props.delay,U?0:1,xr.delay)}function ge(U){U===void 0&&(U=!1),y.style.pointerEvents=g.props.interactive&&!U?"":"none",y.style.zIndex=""+g.props.zIndex}function se(U,te,he){if(he===void 0&&(he=!0),w.forEach(function(Te){Te[U]&&Te[U].apply(Te,te)}),he){var pe;(pe=g.props)[U].apply(pe,te)}}function k(){var U=g.props.aria;if(U.content){var te="aria-"+U.content,he=y.id,pe=ol(g.props.triggerTarget||e);pe.forEach(function(Te){var at=Te.getAttribute(te);if(g.state.isVisible)Te.setAttribute(te,at?at+" "+he:he);else{var Kn=at&&at.replace(he,"").trim();Kn?Te.setAttribute(te,Kn):Te.removeAttribute(te)}})}}function E(){if(!(M||!g.props.aria.expanded)){var U=ol(g.props.triggerTarget||e);U.forEach(function(te){g.props.interactive?te.setAttribute("aria-expanded",g.state.isVisible&&te===N()?"true":"false"):te.removeAttribute("aria-expanded")})}}function D(){J().removeEventListener("mousemove",h),Yh=Yh.filter(function(U){return U!==h})}function ue(U){if(!(eo.isTouch&&(s||U.type==="mousedown"))){var te=U.composedPath&&U.composedPath()[0]||U.target;if(!(g.props.interactive&&DM(y,te))){if(ol(g.props.triggerTarget||e).some(function(he){return DM(he,te)})){if(eo.isTouch||g.state.isVisible&&g.props.trigger.indexOf("click")>=0)return}else se("onClickOutside",[g,U]);g.props.hideOnClick===!0&&(g.clearDelayTimeouts(),g.hide(),u=!0,setTimeout(function(){u=!1}),g.state.isMounted||bt())}}}function ke(){s=!0}function Se(){s=!1}function rt(){var U=J();U.addEventListener("mousedown",ue,!0),U.addEventListener("touchend",ue,ts),U.addEventListener("touchstart",Se,ts),U.addEventListener("touchmove",ke,ts)}function bt(){var U=J();U.removeEventListener("mousedown",ue,!0),U.removeEventListener("touchend",ue,ts),U.removeEventListener("touchstart",Se,ts),U.removeEventListener("touchmove",ke,ts)}function Yt(U,te){mt(U,function(){!g.state.isVisible&&y.parentNode&&y.parentNode.contains(y)&&te()})}function Oe(U,te){mt(U,te)}function mt(U,te){var he=Z().box;function pe(Te){Te.target===he&&(f1(he,"remove",pe),te())}if(U===0)return te();f1(he,"remove",f),f1(he,"add",pe),f=pe}function lt(U,te,he){he===void 0&&(he=!1);var pe=ol(g.props.triggerTarget||e);pe.forEach(function(Te){Te.addEventListener(U,te,he),A.push({node:Te,eventType:U,handler:te,options:he})})}function Tt(){F()&&(lt("touchstart",Fo,{passive:!0}),lt("touchend",fi,{passive:!0})),qke(g.props.trigger).forEach(function(U){if(U!=="manual")switch(lt(U,Fo),U){case"mouseenter":lt("mouseleave",fi);break;case"focus":lt(rLe?"focusout":"blur",qr);break;case"focusin":lt("focusout",qr);break}})}function sn(){A.forEach(function(U){var te=U.node,he=U.eventType,pe=U.handler,Te=U.options;te.removeEventListener(he,pe,Te)}),A=[]}function Fo(U){var te,he=!1;if(!(!g.state.isEnabled||Zi(U)||u)){var pe=((te=l)==null?void 0:te.type)==="focus";l=U,v=U.currentTarget,E(),!g.state.isVisible&&Hke(U)&&Yh.forEach(function(Te){return Te(U)}),U.type==="click"&&(g.props.trigger.indexOf("mouseenter")<0||a)&&g.props.hideOnClick!==!1&&g.state.isVisible?he=!0:pi(U),U.type==="click"&&(a=!he),he&&!pe&&Ai(U)}}function Qa(U){var te=U.target,he=N().contains(te)||y.contains(te);if(!(U.type==="mousemove"&&he)){var pe=Qr().concat(y).map(function(Te){var at,Kn=Te._tippy,br=(at=Kn.popperInstance)==null?void 0:at.state;return br?{popperRect:Te.getBoundingClientRect(),popperState:br,props:n}:null}).filter(Boolean);Zke(pe,U)&&(D(),Ai(U))}}function fi(U){var te=Zi(U)||g.props.trigger.indexOf("click")>=0&&a;if(!te){if(g.props.interactive){g.hideWithInteractivity(U);return}Ai(U)}}function qr(U){g.props.trigger.indexOf("focusin")<0&&U.target!==N()||g.props.interactive&&U.relatedTarget&&y.contains(U.relatedTarget)||Ai(U)}function Zi(U){return eo.isTouch?F()!==U.type.indexOf("touch")>=0:!1}function Mo(){di();var U=g.props,te=U.popperOptions,he=U.placement,pe=U.offset,Te=U.getReferenceClientRect,at=U.moveTransition,Kn=K()?TC(y).arrow:null,br=Te?{getBoundingClientRect:Te,contextElement:Te.contextElement||N()}:e,Nc={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Qc){var Uo=Qc.state;if(K()){var ib=Z(),Vc=ib.box;["placement","reference-hidden","escaped"].forEach(function(Gu){Gu==="placement"?Vc.setAttribute("data-placement",Uo.placement):Uo.attributes.popper["data-popper-"+Gu]?Vc.setAttribute("data-"+Gu,""):Vc.removeAttribute("data-"+Gu)}),Uo.attributes.popper={}}}},hi=[{name:"offset",options:{offset:pe}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!at}},Nc];K()&&Kn&&hi.push({name:"arrow",options:{element:Kn,padding:3}}),hi.push.apply(hi,(te==null?void 0:te.modifiers)||[]),g.popperInstance=Wke(br,y,Object.assign({},te,{placement:he,onFirstUpdate:p,modifiers:hi}))}function di(){g.popperInstance&&(g.popperInstance.destroy(),g.popperInstance=null)}function tr(){var U=g.props.appendTo,te,he=N();g.props.interactive&&U===iQ||U==="parent"?te=he.parentNode:te=oQ(U,[he]),te.contains(y)||te.appendChild(y),g.state.isMounted=!0,Mo(),process.env.NODE_ENV!=="production"&&qo(g.props.interactive&&U===xr.appendTo&&he.nextElementSibling!==y,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",`
52
+ `,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var pLe=function(){return"innerHTML"};function IC(e,t){e[pLe()]=t}function VM(e){var t=kd();return e===!0?t.className=nQ:(t.className=rQ,Cp(e)?t.appendChild(e):IC(t,e)),t}function zM(e,t){Cp(t.content)?(IC(e,""),e.appendChild(t.content)):typeof t.content!="function"&&(t.allowHTML?IC(e,t.content):e.textContent=t.content)}function TC(e){var t=e.firstElementChild,n=ig(t.children);return{box:t,content:n.find(function(r){return r.classList.contains(tQ)}),arrow:n.find(function(r){return r.classList.contains(nQ)||r.classList.contains(rQ)}),backdrop:n.find(function(r){return r.classList.contains(Nke)})}}function fQ(e){var t=kd(),n=kd();n.className=Dke,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=kd();r.className=tQ,r.setAttribute("data-state","hidden"),zM(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props);function i(o,a){var u=TC(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)&&zM(c,e.props),a.arrow?l?o.arrow!==a.arrow&&(s.removeChild(l),s.appendChild(VM(a.arrow))):s.appendChild(VM(a.arrow)):l&&s.removeChild(l)}return{popper:t,onUpdate:i}}fQ.$$tippy=!0;var ALe=1,Yh=[],d1=[];function hLe(e,t){var n=QM(e,Object.assign({},xr,cQ(KM(t)))),r,i,o,a=!1,u=!1,s=!1,c=!1,l,f,p,A=[],h=BM(Qa,n.interactiveDebounce),v,_=ALe++,S=null,I=zke(n.plugins),T={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},g={id:_,reference:e,popper:kd(),popperInstance:S,props:n,state:T,plugins:I,clearDelayTimeouts:jo,setProps:Vr,setContent:Va,show:Dc,hide:j,hideWithInteractivity:L,enable:ko,disable:Lo,unmount:W,destroy:Le};if(!n.render)return process.env.NODE_ENV!=="production"&&_C(!0,"render() function has not been supplied."),g;var C=n.render(g),y=C.popper,x=C.onUpdate;y.setAttribute("data-tippy-root",""),y.id="tippy-"+g.id,g.popper=y,e._tippy=g,y._tippy=g;var w=I.map(function(U){return U.fn(g)}),M=e.hasAttribute("aria-expanded");return Tt(),E(),ge(),se("onCreate",[g]),n.showOnCreate&&pi(),y.addEventListener("mouseenter",function(){g.props.interactive&&g.state.isVisible&&g.clearDelayTimeouts()}),y.addEventListener("mouseleave",function(){g.props.interactive&&g.props.trigger.indexOf("mouseenter")>=0&&J().addEventListener("mousemove",h)}),g;function O(){var U=g.props.touch;return Array.isArray(U)?U:[U,0]}function F(){return O()[0]==="hold"}function K(){var U;return!!((U=g.props.render)!=null&&U.$$tippy)}function N(){return v||e}function J(){var U=N().parentNode;return U?Xke(U):document}function Z(){return TC(y)}function ae(U){return g.state.isMounted&&!g.state.isVisible||eo.isTouch||l&&l.type==="focus"?0:c1(g.props.delay,U?0:1,xr.delay)}function ge(U){U===void 0&&(U=!1),y.style.pointerEvents=g.props.interactive&&!U?"":"none",y.style.zIndex=""+g.props.zIndex}function se(U,te,he){if(he===void 0&&(he=!0),w.forEach(function(Ie){Ie[U]&&Ie[U].apply(Ie,te)}),he){var pe;(pe=g.props)[U].apply(pe,te)}}function k(){var U=g.props.aria;if(U.content){var te="aria-"+U.content,he=y.id,pe=ol(g.props.triggerTarget||e);pe.forEach(function(Ie){var at=Ie.getAttribute(te);if(g.state.isVisible)Ie.setAttribute(te,at?at+" "+he:he);else{var Kn=at&&at.replace(he,"").trim();Kn?Ie.setAttribute(te,Kn):Ie.removeAttribute(te)}})}}function E(){if(!(M||!g.props.aria.expanded)){var U=ol(g.props.triggerTarget||e);U.forEach(function(te){g.props.interactive?te.setAttribute("aria-expanded",g.state.isVisible&&te===N()?"true":"false"):te.removeAttribute("aria-expanded")})}}function D(){J().removeEventListener("mousemove",h),Yh=Yh.filter(function(U){return U!==h})}function ue(U){if(!(eo.isTouch&&(s||U.type==="mousedown"))){var te=U.composedPath&&U.composedPath()[0]||U.target;if(!(g.props.interactive&&DM(y,te))){if(ol(g.props.triggerTarget||e).some(function(he){return DM(he,te)})){if(eo.isTouch||g.state.isVisible&&g.props.trigger.indexOf("click")>=0)return}else se("onClickOutside",[g,U]);g.props.hideOnClick===!0&&(g.clearDelayTimeouts(),g.hide(),u=!0,setTimeout(function(){u=!1}),g.state.isMounted||bt())}}}function ke(){s=!0}function Se(){s=!1}function rt(){var U=J();U.addEventListener("mousedown",ue,!0),U.addEventListener("touchend",ue,ts),U.addEventListener("touchstart",Se,ts),U.addEventListener("touchmove",ke,ts)}function bt(){var U=J();U.removeEventListener("mousedown",ue,!0),U.removeEventListener("touchend",ue,ts),U.removeEventListener("touchstart",Se,ts),U.removeEventListener("touchmove",ke,ts)}function Yt(U,te){mt(U,function(){!g.state.isVisible&&y.parentNode&&y.parentNode.contains(y)&&te()})}function Oe(U,te){mt(U,te)}function mt(U,te){var he=Z().box;function pe(Ie){Ie.target===he&&(f1(he,"remove",pe),te())}if(U===0)return te();f1(he,"remove",f),f1(he,"add",pe),f=pe}function lt(U,te,he){he===void 0&&(he=!1);var pe=ol(g.props.triggerTarget||e);pe.forEach(function(Ie){Ie.addEventListener(U,te,he),A.push({node:Ie,eventType:U,handler:te,options:he})})}function Tt(){F()&&(lt("touchstart",Fo,{passive:!0}),lt("touchend",fi,{passive:!0})),Vke(g.props.trigger).forEach(function(U){if(U!=="manual")switch(lt(U,Fo),U){case"mouseenter":lt("mouseleave",fi);break;case"focus":lt(oLe?"focusout":"blur",qr);break;case"focusin":lt("focusout",qr);break}})}function sn(){A.forEach(function(U){var te=U.node,he=U.eventType,pe=U.handler,Ie=U.options;te.removeEventListener(he,pe,Ie)}),A=[]}function Fo(U){var te,he=!1;if(!(!g.state.isEnabled||Zi(U)||u)){var pe=((te=l)==null?void 0:te.type)==="focus";l=U,v=U.currentTarget,E(),!g.state.isVisible&&Gke(U)&&Yh.forEach(function(Ie){return Ie(U)}),U.type==="click"&&(g.props.trigger.indexOf("mouseenter")<0||a)&&g.props.hideOnClick!==!1&&g.state.isVisible?he=!0:pi(U),U.type==="click"&&(a=!he),he&&!pe&&Ai(U)}}function Qa(U){var te=U.target,he=N().contains(te)||y.contains(te);if(!(U.type==="mousemove"&&he)){var pe=Qr().concat(y).map(function(Ie){var at,Kn=Ie._tippy,br=(at=Kn.popperInstance)==null?void 0:at.state;return br?{popperRect:Ie.getBoundingClientRect(),popperState:br,props:n}:null}).filter(Boolean);eLe(pe,U)&&(D(),Ai(U))}}function fi(U){var te=Zi(U)||g.props.trigger.indexOf("click")>=0&&a;if(!te){if(g.props.interactive){g.hideWithInteractivity(U);return}Ai(U)}}function qr(U){g.props.trigger.indexOf("focusin")<0&&U.target!==N()||g.props.interactive&&U.relatedTarget&&y.contains(U.relatedTarget)||Ai(U)}function Zi(U){return eo.isTouch?F()!==U.type.indexOf("touch")>=0:!1}function Mo(){di();var U=g.props,te=U.popperOptions,he=U.placement,pe=U.offset,Ie=U.getReferenceClientRect,at=U.moveTransition,Kn=K()?TC(y).arrow:null,br=Ie?{getBoundingClientRect:Ie,contextElement:Ie.contextElement||N()}:e,Nc={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Qc){var Uo=Qc.state;if(K()){var ib=Z(),Vc=ib.box;["placement","reference-hidden","escaped"].forEach(function(Gu){Gu==="placement"?Vc.setAttribute("data-placement",Uo.placement):Uo.attributes.popper["data-popper-"+Gu]?Vc.setAttribute("data-"+Gu,""):Vc.removeAttribute("data-"+Gu)}),Uo.attributes.popper={}}}},hi=[{name:"offset",options:{offset:pe}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!at}},Nc];K()&&Kn&&hi.push({name:"arrow",options:{element:Kn,padding:3}}),hi.push.apply(hi,(te==null?void 0:te.modifiers)||[]),g.popperInstance=Pke(br,y,Object.assign({},te,{placement:he,onFirstUpdate:p,modifiers:hi}))}function di(){g.popperInstance&&(g.popperInstance.destroy(),g.popperInstance=null)}function tr(){var U=g.props.appendTo,te,he=N();g.props.interactive&&U===iQ||U==="parent"?te=he.parentNode:te=oQ(U,[he]),te.contains(y)||te.appendChild(y),g.state.isMounted=!0,Mo(),process.env.NODE_ENV!=="production"&&qo(g.props.interactive&&U===xr.appendTo&&he.nextElementSibling!==y,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",`
53
53
 
54
54
  `,"Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.",`
55
55
 
56
56
  `,"Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.",`
57
57
 
58
- `,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function Qr(){return ig(y.querySelectorAll("[data-tippy-root]"))}function pi(U){g.clearDelayTimeouts(),U&&se("onTrigger",[g,U]),rt();var te=ae(!0),he=O(),pe=he[0],Te=he[1];eo.isTouch&&pe==="hold"&&Te&&(te=Te),te?r=setTimeout(function(){g.show()},te):g.show()}function Ai(U){if(g.clearDelayTimeouts(),se("onUntrigger",[g,U]),!g.state.isVisible){bt();return}if(!(g.props.trigger.indexOf("mouseenter")>=0&&g.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(U.type)>=0&&a)){var te=ae(!1);te?i=setTimeout(function(){g.state.isVisible&&g.hide()},te):o=requestAnimationFrame(function(){g.hide()})}}function ko(){g.state.isEnabled=!0}function Lo(){g.hide(),g.state.isEnabled=!1}function jo(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function Vr(U){if(process.env.NODE_ENV!=="production"&&qo(g.state.isDestroyed,Jc("setProps")),!g.state.isDestroyed){se("onBeforeUpdate",[g,U]),sn();var te=g.props,he=QM(e,Object.assign({},te,KM(U),{ignoreAttributes:!0}));g.props=he,Tt(),te.interactiveDebounce!==he.interactiveDebounce&&(D(),h=BM(Qa,he.interactiveDebounce)),te.triggerTarget&&!he.triggerTarget?ol(te.triggerTarget).forEach(function(pe){pe.removeAttribute("aria-expanded")}):he.triggerTarget&&e.removeAttribute("aria-expanded"),E(),ge(),x&&x(te,he),g.popperInstance&&(Mo(),Qr().forEach(function(pe){requestAnimationFrame(pe._tippy.popperInstance.forceUpdate)})),se("onAfterUpdate",[g,U])}}function Va(U){g.setProps({content:U})}function Dc(){process.env.NODE_ENV!=="production"&&qo(g.state.isDestroyed,Jc("show"));var U=g.state.isVisible,te=g.state.isDestroyed,he=!g.state.isEnabled,pe=eo.isTouch&&!g.props.touch,Te=c1(g.props.duration,0,xr.duration);if(!(U||te||he||pe)&&!N().hasAttribute("disabled")&&(se("onShow",[g],!1),g.props.onShow(g)!==!1)){if(g.state.isVisible=!0,K()&&(y.style.visibility="visible"),ge(),rt(),g.state.isMounted||(y.style.transition="none"),K()){var at=Z(),Kn=at.box,br=at.content;l1([Kn,br],0)}p=function(){var hi;if(!(!g.state.isVisible||c)){if(c=!0,y.offsetHeight,y.style.transition=g.props.moveTransition,K()&&g.props.animation){var qc=Z(),Qc=qc.box,Uo=qc.content;l1([Qc,Uo],Te),PM([Qc,Uo],"visible")}k(),E(),WM(d1,g),(hi=g.popperInstance)==null||hi.forceUpdate(),se("onMount",[g]),g.props.animation&&K()&&Oe(Te,function(){g.state.isShown=!0,se("onShown",[g])})}},tr()}}function j(){process.env.NODE_ENV!=="production"&&qo(g.state.isDestroyed,Jc("hide"));var U=!g.state.isVisible,te=g.state.isDestroyed,he=!g.state.isEnabled,pe=c1(g.props.duration,1,xr.duration);if(!(U||te||he)&&(se("onHide",[g],!1),g.props.onHide(g)!==!1)){if(g.state.isVisible=!1,g.state.isShown=!1,c=!1,a=!1,K()&&(y.style.visibility="hidden"),D(),bt(),ge(!0),K()){var Te=Z(),at=Te.box,Kn=Te.content;g.props.animation&&(l1([at,Kn],pe),PM([at,Kn],"hidden"))}k(),E(),g.props.animation?K()&&Yt(pe,g.unmount):g.unmount()}}function L(U){process.env.NODE_ENV!=="production"&&qo(g.state.isDestroyed,Jc("hideWithInteractivity")),J().addEventListener("mousemove",h),WM(Yh,h),h(U)}function W(){process.env.NODE_ENV!=="production"&&qo(g.state.isDestroyed,Jc("unmount")),g.state.isVisible&&g.hide(),g.state.isMounted&&(di(),Qr().forEach(function(U){U._tippy.unmount()}),y.parentNode&&y.parentNode.removeChild(y),d1=d1.filter(function(U){return U!==g}),g.state.isMounted=!1,se("onHidden",[g]))}function Le(){process.env.NODE_ENV!=="production"&&qo(g.state.isDestroyed,Jc("destroy")),!g.state.isDestroyed&&(g.clearDelayTimeouts(),g.unmount(),sn(),delete e._tippy,g.state.isDestroyed=!0,se("onDestroy",[g]))}}function $h(e,t){t===void 0&&(t={});var n=xr.plugins.concat(t.plugins||[]);process.env.NODE_ENV!=="production"&&(aLe(e),lQ(t,n)),tLe();var r=Object.assign({},t,{plugins:n}),i=Gke(e);if(process.env.NODE_ENV!=="production"){var o=Cp(r.content),a=i.length>1;qo(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.",`
58
+ `,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function Qr(){return ig(y.querySelectorAll("[data-tippy-root]"))}function pi(U){g.clearDelayTimeouts(),U&&se("onTrigger",[g,U]),rt();var te=ae(!0),he=O(),pe=he[0],Ie=he[1];eo.isTouch&&pe==="hold"&&Ie&&(te=Ie),te?r=setTimeout(function(){g.show()},te):g.show()}function Ai(U){if(g.clearDelayTimeouts(),se("onUntrigger",[g,U]),!g.state.isVisible){bt();return}if(!(g.props.trigger.indexOf("mouseenter")>=0&&g.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(U.type)>=0&&a)){var te=ae(!1);te?i=setTimeout(function(){g.state.isVisible&&g.hide()},te):o=requestAnimationFrame(function(){g.hide()})}}function ko(){g.state.isEnabled=!0}function Lo(){g.hide(),g.state.isEnabled=!1}function jo(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function Vr(U){if(process.env.NODE_ENV!=="production"&&qo(g.state.isDestroyed,Jc("setProps")),!g.state.isDestroyed){se("onBeforeUpdate",[g,U]),sn();var te=g.props,he=QM(e,Object.assign({},te,KM(U),{ignoreAttributes:!0}));g.props=he,Tt(),te.interactiveDebounce!==he.interactiveDebounce&&(D(),h=BM(Qa,he.interactiveDebounce)),te.triggerTarget&&!he.triggerTarget?ol(te.triggerTarget).forEach(function(pe){pe.removeAttribute("aria-expanded")}):he.triggerTarget&&e.removeAttribute("aria-expanded"),E(),ge(),x&&x(te,he),g.popperInstance&&(Mo(),Qr().forEach(function(pe){requestAnimationFrame(pe._tippy.popperInstance.forceUpdate)})),se("onAfterUpdate",[g,U])}}function Va(U){g.setProps({content:U})}function Dc(){process.env.NODE_ENV!=="production"&&qo(g.state.isDestroyed,Jc("show"));var U=g.state.isVisible,te=g.state.isDestroyed,he=!g.state.isEnabled,pe=eo.isTouch&&!g.props.touch,Ie=c1(g.props.duration,0,xr.duration);if(!(U||te||he||pe)&&!N().hasAttribute("disabled")&&(se("onShow",[g],!1),g.props.onShow(g)!==!1)){if(g.state.isVisible=!0,K()&&(y.style.visibility="visible"),ge(),rt(),g.state.isMounted||(y.style.transition="none"),K()){var at=Z(),Kn=at.box,br=at.content;l1([Kn,br],0)}p=function(){var hi;if(!(!g.state.isVisible||c)){if(c=!0,y.offsetHeight,y.style.transition=g.props.moveTransition,K()&&g.props.animation){var qc=Z(),Qc=qc.box,Uo=qc.content;l1([Qc,Uo],Ie),PM([Qc,Uo],"visible")}k(),E(),WM(d1,g),(hi=g.popperInstance)==null||hi.forceUpdate(),se("onMount",[g]),g.props.animation&&K()&&Oe(Ie,function(){g.state.isShown=!0,se("onShown",[g])})}},tr()}}function j(){process.env.NODE_ENV!=="production"&&qo(g.state.isDestroyed,Jc("hide"));var U=!g.state.isVisible,te=g.state.isDestroyed,he=!g.state.isEnabled,pe=c1(g.props.duration,1,xr.duration);if(!(U||te||he)&&(se("onHide",[g],!1),g.props.onHide(g)!==!1)){if(g.state.isVisible=!1,g.state.isShown=!1,c=!1,a=!1,K()&&(y.style.visibility="hidden"),D(),bt(),ge(!0),K()){var Ie=Z(),at=Ie.box,Kn=Ie.content;g.props.animation&&(l1([at,Kn],pe),PM([at,Kn],"hidden"))}k(),E(),g.props.animation?K()&&Yt(pe,g.unmount):g.unmount()}}function L(U){process.env.NODE_ENV!=="production"&&qo(g.state.isDestroyed,Jc("hideWithInteractivity")),J().addEventListener("mousemove",h),WM(Yh,h),h(U)}function W(){process.env.NODE_ENV!=="production"&&qo(g.state.isDestroyed,Jc("unmount")),g.state.isVisible&&g.hide(),g.state.isMounted&&(di(),Qr().forEach(function(U){U._tippy.unmount()}),y.parentNode&&y.parentNode.removeChild(y),d1=d1.filter(function(U){return U!==g}),g.state.isMounted=!1,se("onHidden",[g]))}function Le(){process.env.NODE_ENV!=="production"&&qo(g.state.isDestroyed,Jc("destroy")),!g.state.isDestroyed&&(g.clearDelayTimeouts(),g.unmount(),sn(),delete e._tippy,g.state.isDestroyed=!0,se("onDestroy",[g]))}}function $h(e,t){t===void 0&&(t={});var n=xr.plugins.concat(t.plugins||[]);process.env.NODE_ENV!=="production"&&(sLe(e),lQ(t,n)),rLe();var r=Object.assign({},t,{plugins:n}),i=Zke(e);if(process.env.NODE_ENV!=="production"){var o=Cp(r.content),a=i.length>1;qo(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.",`
59
59
 
60
60
  `,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",`
61
61
 
62
62
  `,`1) content: element.innerHTML
63
- `,"2) content: () => element.cloneNode(true)"].join(" "))}var u=i.reduce(function(s,c){var l=c&&pLe(c,r);return l&&s.push(l),s},[]);return Cp(e)?u[0]:u}$h.defaultProps=xr;$h.setDefaultProps=cLe;$h.currentInput=eo;Object.assign({},z8,{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)}});$h.setDefaultProps({render:fQ});class ALe{constructor({editor:t,element:n,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:a}){this.preventHide=!1,this.shouldShow=({view:u,state:s,from:c,to:l})=>{const{doc:f,selection:p}=s,{empty:A}=p,h=!f.textBetween(c,l).length&&JR(s.selection),v=this.element.contains(document.activeElement);return!(!(u.hasFocus()||v)||A||h||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:u})=>{var s;if(this.preventHide){this.preventHide=!1;return}u!=null&&u.relatedTarget&&(!((s=this.element.parentNode)===null||s===void 0)&&s.contains(u.relatedTarget))||this.hide()},this.tippyBlurHandler=u=>{this.blurHandler({event:u})},this.handleDebouncedUpdate=(u,s)=>{const c=!(s!=null&&s.selection.eq(u.state.selection)),l=!(s!=null&&s.doc.eq(u.state.doc));!c&&!l||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(u,c,l,s)},this.updateDelay))},this.updateHandler=(u,s,c,l)=>{var f,p,A;const{state:h,composing:v}=u,{selection:_}=h;if(v||!s&&!c)return;this.createTooltip();const{ranges:I}=_,T=Math.min(...I.map(y=>y.$from.pos)),g=Math.max(...I.map(y=>y.$to.pos));if(!((f=this.shouldShow)===null||f===void 0?void 0:f.call(this,{editor:this.editor,view:u,state:h,oldState:l,from:T,to:g}))){this.hide();return}(p=this.tippy)===null||p===void 0||p.setProps({getReferenceClientRect:((A=this.tippyOptions)===null||A===void 0?void 0:A.getReferenceClientRect)||(()=>{if(tMe(h.selection)){let y=u.nodeDOM(T);const x=y.dataset.nodeViewWrapper?y:y.querySelector("[data-node-view-wrapper]");if(x&&(y=x.firstChild),y)return y.getBoundingClientRect()}return nMe(u,T,g)})}),this.show()},this.editor=t,this.element=n,this.view=r,this.updateDelay=o,a&&(this.shouldShow=a),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:t}=this.editor.options,n=!!t.parentElement;this.tippy||!n||(this.tippy=$h(t,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(t,n){const{state:r}=t,i=r.selection.$from.pos!==r.selection.$to.pos;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(t,n);return}const o=!(n!=null&&n.selection.eq(t.state.selection)),a=!(n!=null&&n.doc.eq(t.state.doc));this.updateHandler(t,o,a,n)}show(){var t;(t=this.tippy)===null||t===void 0||t.show()}hide(){var t;(t=this.tippy)===null||t===void 0||t.hide()}destroy(){var t,n;!((t=this.tippy)===null||t===void 0)&&t.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const dQ=e=>new Nr({key:typeof e.pluginKey=="string"?new Gi(e.pluginKey):e.pluginKey,view:t=>new ALe({view:t,...e})});cr.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[dQ({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});const hLe=(...e)=>t=>{e.forEach(n=>{typeof n=="function"?n(t):n&&(n.current=t)})},mLe=({renderers:e})=>R.createElement(R.Fragment,null,Object.entries(e).map(([t,n])=>DC.createPortal(n.reactElement,n.element,t)));class gLe extends R.Component{constructor(t){super(t),this.editorContentRef=R.createRef(),this.initialized=!1,this.state={renderers:{}}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const{editor:t}=this.props;if(t&&t.options.element){if(t.contentComponent)return;const n=this.editorContentRef.current;n.append(...t.options.element.childNodes),t.setOptions({element:n}),t.contentComponent=this,t.createNodeViews(),this.initialized=!0}}maybeFlushSync(t){this.initialized?DC.flushSync(t):t()}setRenderer(t,n){this.maybeFlushSync(()=>{this.setState(({renderers:r})=>({renderers:{...r,[t]:n}}))})}removeRenderer(t){this.maybeFlushSync(()=>{this.setState(({renderers:n})=>{const r={...n};return delete r[t],{renderers:r}})})}componentWillUnmount(){const{editor:t}=this.props;if(!t||(this.initialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),t.contentComponent=null,!t.options.element.firstChild))return;const n=document.createElement("div");n.append(...t.options.element.childNodes),t.setOptions({element:n})}render(){const{editor:t,innerRef:n,...r}=this.props;return R.createElement(R.Fragment,null,R.createElement("div",{ref:hLe(n,this.editorContentRef),...r}),R.createElement(mLe,{renderers:this.state.renderers}))}}const vLe=R.forwardRef((e,t)=>{const n=R.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return R.createElement(gLe,{key:n,innerRef:t,...e})}),yLe=R.memo(vLe),pQ=R.createContext({editor:null});pQ.Consumer;const bLe=()=>R.useContext(pQ),p1=e=>{const[t,n]=R.useState(null),{editor:r}=bLe();return R.useEffect(()=>{var i;if(!t||!((i=e.editor)===null||i===void 0)&&i.isDestroyed||r!=null&&r.isDestroyed)return;const{pluginKey:o="bubbleMenu",editor:a,tippyOptions:u={},updateDelay:s,shouldShow:c=null}=e,l=a||r;if(!l){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const f=dQ({updateDelay:s,editor:l,element:t,pluginKey:o,shouldShow:c,tippyOptions:u});return l.registerPlugin(f),()=>l.unregisterPlugin(o)},[e.editor,r,t]),R.createElement("div",{ref:n,className:e.className,style:{visibility:"hidden"}},e.children)},AQ=R.createContext({onDragStart:void 0}),CLe=()=>R.useContext(AQ),hQ=R.forwardRef((e,t)=>{const{onDragStart:n}=CLe(),r=e.as||"div";return R.createElement(r,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})});function SLe(e){return!!(typeof e=="function"&&e.prototype&&e.prototype.isReactComponent)}function _Le(e){var t;return typeof e=="object"&&((t=e.$$typeof)===null||t===void 0?void 0:t.toString())==="Symbol(react.forward_ref)"}class mQ{constructor(t,{editor:n,props:r={},as:i="div",className:o="",attrs:a}){this.ref=null,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=t,this.editor=n,this.props=r,this.element=document.createElement(i),this.element.classList.add("react-renderer"),o&&this.element.classList.add(...o.split(" ")),a&&Object.keys(a).forEach(u=>{this.element.setAttribute(u,a[u])}),this.render()}render(){var t,n;const r=this.component,i=this.props;(SLe(r)||_Le(r))&&(i.ref=o=>{this.ref=o}),this.reactElement=R.createElement(r,{...i}),(n=(t=this.editor)===null||t===void 0?void 0:t.contentComponent)===null||n===void 0||n.setRenderer(this.id,this)}updateProps(t={}){this.props={...this.props,...t},this.render()}destroy(){var t,n;(n=(t=this.editor)===null||t===void 0?void 0:t.contentComponent)===null||n===void 0||n.removeRenderer(this.id)}}class ILe extends IMe{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 R.createElement(R.Fragment,null,R.createElement(AQ.Provider,{value:{onDragStart:u,nodeViewContentRef:s}},R.createElement(a,{...o})))};n.displayName="ReactNodeView",this.node.isLeaf?this.contentDOMElement=null:this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=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.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.renderer=new mQ(n,{editor:this.editor,props:t,as:r,className:`node-${this.node.type.name} ${i}`.trim(),attrs:this.options.attrs})}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}handleSelectionUpdate(){const{from:t,to:n}=this.editor.state.selection;if(t<=this.getPos()&&n>=this.getPos()+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}}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}),this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove("ProseMirror-selectednode")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate),this.contentDOMElement=null}}function gQ(e,t){return n=>n.editor.contentComponent?new ILe(e,n,t):{}}const TLe=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,xLe=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,wLe=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,$Le=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,ELe=Kc.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",St(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[Xm({find:TLe,type:this.type}),Xm({find:wLe,type:this.type})]},addPasteRules(){return[tg({find:xLe,type:this.type}),tg({find:$Le,type:this.type})]}});var Pc=(e=>(e.Document="document",e.Mark="mark",e.Node="node",e))(Pc||{}),Al=(e=>(e.Text="text",e.Embed="embed",e.Image="image",e))(Al||{});class RLe{constructor(t,n,r){$n(this,"extType","document");this.name=t,this.component=n,this.converter=r}}class Eh{constructor(t,n,r,i,o,a=!1){$n(this,"extType","node");$n(this,"nodeType","text");this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i,this.placeholder=o,this.lockedFormat=a}}function vQ(e){return e instanceof Eh}class OLe{constructor(t,n,r,i){$n(this,"extType","node");$n(this,"nodeType","embed");this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i}}class FLe{constructor(t,n,r,i){$n(this,"extType","node");$n(this,"nodeType","image");this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i}}class MLe extends Eh{constructor(t,n,r,i,o){super(t,"heading",n,i,o),this.levels=r}}class cO extends Eh{constructor(t,n,r,i){super(t,n,r,i)}}function kLe(e){return e instanceof cO}const yQ=kn.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:e}){return["br",St(this.options.HTMLAttributes,e)]},renderText(){return`
64
- `},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(p=>u.includes(p.type.name));c.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),js={isHardBreak(e){return e.type.name===yQ.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 LLe(e){if(!e||!(e!=null&&e.single)&&!(e!=null&&e.multi))return HM();const t=jLe(e);if(!t.size)return HM();const n=ULe(t),r=BLe(n,e);return{nodeTypes:t,extensions:r}}function jLe(e){const n=(e.single||e.multi||"").split(/\s*,\s*/).map(r=>{const i=le.RichTextNodeTypeCodec.decode(r);return i._tag==="Right"?i.right:void 0}).filter(to.isDefined);return new Set(n)}function ULe(e){return nV(e).filter(n=>Rn.some(e,r=>n.richTextNodeTypes.includes(r)))}function BLe(e,t){var r;const n=new Set(e);return Rn.some(n,kLe)&&n.add(aa),Rn.some(n,vQ)||n.add(aa),(r=t==null?void 0:t.labels)!=null&&r.length&&n.add(gO),[...n]}function HM(){return{extensions:nV(),nodeTypes:new Set(Pl.keys(le.RichTextNodeTypeCodec.keys))}}class WLe{constructor(t,n,r){$n(this,"extType",Pc.Mark);$n(this,"richTextNodeTypes",[le.RichTextNodeType.strong]);this.name=t,this.component=n,this.converter=r}}const bQ="bold",CQ=ELe.extend({name:bQ}),KLe={fromPrismic(e){return function(){var t;return(t=e.marks[CQ.name])==null?void 0:t.create()}},toPrismic(){}},PLe=new WLe(bQ,CQ,KLe),lO=PLe,DLe=kn.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",St(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)}}}),YM=Kc.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:e=>e.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["span",St(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:e,commands:t})=>{const n=XR(e,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:t.unsetMark(this.name)}}}}),GM=/^\s*([-+*])\s$/,NLe=kn.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:e}){return["ul",St(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(DLe.name,this.editor.getAttributes(YM.name)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=eg({find:GM,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=eg({find:GM,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(YM.name),editor:this.editor})),[e]}}),qLe=kn.create({name:"doc",topNode:!0,content:"block+"}),QLe=kn.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",St(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)}}}),SQ=QLe.extend({name:"listItem",content:"paragraph*",addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name)}}}),VLe={fromPrismic(e){return function(t){var r;const n=aa.converter.fromPrismic(e)(t);if(n)return(r=e.nodes[SQ.name])==null?void 0:r.create({},n)}},toPrismic(e,t){return js.children.reduce(e,(n,r)=>{const i=aa.converter.toPrismic(r),o=(()=>i instanceof Array?i.map(a=>({...a,type:t})):i?[{...i,type:t}]:[])();return[...n,...o]},[])}},Wl={component:SQ,converter:VLe,placeholder:"List"};function zLe(e,t){return e.copy(e.content.append(t.content))}const al={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"},G0=()=>(++G0.i).toString();G0.i=0;const HLe=e=>{const t=YLe(e),n=[];for(let r=0;r<t.length;r++)n.push(_Q(t[r]));return{key:G0(),children:n}},Ld=(e,t=[])=>({key:G0(),type:e.type,text:"text"in e?e.text:void 0,node:e,children:t}),A1=e=>Ld({type:al.span,text:e,spans:[]}),YLe=e=>{const t=e.slice(0);for(let n=0;n<t.length;n++){const r=t[n];if(r.type===al.listItem||r.type===al.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===al.listItem?t[n]={type:al.list,items:i}:t[n]={type:al.oList,items:i}}}return t},_Q=e=>{if("text"in e)return Ld(e,IQ(e.spans,e));if("items"in e){const t=[];for(let n=0;n<e.items.length;n++)t.push(_Q(e.items[n]));return Ld(e,t)}return Ld(e)},IQ=(e,t,n)=>{if(!e.length)return[A1(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 A=o;A<r.length;A++){const h=r[A];h!==a&&h.start>=a.start&&h.end<=a.end&&(f.push(h),r.splice(A,1),A--)}o===0&&s>0&&i.push(A1(t.text.slice(0,s)));const p={...a,text:l};i.push(Ld(p,IQ(f,{...t,text:l},a))),c<t.text.length&&i.push(A1(t.text.slice(c,r[o+1]?r[o+1].start-u:void 0)))}return i},GLe=(e,t)=>TQ(HLe(e).children,t),TQ=(e,t)=>{const n=[];for(let r=0;r<e.length;r++){const i=e[r],o=t(i.type,i.node,i.text,TQ(i.children,t),i.key);o!=null&&n.push(o)}return n},JLe=kn.create({name:"text",group:"inline"});function ZLe(e){return e.reduce((t,n)=>{const r=(t[n.type]||[]).concat(n);return{...t,[n.type]:r}},{})}function JM(e){return e.sort((t,n)=>t.start-n.start)}function XLe(e){const t=ZLe(e),n=Object.entries(t).map(([r,i])=>JM(i).reduce((a,u)=>{if(!a.length)return[u];const s=a.length-1,c=a[s];return c?c.end<u.start?[...a,u]:c.end>=u.end?a:[...a.slice(0,s),{...c,end:u.end}]:a},[])).flat();return JM(n)}const og=yQ.extend({name:"hard_break"}),ag=`
65
- `,xQ={fromPrismic(e){return function(t){var n;if(t===ag)return(n=e.nodes[og.name])==null?void 0:n.create({})}},toPrismic(e){if(e.type.name===og.name)return ag}},h1={isEmptyLine(e){return e.length===0},isFirst(e){return e===0}};function eje(e,t){return function(n){const r=xQ.fromPrismic(e)(ag);if(!r)return[n(t)];const i=t.split(ag);return i.length===1?t.length?[n(t)]:[r]:i.reduce((o,a,u)=>h1.isFirst(u)?h1.isEmptyLine(a)?o:[...o,n(a)]:h1.isEmptyLine(a)?[...o,r]:[...o,r,n(a)],[])}}const tje={name:og.name,component:og,converter:xQ,splitTextToNodes:eje},ug=tje,wQ={fromPrismic(e){return t=>{switch(t.type){case"hyperlink":return XQ.converter.fromPrismic(e)(t);case"em":return mO.converter.fromPrismic(e)(t);case"strong":return lO.converter.fromPrismic(e)(t);case"label":return gO.converter.fromPrismic(e)(t);case"list-item":return}}},toPrismic(e,t,n){const r=tV.find(i=>e.type.name===i.name);if(!r)throw new Error(`Invalid mark extension '${e.type.name}'.`);switch(r.name){case"bold":return{type:"strong",start:t,end:n};case"em":return{type:r.name,start:t,end:n};case"hyperlink":return{type:r.name,start:t,end:n,data:r.converter.toPrismic(e)};case"label":return{type:r.name,start:t,end:n,data:r.converter.toPrismic(e)}}}},nje={strong:"bold",label:"label",em:"em",hyperlink:"hyperlink","list-item":void 0},ZM=JLe.extend({name:"text"}),rje={fromPrismic(e){return function(t,n,r=!1){const i={type:t,text:n.content.text,spans:n.content.spans||[]};return GLe([i],ije(e,r)).flat()}},toPrismic(e,t,n){const r=js.children.reduce(e,(i,o)=>{const a=(()=>o.type.name===ug.name?ug.converter.toPrismic(o):o.textContent)(),u=a?i.text+a:i.text,s=i.text.length,c=u.length,l=(()=>o.marks.length?js.marks.map(o,p=>wQ.toPrismic(p,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:[...XLe(r.spans)].sort((i,o)=>i.type.localeCompare(o.type))},...n}}};function ije(e,t=!1){return(n,r,i,o)=>{if(n==="span"&&i&&i.length)return t?[e.text(i)]:ug.splitTextToNodes(e,i)(s=>e.text(s));const a=wQ.fromPrismic(e)(r);return a?oje(a,o):o.flat()}}function oje(e,t){return t.flat().map(r=>{const o=[...r.marks,e].sort((a,u)=>a.type.name.localeCompare(u.type.name));return r.mark(o)})}const aje={name:ZM.name,component:ZM,converter:rje},Us=aje,fO="document";function uje(e){return qLe.extend({name:fO,content:e?"block+":"block"})}function sje(e){return{fromPrismic(t,n,r){var o;const i=r.value.reduce((a,u)=>{const{extension:s,block:c}=dje(e,u,t,n),l=lje({extension:s,block:c,schema:t}),f=a.slice(0,a.length-1),p=gn.last(a),A=fje({node:l,previousNode:p});return A.updatedNode?[...A.merged?f:a,A.updatedNode]:a},[]);return(o=t.nodes[fO])==null?void 0:o.create({},i)},toPrismic(t){return{__TYPE__:"StructuredTextContent",value:[...js.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},[])]}}}}const cje=new RLe(fO,uje,sje),xC=cje;function lje(e){const{extension:t,block:n,schema:r}=e;if(t)switch(t.nodeType){case Al.Embed:return Ue.EmbedBlock.is(n)?t.converter.fromPrismic(r)(n):void 0;case Al.Text:return Ue.TextBlock.is(n)?t.converter.fromPrismic(r)(n):void 0;case Al.Image:return Ue.ImageBlock.is(n)?t.converter.fromPrismic(r)(n):void 0}}function fje(e){const{node:t,previousNode:n}=e;return!t||!n?{merged:!1,updatedNode:t}:t.type.name===n.type.name&&(t.type.name===dg.name||t.type.name===Ag.name)?{merged:!0,updatedNode:zLe(n,t)}:{merged:!1,updatedNode:t}}function dje(e,t,n,r){var u;const i=e.find(s=>s.richTextNodeTypes.includes(t.type)&&r.has(t.type));if(i)return{extension:i,block:t};if(!Ue.TextBlock.is(t))return{extension:void 0,block:t};const o=e.find(s=>vQ(s)&&s.name in n.nodes),a=(u=t.content.spans)==null?void 0:u.filter(s=>{const c=nje[s.type];return c&&c in n.marks});return{extension:o,block:{...t,content:{text:t.content.text,spans:a}}}}const pje=cr.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,considerAnyAsEmpty:!1,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new Nr({key:new Gi("placeholder"),props:{decorations:({doc:e,selection:t})=>{var n;const r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=t,o=[];if(!r)return null;const{firstChild:a}=e.content,u=a&&a.type.isLeaf,s=a&&a.isAtom,c=this.options.considerAnyAsEmpty?!0:a&&a.type.name===((n=e.type.contentMatch.defaultType)===null||n===void 0?void 0:n.name),l=e.content.childCount<=1&&a&&c&&a.nodeSize<=2&&(!u||!s);return e.descendants((f,p)=>{const A=i>=p&&i<=p+f.nodeSize,h=!f.isLeaf&&!f.childCount;if((A||!this.options.showOnlyCurrent)&&h){const v=[this.options.emptyNodeClass];l&&v.push(this.options.emptyEditorClass);const _=Si.node(p,p+f.nodeSize,{class:v.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:f,pos:p,hasAnchor:A}):this.options.placeholder});o.push(_)}return this.options.includeChildren}),Vt.create(e,o)}}})]}}),Aje="Type '/' for commands",hje=e=>pje.configure({includeChildren:!0,placeholder:t=>mje({props:t,params:e}),showOnlyCurrent:!1,showOnlyWhenEditable:!1});function mje({props:e,params:t}){const{editor:n,hasAnchor:r,node:i}=e,{placeholderByNodeType:o,unfocusedPlaceholder:a,nodeExtensions:u}=t,s=!js.children.exists(n.state.doc,I=>I===i),c=n.isEditable,l=n.isFocused&&r,f=i.type.name!==aa.name,p=l||f||s,A=u.filter(I=>I!==aa).length>1;function h(I){return I===Aje?c&&p&&A:c&&p}function v(){if(s)return Wl.placeholder;const I=o[i.type.name];return typeof I=="string"?I:I==null?void 0:I(i.attrs)}const _=v(),S=h(_);return a&&!l&&n.isEmpty?a:S&&_||""}function J0(e){return e.split("-")[1]}function $Q(e){return e==="y"?"height":"width"}function ou(e){return e.split("-")[0]}function Rh(e){return["top","bottom"].includes(ou(e))?"x":"y"}function XM(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=Rh(t),s=$Q(u),c=r[s]/2-i[s]/2,l=u==="x";let f;switch(ou(t)){case"top":f={x:o,y:r.y-i.height};break;case"bottom":f={x:o,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:a};break;case"left":f={x:r.x-i.width,y:a};break;default:f={x:r.x,y:r.y}}switch(J0(t)){case"start":f[u]-=c*(n&&l?-1:1);break;case"end":f[u]+=c*(n&&l?-1:1)}return f}const gje=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,u=o.filter(Boolean),s=await(a.isRTL==null?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:l,y:f}=XM(c,r,s),p=r,A={},h=0;for(let v=0;v<u.length;v++){const{name:_,fn:S}=u[v],{x:I,y:T,data:g,reset:C}=await S({x:l,y:f,initialPlacement:r,placement:p,strategy:i,middlewareData:A,rects:c,platform:a,elements:{reference:e,floating:t}});l=I??l,f=T??f,A={...A,[_]:{...A[_],...g}},C&&h<=50&&(h++,typeof C=="object"&&(C.placement&&(p=C.placement),C.rects&&(c=C.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):C.rects),{x:l,y:f}=XM(c,p,s)),v=-1)}return{x:l,y:f,placement:p,strategy:i,middlewareData:A}};function vje(e){return typeof e!="number"?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(e):{top:e,right:e,bottom:e,left:e}}function wC(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function EQ(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:p=!1,padding:A=0}=t,h=vje(A),v=u[p?f==="floating"?"reference":"floating":f],_=wC(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(v)))==null||n?v:v.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(u.floating)),boundary:c,rootBoundary:l,strategy:s})),S=f==="floating"?{...a.floating,x:r,y:i}:a.reference,I=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u.floating)),T=await(o.isElement==null?void 0:o.isElement(I))&&await(o.getScale==null?void 0:o.getScale(I))||{x:1,y:1},g=wC(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:S,offsetParent:I,strategy:s}):S);return{top:(_.top-g.top+h.top)/T.y,bottom:(g.bottom-_.bottom+h.bottom)/T.y,left:(_.left-g.left+h.left)/T.x,right:(g.right-_.right+h.right)/T.x}}const yje=Math.min,bje=Math.max;function ek(e,t,n){return bje(e,yje(t,n))}const Cje=["top","right","bottom","left"];Cje.reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);const Sje={left:"right",right:"left",bottom:"top",top:"bottom"};function sg(e){return e.replace(/left|right|bottom|top/g,t=>Sje[t])}function _je(e,t,n){n===void 0&&(n=!1);const r=J0(e),i=Rh(e),o=$Q(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=sg(a)),{main:a,cross:sg(a)}}const Ije={start:"end",end:"start"};function m1(e){return e.replace(/start|end/g,t=>Ije[t])}const Tje=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:p="bestFit",fallbackAxisSideDirection:A="none",flipAlignment:h=!0,...v}=e,_=ou(r),S=ou(a)===a,I=await(u.isRTL==null?void 0:u.isRTL(s.floating)),T=f||(S||!h?[sg(a)]:function(F){const K=sg(F);return[m1(F),K,m1(K)]}(a));f||A==="none"||T.push(...function(F,K,N,J){const Z=J0(F);let ae=function(ge,se,k){const E=["left","right"],D=["right","left"],ue=["top","bottom"],ke=["bottom","top"];switch(ge){case"top":case"bottom":return k?se?D:E:se?E:D;case"left":case"right":return se?ue:ke;default:return[]}}(ou(F),N==="start",J);return Z&&(ae=ae.map(ge=>ge+"-"+Z),K&&(ae=ae.concat(ae.map(m1)))),ae}(a,h,A,I));const g=[a,...T],C=await EQ(t,v),y=[];let x=((n=i.flip)==null?void 0:n.overflows)||[];if(c&&y.push(C[_]),l){const{main:F,cross:K}=_je(r,o,I);y.push(C[F],C[K])}if(x=[...x,{placement:r,overflows:y}],!y.every(F=>F<=0)){var w,M;const F=(((w=i.flip)==null?void 0:w.index)||0)+1,K=g[F];if(K)return{data:{index:F,overflows:x},reset:{placement:K}};let N=(M=x.filter(J=>J.overflows[0]<=0).sort((J,Z)=>J.overflows[1]-Z.overflows[1])[0])==null?void 0:M.placement;if(!N)switch(p){case"bestFit":{var O;const J=(O=x.map(Z=>[Z.placement,Z.overflows.filter(ae=>ae>0).reduce((ae,ge)=>ae+ge,0)]).sort((Z,ae)=>Z[1]-ae[1])[0])==null?void 0:O[0];J&&(N=J);break}case"initialPlacement":N=a}if(r!==N)return{reset:{placement:N}}}return{}}}},xje=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,i=await async function(o,a){const{placement:u,platform:s,elements:c}=o,l=await(s.isRTL==null?void 0:s.isRTL(c.floating)),f=ou(u),p=J0(u),A=Rh(u)==="x",h=["left","top"].includes(f)?-1:1,v=l&&A?-1:1,_=typeof a=="function"?a(o):a;let{mainAxis:S,crossAxis:I,alignmentAxis:T}=typeof _=="number"?{mainAxis:_,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,..._};return p&&typeof T=="number"&&(I=p==="end"?-1*T:T),A?{x:I*v,y:S*h}:{x:S*h,y:I*v}}(t,e);return{x:n+i.x,y:r+i.y,data:i}}}};function RQ(e){return e==="x"?"y":"x"}const wje=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:_=>{let{x:S,y:I}=_;return{x:S,y:I}}},...s}=e,c={x:n,y:r},l=await EQ(t,s),f=Rh(ou(i)),p=RQ(f);let A=c[f],h=c[p];if(o){const _=f==="y"?"bottom":"right";A=ek(A+l[f==="y"?"top":"left"],A,A-l[_])}if(a){const _=p==="y"?"bottom":"right";h=ek(h+l[p==="y"?"top":"left"],h,h-l[_])}const v=u.fn({...t,[f]:A,[p]:h});return{...v,data:{x:v.x-n,y:v.y-r}}}}},$je=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=Rh(i),p=RQ(f);let A=l[f],h=l[p];const v=typeof u=="function"?u(t):u,_=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(s){const T=f==="y"?"height":"width",g=o.reference[f]-o.floating[T]+_.mainAxis,C=o.reference[f]+o.reference[T]-_.mainAxis;A<g?A=g:A>C&&(A=C)}if(c){var S,I;const T=f==="y"?"width":"height",g=["top","left"].includes(ou(i)),C=o.reference[p]-o.floating[T]+(g&&((S=a.offset)==null?void 0:S[p])||0)+(g?0:_.crossAxis),y=o.reference[p]+o.reference[T]+(g?0:((I=a.offset)==null?void 0:I[p])||0)-(g?_.crossAxis:0);h<C?h=C:h>y&&(h=y)}return{[f]:A,[p]:h}}}};function wr(e){var t;return((t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ro(e){return wr(e).getComputedStyle(e)}const tk=Math.min,jd=Math.max,cg=Math.round;function OQ(e){const t=ro(e);let n=parseFloat(t.width),r=parseFloat(t.height);const i=e.offsetWidth,o=e.offsetHeight,a=cg(n)!==i||cg(r)!==o;return a&&(n=i,r=o),{width:n,height:r,fallback:a}}function Au(e){return MQ(e)?(e.nodeName||"").toLowerCase():""}let Gh;function FQ(){if(Gh)return Gh;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(Gh=e.brands.map(t=>t.brand+"/"+t.version).join(" "),Gh):navigator.userAgent}function io(e){return e instanceof wr(e).HTMLElement}function xi(e){return e instanceof wr(e).Element}function MQ(e){return e instanceof wr(e).Node}function nk(e){return typeof ShadowRoot>"u"?!1:e instanceof wr(e).ShadowRoot||e instanceof ShadowRoot}function Z0(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=ro(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function Eje(e){return["table","td","th"].includes(Au(e))}function $C(e){const t=/firefox/i.test(FQ()),n=ro(e),r=n.backdropFilter||n.WebkitBackdropFilter;return n.transform!=="none"||n.perspective!=="none"||!!r&&r!=="none"||t&&n.willChange==="filter"||t&&!!n.filter&&n.filter!=="none"||["transform","perspective"].some(i=>n.willChange.includes(i))||["paint","layout","strict","content"].some(i=>{const o=n.contain;return o!=null&&o.includes(i)})}function EC(){return/^((?!chrome|android).)*safari/i.test(FQ())}function dO(e){return["html","body","#document"].includes(Au(e))}function kQ(e){return xi(e)?e:e.contextElement}const LQ={x:1,y:1};function hl(e){const t=kQ(e);if(!io(t))return LQ;const n=t.getBoundingClientRect(),{width:r,height:i,fallback:o}=OQ(t);let a=(o?cg(n.width):n.width)/r,u=(o?cg(n.height):n.height)/i;return a&&Number.isFinite(a)||(a=1),u&&Number.isFinite(u)||(u=1),{x:a,y:u}}function Bs(e,t,n,r){var i,o;t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),u=kQ(e);let s=LQ;t&&(r?xi(r)&&(s=hl(r)):s=hl(e));const c=u?wr(u):window,l=EC()&&n;let f=(a.left+(l&&((i=c.visualViewport)==null?void 0:i.offsetLeft)||0))/s.x,p=(a.top+(l&&((o=c.visualViewport)==null?void 0:o.offsetTop)||0))/s.y,A=a.width/s.x,h=a.height/s.y;if(u){const v=wr(u),_=r&&xi(r)?wr(r):r;let S=v.frameElement;for(;S&&r&&_!==v;){const I=hl(S),T=S.getBoundingClientRect(),g=getComputedStyle(S);T.x+=(S.clientLeft+parseFloat(g.paddingLeft))*I.x,T.y+=(S.clientTop+parseFloat(g.paddingTop))*I.y,f*=I.x,p*=I.y,A*=I.x,h*=I.y,f+=T.x,p+=T.y,S=wr(S).frameElement}}return{width:A,height:h,top:p,right:f+A,bottom:p+h,left:f,x:f,y:p}}function au(e){return((MQ(e)?e.ownerDocument:e.document)||window.document).documentElement}function X0(e){return xi(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function jQ(e){return Bs(au(e)).left+X0(e).scrollLeft}function _p(e){if(Au(e)==="html")return e;const t=e.assignedSlot||e.parentNode||nk(e)&&e.host||au(e);return nk(t)?t.host:t}function UQ(e){const t=_p(e);return dO(t)?t.ownerDocument.body:io(t)&&Z0(t)?t:UQ(t)}function vs(e,t){var n;t===void 0&&(t=[]);const r=UQ(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=wr(r);return i?t.concat(o,o.visualViewport||[],Z0(r)?r:[]):t.concat(r,vs(r))}function rk(e,t,n){let r;if(t==="viewport")r=function(a,u){const s=wr(a),c=au(a),l=s.visualViewport;let f=c.clientWidth,p=c.clientHeight,A=0,h=0;if(l){f=l.width,p=l.height;const v=EC();(!v||v&&u==="fixed")&&(A=l.offsetLeft,h=l.offsetTop)}return{width:f,height:p,x:A,y:h}}(e,n);else if(t==="document")r=function(a){const u=au(a),s=X0(a),c=a.ownerDocument.body,l=jd(u.scrollWidth,u.clientWidth,c.scrollWidth,c.clientWidth),f=jd(u.scrollHeight,u.clientHeight,c.scrollHeight,c.clientHeight);let p=-s.scrollLeft+jQ(a);const A=-s.scrollTop;return ro(c).direction==="rtl"&&(p+=jd(u.clientWidth,c.clientWidth)-l),{width:l,height:f,x:p,y:A}}(au(e));else if(xi(t))r=function(a,u){const s=Bs(a,!0,u==="fixed"),c=s.top+a.clientTop,l=s.left+a.clientLeft,f=io(a)?hl(a):{x:1,y:1};return{width:a.clientWidth*f.x,height:a.clientHeight*f.y,x:l*f.x,y:c*f.y}}(t,n);else{const a={...t};if(EC()){var i,o;const u=wr(e);a.x-=((i=u.visualViewport)==null?void 0:i.offsetLeft)||0,a.y-=((o=u.visualViewport)==null?void 0:o.offsetTop)||0}r=a}return wC(r)}function ik(e,t){return io(e)&&ro(e).position!=="fixed"?t?t(e):e.offsetParent:null}function ok(e,t){const n=wr(e);let r=ik(e,t);for(;r&&Eje(r)&&ro(r).position==="static";)r=ik(r,t);return r&&(Au(r)==="html"||Au(r)==="body"&&ro(r).position==="static"&&!$C(r))?n:r||function(i){let o=_p(i);for(;io(o)&&!dO(o);){if($C(o))return o;o=_p(o)}return null}(e)||n}function Rje(e,t,n){const r=io(t),i=au(t),o=Bs(e,!0,n==="fixed",t);let a={scrollLeft:0,scrollTop:0};const u={x:0,y:0};if(r||!r&&n!=="fixed")if((Au(t)!=="body"||Z0(i))&&(a=X0(t)),io(t)){const s=Bs(t,!0);u.x=s.x+t.clientLeft,u.y=s.y+t.clientTop}else i&&(u.x=jQ(i));return{x:o.left+a.scrollLeft-u.x,y:o.top+a.scrollTop-u.y,width:o.width,height:o.height}}const Oje={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=n==="clippingAncestors"?function(c,l){const f=l.get(c);if(f)return f;let p=vs(c).filter(_=>xi(_)&&Au(_)!=="body"),A=null;const h=ro(c).position==="fixed";let v=h?_p(c):c;for(;xi(v)&&!dO(v);){const _=ro(v),S=$C(v);_.position==="fixed"?A=null:(h?S||A:S||_.position!=="static"||!A||!["absolute","fixed"].includes(A.position))?A=_:p=p.filter(I=>I!==v),v=_p(v)}return l.set(c,p),p}(t,this._c):[].concat(n),a=[...o,r],u=a[0],s=a.reduce((c,l)=>{const f=rk(t,l,i);return c.top=jd(f.top,c.top),c.right=tk(f.right,c.right),c.bottom=tk(f.bottom,c.bottom),c.left=jd(f.left,c.left),c},rk(t,u,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=io(n),o=au(n);if(n===o)return t;let a={scrollLeft:0,scrollTop:0},u={x:1,y:1};const s={x:0,y:0};if((i||!i&&r!=="fixed")&&((Au(n)!=="body"||Z0(o))&&(a=X0(n)),io(n))){const c=Bs(n);u=hl(n),s.x=c.x+n.clientLeft,s.y=c.y+n.clientTop}return{width:t.width*u.x,height:t.height*u.y,x:t.x*u.x-a.scrollLeft*u.x+s.x,y:t.y*u.y-a.scrollTop*u.y+s.y}},isElement:xi,getDimensions:function(e){return io(e)?OQ(e):e.getBoundingClientRect()},getOffsetParent:ok,getDocumentElement:au,getScale:hl,async getElementRects(e){let{reference:t,floating:n,strategy:r}=e;const i=this.getOffsetParent||ok,o=this.getDimensions;return{reference:Rje(t,await i(n),r),floating:{x:0,y:0,...await o(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>ro(e).direction==="rtl"};function Fje(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=!0,animationFrame:u=!1}=r,s=i&&!u,c=s||o?[...xi(e)?vs(e):e.contextElement?vs(e.contextElement):[],...vs(t)]:[];c.forEach(A=>{s&&A.addEventListener("scroll",n,{passive:!0}),o&&A.addEventListener("resize",n)});let l,f=null;if(a){let A=!0;f=new ResizeObserver(()=>{A||n(),A=!1}),xi(e)&&!u&&f.observe(e),xi(e)||!e.contextElement||u||f.observe(e.contextElement),f.observe(t)}let p=u?Bs(e):null;return u&&function A(){const h=Bs(e);!p||h.x===p.x&&h.y===p.y&&h.width===p.width&&h.height===p.height||n(),p=h,l=requestAnimationFrame(A)}(),n(),()=>{var A;c.forEach(h=>{s&&h.removeEventListener("scroll",n),o&&h.removeEventListener("resize",n)}),(A=f)==null||A.disconnect(),f=null,u&&cancelAnimationFrame(l)}}const Mje=(e,t,n)=>{const r=new Map,i={platform:Oje,...n},o={...i.platform,_c:r};return gje(e,t,{...i,platform:o})};var sm=typeof document<"u"?R.useLayoutEffect:R.useEffect;function lg(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(!lg(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)&&!lg(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function ak(e){const t=we.useRef(e);return sm(()=>{t.current=e}),t}function kje(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,whileElementsMounted:o,open:a}=e,[u,s]=we.useState({x:null,y:null,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[c,l]=we.useState(r);lg(c,r)||l(r);const f=we.useRef(null),p=we.useRef(null),A=we.useRef(u),h=ak(o),v=ak(i),[_,S]=we.useState(null),[I,T]=we.useState(null),g=we.useCallback(O=>{f.current!==O&&(f.current=O,S(O))},[]),C=we.useCallback(O=>{p.current!==O&&(p.current=O,T(O))},[]),y=we.useCallback(()=>{if(!f.current||!p.current)return;const O={placement:t,strategy:n,middleware:c};v.current&&(O.platform=v.current),Mje(f.current,p.current,O).then(F=>{const K={...F,isPositioned:!0};x.current&&!lg(A.current,K)&&(A.current=K,gV.flushSync(()=>{s(K)}))})},[c,t,n,v]);sm(()=>{a===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,s(O=>({...O,isPositioned:!1})))},[a]);const x=we.useRef(!1);sm(()=>(x.current=!0,()=>{x.current=!1}),[]),sm(()=>{if(_&&I){if(h.current)return h.current(_,I,y);y()}},[_,I,y,h]);const w=we.useMemo(()=>({reference:f,floating:p,setReference:g,setFloating:C}),[g,C]),M=we.useMemo(()=>({reference:_,floating:I}),[_,I]);return we.useMemo(()=>({...u,update:y,refs:w,elements:M,reference:g,floating:C}),[u,y,w,M,g,C])}var tu=typeof document<"u"?R.useLayoutEffect:R.useEffect;function Lje(){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 g1=!1,jje=0;const uk=()=>"floating-ui-"+jje++;function Uje(){const[e,t]=we.useState(()=>g1?uk():void 0);return tu(()=>{e==null&&t(uk())},[]),we.useEffect(()=>{g1||(g1=!0)},[]),e}const sk=we["useId".toString()],ck=sk??Uje,Bje=we.createContext(null),Wje=we.createContext(null),BQ=()=>{var e,t;return(e=(t=we.useContext(Bje))==null?void 0:t.id)!=null?e:null},pO=()=>we.useContext(Wje);function AO(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function WQ(e){var t;return(t=AO(e).defaultView)!=null?t:window}function cm(e){return e?e instanceof WQ(e).Element:!1}function Kje(e){return e?e instanceof WQ(e).HTMLElement:!1}const lk=we["useInsertionEffect".toString()];function RC(e){const t=we.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return lk?lk(()=>{t.current=e}):t.current=e,we.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 Pje(e){let{open:t=!1,onOpenChange:n,whileElementsMounted:r,placement:i,middleware:o,strategy:a,nodeId:u}=e===void 0?{}:e;const[s,c]=we.useState(null),l=pO(),f=we.useRef(null),p=we.useRef({}),A=we.useState(()=>Lje())[0],h=kje({placement:i,middleware:o,strategy:a,whileElementsMounted:r}),v=RC(n),_=we.useMemo(()=>({...h.refs,domReference:f}),[h.refs]),S=we.useMemo(()=>({...h,refs:_,dataRef:p,nodeId:u,events:A,open:t,onOpenChange:v,_:{domReference:s}}),[h,u,A,t,v,_,s]);tu(()=>{const g=l==null?void 0:l.nodesRef.current.find(C=>C.id===u);g&&(g.context=S)});const{reference:I}=h,T=we.useCallback(g=>{(cm(g)||g===null)&&(S.refs.domReference.current=g,c(g)),I(g)},[I,S.refs]);return we.useMemo(()=>({...h,context:S,refs:_,reference:T}),[h,_,S,T])}function v1(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,p=new Array(f),A=0;A<f;A++)p[A]=arguments[A];(l=r.get(u))==null||l.forEach(h=>h(...p))}}}else i[u]=s}),i),{})}}const Dje=function(e){return e===void 0&&(e=[]),{getReferenceProps:t=>v1(t,e,"reference"),getFloatingProps:t=>v1(t,e,"floating"),getItemProps:t=>v1(t,e,"item")}};function y1(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 fk(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 Nje(e){return"composedPath"in e?e.composedPath()[0]:e.target}function za(e){e.preventDefault(),e.stopPropagation()}function qje(e){const t=R.useRef(e);return tu(()=>{t.current=e}),t}function dk(e){const t=R.useRef();return tu(()=>{t.current=e},[e]),t.current}const Qje=function(e,t){let{open:n}=e,{enabled:r=!0,role:i="dialog"}=t===void 0?{}:t;const o=ck(),a=ck(),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 b1(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 Vje=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:p=!0}=t===void 0?{}:t;const A=pO(),h=BQ()!=null,v=we.useRef(!1);return we.useEffect(()=>{if(!n||!u)return;function _(C){if(C.key==="Escape"){if(!p&&A&&y1(A.nodesRef.current,a).length>0)return;o.emit("dismiss",{preventScroll:!1}),r(!1)}}function S(C){const y=v.current;if(v.current=!1,y)return;const x=Nje(C);if(cm(x)&&i.floating.current){var w;const O=(w=i.floating.current.ownerDocument.defaultView)!=null?w:window,F=x.scrollWidth>x.clientWidth,K=x.scrollHeight>x.clientHeight;let N=K&&C.offsetX>x.clientWidth;if(K&&O.getComputedStyle(x).direction==="rtl"&&(N=C.offsetX<=x.offsetWidth-x.clientWidth),N||F&&C.offsetY>x.clientHeight)return}const M=A&&y1(A.nodesRef.current,a).some(O=>{var F;return b1(C,(F=O.context)==null?void 0:F.refs.floating.current)});b1(C,i.floating.current)||b1(C,i.domReference.current)||M||!p&&A&&y1(A.nodesRef.current,a).length>0||(o.emit("dismiss",h?{preventScroll:!0}:!1),r(!1))}function I(){r(!1)}const T=AO(i.floating.current);s&&T.addEventListener("keydown",_),c&&T.addEventListener("pointerdown",S);const g=(f?[...cm(i.reference.current)?vs(i.reference.current):[],...cm(i.floating.current)?vs(i.floating.current):[]]:[]).filter(C=>{var y;return C!==((y=T.defaultView)==null?void 0:y.visualViewport)});return g.forEach(C=>C.addEventListener("scroll",I,{passive:!0})),()=>{s&&T.removeEventListener("keydown",_),c&&T.removeEventListener("pointerdown",S),g.forEach(C=>C.removeEventListener("scroll",I))}},[s,c,o,A,a,n,r,f,u,p,i,h]),u?{reference:{onPointerDown(){l&&(o.emit("dismiss"),r(!1))}},floating:{onPointerDownCapture(){v.current=!0}}}:{}},hO="ArrowUp",eb="ArrowDown",Kl="ArrowLeft",Oh="ArrowRight";function Jh(e,t,n){return Math.floor(e/t)!==n}function yd(e,t){return t<0||t>=e.current.length}function En(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:i,amount:o=1}=t===void 0?{}:t;const a=e.current;let u=n;do{var s,c;u=u+(r?-o:o)}while(u>=0&&u<=a.length-1&&(i?i.includes(u):a[u]==null||(s=a[u])!=null&&s.hasAttribute("disabled")||((c=a[u])==null?void 0:c.getAttribute("aria-disabled"))==="true"));return u}function tb(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function pk(e,t){return tb(t,e===hO||e===eb,e===Kl||e===Oh)}function C1(e,t,n){return tb(t,e===eb,n?e===Kl:e===Oh)||e==="Enter"||e==" "||e===""}function zje(e,t,n){return tb(t,n?e===Kl:e===Oh,e===eb)}function Hje(e,t,n){return tb(t,n?e===Oh:e===Kl,e===hO)}function S1(e,t){return En(e,{disabledIndices:t})}function Ak(e,t){return En(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}const Yje=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:p=!1,rtl:A=!1,virtual:h=!1,focusItemOnOpen:v="auto",focusItemOnHover:_=!0,openOnArrowKeyDown:S=!0,disabledIndices:I=void 0,orientation:T="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(" "))),T==="vertical"&&g>1&&console.warn(["Floating UI: In grid list navigation mode (`cols` > 1), the",'`orientation` should be either "horizontal" or "both".'].join(" ")));const C=BQ(),y=pO(),x=dk(n),w=RC(u),M=RC(dk(u)),O=we.useRef(v),F=we.useRef(c??-1),K=we.useRef(null),N=qje(I),J=we.useRef(!1),Z=we.useRef(-1),[ae,ge]=we.useState(),se=we.useCallback((E,D)=>{Z.current=requestAnimationFrame(()=>{if(h){var ue;ge((ue=E.current[D.current])==null?void 0:ue.id)}else{var ke;(ke=E.current[D.current])==null||ke.focus({preventScroll:!0})}})},[h]);tu(()=>{s&&(!x&&n&&O.current&&c!=null&&w(c),x&&!n&&(cancelAnimationFrame(Z.current),F.current=-1,M(null)))},[n,x,c,o,se,s,w,M]),tu(()=>{if(s&&n)if(a==null){if(c!=null)return;x&&(F.current=-1,se(o,F)),!x&&O.current&&(K.current!=null||O.current===!0&&K.current==null)&&(F.current=K.current==null||C1(K.current,T,A)||p?S1(o,N.current):Ak(o,N.current),w(F.current),se(o,F))}else yd(o,a)||(F.current=a,se(o,F))},[n,x,a,c,p,o,w,se,s,l,T,A,h,N]),tu(()=>{if(s&&!n&&x){var E,D;const ue=y==null||(E=y.nodesRef.current.find(ke=>ke.id===C))==null||(D=E.context)==null?void 0:D.refs.floating.current;ue&&!ue.contains(fk(AO(ue)))&&ue.focus({preventScroll:!0})}},[s,n,x,y,C]),tu(()=>{K.current=null});function k(E){if(J.current=!0,p&&Hje(E.key,T,A)){za(E),r(!1),Kje(i.domReference.current)&&i.domReference.current.focus();return}const D=F.current,ue=S1(o,I),ke=Ak(o,I);if(E.key==="Home"&&(F.current=ue,w(F.current)),E.key==="End"&&(F.current=ke,w(F.current)),g>1){const Se=F.current;if(E.key===hO){if(za(E),Se===-1)F.current=ke;else if(F.current=En(o,{startingIndex:Se,amount:g,decrement:!0,disabledIndices:I}),f&&(Se-g<ue||F.current<0)){const rt=Se%g,bt=ke%g,Yt=ke-(bt-rt);bt===rt?F.current=ke:F.current=bt>rt?Yt:Yt-g}yd(o,F.current)&&(F.current=Se),w(F.current)}if(E.key===eb&&(za(E),Se===-1?F.current=ue:(F.current=En(o,{startingIndex:Se,amount:g,disabledIndices:I}),f&&Se+g>ke&&(F.current=En(o,{startingIndex:Se%g-g,amount:g,disabledIndices:I}))),yd(o,F.current)&&(F.current=Se),w(F.current)),T==="both"){const rt=Math.floor(Se/g);E.key===Oh&&(za(E),Se%g!==g-1?(F.current=En(o,{startingIndex:Se,disabledIndices:I}),f&&Jh(F.current,g,rt)&&(F.current=En(o,{startingIndex:Se-Se%g-1,disabledIndices:I}))):f&&(F.current=En(o,{startingIndex:Se-Se%g-1,disabledIndices:I})),Jh(F.current,g,rt)&&(F.current=Se)),E.key===Kl&&(za(E),Se%g!==0?(F.current=En(o,{startingIndex:Se,disabledIndices:I,decrement:!0}),f&&Jh(F.current,g,rt)&&(F.current=En(o,{startingIndex:Se+(g-Se%g),decrement:!0,disabledIndices:I}))):f&&(F.current=En(o,{startingIndex:Se+(g-Se%g),decrement:!0,disabledIndices:I})),Jh(F.current,g,rt)&&(F.current=Se));const bt=Math.floor(ke/g)===rt;yd(o,F.current)&&(f&&bt?F.current=E.key===Kl?ke:En(o,{startingIndex:Se-Se%g-1,disabledIndices:I}):F.current=Se),w(F.current);return}}if(pk(E.key,T)){if(za(E),n&&!h&&fk(E.currentTarget.ownerDocument)===E.currentTarget){F.current=C1(E.key,T,A)?ue:ke,w(F.current);return}C1(E.key,T,A)?f?F.current=D>=ke?l&&D!==o.current.length?-1:ue:En(o,{startingIndex:D,disabledIndices:I}):F.current=Math.min(ke,En(o,{startingIndex:D,disabledIndices:I})):f?F.current=D<=ue?l&&D!==-1?o.current.length:ke:En(o,{startingIndex:D,decrement:!0,disabledIndices:I}):F.current=Math.max(ue,En(o,{startingIndex:D,decrement:!0,disabledIndices:I})),yd(o,F.current)?w(null):w(F.current)}}return s?{reference:{...h&&n&&a!=null&&{"aria-activedescendant":ae},onKeyDown(E){if(J.current=!0,h&&n)return k(E);if((E.key.indexOf("Arrow")===0||E.key==="Enter"||E.key===" "||E.key==="")&&(K.current=E.key),p){zje(E.key,T,A)&&(za(E),n?(F.current=S1(o,I),w(F.current)):r(!0));return}pk(E.key,T)&&(c!=null&&(F.current=c),za(E),!n&&S?r(!0):k(E),n&&w(F.current))}},floating:{"aria-orientation":T==="both"?void 0:T,...h&&a!=null&&{"aria-activedescendant":ae},onKeyDown:k,onPointerMove(){J.current=!1}},item:{onFocus(E){let{currentTarget:D}=E;const ue=o.current.indexOf(D);ue!==-1&&w(ue)},onClick:E=>{let{currentTarget:D}=E;return D.focus({preventScroll:!0})},..._&&{onMouseMove(E){let{currentTarget:D}=E;const ue=D;if(ue){const ke=o.current.indexOf(ue);ke!==-1&&w(ke)}},onPointerLeave(){if(!J.current&&(F.current=-1,se(o,F),w(null),!h)){var E;(E=i.floating.current)==null||E.focus({preventScroll:!0})}}}}}:{}};function Gje(e){var t;const{char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:a}=e,u=TMe(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 p=a.pos-f.length,A=Array.from(f.matchAll(l)).pop();if(!A||A.input===void 0||A.index===void 0)return null;const h=A.input.slice(Math.max(0,A.index-1),A.index),v=new RegExp(`^[${i==null?void 0:i.join("")}\0]?$`).test(h);if(i!==null&&!v)return null;const _=p+A.index;let S=_+A[0].length;return r&&s.test(f.slice(S-1,S+1))&&(A[0]+=" ",S+=1),_<a.pos&&S>=a.pos?{range:{from:_,to:S},query:A[0].slice(n.length),text:A[0]}:null}const Jje=new Gi("suggestion");function Zje({pluginKey:e=Jje,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,findSuggestionMatch:p=Gje}){let A;const h=l==null?void 0:l(),v=new Nr({key:e,view(){return{update:async(_,S)=>{var I,T,g,C,y,x,w;const M=(I=this.key)===null||I===void 0?void 0:I.getState(S),O=(T=this.key)===null||T===void 0?void 0:T.getState(_.state),F=M.active&&O.active&&M.range.from!==O.range.from,K=!M.active&&O.active,N=M.active&&!O.active,J=!K&&!N&&M.query!==O.query,Z=K||F,ae=J&&!F,ge=N||F;if(!Z&&!ae&&!ge)return;const se=ge&&!Z?M:O,k=_.dom.querySelector(`[data-decoration-id="${se.decorationId}"]`);A={editor:t,range:se.range,query:se.query,text:se.text,items:[],command:E=>s({editor:t,range:se.range,props:E}),decorationNode:k,clientRect:k?()=>{var E;const{decorationId:D}=(E=this.key)===null||E===void 0?void 0:E.getState(t.state),ue=_.dom.querySelector(`[data-decoration-id="${D}"]`);return(ue==null?void 0:ue.getBoundingClientRect())||null}:null},Z&&((g=h==null?void 0:h.onBeforeStart)===null||g===void 0||g.call(h,A)),ae&&((C=h==null?void 0:h.onBeforeUpdate)===null||C===void 0||C.call(h,A)),(ae||Z)&&(A.items=await c({editor:t,query:se.query})),ge&&((y=h==null?void 0:h.onExit)===null||y===void 0||y.call(h,A)),ae&&((x=h==null?void 0:h.onUpdate)===null||x===void 0||x.call(h,A)),Z&&((w=h==null?void 0:h.onStart)===null||w===void 0||w.call(h,A))},destroy:()=>{var _;A&&((_=h==null?void 0:h.onExit)===null||_===void 0||_.call(h,A))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(_,S,I,T){const{isEditable:g}=t,{composing:C}=t.view,{selection:y}=_,{empty:x,from:w}=y,M={...S};if(M.composing=C,g&&(x||t.view.composing)){(w<S.range.from||w>S.range.to)&&!C&&!S.composing&&(M.active=!1);const O=p({char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:y.$from}),F=`id_${Math.floor(Math.random()*4294967295)}`;O&&f({editor:t,state:T,range:O.range})?(M.active=!0,M.decorationId=S.decorationId?S.decorationId:F,M.range=O.range,M.query=O.query,M.text=O.text):M.active=!1}else M.active=!1;return M.active||(M.decorationId=null,M.range={from:0,to:0},M.query=null,M.text=null),M}},props:{handleKeyDown(_,S){var I;const{active:T,range:g}=v.getState(_.state);return T&&((I=h==null?void 0:h.onKeyDown)===null||I===void 0?void 0:I.call(h,{view:_,event:S,range:g}))||!1},decorations(_){const{active:S,range:I,decorationId:T}=v.getState(_);return S?Vt.create(_.doc,[Si.inline(I.from,I.to,{nodeName:a,class:u,"data-decoration-id":T})]):null}}});return v}const Xje=kn.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",St(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),lm="ltr",ls="rtl",Vo="dir",eUe=le.RichTextNodeType.rtl,tUe=cr.create({name:"textDirection",addOptions(){return{supportedExtensionNames:[]}},addGlobalAttributes(){return[{types:this.options.supportedExtensionNames,attributes:{[Vo]:{default:lm,parseHTML:e=>e.getAttribute(Vo),renderHTML:e=>({[Vo]:OC(e[Vo])})}}}]},addCommands(){return{setDirection:e=>({commands:t})=>{switch(e){case lm:return t.setLeftToRight();case ls:return t.setRightToLeft()}},toggleDirection:e=>({commands:t})=>{const n=e===ls?lm:ls;return t.setDirection(n)},setRightToLeft:()=>({commands:e})=>this.options.supportedExtensionNames.every(t=>e.updateAttributes(t,{[Vo]:ls})),setLeftToRight:()=>({commands:e})=>this.options.supportedExtensionNames.every(t=>e.resetAttributes(t,Vo))}},addKeyboardShortcuts(){return{"Mod-Shift-r":()=>this.editor.commands.setRightToLeft(),"Mod-Shift-l":()=>this.editor.commands.setLeftToRight()}}}),oa={parseNodeAttrsDirection(e){return OC(e[Vo])},fromPrismic(e){return{[Vo]:OC(e.direction)}},toPrismic(e){return{direction:this.parseNodeAttrsDirection(e.attrs)}}};function OC(e){return e===ls?ls:lm}const fg=Xje.extend({name:"paragraph",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",St(this.options.HTMLAttributes,e),0]}}),nUe={fromPrismic(e){return function(t){var r;const n=Us.converter.fromPrismic(e)(fg.name,t);return(r=e.nodes[fg.name])==null?void 0:r.create(oa.fromPrismic(t),n)}},toPrismic(e){return Us.converter.toPrismic(e,le.RichTextNodeType.paragraph,oa.toPrismic(e))}},rUe=new Eh([le.RichTextNodeType.paragraph],fg.name,fg,nUe,"Type '/' for commands"),aa=rUe,KQ=["ArrowDown","ArrowUp","End","Home"],PQ=["Enter"],iUe=["Escape",...KQ,...PQ],oUe=cr.create({name:"slash-commands",addOptions(){return{nodeTypes:[]}},addProseMirrorPlugins(){const e=fm(rV,this.options.nodeTypes);return e.length>1?[Zje({allowSpaces:!0,char:"/",editor:this.editor,startOfLine:!0,allow:({state:t})=>{const n=t.selection.$from;return n.parent.type.name===aa.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 mQ(aUe,{editor:n.editor,props:n}),document.body.appendChild(t.element)},onUpdate:n=>{t==null||t.updateProps(n)},onKeyDown:({event:n})=>{var r;return!!(iUe.includes(n.key)&&((r=t==null?void 0:t.ref)!=null&&r.handleKeyDown(n)))},onExit:()=>{t==null||t.destroy(),t==null||t.element.remove()}}}})]:[]}}),aUe=R.forwardRef(function(t,n){const{command:r,decorationNode:i,editor:o,items:a}=t,[u,s]=R.useState(!0),{context:c,floating:l,reference:f,x:p,y:A}=Pje({middleware:[xje(0),Tje(),wje({limiter:$je()})],onOpenChange:s,open:u,placement:"top-start",strategy:"fixed",whileElementsMounted:Fje});R.useLayoutEffect(()=>{f(i)},[f,i]),R.useEffect(()=>{let x;const w=()=>{x=window.setTimeout(()=>{s(!0)})},M=()=>{s(!1)};return o.on("focus",w).on("blur",M),()=>{o.off("focus",w).off("blur",M),clearTimeout(x)}},[o]);const[h,v]=R.useState(0),_=R.useRef([]);Xe.useOnChange(a,()=>{v(0),_.current=[]});const{getFloatingProps:S,getItemProps:I,getReferenceProps:T}=Dje([Vje(c,{outsidePointerDown:!1}),Yje(c,{activeIndex:h,listRef:_,onNavigate:x=>{v(w=>x??w)},openOnArrowKeyDown:!1,virtual:!0}),Qje(c,{role:"menu"})]),C=T().onKeyDown;R.useImperativeHandle(n,()=>({handleKeyDown:x=>{if(u){if(KQ.includes(x.key)&&C(x),PQ.includes(x.key)){const w=a[h];w!==void 0&&r(w)}return!0}else return!1}}),[h,r,a,C,u]);const y=p!==null&&A!==null;return u?d.jsx(m.Box,{...S(),minWidth:256,backgroundColor:"grey1",border:!0,borderStyle:"solid",borderRadius:6,flexDirection:"column",ref:l,top:0,left:0,position:"fixed",transform:y?`translate3d(${Math.round(p)}px, ${Math.round(A)}px, 0)`:"translate3d(0, -200%, 0)",overflow:"hidden",children:d.jsxs("div",{style:{boxShadow:"0px 2px 10px 0px hsla(0, 0%, 0%, 0.1)"},children:[a.map((x,w)=>{const M=I({onClick:()=>{r(x)},onPointerDown:O=>{O.preventDefault()}});return R.createElement(hk,{...M,key:x.nodeType,ref:O=>{_.current[w]=O},active:w===h,isFirstItem:w===0,isLastItem:w===a.length-1,shortcut:`/${x.shortText??""}`},x.text)}),a.length===0&&d.jsx(hk,{...I({onPointerDown:x=>{x.preventDefault()}}),disabled:!0,ref:x=>{_.current[0]=x},children:"No results"})]})}):null}),hk=R.forwardRef(function(t,n){const{children:r,disabled:i=!1,shortcut:o,active:a=!1,isFirstItem:u=!1,isLastItem:s=!1,...c}=t;return d.jsx("div",{...c,role:"button",style:{cursor:i?"default":"pointer"},ref:n,children:d.jsxs(m.Box,{alignItems:"center",height:32,flexDirection:"row",gap:8,padding:8,backgroundColor:a?"grey4":"inherit",justifyContent:"space-between",opacity:i?.5:1,children:[d.jsx(m.Text,{color:"grey12",component:"span",children:r}),o&&d.jsx(m.Text,{color:"inherit",component:"span",variant:"small",children:o})]})})});function uUe(e,t){var u,s;const n=t.map(c=>c.richTextNodeTypes).flat(),i={placeholderByNodeType:sUe(t),unfocusedPlaceholder:(u=e.config)==null?void 0:u.placeholder,nodeExtensions:t},o=n.includes(le.RichTextNodeType.orderedList)||n.includes(le.RichTextNodeType.list);return[xC.component(((s=e.config)==null?void 0:s.single)===void 0),Us.component,ug.component,hje(i),o?Wl.component:void 0,oUe.configure({nodeTypes:n})].filter(to.isDefined)}function sUe(e){return e.reduce((t,n)=>(n.nodeType===Al.Text&&(t[n.name]=n.placeholder),t),{})}const FC=NLe.extend({name:"bulletList",parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:e}){return["ul",St(this.options.HTMLAttributes,e),0]}}).configure({itemTypeName:"listItem"}),cUe={fromPrismic(e){return function(t){var r;const n=Wl.converter.fromPrismic(e)(t);if(n)return(r=e.nodes[FC.name])==null?void 0:r.create(oa.fromPrismic(t),n)}},toPrismic(e){return js.children.map(e,t=>Wl.converter.toPrismic(t,le.RichTextNodeType.list).filter(to.isDefined)).flat()}},lUe=new cO([le.RichTextNodeType.list],FC.name,FC,cUe),dg=lUe,fUe=/^```([a-z]+)?[\s\n]$/,dUe=/^~~~([a-z]+)?[\s\n]$/,pUe=kn.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",St(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(`
63
+ `,"2) content: () => element.cloneNode(true)"].join(" "))}var u=i.reduce(function(s,c){var l=c&&hLe(c,r);return l&&s.push(l),s},[]);return Cp(e)?u[0]:u}$h.defaultProps=xr;$h.setDefaultProps=fLe;$h.currentInput=eo;Object.assign({},z8,{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)}});$h.setDefaultProps({render:fQ});class mLe{constructor({editor:t,element:n,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:a}){this.preventHide=!1,this.shouldShow=({view:u,state:s,from:c,to:l})=>{const{doc:f,selection:p}=s,{empty:A}=p,h=!f.textBetween(c,l).length&&JR(s.selection),v=this.element.contains(document.activeElement);return!(!(u.hasFocus()||v)||A||h||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:u})=>{var s;if(this.preventHide){this.preventHide=!1;return}u!=null&&u.relatedTarget&&(!((s=this.element.parentNode)===null||s===void 0)&&s.contains(u.relatedTarget))||this.hide()},this.tippyBlurHandler=u=>{this.blurHandler({event:u})},this.handleDebouncedUpdate=(u,s)=>{const c=!(s!=null&&s.selection.eq(u.state.selection)),l=!(s!=null&&s.doc.eq(u.state.doc));!c&&!l||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(u,c,l,s)},this.updateDelay))},this.updateHandler=(u,s,c,l)=>{var f,p,A;const{state:h,composing:v}=u,{selection:_}=h;if(v||!s&&!c)return;this.createTooltip();const{ranges:I}=_,T=Math.min(...I.map(y=>y.$from.pos)),g=Math.max(...I.map(y=>y.$to.pos));if(!((f=this.shouldShow)===null||f===void 0?void 0:f.call(this,{editor:this.editor,view:u,state:h,oldState:l,from:T,to:g}))){this.hide();return}(p=this.tippy)===null||p===void 0||p.setProps({getReferenceClientRect:((A=this.tippyOptions)===null||A===void 0?void 0:A.getReferenceClientRect)||(()=>{if(rMe(h.selection)){let y=u.nodeDOM(T);const x=y.dataset.nodeViewWrapper?y:y.querySelector("[data-node-view-wrapper]");if(x&&(y=x.firstChild),y)return y.getBoundingClientRect()}return iMe(u,T,g)})}),this.show()},this.editor=t,this.element=n,this.view=r,this.updateDelay=o,a&&(this.shouldShow=a),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:t}=this.editor.options,n=!!t.parentElement;this.tippy||!n||(this.tippy=$h(t,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(t,n){const{state:r}=t,i=r.selection.$from.pos!==r.selection.$to.pos;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(t,n);return}const o=!(n!=null&&n.selection.eq(t.state.selection)),a=!(n!=null&&n.doc.eq(t.state.doc));this.updateHandler(t,o,a,n)}show(){var t;(t=this.tippy)===null||t===void 0||t.show()}hide(){var t;(t=this.tippy)===null||t===void 0||t.hide()}destroy(){var t,n;!((t=this.tippy)===null||t===void 0)&&t.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const dQ=e=>new Nr({key:typeof e.pluginKey=="string"?new Gi(e.pluginKey):e.pluginKey,view:t=>new mLe({view:t,...e})});cr.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[dQ({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});const gLe=(...e)=>t=>{e.forEach(n=>{typeof n=="function"?n(t):n&&(n.current=t)})},vLe=({renderers:e})=>R.createElement(R.Fragment,null,Object.entries(e).map(([t,n])=>DC.createPortal(n.reactElement,n.element,t)));class yLe extends R.Component{constructor(t){super(t),this.editorContentRef=R.createRef(),this.initialized=!1,this.state={renderers:{}}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const{editor:t}=this.props;if(t&&t.options.element){if(t.contentComponent)return;const n=this.editorContentRef.current;n.append(...t.options.element.childNodes),t.setOptions({element:n}),t.contentComponent=this,t.createNodeViews(),this.initialized=!0}}maybeFlushSync(t){this.initialized?DC.flushSync(t):t()}setRenderer(t,n){this.maybeFlushSync(()=>{this.setState(({renderers:r})=>({renderers:{...r,[t]:n}}))})}removeRenderer(t){this.maybeFlushSync(()=>{this.setState(({renderers:n})=>{const r={...n};return delete r[t],{renderers:r}})})}componentWillUnmount(){const{editor:t}=this.props;if(!t||(this.initialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),t.contentComponent=null,!t.options.element.firstChild))return;const n=document.createElement("div");n.append(...t.options.element.childNodes),t.setOptions({element:n})}render(){const{editor:t,innerRef:n,...r}=this.props;return R.createElement(R.Fragment,null,R.createElement("div",{ref:gLe(n,this.editorContentRef),...r}),R.createElement(vLe,{renderers:this.state.renderers}))}}const bLe=R.forwardRef((e,t)=>{const n=R.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return R.createElement(yLe,{key:n,innerRef:t,...e})}),CLe=R.memo(bLe),pQ=R.createContext({editor:null});pQ.Consumer;const SLe=()=>R.useContext(pQ),p1=e=>{const[t,n]=R.useState(null),{editor:r}=SLe();return R.useEffect(()=>{var i;if(!t||!((i=e.editor)===null||i===void 0)&&i.isDestroyed||r!=null&&r.isDestroyed)return;const{pluginKey:o="bubbleMenu",editor:a,tippyOptions:u={},updateDelay:s,shouldShow:c=null}=e,l=a||r;if(!l){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const f=dQ({updateDelay:s,editor:l,element:t,pluginKey:o,shouldShow:c,tippyOptions:u});return l.registerPlugin(f),()=>l.unregisterPlugin(o)},[e.editor,r,t]),R.createElement("div",{ref:n,className:e.className,style:{visibility:"hidden"}},e.children)},AQ=R.createContext({onDragStart:void 0}),_Le=()=>R.useContext(AQ),hQ=R.forwardRef((e,t)=>{const{onDragStart:n}=_Le(),r=e.as||"div";return R.createElement(r,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})});function ILe(e){return!!(typeof e=="function"&&e.prototype&&e.prototype.isReactComponent)}function TLe(e){var t;return typeof e=="object"&&((t=e.$$typeof)===null||t===void 0?void 0:t.toString())==="Symbol(react.forward_ref)"}class mQ{constructor(t,{editor:n,props:r={},as:i="div",className:o="",attrs:a}){this.ref=null,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=t,this.editor=n,this.props=r,this.element=document.createElement(i),this.element.classList.add("react-renderer"),o&&this.element.classList.add(...o.split(" ")),a&&Object.keys(a).forEach(u=>{this.element.setAttribute(u,a[u])}),this.render()}render(){var t,n;const r=this.component,i=this.props;(ILe(r)||TLe(r))&&(i.ref=o=>{this.ref=o}),this.reactElement=R.createElement(r,{...i}),(n=(t=this.editor)===null||t===void 0?void 0:t.contentComponent)===null||n===void 0||n.setRenderer(this.id,this)}updateProps(t={}){this.props={...this.props,...t},this.render()}destroy(){var t,n;(n=(t=this.editor)===null||t===void 0?void 0:t.contentComponent)===null||n===void 0||n.removeRenderer(this.id)}}class xLe extends xMe{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 R.createElement(R.Fragment,null,R.createElement(AQ.Provider,{value:{onDragStart:u,nodeViewContentRef:s}},R.createElement(a,{...o})))};n.displayName="ReactNodeView",this.node.isLeaf?this.contentDOMElement=null:this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=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.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.renderer=new mQ(n,{editor:this.editor,props:t,as:r,className:`node-${this.node.type.name} ${i}`.trim(),attrs:this.options.attrs})}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}handleSelectionUpdate(){const{from:t,to:n}=this.editor.state.selection;if(t<=this.getPos()&&n>=this.getPos()+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}}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}),this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove("ProseMirror-selectednode")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate),this.contentDOMElement=null}}function gQ(e,t){return n=>n.editor.contentComponent?new xLe(e,n,t):{}}const wLe=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,$Le=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,ELe=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,RLe=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,OLe=Kc.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",St(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[Xm({find:wLe,type:this.type}),Xm({find:ELe,type:this.type})]},addPasteRules(){return[tg({find:$Le,type:this.type}),tg({find:RLe,type:this.type})]}});var Pc=(e=>(e.Document="document",e.Mark="mark",e.Node="node",e))(Pc||{}),Al=(e=>(e.Text="text",e.Embed="embed",e.Image="image",e))(Al||{});class FLe{constructor(t,n,r){$n(this,"extType","document");this.name=t,this.component=n,this.converter=r}}class Eh{constructor(t,n,r,i,o,a=!1){$n(this,"extType","node");$n(this,"nodeType","text");this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i,this.placeholder=o,this.lockedFormat=a}}function vQ(e){return e instanceof Eh}class MLe{constructor(t,n,r,i){$n(this,"extType","node");$n(this,"nodeType","embed");this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i}}class kLe{constructor(t,n,r,i){$n(this,"extType","node");$n(this,"nodeType","image");this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i}}class LLe extends Eh{constructor(t,n,r,i,o){super(t,"heading",n,i,o),this.levels=r}}class cO extends Eh{constructor(t,n,r,i){super(t,n,r,i)}}function jLe(e){return e instanceof cO}const yQ=kn.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:e}){return["br",St(this.options.HTMLAttributes,e)]},renderText(){return`
64
+ `},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(p=>u.includes(p.type.name));c.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),js={isHardBreak(e){return e.type.name===yQ.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 ULe(e){if(!e||!(e!=null&&e.single)&&!(e!=null&&e.multi))return HM();const t=BLe(e);if(!t.size)return HM();const n=WLe(t),r=KLe(n,e);return{nodeTypes:t,extensions:r}}function BLe(e){const n=(e.single||e.multi||"").split(/\s*,\s*/).map(r=>{const i=le.RichTextNodeTypeCodec.decode(r);return i._tag==="Right"?i.right:void 0}).filter(to.isDefined);return new Set(n)}function WLe(e){return nV(e).filter(n=>Rn.some(e,r=>n.richTextNodeTypes.includes(r)))}function KLe(e,t){var r;const n=new Set(e);return Rn.some(n,jLe)&&n.add(aa),Rn.some(n,vQ)||n.add(aa),(r=t==null?void 0:t.labels)!=null&&r.length&&n.add(gO),[...n]}function HM(){return{extensions:nV(),nodeTypes:new Set(Pl.keys(le.RichTextNodeTypeCodec.keys))}}class PLe{constructor(t,n,r){$n(this,"extType",Pc.Mark);$n(this,"richTextNodeTypes",[le.RichTextNodeType.strong]);this.name=t,this.component=n,this.converter=r}}const bQ="bold",CQ=OLe.extend({name:bQ}),DLe={fromPrismic(e){return function(){var t;return(t=e.marks[CQ.name])==null?void 0:t.create()}},toPrismic(){}},NLe=new PLe(bQ,CQ,DLe),lO=NLe,qLe=kn.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",St(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)}}}),YM=Kc.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:e=>e.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["span",St(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:e,commands:t})=>{const n=XR(e,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:t.unsetMark(this.name)}}}}),GM=/^\s*([-+*])\s$/,QLe=kn.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:e}){return["ul",St(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(qLe.name,this.editor.getAttributes(YM.name)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=eg({find:GM,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=eg({find:GM,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(YM.name),editor:this.editor})),[e]}}),VLe=kn.create({name:"doc",topNode:!0,content:"block+"}),zLe=kn.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",St(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)}}}),SQ=zLe.extend({name:"listItem",content:"paragraph*",addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name)}}}),HLe={fromPrismic(e){return function(t){var r;const n=aa.converter.fromPrismic(e)(t);if(n)return(r=e.nodes[SQ.name])==null?void 0:r.create({},n)}},toPrismic(e,t){return js.children.reduce(e,(n,r)=>{const i=aa.converter.toPrismic(r),o=(()=>i instanceof Array?i.map(a=>({...a,type:t})):i?[{...i,type:t}]:[])();return[...n,...o]},[])}},Wl={component:SQ,converter:HLe,placeholder:"List"};function YLe(e,t){return e.copy(e.content.append(t.content))}const al={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"},G0=()=>(++G0.i).toString();G0.i=0;const GLe=e=>{const t=JLe(e),n=[];for(let r=0;r<t.length;r++)n.push(_Q(t[r]));return{key:G0(),children:n}},Ld=(e,t=[])=>({key:G0(),type:e.type,text:"text"in e?e.text:void 0,node:e,children:t}),A1=e=>Ld({type:al.span,text:e,spans:[]}),JLe=e=>{const t=e.slice(0);for(let n=0;n<t.length;n++){const r=t[n];if(r.type===al.listItem||r.type===al.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===al.listItem?t[n]={type:al.list,items:i}:t[n]={type:al.oList,items:i}}}return t},_Q=e=>{if("text"in e)return Ld(e,IQ(e.spans,e));if("items"in e){const t=[];for(let n=0;n<e.items.length;n++)t.push(_Q(e.items[n]));return Ld(e,t)}return Ld(e)},IQ=(e,t,n)=>{if(!e.length)return[A1(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 A=o;A<r.length;A++){const h=r[A];h!==a&&h.start>=a.start&&h.end<=a.end&&(f.push(h),r.splice(A,1),A--)}o===0&&s>0&&i.push(A1(t.text.slice(0,s)));const p={...a,text:l};i.push(Ld(p,IQ(f,{...t,text:l},a))),c<t.text.length&&i.push(A1(t.text.slice(c,r[o+1]?r[o+1].start-u:void 0)))}return i},ZLe=(e,t)=>TQ(GLe(e).children,t),TQ=(e,t)=>{const n=[];for(let r=0;r<e.length;r++){const i=e[r],o=t(i.type,i.node,i.text,TQ(i.children,t),i.key);o!=null&&n.push(o)}return n},XLe=kn.create({name:"text",group:"inline"});function eje(e){return e.reduce((t,n)=>{const r=(t[n.type]||[]).concat(n);return{...t,[n.type]:r}},{})}function JM(e){return e.sort((t,n)=>t.start-n.start)}function tje(e){const t=eje(e),n=Object.entries(t).map(([r,i])=>JM(i).reduce((a,u)=>{if(!a.length)return[u];const s=a.length-1,c=a[s];return c?c.end<u.start?[...a,u]:c.end>=u.end?a:[...a.slice(0,s),{...c,end:u.end}]:a},[])).flat();return JM(n)}const og=yQ.extend({name:"hard_break"}),ag=`
65
+ `,xQ={fromPrismic(e){return function(t){var n;if(t===ag)return(n=e.nodes[og.name])==null?void 0:n.create({})}},toPrismic(e){if(e.type.name===og.name)return ag}},h1={isEmptyLine(e){return e.length===0},isFirst(e){return e===0}};function nje(e,t){return function(n){const r=xQ.fromPrismic(e)(ag);if(!r)return[n(t)];const i=t.split(ag);return i.length===1?t.length?[n(t)]:[r]:i.reduce((o,a,u)=>h1.isFirst(u)?h1.isEmptyLine(a)?o:[...o,n(a)]:h1.isEmptyLine(a)?[...o,r]:[...o,r,n(a)],[])}}const rje={name:og.name,component:og,converter:xQ,splitTextToNodes:nje},ug=rje,wQ={fromPrismic(e){return t=>{switch(t.type){case"hyperlink":return XQ.converter.fromPrismic(e)(t);case"em":return mO.converter.fromPrismic(e)(t);case"strong":return lO.converter.fromPrismic(e)(t);case"label":return gO.converter.fromPrismic(e)(t);case"list-item":return}}},toPrismic(e,t,n){const r=tV.find(i=>e.type.name===i.name);if(!r)throw new Error(`Invalid mark extension '${e.type.name}'.`);switch(r.name){case"bold":return{type:"strong",start:t,end:n};case"em":return{type:r.name,start:t,end:n};case"hyperlink":return{type:r.name,start:t,end:n,data:r.converter.toPrismic(e)};case"label":return{type:r.name,start:t,end:n,data:r.converter.toPrismic(e)}}}},ije={strong:"bold",label:"label",em:"em",hyperlink:"hyperlink","list-item":void 0},ZM=XLe.extend({name:"text"}),oje={fromPrismic(e){return function(t,n,r=!1){const i={type:t,text:n.content.text,spans:n.content.spans||[]};return ZLe([i],aje(e,r)).flat()}},toPrismic(e,t,n){const r=js.children.reduce(e,(i,o)=>{const a=(()=>o.type.name===ug.name?ug.converter.toPrismic(o):o.textContent)(),u=a?i.text+a:i.text,s=i.text.length,c=u.length,l=(()=>o.marks.length?js.marks.map(o,p=>wQ.toPrismic(p,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:[...tje(r.spans)].sort((i,o)=>i.type.localeCompare(o.type))},...n}}};function aje(e,t=!1){return(n,r,i,o)=>{if(n==="span"&&i&&i.length)return t?[e.text(i)]:ug.splitTextToNodes(e,i)(s=>e.text(s));const a=wQ.fromPrismic(e)(r);return a?uje(a,o):o.flat()}}function uje(e,t){return t.flat().map(r=>{const o=[...r.marks,e].sort((a,u)=>a.type.name.localeCompare(u.type.name));return r.mark(o)})}const sje={name:ZM.name,component:ZM,converter:oje},Us=sje,fO="document";function cje(e){return VLe.extend({name:fO,content:e?"block+":"block"})}function lje(e){return{fromPrismic(t,n,r){var o;const i=r.value.reduce((a,u)=>{const{extension:s,block:c}=Aje(e,u,t,n),l=dje({extension:s,block:c,schema:t}),f=a.slice(0,a.length-1),p=gn.last(a),A=pje({node:l,previousNode:p});return A.updatedNode?[...A.merged?f:a,A.updatedNode]:a},[]);return(o=t.nodes[fO])==null?void 0:o.create({},i)},toPrismic(t){return{__TYPE__:"StructuredTextContent",value:[...js.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},[])]}}}}const fje=new FLe(fO,cje,lje),xC=fje;function dje(e){const{extension:t,block:n,schema:r}=e;if(t)switch(t.nodeType){case Al.Embed:return Ue.EmbedBlock.is(n)?t.converter.fromPrismic(r)(n):void 0;case Al.Text:return Ue.TextBlock.is(n)?t.converter.fromPrismic(r)(n):void 0;case Al.Image:return Ue.ImageBlock.is(n)?t.converter.fromPrismic(r)(n):void 0}}function pje(e){const{node:t,previousNode:n}=e;return!t||!n?{merged:!1,updatedNode:t}:t.type.name===n.type.name&&(t.type.name===dg.name||t.type.name===Ag.name)?{merged:!0,updatedNode:YLe(n,t)}:{merged:!1,updatedNode:t}}function Aje(e,t,n,r){var u;const i=e.find(s=>s.richTextNodeTypes.includes(t.type)&&r.has(t.type));if(i)return{extension:i,block:t};if(!Ue.TextBlock.is(t))return{extension:void 0,block:t};const o=e.find(s=>vQ(s)&&s.name in n.nodes),a=(u=t.content.spans)==null?void 0:u.filter(s=>{const c=ije[s.type];return c&&c in n.marks});return{extension:o,block:{...t,content:{text:t.content.text,spans:a}}}}const hje=cr.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,considerAnyAsEmpty:!1,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new Nr({key:new Gi("placeholder"),props:{decorations:({doc:e,selection:t})=>{var n;const r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=t,o=[];if(!r)return null;const{firstChild:a}=e.content,u=a&&a.type.isLeaf,s=a&&a.isAtom,c=this.options.considerAnyAsEmpty?!0:a&&a.type.name===((n=e.type.contentMatch.defaultType)===null||n===void 0?void 0:n.name),l=e.content.childCount<=1&&a&&c&&a.nodeSize<=2&&(!u||!s);return e.descendants((f,p)=>{const A=i>=p&&i<=p+f.nodeSize,h=!f.isLeaf&&!f.childCount;if((A||!this.options.showOnlyCurrent)&&h){const v=[this.options.emptyNodeClass];l&&v.push(this.options.emptyEditorClass);const _=Si.node(p,p+f.nodeSize,{class:v.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:f,pos:p,hasAnchor:A}):this.options.placeholder});o.push(_)}return this.options.includeChildren}),Vt.create(e,o)}}})]}}),mje="Type '/' for commands",gje=e=>hje.configure({includeChildren:!0,placeholder:t=>vje({props:t,params:e}),showOnlyCurrent:!1,showOnlyWhenEditable:!1});function vje({props:e,params:t}){const{editor:n,hasAnchor:r,node:i}=e,{placeholderByNodeType:o,unfocusedPlaceholder:a,nodeExtensions:u}=t,s=!js.children.exists(n.state.doc,I=>I===i),c=n.isEditable,l=n.isFocused&&r,f=i.type.name!==aa.name,p=l||f||s,A=u.filter(I=>I!==aa).length>1;function h(I){return I===mje?c&&p&&A:c&&p}function v(){if(s)return Wl.placeholder;const I=o[i.type.name];return typeof I=="string"?I:I==null?void 0:I(i.attrs)}const _=v(),S=h(_);return a&&!l&&n.isEmpty?a:S&&_||""}function J0(e){return e.split("-")[1]}function $Q(e){return e==="y"?"height":"width"}function ou(e){return e.split("-")[0]}function Rh(e){return["top","bottom"].includes(ou(e))?"x":"y"}function XM(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=Rh(t),s=$Q(u),c=r[s]/2-i[s]/2,l=u==="x";let f;switch(ou(t)){case"top":f={x:o,y:r.y-i.height};break;case"bottom":f={x:o,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:a};break;case"left":f={x:r.x-i.width,y:a};break;default:f={x:r.x,y:r.y}}switch(J0(t)){case"start":f[u]-=c*(n&&l?-1:1);break;case"end":f[u]+=c*(n&&l?-1:1)}return f}const yje=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,u=o.filter(Boolean),s=await(a.isRTL==null?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:l,y:f}=XM(c,r,s),p=r,A={},h=0;for(let v=0;v<u.length;v++){const{name:_,fn:S}=u[v],{x:I,y:T,data:g,reset:C}=await S({x:l,y:f,initialPlacement:r,placement:p,strategy:i,middlewareData:A,rects:c,platform:a,elements:{reference:e,floating:t}});l=I??l,f=T??f,A={...A,[_]:{...A[_],...g}},C&&h<=50&&(h++,typeof C=="object"&&(C.placement&&(p=C.placement),C.rects&&(c=C.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):C.rects),{x:l,y:f}=XM(c,p,s)),v=-1)}return{x:l,y:f,placement:p,strategy:i,middlewareData:A}};function bje(e){return typeof e!="number"?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(e):{top:e,right:e,bottom:e,left:e}}function wC(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function EQ(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:p=!1,padding:A=0}=t,h=bje(A),v=u[p?f==="floating"?"reference":"floating":f],_=wC(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(v)))==null||n?v:v.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(u.floating)),boundary:c,rootBoundary:l,strategy:s})),S=f==="floating"?{...a.floating,x:r,y:i}:a.reference,I=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u.floating)),T=await(o.isElement==null?void 0:o.isElement(I))&&await(o.getScale==null?void 0:o.getScale(I))||{x:1,y:1},g=wC(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:S,offsetParent:I,strategy:s}):S);return{top:(_.top-g.top+h.top)/T.y,bottom:(g.bottom-_.bottom+h.bottom)/T.y,left:(_.left-g.left+h.left)/T.x,right:(g.right-_.right+h.right)/T.x}}const Cje=Math.min,Sje=Math.max;function ek(e,t,n){return Sje(e,Cje(t,n))}const _je=["top","right","bottom","left"];_je.reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);const Ije={left:"right",right:"left",bottom:"top",top:"bottom"};function sg(e){return e.replace(/left|right|bottom|top/g,t=>Ije[t])}function Tje(e,t,n){n===void 0&&(n=!1);const r=J0(e),i=Rh(e),o=$Q(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=sg(a)),{main:a,cross:sg(a)}}const xje={start:"end",end:"start"};function m1(e){return e.replace(/start|end/g,t=>xje[t])}const wje=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:p="bestFit",fallbackAxisSideDirection:A="none",flipAlignment:h=!0,...v}=e,_=ou(r),S=ou(a)===a,I=await(u.isRTL==null?void 0:u.isRTL(s.floating)),T=f||(S||!h?[sg(a)]:function(F){const K=sg(F);return[m1(F),K,m1(K)]}(a));f||A==="none"||T.push(...function(F,K,N,J){const Z=J0(F);let ae=function(ge,se,k){const E=["left","right"],D=["right","left"],ue=["top","bottom"],ke=["bottom","top"];switch(ge){case"top":case"bottom":return k?se?D:E:se?E:D;case"left":case"right":return se?ue:ke;default:return[]}}(ou(F),N==="start",J);return Z&&(ae=ae.map(ge=>ge+"-"+Z),K&&(ae=ae.concat(ae.map(m1)))),ae}(a,h,A,I));const g=[a,...T],C=await EQ(t,v),y=[];let x=((n=i.flip)==null?void 0:n.overflows)||[];if(c&&y.push(C[_]),l){const{main:F,cross:K}=Tje(r,o,I);y.push(C[F],C[K])}if(x=[...x,{placement:r,overflows:y}],!y.every(F=>F<=0)){var w,M;const F=(((w=i.flip)==null?void 0:w.index)||0)+1,K=g[F];if(K)return{data:{index:F,overflows:x},reset:{placement:K}};let N=(M=x.filter(J=>J.overflows[0]<=0).sort((J,Z)=>J.overflows[1]-Z.overflows[1])[0])==null?void 0:M.placement;if(!N)switch(p){case"bestFit":{var O;const J=(O=x.map(Z=>[Z.placement,Z.overflows.filter(ae=>ae>0).reduce((ae,ge)=>ae+ge,0)]).sort((Z,ae)=>Z[1]-ae[1])[0])==null?void 0:O[0];J&&(N=J);break}case"initialPlacement":N=a}if(r!==N)return{reset:{placement:N}}}return{}}}},$je=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,i=await async function(o,a){const{placement:u,platform:s,elements:c}=o,l=await(s.isRTL==null?void 0:s.isRTL(c.floating)),f=ou(u),p=J0(u),A=Rh(u)==="x",h=["left","top"].includes(f)?-1:1,v=l&&A?-1:1,_=typeof a=="function"?a(o):a;let{mainAxis:S,crossAxis:I,alignmentAxis:T}=typeof _=="number"?{mainAxis:_,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,..._};return p&&typeof T=="number"&&(I=p==="end"?-1*T:T),A?{x:I*v,y:S*h}:{x:S*h,y:I*v}}(t,e);return{x:n+i.x,y:r+i.y,data:i}}}};function RQ(e){return e==="x"?"y":"x"}const Eje=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:_=>{let{x:S,y:I}=_;return{x:S,y:I}}},...s}=e,c={x:n,y:r},l=await EQ(t,s),f=Rh(ou(i)),p=RQ(f);let A=c[f],h=c[p];if(o){const _=f==="y"?"bottom":"right";A=ek(A+l[f==="y"?"top":"left"],A,A-l[_])}if(a){const _=p==="y"?"bottom":"right";h=ek(h+l[p==="y"?"top":"left"],h,h-l[_])}const v=u.fn({...t,[f]:A,[p]:h});return{...v,data:{x:v.x-n,y:v.y-r}}}}},Rje=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=Rh(i),p=RQ(f);let A=l[f],h=l[p];const v=typeof u=="function"?u(t):u,_=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(s){const T=f==="y"?"height":"width",g=o.reference[f]-o.floating[T]+_.mainAxis,C=o.reference[f]+o.reference[T]-_.mainAxis;A<g?A=g:A>C&&(A=C)}if(c){var S,I;const T=f==="y"?"width":"height",g=["top","left"].includes(ou(i)),C=o.reference[p]-o.floating[T]+(g&&((S=a.offset)==null?void 0:S[p])||0)+(g?0:_.crossAxis),y=o.reference[p]+o.reference[T]+(g?0:((I=a.offset)==null?void 0:I[p])||0)-(g?_.crossAxis:0);h<C?h=C:h>y&&(h=y)}return{[f]:A,[p]:h}}}};function wr(e){var t;return((t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ro(e){return wr(e).getComputedStyle(e)}const tk=Math.min,jd=Math.max,cg=Math.round;function OQ(e){const t=ro(e);let n=parseFloat(t.width),r=parseFloat(t.height);const i=e.offsetWidth,o=e.offsetHeight,a=cg(n)!==i||cg(r)!==o;return a&&(n=i,r=o),{width:n,height:r,fallback:a}}function Au(e){return MQ(e)?(e.nodeName||"").toLowerCase():""}let Gh;function FQ(){if(Gh)return Gh;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(Gh=e.brands.map(t=>t.brand+"/"+t.version).join(" "),Gh):navigator.userAgent}function io(e){return e instanceof wr(e).HTMLElement}function xi(e){return e instanceof wr(e).Element}function MQ(e){return e instanceof wr(e).Node}function nk(e){return typeof ShadowRoot>"u"?!1:e instanceof wr(e).ShadowRoot||e instanceof ShadowRoot}function Z0(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=ro(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function Oje(e){return["table","td","th"].includes(Au(e))}function $C(e){const t=/firefox/i.test(FQ()),n=ro(e),r=n.backdropFilter||n.WebkitBackdropFilter;return n.transform!=="none"||n.perspective!=="none"||!!r&&r!=="none"||t&&n.willChange==="filter"||t&&!!n.filter&&n.filter!=="none"||["transform","perspective"].some(i=>n.willChange.includes(i))||["paint","layout","strict","content"].some(i=>{const o=n.contain;return o!=null&&o.includes(i)})}function EC(){return/^((?!chrome|android).)*safari/i.test(FQ())}function dO(e){return["html","body","#document"].includes(Au(e))}function kQ(e){return xi(e)?e:e.contextElement}const LQ={x:1,y:1};function hl(e){const t=kQ(e);if(!io(t))return LQ;const n=t.getBoundingClientRect(),{width:r,height:i,fallback:o}=OQ(t);let a=(o?cg(n.width):n.width)/r,u=(o?cg(n.height):n.height)/i;return a&&Number.isFinite(a)||(a=1),u&&Number.isFinite(u)||(u=1),{x:a,y:u}}function Bs(e,t,n,r){var i,o;t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),u=kQ(e);let s=LQ;t&&(r?xi(r)&&(s=hl(r)):s=hl(e));const c=u?wr(u):window,l=EC()&&n;let f=(a.left+(l&&((i=c.visualViewport)==null?void 0:i.offsetLeft)||0))/s.x,p=(a.top+(l&&((o=c.visualViewport)==null?void 0:o.offsetTop)||0))/s.y,A=a.width/s.x,h=a.height/s.y;if(u){const v=wr(u),_=r&&xi(r)?wr(r):r;let S=v.frameElement;for(;S&&r&&_!==v;){const I=hl(S),T=S.getBoundingClientRect(),g=getComputedStyle(S);T.x+=(S.clientLeft+parseFloat(g.paddingLeft))*I.x,T.y+=(S.clientTop+parseFloat(g.paddingTop))*I.y,f*=I.x,p*=I.y,A*=I.x,h*=I.y,f+=T.x,p+=T.y,S=wr(S).frameElement}}return{width:A,height:h,top:p,right:f+A,bottom:p+h,left:f,x:f,y:p}}function au(e){return((MQ(e)?e.ownerDocument:e.document)||window.document).documentElement}function X0(e){return xi(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function jQ(e){return Bs(au(e)).left+X0(e).scrollLeft}function _p(e){if(Au(e)==="html")return e;const t=e.assignedSlot||e.parentNode||nk(e)&&e.host||au(e);return nk(t)?t.host:t}function UQ(e){const t=_p(e);return dO(t)?t.ownerDocument.body:io(t)&&Z0(t)?t:UQ(t)}function vs(e,t){var n;t===void 0&&(t=[]);const r=UQ(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=wr(r);return i?t.concat(o,o.visualViewport||[],Z0(r)?r:[]):t.concat(r,vs(r))}function rk(e,t,n){let r;if(t==="viewport")r=function(a,u){const s=wr(a),c=au(a),l=s.visualViewport;let f=c.clientWidth,p=c.clientHeight,A=0,h=0;if(l){f=l.width,p=l.height;const v=EC();(!v||v&&u==="fixed")&&(A=l.offsetLeft,h=l.offsetTop)}return{width:f,height:p,x:A,y:h}}(e,n);else if(t==="document")r=function(a){const u=au(a),s=X0(a),c=a.ownerDocument.body,l=jd(u.scrollWidth,u.clientWidth,c.scrollWidth,c.clientWidth),f=jd(u.scrollHeight,u.clientHeight,c.scrollHeight,c.clientHeight);let p=-s.scrollLeft+jQ(a);const A=-s.scrollTop;return ro(c).direction==="rtl"&&(p+=jd(u.clientWidth,c.clientWidth)-l),{width:l,height:f,x:p,y:A}}(au(e));else if(xi(t))r=function(a,u){const s=Bs(a,!0,u==="fixed"),c=s.top+a.clientTop,l=s.left+a.clientLeft,f=io(a)?hl(a):{x:1,y:1};return{width:a.clientWidth*f.x,height:a.clientHeight*f.y,x:l*f.x,y:c*f.y}}(t,n);else{const a={...t};if(EC()){var i,o;const u=wr(e);a.x-=((i=u.visualViewport)==null?void 0:i.offsetLeft)||0,a.y-=((o=u.visualViewport)==null?void 0:o.offsetTop)||0}r=a}return wC(r)}function ik(e,t){return io(e)&&ro(e).position!=="fixed"?t?t(e):e.offsetParent:null}function ok(e,t){const n=wr(e);let r=ik(e,t);for(;r&&Oje(r)&&ro(r).position==="static";)r=ik(r,t);return r&&(Au(r)==="html"||Au(r)==="body"&&ro(r).position==="static"&&!$C(r))?n:r||function(i){let o=_p(i);for(;io(o)&&!dO(o);){if($C(o))return o;o=_p(o)}return null}(e)||n}function Fje(e,t,n){const r=io(t),i=au(t),o=Bs(e,!0,n==="fixed",t);let a={scrollLeft:0,scrollTop:0};const u={x:0,y:0};if(r||!r&&n!=="fixed")if((Au(t)!=="body"||Z0(i))&&(a=X0(t)),io(t)){const s=Bs(t,!0);u.x=s.x+t.clientLeft,u.y=s.y+t.clientTop}else i&&(u.x=jQ(i));return{x:o.left+a.scrollLeft-u.x,y:o.top+a.scrollTop-u.y,width:o.width,height:o.height}}const Mje={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=n==="clippingAncestors"?function(c,l){const f=l.get(c);if(f)return f;let p=vs(c).filter(_=>xi(_)&&Au(_)!=="body"),A=null;const h=ro(c).position==="fixed";let v=h?_p(c):c;for(;xi(v)&&!dO(v);){const _=ro(v),S=$C(v);_.position==="fixed"?A=null:(h?S||A:S||_.position!=="static"||!A||!["absolute","fixed"].includes(A.position))?A=_:p=p.filter(I=>I!==v),v=_p(v)}return l.set(c,p),p}(t,this._c):[].concat(n),a=[...o,r],u=a[0],s=a.reduce((c,l)=>{const f=rk(t,l,i);return c.top=jd(f.top,c.top),c.right=tk(f.right,c.right),c.bottom=tk(f.bottom,c.bottom),c.left=jd(f.left,c.left),c},rk(t,u,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=io(n),o=au(n);if(n===o)return t;let a={scrollLeft:0,scrollTop:0},u={x:1,y:1};const s={x:0,y:0};if((i||!i&&r!=="fixed")&&((Au(n)!=="body"||Z0(o))&&(a=X0(n)),io(n))){const c=Bs(n);u=hl(n),s.x=c.x+n.clientLeft,s.y=c.y+n.clientTop}return{width:t.width*u.x,height:t.height*u.y,x:t.x*u.x-a.scrollLeft*u.x+s.x,y:t.y*u.y-a.scrollTop*u.y+s.y}},isElement:xi,getDimensions:function(e){return io(e)?OQ(e):e.getBoundingClientRect()},getOffsetParent:ok,getDocumentElement:au,getScale:hl,async getElementRects(e){let{reference:t,floating:n,strategy:r}=e;const i=this.getOffsetParent||ok,o=this.getDimensions;return{reference:Fje(t,await i(n),r),floating:{x:0,y:0,...await o(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>ro(e).direction==="rtl"};function kje(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=!0,animationFrame:u=!1}=r,s=i&&!u,c=s||o?[...xi(e)?vs(e):e.contextElement?vs(e.contextElement):[],...vs(t)]:[];c.forEach(A=>{s&&A.addEventListener("scroll",n,{passive:!0}),o&&A.addEventListener("resize",n)});let l,f=null;if(a){let A=!0;f=new ResizeObserver(()=>{A||n(),A=!1}),xi(e)&&!u&&f.observe(e),xi(e)||!e.contextElement||u||f.observe(e.contextElement),f.observe(t)}let p=u?Bs(e):null;return u&&function A(){const h=Bs(e);!p||h.x===p.x&&h.y===p.y&&h.width===p.width&&h.height===p.height||n(),p=h,l=requestAnimationFrame(A)}(),n(),()=>{var A;c.forEach(h=>{s&&h.removeEventListener("scroll",n),o&&h.removeEventListener("resize",n)}),(A=f)==null||A.disconnect(),f=null,u&&cancelAnimationFrame(l)}}const Lje=(e,t,n)=>{const r=new Map,i={platform:Mje,...n},o={...i.platform,_c:r};return yje(e,t,{...i,platform:o})};var sm=typeof document<"u"?R.useLayoutEffect:R.useEffect;function lg(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(!lg(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)&&!lg(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function ak(e){const t=xe.useRef(e);return sm(()=>{t.current=e}),t}function jje(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,whileElementsMounted:o,open:a}=e,[u,s]=xe.useState({x:null,y:null,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[c,l]=xe.useState(r);lg(c,r)||l(r);const f=xe.useRef(null),p=xe.useRef(null),A=xe.useRef(u),h=ak(o),v=ak(i),[_,S]=xe.useState(null),[I,T]=xe.useState(null),g=xe.useCallback(O=>{f.current!==O&&(f.current=O,S(O))},[]),C=xe.useCallback(O=>{p.current!==O&&(p.current=O,T(O))},[]),y=xe.useCallback(()=>{if(!f.current||!p.current)return;const O={placement:t,strategy:n,middleware:c};v.current&&(O.platform=v.current),Lje(f.current,p.current,O).then(F=>{const K={...F,isPositioned:!0};x.current&&!lg(A.current,K)&&(A.current=K,gV.flushSync(()=>{s(K)}))})},[c,t,n,v]);sm(()=>{a===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,s(O=>({...O,isPositioned:!1})))},[a]);const x=xe.useRef(!1);sm(()=>(x.current=!0,()=>{x.current=!1}),[]),sm(()=>{if(_&&I){if(h.current)return h.current(_,I,y);y()}},[_,I,y,h]);const w=xe.useMemo(()=>({reference:f,floating:p,setReference:g,setFloating:C}),[g,C]),M=xe.useMemo(()=>({reference:_,floating:I}),[_,I]);return xe.useMemo(()=>({...u,update:y,refs:w,elements:M,reference:g,floating:C}),[u,y,w,M,g,C])}var tu=typeof document<"u"?R.useLayoutEffect:R.useEffect;function Uje(){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 g1=!1,Bje=0;const uk=()=>"floating-ui-"+Bje++;function Wje(){const[e,t]=xe.useState(()=>g1?uk():void 0);return tu(()=>{e==null&&t(uk())},[]),xe.useEffect(()=>{g1||(g1=!0)},[]),e}const sk=xe["useId".toString()],ck=sk??Wje,Kje=xe.createContext(null),Pje=xe.createContext(null),BQ=()=>{var e,t;return(e=(t=xe.useContext(Kje))==null?void 0:t.id)!=null?e:null},pO=()=>xe.useContext(Pje);function AO(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function WQ(e){var t;return(t=AO(e).defaultView)!=null?t:window}function cm(e){return e?e instanceof WQ(e).Element:!1}function Dje(e){return e?e instanceof WQ(e).HTMLElement:!1}const lk=xe["useInsertionEffect".toString()];function RC(e){const t=xe.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return lk?lk(()=>{t.current=e}):t.current=e,xe.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 Nje(e){let{open:t=!1,onOpenChange:n,whileElementsMounted:r,placement:i,middleware:o,strategy:a,nodeId:u}=e===void 0?{}:e;const[s,c]=xe.useState(null),l=pO(),f=xe.useRef(null),p=xe.useRef({}),A=xe.useState(()=>Uje())[0],h=jje({placement:i,middleware:o,strategy:a,whileElementsMounted:r}),v=RC(n),_=xe.useMemo(()=>({...h.refs,domReference:f}),[h.refs]),S=xe.useMemo(()=>({...h,refs:_,dataRef:p,nodeId:u,events:A,open:t,onOpenChange:v,_:{domReference:s}}),[h,u,A,t,v,_,s]);tu(()=>{const g=l==null?void 0:l.nodesRef.current.find(C=>C.id===u);g&&(g.context=S)});const{reference:I}=h,T=xe.useCallback(g=>{(cm(g)||g===null)&&(S.refs.domReference.current=g,c(g)),I(g)},[I,S.refs]);return xe.useMemo(()=>({...h,context:S,refs:_,reference:T}),[h,_,S,T])}function v1(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,p=new Array(f),A=0;A<f;A++)p[A]=arguments[A];(l=r.get(u))==null||l.forEach(h=>h(...p))}}}else i[u]=s}),i),{})}}const qje=function(e){return e===void 0&&(e=[]),{getReferenceProps:t=>v1(t,e,"reference"),getFloatingProps:t=>v1(t,e,"floating"),getItemProps:t=>v1(t,e,"item")}};function y1(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 fk(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 Qje(e){return"composedPath"in e?e.composedPath()[0]:e.target}function za(e){e.preventDefault(),e.stopPropagation()}function Vje(e){const t=R.useRef(e);return tu(()=>{t.current=e}),t}function dk(e){const t=R.useRef();return tu(()=>{t.current=e},[e]),t.current}const zje=function(e,t){let{open:n}=e,{enabled:r=!0,role:i="dialog"}=t===void 0?{}:t;const o=ck(),a=ck(),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 b1(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 Hje=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:p=!0}=t===void 0?{}:t;const A=pO(),h=BQ()!=null,v=xe.useRef(!1);return xe.useEffect(()=>{if(!n||!u)return;function _(C){if(C.key==="Escape"){if(!p&&A&&y1(A.nodesRef.current,a).length>0)return;o.emit("dismiss",{preventScroll:!1}),r(!1)}}function S(C){const y=v.current;if(v.current=!1,y)return;const x=Qje(C);if(cm(x)&&i.floating.current){var w;const O=(w=i.floating.current.ownerDocument.defaultView)!=null?w:window,F=x.scrollWidth>x.clientWidth,K=x.scrollHeight>x.clientHeight;let N=K&&C.offsetX>x.clientWidth;if(K&&O.getComputedStyle(x).direction==="rtl"&&(N=C.offsetX<=x.offsetWidth-x.clientWidth),N||F&&C.offsetY>x.clientHeight)return}const M=A&&y1(A.nodesRef.current,a).some(O=>{var F;return b1(C,(F=O.context)==null?void 0:F.refs.floating.current)});b1(C,i.floating.current)||b1(C,i.domReference.current)||M||!p&&A&&y1(A.nodesRef.current,a).length>0||(o.emit("dismiss",h?{preventScroll:!0}:!1),r(!1))}function I(){r(!1)}const T=AO(i.floating.current);s&&T.addEventListener("keydown",_),c&&T.addEventListener("pointerdown",S);const g=(f?[...cm(i.reference.current)?vs(i.reference.current):[],...cm(i.floating.current)?vs(i.floating.current):[]]:[]).filter(C=>{var y;return C!==((y=T.defaultView)==null?void 0:y.visualViewport)});return g.forEach(C=>C.addEventListener("scroll",I,{passive:!0})),()=>{s&&T.removeEventListener("keydown",_),c&&T.removeEventListener("pointerdown",S),g.forEach(C=>C.removeEventListener("scroll",I))}},[s,c,o,A,a,n,r,f,u,p,i,h]),u?{reference:{onPointerDown(){l&&(o.emit("dismiss"),r(!1))}},floating:{onPointerDownCapture(){v.current=!0}}}:{}},hO="ArrowUp",eb="ArrowDown",Kl="ArrowLeft",Oh="ArrowRight";function Jh(e,t,n){return Math.floor(e/t)!==n}function yd(e,t){return t<0||t>=e.current.length}function En(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:i,amount:o=1}=t===void 0?{}:t;const a=e.current;let u=n;do{var s,c;u=u+(r?-o:o)}while(u>=0&&u<=a.length-1&&(i?i.includes(u):a[u]==null||(s=a[u])!=null&&s.hasAttribute("disabled")||((c=a[u])==null?void 0:c.getAttribute("aria-disabled"))==="true"));return u}function tb(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function pk(e,t){return tb(t,e===hO||e===eb,e===Kl||e===Oh)}function C1(e,t,n){return tb(t,e===eb,n?e===Kl:e===Oh)||e==="Enter"||e==" "||e===""}function Yje(e,t,n){return tb(t,n?e===Kl:e===Oh,e===eb)}function Gje(e,t,n){return tb(t,n?e===Oh:e===Kl,e===hO)}function S1(e,t){return En(e,{disabledIndices:t})}function Ak(e,t){return En(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}const Jje=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:p=!1,rtl:A=!1,virtual:h=!1,focusItemOnOpen:v="auto",focusItemOnHover:_=!0,openOnArrowKeyDown:S=!0,disabledIndices:I=void 0,orientation:T="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(" "))),T==="vertical"&&g>1&&console.warn(["Floating UI: In grid list navigation mode (`cols` > 1), the",'`orientation` should be either "horizontal" or "both".'].join(" ")));const C=BQ(),y=pO(),x=dk(n),w=RC(u),M=RC(dk(u)),O=xe.useRef(v),F=xe.useRef(c??-1),K=xe.useRef(null),N=Vje(I),J=xe.useRef(!1),Z=xe.useRef(-1),[ae,ge]=xe.useState(),se=xe.useCallback((E,D)=>{Z.current=requestAnimationFrame(()=>{if(h){var ue;ge((ue=E.current[D.current])==null?void 0:ue.id)}else{var ke;(ke=E.current[D.current])==null||ke.focus({preventScroll:!0})}})},[h]);tu(()=>{s&&(!x&&n&&O.current&&c!=null&&w(c),x&&!n&&(cancelAnimationFrame(Z.current),F.current=-1,M(null)))},[n,x,c,o,se,s,w,M]),tu(()=>{if(s&&n)if(a==null){if(c!=null)return;x&&(F.current=-1,se(o,F)),!x&&O.current&&(K.current!=null||O.current===!0&&K.current==null)&&(F.current=K.current==null||C1(K.current,T,A)||p?S1(o,N.current):Ak(o,N.current),w(F.current),se(o,F))}else yd(o,a)||(F.current=a,se(o,F))},[n,x,a,c,p,o,w,se,s,l,T,A,h,N]),tu(()=>{if(s&&!n&&x){var E,D;const ue=y==null||(E=y.nodesRef.current.find(ke=>ke.id===C))==null||(D=E.context)==null?void 0:D.refs.floating.current;ue&&!ue.contains(fk(AO(ue)))&&ue.focus({preventScroll:!0})}},[s,n,x,y,C]),tu(()=>{K.current=null});function k(E){if(J.current=!0,p&&Gje(E.key,T,A)){za(E),r(!1),Dje(i.domReference.current)&&i.domReference.current.focus();return}const D=F.current,ue=S1(o,I),ke=Ak(o,I);if(E.key==="Home"&&(F.current=ue,w(F.current)),E.key==="End"&&(F.current=ke,w(F.current)),g>1){const Se=F.current;if(E.key===hO){if(za(E),Se===-1)F.current=ke;else if(F.current=En(o,{startingIndex:Se,amount:g,decrement:!0,disabledIndices:I}),f&&(Se-g<ue||F.current<0)){const rt=Se%g,bt=ke%g,Yt=ke-(bt-rt);bt===rt?F.current=ke:F.current=bt>rt?Yt:Yt-g}yd(o,F.current)&&(F.current=Se),w(F.current)}if(E.key===eb&&(za(E),Se===-1?F.current=ue:(F.current=En(o,{startingIndex:Se,amount:g,disabledIndices:I}),f&&Se+g>ke&&(F.current=En(o,{startingIndex:Se%g-g,amount:g,disabledIndices:I}))),yd(o,F.current)&&(F.current=Se),w(F.current)),T==="both"){const rt=Math.floor(Se/g);E.key===Oh&&(za(E),Se%g!==g-1?(F.current=En(o,{startingIndex:Se,disabledIndices:I}),f&&Jh(F.current,g,rt)&&(F.current=En(o,{startingIndex:Se-Se%g-1,disabledIndices:I}))):f&&(F.current=En(o,{startingIndex:Se-Se%g-1,disabledIndices:I})),Jh(F.current,g,rt)&&(F.current=Se)),E.key===Kl&&(za(E),Se%g!==0?(F.current=En(o,{startingIndex:Se,disabledIndices:I,decrement:!0}),f&&Jh(F.current,g,rt)&&(F.current=En(o,{startingIndex:Se+(g-Se%g),decrement:!0,disabledIndices:I}))):f&&(F.current=En(o,{startingIndex:Se+(g-Se%g),decrement:!0,disabledIndices:I})),Jh(F.current,g,rt)&&(F.current=Se));const bt=Math.floor(ke/g)===rt;yd(o,F.current)&&(f&&bt?F.current=E.key===Kl?ke:En(o,{startingIndex:Se-Se%g-1,disabledIndices:I}):F.current=Se),w(F.current);return}}if(pk(E.key,T)){if(za(E),n&&!h&&fk(E.currentTarget.ownerDocument)===E.currentTarget){F.current=C1(E.key,T,A)?ue:ke,w(F.current);return}C1(E.key,T,A)?f?F.current=D>=ke?l&&D!==o.current.length?-1:ue:En(o,{startingIndex:D,disabledIndices:I}):F.current=Math.min(ke,En(o,{startingIndex:D,disabledIndices:I})):f?F.current=D<=ue?l&&D!==-1?o.current.length:ke:En(o,{startingIndex:D,decrement:!0,disabledIndices:I}):F.current=Math.max(ue,En(o,{startingIndex:D,decrement:!0,disabledIndices:I})),yd(o,F.current)?w(null):w(F.current)}}return s?{reference:{...h&&n&&a!=null&&{"aria-activedescendant":ae},onKeyDown(E){if(J.current=!0,h&&n)return k(E);if((E.key.indexOf("Arrow")===0||E.key==="Enter"||E.key===" "||E.key==="")&&(K.current=E.key),p){Yje(E.key,T,A)&&(za(E),n?(F.current=S1(o,I),w(F.current)):r(!0));return}pk(E.key,T)&&(c!=null&&(F.current=c),za(E),!n&&S?r(!0):k(E),n&&w(F.current))}},floating:{"aria-orientation":T==="both"?void 0:T,...h&&a!=null&&{"aria-activedescendant":ae},onKeyDown:k,onPointerMove(){J.current=!1}},item:{onFocus(E){let{currentTarget:D}=E;const ue=o.current.indexOf(D);ue!==-1&&w(ue)},onClick:E=>{let{currentTarget:D}=E;return D.focus({preventScroll:!0})},..._&&{onMouseMove(E){let{currentTarget:D}=E;const ue=D;if(ue){const ke=o.current.indexOf(ue);ke!==-1&&w(ke)}},onPointerLeave(){if(!J.current&&(F.current=-1,se(o,F),w(null),!h)){var E;(E=i.floating.current)==null||E.focus({preventScroll:!0})}}}}}:{}};function Zje(e){var t;const{char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:a}=e,u=wMe(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 p=a.pos-f.length,A=Array.from(f.matchAll(l)).pop();if(!A||A.input===void 0||A.index===void 0)return null;const h=A.input.slice(Math.max(0,A.index-1),A.index),v=new RegExp(`^[${i==null?void 0:i.join("")}\0]?$`).test(h);if(i!==null&&!v)return null;const _=p+A.index;let S=_+A[0].length;return r&&s.test(f.slice(S-1,S+1))&&(A[0]+=" ",S+=1),_<a.pos&&S>=a.pos?{range:{from:_,to:S},query:A[0].slice(n.length),text:A[0]}:null}const Xje=new Gi("suggestion");function eUe({pluginKey:e=Xje,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,findSuggestionMatch:p=Zje}){let A;const h=l==null?void 0:l(),v=new Nr({key:e,view(){return{update:async(_,S)=>{var I,T,g,C,y,x,w;const M=(I=this.key)===null||I===void 0?void 0:I.getState(S),O=(T=this.key)===null||T===void 0?void 0:T.getState(_.state),F=M.active&&O.active&&M.range.from!==O.range.from,K=!M.active&&O.active,N=M.active&&!O.active,J=!K&&!N&&M.query!==O.query,Z=K||F,ae=J&&!F,ge=N||F;if(!Z&&!ae&&!ge)return;const se=ge&&!Z?M:O,k=_.dom.querySelector(`[data-decoration-id="${se.decorationId}"]`);A={editor:t,range:se.range,query:se.query,text:se.text,items:[],command:E=>s({editor:t,range:se.range,props:E}),decorationNode:k,clientRect:k?()=>{var E;const{decorationId:D}=(E=this.key)===null||E===void 0?void 0:E.getState(t.state),ue=_.dom.querySelector(`[data-decoration-id="${D}"]`);return(ue==null?void 0:ue.getBoundingClientRect())||null}:null},Z&&((g=h==null?void 0:h.onBeforeStart)===null||g===void 0||g.call(h,A)),ae&&((C=h==null?void 0:h.onBeforeUpdate)===null||C===void 0||C.call(h,A)),(ae||Z)&&(A.items=await c({editor:t,query:se.query})),ge&&((y=h==null?void 0:h.onExit)===null||y===void 0||y.call(h,A)),ae&&((x=h==null?void 0:h.onUpdate)===null||x===void 0||x.call(h,A)),Z&&((w=h==null?void 0:h.onStart)===null||w===void 0||w.call(h,A))},destroy:()=>{var _;A&&((_=h==null?void 0:h.onExit)===null||_===void 0||_.call(h,A))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(_,S,I,T){const{isEditable:g}=t,{composing:C}=t.view,{selection:y}=_,{empty:x,from:w}=y,M={...S};if(M.composing=C,g&&(x||t.view.composing)){(w<S.range.from||w>S.range.to)&&!C&&!S.composing&&(M.active=!1);const O=p({char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:y.$from}),F=`id_${Math.floor(Math.random()*4294967295)}`;O&&f({editor:t,state:T,range:O.range})?(M.active=!0,M.decorationId=S.decorationId?S.decorationId:F,M.range=O.range,M.query=O.query,M.text=O.text):M.active=!1}else M.active=!1;return M.active||(M.decorationId=null,M.range={from:0,to:0},M.query=null,M.text=null),M}},props:{handleKeyDown(_,S){var I;const{active:T,range:g}=v.getState(_.state);return T&&((I=h==null?void 0:h.onKeyDown)===null||I===void 0?void 0:I.call(h,{view:_,event:S,range:g}))||!1},decorations(_){const{active:S,range:I,decorationId:T}=v.getState(_);return S?Vt.create(_.doc,[Si.inline(I.from,I.to,{nodeName:a,class:u,"data-decoration-id":T})]):null}}});return v}const tUe=kn.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",St(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),lm="ltr",ls="rtl",Vo="dir",nUe=le.RichTextNodeType.rtl,rUe=cr.create({name:"textDirection",addOptions(){return{supportedExtensionNames:[]}},addGlobalAttributes(){return[{types:this.options.supportedExtensionNames,attributes:{[Vo]:{default:lm,parseHTML:e=>e.getAttribute(Vo),renderHTML:e=>({[Vo]:OC(e[Vo])})}}}]},addCommands(){return{setDirection:e=>({commands:t})=>{switch(e){case lm:return t.setLeftToRight();case ls:return t.setRightToLeft()}},toggleDirection:e=>({commands:t})=>{const n=e===ls?lm:ls;return t.setDirection(n)},setRightToLeft:()=>({commands:e})=>this.options.supportedExtensionNames.every(t=>e.updateAttributes(t,{[Vo]:ls})),setLeftToRight:()=>({commands:e})=>this.options.supportedExtensionNames.every(t=>e.resetAttributes(t,Vo))}},addKeyboardShortcuts(){return{"Mod-Shift-r":()=>this.editor.commands.setRightToLeft(),"Mod-Shift-l":()=>this.editor.commands.setLeftToRight()}}}),oa={parseNodeAttrsDirection(e){return OC(e[Vo])},fromPrismic(e){return{[Vo]:OC(e.direction)}},toPrismic(e){return{direction:this.parseNodeAttrsDirection(e.attrs)}}};function OC(e){return e===ls?ls:lm}const fg=tUe.extend({name:"paragraph",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",St(this.options.HTMLAttributes,e),0]}}),iUe={fromPrismic(e){return function(t){var r;const n=Us.converter.fromPrismic(e)(fg.name,t);return(r=e.nodes[fg.name])==null?void 0:r.create(oa.fromPrismic(t),n)}},toPrismic(e){return Us.converter.toPrismic(e,le.RichTextNodeType.paragraph,oa.toPrismic(e))}},oUe=new Eh([le.RichTextNodeType.paragraph],fg.name,fg,iUe,"Type '/' for commands"),aa=oUe,KQ=["ArrowDown","ArrowUp","End","Home"],PQ=["Enter"],aUe=["Escape",...KQ,...PQ],uUe=cr.create({name:"slash-commands",addOptions(){return{nodeTypes:[]}},addProseMirrorPlugins(){const e=fm(rV,this.options.nodeTypes);return e.length>1?[eUe({allowSpaces:!0,char:"/",editor:this.editor,startOfLine:!0,allow:({state:t})=>{const n=t.selection.$from;return n.parent.type.name===aa.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 mQ(sUe,{editor:n.editor,props:n}),document.body.appendChild(t.element)},onUpdate:n=>{t==null||t.updateProps(n)},onKeyDown:({event:n})=>{var r;return!!(aUe.includes(n.key)&&((r=t==null?void 0:t.ref)!=null&&r.handleKeyDown(n)))},onExit:()=>{t==null||t.destroy(),t==null||t.element.remove()}}}})]:[]}}),sUe=R.forwardRef(function(t,n){const{command:r,decorationNode:i,editor:o,items:a}=t,[u,s]=R.useState(!0),{context:c,floating:l,reference:f,x:p,y:A}=Nje({middleware:[$je(0),wje(),Eje({limiter:Rje()})],onOpenChange:s,open:u,placement:"top-start",strategy:"fixed",whileElementsMounted:kje});R.useLayoutEffect(()=>{f(i)},[f,i]),R.useEffect(()=>{let x;const w=()=>{x=window.setTimeout(()=>{s(!0)})},M=()=>{s(!1)};return o.on("focus",w).on("blur",M),()=>{o.off("focus",w).off("blur",M),clearTimeout(x)}},[o]);const[h,v]=R.useState(0),_=R.useRef([]);Xe.useOnChange(a,()=>{v(0),_.current=[]});const{getFloatingProps:S,getItemProps:I,getReferenceProps:T}=qje([Hje(c,{outsidePointerDown:!1}),Jje(c,{activeIndex:h,listRef:_,onNavigate:x=>{v(w=>x??w)},openOnArrowKeyDown:!1,virtual:!0}),zje(c,{role:"menu"})]),C=T().onKeyDown;R.useImperativeHandle(n,()=>({handleKeyDown:x=>{if(u){if(KQ.includes(x.key)&&C(x),PQ.includes(x.key)){const w=a[h];w!==void 0&&r(w)}return!0}else return!1}}),[h,r,a,C,u]);const y=p!==null&&A!==null;return u?d.jsx(m.Box,{...S(),minWidth:256,backgroundColor:"grey1",border:!0,borderStyle:"solid",borderRadius:6,flexDirection:"column",ref:l,top:0,left:0,position:"fixed",transform:y?`translate3d(${Math.round(p)}px, ${Math.round(A)}px, 0)`:"translate3d(0, -200%, 0)",overflow:"hidden",children:d.jsxs("div",{style:{boxShadow:"0px 2px 10px 0px hsla(0, 0%, 0%, 0.1)"},children:[a.map((x,w)=>{const M=I({onClick:()=>{r(x)},onPointerDown:O=>{O.preventDefault()}});return R.createElement(hk,{...M,key:x.nodeType,ref:O=>{_.current[w]=O},active:w===h,isFirstItem:w===0,isLastItem:w===a.length-1,shortcut:`/${x.shortText??""}`},x.text)}),a.length===0&&d.jsx(hk,{...I({onPointerDown:x=>{x.preventDefault()}}),disabled:!0,ref:x=>{_.current[0]=x},children:"No results"})]})}):null}),hk=R.forwardRef(function(t,n){const{children:r,disabled:i=!1,shortcut:o,active:a=!1,isFirstItem:u=!1,isLastItem:s=!1,...c}=t;return d.jsx("div",{...c,role:"button",style:{cursor:i?"default":"pointer"},ref:n,children:d.jsxs(m.Box,{alignItems:"center",height:32,flexDirection:"row",gap:8,padding:8,backgroundColor:a?"grey4":"inherit",justifyContent:"space-between",opacity:i?.5:1,children:[d.jsx(m.Text,{color:"grey12",component:"span",children:r}),o&&d.jsx(m.Text,{color:"inherit",component:"span",variant:"small",children:o})]})})});function cUe(e,t){var u,s;const n=t.map(c=>c.richTextNodeTypes).flat(),i={placeholderByNodeType:lUe(t),unfocusedPlaceholder:(u=e.config)==null?void 0:u.placeholder,nodeExtensions:t},o=n.includes(le.RichTextNodeType.orderedList)||n.includes(le.RichTextNodeType.list);return[xC.component(((s=e.config)==null?void 0:s.single)===void 0),Us.component,ug.component,gje(i),o?Wl.component:void 0,uUe.configure({nodeTypes:n})].filter(to.isDefined)}function lUe(e){return e.reduce((t,n)=>(n.nodeType===Al.Text&&(t[n.name]=n.placeholder),t),{})}const FC=QLe.extend({name:"bulletList",parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:e}){return["ul",St(this.options.HTMLAttributes,e),0]}}).configure({itemTypeName:"listItem"}),fUe={fromPrismic(e){return function(t){var r;const n=Wl.converter.fromPrismic(e)(t);if(n)return(r=e.nodes[FC.name])==null?void 0:r.create(oa.fromPrismic(t),n)}},toPrismic(e){return js.children.map(e,t=>Wl.converter.toPrismic(t,le.RichTextNodeType.list).filter(to.isDefined)).flat()}},dUe=new cO([le.RichTextNodeType.list],FC.name,FC,fUe),dg=dUe,pUe=/^```([a-z]+)?[\s\n]$/,AUe=/^~~~([a-z]+)?[\s\n]$/,hUe=kn.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",St(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(`
66
66
 
67
- `);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[yC({find:fUe,type:this.type,getAttributes:e=>({language:e[1]})}),yC({find:dUe,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new Nr({key:new Gi("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(Ke.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.insertText(n.replace(/\r\n?/g,`
68
- `)),a.setMeta("paste",!0),e.dispatch(a),!0}}})]}}),pg=pUe.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",St(this.options.HTMLAttributes),["code",e,0]]}}).configure({exitOnTripleEnter:!1}),AUe={fromPrismic(e){return function(t){var r;const n=Us.converter.fromPrismic(e)(pg.name,t,!0);return(r=e.nodes[pg.name])==null?void 0:r.create(oa.fromPrismic(t),n)}},toPrismic(e){return Us.converter.toPrismic(e,le.RichTextNodeType.preformatted,oa.toPrismic(e))}},hUe=new Eh([le.RichTextNodeType.preformatted],pg.name,pg,AUe,"",!0),DQ=hUe;function NQ(e){const{editor:t,getPos:n,node:r}=e,[i,o]=R.useState(!1);return R.useEffect(()=>{function a(){const{from:s,to:c}=t.state.selection,l=n(),f=n()+r.nodeSize,p=s<=l&&c>=f;o(p)}function u(){o(!1)}return t.on("blur",u),t.on("selectionUpdate",a),()=>{t.off("blur",u),t.off("selectionUpdate",a)}},[t,n,r.nodeSize]),{selected:i}}function mUe(e,t,n){const{node:r}=e,i=r.attrs.content,o=Xe.useStableCallback(e.updateAttributes),a=Xe.useDebounceState({initialState:(i==null?void 0:i.embed_url)??"",startTransition:R.startTransition});function u(l){o({content:l})}function s(l){a.set(l),$r.toURL(l)||u(void 0)}const{onKeyDown:c}=gUe(e,a.value,t,n);return{inputRef:t,containerRef:n,onKeyDown:c,url:a.value,urlChanged:s,onContentChange:u,debouncedUrl:a.debouncedValue,content:e.node.attrs.content}}function gUe(e,t,n,r){const{editor:i,getPos:o,node:a}=e,[u,s]=R.useState(!0);R.useEffect(()=>{!u||!e.editor.isFocused||m.handleEditorFlushSyncError(()=>{var l;return(l=n.current)==null?void 0:l.focus()})},[n,u,e.editor.isFocused]);function c(l){const f=o(),p=o()+a.nodeSize;l.code==="Enter"&&(s(!1),i.chain().insertContentAt(p,{type:"paragraph"}).focus(p+1).run()),l.code==="Backspace"&&t===""&&i.chain().deleteRange({from:f,to:p}).focus(p+1).run(),l.code==="ArrowUp"&&(s(!1),i.chain().focus(f-1).run()),l.code==="ArrowDown"&&(s(!1),i.chain().focus(p+1).run())}return{containerRef:r,inputRef:n,onKeyDown:c}}function vUe(e){const t=R.useRef(null),n=R.useRef(null),{onKeyDown:r,url:i,urlChanged:o,onContentChange:a,debouncedUrl:u,content:s}=mUe(e,t,n),{selected:c}=NQ(e);return d.jsx(hQ,{className:"custom-embed",children:d.jsxs("div",{contentEditable:"false",suppressContentEditableWarning:!0,children:[d.jsxs(m.Box,{flexGrow:1,alignItems:"center",children:[d.jsx(m.Icon,{size:"small",name:"cloud",color:"grey11"}),d.jsx(m.Box,{flexGrow:1,height:40,ref:n,children:d.jsx(Vu,{id:"id",ref:t,value:i,variant:$r.toURL(i)?"link":"normal",placeholder:"Paste your link here",onValueChange:o,onKeyDown:r})})]}),$r.toURL(i)&&d.jsx(t7,{selected:c,debouncedUrl:u,onContentChange:a,content:s})]})})}const MC=kn.create({name:"embed",group:"block",atom:!0,content:"block*",marks:"",addAttributes(){return{content:{default:void 0}}},addCommands(){return{setEmbed:()=>({tr:e,dispatch:t})=>{const n=this.type.create();return t&&e.replaceSelectionWith(n),!0}}},parseHTML(){return[{tag:"embed"}]},renderHTML(){return["embed"]},addNodeView(){return gQ(vUe)}}),yUe={fromPrismic(e){return function(t){var n;return(n=e.nodes[MC.name])==null?void 0:n.create({content:t.data})}},toPrismic(e){return e.attrs.content===void 0?{type:"embed",data:{type:"embed",embed_url:"",__TYPE__:"EmbedContent",all:[]}}:{type:"embed",data:{...e.attrs.content}}}},qQ=new OLe([le.RichTextNodeType.embed],MC.name,MC,yUe),bUe=kn.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]}`,St(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=>yC({find:new RegExp(`^(#{1,${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),kC="heading";function nb(e){switch(e){case 1:return le.RichTextNodeType.heading1;case 2:return le.RichTextNodeType.heading2;case 3:return le.RichTextNodeType.heading3;case 4:return le.RichTextNodeType.heading4;case 5:return le.RichTextNodeType.heading5;case 6:return le.RichTextNodeType.heading6}}function mk(e){return{fullName:nb(e),level:e}}const QQ=[1,2,3,4,5,6];function VQ(e,t=QQ){const n=new RegExp(`^heading([${t.join(",")}]){1}$`),r=e.match(n);if(!r||!r[1])return;const i=parseInt(r[1]);return{fullName:nb(i),level:i}}function zQ(e,t){const n=e.level;if(t.includes(n))return{fullName:nb(n),level:n}}const CUe=e=>{const t=e[0]??1;return{fromPrismic(n){return function(r){var a;const i=Us.converter.fromPrismic(n)(kC,r),o=VQ(r.type,e)||mk(t);return(a=n.nodes[kC])==null?void 0:a.create({level:o.level,...oa.fromPrismic(r)},i)}},toPrismic(n){const{fullName:r}=zQ(n.attrs,e)||mk(t);return Us.converter.toPrismic(n,r,oa.toPrismic(n))}}};function SUe(e){return e?e.size?Array.from(e.values()).reduce((n,r)=>{const i=VQ(r);return i?[...n,i.level]:n},[]).sort((n,r)=>n-r):[]:QQ}function _Ue(e){return bUe.extend({name:"heading"}).configure({levels:e})}const ns={name:kC,build:e=>{const t=SUe(e);if(!t)return;const n=t.map(r=>nb(r));return new MLe(n,_Ue(t),t,CUe(t),r=>{const i=zQ(r,t);return i&&`Heading ${i.level}`})}};function IUe(e){const{content:t,thumbnail:n,imageViewProps:{getPos:r,updateAttributes:i,editor:o,node:a}}=e,[u,s]=R.useTransition();function c(A){s(()=>i({content:A}))}function l(A){const h=Xh(A),v=r()+a.nodeSize;c({...t,...h}),o.chain().focus(v+1).run()}function f({croppedImages:A}){if(!t)return;const h=A[n.name];if(!h)return;const v=c7({content:t,croppedImage:h});v!==t&&c(v)}function p(){const A=r(),h=r()+a.nodeSize;o.chain().deleteRange({from:A,to:h}).focus(h).run()}return{onMediaSelected:l,onCropperDialogClose:f,isUpdating:u,updateContent:c,onClear:p}}function TUe(e){const{node:t}=e,n=t.attrs.content,{selected:r}=NQ(e),i={width:void 0,height:void 0,name:dd},{onMediaSelected:o,onCropperDialogClose:a,isUpdating:u,updateContent:s,onClear:c}=IUe({content:n,thumbnail:i,imageViewProps:e}),[l,f]=R.useState(!1),p="Feature image",A=(n==null?void 0:n.width)===0&&(n==null?void 0:n.height)===0,h=n&&!A?[`${n.width}x${n.height}px`]:[],v={thumbnail:i,contentView:n,labels:J1(i,n,n)};return d.jsx(hQ,{className:"custom-image",children:d.jsx("div",{contentEditable:"false",suppressContentEditableWarning:!0,children:d.jsx(u7,{isMediaDialogOpen:l,selected:r,onMediaSelected:o,onMediaDialogOpenChange:f,children:d.jsx(R.Suspense,{fallback:xUe,children:n!=null&&n.url?d.jsx(g7,{allContentViews:[n],content:n,contentView:n,fieldLabel:p,id:"id",imageLabel:h,initialImages:[v],isUpdating:u,readOnly:!1,thumbnailName:i.name,onClear:c,onContentChange:s,onCropperDialogClose:a,onMediaDialogOpenChange:f}):d.jsx(i7,{fieldLabel:p,isUpdating:u,readOnly:!1,onMediaDialogOpenChange:f})})})})})}const xUe=d.jsx("div",{style:{height:144}}),LC=kn.create({name:"image",group:"block",atom:!0,addAttributes(){return{content:{default:void 0}}},addCommands(){return{setImage:()=>e=>{const{dispatch:t,tr:n}=e,r=this.type.create();return t&&n.replaceSelectionWith(r),!0}}},parseHTML(){return[{tag:"image"}]},renderHTML({HTMLAttributes:e}){return["image",St(e)]},addNodeView(){return gQ(TUe)}}),wUe={fromPrismic(e){return function(t){var n;return(n=e.nodes[LC.name])==null?void 0:n.create({content:t.data})}},toPrismic(e){if(e.attrs.content!==void 0)return{type:"image",data:{...e.attrs.content}}}},HQ=new FLe([le.RichTextNodeType.image],LC.name,LC,wUe),$Ue=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,EUe=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,RUe=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,OUe=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,FUe=Kc.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",St(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[Xm({find:$Ue,type:this.type}),Xm({find:RUe,type:this.type})]},addPasteRules(){return[tg({find:EUe,type:this.type}),tg({find:OUe,type:this.type})]}});class MUe{constructor(t,n,r){$n(this,"extType",Pc.Mark);$n(this,"richTextNodeTypes",[le.RichTextNodeType.em]);this.name=t,this.component=n,this.converter=r}}const YQ="em",GQ=FUe.extend({name:YQ}),kUe={fromPrismic(e){return function(){var t;return(t=e.marks[GQ.name])==null?void 0:t.create()}},toPrismic(){}},LUe=new MUe(YQ,GQ,kUe),mO=LUe;class jUe{constructor(t,n,r){$n(this,"extType",Pc.Mark);$n(this,"richTextNodeTypes",[]);this.name=t,this.component=n,this.converter=r}}const JQ="label",jC=Kc.create({name:JQ,priority:1e3,keepOnSplit:!1,inclusive:!1,addOptions(){return{htmlAttributes:{style:"background-color: hsl(251, 89%, 96%); border: 1px dashed rgba(68, 53, 146, 0.4); border-radius: 0px 2px 2px 2px"}}},addAttributes(){return{label:{default:""}}},addCommands(){return{setLabel:e=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMark(this.name,e).run(),unsetLabel:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},renderHTML({HTMLAttributes:e}){return["span",St(this.options.htmlAttributes,e),0]}}),UUe={fromPrismic(e){return function(t){var i;const n=t.data,r={type:jC.name,label:n};return(i=e.marks[jC.name])==null?void 0:i.create(r)}},toPrismic(e){return e.attrs.label}},gO=new jUe(JQ,jC,UUe);class BUe{constructor(t,n,r){$n(this,"extType",Pc.Mark);$n(this,"richTextNodeTypes",[le.RichTextNodeType.hyperlink]);this.name=t,this.component=n,this.converter=r}}const ZQ="hyperlink",No=Kc.create({name:ZQ,priority:1e3,keepOnSplit:!1,inclusive:!1,addOptions(){return{openOnClick:!1,linkOnPaste:!0,autolink:!0,protocols:[],htmlAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null,id:""},validate:void 0}},addAttributes(){return{href:{default:""},id:{default:""},target:{default:"_blank"},rel:{default:"noopener noreferrer nofollow"},class:{default:null},media:{default:null}}},parseHTML(){return[{tag:'a[href]:not([href *= "javascript:" i])'}]},renderHTML({HTMLAttributes:e}){return["a",St(this.options.htmlAttributes,e),0]},addCommands(){return{setWebLink:e=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMark(this.name,e).setMeta("preventAutolink",!0).run(),setDocumentLink:e=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMark(this.name,e).setMeta("preventAutolink",!0).run(),setMediaLink:e=>({chain:t})=>{const n=UC(h7({media:e.media}).value);return t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMark(this.name,{media:n}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}}}),WUe={fromPrismic(e){return function(t){var r,i,o,a;const n=t.data;if(n.__TYPE__==="DocumentLink"){const u={type:No.name,id:n.id};return(r=e.marks[No.name])==null?void 0:r.create(u)}if(n.__TYPE__==="ImageLink"){const u={type:No.name,media:UC(n)};return(i=e.marks[No.name])==null?void 0:i.create(u)}if(n.__TYPE__==="FileLink"){const u={type:No.name,media:UC(n)};return(o=e.marks[No.name])==null?void 0:o.create(u)}if(n.__TYPE__==="ExternalLink"){const u={type:No.name,url:n.url,href:n.url,target:n.target};return(a=e.marks[No.name])==null?void 0:a.create(u)}}},toPrismic(e){return e.attrs.media?eV(e.attrs.media):e.attrs.id?{__TYPE__:"DocumentLink",id:e.attrs.id}:{__TYPE__:"ExternalLink",url:e.attrs.href,target:e.attrs.target}}},XQ=new BUe(ZQ,No,WUe);function UC(e){return JSON.stringify(e)}function eV(e){return JSON.parse(e)}const KUe=kn.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",St(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)}}}),gk=Kc.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:e=>e.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["span",St(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:e,commands:t})=>{const n=XR(e,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:t.unsetMark(this.name)}}}}),vk=/^(\d+)\.\s$/,PUe=kn.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return t===1?["ol",St(this.options.HTMLAttributes,n),0]:["ol",St(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(KUe.name,this.editor.getAttributes(gk.name)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=eg({find:vk,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=eg({find:vk,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(gk.name)}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1],editor:this.editor})),[e]}}),BC=PUe.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",St(this.options.HTMLAttributes,n),0]:["ol",St(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"}),DUe={fromPrismic(e){return function(t){var r;const n=Wl.converter.fromPrismic(e)(t);if(n)return(r=e.nodes[BC.name])==null?void 0:r.create(oa.fromPrismic(t),n)}},toPrismic(e){return js.children.map(e,t=>Wl.converter.toPrismic(t,le.RichTextNodeType.orderedList).filter(to.isDefined)).flat()}},NUe=new cO([le.RichTextNodeType.orderedList],BC.name,BC,DUe),Ag=NUe,tV=[lO,mO,XQ,gO];function nV(e){return[aa,dg,Ag,ns.build(e),DQ,qQ,HQ,...tV].filter(to.isDefined)}const rV=[{nodeType:le.RichTextNodeType.paragraph,icon:"textFields",isActive:e=>e.isActive(aa.name)&&!e.isActive(dg.name)&&!e.isActive(Ag.name),runCommands:Ot((e,t)=>e.clearNodes().setDirection(gi(t))),shortText:"par",text:"Paragraph"},{nodeType:le.RichTextNodeType.heading1,icon:"looks1",isActive:e=>e.isActive(ns.name,{level:1}),runCommands:Ot((e,t)=>e.setHeading({level:1}).setDirection(gi(t))),shortText:"h1",text:"Heading 1"},{nodeType:le.RichTextNodeType.heading2,icon:"looks2",isActive:e=>e.isActive(ns.name,{level:2}),runCommands:Ot((e,t)=>e.setHeading({level:2}).setDirection(gi(t))),shortText:"h2",text:"Heading 2"},{nodeType:le.RichTextNodeType.heading3,icon:"looks3",isActive:e=>e.isActive(ns.name,{level:3}),runCommands:Ot((e,t)=>e.setHeading({level:3}).setDirection(gi(t))),shortText:"h3",text:"Heading 3"},{nodeType:le.RichTextNodeType.heading4,icon:"looks4",isActive:e=>e.isActive(ns.name,{level:4}),runCommands:Ot((e,t)=>e.setHeading({level:4}).setDirection(gi(t))),shortText:"h4",text:"Heading 4"},{nodeType:le.RichTextNodeType.heading5,icon:"looks5",isActive:e=>e.isActive(ns.name,{level:5}),runCommands:Ot((e,t)=>e.setHeading({level:5}).setDirection(gi(t))),shortText:"h5",text:"Heading 5"},{nodeType:le.RichTextNodeType.heading6,icon:"looks6",isActive:e=>e.isActive(ns.name,{level:6}),runCommands:Ot((e,t)=>e.setHeading({level:6}).setDirection(gi(t))),shortText:"h6",text:"Heading 6"},{nodeType:le.RichTextNodeType.list,icon:"formatListBulleted",isActive:e=>e.isActive(dg.name),runCommands:Ot((e,t)=>e.toggleBulletList().setDirection(gi(t))),shortText:"bull",text:"Bulleted list"},{nodeType:le.RichTextNodeType.orderedList,icon:"formatListNumbered",isActive:e=>e.isActive(Ag.name),runCommands:Ot((e,t)=>e.toggleOrderedList().setDirection(gi(t))),shortText:"num",text:"Numbered list"},{nodeType:le.RichTextNodeType.preformatted,icon:"dataObject",isActive:e=>e.isActive(DQ.name),runCommands:Ot((e,t)=>e.setCodeBlock().setDirection(gi(t))),shortText:"code",text:"Code"},{nodeType:le.RichTextNodeType.embed,icon:"cloud",isActive:e=>e.isActive(qQ.name),runCommands:Ot(e=>e.setEmbed()),shortText:"emb",text:"Embed"},{nodeType:le.RichTextNodeType.image,icon:"image",isActive:e=>e.isActive(HQ.name),runCommands:Ot(e=>e.setImage()),shortText:"img",text:"Image"}],qUe=[{nodeType:le.RichTextNodeType.strong,icon:"formatBold",isActive:e=>e.isActive(lO.name),runCommands:Ot(e=>e.toggleBold())},{nodeType:le.RichTextNodeType.em,icon:"formatItalic",isActive:e=>e.isActive(mO.name),runCommands:Ot(e=>e.toggleItalic())}],QUe=[{nodeType:le.RichTextNodeType.rtl,icon:"formatTextDirectionRToL",isActive:e=>e.isActive({[Vo]:ls}),runCommands:Ot((e,t)=>e.toggleDirection(gi(t)))}];function Ot(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)),n.can?VUe(t,r,e):e(r,t).run()}}function gi(e){const t=e.state.selection.$from.parent.attrs;return oa.parseNodeAttrsDirection(t)}function fm(e,t){return e.filter(n=>t.includes(n.nodeType))}function VUe(e,t,n){try{return n(t,e).run()}catch{return!1}}function zUe(e){const{items:t,editor:n}=e;return t.length===0?null:d.jsxs(d.Fragment,{children:[d.jsx(m.ToolbarSeparator,{}),t.map(r=>d.jsx(m.ToolbarToggleButton,{disabled:!r.runCommands(n,{can:!0}),onPressedChange:()=>{r.runCommands(n)},pressed:r.isActive(n),startIcon:r.icon},r.nodeType))]})}function HUe(e){const{labels:t,editor:n}=e,r=n.getAttributes("label").label;return d.jsxs(d.Fragment,{children:[d.jsx(m.ToolbarSeparator,{}),d.jsxs(m.DropdownMenu,{children:[d.jsx(m.DropdownMenuTrigger,{disabled:t.length===0,children:d.jsx(m.Button,{endIcon:"arrowDropDown",size:"small",color:"grey",children:yk(r??"Labels")})}),d.jsx(m.DropdownMenuContent,{align:"start",asPortal:!1,maxHeight:256,avoidCollisions:!1,children:t.map((i,o)=>{const a=r===i;return d.jsx(m.DropdownMenuItem,{onSelect:()=>a?n.commands.unsetLabel():YUe(n,i),endIcon:a&&d.jsx(m.Icon,{name:"check",size:"extraSmall"}),children:yk(i)},`${i}-${o}`)})})]})]})}function YUe(e,t){Ot(r=>r.setLabel({label:t}))(e)}function yk(e){return Ip.overflow(e,20)}function GUe(e){const{editor:t}=e,n=t.getAttributes("label");if(!n.label)return null;const r=n.label;return d.jsx(m.Box,{backgroundColor:"purple9",padding:{block:2,inline:4},alignItems:"center",borderRadius:{topLeft:2,topRight:2,bottomRight:2},maxWidth:125,children:d.jsx(m.Text,{color:"white",variant:"small",noWrap:!0,children:r})})}function JUe(e){const{disabled:t,showWebLinkModal:n,showDocumentsLinkModal:r,showMediaLinkModal:i}=ZUe(e);return d.jsxs(d.Fragment,{children:[d.jsx(m.ToolbarSeparator,{}),d.jsxs(m.ToolbarButtonGroup,{density:"compact",children:[d.jsx(m.ToolbarButton,{disabled:t,startIcon:"link",onClick:n},le.RichTextNodeType.hyperlink),d.jsxs(m.DropdownMenu,{children:[d.jsx(m.DropdownMenuTrigger,{children:d.jsx(m.ToolbarButton,{startIcon:"arrowDropDown"})}),d.jsxs(m.DropdownMenuContent,{align:"end",asPortal:!1,children:[d.jsx(m.DropdownMenuItem,{startIcon:d.jsx(m.Icon,{name:"public"}),onSelect:n,children:"Link to web page"}),d.jsx(m.DropdownMenuItem,{startIcon:d.jsx(m.Icon,{name:"description"}),onSelect:r,children:"Link to document"}),d.jsx(m.DropdownMenuItem,{startIcon:d.jsx(m.Icon,{name:"image"}),onSelect:i,children:"Link to media"})]})]})]})]})}function ZUe(e){const{editor:t,setModal:n}=e;function r(){n("webLink")}function i(){n("documentLink")}function o(){n("mediaLink")}return{disabled:!Ot(u=>u.setWebLink({href:""}))(t,{can:!0}),showWebLinkModal:r,showDocumentsLinkModal:i,showMediaLinkModal:o}}function XUe(e){const{docId:t,onEdit:n,onUnlink:r}=e,i=e2e(t),o=xe();if(!i)return null;const a=i.versions[0],u=_R({status:a==null?void 0:a.status,releaseId:(a==null?void 0:a.status)==="release"?a.release_id:void 0,documentId:i.id,versionId:a==null?void 0:a.version_id,baseUrl:o.baseUrl}),s=(a==null?void 0:a.preview_summary)??"",c=(a==null?void 0:a.custom_type_label)??"";return d.jsx(m.LinkDescriptionCard,{url:u,title:i.title,subTitle:c,description:s,onEdit:n,onUnlink:r,largeIconName:"description"})}function e2e(e){const t=xe();t.searchDocuments||Bn("searchDocuments");const{coreApiBaseUrl:n,authStrategy:r}=t;return nt.useRequest(Cq,[n,r,e])}function t2e(e){const{editor:t}=e,{searchDocuments:n}=xe(),r=t.getAttributes(le.RichTextNodeType.hyperlink);if(r.id&&n){const i=r.id;return d.jsx(n2e,{docId:i,...e})}if(r.href){const i=r.href;return d.jsx(r2e,{url:i,...e})}if(r.media){const i=eV(r.media);return d.jsx(i2e,{media:i,...e})}return null}function n2e(e){const{editor:t,onEditDocumentLink:n,docId:r}=e;return d.jsx(m.ErrorBoundary,{renderError:()=>d.jsx(m.LinkDescriptionCard,{url:"",title:"Failed to Load Linked Document Data",subTitle:"",error:!0,onEdit:n,onUnlink:()=>ys(t)}),children:d.jsx(R.Suspense,{fallback:d.jsx(m.LinkDescriptionCard,{url:"",title:"",subTitle:"",loading:!0,onEdit:n,onUnlink:()=>ys(t)}),children:d.jsx(XUe,{docId:r,onEdit:n,onUnlink:()=>ys(t)})})})}function r2e(e){const{url:t,editor:n,onEditWebLink:r}=e,i=$r.toURL(t);return i?d.jsx(m.LinkDescriptionCard,{url:t,title:$r.getUrlTitle(i),subTitle:t,onEdit:r,onUnlink:()=>ys(n)}):d.jsx(m.LinkDescriptionCard,{url:t,title:"",subTitle:t,onEdit:r,onUnlink:()=>ys(n)})}function i2e(e){const{media:t,editor:n,onEditMediaLink:r}=e;return t.__TYPE__==="ImageLink"?d.jsx(m.LinkImageCard,{url:t.url,title:t.name,subTitle:`${t.width} x ${t.height} pixels`,onEdit:r,onUnlink:()=>ys(n)}):t.__TYPE__==="FileLink"?d.jsx(m.LinkDescriptionCard,{url:t.url,title:t.name,subTitle:o2e({filename:t.name}),onEdit:r,onUnlink:()=>ys(n),largeIconName:"insertDriveFile"}):null}function ys(e){Ot(n=>n.unsetLink())(e)}function o2e(e){const{filename:t}=e,n=t.split(".").pop();return n?n.toLowerCase():""}function a2e(e){const{open:t}=e,{onOpenChange:n,onSelectDocument:r}=u2e(e);return d.jsx(f7,{open:t,onOpenChange:n,onSelectDocument:r})}function u2e(e){const{editor:t,setOpen:n}=e;function r(o){Ot(u=>u.extendMarkRange(le.RichTextNodeType.hyperlink).setDocumentLink({id:o}))(t),n(!1)}function i(o){n(o)}return{onSelectDocument:r,onOpenChange:i}}function s2e(e){const{open:t}=e,{onOpenChange:n,onMediaSelected:r}=c2e(e);return d.jsx(RR,{open:t,onOpenChange:n,onMediaSelected:r,assetType:"all"})}function c2e(e){const{editor:t,setOpen:n}=e;function r(i){Ot(a=>a.extendMarkRange(le.RichTextNodeType.hyperlink).setMediaLink({media:i}))(t),n(!1)}return{onMediaSelected:r,onOpenChange:n}}function l2e(e){const{open:t,setOpen:n}=e,{url:r,setUrl:i,openInNewTab:o,setOpenInNewTab:a,disabled:u,onUpdate:s}=f2e(e);return d.jsxs(m.Dialog,{open:t,onOpenChange:n,size:"small",children:[d.jsx(m.DialogHeader,{title:"Set Link URL"}),d.jsxs(m.DialogContent,{padding:16,children:[d.jsx(m.FormInput,{value:r,onValueChange:i,placeholder:"Paste URL",icon:"public"}),r&&d.jsx(m.CheckboxLabel,{value:"Open in new tab",children:d.jsx(m.Checkbox,{checked:o,onCheckedChange:a})})]}),d.jsxs(m.DialogActions,{children:[d.jsx(m.DialogCancelButton,{}),d.jsx(m.DialogActionButton,{onClick:s,disabled:u,children:"Update"})]})]})}function f2e(e){const{editor:t,open:n,setOpen:r}=e,i=d2e(t),[o,a]=R.useState(i.url),[u,s]=R.useState(i.openInNewTab);Xe.useOnChange(n,()=>{n&&(a(i.url),s(i.openInNewTab))});const c=!o||o===i.url&&u===i.openInNewTab;function l(){const f=u?"_blank":"_self";Ot(p=>p.extendMarkRange(le.RichTextNodeType.hyperlink).setWebLink({href:o,target:f}))(t),r(!1)}return{url:o,setUrl:a,openInNewTab:u,disabled:c,setOpenInNewTab:s,onUpdate:l}}function d2e(e){const t=e.getAttributes(le.RichTextNodeType.hyperlink);return{url:t.href??"",openInNewTab:t.target==="_blank"}}function p2e(e){const{items:t,editor:n}=e;return t.length===0?null:d.jsxs(d.Fragment,{children:[d.jsx(m.ToolbarSeparator,{}),d.jsx(m.ToolbarToggleButtonGroup,{onValueChange:r=>{t.forEach(i=>{(i.isActive(n)&&!r.includes(i.nodeType)||!i.isActive(n)&&r.includes(i.nodeType))&&i.runCommands(n)})},type:"multiple",value:t.filter(r=>r.isActive(n)).map(r=>r.nodeType),children:t.map(r=>d.jsx(m.ToolbarToggleButtonGroupItem,{disabled:!r.runCommands(n,{can:!0}),startIcon:r.icon,value:r.nodeType},r.nodeType))},"mark")]})}function A2e(e){var r;const{items:t,editor:n}=e;return t.length===0?null:d.jsxs(m.DropdownMenu,{children:[d.jsx(m.DropdownMenuTrigger,{disabled:t.length===1,children:d.jsx(m.Button,{endIcon:"arrowDropDown",size:"small",color:"grey",children:((r=t.find(i=>i.isActive(n)))==null?void 0:r.text)??""})}),d.jsx(m.DropdownMenuContent,{align:"start",asPortal:!1,maxHeight:256,avoidCollisions:!1,children:t.map(i=>d.jsx(m.DropdownMenuItem,{onSelect:()=>{i.runCommands(n)},children:i.text},i.nodeType))})]})}function _1(e){return{duration:100,hideOnClick:!0,offset:e,placement:"top-start",appendTo:document.querySelector("body > div")??"parent"}}function h2e(e){const{editor:t,nodeTypes:n,labels:r}=e,[i,o]=R.useState(),a=n.includes(le.RichTextNodeType.hyperlink),u=!i,{shouldShowBubbleMenu:s,shouldshowPopover:c}=g2e({editor:t}),[l,f]=R.useState(!0);R.useEffect(()=>{f(!1)},[]);function p(v){o(v?"webLink":void 0)}function A(v){o(v?"documentLink":void 0)}function h(v){o(v?"mediaLink":void 0)}return l?null:d.jsxs(d.Fragment,{children:[d.jsx(p1,{editor:t,tippyOptions:_1([-48,0]),shouldShow:s,children:u&&d.jsx(m2e,{editor:t,nodeTypes:n,labels:r,setModal:o})}),d.jsx(p1,{editor:t,tippyOptions:_1([-48,0]),shouldShow:v=>c(v,"hyperlink"),children:u&&d.jsx(t2e,{editor:t,onEditWebLink:()=>o("webLink"),onEditDocumentLink:()=>o("documentLink"),onEditMediaLink:()=>o("mediaLink")})}),d.jsx(p1,{editor:t,tippyOptions:_1([0,0]),shouldShow:v=>c(v,"label"),children:d.jsx(GUe,{editor:t})}),a&&d.jsxs(d.Fragment,{children:[d.jsx(l2e,{open:i==="webLink",setOpen:p,editor:t}),d.jsx(a2e,{open:i==="documentLink",setOpen:A,editor:t}),d.jsx(s2e,{open:i==="mediaLink",setOpen:h,editor:t})]})]})}function m2e(e){const{editor:t,nodeTypes:n,labels:r,setModal:i}=e,o=n.includes("hyperlink"),a=r.length>0,u=fm(rV,n),s=fm(qUe,n),c=fm(QUe,n),l=u.length+s.length+c.length+Number(o);return l===0?null:d.jsxs(m.Toolbar,{children:[d.jsx(A2e,{items:u,editor:t}),a&&d.jsx(HUe,{labels:r,editor:t}),d.jsx(p2e,{items:s,editor:t}),o&&d.jsx(JUe,{editor:t,setModal:i}),d.jsx(zUe,{items:c,editor:t}),l>1&&d.jsxs(d.Fragment,{children:[d.jsx(m.ToolbarSeparator,{}),d.jsx(m.ToolbarButton,{onClick:()=>{t.chain().focus().clearNodes().unsetAllMarks().run()},startIcon:"formatClear"},"clear")]})]})}function g2e(e){const{editor:t}=e;function n(i){const{view:o,state:a,from:u,to:s}=i;if(!o.hasFocus())return!1;const{doc:c,selection:l}=a;return!(t.isActive(le.RichTextNodeType.preformatted)||l.empty||c.textBetween(u,s).length===0)}function r(i,o){const{view:a,state:u,from:s,to:c}=i,l=a.state.doc.nodeAt(s),{doc:f,selection:p}=u;return!p.empty||f.textBetween(s,c).length>0?!1:!!(l!=null&&l.marks.some(h=>h.type.name===o))}return{shouldShowBubbleMenu:n,shouldshowPopover:r}}function v2e(e){const{content:t,field:n,id:r,readOnly:i}=e,o=y2e(n),a=t&&xC.converter(o.nodeExtensions).fromPrismic(o.schema,o.nodeTypes,t),u=Xe.useStableCallback(e.onContentChange),s=m.useEditor({content:a==null?void 0:a.toJSON(),editable:!i,editorProps:{attributes:{class:`${m.contentEditableClass} ${m.contentEditableMultilinePlaceholderClass}`,id:r,tabIndex:"0"}},extensions:o.allComponents,injectCSS:!1,onUpdate({editor:c}){if(c.isEmpty)return u(void 0);const l=xC.converter(o.nodeExtensions).toPrismic(c.state.doc);u(l)}},[o,i]);return d.jsxs(m.Field,{children:[d.jsx(m.FieldLabel,{htmlFor:r,children:er(n)}),d.jsxs(m.FieldControl,{children:[s.isEditable&&d.jsx(h2e,{editor:s,nodeTypes:o.names.concat(eUe),labels:o.labels}),d.jsx(yLe,{editor:s,style:{flexGrow:1}})]})]})}function y2e(e){var n,r;const t=`${((n=e.config)==null?void 0:n.multi)??""}-${((r=e.config)==null?void 0:r.single)??""}`;return R.useMemo(()=>{var h;const{extensions:i,nodeTypes:o}=LLe(e.config),a=i.filter(b2e),u=i.flatMap(v=>v.richTextNodeTypes),s=i.map(v=>v.component),c=i.filter(C2e).map(v=>v.name),l=[...s,...uUe(e,a),tUe.configure({supportedExtensionNames:c}),kMe],f=l.map(v=>v.name),p=XFe(l),A=S2e((h=e.config)==null?void 0:h.labels);return{allComponents:l,extensionNames:f,nodeTypes:o,nodeExtensions:a,names:u,schema:p,labels:A}},[t])}function b2e(e){return e.extType===Pc.Node}function C2e(e){return!(e.extType!==Pc.Node||e.nodeType!==Al.Text||e.lockedFormat)}function S2e(e){return Array.from(e??[])}function _2e(e){var p,A;const{content:t,field:n,id:r,readOnly:i,onContentChange:o}=e,{placeholder:a,options:u}=n.config??{},s=!!(u!=null&&u.includes("")),c=x2e(n),l=I2e({content:t,placeholder:a,defaultValue:c,canHaveEmptyValue:s}),f=a&&c===void 0;return d.jsxs(m.Field,{children:[d.jsx(m.FieldIcon,{name:"arrowDropDownCircle"}),d.jsx(m.FieldLabel,{htmlFor:r,children:er(n)}),d.jsx(m.FieldControl,{children:d.jsxs(m.Select,{id:r,size:"large",color:"grey",value:l,disabled:i,renderTrigger:()=>d.jsx(m.SelectGhostTrigger,{id:r}),onValueChange:h=>{o(T2e({value:h,placeholder:a}))},children:[f&&d.jsx(m.SelectItem,{value:a,children:a}),(A=(p=n.config)==null?void 0:p.options)==null?void 0:A.map(h=>d.jsx(m.SelectItem,{value:h||vO,children:h},h))]})})]})}function I2e(e){const{content:t,placeholder:n,defaultValue:r,canHaveEmptyValue:i}=e;let{value:o}=t??{};return o===""&&i?vO:(o===""&&(o=void 0),o??r??n)}function T2e(e){const{placeholder:t}=e;let{value:n}=e;if(n!==t)return n===vO&&(n=""),{__TYPE__:"FieldContent",type:"Select",value:n}}function x2e(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]}const vO=" ";function w2e(e){const{id:t,readOnly:n,field:r,content:i,onContentChange:o}=e,a=i!=null&&i.value?PC.dateFromISOString(i.value):void 0;return d.jsxs(m.Field,{children:[d.jsx(m.FieldIcon,{name:"event"}),d.jsx(m.FieldLabel,{id:t,children:er(r)}),d.jsx(m.FieldControl,{children:d.jsx(m.Box,{padding:{left:4,right:12},width:"100%",flexDirection:"column",justifyContent:"center",children:d.jsx(m.DateInput,{mode:"date-time","aria-labelledby":t,disabled:n,value:a,onValueChange:u=>o($2e(u))})})})]})}function $2e(e){if(e)return{__TYPE__:"FieldContent",type:"Timestamp",value:E2e(e)}}function E2e(e){const t=`${e.getUTCFullYear()}`.padStart(4,"0"),n=`${e.getUTCMonth()+1}`.padStart(2,"0"),r=`${e.getUTCDate()}`.padStart(2,"0"),i=`${e.getUTCHours()}`.padStart(2,"0"),o=`${e.getUTCMinutes()}`.padStart(2,"0");return`${t}-${n}-${r}T${i}:${o}:00+00:00`}function rb(e){const{id:t,readOnly:n,content:r,nestableWidget:i}=e,o=Xe.useStableCallback(e.onContentChange);return R.useMemo(()=>{const a={id:t,readOnly:n,onContentChange:o};return i.type==="Boolean"?d.jsx(c$e,{...a,field:i,content:Ue.isBooleanContent(r)?r:void 0}):i.type==="Date"?d.jsx(p$e,{...a,field:i,content:Ue.isDateContent(r)?r:void 0}):i.type==="Timestamp"?d.jsx(w2e,{...a,field:i,content:Ue.isTimestampContent(r)?r:void 0}):i.type==="Image"?d.jsx(yEe,{...a,field:i,content:Ue.isImageContent(r)?r:void 0}):i.type==="Link"?d.jsx(m7,{...a,field:i,content:Ue.isLinkContent(r)?r:void 0}):i.type==="Number"?d.jsx(jEe,{...a,field:i,content:Ue.isNumberContent(r)?r:void 0}):i.type==="StructuredText"?d.jsx(v2e,{...a,field:i,content:Ue.isRichTextContent(r)?r:void 0}):i.type==="Select"?d.jsx(_2e,{...a,field:i,content:Ue.isSelectContent(r)?r:void 0}):i.type==="Text"?d.jsx(kEe,{...a,field:i,content:Ue.isTextContent(r)?r:void 0}):i.type==="Embed"?d.jsx(I$e,{...a,field:i,content:Ue.isEmbedContent(r)?r:void 0}):i.type==="Color"?d.jsx(f$e,{...a,field:i,content:Ue.isColorContent(r)?r:void 0}):i.type==="GeoPoint"?d.jsx(T$e,{...a,field:i,content:Ue.isGeoPointContent(r)?r:void 0}):i.type==="IntegrationFields"?d.jsx(MEe,{...a,field:i,content:Ue.isIntegrationFieldContent(r)?r:void 0}):null},[r,t,i,o,n])}function R2e(e){const{content:t,id:n,nonRepeatableZone:r,onContentChange:i,readOnly:o}=e,a=R.useMemo(()=>Object.entries(r),[r]);return d.jsx(d.Fragment,{children:a.map(([u,s])=>{const c=t[u];return d.jsx(rb,{id:`${n}.${u}`,readOnly:o,nestableWidget:s,content:Ue.isNestableContent(c)?c:void 0,onContentChange:l=>{i(O2e(t,u,l))}},u)})})}function O2e(e,t,n){return n?{...e,[t]:n}:Pl.removeKey(e,t)}function yO(e){var o,a;const{group:t,content:n,onContentChange:r,...i}=e;return d.jsx(bO,{...i,title:WC(t),addItemButtonTitle:`Add item in "${WC(t)}"`,repeatable:((o=t.config)==null?void 0:o.repeat)!==!1,repeatableZone:((a=t.config)==null?void 0:a.fields)??{},content:n==null?void 0:n.value,onContentChange:u=>{r({__TYPE__:"GroupContentType",value:u})}})}function WC(e){var t;return((t=e.config)==null?void 0:t.label)??e.fieldset??e.type}function iV(e){const{id:t,readOnly:n,content:r,widget:i}=e,o=Xe.useStableCallback(e.onContentChange);return R.useMemo(()=>{const a={id:t,readOnly:n,onContentChange:o};return i.type==="Group"?d.jsx(yO,{...a,group:i,content:Ue.isGroupContent(r)?r:void 0}):d.jsx(rb,{...a,nestableWidget:i,content:Ue.isNestableContent(r)?r:void 0})},[r,t,i,o,n])}function bO(e){const{id:t,title:n,addItemButtonTitle:r,content:i,onContentChange:o,readOnly:a,repeatable:u=!0,repeatableZone:s}=e,c=Object.entries(s);let l=i??[k2e];!u&&l.length>1&&(l=l.slice(0,1));const{scrollOffsetTop:f}=xe(),p=R.useRef(new WeakMap);F2e(p.current,l);function A(T){return p.current.get(T)??"!bugged!"}function h(){o(l.concat(KC()))}function v(T){const{index:g,offset:C}=T;o(gn.move(l,g,g+C))}function _(T){const{index:g}=T;o(gn.removeIndex(l,g))}function S(T){o(T)}function I(T,g,C,y){const x=j2e(T,[C,y]),w=L2e(l,[g,x]);M2e(p.current,T,x),o(w)}return Object.keys(s).length===0?null:d.jsx(m.Group,{title:n??"Repeatable zone",addItemButtonTitle:r??"Add item in repeatable zone",items:l,maxItems:u?void 0:1,getItemKey:A,onAddItem:h,dnd:{scrollOffsetTop:f,onReorder:S,renderDragPreview:({index:T})=>d.jsx(U2e,{title:n??"Repeatable zone",index:T}),renderDropIndicator:B2e},children:(T,g)=>{const C=new Map(T.value),y=A(T);return d.jsx(m.LazyRender,{keepLoaded:!0,children:d.jsx(m.GroupItem,{index:g,title:`${g+1} • Item`,onMove:v,onDelete:_,children:c.map(([x,w])=>d.jsx(iV,{id:`${t}[${y}].${x}`,content:C.get(x),widget:w,onContentChange:M=>I(T,g,x,M),readOnly:a},x))})})}})}function F2e(e,t){t.forEach(n=>{e.has(n)||e.set(n,mV.uniqueNumber())})}function M2e(e,t,n){const r=e.get(t);r!==void 0&&e.set(n,r)}const k2e={__TYPE__:"GroupItemContent",value:[]};function L2e(e,t){const[n,r]=t;return r?e.map((i,o)=>o===n?r:i):e.filter((i,o)=>o!==n)}function j2e(e,t){const[n,r]=t;if(!r){const o=e.value.filter(([a])=>a!==n);return KC(o)}const i=Array.from(new Map(e.value).set(n,r));return KC(i)}function KC(e=[]){return{__TYPE__:"GroupItemContent",value:e}}function U2e(e){const{title:t,index:n}=e;return d.jsxs(m.Box,{padding:{block:8,inline:12},backgroundColor:"grey3",border:!0,borderRadius:6,alignItems:"center",justifyContent:"space-between",width:"100%",children:[d.jsxs("div",{children:[d.jsx(m.Text,{variant:"smallBold",color:"grey11",children:t??"Repeatable zone"}),d.jsxs(m.Text,{variant:"small",color:"grey11",children:[n+1," • Item"]})]}),d.jsx(m.Icon,{name:"dragIndicator",size:"small",color:"grey8"})]})}function B2e(e){const{isDropTarget:t,itemIndex:n,position:r}=e,i=t?d.jsx(m.Line,{color:"purple",thickness:2,sx:{position:"absolute",left:0,right:0,bottom:n===0&&r==="before"?0:void 0}},"line"):void 0;return d.jsx(m.AnimatedElement,{enterDuration:150,children:i})}function W2e(e){const{compositeSlice:t,content:n,onContentChange:r,sliceKey:i,id:o,readOnly:a,header:u}=e,{selected:s,selectionId:c,selection:l}=P0({sliceKey:i});function f(){i&&l.update("sliceFieldSet",i)}return d.jsxs(m.FieldSet,{id:c,selected:s,onFocus:f,legend:K2e(t),header:u,children:[d.jsx(R2e,{id:o,readOnly:a,nonRepeatableZone:t["non-repeat"]??{},content:n.nonRepeat,onContentChange:p=>{r({...n,nonRepeat:p})}}),d.jsx(bO,{id:o,readOnly:a,repeatableZone:t.repeat??{},content:n.repeat,onContentChange:p=>{r({...n,repeat:p})}})]})}function K2e(e){var t;return((t=e.config)==null?void 0:t.label)??e.fieldset??e.type}const oV={__TYPE__:"ImageContent",edit:{background:"",crop:{x:0,y:0},zoom:0},height:0,width:0,origin:{height:0,width:0,id:"",url:""},url:""};function P2e(e){const{field:t}=e;if(t.type==="Image")return oV}function D2e(e){const{content:t,legacySlice:n,sliceKey:r,id:i,readOnly:o,onContentChange:a,header:u}=e,{selected:s,selectionId:c,selection:l}=P0({sliceKey:r});function f(){r&&l.update("sliceFieldSet",r)}const p=n.type==="Group"?WC(n):er(n);return d.jsx(m.FieldSet,{id:c,selected:s,onFocus:f,legend:p,header:u,children:n.type==="Group"?d.jsx(yO,{id:i,readOnly:o,onContentChange:a,group:n,content:Ue.isGroupContent(t)?t:void 0}):d.jsx(rb,{id:i,readOnly:o,nestableWidget:n,content:Ue.isNestableContent(t)?t:void 0,onContentChange:A=>{const h=P2e({field:n});!A&&h&&a(h),A&&a(A)}})})}function N2e(e){const{content:t,id:n,slicePrimaryZone:r,onContentChange:i,readOnly:o}=e,a=R.useMemo(()=>Object.entries(r),[r]);return d.jsx(d.Fragment,{children:a.map(([u,s])=>{const c=t[u];return d.jsx(iV,{id:`${n}.${u}`,readOnly:o,widget:s,content:Ue.isSlicePrimaryContent(c)?c:void 0,onContentChange:l=>{i(q2e(t,u,l))}},u)})})}function q2e(e,t,n){return n?{...e,[t]:n}:Pl.removeKey(e,t)}function aV(e){const{config:t,content:n,sliceKey:r,readOnly:i=!1,sharedSlice:o,onContentChange:a,...u}=e,s=Q2e(o,n.variation),c=R.useId(),f={id:u.id??c,readOnly:i},{selected:p,selectionId:A,selection:h}=P0({sliceKey:r});function v(){r&&h.update("sliceFieldSet",r)}return s===void 0?null:d.jsx(j0.Provider,{value:t,children:d.jsx(m.FieldSet,{id:A,selected:p,onFocus:v,legend:V2e(o,s),children:d.jsxs(m.LazyRender,{heightEstimate:400,gap:16,keepLoaded:!0,children:[d.jsx(N2e,{...f,slicePrimaryZone:s.primary??{},content:n.primary,onContentChange:_=>{a({...n,primary:_})}}),d.jsx(bO,{...f,repeatableZone:s.items??{},content:n.items,onContentChange:_=>{a({...n,items:_})}})]})})})}function Q2e(e,t){return R.useMemo(()=>e.variations.find(n=>n.id===t),[e,t])}function V2e(e,t){return[e.name,t.name].join(" • ")}function bk(e){var s,c;const{sliceZone:t,onChange:n,slices:r,sliceContent:i}=e,o=(c=(s=t.config)==null?void 0:s.labels)==null?void 0:c[i.name];if(!o)return null;const a=o.find(l=>l.name===i.maybeLabel);function u(l){const f=r.value.map(p=>p.key===i.key?{...p,maybeLabel:l}:p);n({...r,value:f})}return d.jsxs(d.Fragment,{children:[d.jsx(m.Text,{component:"span",variant:"smallBold",children:"•"}),d.jsxs(m.DropdownMenu,{children:[d.jsx(m.DropdownMenuTrigger,{children:d.jsx(m.Button,{color:"grey",size:"small",endIcon:"arrowDropDown",invisible:!0,children:(a==null?void 0:a.display)??"Slice variation"})}),d.jsxs(m.DropdownMenuContent,{align:"start",maxHeight:256,children:[d.jsx(m.DropdownMenuItem,{onSelect:()=>u(void 0),endIcon:i.maybeLabel===void 0?d.jsx(m.Icon,{name:"check"}):void 0,children:"..."}),o==null?void 0:o.map(l=>d.jsx(m.DropdownMenuItem,{onSelect:()=>u(l.name),endIcon:l.name===i.maybeLabel?d.jsx(m.Icon,{name:"check"}):void 0,children:l.display??"[Missing display value]"},l.name))]})]})]})}function z2e(e){const{content:t,id:n,onContentChange:r,readOnly:i,sliceZone:o}=e,a=xe();return d.jsx(d.Fragment,{children:t==null?void 0:t.value.map((u,s)=>{var p,A;const c=(A=(p=o.config)==null?void 0:p.choices)==null?void 0:A[u.name];if(c===void 0)return null;const l=u.widget,f={id:`${n}[${u.key}]`,key:u.key,sliceKey:u.key,onContentChange:h=>{const v={...u,widget:h},_=H2e(t,[s,v]);r(_)},readOnly:i};return c.type==="SharedSlice"?Ue.isSharedSliceContent(l)?d.jsx(aV,{...f,config:a,sharedSlice:c,content:l}):null:c.type==="Slice"?Ue.isCompositeSliceContent(l)?d.jsx(W2e,{...f,compositeSlice:c,content:l,header:d.jsx(bk,{sliceContent:u,sliceZone:o,slices:t,onChange:r})}):null:Ue.isSimpleSliceContent(l)?d.jsx(D2e,{...f,legacySlice:c,content:l,header:d.jsx(bk,{sliceContent:u,sliceZone:o,slices:t,onChange:r})}):null})})}function H2e(e,[t,n]){return{__TYPE__:"SliceContentType",value:e.value.map((r,i)=>i===t?n:r)}}function Y2e(e){const{id:t,field:n,content:r,onContentChange:i}=e,o=Xe.useDebounceState({state:(r==null?void 0:r.value)??"",synchronize:!0}),{onEditUID:a}=R.useContext(Yq);function u(c){a();const l=Ip.slugify(c);i(Z2e(l)),o.set(l)}function s(c){u(c.clipboardData.getData("Text").trim()),c.preventDefault()}return d.jsxs(m.Field,{children:[d.jsx(m.FieldIcon,{name:"tag"}),d.jsx(m.FieldLabel,{htmlFor:t,children:er(n)}),d.jsx(m.FieldControl,{children:d.jsx(Vu,{id:t,variant:"success",placeholder:Qu(n),value:o.value,onPaste:s,onValueChange:u,endAdornment:d.jsx(m.AnimatedElement,{enterDuration:150,children:d.jsx(G2e,{uid:o.debouncedValue})})})})]})}function G2e(e){const{uid:t}=e,n=xe();return t?n.uidField?d.jsx(m.ErrorBoundary,{children:d.jsx(R.Suspense,{children:d.jsx(J2e,{uid:t})})}):null:d.jsx(m.Badge,{color:"tomato",title:"Required",size:"medium"})}function J2e(e){const t=X2e(e),n=xe();if(!t.documentId)return null;const r=_R({status:t.status,releaseId:t.releaseId,documentId:t.documentId,versionId:t.versionId,baseUrl:n.baseUrl}),i=d.jsxs(d.Fragment,{children:[d.jsxs(m.Text,{color:"tomato11",variant:"small",children:["Value already used in"," "]}),d.jsx(m.Text,{color:"tomato11",variant:"small",underline:!0,children:"another document"})]});return d.jsx(m.Badge,{color:"tomato",title:i,onClick:()=>window.open(r,"_blank"),size:"medium"})}function Z2e(e){return e===""?void 0:{__TYPE__:"UIDContent",value:e}}function X2e(e){var A,h,v,_;const{uid:t}=e,n=xe();n.uidField||Bn("uidField");const{coreApiBaseUrl:r,authStrategy:i,customTypeId:o,localeId:a,documentId:u}=n,s=W0({uid:[t]}),l=nt.useRequest(B0,[r,i,s]).results,p=Jq({customTypeId:o,languageId:a,documentsWithUid:l,documentId:u,uid:t})[0];return p?{documentId:p.id,versionId:(A=p.versions[0])==null?void 0:A.version_id,status:(h=p.versions[0])==null?void 0:h.status,releaseId:((v=p.versions[0])==null?void 0:v.status)==="release"?(_=p.versions[0])==null?void 0:_.release_id:void 0}:{}}function eBe(e){const{id:t,readOnly:n,staticZone:r,content:i,onContentChange:o}=e,a=R.useMemo(()=>Object.entries(r),[r]);return a.length===0?null:d.jsx(m.FieldSet,{legend:"Page data",children:a.map(([u,s])=>{const c={id:`${t}.${u}`,onContentChange:f=>{const{[u]:p,...A}=i;o({...A,...f!==void 0&&{[u]:f}})},readOnly:n},l=i[u];return s.type==="UID"?R.createElement(Y2e,{...c,content:Ue.isUIDContent(l)?l:void 0,key:u,field:s}):s.type==="Group"?R.createElement(yO,{...c,content:Ue.isGroupContent(l)?l:void 0,group:s,key:u}):R.createElement(rb,{...c,content:Ue.isNestableContent(l)?l:void 0,key:u,nestableWidget:s})})})}function tBe(e){const{id:t,readOnly:n,section:r,content:i,onContentChange:o}=e,[a,u]=rBe(r),[s,c]=iBe(i);return d.jsxs("div",{style:{display:"flex",flexDirection:"column",position:"relative",zIndex:0},children:[d.jsx(eBe,{id:t,readOnly:n,staticZone:a,content:s,onContentChange:l=>o({...c,...l})}),u.map(([l,f])=>{const p=c[l];return d.jsx(z2e,{id:`${t}.${l}`,readOnly:n,sliceZone:f,content:p,onContentChange:A=>o({...s,...c,[l]:A})},l)})]})}function nBe(e){return e.type==="Choice"||e.type==="Slices"}function rBe(e){return Object.entries(e).reduce(([t,n],[r,i])=>(nBe(i)?n.push([r,i]):Object.assign(t,{[r]:i}),[t,n]),[{},[]])}function iBe(e){return Object.entries(e).reduce(([t,n],[r,i])=>{const o={[r]:i};return Object.assign(Ue.isSlicesContent(i)?n:t,o),[t,n]},[{},{}])}function oBe(e){const{config:t,readOnly:n=!1,customType:r,sectionName:i,content:o,onContentChange:a}=e,u=R.useId();if(Pl.isEmpty(r.json))return null;const s=aBe(r,i),[c,l]=uBe(s,o);return d.jsx(j0.Provider,{value:t,children:d.jsx(tBe,{id:u,readOnly:n,section:s,content:c,onContentChange:f=>a({...l,...f})})})}function aBe(e,t){const n=e.json[t];if(n===void 0)throw new Error(`Cannot find a section with name '${t}'.`);return n}function uBe(e,t){return Object.entries(t).reduce(([n,r],[i,o])=>{const a=e[i]!==void 0,u={[i]:o};return[{...n,...a?u:{}},{...r,...a?{}:u}]},[{},{}])}exports.DocumentEditor=oBe;exports.EditorConfigContext=j0;exports.MediaLibrary=Hq;exports.NewMediaLibraryFeaturesBanner=aq;exports.SelectionContext=Xq;exports.SelectionManagerProvider=sq;exports.SharedSliceEditor=aV;exports.UIDContext=Yq;exports.createSearchParams=xR;exports.defaultGroupContentWithOneItem=rq;exports.defaultImageContentWidget=oV;exports.documentMetaOkType=TR;exports.documentSchema=Exe;exports.documentStatus=iq;exports.getConflictingUidDocuments=Jq;exports.getDocumentByDocumentId=Cq;exports.getDocuments=B0;exports.getDocumentsById=Sq;exports.getDocumentsByReleaseId=$xe;exports.getRepository=_q;exports.getRepositoryCustomTypes=gq;exports.getRepositoryTags=Tq;exports.getSelectionDOMId=Zq;exports.hasUIDField=Gq;exports.isMissingUID=a$e;exports.isValidSimulatorURL=Iq;exports.languageOkType=IR;exports.makeGetDocumentsQueryString=W0;exports.makeSearchFullTextDocumentsQueryString=bq;exports.prepareDocumentForSave=ATe;exports.searchDocumentStatus=oq;exports.searchFullTextDocuments=yq;exports.suppressErrors=STe;exports.throwConfigError=Bn;exports.useSelection=P0;exports.useSelectionManager=qu;
67
+ `);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[yC({find:pUe,type:this.type,getAttributes:e=>({language:e[1]})}),yC({find:AUe,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new Nr({key:new Gi("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(Ke.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.insertText(n.replace(/\r\n?/g,`
68
+ `)),a.setMeta("paste",!0),e.dispatch(a),!0}}})]}}),pg=hUe.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",St(this.options.HTMLAttributes),["code",e,0]]}}).configure({exitOnTripleEnter:!1}),mUe={fromPrismic(e){return function(t){var r;const n=Us.converter.fromPrismic(e)(pg.name,t,!0);return(r=e.nodes[pg.name])==null?void 0:r.create(oa.fromPrismic(t),n)}},toPrismic(e){return Us.converter.toPrismic(e,le.RichTextNodeType.preformatted,oa.toPrismic(e))}},gUe=new Eh([le.RichTextNodeType.preformatted],pg.name,pg,mUe,"",!0),DQ=gUe;function NQ(e){const{editor:t,getPos:n,node:r}=e,[i,o]=R.useState(!1);return R.useEffect(()=>{function a(){const{from:s,to:c}=t.state.selection,l=n(),f=n()+r.nodeSize,p=s<=l&&c>=f;o(p)}function u(){o(!1)}return t.on("blur",u),t.on("selectionUpdate",a),()=>{t.off("blur",u),t.off("selectionUpdate",a)}},[t,n,r.nodeSize]),{selected:i}}function vUe(e,t,n){const{node:r}=e,i=r.attrs.content,o=Xe.useStableCallback(e.updateAttributes),a=Xe.useDebounceState({initialState:(i==null?void 0:i.embed_url)??"",startTransition:R.startTransition});function u(l){o({content:l})}function s(l){a.set(l),$r.toURL(l)||u(void 0)}const{onKeyDown:c}=yUe(e,a.value,t,n);return{inputRef:t,containerRef:n,onKeyDown:c,url:a.value,urlChanged:s,onContentChange:u,debouncedUrl:a.debouncedValue,content:e.node.attrs.content}}function yUe(e,t,n,r){const{editor:i,getPos:o,node:a}=e,[u,s]=R.useState(!0);R.useEffect(()=>{!u||!e.editor.isFocused||m.handleEditorFlushSyncError(()=>{var l;return(l=n.current)==null?void 0:l.focus()})},[n,u,e.editor.isFocused]);function c(l){const f=o(),p=o()+a.nodeSize;l.code==="Enter"&&(s(!1),i.chain().insertContentAt(p,{type:"paragraph"}).focus(p+1).run()),l.code==="Backspace"&&t===""&&i.chain().deleteRange({from:f,to:p}).focus(p+1).run(),l.code==="ArrowUp"&&(s(!1),i.chain().focus(f-1).run()),l.code==="ArrowDown"&&(s(!1),i.chain().focus(p+1).run())}return{containerRef:r,inputRef:n,onKeyDown:c}}function bUe(e){const t=R.useRef(null),n=R.useRef(null),{onKeyDown:r,url:i,urlChanged:o,onContentChange:a,debouncedUrl:u,content:s}=vUe(e,t,n),{selected:c}=NQ(e);return d.jsx(hQ,{className:"custom-embed",children:d.jsxs("div",{contentEditable:"false",suppressContentEditableWarning:!0,children:[d.jsxs(m.Box,{flexGrow:1,alignItems:"center",children:[d.jsx(m.Icon,{size:"small",name:"cloud",color:"grey11"}),d.jsx(m.Box,{flexGrow:1,height:40,ref:n,children:d.jsx(Vu,{id:"id",ref:t,value:i,variant:$r.toURL(i)?"link":"normal",placeholder:"Paste your link here",onValueChange:o,onKeyDown:r})})]}),$r.toURL(i)&&d.jsx(t7,{selected:c,debouncedUrl:u,onContentChange:a,content:s})]})})}const MC=kn.create({name:"embed",group:"block",atom:!0,content:"block*",marks:"",addAttributes(){return{content:{default:void 0}}},addCommands(){return{setEmbed:()=>({tr:e,dispatch:t})=>{const n=this.type.create();return t&&e.replaceSelectionWith(n),!0}}},parseHTML(){return[{tag:"embed"}]},renderHTML(){return["embed"]},addNodeView(){return gQ(bUe)}}),CUe={fromPrismic(e){return function(t){var n;return(n=e.nodes[MC.name])==null?void 0:n.create({content:t.data})}},toPrismic(e){return e.attrs.content===void 0?{type:"embed",data:{type:"embed",embed_url:"",__TYPE__:"EmbedContent",all:[]}}:{type:"embed",data:{...e.attrs.content}}}},qQ=new MLe([le.RichTextNodeType.embed],MC.name,MC,CUe),SUe=kn.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]}`,St(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=>yC({find:new RegExp(`^(#{1,${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),kC="heading";function nb(e){switch(e){case 1:return le.RichTextNodeType.heading1;case 2:return le.RichTextNodeType.heading2;case 3:return le.RichTextNodeType.heading3;case 4:return le.RichTextNodeType.heading4;case 5:return le.RichTextNodeType.heading5;case 6:return le.RichTextNodeType.heading6}}function mk(e){return{fullName:nb(e),level:e}}const QQ=[1,2,3,4,5,6];function VQ(e,t=QQ){const n=new RegExp(`^heading([${t.join(",")}]){1}$`),r=e.match(n);if(!r||!r[1])return;const i=parseInt(r[1]);return{fullName:nb(i),level:i}}function zQ(e,t){const n=e.level;if(t.includes(n))return{fullName:nb(n),level:n}}const _Ue=e=>{const t=e[0]??1;return{fromPrismic(n){return function(r){var a;const i=Us.converter.fromPrismic(n)(kC,r),o=VQ(r.type,e)||mk(t);return(a=n.nodes[kC])==null?void 0:a.create({level:o.level,...oa.fromPrismic(r)},i)}},toPrismic(n){const{fullName:r}=zQ(n.attrs,e)||mk(t);return Us.converter.toPrismic(n,r,oa.toPrismic(n))}}};function IUe(e){return e?e.size?Array.from(e.values()).reduce((n,r)=>{const i=VQ(r);return i?[...n,i.level]:n},[]).sort((n,r)=>n-r):[]:QQ}function TUe(e){return SUe.extend({name:"heading"}).configure({levels:e})}const ns={name:kC,build:e=>{const t=IUe(e);if(!t)return;const n=t.map(r=>nb(r));return new LLe(n,TUe(t),t,_Ue(t),r=>{const i=zQ(r,t);return i&&`Heading ${i.level}`})}};function xUe(e){const{content:t,thumbnail:n,imageViewProps:{getPos:r,updateAttributes:i,editor:o,node:a}}=e,[u,s]=R.useTransition();function c(A){s(()=>i({content:A}))}function l(A){const h=Xh(A),v=r()+a.nodeSize;c({...t,...h}),o.chain().focus(v+1).run()}function f({croppedImages:A}){if(!t)return;const h=A[n.name];if(!h)return;const v=c7({content:t,croppedImage:h});v!==t&&c(v)}function p(){const A=r(),h=r()+a.nodeSize;o.chain().deleteRange({from:A,to:h}).focus(h).run()}return{onMediaSelected:l,onCropperDialogClose:f,isUpdating:u,updateContent:c,onClear:p}}function wUe(e){const{node:t}=e,n=t.attrs.content,{selected:r}=NQ(e),i={width:void 0,height:void 0,name:dd},{onMediaSelected:o,onCropperDialogClose:a,isUpdating:u,updateContent:s,onClear:c}=xUe({content:n,thumbnail:i,imageViewProps:e}),[l,f]=R.useState(!1),p="Feature image",A=(n==null?void 0:n.width)===0&&(n==null?void 0:n.height)===0,h=n&&!A?[`${n.width}x${n.height}px`]:[],v={thumbnail:i,contentView:n,labels:J1(i,n,n)};return d.jsx(hQ,{className:"custom-image",children:d.jsx("div",{contentEditable:"false",suppressContentEditableWarning:!0,children:d.jsx(u7,{isMediaDialogOpen:l,selected:r,onMediaSelected:o,onMediaDialogOpenChange:f,children:d.jsx(R.Suspense,{fallback:$Ue,children:n!=null&&n.url?d.jsx(g7,{allContentViews:[n],content:n,contentView:n,fieldLabel:p,id:"id",imageLabel:h,initialImages:[v],isUpdating:u,readOnly:!1,thumbnailName:i.name,onClear:c,onContentChange:s,onCropperDialogClose:a,onMediaDialogOpenChange:f}):d.jsx(i7,{fieldLabel:p,isUpdating:u,readOnly:!1,onMediaDialogOpenChange:f})})})})})}const $Ue=d.jsx("div",{style:{height:144}}),LC=kn.create({name:"image",group:"block",atom:!0,addAttributes(){return{content:{default:void 0}}},addCommands(){return{setImage:()=>e=>{const{dispatch:t,tr:n}=e,r=this.type.create();return t&&n.replaceSelectionWith(r),!0}}},parseHTML(){return[{tag:"image"}]},renderHTML({HTMLAttributes:e}){return["image",St(e)]},addNodeView(){return gQ(wUe)}}),EUe={fromPrismic(e){return function(t){var n;return(n=e.nodes[LC.name])==null?void 0:n.create({content:t.data})}},toPrismic(e){if(e.attrs.content!==void 0)return{type:"image",data:{...e.attrs.content}}}},HQ=new kLe([le.RichTextNodeType.image],LC.name,LC,EUe),RUe=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,OUe=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,FUe=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,MUe=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,kUe=Kc.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",St(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[Xm({find:RUe,type:this.type}),Xm({find:FUe,type:this.type})]},addPasteRules(){return[tg({find:OUe,type:this.type}),tg({find:MUe,type:this.type})]}});class LUe{constructor(t,n,r){$n(this,"extType",Pc.Mark);$n(this,"richTextNodeTypes",[le.RichTextNodeType.em]);this.name=t,this.component=n,this.converter=r}}const YQ="em",GQ=kUe.extend({name:YQ}),jUe={fromPrismic(e){return function(){var t;return(t=e.marks[GQ.name])==null?void 0:t.create()}},toPrismic(){}},UUe=new LUe(YQ,GQ,jUe),mO=UUe;class BUe{constructor(t,n,r){$n(this,"extType",Pc.Mark);$n(this,"richTextNodeTypes",[]);this.name=t,this.component=n,this.converter=r}}const JQ="label",jC=Kc.create({name:JQ,priority:1e3,keepOnSplit:!1,inclusive:!1,addOptions(){return{htmlAttributes:{style:"background-color: hsl(251, 89%, 96%); border: 1px dashed rgba(68, 53, 146, 0.4); border-radius: 0px 2px 2px 2px"}}},addAttributes(){return{label:{default:""}}},addCommands(){return{setLabel:e=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMark(this.name,e).run(),unsetLabel:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},renderHTML({HTMLAttributes:e}){return["span",St(this.options.htmlAttributes,e),0]}}),WUe={fromPrismic(e){return function(t){var i;const n=t.data,r={type:jC.name,label:n};return(i=e.marks[jC.name])==null?void 0:i.create(r)}},toPrismic(e){return e.attrs.label}},gO=new BUe(JQ,jC,WUe);class KUe{constructor(t,n,r){$n(this,"extType",Pc.Mark);$n(this,"richTextNodeTypes",[le.RichTextNodeType.hyperlink]);this.name=t,this.component=n,this.converter=r}}const ZQ="hyperlink",No=Kc.create({name:ZQ,priority:1e3,keepOnSplit:!1,inclusive:!1,addOptions(){return{openOnClick:!1,linkOnPaste:!0,autolink:!0,protocols:[],htmlAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null,id:""},validate:void 0}},addAttributes(){return{href:{default:""},id:{default:""},target:{default:"_blank"},rel:{default:"noopener noreferrer nofollow"},class:{default:null},media:{default:null}}},parseHTML(){return[{tag:'a[href]:not([href *= "javascript:" i])'}]},renderHTML({HTMLAttributes:e}){return["a",St(this.options.htmlAttributes,e),0]},addCommands(){return{setWebLink:e=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMark(this.name,e).setMeta("preventAutolink",!0).run(),setDocumentLink:e=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMark(this.name,e).setMeta("preventAutolink",!0).run(),setMediaLink:e=>({chain:t})=>{const n=UC(h7({media:e.media}).value);return t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMark(this.name,{media:n}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}}}),PUe={fromPrismic(e){return function(t){var r,i,o,a;const n=t.data;if(n.__TYPE__==="DocumentLink"){const u={type:No.name,id:n.id};return(r=e.marks[No.name])==null?void 0:r.create(u)}if(n.__TYPE__==="ImageLink"){const u={type:No.name,media:UC(n)};return(i=e.marks[No.name])==null?void 0:i.create(u)}if(n.__TYPE__==="FileLink"){const u={type:No.name,media:UC(n)};return(o=e.marks[No.name])==null?void 0:o.create(u)}if(n.__TYPE__==="ExternalLink"){const u={type:No.name,url:n.url,href:n.url,target:n.target};return(a=e.marks[No.name])==null?void 0:a.create(u)}}},toPrismic(e){return e.attrs.media?eV(e.attrs.media):e.attrs.id?{__TYPE__:"DocumentLink",id:e.attrs.id}:{__TYPE__:"ExternalLink",url:e.attrs.href,target:e.attrs.target}}},XQ=new KUe(ZQ,No,PUe);function UC(e){return JSON.stringify(e)}function eV(e){return JSON.parse(e)}const DUe=kn.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",St(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)}}}),gk=Kc.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:e=>e.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["span",St(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:e,commands:t})=>{const n=XR(e,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:t.unsetMark(this.name)}}}}),vk=/^(\d+)\.\s$/,NUe=kn.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return t===1?["ol",St(this.options.HTMLAttributes,n),0]:["ol",St(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(DUe.name,this.editor.getAttributes(gk.name)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=eg({find:vk,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=eg({find:vk,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(gk.name)}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1],editor:this.editor})),[e]}}),BC=NUe.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",St(this.options.HTMLAttributes,n),0]:["ol",St(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"}),qUe={fromPrismic(e){return function(t){var r;const n=Wl.converter.fromPrismic(e)(t);if(n)return(r=e.nodes[BC.name])==null?void 0:r.create(oa.fromPrismic(t),n)}},toPrismic(e){return js.children.map(e,t=>Wl.converter.toPrismic(t,le.RichTextNodeType.orderedList).filter(to.isDefined)).flat()}},QUe=new cO([le.RichTextNodeType.orderedList],BC.name,BC,qUe),Ag=QUe,tV=[lO,mO,XQ,gO];function nV(e){return[aa,dg,Ag,ns.build(e),DQ,qQ,HQ,...tV].filter(to.isDefined)}const rV=[{nodeType:le.RichTextNodeType.paragraph,icon:"textFields",isActive:e=>e.isActive(aa.name)&&!e.isActive(dg.name)&&!e.isActive(Ag.name),runCommands:Ot((e,t)=>e.clearNodes().setDirection(gi(t))),shortText:"par",text:"Paragraph"},{nodeType:le.RichTextNodeType.heading1,icon:"looks1",isActive:e=>e.isActive(ns.name,{level:1}),runCommands:Ot((e,t)=>e.setHeading({level:1}).setDirection(gi(t))),shortText:"h1",text:"Heading 1"},{nodeType:le.RichTextNodeType.heading2,icon:"looks2",isActive:e=>e.isActive(ns.name,{level:2}),runCommands:Ot((e,t)=>e.setHeading({level:2}).setDirection(gi(t))),shortText:"h2",text:"Heading 2"},{nodeType:le.RichTextNodeType.heading3,icon:"looks3",isActive:e=>e.isActive(ns.name,{level:3}),runCommands:Ot((e,t)=>e.setHeading({level:3}).setDirection(gi(t))),shortText:"h3",text:"Heading 3"},{nodeType:le.RichTextNodeType.heading4,icon:"looks4",isActive:e=>e.isActive(ns.name,{level:4}),runCommands:Ot((e,t)=>e.setHeading({level:4}).setDirection(gi(t))),shortText:"h4",text:"Heading 4"},{nodeType:le.RichTextNodeType.heading5,icon:"looks5",isActive:e=>e.isActive(ns.name,{level:5}),runCommands:Ot((e,t)=>e.setHeading({level:5}).setDirection(gi(t))),shortText:"h5",text:"Heading 5"},{nodeType:le.RichTextNodeType.heading6,icon:"looks6",isActive:e=>e.isActive(ns.name,{level:6}),runCommands:Ot((e,t)=>e.setHeading({level:6}).setDirection(gi(t))),shortText:"h6",text:"Heading 6"},{nodeType:le.RichTextNodeType.list,icon:"formatListBulleted",isActive:e=>e.isActive(dg.name),runCommands:Ot((e,t)=>e.toggleBulletList().setDirection(gi(t))),shortText:"bull",text:"Bulleted list"},{nodeType:le.RichTextNodeType.orderedList,icon:"formatListNumbered",isActive:e=>e.isActive(Ag.name),runCommands:Ot((e,t)=>e.toggleOrderedList().setDirection(gi(t))),shortText:"num",text:"Numbered list"},{nodeType:le.RichTextNodeType.preformatted,icon:"dataObject",isActive:e=>e.isActive(DQ.name),runCommands:Ot((e,t)=>e.setCodeBlock().setDirection(gi(t))),shortText:"code",text:"Code"},{nodeType:le.RichTextNodeType.embed,icon:"cloud",isActive:e=>e.isActive(qQ.name),runCommands:Ot(e=>e.setEmbed()),shortText:"emb",text:"Embed"},{nodeType:le.RichTextNodeType.image,icon:"image",isActive:e=>e.isActive(HQ.name),runCommands:Ot(e=>e.setImage()),shortText:"img",text:"Image"}],VUe=[{nodeType:le.RichTextNodeType.strong,icon:"formatBold",isActive:e=>e.isActive(lO.name),runCommands:Ot(e=>e.toggleBold())},{nodeType:le.RichTextNodeType.em,icon:"formatItalic",isActive:e=>e.isActive(mO.name),runCommands:Ot(e=>e.toggleItalic())}],zUe=[{nodeType:le.RichTextNodeType.rtl,icon:"formatTextDirectionRToL",isActive:e=>e.isActive({[Vo]:ls}),runCommands:Ot((e,t)=>e.toggleDirection(gi(t)))}];function Ot(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)),n.can?HUe(t,r,e):e(r,t).run()}}function gi(e){const t=e.state.selection.$from.parent.attrs;return oa.parseNodeAttrsDirection(t)}function fm(e,t){return e.filter(n=>t.includes(n.nodeType))}function HUe(e,t,n){try{return n(t,e).run()}catch{return!1}}function YUe(e){const{items:t,editor:n}=e;return t.length===0?null:d.jsxs(d.Fragment,{children:[d.jsx(m.ToolbarSeparator,{}),t.map(r=>d.jsx(m.ToolbarToggleButton,{disabled:!r.runCommands(n,{can:!0}),onPressedChange:()=>{r.runCommands(n)},pressed:r.isActive(n),startIcon:r.icon},r.nodeType))]})}function GUe(e){const{labels:t,editor:n}=e,r=n.getAttributes("label").label;return d.jsxs(d.Fragment,{children:[d.jsx(m.ToolbarSeparator,{}),d.jsxs(m.DropdownMenu,{children:[d.jsx(m.DropdownMenuTrigger,{disabled:t.length===0,children:d.jsx(m.Button,{endIcon:"arrowDropDown",size:"small",color:"grey",children:yk(r??"Labels")})}),d.jsx(m.DropdownMenuContent,{align:"start",asPortal:!1,maxHeight:256,avoidCollisions:!1,children:t.map((i,o)=>{const a=r===i;return d.jsx(m.DropdownMenuItem,{onSelect:()=>a?n.commands.unsetLabel():JUe(n,i),endIcon:a&&d.jsx(m.Icon,{name:"check",size:"extraSmall"}),children:yk(i)},`${i}-${o}`)})})]})]})}function JUe(e,t){Ot(r=>r.setLabel({label:t}))(e)}function yk(e){return Ip.overflow(e,20)}function ZUe(e){const{editor:t}=e,n=t.getAttributes("label");if(!n.label)return null;const r=n.label;return d.jsx(m.Box,{backgroundColor:"purple9",padding:{block:2,inline:4},alignItems:"center",borderRadius:{topLeft:2,topRight:2,bottomRight:2},maxWidth:125,children:d.jsx(m.Text,{color:"white",variant:"small",noWrap:!0,children:r})})}function XUe(e){const{disabled:t,showWebLinkModal:n,showDocumentsLinkModal:r,showMediaLinkModal:i}=e2e(e);return d.jsxs(d.Fragment,{children:[d.jsx(m.ToolbarSeparator,{}),d.jsxs(m.ToolbarButtonGroup,{density:"compact",children:[d.jsx(m.ToolbarButton,{disabled:t,startIcon:"link",onClick:n},le.RichTextNodeType.hyperlink),d.jsxs(m.DropdownMenu,{children:[d.jsx(m.DropdownMenuTrigger,{children:d.jsx(m.ToolbarButton,{startIcon:"arrowDropDown"})}),d.jsxs(m.DropdownMenuContent,{align:"end",asPortal:!1,children:[d.jsx(m.DropdownMenuItem,{startIcon:d.jsx(m.Icon,{name:"public"}),onSelect:n,children:"Link to web page"}),d.jsx(m.DropdownMenuItem,{startIcon:d.jsx(m.Icon,{name:"description"}),onSelect:r,children:"Link to document"}),d.jsx(m.DropdownMenuItem,{startIcon:d.jsx(m.Icon,{name:"image"}),onSelect:i,children:"Link to media"})]})]})]})]})}function e2e(e){const{editor:t,setModal:n}=e;function r(){n("webLink")}function i(){n("documentLink")}function o(){n("mediaLink")}return{disabled:!Ot(u=>u.setWebLink({href:""}))(t,{can:!0}),showWebLinkModal:r,showDocumentsLinkModal:i,showMediaLinkModal:o}}function t2e(e){const{docId:t,onEdit:n,onUnlink:r}=e,i=n2e(t),o=Te();if(!i)return null;const a=i.versions[0],u=_R({status:a==null?void 0:a.status,releaseId:(a==null?void 0:a.status)==="release"?a.release_id:void 0,documentId:i.id,versionId:a==null?void 0:a.version_id,baseUrl:o.baseUrl}),s=(a==null?void 0:a.preview_summary)??"",c=(a==null?void 0:a.custom_type_label)??"";return d.jsx(m.LinkDescriptionCard,{url:u,title:i.title,subTitle:c,description:s,onEdit:n,onUnlink:r,largeIconName:"description"})}function n2e(e){const t=Te();t.searchDocuments||Bn("searchDocuments");const{coreApiBaseUrl:n,authStrategy:r}=t;return nt.useRequest(bq,[n,r,e])}function r2e(e){const{editor:t}=e,{searchDocuments:n}=Te(),r=t.getAttributes(le.RichTextNodeType.hyperlink);if(r.id&&n){const i=r.id;return d.jsx(i2e,{docId:i,...e})}if(r.href){const i=r.href;return d.jsx(o2e,{url:i,...e})}if(r.media){const i=eV(r.media);return d.jsx(a2e,{media:i,...e})}return null}function i2e(e){const{editor:t,onEditDocumentLink:n,docId:r}=e;return d.jsx(m.ErrorBoundary,{renderError:()=>d.jsx(m.LinkDescriptionCard,{url:"",title:"Failed to Load Linked Document Data",subTitle:"",error:!0,onEdit:n,onUnlink:()=>ys(t)}),children:d.jsx(R.Suspense,{fallback:d.jsx(m.LinkDescriptionCard,{url:"",title:"",subTitle:"",loading:!0,onEdit:n,onUnlink:()=>ys(t)}),children:d.jsx(t2e,{docId:r,onEdit:n,onUnlink:()=>ys(t)})})})}function o2e(e){const{url:t,editor:n,onEditWebLink:r}=e,i=$r.toURL(t);return i?d.jsx(m.LinkDescriptionCard,{url:t,title:$r.getUrlTitle(i),subTitle:t,onEdit:r,onUnlink:()=>ys(n)}):d.jsx(m.LinkDescriptionCard,{url:t,title:"",subTitle:t,onEdit:r,onUnlink:()=>ys(n)})}function a2e(e){const{media:t,editor:n,onEditMediaLink:r}=e;return t.__TYPE__==="ImageLink"?d.jsx(m.LinkImageCard,{url:t.url,title:t.name,subTitle:`${t.width} x ${t.height} pixels`,onEdit:r,onUnlink:()=>ys(n)}):t.__TYPE__==="FileLink"?d.jsx(m.LinkDescriptionCard,{url:t.url,title:t.name,subTitle:u2e({filename:t.name}),onEdit:r,onUnlink:()=>ys(n),largeIconName:"insertDriveFile"}):null}function ys(e){Ot(n=>n.unsetLink())(e)}function u2e(e){const{filename:t}=e,n=t.split(".").pop();return n?n.toLowerCase():""}function s2e(e){const{open:t}=e,{onOpenChange:n,onSelectDocument:r}=c2e(e);return d.jsx(f7,{open:t,onOpenChange:n,onSelectDocument:r})}function c2e(e){const{editor:t,setOpen:n}=e;function r(o){Ot(u=>u.extendMarkRange(le.RichTextNodeType.hyperlink).setDocumentLink({id:o}))(t),n(!1)}function i(o){n(o)}return{onSelectDocument:r,onOpenChange:i}}function l2e(e){const{open:t}=e,{onOpenChange:n,onMediaSelected:r}=f2e(e);return d.jsx(RR,{open:t,onOpenChange:n,onMediaSelected:r,assetType:"all"})}function f2e(e){const{editor:t,setOpen:n}=e;function r(i){Ot(a=>a.extendMarkRange(le.RichTextNodeType.hyperlink).setMediaLink({media:i}))(t),n(!1)}return{onMediaSelected:r,onOpenChange:n}}function d2e(e){const{open:t,setOpen:n}=e,{url:r,setUrl:i,openInNewTab:o,setOpenInNewTab:a,disabled:u,onUpdate:s}=p2e(e);return d.jsxs(m.Dialog,{open:t,onOpenChange:n,size:"small",children:[d.jsx(m.DialogHeader,{title:"Set Link URL"}),d.jsxs(m.DialogContent,{padding:16,children:[d.jsx(m.FormInput,{value:r,onValueChange:i,placeholder:"Paste URL",icon:"public"}),r&&d.jsx(m.CheckboxLabel,{value:"Open in new tab",children:d.jsx(m.Checkbox,{checked:o,onCheckedChange:a})})]}),d.jsxs(m.DialogActions,{children:[d.jsx(m.DialogCancelButton,{}),d.jsx(m.DialogActionButton,{onClick:s,disabled:u,children:"Update"})]})]})}function p2e(e){const{editor:t,open:n,setOpen:r}=e,i=A2e(t),[o,a]=R.useState(i.url),[u,s]=R.useState(i.openInNewTab);Xe.useOnChange(n,()=>{n&&(a(i.url),s(i.openInNewTab))});const c=!o||o===i.url&&u===i.openInNewTab;function l(){const f=u?"_blank":"_self";Ot(p=>p.extendMarkRange(le.RichTextNodeType.hyperlink).setWebLink({href:o,target:f}))(t),r(!1)}return{url:o,setUrl:a,openInNewTab:u,disabled:c,setOpenInNewTab:s,onUpdate:l}}function A2e(e){const t=e.getAttributes(le.RichTextNodeType.hyperlink);return{url:t.href??"",openInNewTab:t.target==="_blank"}}function h2e(e){const{items:t,editor:n}=e;return t.length===0?null:d.jsxs(d.Fragment,{children:[d.jsx(m.ToolbarSeparator,{}),d.jsx(m.ToolbarToggleButtonGroup,{onValueChange:r=>{t.forEach(i=>{(i.isActive(n)&&!r.includes(i.nodeType)||!i.isActive(n)&&r.includes(i.nodeType))&&i.runCommands(n)})},type:"multiple",value:t.filter(r=>r.isActive(n)).map(r=>r.nodeType),children:t.map(r=>d.jsx(m.ToolbarToggleButtonGroupItem,{disabled:!r.runCommands(n,{can:!0}),startIcon:r.icon,value:r.nodeType},r.nodeType))},"mark")]})}function m2e(e){var r;const{items:t,editor:n}=e;return t.length===0?null:d.jsxs(m.DropdownMenu,{children:[d.jsx(m.DropdownMenuTrigger,{disabled:t.length===1,children:d.jsx(m.Button,{endIcon:"arrowDropDown",size:"small",color:"grey",children:((r=t.find(i=>i.isActive(n)))==null?void 0:r.text)??""})}),d.jsx(m.DropdownMenuContent,{align:"start",asPortal:!1,maxHeight:256,avoidCollisions:!1,children:t.map(i=>d.jsx(m.DropdownMenuItem,{onSelect:()=>{i.runCommands(n)},children:i.text},i.nodeType))})]})}function _1(e){return{duration:100,hideOnClick:!0,offset:e,placement:"top-start",appendTo:document.querySelector("body > div")??"parent"}}function g2e(e){const{editor:t,nodeTypes:n,labels:r}=e,[i,o]=R.useState(),a=n.includes(le.RichTextNodeType.hyperlink),u=!i,{shouldShowBubbleMenu:s,shouldshowPopover:c}=y2e({editor:t}),[l,f]=R.useState(!0);R.useEffect(()=>{f(!1)},[]);function p(v){o(v?"webLink":void 0)}function A(v){o(v?"documentLink":void 0)}function h(v){o(v?"mediaLink":void 0)}return l?null:d.jsxs(d.Fragment,{children:[d.jsx(p1,{editor:t,tippyOptions:_1([-48,0]),shouldShow:s,children:u&&d.jsx(v2e,{editor:t,nodeTypes:n,labels:r,setModal:o})}),d.jsx(p1,{editor:t,tippyOptions:_1([-48,0]),shouldShow:v=>c(v,"hyperlink"),children:u&&d.jsx(r2e,{editor:t,onEditWebLink:()=>o("webLink"),onEditDocumentLink:()=>o("documentLink"),onEditMediaLink:()=>o("mediaLink")})}),d.jsx(p1,{editor:t,tippyOptions:_1([0,0]),shouldShow:v=>c(v,"label"),children:d.jsx(ZUe,{editor:t})}),a&&d.jsxs(d.Fragment,{children:[d.jsx(d2e,{open:i==="webLink",setOpen:p,editor:t}),d.jsx(s2e,{open:i==="documentLink",setOpen:A,editor:t}),d.jsx(l2e,{open:i==="mediaLink",setOpen:h,editor:t})]})]})}function v2e(e){const{editor:t,nodeTypes:n,labels:r,setModal:i}=e,o=n.includes("hyperlink"),a=r.length>0,u=fm(rV,n),s=fm(VUe,n),c=fm(zUe,n),l=u.length+s.length+c.length+Number(o);return l===0?null:d.jsxs(m.Toolbar,{children:[d.jsx(m2e,{items:u,editor:t}),a&&d.jsx(GUe,{labels:r,editor:t}),d.jsx(h2e,{items:s,editor:t}),o&&d.jsx(XUe,{editor:t,setModal:i}),d.jsx(YUe,{items:c,editor:t}),l>1&&d.jsxs(d.Fragment,{children:[d.jsx(m.ToolbarSeparator,{}),d.jsx(m.ToolbarButton,{onClick:()=>{t.chain().focus().clearNodes().unsetAllMarks().run()},startIcon:"formatClear"},"clear")]})]})}function y2e(e){const{editor:t}=e;function n(i){const{view:o,state:a,from:u,to:s}=i;if(!o.hasFocus())return!1;const{doc:c,selection:l}=a;return!(t.isActive(le.RichTextNodeType.preformatted)||l.empty||c.textBetween(u,s).length===0)}function r(i,o){const{view:a,state:u,from:s,to:c}=i,l=a.state.doc.nodeAt(s),{doc:f,selection:p}=u;return!p.empty||f.textBetween(s,c).length>0?!1:!!(l!=null&&l.marks.some(h=>h.type.name===o))}return{shouldShowBubbleMenu:n,shouldshowPopover:r}}function b2e(e){const{content:t,field:n,id:r,readOnly:i}=e,o=C2e(n),a=t&&xC.converter(o.nodeExtensions).fromPrismic(o.schema,o.nodeTypes,t),u=Xe.useStableCallback(e.onContentChange),s=m.useEditor({content:a==null?void 0:a.toJSON(),editable:!i,editorProps:{attributes:{class:`${m.contentEditableClass} ${m.contentEditableMultilinePlaceholderClass}`,id:r,tabIndex:"0"}},extensions:o.allComponents,injectCSS:!1,onUpdate({editor:c}){if(c.isEmpty)return u(void 0);const l=xC.converter(o.nodeExtensions).toPrismic(c.state.doc);u(l)}},[o,i]);return d.jsxs(m.Field,{children:[d.jsx(m.FieldLabel,{htmlFor:r,children:er(n)}),d.jsxs(m.FieldControl,{children:[s.isEditable&&d.jsx(g2e,{editor:s,nodeTypes:o.names.concat(nUe),labels:o.labels}),d.jsx(CLe,{editor:s,style:{flexGrow:1}})]})]})}function C2e(e){var n,r;const t=`${((n=e.config)==null?void 0:n.multi)??""}-${((r=e.config)==null?void 0:r.single)??""}`;return R.useMemo(()=>{var h;const{extensions:i,nodeTypes:o}=ULe(e.config),a=i.filter(S2e),u=i.flatMap(v=>v.richTextNodeTypes),s=i.map(v=>v.component),c=i.filter(_2e).map(v=>v.name),l=[...s,...cUe(e,a),rUe.configure({supportedExtensionNames:c}),jMe],f=l.map(v=>v.name),p=tMe(l),A=I2e((h=e.config)==null?void 0:h.labels);return{allComponents:l,extensionNames:f,nodeTypes:o,nodeExtensions:a,names:u,schema:p,labels:A}},[t])}function S2e(e){return e.extType===Pc.Node}function _2e(e){return!(e.extType!==Pc.Node||e.nodeType!==Al.Text||e.lockedFormat)}function I2e(e){return Array.from(e??[])}function T2e(e){var p,A;const{content:t,field:n,id:r,readOnly:i,onContentChange:o}=e,{placeholder:a,options:u}=n.config??{},s=!!(u!=null&&u.includes("")),c=$2e(n),l=x2e({content:t,placeholder:a,defaultValue:c,canHaveEmptyValue:s}),f=a&&c===void 0;return d.jsxs(m.Field,{children:[d.jsx(m.FieldIcon,{name:"arrowDropDownCircle"}),d.jsx(m.FieldLabel,{htmlFor:r,children:er(n)}),d.jsx(m.FieldControl,{children:d.jsxs(m.Select,{id:r,size:"large",color:"grey",value:l,disabled:i,renderTrigger:()=>d.jsx(m.SelectGhostTrigger,{id:r}),onValueChange:h=>{o(w2e({value:h,placeholder:a}))},children:[f&&d.jsx(m.SelectItem,{value:a,children:a}),(A=(p=n.config)==null?void 0:p.options)==null?void 0:A.map(h=>d.jsx(m.SelectItem,{value:h||vO,children:h},h))]})})]})}function x2e(e){const{content:t,placeholder:n,defaultValue:r,canHaveEmptyValue:i}=e;let{value:o}=t??{};return o===""&&i?vO:(o===""&&(o=void 0),o??r??n)}function w2e(e){const{placeholder:t}=e;let{value:n}=e;if(n!==t)return n===vO&&(n=""),{__TYPE__:"FieldContent",type:"Select",value:n}}function $2e(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]}const vO=" ";function E2e(e){const{id:t,readOnly:n,field:r,content:i,onContentChange:o}=e,a=i!=null&&i.value?PC.dateFromISOString(i.value):void 0;return d.jsxs(m.Field,{children:[d.jsx(m.FieldIcon,{name:"event"}),d.jsx(m.FieldLabel,{id:t,children:er(r)}),d.jsx(m.FieldControl,{children:d.jsx(m.Box,{padding:{left:4,right:12},width:"100%",flexDirection:"column",justifyContent:"center",children:d.jsx(m.DateInput,{mode:"date-time","aria-labelledby":t,disabled:n,value:a,onValueChange:u=>o(R2e(u))})})})]})}function R2e(e){if(e)return{__TYPE__:"FieldContent",type:"Timestamp",value:O2e(e)}}function O2e(e){const t=`${e.getUTCFullYear()}`.padStart(4,"0"),n=`${e.getUTCMonth()+1}`.padStart(2,"0"),r=`${e.getUTCDate()}`.padStart(2,"0"),i=`${e.getUTCHours()}`.padStart(2,"0"),o=`${e.getUTCMinutes()}`.padStart(2,"0");return`${t}-${n}-${r}T${i}:${o}:00+00:00`}function rb(e){const{id:t,readOnly:n,content:r,nestableWidget:i}=e,o=Xe.useStableCallback(e.onContentChange);return R.useMemo(()=>{const a={id:t,readOnly:n,onContentChange:o};return i.type==="Boolean"?d.jsx(f$e,{...a,field:i,content:Ue.isBooleanContent(r)?r:void 0}):i.type==="Date"?d.jsx(h$e,{...a,field:i,content:Ue.isDateContent(r)?r:void 0}):i.type==="Timestamp"?d.jsx(E2e,{...a,field:i,content:Ue.isTimestampContent(r)?r:void 0}):i.type==="Image"?d.jsx(CEe,{...a,field:i,content:Ue.isImageContent(r)?r:void 0}):i.type==="Link"?d.jsx(m7,{...a,field:i,content:Ue.isLinkContent(r)?r:void 0}):i.type==="Number"?d.jsx(BEe,{...a,field:i,content:Ue.isNumberContent(r)?r:void 0}):i.type==="StructuredText"?d.jsx(b2e,{...a,field:i,content:Ue.isRichTextContent(r)?r:void 0}):i.type==="Select"?d.jsx(T2e,{...a,field:i,content:Ue.isSelectContent(r)?r:void 0}):i.type==="Text"?d.jsx(jEe,{...a,field:i,content:Ue.isTextContent(r)?r:void 0}):i.type==="Embed"?d.jsx(x$e,{...a,field:i,content:Ue.isEmbedContent(r)?r:void 0}):i.type==="Color"?d.jsx(p$e,{...a,field:i,content:Ue.isColorContent(r)?r:void 0}):i.type==="GeoPoint"?d.jsx(w$e,{...a,field:i,content:Ue.isGeoPointContent(r)?r:void 0}):i.type==="IntegrationFields"?d.jsx(LEe,{...a,field:i,content:Ue.isIntegrationFieldContent(r)?r:void 0}):null},[r,t,i,o,n])}function F2e(e){const{content:t,id:n,nonRepeatableZone:r,onContentChange:i,readOnly:o}=e,a=R.useMemo(()=>Object.entries(r),[r]);return d.jsx(d.Fragment,{children:a.map(([u,s])=>{const c=t[u];return d.jsx(rb,{id:`${n}.${u}`,readOnly:o,nestableWidget:s,content:Ue.isNestableContent(c)?c:void 0,onContentChange:l=>{i(M2e(t,u,l))}},u)})})}function M2e(e,t,n){return n?{...e,[t]:n}:Pl.removeKey(e,t)}function yO(e){var o,a;const{group:t,content:n,onContentChange:r,...i}=e;return d.jsx(bO,{...i,title:WC(t),addItemButtonTitle:`Add item in "${WC(t)}"`,repeatable:((o=t.config)==null?void 0:o.repeat)!==!1,repeatableZone:((a=t.config)==null?void 0:a.fields)??{},content:n==null?void 0:n.value,onContentChange:u=>{r({__TYPE__:"GroupContentType",value:u})}})}function WC(e){var t;return((t=e.config)==null?void 0:t.label)??e.fieldset??e.type}function iV(e){const{id:t,readOnly:n,content:r,widget:i}=e,o=Xe.useStableCallback(e.onContentChange);return R.useMemo(()=>{const a={id:t,readOnly:n,onContentChange:o};return i.type==="Group"?d.jsx(yO,{...a,group:i,content:Ue.isGroupContent(r)?r:void 0}):d.jsx(rb,{...a,nestableWidget:i,content:Ue.isNestableContent(r)?r:void 0})},[r,t,i,o,n])}function bO(e){const{id:t,title:n,addItemButtonTitle:r,content:i,onContentChange:o,readOnly:a,repeatable:u=!0,repeatableZone:s}=e,c=Object.entries(s);let l=i??[j2e];!u&&l.length>1&&(l=l.slice(0,1));const{scrollOffsetTop:f}=Te(),p=R.useRef(new WeakMap);k2e(p.current,l);function A(T){return p.current.get(T)??"!bugged!"}function h(){o(l.concat(KC()))}function v(T){const{index:g,offset:C}=T;o(gn.move(l,g,g+C))}function _(T){const{index:g}=T;o(gn.removeIndex(l,g))}function S(T){o(T)}function I(T,g,C,y){const x=B2e(T,[C,y]),w=U2e(l,[g,x]);L2e(p.current,T,x),o(w)}return Object.keys(s).length===0?null:d.jsx(m.Group,{title:n??"Repeatable zone",addItemButtonTitle:r??"Add item in repeatable zone",items:l,maxItems:u?void 0:1,getItemKey:A,onAddItem:h,dnd:{scrollOffsetTop:f,onReorder:S,renderDragPreview:({index:T})=>d.jsx(W2e,{title:n??"Repeatable zone",index:T}),renderDropIndicator:K2e},children:(T,g)=>{const C=new Map(T.value),y=A(T);return d.jsx(m.LazyRender,{keepLoaded:!0,children:d.jsx(m.GroupItem,{index:g,title:`${g+1} • Item`,onMove:v,onDelete:_,children:c.map(([x,w])=>d.jsx(iV,{id:`${t}[${y}].${x}`,content:C.get(x),widget:w,onContentChange:M=>I(T,g,x,M),readOnly:a},x))})})}})}function k2e(e,t){t.forEach(n=>{e.has(n)||e.set(n,mV.uniqueNumber())})}function L2e(e,t,n){const r=e.get(t);r!==void 0&&e.set(n,r)}const j2e={__TYPE__:"GroupItemContent",value:[]};function U2e(e,t){const[n,r]=t;return r?e.map((i,o)=>o===n?r:i):e.filter((i,o)=>o!==n)}function B2e(e,t){const[n,r]=t;if(!r){const o=e.value.filter(([a])=>a!==n);return KC(o)}const i=Array.from(new Map(e.value).set(n,r));return KC(i)}function KC(e=[]){return{__TYPE__:"GroupItemContent",value:e}}function W2e(e){const{title:t,index:n}=e;return d.jsxs(m.Box,{padding:{block:8,inline:12},backgroundColor:"grey3",border:!0,borderRadius:6,alignItems:"center",justifyContent:"space-between",width:"100%",children:[d.jsxs("div",{children:[d.jsx(m.Text,{variant:"smallBold",color:"grey11",children:t??"Repeatable zone"}),d.jsxs(m.Text,{variant:"small",color:"grey11",children:[n+1," • Item"]})]}),d.jsx(m.Icon,{name:"dragIndicator",size:"small",color:"grey8"})]})}function K2e(e){const{isDropTarget:t,itemIndex:n,position:r}=e,i=t?d.jsx(m.Line,{color:"purple",thickness:2,sx:{position:"absolute",left:0,right:0,bottom:n===0&&r==="before"?0:void 0}},"line"):void 0;return d.jsx(m.AnimatedElement,{enterDuration:150,children:i})}function P2e(e){const{compositeSlice:t,content:n,onContentChange:r,sliceKey:i,id:o,readOnly:a,header:u}=e,{selected:s,selectionId:c,selection:l}=P0({sliceKey:i});function f(){i&&l.update("sliceFieldSet",i)}return d.jsxs(m.FieldSet,{id:c,selected:s,onFocus:f,legend:D2e(t),header:u,children:[d.jsx(F2e,{id:o,readOnly:a,nonRepeatableZone:t["non-repeat"]??{},content:n.nonRepeat,onContentChange:p=>{r({...n,nonRepeat:p})}}),d.jsx(bO,{id:o,readOnly:a,repeatableZone:t.repeat??{},content:n.repeat,onContentChange:p=>{r({...n,repeat:p})}})]})}function D2e(e){var t;return((t=e.config)==null?void 0:t.label)??e.fieldset??e.type}const oV={__TYPE__:"ImageContent",edit:{background:"",crop:{x:0,y:0},zoom:0},height:0,width:0,origin:{height:0,width:0,id:"",url:""},url:""};function N2e(e){const{field:t}=e;if(t.type==="Image")return oV}function q2e(e){const{content:t,legacySlice:n,sliceKey:r,id:i,readOnly:o,onContentChange:a,header:u}=e,{selected:s,selectionId:c,selection:l}=P0({sliceKey:r});function f(){r&&l.update("sliceFieldSet",r)}const p=n.type==="Group"?WC(n):er(n);return d.jsx(m.FieldSet,{id:c,selected:s,onFocus:f,legend:p,header:u,children:n.type==="Group"?d.jsx(yO,{id:i,readOnly:o,onContentChange:a,group:n,content:Ue.isGroupContent(t)?t:void 0}):d.jsx(rb,{id:i,readOnly:o,nestableWidget:n,content:Ue.isNestableContent(t)?t:void 0,onContentChange:A=>{const h=N2e({field:n});!A&&h&&a(h),A&&a(A)}})})}function Q2e(e){const{content:t,id:n,slicePrimaryZone:r,onContentChange:i,readOnly:o}=e,a=R.useMemo(()=>Object.entries(r),[r]);return d.jsx(d.Fragment,{children:a.map(([u,s])=>{const c=t[u];return d.jsx(iV,{id:`${n}.${u}`,readOnly:o,widget:s,content:Ue.isSlicePrimaryContent(c)?c:void 0,onContentChange:l=>{i(V2e(t,u,l))}},u)})})}function V2e(e,t,n){return n?{...e,[t]:n}:Pl.removeKey(e,t)}function aV(e){const{config:t,content:n,sliceKey:r,readOnly:i=!1,sharedSlice:o,onContentChange:a,...u}=e,s=z2e(o,n.variation),c=R.useId(),f={id:u.id??c,readOnly:i},{selected:p,selectionId:A,selection:h}=P0({sliceKey:r});function v(){r&&h.update("sliceFieldSet",r)}return s===void 0?null:d.jsx(j0.Provider,{value:t,children:d.jsx(m.FieldSet,{id:A,selected:p,onFocus:v,legend:H2e(o,s),children:d.jsxs(m.LazyRender,{heightEstimate:400,gap:16,keepLoaded:!0,children:[d.jsx(Q2e,{...f,slicePrimaryZone:s.primary??{},content:n.primary,onContentChange:_=>{a({...n,primary:_})}}),d.jsx(bO,{...f,repeatableZone:s.items??{},content:n.items,onContentChange:_=>{a({...n,items:_})}})]})})})}function z2e(e,t){return R.useMemo(()=>e.variations.find(n=>n.id===t),[e,t])}function H2e(e,t){return[e.name,t.name].join(" • ")}function bk(e){var s,c;const{sliceZone:t,onChange:n,slices:r,sliceContent:i}=e,o=(c=(s=t.config)==null?void 0:s.labels)==null?void 0:c[i.name];if(!o)return null;const a=o.find(l=>l.name===i.maybeLabel);function u(l){const f=r.value.map(p=>p.key===i.key?{...p,maybeLabel:l}:p);n({...r,value:f})}return d.jsxs(d.Fragment,{children:[d.jsx(m.Text,{component:"span",variant:"smallBold",children:"•"}),d.jsxs(m.DropdownMenu,{children:[d.jsx(m.DropdownMenuTrigger,{children:d.jsx(m.Button,{color:"grey",size:"small",endIcon:"arrowDropDown",invisible:!0,children:(a==null?void 0:a.display)??"Slice variation"})}),d.jsxs(m.DropdownMenuContent,{align:"start",maxHeight:256,children:[d.jsx(m.DropdownMenuItem,{onSelect:()=>u(void 0),endIcon:i.maybeLabel===void 0?d.jsx(m.Icon,{name:"check"}):void 0,children:"..."}),o==null?void 0:o.map(l=>d.jsx(m.DropdownMenuItem,{onSelect:()=>u(l.name),endIcon:l.name===i.maybeLabel?d.jsx(m.Icon,{name:"check"}):void 0,children:l.display??"[Missing display value]"},l.name))]})]})]})}function Y2e(e){const{content:t,id:n,onContentChange:r,readOnly:i,sliceZone:o}=e,a=Te();return d.jsx(d.Fragment,{children:t==null?void 0:t.value.map((u,s)=>{var p,A;const c=(A=(p=o.config)==null?void 0:p.choices)==null?void 0:A[u.name];if(c===void 0)return null;const l=u.widget,f={id:`${n}[${u.key}]`,key:u.key,sliceKey:u.key,onContentChange:h=>{const v={...u,widget:h},_=G2e(t,[s,v]);r(_)},readOnly:i};return c.type==="SharedSlice"?Ue.isSharedSliceContent(l)?d.jsx(aV,{...f,config:a,sharedSlice:c,content:l}):null:c.type==="Slice"?Ue.isCompositeSliceContent(l)?d.jsx(P2e,{...f,compositeSlice:c,content:l,header:d.jsx(bk,{sliceContent:u,sliceZone:o,slices:t,onChange:r})}):null:Ue.isSimpleSliceContent(l)?d.jsx(q2e,{...f,legacySlice:c,content:l,header:d.jsx(bk,{sliceContent:u,sliceZone:o,slices:t,onChange:r})}):null})})}function G2e(e,[t,n]){return{__TYPE__:"SliceContentType",value:e.value.map((r,i)=>i===t?n:r)}}function J2e(e){const{id:t,field:n,content:r,onContentChange:i}=e,o=Xe.useDebounceState({state:(r==null?void 0:r.value)??"",synchronize:!0}),{onEditUID:a}=R.useContext(Yq);function u(c){a();const l=Ip.slugify(c);i(eBe(l)),o.set(l)}function s(c){u(c.clipboardData.getData("Text").trim()),c.preventDefault()}return d.jsxs(m.Field,{children:[d.jsx(m.FieldIcon,{name:"tag"}),d.jsx(m.FieldLabel,{htmlFor:t,children:er(n)}),d.jsx(m.FieldControl,{children:d.jsx(Vu,{id:t,variant:"success",placeholder:Qu(n),value:o.value,onPaste:s,onValueChange:u,endAdornment:d.jsx(m.AnimatedElement,{enterDuration:150,children:d.jsx(Z2e,{uid:o.debouncedValue})})})})]})}function Z2e(e){const{uid:t}=e,n=Te();return t?n.uidField?d.jsx(m.ErrorBoundary,{children:d.jsx(R.Suspense,{children:d.jsx(X2e,{uid:t})})}):null:d.jsx(m.Badge,{color:"tomato",title:"Required",size:"medium"})}function X2e(e){const t=tBe(e),n=Te();if(!t.documentId)return null;const r=_R({status:t.status,releaseId:t.releaseId,documentId:t.documentId,versionId:t.versionId,baseUrl:n.baseUrl}),i=d.jsxs(d.Fragment,{children:[d.jsxs(m.Text,{color:"tomato11",variant:"small",children:["Value already used in"," "]}),d.jsx(m.Text,{color:"tomato11",variant:"small",underline:!0,children:"another document"})]});return d.jsx(m.Badge,{color:"tomato",title:i,onClick:()=>window.open(r,"_blank"),size:"medium"})}function eBe(e){return e===""?void 0:{__TYPE__:"UIDContent",value:e}}function tBe(e){var A,h,v,_;const{uid:t}=e,n=Te();n.uidField||Bn("uidField");const{coreApiBaseUrl:r,authStrategy:i,customTypeId:o,localeId:a,documentId:u}=n,s=W0({uid:[t]}),l=nt.useRequest(B0,[r,i,s]).results,p=Jq({customTypeId:o,languageId:a,documentsWithUid:l,documentId:u,uid:t})[0];return p?{documentId:p.id,versionId:(A=p.versions[0])==null?void 0:A.version_id,status:(h=p.versions[0])==null?void 0:h.status,releaseId:((v=p.versions[0])==null?void 0:v.status)==="release"?(_=p.versions[0])==null?void 0:_.release_id:void 0}:{}}function nBe(e){const{id:t,readOnly:n,staticZone:r,content:i,onContentChange:o}=e,a=R.useMemo(()=>Object.entries(r),[r]);return a.length===0?null:d.jsx(m.FieldSet,{legend:"Page data",children:a.map(([u,s])=>{const c={id:`${t}.${u}`,onContentChange:f=>{const{[u]:p,...A}=i;o({...A,...f!==void 0&&{[u]:f}})},readOnly:n},l=i[u];return s.type==="UID"?R.createElement(J2e,{...c,content:Ue.isUIDContent(l)?l:void 0,key:u,field:s}):s.type==="Group"?R.createElement(yO,{...c,content:Ue.isGroupContent(l)?l:void 0,group:s,key:u}):R.createElement(rb,{...c,content:Ue.isNestableContent(l)?l:void 0,key:u,nestableWidget:s})})})}function rBe(e){const{id:t,readOnly:n,section:r,content:i,onContentChange:o}=e,[a,u]=oBe(r),[s,c]=aBe(i);return d.jsxs("div",{style:{display:"flex",flexDirection:"column",position:"relative",zIndex:0},children:[d.jsx(nBe,{id:t,readOnly:n,staticZone:a,content:s,onContentChange:l=>o({...c,...l})}),u.map(([l,f])=>{const p=c[l];return d.jsx(Y2e,{id:`${t}.${l}`,readOnly:n,sliceZone:f,content:p,onContentChange:A=>o({...s,...c,[l]:A})},l)})]})}function iBe(e){return e.type==="Choice"||e.type==="Slices"}function oBe(e){return Object.entries(e).reduce(([t,n],[r,i])=>(iBe(i)?n.push([r,i]):Object.assign(t,{[r]:i}),[t,n]),[{},[]])}function aBe(e){return Object.entries(e).reduce(([t,n],[r,i])=>{const o={[r]:i};return Object.assign(Ue.isSlicesContent(i)?n:t,o),[t,n]},[{},{}])}function uBe(e){const{config:t,readOnly:n=!1,customType:r,sectionName:i,content:o,onContentChange:a}=e,u=R.useId();if(Pl.isEmpty(r.json))return null;const s=sBe(r,i),[c,l]=cBe(s,o);return d.jsx(j0.Provider,{value:t,children:d.jsx(rBe,{id:u,readOnly:n,section:s,content:c,onContentChange:f=>a({...l,...f})})})}function sBe(e,t){const n=e.json[t];if(n===void 0)throw new Error(`Cannot find a section with name '${t}'.`);return n}function cBe(e,t){return Object.entries(t).reduce(([n,r],[i,o])=>{const a=e[i]!==void 0,u={[i]:o};return[{...n,...a?u:{}},{...r,...a?{}:u}]},[{},{}])}exports.DocumentEditor=uBe;exports.EditorConfigContext=j0;exports.MediaLibrary=Hq;exports.NewMediaLibraryFeaturesBanner=aq;exports.SelectionContext=Xq;exports.SelectionManagerProvider=sq;exports.SharedSliceEditor=aV;exports.UIDContext=Yq;exports.createSearchParams=xR;exports.defaultGroupContentWithOneItem=rq;exports.defaultImageContentWidget=oV;exports.documentMetaOkType=TR;exports.documentSchema=Exe;exports.documentStatus=iq;exports.getConflictingUidDocuments=Jq;exports.getDocumentByDocumentId=bq;exports.getDocuments=B0;exports.getDocumentsById=Cq;exports.getRepository=_q;exports.getRepositoryCustomTypes=gq;exports.getRepositoryTags=Tq;exports.getSelectionDOMId=Zq;exports.hasUIDField=Gq;exports.isMissingUID=s$e;exports.isValidSimulatorURL=Iq;exports.languageOkType=IR;exports.makeGetDocumentsQueryString=W0;exports.makeSearchFullTextDocumentsQueryString=yq;exports.prepareDocumentForSave=ATe;exports.searchDocumentStatus=oq;exports.searchFullTextDocuments=vq;exports.suppressErrors=STe;exports.throwConfigError=Bn;exports.useSelection=P0;exports.useSelectionManager=qu;